David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1 | /***************************************************************************/ |
| 2 | /* */ |
| 3 | /* ttobjs.c */ |
| 4 | /* */ |
| 5 | /* Objects manager (body). */ |
| 6 | /* */ |
Werner Lemberg | 18931a5 | 2011-02-01 07:08:43 +0100 | [diff] [blame] | 7 | /* Copyright 1996-2011 */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
| 9 | /* */ |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 10 | /* This file is part of the FreeType project, and may only be used, */ |
| 11 | /* modified, and distributed under the terms of the FreeType project */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
| 13 | /* this file you indicate that you have read the license and */ |
| 14 | /* understand and accept it fully. */ |
Werner Lemberg | 328abf3 | 2003-12-24 13:37:58 +0000 | [diff] [blame] | 15 | /* */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 16 | /***************************************************************************/ |
| 17 | |
Werner Lemberg | cc069be | 2000-12-08 16:17:16 +0000 | [diff] [blame] | 18 | |
David Turner | 19ed8af | 2000-12-08 02:42:29 +0000 | [diff] [blame] | 19 | #include <ft2build.h> |
| 20 | #include FT_INTERNAL_DEBUG_H |
David Turner | 19ed8af | 2000-12-08 02:42:29 +0000 | [diff] [blame] | 21 | #include FT_INTERNAL_STREAM_H |
David Turner | 19ed8af | 2000-12-08 02:42:29 +0000 | [diff] [blame] | 22 | #include FT_TRUETYPE_TAGS_H |
| 23 | #include FT_INTERNAL_SFNT_H |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 24 | |
David Turner | 8d3a401 | 2001-03-20 11:14:24 +0000 | [diff] [blame] | 25 | #include "ttgload.h" |
| 26 | #include "ttpload.h" |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 27 | |
Werner Lemberg | 1f7f0e8 | 2001-06-06 17:30:41 +0000 | [diff] [blame] | 28 | #include "tterrors.h" |
| 29 | |
David Turner | 6aa260c | 2006-08-25 22:45:13 +0000 | [diff] [blame] | 30 | #ifdef TT_USE_BYTECODE_INTERPRETER |
David Turner | 8d3a401 | 2001-03-20 11:14:24 +0000 | [diff] [blame] | 31 | #include "ttinterp.h" |
David Turner | a90663f | 2000-07-08 00:41:13 +0000 | [diff] [blame] | 32 | #endif |
| 33 | |
David Turner | 8b6db86 | 2003-08-17 22:09:14 +0000 | [diff] [blame] | 34 | #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING |
Graham Asher | 3ea859f | 2003-04-25 11:40:46 +0000 | [diff] [blame] | 35 | #include FT_TRUETYPE_UNPATENTED_H |
| 36 | #endif |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 37 | |
Werner Lemberg | 44bb303 | 2004-04-25 20:15:11 +0000 | [diff] [blame] | 38 | #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT |
| 39 | #include "ttgxvar.h" |
| 40 | #endif |
| 41 | |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 42 | /*************************************************************************/ |
| 43 | /* */ |
| 44 | /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ |
| 45 | /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ |
| 46 | /* messages during execution. */ |
| 47 | /* */ |
Werner Lemberg | 5811c7c | 2000-07-02 13:53:16 +0000 | [diff] [blame] | 48 | #undef FT_COMPONENT |
| 49 | #define FT_COMPONENT trace_ttobjs |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 50 | |
| 51 | |
David Turner | 6aa260c | 2006-08-25 22:45:13 +0000 | [diff] [blame] | 52 | #ifdef TT_USE_BYTECODE_INTERPRETER |
Werner Lemberg | 321cd27 | 2000-07-27 11:20:20 +0000 | [diff] [blame] | 53 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 54 | /*************************************************************************/ |
| 55 | /* */ |
| 56 | /* GLYPH ZONE FUNCTIONS */ |
| 57 | /* */ |
| 58 | /*************************************************************************/ |
| 59 | |
Werner Lemberg | 321cd27 | 2000-07-27 11:20:20 +0000 | [diff] [blame] | 60 | |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 61 | /*************************************************************************/ |
| 62 | /* */ |
| 63 | /* <Function> */ |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 64 | /* tt_glyphzone_done */ |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 65 | /* */ |
| 66 | /* <Description> */ |
Werner Lemberg | f1c2b91 | 2006-01-13 14:53:28 +0000 | [diff] [blame] | 67 | /* Deallocate a glyph zone. */ |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 68 | /* */ |
| 69 | /* <Input> */ |
| 70 | /* zone :: A pointer to the target glyph zone. */ |
| 71 | /* */ |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 72 | FT_LOCAL_DEF( void ) |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 73 | tt_glyphzone_done( TT_GlyphZone zone ) |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 74 | { |
| 75 | FT_Memory memory = zone->memory; |
| 76 | |
Werner Lemberg | b442ca1 | 2003-04-23 15:50:27 +0000 | [diff] [blame] | 77 | |
David Turner | b280537 | 2003-03-13 21:07:51 +0000 | [diff] [blame] | 78 | if ( memory ) |
| 79 | { |
| 80 | FT_FREE( zone->contours ); |
| 81 | FT_FREE( zone->tags ); |
| 82 | FT_FREE( zone->cur ); |
| 83 | FT_FREE( zone->org ); |
David Turner | 33f5f24 | 2006-08-16 16:50:55 +0000 | [diff] [blame] | 84 | FT_FREE( zone->orus ); |
Werner Lemberg | 5811c7c | 2000-07-02 13:53:16 +0000 | [diff] [blame] | 85 | |
David Turner | b280537 | 2003-03-13 21:07:51 +0000 | [diff] [blame] | 86 | zone->max_points = zone->n_points = 0; |
| 87 | zone->max_contours = zone->n_contours = 0; |
| 88 | zone->memory = NULL; |
| 89 | } |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | |
| 93 | /*************************************************************************/ |
| 94 | /* */ |
| 95 | /* <Function> */ |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 96 | /* tt_glyphzone_new */ |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 97 | /* */ |
| 98 | /* <Description> */ |
Werner Lemberg | f1c2b91 | 2006-01-13 14:53:28 +0000 | [diff] [blame] | 99 | /* Allocate a new glyph zone. */ |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 100 | /* */ |
| 101 | /* <Input> */ |
| 102 | /* memory :: A handle to the current memory object. */ |
| 103 | /* */ |
| 104 | /* maxPoints :: The capacity of glyph zone in points. */ |
| 105 | /* */ |
| 106 | /* maxContours :: The capacity of glyph zone in contours. */ |
| 107 | /* */ |
| 108 | /* <Output> */ |
| 109 | /* zone :: A pointer to the target glyph zone record. */ |
| 110 | /* */ |
| 111 | /* <Return> */ |
| 112 | /* FreeType error code. 0 means success. */ |
| 113 | /* */ |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 114 | FT_LOCAL_DEF( FT_Error ) |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 115 | tt_glyphzone_new( FT_Memory memory, |
Werner Lemberg | 91db04c | 2002-04-01 14:25:28 +0000 | [diff] [blame] | 116 | FT_UShort maxPoints, |
| 117 | FT_Short maxContours, |
| 118 | TT_GlyphZone zone ) |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 119 | { |
Werner Lemberg | 5811c7c | 2000-07-02 13:53:16 +0000 | [diff] [blame] | 120 | FT_Error error; |
| 121 | |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 122 | |
Werner Lemberg | b3d5e9c | 2002-07-28 05:05:24 +0000 | [diff] [blame] | 123 | FT_MEM_ZERO( zone, sizeof ( *zone ) ); |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 124 | zone->memory = memory; |
| 125 | |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 126 | if ( FT_NEW_ARRAY( zone->org, maxPoints ) || |
| 127 | FT_NEW_ARRAY( zone->cur, maxPoints ) || |
David Turner | 33f5f24 | 2006-08-16 16:50:55 +0000 | [diff] [blame] | 128 | FT_NEW_ARRAY( zone->orus, maxPoints ) || |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 129 | FT_NEW_ARRAY( zone->tags, maxPoints ) || |
| 130 | FT_NEW_ARRAY( zone->contours, maxContours ) ) |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 131 | { |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 132 | tt_glyphzone_done( zone ); |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 133 | } |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 134 | else |
| 135 | { |
Werner Lemberg | 8e3fc5e | 2005-08-03 21:17:53 +0000 | [diff] [blame] | 136 | zone->max_points = maxPoints; |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 137 | zone->max_contours = maxContours; |
| 138 | } |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 139 | |
| 140 | return error; |
| 141 | } |
David Turner | 6aa260c | 2006-08-25 22:45:13 +0000 | [diff] [blame] | 142 | #endif /* TT_USE_BYTECODE_INTERPRETER */ |
Werner Lemberg | 321cd27 | 2000-07-27 11:20:20 +0000 | [diff] [blame] | 143 | |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 144 | |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 145 | /* Compare the face with a list of well-known `tricky' fonts. */ |
| 146 | /* This list shall be expanded as we find more of them. */ |
| 147 | |
| 148 | static FT_Bool |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 149 | tt_check_trickyness_family( FT_String* name ) |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 150 | { |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 151 | |
Oran Agra | 2e7a4e9 | 2009-04-05 18:03:02 +0300 | [diff] [blame] | 152 | #define TRICK_NAMES_MAX_CHARACTERS 16 |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 153 | #define TRICK_NAMES_COUNT 8 |
| 154 | |
| 155 | static const char trick_names[TRICK_NAMES_COUNT] |
| 156 | [TRICK_NAMES_MAX_CHARACTERS + 1] = |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 157 | { |
| 158 | "DFKaiSho-SB", /* dfkaisb.ttf */ |
Werner Lemberg | 0552a49 | 2009-02-11 22:59:40 +0000 | [diff] [blame] | 159 | "DFKaiShu", |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 160 | "DFKai-SB", /* kaiu.ttf */ |
suzuki toshiya | 8b05b5d | 2010-08-28 21:16:26 +0900 | [diff] [blame] | 161 | "HuaTianKaiTi?", /* htkt2.ttf */ |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 162 | "HuaTianSongTi?", /* htst3.ttf */ |
| 163 | "MingLiU", /* mingliu.ttf & mingliu.ttc */ |
| 164 | "PMingLiU", /* mingliu.ttc */ |
| 165 | "MingLi43", /* mingli.ttf */ |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 166 | }; |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 167 | |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 168 | int nn; |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 169 | |
| 170 | |
Oran Agra | 2e7a4e9 | 2009-04-05 18:03:02 +0300 | [diff] [blame] | 171 | for ( nn = 0; nn < TRICK_NAMES_COUNT; nn++ ) |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 172 | if ( ft_strstr( name, trick_names[nn] ) ) |
| 173 | return TRUE; |
| 174 | |
| 175 | return FALSE; |
| 176 | } |
| 177 | |
| 178 | |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 179 | /* XXX: This function should be in the `sfnt' module. */ |
| 180 | |
| 181 | /* Some PDF generators clear the checksums in the TrueType header table. */ |
| 182 | /* For example, Quartz ContextPDF clears all entries, or Bullzip PDF */ |
| 183 | /* Printer clears the entries for subsetted subtables. We thus have to */ |
| 184 | /* recalculate the checksums where necessary. */ |
| 185 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 186 | static FT_UInt32 |
| 187 | tt_synth_sfnt_checksum( FT_Stream stream, |
| 188 | FT_ULong length ) |
| 189 | { |
| 190 | FT_Error error; |
| 191 | FT_UInt32 checksum = 0; |
| 192 | int i; |
| 193 | |
| 194 | |
| 195 | if ( FT_FRAME_ENTER( length ) ) |
| 196 | return 0; |
| 197 | |
| 198 | for ( ; length > 3; length -= 4 ) |
| 199 | checksum += (FT_UInt32)FT_GET_ULONG(); |
| 200 | |
| 201 | for ( i = 3; length > 0; length --, i-- ) |
| 202 | checksum += (FT_UInt32)( FT_GET_BYTE() << ( i * 8 ) ); |
| 203 | |
| 204 | FT_FRAME_EXIT(); |
| 205 | |
| 206 | return checksum; |
| 207 | } |
| 208 | |
| 209 | |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 210 | /* XXX: This function should be in the `sfnt' module. */ |
| 211 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 212 | static FT_ULong |
| 213 | tt_get_sfnt_checksum( TT_Face face, |
| 214 | FT_UShort i ) |
| 215 | { |
suzuki toshiya | 58cb359 | 2011-05-01 00:47:43 +0900 | [diff] [blame] | 216 | #if 0 /* if we believe the written value, use following part. */ |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 217 | if ( face->dir_tables[i].CheckSum ) |
| 218 | return face->dir_tables[i].CheckSum; |
suzuki toshiya | 58cb359 | 2011-05-01 00:47:43 +0900 | [diff] [blame] | 219 | #endif |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 220 | |
suzuki toshiya | 10385e3 | 2011-04-30 17:49:45 +0900 | [diff] [blame] | 221 | if ( !face->goto_table ) |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 222 | return 0; |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 223 | |
suzuki toshiya | 10385e3 | 2011-04-30 17:49:45 +0900 | [diff] [blame] | 224 | if ( face->goto_table( face, |
| 225 | face->dir_tables[i].Tag, |
| 226 | face->root.stream, |
| 227 | NULL ) ) |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 228 | return 0; |
| 229 | |
| 230 | return (FT_ULong)tt_synth_sfnt_checksum( face->root.stream, |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 231 | face->dir_tables[i].Length ); |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 232 | } |
| 233 | |
| 234 | |
| 235 | typedef struct tt_sfnt_id_rec_ |
| 236 | { |
| 237 | FT_ULong CheckSum; |
| 238 | FT_ULong Length; |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 239 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 240 | } tt_sfnt_id_rec; |
| 241 | |
| 242 | |
| 243 | static FT_Bool |
| 244 | tt_check_trickyness_sfnt_ids( TT_Face face ) |
| 245 | { |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 246 | #define TRICK_SFNT_IDS_PER_FACE 3 |
suzuki toshiya | 1e89d15 | 2011-04-30 17:55:57 +0900 | [diff] [blame] | 247 | #define TRICK_SFNT_IDS_NUM_FACES 13 |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 248 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 249 | static const tt_sfnt_id_rec sfnt_id[TRICK_SFNT_IDS_NUM_FACES] |
| 250 | [TRICK_SFNT_IDS_PER_FACE] = { |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 251 | |
| 252 | #define TRICK_SFNT_ID_cvt 0 |
| 253 | #define TRICK_SFNT_ID_fpgm 1 |
| 254 | #define TRICK_SFNT_ID_prep 2 |
| 255 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 256 | { /* MingLiU 1995 */ |
| 257 | { 0x05bcf058, 0x000002e4 }, /* cvt */ |
| 258 | { 0x28233bf1, 0x000087c4 }, /* fpgm */ |
| 259 | { 0xa344a1ea, 0x000001e1 } /* prep */ |
| 260 | }, |
| 261 | { /* MingLiU 1996- */ |
| 262 | { 0x05bcf058, 0x000002e4 }, /* cvt */ |
| 263 | { 0x28233bf1, 0x000087c4 }, /* fpgm */ |
| 264 | { 0xa344a1eb, 0x000001e1 } /* prep */ |
| 265 | }, |
| 266 | { /* DFKaiShu */ |
| 267 | { 0x11e5ead4, 0x00000350 }, /* cvt */ |
| 268 | { 0x5a30ca3b, 0x00009063 }, /* fpgm */ |
| 269 | { 0x13a42602, 0x0000007e } /* prep */ |
| 270 | }, |
| 271 | { /* HuaTianKaiTi */ |
| 272 | { 0xfffbfffc, 0x00000008 }, /* cvt */ |
| 273 | { 0x9c9e48b8, 0x0000bea2 }, /* fpgm */ |
| 274 | { 0x70020112, 0x00000008 } /* prep */ |
| 275 | }, |
| 276 | { /* HuaTianSongTi */ |
| 277 | { 0xfffbfffc, 0x00000008 }, /* cvt */ |
| 278 | { 0x0a5a0483, 0x00017c39 }, /* fpgm */ |
| 279 | { 0x70020112, 0x00000008 } /* prep */ |
suzuki toshiya | 1e89d15 | 2011-04-30 17:55:57 +0900 | [diff] [blame] | 280 | }, |
| 281 | { /* NEC fadpop7.ttf */ |
| 282 | { 0x00000000, 0x00000000 }, /* cvt */ |
| 283 | { 0x40c92555, 0x000000e5 }, /* fpgm */ |
| 284 | { 0xa39b58e3, 0x0000117c } /* prep */ |
| 285 | }, |
| 286 | { /* NEC fadrei5.ttf */ |
| 287 | { 0x00000000, 0x00000000 }, /* cvt */ |
| 288 | { 0x33c41652, 0x000000e5 }, /* fpgm */ |
| 289 | { 0x26d6c52a, 0x00000f6a } /* prep */ |
| 290 | }, |
| 291 | { /* NEC fangot7.ttf */ |
| 292 | { 0x00000000, 0x00000000 }, /* cvt */ |
| 293 | { 0x6db1651d, 0x0000019d }, /* fpgm */ |
| 294 | { 0x6c6e4b03, 0x00002492 } /* prep */ |
| 295 | }, |
| 296 | { /* NEC fangyo5.ttf */ |
| 297 | { 0x00000000, 0x00000000 }, /* cvt */ |
| 298 | { 0x40c92555, 0x000000e5 }, /* fpgm */ |
| 299 | { 0xde51fad0, 0x0000117c } /* prep */ |
| 300 | }, |
| 301 | { /* NEC fankyo5.ttf */ |
| 302 | { 0x00000000, 0x00000000 }, /* cvt */ |
| 303 | { 0x85e47664, 0x000000e5 }, /* fpgm */ |
| 304 | { 0xa6c62831, 0x00001caa } /* prep */ |
| 305 | }, |
| 306 | { /* NEC fanrgo5.ttf */ |
| 307 | { 0x00000000, 0x00000000 }, /* cvt */ |
| 308 | { 0x2d891cfd, 0x0000019d }, /* fpgm */ |
| 309 | { 0xa0604633, 0x00001de8 } /* prep */ |
| 310 | }, |
| 311 | { /* NEC fangot5.ttc */ |
| 312 | { 0x00000000, 0x00000000 }, /* cvt */ |
| 313 | { 0x40aa774c, 0x000001cb }, /* fpgm */ |
| 314 | { 0x9b5caa96, 0x00001f9a } /* prep */ |
| 315 | }, |
| 316 | { /* NEC fanmin3.ttc */ |
| 317 | { 0x00000000, 0x00000000 }, /* cvt */ |
| 318 | { 0x0d3de9cb, 0x00000141 }, /* fpgm */ |
| 319 | { 0xd4127766, 0x00002280 } /* prep */ |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 320 | } |
| 321 | }; |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 322 | |
Daniel Zimmermann | 3ad8f35 | 2011-05-24 06:22:32 +0200 | [diff] [blame] | 323 | FT_ULong checksum; |
| 324 | int num_matched_ids[TRICK_SFNT_IDS_NUM_FACES]; |
| 325 | FT_Bool has_cvt, has_fpgm, has_prep; |
| 326 | FT_UShort i; |
| 327 | int j, k; |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 328 | |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 329 | |
| 330 | FT_MEM_SET( num_matched_ids, 0, |
| 331 | sizeof( int ) * TRICK_SFNT_IDS_NUM_FACES ); |
suzuki toshiya | 1e89d15 | 2011-04-30 17:55:57 +0900 | [diff] [blame] | 332 | has_cvt = FALSE; |
| 333 | has_fpgm = FALSE; |
| 334 | has_prep = FALSE; |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 335 | |
| 336 | for ( i = 0; i < face->num_tables; i++ ) |
| 337 | { |
| 338 | checksum = 0; |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 339 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 340 | switch( face->dir_tables[i].Tag ) |
| 341 | { |
| 342 | case TTAG_cvt: |
| 343 | k = TRICK_SFNT_ID_cvt; |
suzuki toshiya | 1e89d15 | 2011-04-30 17:55:57 +0900 | [diff] [blame] | 344 | has_cvt = TRUE; |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 345 | break; |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 346 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 347 | case TTAG_fpgm: |
| 348 | k = TRICK_SFNT_ID_fpgm; |
suzuki toshiya | 1e89d15 | 2011-04-30 17:55:57 +0900 | [diff] [blame] | 349 | has_fpgm = TRUE; |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 350 | break; |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 351 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 352 | case TTAG_prep: |
| 353 | k = TRICK_SFNT_ID_prep; |
suzuki toshiya | 1e89d15 | 2011-04-30 17:55:57 +0900 | [diff] [blame] | 354 | has_prep = TRUE; |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 355 | break; |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 356 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 357 | default: |
| 358 | continue; |
| 359 | } |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 360 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 361 | for ( j = 0; j < TRICK_SFNT_IDS_NUM_FACES; j++ ) |
| 362 | if ( face->dir_tables[i].Length == sfnt_id[j][k].Length ) |
| 363 | { |
| 364 | if ( !checksum ) |
| 365 | checksum = tt_get_sfnt_checksum( face, i ); |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 366 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 367 | if ( sfnt_id[j][k].CheckSum == checksum ) |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 368 | num_matched_ids[j]++; |
| 369 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 370 | if ( num_matched_ids[j] == TRICK_SFNT_IDS_PER_FACE ) |
| 371 | return TRUE; |
| 372 | } |
| 373 | } |
| 374 | |
suzuki toshiya | 1e89d15 | 2011-04-30 17:55:57 +0900 | [diff] [blame] | 375 | for ( j = 0; j < TRICK_SFNT_IDS_NUM_FACES; j++ ) |
| 376 | { |
| 377 | if ( !has_cvt && !sfnt_id[j][TRICK_SFNT_ID_cvt].Length ) |
| 378 | num_matched_ids[j] ++; |
| 379 | if ( !has_fpgm && !sfnt_id[j][TRICK_SFNT_ID_fpgm].Length ) |
| 380 | num_matched_ids[j] ++; |
| 381 | if ( !has_prep && !sfnt_id[j][TRICK_SFNT_ID_prep].Length ) |
| 382 | num_matched_ids[j] ++; |
| 383 | if ( num_matched_ids[j] == TRICK_SFNT_IDS_PER_FACE ) |
| 384 | return TRUE; |
| 385 | } |
| 386 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 387 | return FALSE; |
| 388 | } |
| 389 | |
| 390 | |
| 391 | static FT_Bool |
| 392 | tt_check_trickyness( FT_Face face ) |
| 393 | { |
| 394 | if ( !face ) |
| 395 | return FALSE; |
| 396 | |
suzuki toshiya | 86b7b2f | 2011-04-26 03:46:12 +0900 | [diff] [blame] | 397 | /* For first, check the face name for quick check. */ |
| 398 | if ( face->family_name && |
| 399 | tt_check_trickyness_family( face->family_name ) ) |
| 400 | return TRUE; |
| 401 | |
Werner Lemberg | 9871b84 | 2010-11-22 19:30:41 +0100 | [diff] [blame] | 402 | /* Type42 fonts may lack `name' tables, we thus try to identify */ |
| 403 | /* tricky fonts by checking the checksums of Type42-persistent */ |
| 404 | /* sfnt tables (`cvt', `fpgm', and `prep'). */ |
| 405 | if ( tt_check_trickyness_sfnt_ids( (TT_Face)face ) ) |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 406 | return TRUE; |
| 407 | |
| 408 | return FALSE; |
| 409 | } |
| 410 | |
| 411 | |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 412 | /*************************************************************************/ |
| 413 | /* */ |
| 414 | /* <Function> */ |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 415 | /* tt_face_init */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 416 | /* */ |
| 417 | /* <Description> */ |
Werner Lemberg | f1c2b91 | 2006-01-13 14:53:28 +0000 | [diff] [blame] | 418 | /* Initialize a given TrueType face object. */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 419 | /* */ |
| 420 | /* <Input> */ |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 421 | /* stream :: The source font stream. */ |
| 422 | /* */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 423 | /* face_index :: The index of the font face in the resource. */ |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 424 | /* */ |
| 425 | /* num_params :: Number of additional generic parameters. Ignored. */ |
| 426 | /* */ |
| 427 | /* params :: Additional generic parameters. Ignored. */ |
| 428 | /* */ |
| 429 | /* <InOut> */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 430 | /* face :: The newly built face object. */ |
| 431 | /* */ |
| 432 | /* <Return> */ |
Werner Lemberg | a929ba9 | 2000-06-25 06:47:11 +0000 | [diff] [blame] | 433 | /* FreeType error code. 0 means success. */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 434 | /* */ |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 435 | FT_LOCAL_DEF( FT_Error ) |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 436 | tt_face_init( FT_Stream stream, |
Werner Lemberg | 86ae11c | 2004-05-04 16:53:45 +0000 | [diff] [blame] | 437 | FT_Face ttface, /* TT_Face */ |
Werner Lemberg | 4a2305c | 2001-06-28 07:17:51 +0000 | [diff] [blame] | 438 | FT_Int face_index, |
| 439 | FT_Int num_params, |
| 440 | FT_Parameter* params ) |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 441 | { |
Werner Lemberg | 91db04c | 2002-04-01 14:25:28 +0000 | [diff] [blame] | 442 | FT_Error error; |
| 443 | FT_Library library; |
David Turner | 4e7eeee | 2002-02-28 16:10:29 +0000 | [diff] [blame] | 444 | SFNT_Service sfnt; |
Werner Lemberg | 86ae11c | 2004-05-04 16:53:45 +0000 | [diff] [blame] | 445 | TT_Face face = (TT_Face)ttface; |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 446 | |
Werner Lemberg | 5811c7c | 2000-07-02 13:53:16 +0000 | [diff] [blame] | 447 | |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 448 | library = ttface->driver->root.library; |
David Turner | 4e7eeee | 2002-02-28 16:10:29 +0000 | [diff] [blame] | 449 | sfnt = (SFNT_Service)FT_Get_Module_Interface( library, "sfnt" ); |
Werner Lemberg | a929ba9 | 2000-06-25 06:47:11 +0000 | [diff] [blame] | 450 | if ( !sfnt ) |
| 451 | goto Bad_Format; |
David Turner | c60c61c | 2000-05-12 15:26:58 +0000 | [diff] [blame] | 452 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 453 | /* create input stream from resource */ |
David Turner | 7d3a264 | 2002-03-20 10:49:31 +0000 | [diff] [blame] | 454 | if ( FT_STREAM_SEEK( 0 ) ) |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 455 | goto Exit; |
| 456 | |
David Turner | d42c68e | 2000-01-27 13:56:02 +0000 | [diff] [blame] | 457 | /* check that we have a valid TrueType file */ |
David Turner | 2e42131 | 2000-05-26 22:13:17 +0000 | [diff] [blame] | 458 | error = sfnt->init_face( stream, face, face_index, num_params, params ); |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 459 | if ( error ) |
| 460 | goto Exit; |
David Turner | c60c61c | 2000-05-12 15:26:58 +0000 | [diff] [blame] | 461 | |
Werner Lemberg | 9f8309f | 2004-07-24 21:57:39 +0000 | [diff] [blame] | 462 | /* We must also be able to accept Mac/GX fonts, as well as OT ones. */ |
| 463 | /* The 0x00020000 tag is completely undocumented; some fonts from */ |
| 464 | /* Arphic made for Chinese Windows 3.1 have this. */ |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 465 | if ( face->format_tag != 0x00010000L && /* MS fonts */ |
Werner Lemberg | 9f8309f | 2004-07-24 21:57:39 +0000 | [diff] [blame] | 466 | face->format_tag != 0x00020000L && /* CJK fonts for Win 3.1 */ |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 467 | face->format_tag != TTAG_true ) /* Mac fonts */ |
David Turner | d42c68e | 2000-01-27 13:56:02 +0000 | [diff] [blame] | 468 | { |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 469 | FT_TRACE2(( "[not a valid TTF font]\n" )); |
David Turner | 2e42131 | 2000-05-26 22:13:17 +0000 | [diff] [blame] | 470 | goto Bad_Format; |
David Turner | d42c68e | 2000-01-27 13:56:02 +0000 | [diff] [blame] | 471 | } |
| 472 | |
David Turner | 6aa260c | 2006-08-25 22:45:13 +0000 | [diff] [blame] | 473 | #ifdef TT_USE_BYTECODE_INTERPRETER |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 474 | ttface->face_flags |= FT_FACE_FLAG_HINTER; |
Werner Lemberg | 7734a1f | 2005-10-05 15:18:29 +0000 | [diff] [blame] | 475 | #endif |
| 476 | |
| 477 | /* If we are performing a simple font format check, exit immediately. */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 478 | if ( face_index < 0 ) |
| 479 | return TT_Err_Ok; |
| 480 | |
David Turner | 2e42131 | 2000-05-26 22:13:17 +0000 | [diff] [blame] | 481 | /* Load font directory */ |
| 482 | error = sfnt->load_face( stream, face, face_index, num_params, params ); |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 483 | if ( error ) |
| 484 | goto Exit; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 485 | |
suzuki toshiya | 9f5dd61 | 2010-11-23 02:47:10 +0900 | [diff] [blame] | 486 | if ( tt_check_trickyness( ttface ) ) |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 487 | ttface->face_flags |= FT_FACE_FLAG_TRICKY; |
| 488 | |
Wu, Chia-I (吳佳一) | f5aa47b | 2006-02-14 06:40:10 +0000 | [diff] [blame] | 489 | error = tt_face_load_hdmx( face, stream ); |
| 490 | if ( error ) |
| 491 | goto Exit; |
| 492 | |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 493 | if ( FT_IS_SCALABLE( ttface ) ) |
Werner Lemberg | a3f4da8 | 2003-04-29 13:23:47 +0000 | [diff] [blame] | 494 | { |
Werner Lemberg | 7f74a52 | 2002-07-26 09:09:10 +0000 | [diff] [blame] | 495 | |
Graham Asher | 13217f2 | 2002-07-18 15:59:23 +0000 | [diff] [blame] | 496 | #ifdef FT_CONFIG_OPTION_INCREMENTAL |
Werner Lemberg | 7f74a52 | 2002-07-26 09:09:10 +0000 | [diff] [blame] | 497 | |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 498 | if ( !ttface->internal->incremental_interface ) |
Werner Lemberg | a3f4da8 | 2003-04-29 13:23:47 +0000 | [diff] [blame] | 499 | error = tt_face_load_loca( face, stream ); |
| 500 | if ( !error ) |
Werner Lemberg | d496b92 | 2007-12-04 21:49:59 +0000 | [diff] [blame] | 501 | error = tt_face_load_cvt( face, stream ); |
| 502 | if ( !error ) |
| 503 | error = tt_face_load_fpgm( face, stream ); |
| 504 | if ( !error ) |
| 505 | error = tt_face_load_prep( face, stream ); |
Werner Lemberg | 7f74a52 | 2002-07-26 09:09:10 +0000 | [diff] [blame] | 506 | |
Graham Asher | 11f0ab7 | 2002-07-24 13:58:21 +0000 | [diff] [blame] | 507 | #else |
Werner Lemberg | 7f74a52 | 2002-07-26 09:09:10 +0000 | [diff] [blame] | 508 | |
Werner Lemberg | a3f4da8 | 2003-04-29 13:23:47 +0000 | [diff] [blame] | 509 | if ( !error ) |
Werner Lemberg | d496b92 | 2007-12-04 21:49:59 +0000 | [diff] [blame] | 510 | error = tt_face_load_loca( face, stream ); |
| 511 | if ( !error ) |
| 512 | error = tt_face_load_cvt( face, stream ); |
| 513 | if ( !error ) |
| 514 | error = tt_face_load_fpgm( face, stream ); |
| 515 | if ( !error ) |
| 516 | error = tt_face_load_prep( face, stream ); |
Werner Lemberg | 7f74a52 | 2002-07-26 09:09:10 +0000 | [diff] [blame] | 517 | |
Graham Asher | 11f0ab7 | 2002-07-24 13:58:21 +0000 | [diff] [blame] | 518 | #endif |
Werner Lemberg | 7f74a52 | 2002-07-26 09:09:10 +0000 | [diff] [blame] | 519 | |
Werner Lemberg | a3f4da8 | 2003-04-29 13:23:47 +0000 | [diff] [blame] | 520 | } |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 521 | |
Werner Lemberg | 046bf8b | 2006-10-03 08:43:42 +0000 | [diff] [blame] | 522 | #if defined( TT_CONFIG_OPTION_UNPATENTED_HINTING ) && \ |
| 523 | !defined( TT_CONFIG_OPTION_BYTECODE_INTERPRETER ) |
Graham Asher | 3ea859f | 2003-04-25 11:40:46 +0000 | [diff] [blame] | 524 | |
Graham Asher | 3ea859f | 2003-04-25 11:40:46 +0000 | [diff] [blame] | 525 | { |
David Turner | df430e1 | 2006-10-01 00:09:35 +0000 | [diff] [blame] | 526 | FT_Bool unpatented_hinting; |
| 527 | int i; |
Graham Asher | 3ea859f | 2003-04-25 11:40:46 +0000 | [diff] [blame] | 528 | |
Werner Lemberg | 046bf8b | 2006-10-03 08:43:42 +0000 | [diff] [blame] | 529 | |
David Turner | df430e1 | 2006-10-01 00:09:35 +0000 | [diff] [blame] | 530 | /* Determine whether unpatented hinting is to be used for this face. */ |
| 531 | unpatented_hinting = FT_BOOL |
Werner Lemberg | 046bf8b | 2006-10-03 08:43:42 +0000 | [diff] [blame] | 532 | ( library->debug_hooks[FT_DEBUG_HOOK_UNPATENTED_HINTING] != NULL ); |
Werner Lemberg | a3f4da8 | 2003-04-29 13:23:47 +0000 | [diff] [blame] | 533 | |
| 534 | for ( i = 0; i < num_params && !face->unpatented_hinting; i++ ) |
| 535 | if ( params[i].tag == FT_PARAM_TAG_UNPATENTED_HINTING ) |
David Turner | df430e1 | 2006-10-01 00:09:35 +0000 | [diff] [blame] | 536 | unpatented_hinting = TRUE; |
Graham Asher | 3ea859f | 2003-04-25 11:40:46 +0000 | [diff] [blame] | 537 | |
David Turner | df430e1 | 2006-10-01 00:09:35 +0000 | [diff] [blame] | 538 | if ( !unpatented_hinting ) |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 539 | ttface->internal->ignore_unpatented_hinter = TRUE; |
David Turner | 6aa260c | 2006-08-25 22:45:13 +0000 | [diff] [blame] | 540 | } |
| 541 | |
Werner Lemberg | 046bf8b | 2006-10-03 08:43:42 +0000 | [diff] [blame] | 542 | #endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING && |
| 543 | !TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ |
Graham Asher | 3ea859f | 2003-04-25 11:40:46 +0000 | [diff] [blame] | 544 | |
Werner Lemberg | a929ba9 | 2000-06-25 06:47:11 +0000 | [diff] [blame] | 545 | /* initialize standard glyph loading routines */ |
David Turner | 994d774 | 2000-06-25 04:49:19 +0000 | [diff] [blame] | 546 | TT_Init_Glyph_Loading( face ); |
| 547 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 548 | Exit: |
| 549 | return error; |
Werner Lemberg | b48a609 | 2000-07-09 19:15:30 +0000 | [diff] [blame] | 550 | |
David Turner | 2e42131 | 2000-05-26 22:13:17 +0000 | [diff] [blame] | 551 | Bad_Format: |
Werner Lemberg | 1429db6 | 2001-04-02 23:54:01 +0000 | [diff] [blame] | 552 | error = TT_Err_Unknown_File_Format; |
David Turner | 2e42131 | 2000-05-26 22:13:17 +0000 | [diff] [blame] | 553 | goto Exit; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 554 | } |
| 555 | |
| 556 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 557 | /*************************************************************************/ |
| 558 | /* */ |
| 559 | /* <Function> */ |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 560 | /* tt_face_done */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 561 | /* */ |
| 562 | /* <Description> */ |
Werner Lemberg | f1c2b91 | 2006-01-13 14:53:28 +0000 | [diff] [blame] | 563 | /* Finalize a given face object. */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 564 | /* */ |
| 565 | /* <Input> */ |
| 566 | /* face :: A pointer to the face object to destroy. */ |
| 567 | /* */ |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 568 | FT_LOCAL_DEF( void ) |
Werner Lemberg | 86ae11c | 2004-05-04 16:53:45 +0000 | [diff] [blame] | 569 | tt_face_done( FT_Face ttface ) /* TT_Face */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 570 | { |
Werner Lemberg | d03d856 | 2008-10-01 22:39:05 +0000 | [diff] [blame] | 571 | TT_Face face = (TT_Face)ttface; |
| 572 | FT_Memory memory; |
| 573 | FT_Stream stream; |
| 574 | SFNT_Service sfnt; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 575 | |
David Turner | c60c61c | 2000-05-12 15:26:58 +0000 | [diff] [blame] | 576 | |
Werner Lemberg | d03d856 | 2008-10-01 22:39:05 +0000 | [diff] [blame] | 577 | if ( !face ) |
| 578 | return; |
| 579 | |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 580 | memory = ttface->memory; |
| 581 | stream = ttface->stream; |
Werner Lemberg | d03d856 | 2008-10-01 22:39:05 +0000 | [diff] [blame] | 582 | sfnt = (SFNT_Service)face->sfnt; |
Werner Lemberg | 5811c7c | 2000-07-02 13:53:16 +0000 | [diff] [blame] | 583 | |
Werner Lemberg | a929ba9 | 2000-06-25 06:47:11 +0000 | [diff] [blame] | 584 | /* for `extended TrueType formats' (i.e. compressed versions) */ |
| 585 | if ( face->extra.finalizer ) |
David Turner | 994d774 | 2000-06-25 04:49:19 +0000 | [diff] [blame] | 586 | face->extra.finalizer( face->extra.data ); |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 587 | |
| 588 | if ( sfnt ) |
| 589 | sfnt->done_face( face ); |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 590 | |
| 591 | /* freeing the locations table */ |
David Turner | e70d553 | 2005-02-22 16:53:06 +0000 | [diff] [blame] | 592 | tt_face_done_loca( face ); |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 593 | |
Wu, Chia-I (吳佳一) | f5aa47b | 2006-02-14 06:40:10 +0000 | [diff] [blame] | 594 | tt_face_free_hdmx( face ); |
| 595 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 596 | /* freeing the CVT */ |
David Turner | e459d74 | 2002-03-22 13:52:37 +0000 | [diff] [blame] | 597 | FT_FREE( face->cvt ); |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 598 | face->cvt_size = 0; |
| 599 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 600 | /* freeing the programs */ |
David Turner | 7d3a264 | 2002-03-20 10:49:31 +0000 | [diff] [blame] | 601 | FT_FRAME_RELEASE( face->font_program ); |
| 602 | FT_FRAME_RELEASE( face->cvt_program ); |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 603 | face->font_program_size = 0; |
| 604 | face->cvt_program_size = 0; |
Werner Lemberg | 44bb303 | 2004-04-25 20:15:11 +0000 | [diff] [blame] | 605 | |
| 606 | #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT |
| 607 | tt_done_blend( memory, face->blend ); |
| 608 | face->blend = NULL; |
| 609 | #endif |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 610 | } |
| 611 | |
| 612 | |
| 613 | /*************************************************************************/ |
| 614 | /* */ |
| 615 | /* SIZE FUNCTIONS */ |
| 616 | /* */ |
| 617 | /*************************************************************************/ |
| 618 | |
David Turner | 6aa260c | 2006-08-25 22:45:13 +0000 | [diff] [blame] | 619 | #ifdef TT_USE_BYTECODE_INTERPRETER |
Werner Lemberg | 8e3fc5e | 2005-08-03 21:17:53 +0000 | [diff] [blame] | 620 | |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 621 | /*************************************************************************/ |
| 622 | /* */ |
| 623 | /* <Function> */ |
| 624 | /* tt_size_run_fpgm */ |
| 625 | /* */ |
| 626 | /* <Description> */ |
Werner Lemberg | 8e3fc5e | 2005-08-03 21:17:53 +0000 | [diff] [blame] | 627 | /* Run the font program. */ |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 628 | /* */ |
| 629 | /* <Input> */ |
Werner Lemberg | 18931a5 | 2011-02-01 07:08:43 +0100 | [diff] [blame] | 630 | /* size :: A handle to the size object. */ |
| 631 | /* */ |
| 632 | /* pedantic :: Set if bytecode execution should be pedantic. */ |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 633 | /* */ |
| 634 | /* <Return> */ |
| 635 | /* FreeType error code. 0 means success. */ |
| 636 | /* */ |
| 637 | FT_LOCAL_DEF( FT_Error ) |
Werner Lemberg | 18931a5 | 2011-02-01 07:08:43 +0100 | [diff] [blame] | 638 | tt_size_run_fpgm( TT_Size size, |
| 639 | FT_Bool pedantic ) |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 640 | { |
| 641 | TT_Face face = (TT_Face)size->root.face; |
| 642 | TT_ExecContext exec; |
| 643 | FT_Error error; |
| 644 | |
| 645 | |
| 646 | /* debugging instances have their own context */ |
| 647 | if ( size->debug ) |
| 648 | exec = size->context; |
| 649 | else |
Wu, Chia-I (吳佳一) | 0142e6a | 2005-08-16 01:54:59 +0000 | [diff] [blame] | 650 | exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context; |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 651 | |
| 652 | if ( !exec ) |
| 653 | return TT_Err_Could_Not_Find_Context; |
| 654 | |
| 655 | TT_Load_Context( exec, face, size ); |
| 656 | |
Werner Lemberg | 18931a5 | 2011-02-01 07:08:43 +0100 | [diff] [blame] | 657 | exec->callTop = 0; |
| 658 | exec->top = 0; |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 659 | |
| 660 | exec->period = 64; |
| 661 | exec->phase = 0; |
| 662 | exec->threshold = 0; |
| 663 | |
| 664 | exec->instruction_trap = FALSE; |
Werner Lemberg | 18931a5 | 2011-02-01 07:08:43 +0100 | [diff] [blame] | 665 | exec->F_dot_P = 0x10000L; |
| 666 | |
| 667 | exec->pedantic_hinting = pedantic; |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 668 | |
| 669 | { |
| 670 | FT_Size_Metrics* metrics = &exec->metrics; |
| 671 | TT_Size_Metrics* tt_metrics = &exec->tt_metrics; |
| 672 | |
| 673 | |
| 674 | metrics->x_ppem = 0; |
| 675 | metrics->y_ppem = 0; |
| 676 | metrics->x_scale = 0; |
| 677 | metrics->y_scale = 0; |
| 678 | |
| 679 | tt_metrics->ppem = 0; |
| 680 | tt_metrics->scale = 0; |
| 681 | tt_metrics->ratio = 0x10000L; |
| 682 | } |
| 683 | |
| 684 | /* allow font program execution */ |
| 685 | TT_Set_CodeRange( exec, |
| 686 | tt_coderange_font, |
| 687 | face->font_program, |
| 688 | face->font_program_size ); |
| 689 | |
| 690 | /* disable CVT and glyph programs coderange */ |
| 691 | TT_Clear_CodeRange( exec, tt_coderange_cvt ); |
| 692 | TT_Clear_CodeRange( exec, tt_coderange_glyph ); |
| 693 | |
| 694 | if ( face->font_program_size > 0 ) |
| 695 | { |
| 696 | error = TT_Goto_CodeRange( exec, tt_coderange_font, 0 ); |
| 697 | |
| 698 | if ( !error ) |
Werner Lemberg | 6abb923 | 2010-09-14 09:02:10 +0200 | [diff] [blame] | 699 | { |
| 700 | FT_TRACE4(( "Executing `fpgm' table.\n" )); |
| 701 | |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 702 | error = face->interpreter( exec ); |
Werner Lemberg | 6abb923 | 2010-09-14 09:02:10 +0200 | [diff] [blame] | 703 | } |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 704 | } |
| 705 | else |
| 706 | error = TT_Err_Ok; |
| 707 | |
| 708 | if ( !error ) |
| 709 | TT_Save_Context( exec, size ); |
| 710 | |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 711 | return error; |
| 712 | } |
| 713 | |
| 714 | |
| 715 | /*************************************************************************/ |
| 716 | /* */ |
| 717 | /* <Function> */ |
| 718 | /* tt_size_run_prep */ |
| 719 | /* */ |
| 720 | /* <Description> */ |
Werner Lemberg | 8e3fc5e | 2005-08-03 21:17:53 +0000 | [diff] [blame] | 721 | /* Run the control value program. */ |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 722 | /* */ |
| 723 | /* <Input> */ |
Werner Lemberg | 18931a5 | 2011-02-01 07:08:43 +0100 | [diff] [blame] | 724 | /* size :: A handle to the size object. */ |
| 725 | /* */ |
| 726 | /* pedantic :: Set if bytecode execution should be pedantic. */ |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 727 | /* */ |
| 728 | /* <Return> */ |
| 729 | /* FreeType error code. 0 means success. */ |
| 730 | /* */ |
| 731 | FT_LOCAL_DEF( FT_Error ) |
Werner Lemberg | 18931a5 | 2011-02-01 07:08:43 +0100 | [diff] [blame] | 732 | tt_size_run_prep( TT_Size size, |
| 733 | FT_Bool pedantic ) |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 734 | { |
| 735 | TT_Face face = (TT_Face)size->root.face; |
| 736 | TT_ExecContext exec; |
| 737 | FT_Error error; |
| 738 | |
| 739 | |
| 740 | /* debugging instances have their own context */ |
| 741 | if ( size->debug ) |
| 742 | exec = size->context; |
| 743 | else |
Wu, Chia-I (吳佳一) | 0142e6a | 2005-08-16 01:54:59 +0000 | [diff] [blame] | 744 | exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context; |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 745 | |
| 746 | if ( !exec ) |
| 747 | return TT_Err_Could_Not_Find_Context; |
| 748 | |
| 749 | TT_Load_Context( exec, face, size ); |
| 750 | |
| 751 | exec->callTop = 0; |
| 752 | exec->top = 0; |
| 753 | |
| 754 | exec->instruction_trap = FALSE; |
| 755 | |
Werner Lemberg | 18931a5 | 2011-02-01 07:08:43 +0100 | [diff] [blame] | 756 | exec->pedantic_hinting = pedantic; |
| 757 | |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 758 | TT_Set_CodeRange( exec, |
| 759 | tt_coderange_cvt, |
| 760 | face->cvt_program, |
| 761 | face->cvt_program_size ); |
| 762 | |
| 763 | TT_Clear_CodeRange( exec, tt_coderange_glyph ); |
| 764 | |
| 765 | if ( face->cvt_program_size > 0 ) |
| 766 | { |
| 767 | error = TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 ); |
| 768 | |
| 769 | if ( !error && !size->debug ) |
Werner Lemberg | 6abb923 | 2010-09-14 09:02:10 +0200 | [diff] [blame] | 770 | { |
| 771 | FT_TRACE4(( "Executing `prep' table.\n" )); |
| 772 | |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 773 | error = face->interpreter( exec ); |
Werner Lemberg | 6abb923 | 2010-09-14 09:02:10 +0200 | [diff] [blame] | 774 | } |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 775 | } |
| 776 | else |
| 777 | error = TT_Err_Ok; |
| 778 | |
| 779 | /* save as default graphics state */ |
| 780 | size->GS = exec->GS; |
| 781 | |
| 782 | TT_Save_Context( exec, size ); |
| 783 | |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 784 | return error; |
| 785 | } |
Werner Lemberg | 8e3fc5e | 2005-08-03 21:17:53 +0000 | [diff] [blame] | 786 | |
David Turner | 6aa260c | 2006-08-25 22:45:13 +0000 | [diff] [blame] | 787 | #endif /* TT_USE_BYTECODE_INTERPRETER */ |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 788 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 789 | |
David Turner | 6aa260c | 2006-08-25 22:45:13 +0000 | [diff] [blame] | 790 | #ifdef TT_USE_BYTECODE_INTERPRETER |
Werner Lemberg | 8e3fc5e | 2005-08-03 21:17:53 +0000 | [diff] [blame] | 791 | |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 792 | static void |
| 793 | tt_size_done_bytecode( FT_Size ftsize ) |
| 794 | { |
Werner Lemberg | f629439 | 2007-01-06 07:47:45 +0000 | [diff] [blame] | 795 | TT_Size size = (TT_Size)ftsize; |
| 796 | TT_Face face = (TT_Face)ftsize->face; |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 797 | FT_Memory memory = face->root.memory; |
| 798 | |
Werner Lemberg | f629439 | 2007-01-06 07:47:45 +0000 | [diff] [blame] | 799 | |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 800 | if ( size->debug ) |
| 801 | { |
| 802 | /* the debug context must be deleted by the debugger itself */ |
| 803 | size->context = NULL; |
| 804 | size->debug = FALSE; |
| 805 | } |
| 806 | |
| 807 | FT_FREE( size->cvt ); |
| 808 | size->cvt_size = 0; |
| 809 | |
| 810 | /* free storage area */ |
| 811 | FT_FREE( size->storage ); |
| 812 | size->storage_size = 0; |
| 813 | |
| 814 | /* twilight zone */ |
| 815 | tt_glyphzone_done( &size->twilight ); |
| 816 | |
| 817 | FT_FREE( size->function_defs ); |
| 818 | FT_FREE( size->instruction_defs ); |
| 819 | |
| 820 | size->num_function_defs = 0; |
| 821 | size->max_function_defs = 0; |
| 822 | size->num_instruction_defs = 0; |
| 823 | size->max_instruction_defs = 0; |
| 824 | |
| 825 | size->max_func = 0; |
| 826 | size->max_ins = 0; |
| 827 | |
| 828 | size->bytecode_ready = 0; |
| 829 | size->cvt_ready = 0; |
| 830 | } |
| 831 | |
| 832 | |
Werner Lemberg | f629439 | 2007-01-06 07:47:45 +0000 | [diff] [blame] | 833 | /* Initialize bytecode-related fields in the size object. */ |
| 834 | /* We do this only if bytecode interpretation is really needed. */ |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 835 | static FT_Error |
Werner Lemberg | 18931a5 | 2011-02-01 07:08:43 +0100 | [diff] [blame] | 836 | tt_size_init_bytecode( FT_Size ftsize, |
| 837 | FT_Bool pedantic ) |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 838 | { |
| 839 | FT_Error error; |
| 840 | TT_Size size = (TT_Size)ftsize; |
| 841 | TT_Face face = (TT_Face)ftsize->face; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 842 | FT_Memory memory = face->root.memory; |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 843 | FT_Int i; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 844 | |
David Turner | f9b8dec | 2000-06-16 19:34:52 +0000 | [diff] [blame] | 845 | FT_UShort n_twilight; |
David Turner | 8f43c71 | 2000-02-02 12:16:19 +0000 | [diff] [blame] | 846 | TT_MaxProfile* maxp = &face->max_profile; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 847 | |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 848 | |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 849 | size->bytecode_ready = 1; |
| 850 | size->cvt_ready = 0; |
| 851 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 852 | size->max_function_defs = maxp->maxFunctionDefs; |
| 853 | size->max_instruction_defs = maxp->maxInstructionDefs; |
| 854 | |
| 855 | size->num_function_defs = 0; |
| 856 | size->num_instruction_defs = 0; |
| 857 | |
| 858 | size->max_func = 0; |
| 859 | size->max_ins = 0; |
| 860 | |
| 861 | size->cvt_size = face->cvt_size; |
| 862 | size->storage_size = maxp->maxStorage; |
| 863 | |
| 864 | /* Set default metrics */ |
| 865 | { |
Werner Lemberg | 46e05c4 | 2009-07-17 22:49:34 +0200 | [diff] [blame] | 866 | TT_Size_Metrics* metrics = &size->ttmetrics; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 867 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 868 | |
Werner Lemberg | 46e05c4 | 2009-07-17 22:49:34 +0200 | [diff] [blame] | 869 | metrics->rotated = FALSE; |
| 870 | metrics->stretched = FALSE; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 871 | |
| 872 | /* set default compensation (all 0) */ |
| 873 | for ( i = 0; i < 4; i++ ) |
Werner Lemberg | 46e05c4 | 2009-07-17 22:49:34 +0200 | [diff] [blame] | 874 | metrics->compensations[i] = 0; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 875 | } |
| 876 | |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 877 | /* allocate function defs, instruction defs, cvt, and storage area */ |
Werner Lemberg | 91db04c | 2002-04-01 14:25:28 +0000 | [diff] [blame] | 878 | if ( FT_NEW_ARRAY( size->function_defs, size->max_function_defs ) || |
David Turner | e459d74 | 2002-03-22 13:52:37 +0000 | [diff] [blame] | 879 | FT_NEW_ARRAY( size->instruction_defs, size->max_instruction_defs ) || |
Werner Lemberg | 91db04c | 2002-04-01 14:25:28 +0000 | [diff] [blame] | 880 | FT_NEW_ARRAY( size->cvt, size->cvt_size ) || |
| 881 | FT_NEW_ARRAY( size->storage, size->storage_size ) ) |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 882 | goto Exit; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 883 | |
| 884 | /* reserve twilight zone */ |
| 885 | n_twilight = maxp->maxTwilightPoints; |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 886 | |
| 887 | /* there are 4 phantom points (do we need this?) */ |
| 888 | n_twilight += 4; |
| 889 | |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 890 | error = tt_glyphzone_new( memory, n_twilight, 0, &size->twilight ); |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 891 | if ( error ) |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 892 | goto Exit; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 893 | |
| 894 | size->twilight.n_points = n_twilight; |
| 895 | |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 896 | size->GS = tt_default_graphics_state; |
| 897 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 898 | /* set `face->interpreter' according to the debug hook present */ |
| 899 | { |
David Turner | f0df85b | 2000-06-22 00:17:42 +0000 | [diff] [blame] | 900 | FT_Library library = face->root.driver->root.library; |
David Turner | c60c61c | 2000-05-12 15:26:58 +0000 | [diff] [blame] | 901 | |
Werner Lemberg | a929ba9 | 2000-06-25 06:47:11 +0000 | [diff] [blame] | 902 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 903 | face->interpreter = (TT_Interpreter) |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 904 | library->debug_hooks[FT_DEBUG_HOOK_TRUETYPE]; |
| 905 | if ( !face->interpreter ) |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 906 | face->interpreter = (TT_Interpreter)TT_RunIns; |
| 907 | } |
| 908 | |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 909 | /* Fine, now run the font program! */ |
Werner Lemberg | 18931a5 | 2011-02-01 07:08:43 +0100 | [diff] [blame] | 910 | error = tt_size_run_fpgm( size, pedantic ); |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 911 | |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 912 | Exit: |
Werner Lemberg | f629439 | 2007-01-06 07:47:45 +0000 | [diff] [blame] | 913 | if ( error ) |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 914 | tt_size_done_bytecode( ftsize ); |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 915 | |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 916 | return error; |
| 917 | } |
| 918 | |
| 919 | |
| 920 | FT_LOCAL_DEF( FT_Error ) |
Werner Lemberg | 18931a5 | 2011-02-01 07:08:43 +0100 | [diff] [blame] | 921 | tt_size_ready_bytecode( TT_Size size, |
| 922 | FT_Bool pedantic ) |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 923 | { |
Werner Lemberg | f629439 | 2007-01-06 07:47:45 +0000 | [diff] [blame] | 924 | FT_Error error = TT_Err_Ok; |
| 925 | |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 926 | |
| 927 | if ( !size->bytecode_ready ) |
| 928 | { |
Werner Lemberg | 18931a5 | 2011-02-01 07:08:43 +0100 | [diff] [blame] | 929 | error = tt_size_init_bytecode( (FT_Size)size, pedantic ); |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 930 | if ( error ) |
| 931 | goto Exit; |
| 932 | } |
| 933 | |
| 934 | /* rescale CVT when needed */ |
| 935 | if ( !size->cvt_ready ) |
| 936 | { |
| 937 | FT_UInt i; |
Werner Lemberg | b972a2a | 2008-12-11 08:55:48 +0000 | [diff] [blame] | 938 | TT_Face face = (TT_Face)size->root.face; |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 939 | |
| 940 | |
| 941 | /* Scale the cvt values to the new ppem. */ |
| 942 | /* We use by default the y ppem to scale the CVT. */ |
| 943 | for ( i = 0; i < size->cvt_size; i++ ) |
| 944 | size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale ); |
| 945 | |
Werner Lemberg | f629439 | 2007-01-06 07:47:45 +0000 | [diff] [blame] | 946 | /* all twilight points are originally zero */ |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 947 | for ( i = 0; i < (FT_UInt)size->twilight.n_points; i++ ) |
| 948 | { |
| 949 | size->twilight.org[i].x = 0; |
| 950 | size->twilight.org[i].y = 0; |
| 951 | size->twilight.cur[i].x = 0; |
| 952 | size->twilight.cur[i].y = 0; |
| 953 | } |
| 954 | |
| 955 | /* clear storage area */ |
| 956 | for ( i = 0; i < (FT_UInt)size->storage_size; i++ ) |
| 957 | size->storage[i] = 0; |
| 958 | |
| 959 | size->GS = tt_default_graphics_state; |
| 960 | |
Werner Lemberg | 18931a5 | 2011-02-01 07:08:43 +0100 | [diff] [blame] | 961 | error = tt_size_run_prep( size, pedantic ); |
Werner Lemberg | 56ceaa4 | 2007-05-14 18:53:58 +0000 | [diff] [blame] | 962 | if ( !error ) |
Werner Lemberg | a2f17cc | 2008-05-17 10:01:45 +0000 | [diff] [blame] | 963 | size->cvt_ready = 1; |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 964 | } |
Werner Lemberg | a2f17cc | 2008-05-17 10:01:45 +0000 | [diff] [blame] | 965 | |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 966 | Exit: |
| 967 | return error; |
| 968 | } |
| 969 | |
Werner Lemberg | 6ff2ff5 | 2007-05-24 19:39:14 +0000 | [diff] [blame] | 970 | #endif /* TT_USE_BYTECODE_INTERPRETER */ |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 971 | |
Werner Lemberg | f629439 | 2007-01-06 07:47:45 +0000 | [diff] [blame] | 972 | |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 973 | /*************************************************************************/ |
| 974 | /* */ |
| 975 | /* <Function> */ |
| 976 | /* tt_size_init */ |
| 977 | /* */ |
| 978 | /* <Description> */ |
| 979 | /* Initialize a new TrueType size object. */ |
| 980 | /* */ |
| 981 | /* <InOut> */ |
| 982 | /* size :: A handle to the size object. */ |
| 983 | /* */ |
| 984 | /* <Return> */ |
| 985 | /* FreeType error code. 0 means success. */ |
| 986 | /* */ |
| 987 | FT_LOCAL_DEF( FT_Error ) |
| 988 | tt_size_init( FT_Size ttsize ) /* TT_Size */ |
| 989 | { |
| 990 | TT_Size size = (TT_Size)ttsize; |
| 991 | FT_Error error = TT_Err_Ok; |
| 992 | |
| 993 | #ifdef TT_USE_BYTECODE_INTERPRETER |
| 994 | size->bytecode_ready = 0; |
| 995 | size->cvt_ready = 0; |
| 996 | #endif |
David Turner | 8f43c71 | 2000-02-02 12:16:19 +0000 | [diff] [blame] | 997 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 998 | size->ttmetrics.valid = FALSE; |
Werner Lemberg | f1c2b91 | 2006-01-13 14:53:28 +0000 | [diff] [blame] | 999 | size->strike_index = 0xFFFFFFFFUL; |
Wu, Chia-I (吳佳一) | 89fff9b | 2005-07-31 11:41:54 +0000 | [diff] [blame] | 1000 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1001 | return error; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1002 | } |
| 1003 | |
| 1004 | |
| 1005 | /*************************************************************************/ |
| 1006 | /* */ |
| 1007 | /* <Function> */ |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 1008 | /* tt_size_done */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1009 | /* */ |
| 1010 | /* <Description> */ |
| 1011 | /* The TrueType size object finalizer. */ |
| 1012 | /* */ |
| 1013 | /* <Input> */ |
| 1014 | /* size :: A handle to the target size object. */ |
| 1015 | /* */ |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 1016 | FT_LOCAL_DEF( void ) |
Werner Lemberg | 86ae11c | 2004-05-04 16:53:45 +0000 | [diff] [blame] | 1017 | tt_size_done( FT_Size ttsize ) /* TT_Size */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1018 | { |
Werner Lemberg | f629439 | 2007-01-06 07:47:45 +0000 | [diff] [blame] | 1019 | TT_Size size = (TT_Size)ttsize; |
| 1020 | |
Werner Lemberg | 8e3fc5e | 2005-08-03 21:17:53 +0000 | [diff] [blame] | 1021 | |
David Turner | 6aa260c | 2006-08-25 22:45:13 +0000 | [diff] [blame] | 1022 | #ifdef TT_USE_BYTECODE_INTERPRETER |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 1023 | if ( size->bytecode_ready ) |
| 1024 | tt_size_done_bytecode( ttsize ); |
David Turner | 8f43c71 | 2000-02-02 12:16:19 +0000 | [diff] [blame] | 1025 | #endif |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1026 | |
| 1027 | size->ttmetrics.valid = FALSE; |
| 1028 | } |
| 1029 | |
| 1030 | |
| 1031 | /*************************************************************************/ |
| 1032 | /* */ |
| 1033 | /* <Function> */ |
Wu, Chia-I (吳佳一) | fa7d6ab | 2006-01-13 12:21:31 +0000 | [diff] [blame] | 1034 | /* tt_size_reset */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1035 | /* */ |
| 1036 | /* <Description> */ |
Werner Lemberg | f1c2b91 | 2006-01-13 14:53:28 +0000 | [diff] [blame] | 1037 | /* Reset a TrueType size when resolutions and character dimensions */ |
Wu, Chia-I (吳佳一) | fa7d6ab | 2006-01-13 12:21:31 +0000 | [diff] [blame] | 1038 | /* have been changed. */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1039 | /* */ |
| 1040 | /* <Input> */ |
| 1041 | /* size :: A handle to the target size object. */ |
| 1042 | /* */ |
Wu, Chia-I (吳佳一) | fa7d6ab | 2006-01-13 12:21:31 +0000 | [diff] [blame] | 1043 | FT_LOCAL_DEF( FT_Error ) |
| 1044 | tt_size_reset( TT_Size size ) |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1045 | { |
Werner Lemberg | 91db04c | 2002-04-01 14:25:28 +0000 | [diff] [blame] | 1046 | TT_Face face; |
| 1047 | FT_Error error = TT_Err_Ok; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1048 | FT_Size_Metrics* metrics; |
| 1049 | |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 1050 | |
Wu, Chia-I (吳佳一) | fa7d6ab | 2006-01-13 12:21:31 +0000 | [diff] [blame] | 1051 | size->ttmetrics.valid = FALSE; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1052 | |
| 1053 | face = (TT_Face)size->root.face; |
| 1054 | |
David Turner | ba4511b | 2003-02-18 22:25:22 +0000 | [diff] [blame] | 1055 | metrics = &size->metrics; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1056 | |
Wu, Chia-I (吳佳一) | fa7d6ab | 2006-01-13 12:21:31 +0000 | [diff] [blame] | 1057 | /* copy the result from base layer */ |
| 1058 | *metrics = size->root.metrics; |
| 1059 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1060 | if ( metrics->x_ppem < 1 || metrics->y_ppem < 1 ) |
| 1061 | return TT_Err_Invalid_PPem; |
| 1062 | |
Werner Lemberg | f1c2b91 | 2006-01-13 14:53:28 +0000 | [diff] [blame] | 1063 | /* This bit flag, if set, indicates that the ppems must be */ |
| 1064 | /* rounded to integers. Nearly all TrueType fonts have this bit */ |
| 1065 | /* set, as hinting won't work really well otherwise. */ |
| 1066 | /* */ |
Wu, Chia-I (吳佳一) | fa7d6ab | 2006-01-13 12:21:31 +0000 | [diff] [blame] | 1067 | if ( face->header.Flags & 8 ) |
| 1068 | { |
| 1069 | metrics->x_scale = FT_DivFix( metrics->x_ppem << 6, |
| 1070 | face->root.units_per_EM ); |
| 1071 | metrics->y_scale = FT_DivFix( metrics->y_ppem << 6, |
| 1072 | face->root.units_per_EM ); |
| 1073 | |
| 1074 | metrics->ascender = |
| 1075 | FT_PIX_ROUND( FT_MulFix( face->root.ascender, metrics->y_scale ) ); |
| 1076 | metrics->descender = |
| 1077 | FT_PIX_ROUND( FT_MulFix( face->root.descender, metrics->y_scale ) ); |
| 1078 | metrics->height = |
| 1079 | FT_PIX_ROUND( FT_MulFix( face->root.height, metrics->y_scale ) ); |
| 1080 | metrics->max_advance = |
| 1081 | FT_PIX_ROUND( FT_MulFix( face->root.max_advance_width, |
| 1082 | metrics->x_scale ) ); |
| 1083 | } |
| 1084 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1085 | /* compute new transformation */ |
| 1086 | if ( metrics->x_ppem >= metrics->y_ppem ) |
| 1087 | { |
| 1088 | size->ttmetrics.scale = metrics->x_scale; |
| 1089 | size->ttmetrics.ppem = metrics->x_ppem; |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 1090 | size->ttmetrics.x_ratio = 0x10000L; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1091 | size->ttmetrics.y_ratio = FT_MulDiv( metrics->y_ppem, |
| 1092 | 0x10000L, |
| 1093 | metrics->x_ppem ); |
| 1094 | } |
| 1095 | else |
| 1096 | { |
| 1097 | size->ttmetrics.scale = metrics->y_scale; |
| 1098 | size->ttmetrics.ppem = metrics->y_ppem; |
| 1099 | size->ttmetrics.x_ratio = FT_MulDiv( metrics->x_ppem, |
| 1100 | 0x10000L, |
| 1101 | metrics->y_ppem ); |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 1102 | size->ttmetrics.y_ratio = 0x10000L; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1103 | } |
| 1104 | |
David Turner | 6aa260c | 2006-08-25 22:45:13 +0000 | [diff] [blame] | 1105 | #ifdef TT_USE_BYTECODE_INTERPRETER |
David Turner | 384be23 | 2007-01-05 15:32:01 +0000 | [diff] [blame] | 1106 | size->cvt_ready = 0; |
David Turner | 6aa260c | 2006-08-25 22:45:13 +0000 | [diff] [blame] | 1107 | #endif /* TT_USE_BYTECODE_INTERPRETER */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1108 | |
| 1109 | if ( !error ) |
| 1110 | size->ttmetrics.valid = TRUE; |
| 1111 | |
| 1112 | return error; |
| 1113 | } |
| 1114 | |
Werner Lemberg | 4b68007 | 2000-11-07 06:30:29 +0000 | [diff] [blame] | 1115 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1116 | /*************************************************************************/ |
| 1117 | /* */ |
| 1118 | /* <Function> */ |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 1119 | /* tt_driver_init */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1120 | /* */ |
| 1121 | /* <Description> */ |
Werner Lemberg | f1c2b91 | 2006-01-13 14:53:28 +0000 | [diff] [blame] | 1122 | /* Initialize a given TrueType driver object. */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1123 | /* */ |
| 1124 | /* <Input> */ |
| 1125 | /* driver :: A handle to the target driver object. */ |
| 1126 | /* */ |
| 1127 | /* <Return> */ |
Werner Lemberg | a929ba9 | 2000-06-25 06:47:11 +0000 | [diff] [blame] | 1128 | /* FreeType error code. 0 means success. */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1129 | /* */ |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 1130 | FT_LOCAL_DEF( FT_Error ) |
Wu, Chia-I (吳佳一) | 0142e6a | 2005-08-16 01:54:59 +0000 | [diff] [blame] | 1131 | tt_driver_init( FT_Module ttdriver ) /* TT_Driver */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1132 | { |
Wu, Chia-I (吳佳一) | 0142e6a | 2005-08-16 01:54:59 +0000 | [diff] [blame] | 1133 | |
David Turner | 6aa260c | 2006-08-25 22:45:13 +0000 | [diff] [blame] | 1134 | #ifdef TT_USE_BYTECODE_INTERPRETER |
Wu, Chia-I (吳佳一) | 0142e6a | 2005-08-16 01:54:59 +0000 | [diff] [blame] | 1135 | |
| 1136 | TT_Driver driver = (TT_Driver)ttdriver; |
David Turner | c60c61c | 2000-05-12 15:26:58 +0000 | [diff] [blame] | 1137 | |
Werner Lemberg | a929ba9 | 2000-06-25 06:47:11 +0000 | [diff] [blame] | 1138 | |
Wu, Chia-I (吳佳一) | 0142e6a | 2005-08-16 01:54:59 +0000 | [diff] [blame] | 1139 | if ( !TT_New_Context( driver ) ) |
| 1140 | return TT_Err_Could_Not_Find_Context; |
Werner Lemberg | b48a609 | 2000-07-09 19:15:30 +0000 | [diff] [blame] | 1141 | |
Wu, Chia-I (吳佳一) | 0142e6a | 2005-08-16 01:54:59 +0000 | [diff] [blame] | 1142 | #else |
| 1143 | |
| 1144 | FT_UNUSED( ttdriver ); |
| 1145 | |
| 1146 | #endif |
| 1147 | |
| 1148 | return TT_Err_Ok; |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1149 | } |
| 1150 | |
| 1151 | |
| 1152 | /*************************************************************************/ |
| 1153 | /* */ |
| 1154 | /* <Function> */ |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 1155 | /* tt_driver_done */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1156 | /* */ |
| 1157 | /* <Description> */ |
Werner Lemberg | f1c2b91 | 2006-01-13 14:53:28 +0000 | [diff] [blame] | 1158 | /* Finalize a given TrueType driver. */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1159 | /* */ |
| 1160 | /* <Input> */ |
| 1161 | /* driver :: A handle to the target TrueType driver. */ |
| 1162 | /* */ |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 1163 | FT_LOCAL_DEF( void ) |
Werner Lemberg | 86ae11c | 2004-05-04 16:53:45 +0000 | [diff] [blame] | 1164 | tt_driver_done( FT_Module ttdriver ) /* TT_Driver */ |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1165 | { |
David Turner | 6aa260c | 2006-08-25 22:45:13 +0000 | [diff] [blame] | 1166 | #ifdef TT_USE_BYTECODE_INTERPRETER |
Werner Lemberg | 86ae11c | 2004-05-04 16:53:45 +0000 | [diff] [blame] | 1167 | TT_Driver driver = (TT_Driver)ttdriver; |
| 1168 | |
Werner Lemberg | 78575dc | 2000-06-12 19:36:41 +0000 | [diff] [blame] | 1169 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1170 | /* destroy the execution context */ |
| 1171 | if ( driver->context ) |
| 1172 | { |
Wu, Chia-I (吳佳一) | 0142e6a | 2005-08-16 01:54:59 +0000 | [diff] [blame] | 1173 | TT_Done_Context( driver->context ); |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1174 | driver->context = NULL; |
| 1175 | } |
David Turner | c5cdf8b | 2000-07-27 21:40:22 +0000 | [diff] [blame] | 1176 | #else |
Werner Lemberg | 3bcad43 | 2004-05-06 11:48:35 +0000 | [diff] [blame] | 1177 | FT_UNUSED( ttdriver ); |
David Turner | 8f43c71 | 2000-02-02 12:16:19 +0000 | [diff] [blame] | 1178 | #endif |
Werner Lemberg | 5811c7c | 2000-07-02 13:53:16 +0000 | [diff] [blame] | 1179 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1180 | } |
| 1181 | |
| 1182 | |
Wu, Chia-I (吳佳一) | 0142e6a | 2005-08-16 01:54:59 +0000 | [diff] [blame] | 1183 | /*************************************************************************/ |
| 1184 | /* */ |
| 1185 | /* <Function> */ |
| 1186 | /* tt_slot_init */ |
| 1187 | /* */ |
| 1188 | /* <Description> */ |
Werner Lemberg | f1c2b91 | 2006-01-13 14:53:28 +0000 | [diff] [blame] | 1189 | /* Initialize a new slot object. */ |
Wu, Chia-I (吳佳一) | 0142e6a | 2005-08-16 01:54:59 +0000 | [diff] [blame] | 1190 | /* */ |
| 1191 | /* <InOut> */ |
| 1192 | /* slot :: A handle to the slot object. */ |
| 1193 | /* */ |
| 1194 | /* <Return> */ |
| 1195 | /* FreeType error code. 0 means success. */ |
| 1196 | /* */ |
| 1197 | FT_LOCAL_DEF( FT_Error ) |
| 1198 | tt_slot_init( FT_GlyphSlot slot ) |
| 1199 | { |
| 1200 | return FT_GlyphLoader_CreateExtra( slot->internal->loader ); |
| 1201 | } |
| 1202 | |
| 1203 | |
David Turner | d2b1f35 | 1999-12-16 23:11:37 +0000 | [diff] [blame] | 1204 | /* END */ |