freetype
[Top][All Lists]
Advanced

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

RE: [Freetype] ft_encoding_none


From: Turner, David
Subject: RE: [Freetype] ft_encoding_none
Date: Wed, 13 Oct 2004 10:28:46 +0200

> Am I right in assuming that if you set the character map 
> encoding to an invalid value or explicitly to ft_encoding_none then freetype 
> will use the first encoding in the character map list to get the font indices?
> 
> If so, is this by design or by accident? Can I rely on this?
> 

No, if you pass an invalid or unsupported encoding value to FT_Select_Charmap,
the function will simply do nothing and return an error code.

When a font is loaded, FreeType automatically searches for a Unicode charmap
and selects it if any. Otherwise, it selects the first available charmap in
the font's list.

If you want to mimic this behaviout in your application, you can do something
like:

  error = FT_Set_Charmap( face, FT_ENCODING_UNICODE );
  if ( error && face->num_charmaps > 0 )
    FT_Set_Charmap( face, face->charmaps[0] );


And by the way, the value FT_ENCODING_NONE (a.k.a. ft_encoding_none, a.k.a. 0)
is reserved, and is never supported by any font.

That's it, and we're not going to make it any easier for lazy people :-)

- David Turner
- The FreeType Project  (www.freetype.org)

> 
> Henry
> 
> 
> _______________________________________________
> Freetype mailing list
> address@hidden
> http://www.freetype.org/mailman/listinfo/freetype
> 



reply via email to

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