From 3188a3a112b7448f2cb7c48d7c3ecf13208d70e0 Mon Sep 17 00:00:00 2001 From: David Turner Date: Sun, 13 Feb 2000 13:34:18 +0000 Subject: [PATCH] Sorry, forgot some changes needed to get rid of t1encode.[hc]. Here they come.. --- src/type1/rules.mk | 1 - src/type1/t1driver.c | 4 ++-- src/type1/t1gload.c | 9 +++++---- src/type1/t1load.c | 23 +++++++++++++++++------ 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/type1/rules.mk b/src/type1/rules.mk index 794ea0a9a..dba40a250 100644 --- a/src/type1/rules.mk +++ b/src/type1/rules.mk @@ -101,7 +101,6 @@ T1_DRV_SRC := $(T1_DIR_)t1objs.c \ $(T1_DIR_)t1parse.c \ $(T1_DIR_)t1tokens.c \ $(T1_DIR_)t1driver.c \ - $(T1_DIR_)t1encode.c \ $(T1_DIR_)t1hinter.c \ $(T1_DIR_)t1afm.c \ $(T1_DIR_)t1gload.c diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c index f129d479a..486e03c67 100644 --- a/src/type1/t1driver.c +++ b/src/type1/t1driver.c @@ -435,8 +435,8 @@ sizeof( T1_GlyphSlotRec ), "type1", - 1, - 2, + 100, + 200, 0, /* format interface */ diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c index 379870371..a24cfb92c 100644 --- a/src/type1/t1gload.c +++ b/src/type1/t1gload.c @@ -17,7 +17,6 @@ #include #include -#include #include #ifndef T1_CONFIG_OPTION_DISABLE_HINTER @@ -182,14 +181,16 @@ T1_Int lookup_glyph_by_stdcharcode( T1_Face face, T1_Int charcode ) { - T1_Int n; - const T1_String* glyph_name; + T1_Int n; + const T1_String* glyph_name; + PSNames_Interface* psnames = (PSNames_Interface*)face->psnames; /* check range of standard char code */ if (charcode < 0 || charcode > 255) return -1; - glyph_name = t1_standard_strings[t1_standard_encoding[charcode]]; + glyph_name = psnames->adobe_std_strings( + psnames->adobe_std_encoding[charcode]); for ( n = 0; n < face->type1.num_glyphs; n++ ) { diff --git a/src/type1/t1load.c b/src/type1/t1load.c index d8971cc8c..13e341846 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -1,7 +1,6 @@ #include #include -#include #include #include #include @@ -985,6 +984,7 @@ T1_Font* type1 = &face->type1; FT_Memory memory = face->root.memory; T1_Table* strings = &parser->table; + PSNames_Interface* psnames = (PSNames_Interface*)face->psnames; T1_Int num_glyphs; T1_Int n; T1_Error error; @@ -1010,6 +1010,12 @@ FREE( strings->elements ); FREE( strings->lengths ); + if (!psnames) + { + FT_ERROR(( "T1.Parse.Finalise : PSNames module missing !!\n" )); + return T1_Err_Unimplemented_Feature; + } + /* Compute encoding if required. */ if (parser->encoding_type == t1_encoding_none) { @@ -1033,13 +1039,13 @@ switch (parser->encoding_type) { case t1_encoding_standard: - index = t1_standard_encoding[n]; - names = (T1_String**)t1_standard_strings; + index = psnames->adobe_std_encoding[n]; + names = 0; break; case t1_encoding_expert: - index = t1_expert_encoding[n]; - names = (T1_String**)t1_standard_strings; + index = psnames->adobe_expert_encoding[n]; + names = 0; break; default: @@ -1049,7 +1055,12 @@ encode->char_index[n] = 0; if (index) { - T1_String* name = names[index]; + T1_String* name; + + if (names) + name = names[index]; + else + name = (T1_String*)psnames->adobe_std_strings(index); if ( name ) {