From 91d0f1ebbe214379f2bb87f1709c350400fa9f61 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sun, 25 Jul 2004 08:43:35 +0000 Subject: [PATCH] * src/sfnt/sfobjs.c (sfnt_load_face): Handle TT_NAME_ID_PREFERRED_FAMILY and TT_NAME_ID_PREFERRED_SUBFAMILY. * src/cff/cffload.c (cff_font_load): Always create inverse mapping. Even if the charstring count id different from the CID count, it is still possible that the font uses a different CID -> GID mapping. --- ChangeLog | 11 +++++++++++ src/cff/cffload.c | 4 +--- src/sfnt/sfobjs.c | 13 ++++++++++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55647cc48..4265a78ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-07-25 Kornfeld Eliyahu Peter + + * src/sfnt/sfobjs.c (sfnt_load_face): Handle + TT_NAME_ID_PREFERRED_FAMILY and TT_NAME_ID_PREFERRED_SUBFAMILY. + +2004-07-24 Derek B. Noonburg + + * src/cff/cffload.c (cff_font_load): Always create inverse mapping. + Even if the charstring count id different from the CID count, it is + still possible that the font uses a different CID -> GID mapping. + 2004-07-23 Werner Lemberg * src/truetype/ttobjs.c (tt_face_init): Accept 0x00020000 format tag diff --git a/src/cff/cffload.c b/src/cff/cffload.c index 350e01f3f..340a5993c 100644 --- a/src/cff/cffload.c +++ b/src/cff/cffload.c @@ -2239,11 +2239,9 @@ /* read the Charset and Encoding tables if available */ if ( font->num_glyphs > 0 ) { - FT_Bool invert; + FT_Bool invert = dict->cid_registry != 0xFFFFU; - invert = dict->cid_registry != 0xFFFFU && - font->charstrings_index.count != dict->cid_count; error = cff_charset_load( &font->charset, font->num_glyphs, stream, base_offset, dict->charset_offset, invert ); if ( error ) diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index aef3f5dfb..641c83f1e 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -509,9 +509,16 @@ goto Exit; face->root.family_name = tt_face_get_name( face, - TT_NAME_ID_FONT_FAMILY ); - face->root.style_name = tt_face_get_name( face, - TT_NAME_ID_FONT_SUBFAMILY ); + TT_NAME_ID_PREFERRED_FAMILY ); + if ( !face->root.family_name ) + face->root.family_name = tt_face_get_name( face, + TT_NAME_ID_FONT_FAMILY ); + + face->root.style_name = tt_face_get_name( face, + TT_NAME_ID_PREFERRED_SUBFAMILY ); + if ( !face->root.style_name ) + face->root.style_name = tt_face_get_name( face, + TT_NAME_ID_FONT_SUBFAMILY ); /* now set up root fields */ {