[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Freetype] display Kanji
From: |
Achim Mueller |
Subject: |
[Freetype] display Kanji |
Date: |
Fri, 27 Dec 2002 14:57:28 +0100 |
Hi,
I want to display Text in Kanji. But since the symbols are split into 13
TTF files KANJIA.TTF to KANJIL.TTF I want to create a lookup table which
symbol is in which file. The idea was to iterate with Get_First_Char and
Get_Next_Char over the charmaps to create this unified mapping table.
My problem is now, that this works well with e.g. VERDANA.TTF but not
with the required KANJI fonts.
mvError = FT_Init_FreeType( &mLibrary );
if ( mvError ) {return FAILED;}
mvError = FT_New_Memory_Face( mLibrary,
( const FT_Byte * ) data.cchrptr(),
data.length(), 0, &mFace );
if ( mvError ) {return FAILED;}
//FT_Select_Charmap( mFace, FT_ENCODING_MS_SJIS );
//FT_Select_Charmap( mFace, FT_ENCODING_UNICODE );
//FT_Select_Charmap( mFace, FT_ENCODING_MS_BIG5 );
FT_UInt FirstGlyphCode;
FT_ULong FirstCharCode = FT_Get_First_Char( mFace, &FirstGlyphCode );
cout << FirstCharCode << ",\t";
while ( FirstGlyphCode != 0 )
{
FirstCharCode = FT_Get_Next_Char( mFace,
FirstCharCode, &FirstGlyphCode );
cout << FirstCharCode << ",\t";
};
With the KANJI fonts or even the simple 1-file KANA.TTF font the
iterator returns always 0. And a brute force lookup does it either.
FT_UInt gi = FT_Get_Char_Index( mFace, 0x4ee0 );
cout << "char 0x4ee0 -> glyph: " << gi << "\n";
Any approach is welcome.
achim
amueller.vcf
Description: Card for Achim Mueller
- [Freetype] display Kanji,
Achim Mueller <=