Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 1 | /***************************************************************************/ |
| 2 | /* */ |
Werner Lemberg | b5084e1 | 2000-10-28 17:10:06 +0000 | [diff] [blame] | 3 | /* t1objs.c */ |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 4 | /* */ |
Werner Lemberg | b5084e1 | 2000-10-28 17:10:06 +0000 | [diff] [blame] | 5 | /* Type 1 objects manager (body). */ |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 6 | /* */ |
Werner Lemberg | 8575117 | 2008-03-21 07:16:00 +0000 | [diff] [blame] | 7 | /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */ |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
| 9 | /* */ |
| 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 */ |
| 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. */ |
| 15 | /* */ |
| 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 |
| 21 | #include FT_INTERNAL_STREAM_H |
Werner Lemberg | 8f963be | 2003-12-18 15:29:20 +0000 | [diff] [blame] | 22 | #include FT_TRUETYPE_IDS_H |
Werner Lemberg | cc069be | 2000-12-08 16:17:16 +0000 | [diff] [blame] | 23 | |
David Turner | 8d3a401 | 2001-03-20 11:14:24 +0000 | [diff] [blame] | 24 | #include "t1gload.h" |
| 25 | #include "t1load.h" |
Werner Lemberg | f1ca234 | 2000-11-29 15:18:54 +0000 | [diff] [blame] | 26 | |
Werner Lemberg | 1f7f0e8 | 2001-06-06 17:30:41 +0000 | [diff] [blame] | 27 | #include "t1errors.h" |
| 28 | |
Werner Lemberg | f1ca234 | 2000-11-29 15:18:54 +0000 | [diff] [blame] | 29 | #ifndef T1_CONFIG_OPTION_NO_AFM |
David Turner | 8d3a401 | 2001-03-20 11:14:24 +0000 | [diff] [blame] | 30 | #include "t1afm.h" |
Werner Lemberg | f1ca234 | 2000-11-29 15:18:54 +0000 | [diff] [blame] | 31 | #endif |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 32 | |
David Turner | 7760595 | 2003-10-29 21:43:52 +0000 | [diff] [blame] | 33 | #include FT_SERVICE_POSTSCRIPT_CMAPS_H |
David Turner | 19ed8af | 2000-12-08 02:42:29 +0000 | [diff] [blame] | 34 | #include FT_INTERNAL_POSTSCRIPT_AUX_H |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 35 | |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 36 | |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 37 | /*************************************************************************/ |
| 38 | /* */ |
| 39 | /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ |
| 40 | /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ |
| 41 | /* messages during execution. */ |
| 42 | /* */ |
| 43 | #undef FT_COMPONENT |
Werner Lemberg | b5084e1 | 2000-10-28 17:10:06 +0000 | [diff] [blame] | 44 | #define FT_COMPONENT trace_t1objs |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 45 | |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 46 | |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 47 | /*************************************************************************/ |
| 48 | /* */ |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 49 | /* SIZE FUNCTIONS */ |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 50 | /* */ |
| 51 | /* note that we store the global hints in the size's "internal" root */ |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 52 | /* field */ |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 53 | /* */ |
| 54 | /*************************************************************************/ |
| 55 | |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 56 | |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 57 | static PSH_Globals_Funcs |
| 58 | T1_Size_Get_Globals_Funcs( T1_Size size ) |
| 59 | { |
Werner Lemberg | 0d9165e | 2002-03-07 21:59:59 +0000 | [diff] [blame] | 60 | T1_Face face = (T1_Face)size->root.face; |
| 61 | PSHinter_Service pshinter = (PSHinter_Service)face->pshinter; |
| 62 | FT_Module module; |
Werner Lemberg | 66b3509 | 2002-02-10 12:33:14 +0000 | [diff] [blame] | 63 | |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 64 | |
| 65 | module = FT_Get_Module( size->root.face->driver->root.library, |
| 66 | "pshinter" ); |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 67 | return ( module && pshinter && pshinter->get_globals_funcs ) |
| 68 | ? pshinter->get_globals_funcs( module ) |
| 69 | : 0 ; |
| 70 | } |
| 71 | |
| 72 | |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 73 | FT_LOCAL_DEF( void ) |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 74 | T1_Size_Done( T1_Size size ) |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 75 | { |
| 76 | if ( size->root.internal ) |
| 77 | { |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 78 | PSH_Globals_Funcs funcs; |
Werner Lemberg | 66b3509 | 2002-02-10 12:33:14 +0000 | [diff] [blame] | 79 | |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 80 | |
| 81 | funcs = T1_Size_Get_Globals_Funcs( size ); |
| 82 | if ( funcs ) |
| 83 | funcs->destroy( (PSH_Globals)size->root.internal ); |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 84 | |
| 85 | size->root.internal = 0; |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 90 | FT_LOCAL_DEF( FT_Error ) |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 91 | T1_Size_Init( T1_Size size ) |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 92 | { |
Werner Lemberg | d57a5e9 | 2008-06-18 06:16:39 +0000 | [diff] [blame^] | 93 | FT_Error error = T1_Err_Ok; |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 94 | PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size ); |
Werner Lemberg | 66b3509 | 2002-02-10 12:33:14 +0000 | [diff] [blame] | 95 | |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 96 | |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 97 | if ( funcs ) |
| 98 | { |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 99 | PSH_Globals globals; |
| 100 | T1_Face face = (T1_Face)size->root.face; |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 101 | |
Werner Lemberg | 66b3509 | 2002-02-10 12:33:14 +0000 | [diff] [blame] | 102 | |
| 103 | error = funcs->create( size->root.face->memory, |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 104 | &face->type1.private_dict, &globals ); |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 105 | if ( !error ) |
| 106 | size->root.internal = (FT_Size_Internal)(void*)globals; |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 107 | } |
Werner Lemberg | 66b3509 | 2002-02-10 12:33:14 +0000 | [diff] [blame] | 108 | |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 109 | return error; |
| 110 | } |
| 111 | |
| 112 | |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 113 | FT_LOCAL_DEF( FT_Error ) |
Wu, Chia-I (吳佳一) | bcc438b | 2006-01-23 14:12:40 +0000 | [diff] [blame] | 114 | T1_Size_Request( T1_Size size, |
| 115 | FT_Size_Request req ) |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 116 | { |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 117 | PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size ); |
David Turner | cda2d95 | 2006-02-16 22:45:31 +0000 | [diff] [blame] | 118 | |
| 119 | |
Wu, Chia-I (吳佳一) | bcc438b | 2006-01-23 14:12:40 +0000 | [diff] [blame] | 120 | FT_Request_Metrics( size->root.face, req ); |
Werner Lemberg | 66b3509 | 2002-02-10 12:33:14 +0000 | [diff] [blame] | 121 | |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 122 | if ( funcs ) |
Wu, Chia-I (吳佳一) | fa7d6ab | 2006-01-13 12:21:31 +0000 | [diff] [blame] | 123 | funcs->set_scale( (PSH_Globals)size->root.internal, |
| 124 | size->root.metrics.x_scale, |
| 125 | size->root.metrics.y_scale, |
| 126 | 0, 0 ); |
| 127 | |
| 128 | return T1_Err_Ok; |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | |
| 132 | /*************************************************************************/ |
| 133 | /* */ |
| 134 | /* SLOT FUNCTIONS */ |
| 135 | /* */ |
| 136 | /*************************************************************************/ |
| 137 | |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 138 | FT_LOCAL_DEF( void ) |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 139 | T1_GlyphSlot_Done( T1_GlyphSlot slot ) |
| 140 | { |
| 141 | slot->root.internal->glyph_hints = 0; |
| 142 | } |
| 143 | |
| 144 | |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 145 | FT_LOCAL_DEF( FT_Error ) |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 146 | T1_GlyphSlot_Init( T1_GlyphSlot slot ) |
Werner Lemberg | 66b3509 | 2002-02-10 12:33:14 +0000 | [diff] [blame] | 147 | { |
Werner Lemberg | 0d9165e | 2002-03-07 21:59:59 +0000 | [diff] [blame] | 148 | T1_Face face; |
David Turner | 4e7eeee | 2002-02-28 16:10:29 +0000 | [diff] [blame] | 149 | PSHinter_Service pshinter; |
Werner Lemberg | 66b3509 | 2002-02-10 12:33:14 +0000 | [diff] [blame] | 150 | |
Werner Lemberg | 0d9165e | 2002-03-07 21:59:59 +0000 | [diff] [blame] | 151 | |
| 152 | face = (T1_Face)slot->root.face; |
| 153 | pshinter = (PSHinter_Service)face->pshinter; |
| 154 | |
| 155 | if ( pshinter ) |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 156 | { |
| 157 | FT_Module module; |
Werner Lemberg | 66b3509 | 2002-02-10 12:33:14 +0000 | [diff] [blame] | 158 | |
Werner Lemberg | 0d9165e | 2002-03-07 21:59:59 +0000 | [diff] [blame] | 159 | |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 160 | module = FT_Get_Module( slot->root.face->driver->root.library, "pshinter" ); |
| 161 | if (module) |
| 162 | { |
| 163 | T1_Hints_Funcs funcs; |
Werner Lemberg | 66b3509 | 2002-02-10 12:33:14 +0000 | [diff] [blame] | 164 | |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 165 | funcs = pshinter->get_t1_funcs( module ); |
| 166 | slot->root.internal->glyph_hints = (void*)funcs; |
| 167 | } |
| 168 | } |
| 169 | return 0; |
| 170 | } |
Werner Lemberg | 66b3509 | 2002-02-10 12:33:14 +0000 | [diff] [blame] | 171 | |
| 172 | |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 173 | /*************************************************************************/ |
| 174 | /* */ |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 175 | /* FACE FUNCTIONS */ |
| 176 | /* */ |
| 177 | /*************************************************************************/ |
| 178 | |
| 179 | |
| 180 | /*************************************************************************/ |
| 181 | /* */ |
| 182 | /* <Function> */ |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 183 | /* T1_Face_Done */ |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 184 | /* */ |
| 185 | /* <Description> */ |
| 186 | /* The face object destructor. */ |
| 187 | /* */ |
| 188 | /* <Input> */ |
| 189 | /* face :: A typeless pointer to the face object to destroy. */ |
| 190 | /* */ |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 191 | FT_LOCAL_DEF( void ) |
Werner Lemberg | c3b2160 | 2001-12-05 01:22:05 +0000 | [diff] [blame] | 192 | T1_Face_Done( T1_Face face ) |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 193 | { |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 194 | if ( face ) |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 195 | { |
Werner Lemberg | 3d507fe | 2007-06-03 16:54:55 +0000 | [diff] [blame] | 196 | FT_Memory memory = face->root.memory; |
| 197 | T1_Font type1 = &face->type1; |
| 198 | |
David Turner | 4d3e563 | 2000-05-05 12:33:23 +0000 | [diff] [blame] | 199 | |
Werner Lemberg | b5084e1 | 2000-10-28 17:10:06 +0000 | [diff] [blame] | 200 | #ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT |
David Turner | 7c388ba | 2000-05-26 02:07:40 +0000 | [diff] [blame] | 201 | /* release multiple masters information */ |
Werner Lemberg | a4d6a1c | 2006-07-19 09:54:56 +0000 | [diff] [blame] | 202 | FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) ); |
| 203 | |
| 204 | if ( face->buildchar ) |
| 205 | { |
| 206 | FT_FREE( face->buildchar ); |
| 207 | |
| 208 | face->buildchar = NULL; |
| 209 | face->len_buildchar = 0; |
| 210 | } |
| 211 | |
Werner Lemberg | b5084e1 | 2000-10-28 17:10:06 +0000 | [diff] [blame] | 212 | T1_Done_Blend( face ); |
David Turner | 7c388ba | 2000-05-26 02:07:40 +0000 | [diff] [blame] | 213 | face->blend = 0; |
| 214 | #endif |
| 215 | |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 216 | /* release font info strings */ |
David Turner | 4d3e563 | 2000-05-05 12:33:23 +0000 | [diff] [blame] | 217 | { |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 218 | PS_FontInfo info = &type1->font_info; |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 219 | |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 220 | |
David Turner | e459d74 | 2002-03-22 13:52:37 +0000 | [diff] [blame] | 221 | FT_FREE( info->version ); |
| 222 | FT_FREE( info->notice ); |
| 223 | FT_FREE( info->full_name ); |
| 224 | FT_FREE( info->family_name ); |
| 225 | FT_FREE( info->weight ); |
David Turner | 4d3e563 | 2000-05-05 12:33:23 +0000 | [diff] [blame] | 226 | } |
| 227 | |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 228 | /* release top dictionary */ |
David Turner | e459d74 | 2002-03-22 13:52:37 +0000 | [diff] [blame] | 229 | FT_FREE( type1->charstrings_len ); |
| 230 | FT_FREE( type1->charstrings ); |
| 231 | FT_FREE( type1->glyph_names ); |
David Turner | 4d3e563 | 2000-05-05 12:33:23 +0000 | [diff] [blame] | 232 | |
David Turner | e459d74 | 2002-03-22 13:52:37 +0000 | [diff] [blame] | 233 | FT_FREE( type1->subrs ); |
| 234 | FT_FREE( type1->subrs_len ); |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 235 | |
David Turner | e459d74 | 2002-03-22 13:52:37 +0000 | [diff] [blame] | 236 | FT_FREE( type1->subrs_block ); |
| 237 | FT_FREE( type1->charstrings_block ); |
| 238 | FT_FREE( type1->glyph_names_block ); |
David Turner | 4d3e563 | 2000-05-05 12:33:23 +0000 | [diff] [blame] | 239 | |
David Turner | e459d74 | 2002-03-22 13:52:37 +0000 | [diff] [blame] | 240 | FT_FREE( type1->encoding.char_index ); |
| 241 | FT_FREE( type1->encoding.char_name ); |
| 242 | FT_FREE( type1->font_name ); |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 243 | |
Werner Lemberg | b5084e1 | 2000-10-28 17:10:06 +0000 | [diff] [blame] | 244 | #ifndef T1_CONFIG_OPTION_NO_AFM |
David Turner | 4d3e563 | 2000-05-05 12:33:23 +0000 | [diff] [blame] | 245 | /* release afm data if present */ |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 246 | if ( face->afm_data ) |
Wu, Chia-I (吳佳一) | 108fdbb | 2006-01-16 15:35:56 +0000 | [diff] [blame] | 247 | T1_Done_Metrics( memory, (AFM_FontInfo)face->afm_data ); |
David Turner | 4d3e563 | 2000-05-05 12:33:23 +0000 | [diff] [blame] | 248 | #endif |
| 249 | |
| 250 | /* release unicode map, if any */ |
David Turner | cda2d95 | 2006-02-16 22:45:31 +0000 | [diff] [blame] | 251 | #if 0 |
| 252 | FT_FREE( face->unicode_map_rec.maps ); |
| 253 | face->unicode_map_rec.num_maps = 0; |
| 254 | face->unicode_map = NULL; |
| 255 | #endif |
David Turner | 4d3e563 | 2000-05-05 12:33:23 +0000 | [diff] [blame] | 256 | |
Werner Lemberg | d57a5e9 | 2008-06-18 06:16:39 +0000 | [diff] [blame^] | 257 | face->root.family_name = NULL; |
| 258 | face->root.style_name = NULL; |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 259 | } |
| 260 | } |
| 261 | |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 262 | |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 263 | /*************************************************************************/ |
| 264 | /* */ |
| 265 | /* <Function> */ |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 266 | /* T1_Face_Init */ |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 267 | /* */ |
| 268 | /* <Description> */ |
| 269 | /* The face object constructor. */ |
| 270 | /* */ |
| 271 | /* <Input> */ |
| 272 | /* stream :: input stream where to load font data. */ |
| 273 | /* */ |
| 274 | /* face_index :: The index of the font face in the resource. */ |
| 275 | /* */ |
| 276 | /* num_params :: Number of additional generic parameters. Ignored. */ |
| 277 | /* */ |
| 278 | /* params :: Additional generic parameters. Ignored. */ |
| 279 | /* */ |
| 280 | /* <InOut> */ |
| 281 | /* face :: The face record to build. */ |
| 282 | /* */ |
| 283 | /* <Return> */ |
| 284 | /* FreeType error code. 0 means success. */ |
| 285 | /* */ |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 286 | FT_LOCAL_DEF( FT_Error ) |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 287 | T1_Face_Init( FT_Stream stream, |
Werner Lemberg | 4a2305c | 2001-06-28 07:17:51 +0000 | [diff] [blame] | 288 | T1_Face face, |
| 289 | FT_Int face_index, |
| 290 | FT_Int num_params, |
| 291 | FT_Parameter* params ) |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 292 | { |
Werner Lemberg | 40bb096 | 2003-11-01 14:36:20 +0000 | [diff] [blame] | 293 | FT_Error error; |
David Turner | 7760595 | 2003-10-29 21:43:52 +0000 | [diff] [blame] | 294 | FT_Service_PsCMaps psnames; |
Werner Lemberg | 40bb096 | 2003-11-01 14:36:20 +0000 | [diff] [blame] | 295 | PSAux_Service psaux; |
| 296 | T1_Font type1 = &face->type1; |
| 297 | PS_FontInfo info = &type1->font_info; |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 298 | |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 299 | FT_UNUSED( num_params ); |
| 300 | FT_UNUSED( params ); |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 301 | FT_UNUSED( stream ); |
| 302 | |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 303 | |
| 304 | face->root.num_faces = 1; |
| 305 | |
David Turner | 7760595 | 2003-10-29 21:43:52 +0000 | [diff] [blame] | 306 | FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS ); |
David Turner | b72d8a8 | 2003-09-29 20:33:37 +0000 | [diff] [blame] | 307 | face->psnames = psnames; |
David Turner | 95bec28 | 2000-02-15 12:55:57 +0000 | [diff] [blame] | 308 | |
Werner Lemberg | 1305f26 | 2002-03-28 08:07:16 +0000 | [diff] [blame] | 309 | face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), |
| 310 | "psaux" ); |
| 311 | psaux = (PSAux_Service)face->psaux; |
David Turner | c312861 | 2000-06-23 05:02:13 +0000 | [diff] [blame] | 312 | |
Werner Lemberg | 1305f26 | 2002-03-28 08:07:16 +0000 | [diff] [blame] | 313 | face->pshinter = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), |
| 314 | "pshinter" ); |
David Turner | 9748807 | 2000-08-22 22:36:33 +0000 | [diff] [blame] | 315 | |
Werner Lemberg | fdc042b | 2003-06-12 04:59:07 +0000 | [diff] [blame] | 316 | /* open the tokenizer; this will also check the font format */ |
Werner Lemberg | b5084e1 | 2000-10-28 17:10:06 +0000 | [diff] [blame] | 317 | error = T1_Open_Face( face ); |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 318 | if ( error ) |
| 319 | goto Exit; |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 320 | |
| 321 | /* if we just wanted to check the format, leave successfully now */ |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 322 | if ( face_index < 0 ) |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 323 | goto Exit; |
| 324 | |
| 325 | /* check the face index */ |
| 326 | if ( face_index != 0 ) |
| 327 | { |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 328 | FT_ERROR(( "T1_Face_Init: invalid face index\n" )); |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 329 | error = T1_Err_Invalid_Argument; |
| 330 | goto Exit; |
| 331 | } |
| 332 | |
Werner Lemberg | fdc042b | 2003-06-12 04:59:07 +0000 | [diff] [blame] | 333 | /* now load the font program into the face object */ |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 334 | |
Werner Lemberg | fdc042b | 2003-06-12 04:59:07 +0000 | [diff] [blame] | 335 | /* initialize the face object fields */ |
| 336 | |
| 337 | /* set up root face fields */ |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 338 | { |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 339 | FT_Face root = (FT_Face)&face->root; |
| 340 | |
| 341 | |
Werner Lemberg | 65ba724 | 2003-05-30 09:12:50 +0000 | [diff] [blame] | 342 | root->num_glyphs = type1->num_glyphs; |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 343 | root->face_index = face_index; |
Werner Lemberg | bd889e5 | 2002-05-12 19:59:17 +0000 | [diff] [blame] | 344 | |
Werner Lemberg | 7734a1f | 2005-10-05 15:18:29 +0000 | [diff] [blame] | 345 | root->face_flags = FT_FACE_FLAG_SCALABLE | |
| 346 | FT_FACE_FLAG_HORIZONTAL | |
| 347 | FT_FACE_FLAG_GLYPH_NAMES | |
| 348 | FT_FACE_FLAG_HINTER; |
David Turner | 6930b45 | 2000-07-19 17:13:03 +0000 | [diff] [blame] | 349 | |
Werner Lemberg | 64f1ba9 | 2003-07-25 22:09:53 +0000 | [diff] [blame] | 350 | if ( info->is_fixed_pitch ) |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 351 | root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; |
| 352 | |
| 353 | if ( face->blend ) |
| 354 | root->face_flags |= FT_FACE_FLAG_MULTIPLE_MASTERS; |
| 355 | |
| 356 | /* XXX: TODO -- add kerning with .afm support */ |
| 357 | |
Werner Lemberg | d57a5e9 | 2008-06-18 06:16:39 +0000 | [diff] [blame^] | 358 | |
| 359 | /* The following code to extract the family and the style is very */ |
| 360 | /* simplistic and might get some things wrong. For a full-featured */ |
| 361 | /* algorithm you might have a look at the whitepaper given at */ |
| 362 | /* */ |
| 363 | /* http://blogs.msdn.com/text/archive/2007/04/23/wpf-font-selection-model.aspx */ |
| 364 | |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 365 | /* get style name -- be careful, some broken fonts only */ |
| 366 | /* have a `/FontName' dictionary entry! */ |
Werner Lemberg | 65ba724 | 2003-05-30 09:12:50 +0000 | [diff] [blame] | 367 | root->family_name = info->family_name; |
Werner Lemberg | d57a5e9 | 2008-06-18 06:16:39 +0000 | [diff] [blame^] | 368 | root->style_name = NULL; |
Werner Lemberg | 8575117 | 2008-03-21 07:16:00 +0000 | [diff] [blame] | 369 | |
Werner Lemberg | d57a5e9 | 2008-06-18 06:16:39 +0000 | [diff] [blame^] | 370 | if ( root->family_name ) |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 371 | { |
Werner Lemberg | 65ba724 | 2003-05-30 09:12:50 +0000 | [diff] [blame] | 372 | char* full = info->full_name; |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 373 | char* family = root->family_name; |
David Turner | e49ab25 | 2000-05-16 23:44:38 +0000 | [diff] [blame] | 374 | |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 375 | |
David Turner | 662b344 | 2002-01-03 16:56:59 +0000 | [diff] [blame] | 376 | if ( full ) |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 377 | { |
Werner Lemberg | 64591b7 | 2003-06-01 21:30:04 +0000 | [diff] [blame] | 378 | while ( *full ) |
David Turner | 662b344 | 2002-01-03 16:56:59 +0000 | [diff] [blame] | 379 | { |
Werner Lemberg | 64591b7 | 2003-06-01 21:30:04 +0000 | [diff] [blame] | 380 | if ( *full == *family ) |
| 381 | { |
| 382 | family++; |
| 383 | full++; |
| 384 | } |
| 385 | else |
| 386 | { |
| 387 | if ( *full == ' ' || *full == '-' ) |
| 388 | full++; |
| 389 | else if ( *family == ' ' || *family == '-' ) |
| 390 | family++; |
| 391 | else |
| 392 | { |
| 393 | if ( !*family ) |
| 394 | root->style_name = full; |
| 395 | break; |
| 396 | } |
| 397 | } |
David Turner | 662b344 | 2002-01-03 16:56:59 +0000 | [diff] [blame] | 398 | } |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 399 | } |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 400 | } |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 401 | else |
| 402 | { |
| 403 | /* do we have a `/FontName'? */ |
Werner Lemberg | 65ba724 | 2003-05-30 09:12:50 +0000 | [diff] [blame] | 404 | if ( type1->font_name ) |
Werner Lemberg | 65ba724 | 2003-05-30 09:12:50 +0000 | [diff] [blame] | 405 | root->family_name = type1->font_name; |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 406 | } |
| 407 | |
Werner Lemberg | d57a5e9 | 2008-06-18 06:16:39 +0000 | [diff] [blame^] | 408 | if ( !root->style_name ) |
| 409 | { |
| 410 | if ( info->weight ) |
| 411 | root->style_name = info->weight; |
| 412 | else |
| 413 | /* assume "Regular" style because we don't know better */ |
| 414 | root->style_name = (char *)"Regular"; |
| 415 | } |
| 416 | |
Werner Lemberg | 6dd303d | 2000-11-26 21:25:53 +0000 | [diff] [blame] | 417 | /* compute style flags */ |
| 418 | root->style_flags = 0; |
Werner Lemberg | 64f1ba9 | 2003-07-25 22:09:53 +0000 | [diff] [blame] | 419 | if ( info->italic_angle ) |
Werner Lemberg | 6dd303d | 2000-11-26 21:25:53 +0000 | [diff] [blame] | 420 | root->style_flags |= FT_STYLE_FLAG_ITALIC; |
Werner Lemberg | 65ba724 | 2003-05-30 09:12:50 +0000 | [diff] [blame] | 421 | if ( info->weight ) |
Werner Lemberg | 6dd303d | 2000-11-26 21:25:53 +0000 | [diff] [blame] | 422 | { |
Werner Lemberg | 65ba724 | 2003-05-30 09:12:50 +0000 | [diff] [blame] | 423 | if ( !ft_strcmp( info->weight, "Bold" ) || |
| 424 | !ft_strcmp( info->weight, "Black" ) ) |
Werner Lemberg | 6dd303d | 2000-11-26 21:25:53 +0000 | [diff] [blame] | 425 | root->style_flags |= FT_STYLE_FLAG_BOLD; |
| 426 | } |
| 427 | |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 428 | /* no embedded bitmap support */ |
| 429 | root->num_fixed_sizes = 0; |
| 430 | root->available_sizes = 0; |
| 431 | |
Werner Lemberg | 65ba724 | 2003-05-30 09:12:50 +0000 | [diff] [blame] | 432 | root->bbox.xMin = type1->font_bbox.xMin >> 16; |
| 433 | root->bbox.yMin = type1->font_bbox.yMin >> 16; |
| 434 | root->bbox.xMax = ( type1->font_bbox.xMax + 0xFFFFU ) >> 16; |
| 435 | root->bbox.yMax = ( type1->font_bbox.yMax + 0xFFFFU ) >> 16; |
Tom Kacvinsky | 7b91bea | 2001-02-07 01:14:53 +0000 | [diff] [blame] | 436 | |
| 437 | /* Set units_per_EM if we didn't set it in parse_font_matrix. */ |
| 438 | if ( !root->units_per_EM ) |
| 439 | root->units_per_EM = 1000; |
| 440 | |
David Turner | acfea4d | 2002-03-06 12:38:15 +0000 | [diff] [blame] | 441 | root->ascender = (FT_Short)( root->bbox.yMax ); |
| 442 | root->descender = (FT_Short)( root->bbox.yMin ); |
Wu, Chia-I (吳佳一) | 5d14685 | 2006-01-31 10:29:44 +0000 | [diff] [blame] | 443 | |
| 444 | root->height = (FT_Short)( ( root->units_per_EM * 12 ) / 10 ); |
| 445 | if ( root->height < root->ascender - root->descender ) |
David Turner | da95af6 | 2006-03-20 13:32:33 +0000 | [diff] [blame] | 446 | root->height = (FT_Short)( root->ascender - root->descender ); |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 447 | |
| 448 | /* now compute the maximum advance width */ |
Werner Lemberg | 521a2d7 | 2001-03-20 22:58:56 +0000 | [diff] [blame] | 449 | root->max_advance_width = |
David Turner | acfea4d | 2002-03-06 12:38:15 +0000 | [diff] [blame] | 450 | (FT_Short)( root->bbox.xMax ); |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 451 | { |
Werner Lemberg | 7386197 | 2003-06-05 04:31:05 +0000 | [diff] [blame] | 452 | FT_Pos max_advance; |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 453 | |
| 454 | |
Werner Lemberg | b5084e1 | 2000-10-28 17:10:06 +0000 | [diff] [blame] | 455 | error = T1_Compute_Max_Advance( face, &max_advance ); |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 456 | |
| 457 | /* in case of error, keep the standard width */ |
| 458 | if ( !error ) |
David Turner | 8edbcab | 2001-06-19 08:28:24 +0000 | [diff] [blame] | 459 | root->max_advance_width = (FT_Short)max_advance; |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 460 | else |
Werner Lemberg | d57a5e9 | 2008-06-18 06:16:39 +0000 | [diff] [blame^] | 461 | error = T1_Err_Ok; /* clear error */ |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 462 | } |
| 463 | |
| 464 | root->max_advance_height = root->height; |
| 465 | |
Werner Lemberg | 9472e23 | 2004-02-14 19:21:37 +0000 | [diff] [blame] | 466 | root->underline_position = (FT_Short)info->underline_position; |
| 467 | root->underline_thickness = (FT_Short)info->underline_thickness; |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 468 | } |
| 469 | |
David Turner | fa77c87 | 2002-03-22 15:56:12 +0000 | [diff] [blame] | 470 | { |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 471 | FT_Face root = &face->root; |
Werner Lemberg | bd889e5 | 2002-05-12 19:59:17 +0000 | [diff] [blame] | 472 | |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 473 | |
David Turner | fa77c87 | 2002-03-22 15:56:12 +0000 | [diff] [blame] | 474 | if ( psnames && psaux ) |
| 475 | { |
| 476 | FT_CharMapRec charmap; |
David Turner | ed54f28 | 2002-03-22 17:09:52 +0000 | [diff] [blame] | 477 | T1_CMap_Classes cmap_classes = psaux->t1_cmap_classes; |
David Turner | fa77c87 | 2002-03-22 15:56:12 +0000 | [diff] [blame] | 478 | FT_CMap_Class clazz; |
Werner Lemberg | bd889e5 | 2002-05-12 19:59:17 +0000 | [diff] [blame] | 479 | |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 480 | |
David Turner | fa77c87 | 2002-03-22 15:56:12 +0000 | [diff] [blame] | 481 | charmap.face = root; |
Werner Lemberg | bd889e5 | 2002-05-12 19:59:17 +0000 | [diff] [blame] | 482 | |
David Turner | fa77c87 | 2002-03-22 15:56:12 +0000 | [diff] [blame] | 483 | /* first of all, try to synthetize a Unicode charmap */ |
| 484 | charmap.platform_id = 3; |
| 485 | charmap.encoding_id = 1; |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 486 | charmap.encoding = FT_ENCODING_UNICODE; |
Werner Lemberg | bd889e5 | 2002-05-12 19:59:17 +0000 | [diff] [blame] | 487 | |
David Turner | ed54f28 | 2002-03-22 17:09:52 +0000 | [diff] [blame] | 488 | FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); |
Werner Lemberg | bd889e5 | 2002-05-12 19:59:17 +0000 | [diff] [blame] | 489 | |
David Turner | fa77c87 | 2002-03-22 15:56:12 +0000 | [diff] [blame] | 490 | /* now, generate an Adobe Standard encoding when appropriate */ |
| 491 | charmap.platform_id = 7; |
| 492 | clazz = NULL; |
Werner Lemberg | bd889e5 | 2002-05-12 19:59:17 +0000 | [diff] [blame] | 493 | |
Werner Lemberg | 65ba724 | 2003-05-30 09:12:50 +0000 | [diff] [blame] | 494 | switch ( type1->encoding_type ) |
David Turner | fa77c87 | 2002-03-22 15:56:12 +0000 | [diff] [blame] | 495 | { |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 496 | case T1_ENCODING_TYPE_STANDARD: |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 497 | charmap.encoding = FT_ENCODING_ADOBE_STANDARD; |
Werner Lemberg | 8f963be | 2003-12-18 15:29:20 +0000 | [diff] [blame] | 498 | charmap.encoding_id = TT_ADOBE_ID_STANDARD; |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 499 | clazz = cmap_classes->standard; |
| 500 | break; |
Werner Lemberg | bd889e5 | 2002-05-12 19:59:17 +0000 | [diff] [blame] | 501 | |
| 502 | case T1_ENCODING_TYPE_EXPERT: |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 503 | charmap.encoding = FT_ENCODING_ADOBE_EXPERT; |
Werner Lemberg | 8f963be | 2003-12-18 15:29:20 +0000 | [diff] [blame] | 504 | charmap.encoding_id = TT_ADOBE_ID_EXPERT; |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 505 | clazz = cmap_classes->expert; |
| 506 | break; |
Werner Lemberg | bd889e5 | 2002-05-12 19:59:17 +0000 | [diff] [blame] | 507 | |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 508 | case T1_ENCODING_TYPE_ARRAY: |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 509 | charmap.encoding = FT_ENCODING_ADOBE_CUSTOM; |
Werner Lemberg | 8f963be | 2003-12-18 15:29:20 +0000 | [diff] [blame] | 510 | charmap.encoding_id = TT_ADOBE_ID_CUSTOM; |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 511 | clazz = cmap_classes->custom; |
| 512 | break; |
Werner Lemberg | bd889e5 | 2002-05-12 19:59:17 +0000 | [diff] [blame] | 513 | |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 514 | case T1_ENCODING_TYPE_ISOLATIN1: |
David Turner | b08fe2d | 2002-08-27 20:20:29 +0000 | [diff] [blame] | 515 | charmap.encoding = FT_ENCODING_ADOBE_LATIN_1; |
Werner Lemberg | 8f963be | 2003-12-18 15:29:20 +0000 | [diff] [blame] | 516 | charmap.encoding_id = TT_ADOBE_ID_LATIN_1; |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 517 | clazz = cmap_classes->unicode; |
| 518 | break; |
Werner Lemberg | bd889e5 | 2002-05-12 19:59:17 +0000 | [diff] [blame] | 519 | |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 520 | default: |
| 521 | ; |
David Turner | fa77c87 | 2002-03-22 15:56:12 +0000 | [diff] [blame] | 522 | } |
Werner Lemberg | bd889e5 | 2002-05-12 19:59:17 +0000 | [diff] [blame] | 523 | |
David Turner | fa77c87 | 2002-03-22 15:56:12 +0000 | [diff] [blame] | 524 | if ( clazz ) |
David Turner | ed54f28 | 2002-03-22 17:09:52 +0000 | [diff] [blame] | 525 | FT_CMap_New( clazz, NULL, &charmap, NULL ); |
Werner Lemberg | 0bb4a0f | 2002-06-19 15:57:55 +0000 | [diff] [blame] | 526 | |
David Turner | fed59b7 | 2002-07-17 22:51:06 +0000 | [diff] [blame] | 527 | #if 0 |
Werner Lemberg | 0bb4a0f | 2002-06-19 15:57:55 +0000 | [diff] [blame] | 528 | /* Select default charmap */ |
| 529 | if (root->num_charmaps) |
| 530 | root->charmap = root->charmaps[0]; |
David Turner | fed59b7 | 2002-07-17 22:51:06 +0000 | [diff] [blame] | 531 | #endif |
David Turner | fa77c87 | 2002-03-22 15:56:12 +0000 | [diff] [blame] | 532 | } |
| 533 | } |
| 534 | |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 535 | Exit: |
| 536 | return error; |
| 537 | } |
| 538 | |
| 539 | |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 540 | /*************************************************************************/ |
| 541 | /* */ |
| 542 | /* <Function> */ |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 543 | /* T1_Driver_Init */ |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 544 | /* */ |
| 545 | /* <Description> */ |
| 546 | /* Initializes a given Type 1 driver object. */ |
| 547 | /* */ |
| 548 | /* <Input> */ |
| 549 | /* driver :: A handle to the target driver object. */ |
| 550 | /* */ |
| 551 | /* <Return> */ |
| 552 | /* FreeType error code. 0 means success. */ |
| 553 | /* */ |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 554 | FT_LOCAL_DEF( FT_Error ) |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 555 | T1_Driver_Init( T1_Driver driver ) |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 556 | { |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 557 | FT_UNUSED( driver ); |
| 558 | |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 559 | return T1_Err_Ok; |
| 560 | } |
| 561 | |
| 562 | |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 563 | /*************************************************************************/ |
| 564 | /* */ |
| 565 | /* <Function> */ |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 566 | /* T1_Driver_Done */ |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 567 | /* */ |
| 568 | /* <Description> */ |
| 569 | /* Finalizes a given Type 1 driver. */ |
| 570 | /* */ |
| 571 | /* <Input> */ |
Werner Lemberg | efa9961 | 2002-04-01 22:01:46 +0000 | [diff] [blame] | 572 | /* driver :: A handle to the target Type 1 driver. */ |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 573 | /* */ |
David Turner | bc82f1b | 2002-03-01 02:26:22 +0000 | [diff] [blame] | 574 | FT_LOCAL_DEF( void ) |
David Turner | 5893c1b | 2001-10-18 11:49:26 +0000 | [diff] [blame] | 575 | T1_Driver_Done( T1_Driver driver ) |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 576 | { |
Werner Lemberg | 7fa51b5 | 2000-07-08 19:51:42 +0000 | [diff] [blame] | 577 | FT_UNUSED( driver ); |
David Turner | 2dfb5ac | 2000-01-27 14:02:04 +0000 | [diff] [blame] | 578 | } |
| 579 | |
| 580 | |
| 581 | /* END */ |