* include/freetype/internal/ftobjs.h: changing the definition of FT_CMap_CharNextFunc slightly * src/cff/*.c: updating CFF type definitions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376
diff --git a/ChangeLog b/ChangeLog
index 489c023..fec37e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-03-20 David Turner <david@freetype.org>
+
+ * include/freetype/internal/ftobjs.h: changing the definition of
+ FT_CMap_CharNextFunc slightly
+
+ * src/cff/*.c: updating CFF type definitions.
+
2002-03-14 David Turner <david@freetype.org>
* include/freetype/internal/autohint.h, src/autohint/ahmodule.c,
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index 6459c6c..d269d1e 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -214,9 +214,8 @@ FT_BEGIN_HEADER
typedef FT_UInt (*FT_CMap_CharIndexFunc)( FT_CMap cmap,
FT_UInt32 char_code );
- typedef FT_UInt32 (*FT_CMap_CharNextFunc)( FT_CMap cmap,
- FT_UInt32 char_code,
- FT_UInt *agindex );
+ typedef FT_UInt (*FT_CMap_CharNextFunc)( FT_CMap cmap,
+ FT_UInt32 *achar_code );
typedef struct FT_CMap_ClassRec_
{
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index c270ac0..9ee3e03 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -1515,10 +1515,10 @@
static FT_Error
CFF_Load_Charset( CFF_Charset charset,
- FT_UInt num_glyphs,
- FT_Stream stream,
- FT_ULong base_offset,
- FT_ULong offset )
+ FT_UInt num_glyphs,
+ FT_Stream stream,
+ FT_ULong base_offset,
+ FT_ULong offset )
{
FT_Memory memory = stream->memory;
FT_Error error = 0;
@@ -1964,7 +1964,7 @@
FT_ULong base_offset )
{
FT_Error error;
- CFF_Parser parser;
+ CFF_ParserRec parser;
FT_Byte* dict;
FT_ULong dict_len;
CFF_FontRecDict top = &font->font_dict;
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 5061396..b3631ba 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -248,125 +248,6 @@
}
-#if 0
-
- /* this function is used to build a Unicode charmap from the glyph names */
- /* in a file */
- static FT_Error
- CFF_Build_Unicode_Charmap( CFF_Face face,
- FT_ULong base_offset,
- PSNames_Service psnames )
- {
- CFF_Font font = (CFF_Font)face->extra.data;
- FT_Memory memory = FT_FACE_MEMORY(face);
- FT_UInt n, num_glyphs = face->root.num_glyphs;
- const char** glyph_names;
- FT_Error error;
- CFF_FontRecDict dict = &font->top_font.font_dict;
- FT_ULong charset_offset;
- FT_Byte format;
- FT_Stream stream = face->root.stream;
-
-
- charset_offset = dict->charset_offset;
- if ( !charset_offset )
- {
- FT_ERROR(( "CFF_Build_Unicode_Charmap: charset table is missing\n" ));
- error = CFF_Err_Invalid_File_Format;
- goto Exit;
- }
-
- /* allocate the charmap */
- if ( ALLOC( face->charmap, ...
-
- /* seek to charset table and allocate glyph names table */
- if ( FILE_Seek( base_offset + charset_offset ) ||
- ALLOC_ARRAY( glyph_names, num_glyphs, const char* ) )
- goto Exit;
-
- /* now, read each glyph name and store it in the glyph name table */
- if ( READ_Byte( format ) )
- goto Fail;
-
- switch ( format )
- {
- case 0: /* format 0 - one SID per glyph */
- {
- const char** gname = glyph_names;
- const char** limit = gname + num_glyphs;
-
-
- if ( ACCESS_Frame( num_glyphs * 2 ) )
- goto Fail;
-
- for ( ; gname < limit; gname++ )
- gname[0] = CFF_Get_String( &font->string_index,
- GET_UShort(),
- psnames );
- FORGET_Frame();
- break;
- }
-
- case 1: /* format 1 - sequential ranges */
- case 2: /* format 2 - sequential ranges with 16-bit counts */
- {
- const char** gname = glyph_names;
- const char** limit = gname + num_glyphs;
- FT_UInt len = 3;
-
-
- if ( format == 2 )
- len++;
-
- while ( gname < limit )
- {
- FT_UInt first;
- FT_UInt count;
-
-
- if ( ACCESS_Frame( len ) )
- goto Fail;
-
- first = GET_UShort();
- if ( format == 3 )
- count = GET_UShort();
- else
- count = GET_Byte();
-
- FORGET_Frame();
-
- for ( ; count > 0; count-- )
- {
- gname[0] = CFF_Get_String( &font->string_index,
- first,
- psnames );
- gname++;
- first++;
- }
- }
- break;
- }
-
- default: /* unknown charset format! */
- FT_ERROR(( "CFF_Build_Unicode_Charmap: unknown charset format!\n" ));
- error = CFF_Err_Invalid_File_Format;
- goto Fail;
- }
-
- /* all right, the glyph names were loaded; we now need to create */
- /* the corresponding unicode charmap */
-
- Fail:
- for ( n = 0; n < num_glyphs; n++ )
- FREE( glyph_names[n] );
-
- FREE( glyph_names );
-
- Exit:
- return error;
- }
-
-#endif /* 0 */
static FT_Encoding
@@ -418,29 +299,6 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* CFF_Face_Init */
- /* */
- /* <Description> */
- /* Initializes a given OpenType face object. */
- /* */
- /* <Input> */
- /* stream :: The source font stream. */
- /* */
- /* face_index :: The index of the font face in the resource. */
- /* */
- /* num_params :: Number of additional generic parameters. Ignored. */
- /* */
- /* params :: Additional generic parameters. Ignored. */
- /* */
- /* <InOut> */
- /* face :: The newly built face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
FT_LOCAL_DEF( FT_Error )
CFF_Face_Init( FT_Stream stream,
CFF_Face face,
@@ -694,17 +552,6 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* CFF_Face_Done */
- /* */
- /* <Description> */
- /* Finalizes a given face object. */
- /* */
- /* <Input> */
- /* face :: A pointer to the face object to destroy. */
- /* */
FT_LOCAL_DEF( void )
CFF_Face_Done( CFF_Face face )
{
@@ -728,20 +575,6 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* CFF_Driver_Init */
- /* */
- /* <Description> */
- /* Initializes a given OpenType driver object. */
- /* */
- /* <Input> */
- /* driver :: A handle to the target driver object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
FT_LOCAL_DEF( FT_Error )
CFF_Driver_Init( CFF_Driver driver )
{
@@ -761,17 +594,6 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* CFF_Driver_Done */
- /* */
- /* <Description> */
- /* Finalizes a given OpenType driver. */
- /* */
- /* <Input> */
- /* driver :: A handle to the target OpenType driver. */
- /* */
FT_LOCAL_DEF( void )
CFF_Driver_Done( CFF_Driver driver )
{
diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c
index 515c396..65a49c8 100644
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -48,7 +48,7 @@
/* now generate handlers for the most simple fields */
- typedef FT_Error (*CFF_Field_Reader)( CFF_Parser* parser );
+ typedef FT_Error (*CFF_Field_Reader)( CFF_Parser parser );
typedef struct CFF_Field_Handler_
{
@@ -64,7 +64,7 @@
FT_LOCAL_DEF( void )
- CFF_Parser_Init( CFF_Parser* parser,
+ CFF_Parser_Init( CFF_Parser parser,
FT_UInt code,
void* object )
{
@@ -311,7 +311,7 @@
}
static FT_Error
- cff_parse_font_matrix( CFF_Parser* parser )
+ cff_parse_font_matrix( CFF_Parser parser )
{
CFF_FontRecDict dict = (CFF_FontRecDict)parser->object;
FT_Matrix* matrix = &dict->font_matrix;
@@ -359,7 +359,7 @@
static FT_Error
- cff_parse_font_bbox( CFF_Parser* parser )
+ cff_parse_font_bbox( CFF_Parser parser )
{
CFF_FontRecDict dict = (CFF_FontRecDict)parser->object;
FT_BBox* bbox = &dict->font_bbox;
@@ -383,7 +383,7 @@
static FT_Error
- cff_parse_private_dict( CFF_Parser* parser )
+ cff_parse_private_dict( CFF_Parser parser )
{
CFF_FontRecDict dict = (CFF_FontRecDict)parser->object;
FT_Byte** data = parser->stack;
@@ -404,7 +404,7 @@
static FT_Error
- cff_parse_cid_ros( CFF_Parser* parser )
+ cff_parse_cid_ros( CFF_Parser parser )
{
CFF_FontRecDict dict = (CFF_FontRecDict)parser->object;
FT_Byte** data = parser->stack;
@@ -480,7 +480,7 @@
FT_LOCAL_DEF( FT_Error )
- CFF_Parser_Run( CFF_Parser* parser,
+ CFF_Parser_Run( CFF_Parser parser,
FT_Byte* start,
FT_Byte* limit )
{
diff --git a/src/cff/cffparse.h b/src/cff/cffparse.h
index 39e45b1..045fa25 100644
--- a/src/cff/cffparse.h
+++ b/src/cff/cffparse.h
@@ -34,7 +34,7 @@ FT_BEGIN_HEADER
#define CFF_CODE_PRIVATE 0x2000
- typedef struct CFF_Parser_
+ typedef struct CFF_ParserRec_
{
FT_Byte* start;
FT_Byte* limit;
@@ -46,16 +46,16 @@ FT_BEGIN_HEADER
FT_UInt object_code;
void* object;
- } CFF_Parser;
+ } CFF_ParserRec, *CFF_Parser;
FT_LOCAL( void )
- CFF_Parser_Init( CFF_Parser* parser,
+ CFF_Parser_Init( CFF_Parser parser,
FT_UInt code,
void* object );
FT_LOCAL( FT_Error )
- CFF_Parser_Run( CFF_Parser* parser,
+ CFF_Parser_Run( CFF_Parser parser,
FT_Byte* start,
FT_Byte* limit );