Logo Search packages:      
Sourcecode: bg5ps version File versions

b5tou8.c

/*
 * $Log: b5tou8.c,v $
 * Revision 1.2  2000/02/14 18:16:53  platin
 *
 * Modify ttf2psm.c and add gb_in.c/gbtou8.c to make
 * ttf2psm support multibyte char rendering. At this time,
 * GB and BIG5 aupport were added.
 *
 *
 */

#include "utf.h"

extern      unsigned short    b5_in[];

long
b5tou8(unsigned int b5in)
{
      unsigned int      c1, c2;

      c2 = b5in & 0xFF;
      c1 = (b5in >> 8) & 0xFF;
      if ((c1&0x80) == 0)
            return( c1);
      else {
            c2 -= c2 >= 0xa1 ? (0xa1 - 63) : 0x40;
            return(b5_in[(c1 - 0xa1)*157 + c2]);
      }
      return(0);
}

Generated by  Doxygen 1.6.0   Back to index