|
From: | Stathis |
Subject: | Re: [Freetype] render greek characters |
Date: | Wed, 21 Jul 2004 16:09:32 +0200 |
User-agent: | Mozilla Thunderbird 0.7.2 (Windows/20040707) |
Werner LEMBERG wrote:
I am trying to render greek text on top of a bitmap. I use standard arial.ttf of windows2000 (I tried other fonts also), which from what I know contains the greek glyphs. Unfortunately I can only render latin characters and any greek ones come up as a white square. I tried setting a lot of different combinations of charmaps/encodings in FT, but still there doesn't seem to be any proper outcome from those changes.Hmm, trying with ftview -e unic 20 arial.ttf from the ft2demos package and moving up to character code 0x384 I can see Greek glyphs. With other words, selecting the Unicode charmap and using input codes of 0x384 you get what you want. Apparently you are doing something wrong.
Certainly I am missing something. What I did initially was to hardcode the text in greek like char* text = "κειμενο" and set the charmap to Unicode. Then I have a function that loops over each of those characters and with FT_Load_Char(face, text[index], FT_LOAD_RENDER) I try to retrieve the respective glyph. It appears that I have to convert my text somehow so the lookup can happen, but I do not know how. I understand it's not a freetype question this, but if this is the problem how can I convert these characters to Unicode, if they aren't?
Right now everything is hardcoded, so there is no possibility for the user to select the font, and also set the script, which seems to be what needs to be done. Is that the problem? If so is there a way to do this programmatically?It looks as if you are describing problems with a certain program. Which one?
It's a custom win32 application rendering text over bitmaps, nothing special. I could do it the windows way, but this hinders portability, so I would prefer to use freetype.
Werner PS: Note that in my arial.ttf version (from 2000), kern pairs are not in a `kern' table but in the GPOS table. The logical consequence is that newer arial.ttf versions have a similar layout. GPOS is not supported by FreeType directly; you have to use Pango, Qt, or ICU to access it (or you parse the GPOS table directly).
I guess that's something to consider once I get to render something useful. I am not very literate with font jargon and text formats/conversions, so bare with me. Thanks for your help and feel free to point me to any documentation you think can help me figure it out.
_______________________________________________ Freetype mailing list address@hidden http://www.freetype.org/mailman/listinfo/freetype
--stathis
[Prev in Thread] | Current Thread | [Next in Thread] |