freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Freetype, fontconfig,Xft, Mozilla and Non-BMP char. support


From: Yao Zhang
Subject: [Devel] Freetype, fontconfig,Xft, Mozilla and Non-BMP char. support
Date: Mon, 2 Dec 2002 16:42:39 -0500 (EST)

Antoine Leca wrote:

> Presently, open_face() scans through all charmaps, retaining all that
> are Unicode encodings. And of course, the last one wins.

Although this is a good default behavior, you still should warn the
application developers who use the default unicode cmap may get
something they don't like.  Actually, as demonstrated in the
FreeType 2.0 Tutorial, the reliable way to get the the right
cmap is by

    FT_CharMap  found = 0;
    FT_CharMap  charmap;
    int         n;

    for ( n = 0; n < face->num_charmaps; n++ )
    {
      charmap = face->charmaps[n];
      if ( charmap->platform_id == my_platform_id &&
           charmap->encoding_id == my_encoding_id )
      {
        found = charmap;
        break;
      }
    }

    if ( !found ) { ... }

    /* now, select the charmap for the face object */
    error = FT_Set_CharMap( face, found );
    if ( error ) { ... }

The problem with the above code is that a application needs to know
about (platform_id, encoding_id) pair.

In my opinion there is no need to change FreeType: its interface is
sufficient for the purpose.  It is Xft/fontconfig needs to be changed
to use FT_Set_CharMap() after open_face().

Regards,

Yao Zhang



reply via email to

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