freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Freetype] Re: how can I display accented characters?


From: tech_related
Subject: [Freetype] Re: how can I display accented characters?
Date: Mon, 27 Nov 2000 00:40:56 GMT

Hello Werner,

Thank you for your reply.

>Usually, latin1 is used on UNIX boxes.

Yes, that's the character encoding that I use on my computer.

>If the charmap is (3,1),
>Unicode will be selected, and you directly use latin1 since the range
>0x00-0xFF is almost equivalent to U+0000 to U+00FF.

Do you mean that a call to FT_Get_Char_Index(ftface, 'á') should work since the 
charcode of 'á' under Latin-1 is the same
as under Unicode?

I *think* I am using the Unicode charmap, since these are .ttf files from 
Windows and the tutorial says that, when a Unicode
charmap is available, it is used by default after a call to FT_New_Face().

But I can't use the charcodes used "natively" by my system in calls to 
FT_Get_Char_Index(): it always returns zero if the
charcode refers to an accented character on my system.

I thought that perhaps the font file included a more compatible charmap, so I 
tried accessing them using this code:

for(i=0; i<ftface->num_charmaps; i++)
{
errors=FT_Set_Charmap(ftface,ftface->charmaps[i]);
index=FT_Get_Char_Index(ftface,'á');
printf("errors=%d, index=%d\n", errors,index);
}

It seems that the .ttf files under Win98 contain three different charmaps, and 
this program outputs:

errors: 0, index: 0
errors: 0, index: 0
errors: 0, index: 0

If I got this right, I just tried accessing the glyph for 'á' using all the 
three available charmaps (one of them must be
Unicode, since the "times.ttf" was imported from Win98), and all calls to 
FT_Get_Char_Index(ftface,'á') failed; why does
this happen?

As you suggested, calling FT_Get_Char_Index() using the Unicode value for 'á' 
(0xE1) works flawlessly when I use the "default"
charmap that FT_New_Face() chooses (probably Unicode).

I am rather confused; is there any charmap in the .ttf files from Windows that 
I can use without using iconv to perform the
charcode tranlation

Latin-1 -> Unicode

before calling FT_Get_Char_Index()? Do European users of FreeType usually solve 
this problem by resorting to iconv? Or are
there other options?

Thank you,

Manuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]