Preliminary implemetation for NSConvertGlyphsToPackedGlyphs().

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16616 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2003-05-02 19:01:07 +00:00
parent 294b552583
commit 1ef9efe907

View file

@ -1012,6 +1012,36 @@ int NSConvertGlyphsToPackedGlyphs(NSGlyph *glBuf,
NSMultibyteGlyphPacking packing,
char *packedGlyphs)
{
// TODO
return 0;
int i;
int j;
j = 0;
for (i = 0; i < count; i++)
{
NSGlyph g = glBuf[i];
switch (packing)
{
case NSOneByteGlyphPacking:
packedGlyphs[j++] = (char)(g & 0xFF);
break;
case NSTwoByteGlyphPacking:
packedGlyphs[j++] = (char)((g & 0xFF00) >> 8) ;
packedGlyphs[j++] = (char)(g & 0xFF);
break;
case NSFourByteGlyphPacking:
packedGlyphs[j++] = (char)((g & 0xFF000000) >> 24) ;
packedGlyphs[j++] = (char)((g & 0xFF0000) >> 16);
packedGlyphs[j++] = (char)((g & 0xFF00) >> 8) ;
packedGlyphs[j++] = (char)(g & 0xFF);
break;
case NSJapaneseEUCGlyphPacking:
case NSAsciiWithDoubleByteEUCGlyphPacking:
default:
// FIXME
break;
}
}
return j;
}