lilypond-devel
[Top][All Lists]
Advanced

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

FT_ENCODING_NONE in CVS 2006-10-21


From: Werner LEMBERG
Subject: FT_ENCODING_NONE in CVS 2006-10-21
Date: Sat, 21 Oct 2006 07:43:23 +0200 (CEST)

Looking into lilypond's lily/ttf.cc I see this:

  FT_CharMap current_cmap = face->charmap;
  FT_Select_Charmap(face, FT_ENCODING_NONE);

  int j = 0;
  for (charcode = FT_Get_First_Char (face, &gindex); gindex != 0;
       charcode = FT_Get_Next_Char (face, charcode, &gindex))
    {
      m[gindex] = charcode;
      j++;
    }
  FT_Set_Charmap (face, current_cmap);

What shall this code do?  Selecting FT_ENCODING_NONE with
FT_Select_Charmap gives an undefined result: In an SFNT based font, it
selects the first cmap which FreeType doesn't support.  With other
words, you get a completely unpredictable mapping between character
codes and glyph indices.

Right now I'm thinking whether I should disallow FT_ENCODING_NONE as
an argument to FT_Select_Charmap at all...


    Werner




reply via email to

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