Until now I used a texture (bitmapfont) for font rendering, but I'm trying to get freetype2 working. All my strings are SHIFT_JIS encoded and my only Problem is now to get from freetype the right glyph to a proper SHIFT_JIS bitsequence. But it seems harder than I expected. To example "亜" has the charcode "0x889F" (byte 1 is set to 136 and byte 2 is 159) - that's according to the SHIFT_JIS encoding. So I called the function:
FT_Select_Charmap(face, FT_ENCODING_SJIS);
and try then to load a glyph with that charcode:
FT_Load_Char(face, 0x889F, FT_LOAD_RENDER );
But I receive some random glyph. It cant be a font-specific problem, because I tried already different fonts with the same result (and yeah, they provide a shift-jis charmap). To example "0" (zero) should be at position 0x0030 - but its in fact at 0x002D. Not all characters have an constant offset of 3, otherwise there would be no problem... I think my "FT_Load_Char" call, pass the charcode parameter in a wrong way - but cant guess how it would be right. Already tried:
FT_Load_Char(face, FT_Get_Char_Index(face, 0x889F), FT_LOAD_RENDER );
But then I receive another random glyph. So, how can I pass the charcode to FT_Load_Char if not the default charmap is selected?
Any advice would be really helpful. Thank you.