freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Re: Character mapping - HELP?


From: Tom Kacvinsky
Subject: [Devel] Re: Character mapping - HELP?
Date: Mon, 5 Mar 2001 12:03:16 -0500 (EST)

Don't pass the Unicode code to FT_Get_Char_Index *unless* the current charmap is
a Unicode charmap.  Pass the actual char code for theta instead.  The function
FT_Get_Char_Index takes the char code supplied and, using the current charmap,
finds the appropriate glyph index.  A return of 0 means the char code is to be
rendered as .notdef (a usually "empty" glyph).

Also, shouldn't you be calling FT_Load_Glyph as follows?

    error = FT_Load_Glyph( face, glyph_index, FT_LOAD_DEFAULT );

Tom

On Mon, 5 Mar 2001, Niels A. Moseley wrote:

> Hi,
>
> I'm trying to mimic the Win32 GDI text routines..
>
> >If you know you have the correct char map selected, the most likely
> culprit is
> >that you are not passing the correct char code.
> >We would need to see sample code to see what is wrong.  Can you pass on to us
> >a minimal code snippet that exhibits the problem?
>
> I do something like this:
>
> void TextSupport::SetupGlyphs(unsigned short Unicode, ft_encoding encoding)
> {
>       FT_Error error;
>       unsigned short glyph_index;
>
>       FT_Select_Charmap(face, encoding);                              // 
> select correct charmap
>
>       glyph_index = FT_Get_Char_Index(face, Unicode);         // this returns 
> '0'
>
>       error = FT_Load_Glyph( face, glyph->index, FT_LOAD_DEFAULT );
>
>       ...extra processing...
>       ...blah blah...
> }
>
> Unicode == 113 which should render as a 'theta' ..
> However.. Windows seems to have its own idea about mappings.
> I suspect that windows uses it's own ASCII->Unicode mapping tables as soon
> as the WIN32 LOGFONT16 structure indicates anything but UNICODE mapping,
> like CHARSET_SYMBOL or CHARSET_ANSI etc.
>
> I think it is more a Windows problem than a freetype thing...
>
> Cheers, Niels.
>
>




reply via email to

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