* src/autofit/aflatin.c (af_latin_metrics_init): fixing bug #12212
(auto-hinter refuses to work if no Unicode charmap in font)
This commit is contained in:
parent
fe5c906e9c
commit
8d4ccf5384
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
* src/otvalid/{otvgsub.c, otvgpos.c}: making static tables constant
|
* src/otvalid/{otvgsub.c, otvgpos.c}: making static tables constant
|
||||||
|
|
||||||
|
* src/autofit/aflatin.c (af_latin_metrics_init): fixing bug #12212
|
||||||
|
(auto-hinter refuses to work if no Unicode charmap in font)
|
||||||
|
|
||||||
2005-03-05 Werner Lemberg <wl@gnu.org>
|
2005-03-05 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
* autogen.sh: New script for bootstrapping.
|
* autogen.sh: New script for bootstrapping.
|
||||||
|
|
|
@ -377,23 +377,38 @@
|
||||||
af_latin_metrics_init( AF_LatinMetrics metrics,
|
af_latin_metrics_init( AF_LatinMetrics metrics,
|
||||||
FT_Face face )
|
FT_Face face )
|
||||||
{
|
{
|
||||||
FT_Error error;
|
FT_Error error = 0;
|
||||||
FT_CharMap oldmap = face->charmap;
|
FT_CharMap oldmap = face->charmap;
|
||||||
|
FT_UInt ee;
|
||||||
|
|
||||||
|
static const FT_Encoding latin_encodings[] =
|
||||||
|
{
|
||||||
|
FT_ENCODING_UNICODE,
|
||||||
|
FT_ENCODING_APPLE_ROMAN,
|
||||||
|
FT_ENCODING_ADOBE_STANDARD,
|
||||||
|
FT_ENCODING_ADOBE_LATIN_1,
|
||||||
|
FT_ENCODING_NONE /* end of list */
|
||||||
|
};
|
||||||
|
|
||||||
/* do we have a Unicode charmap in there? */
|
|
||||||
error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
|
|
||||||
if ( error )
|
|
||||||
goto Exit;
|
|
||||||
|
|
||||||
metrics->units_per_em = face->units_per_EM;
|
metrics->units_per_em = face->units_per_EM;
|
||||||
|
|
||||||
af_latin_metrics_init_widths( metrics, face );
|
/* do we have a latin charmap in there? */
|
||||||
af_latin_metrics_init_blues( metrics, face );
|
for ( ee = 0; latin_encodings[ee] != FT_ENCODING_NONE; ee++ )
|
||||||
|
{
|
||||||
|
error = FT_Select_Charmap( face, latin_encodings[ee] );
|
||||||
|
if (!error)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !error )
|
||||||
|
{
|
||||||
|
af_latin_metrics_init_widths( metrics, face );
|
||||||
|
af_latin_metrics_init_blues( metrics, face );
|
||||||
|
}
|
||||||
|
|
||||||
Exit:
|
|
||||||
FT_Set_Charmap( face, oldmap );
|
FT_Set_Charmap( face, oldmap );
|
||||||
return error;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue