[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] ttfautohint and FT_Sfnt_Table_Info
From: |
Werner LEMBERG |
Subject: |
[ft-devel] ttfautohint and FT_Sfnt_Table_Info |
Date: |
Mon, 14 Mar 2011 05:10:26 +0100 (CET) |
Folks,
I've meanwhile started with coding on my ttfautohint project, but
right now it's under heavy development attacks and not really
something you want to look at. Note that I've started with the
framework first, this is, the code to split a font into its SFNT
tables (this is finished) and to build a TTF or TTC again (this is to
come these days).
http://repo.or.cz/w/ttfautohint.git
The reason why I write to this list at this time is that I've fixed a
deficiency in the FT_Sfnt_Table_Info function: Up to FreeType version
2.4.4, this function returned FT_Err_Table_Missing for two cases:
Either the given table index is invalid, or the table is empty. The
latter doesn't happen in `good' TTFs, but Windows, for example,
handles such fonts gracefully, simply ignoring empty SFNT tables, and
so does FreeType.
An unfortunate consequence was that this loop
while (FT_Sfnt_Table_Info(face, idx, &tag, &len)
!= FT_Err_Table_Missing)
{
...
}
could exit prematurely. To fix that, the git repository (and thus the
forthcoming version 2.4.5) now contains an improved version of
FT_Sfnt_Table_Info which can return the number of SFNT tables also:
error = FT_Sfnt_Table_Info(face, 0, NULL, &num_tables);
if (error) { ... }
for (i = 0; i < num_tables; i++)
{
error = FT_Sfnt_Table_Info(face, idx, &tag, &len);
if (error == FT_Err_Table_Missing) { ... }
...
}
Werner
- [ft-devel] ttfautohint and FT_Sfnt_Table_Info,
Werner LEMBERG <=