summaryrefslogtreecommitdiff
path: root/src/type42/t42objs.c
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2015-08-08 08:39:45 +0200
committerWerner Lemberg <wl@gnu.org>2015-08-08 08:39:45 +0200
commitbd75a517dcf87b620e8dd7fcd07992b881f0e234 (patch)
treee86c40f0e9570af4ee2e96a537f00dccbb7e9421 /src/type42/t42objs.c
parente5f4469359560913da8a87cf4831e3e5dee30f93 (diff)
downloadfreetype2-bd75a517dcf87b620e8dd7fcd07992b881f0e234.tar.gz
[type42] Fix glyph access.
This is a severe bug: We've missed one level of indirection, as described in the Type 42 specification. As a result, ftview sometimes showed incorrect glyphs for given glyph names, and even displayed `error 0x0006' (invalid argument!) in case the number of glyph indices differed between the Type 42 font and the embedded TTF. Apparently, noone ever noticed it; this shows how much Type 42 fonts are in use... * src/type42/t42objs.c (T42_GlyphSlot_Load): Map Type 42 glyph index to embedded TTF's glyph index.
Diffstat (limited to 'src/type42/t42objs.c')
-rw-r--r--src/type42/t42objs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c
index 2756adfee..01b271f8c 100644
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -652,11 +652,16 @@
FT_Error error;
T42_GlyphSlot t42slot = (T42_GlyphSlot)glyph;
T42_Size t42size = (T42_Size)size;
+ T42_Face t42face = (T42_Face)size->face;
FT_Driver_Class ttclazz = ((T42_Driver)glyph->face->driver)->ttclazz;
FT_TRACE1(( "T42_GlyphSlot_Load: glyph index %d\n", glyph_index ));
+ /* map T42 glyph index to embedded TTF's glyph index */
+ glyph_index = (FT_UInt)ft_atol(
+ (const char *)t42face->type1.charstrings[glyph_index] );
+
t42_glyphslot_clear( t42slot->ttslot );
error = ttclazz->load_glyph( t42slot->ttslot,
t42size->ttsize,