Logo Search packages:      
Sourcecode: bg5ps version File versions

gbtou8.c

/*
 * $Log: gbtou8.c,v $
 * Revision 1.1  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    gb_in[];

long gbtou8(unsigned int gbin)
{
  unsigned int c1,c2;
  
  c2 = gbin & 0xFF;
  c1 = (gbin >> 8) & 0xFF;
  
  if ((c1&0x80) == 0)
    return( c1);
  else 
    return(gb_in[(c1 - 0xa1)*94 + (c2&0x7f) - 0x21]);
  
  return(0);
}

Generated by  Doxygen 1.6.0   Back to index