* src/cache/ftccache.c (ftc_node_hash_unlink, ftc_node_hash_link)

[FTC_CACHE_USE_LINEAR_HASHING]: Fix returned error code.
Fix debugging messages.

* src/type42/t42error.h: New file.
* src/type42/t42drivr.c, src/type42/t42objs.c,
src/type42/t42parse.c: Use t42 error codes.
* src/type42/rules.mk: Updated.

* src/base/ftnames.c: Include FT_INTERNAL_STREAM_H.

Formatting, adding copyright messages.
This commit is contained in:
Werner Lemberg 2002-06-08 06:47:18 +00:00
parent 5a2f39e8ed
commit 8c90c22dbe
15 changed files with 411 additions and 151 deletions

112
ChangeLog
View File

@ -1,27 +1,113 @@
2002-06-08 Werner Lemberg <wl@gnu.org>
* src/cache/ftccache.c (ftc_node_hash_unlink, ftc_node_hash_link)
[FTC_CACHE_USE_LINEAR_HASHING]: Fix returned error code.
Fix debugging messages.
* src/type42/t42error.h: New file.
* src/type42/t42drivr.c, src/type42/t42objs.c,
src/type42/t42parse.c: Use t42 error codes.
* src/type42/rules.mk: Updated.
* src/base/ftnames.c: Include FT_INTERNAL_STREAM_H.
2002-06-08 David Turner <david@freetype.org>
* src/cache/ftccmap.c: GEN_CACHE_FAMILY_COMPARE,
GEN_CACHE_NODE_COMPARE, GEN_CACHE_LOOKUP) [FTC_CACHE_USE_INLINE]:
New macros.
(ftc_cmap_cache_lookup) [!FTC_CACHE_USE_INLINE]: Typedef to
ftc_cache_lookup.
(FTC_CMapCache_Lookup): Updated.
2002-06-07 Graham Asher <graham.asher@btinternet.com>
* include/freetype/cache/ftccache.h, src/cache/ftccache.c,
src/cache/ftccache.i, src/cache/ftcsbits.c: adding various
experimental optimisations to the cache manager
Adding various experimental optimizations to the cache manager.
* src/type42/t42parse.c: removing duplicate function
* include/freetype/cache/ftccache.h (FTC_CACHE_USE_INLINE,
FTC_CACHE_USE_LINEAR_HASHING): New options.
(FTC_CacheRec) [FTC_CACHE_USE_LINEAR_HASHING]: New elements `p',
`mask', and `slack'.
* src/base/ftobjs.c (FT_Render_Glyph_Internal): changed definition
from FT_EXPORT_DEF to FT_BASE_DEF
* src/cache/ftccache.c (FTC_HASH_MAX_LOAD, FTC_HASH_MIN_LOAD,
FTC_HASH_SUB_LOAD) [FTC_CACHE_USE_LINEAR_HASHING,
FTC_HASH_INITIAL_SIZE]: New macros.
(ftc_node_mru_link, ftc_node_mru_up): Optimized.
(ftc_node_hash_unlink, ftc_node_hash_link)
[FTC_CACHE_USE_LINEAR_HASHING]: New variants.
(FTC_PRIMES_MIN, FTC_PRIMES_MAX, ftc_primes, ftc_prime_closest,
FTC_CACHE_RESIZE_TEST, ftc_cache_resize)
[!FTC_CACHE_USE_LINEAR_HASHING]: Define it conditionally.
(ftc_cache_init, ftc_cache_clear) [FTC_CACHE_USE_LINEAR_HASHING]:
Updated.
(ftc_cache_lookup) [FTC_CACHE_USE_LINEAR_HASHING]: Implement it.
* src/cache/ftccache.i: New file.
* src/cache/ftcsbits.c (GEN_CACHE_FAMILY_COMPARE,
GEN_CACHE_NODE_COMPARE, GEN_CACHE_LOOKUP) [FTC_CACHE_USE_INLINE]:
New macros.
(ftc_sbit_cache_lookup) [!FTC_CACHE_USE_INLINE]: Typedef to
ftc_cache_lookup.
(FTC_SBitCache_Lookup): Updated.
* src/type42/t42parse.c: Removing duplicate function.
* src/base/ftobjs.c (FT_Render_Glyph_Internal): Changed definition
from FT_EXPORT_DEF to FT_BASE_DEF.
2002-06-07 David Turner <david@freetype.org>
* src/type42/t42drivr.c, src/type42/t42drivr.h, src/type42/t42parse.c,
src/type42/t42parse.h, src/type42/t42objs.h, src/type42/t42objs.c,
src/type42/type42.c:
Fixed the bug that prevented the correct display of fonts with
"ftview".
updated the Type42 driver by splitting it into several files since
it makes the code easier to read and maintain. Also fixed the bug
that prevented the correct display of fonts with "ftview"
* src/type42/t42drivr.c: Split into...
* src/type42/t42drivr.h, src/type42/t42parse.c,
src/type42/t42parse.h, src/type42/t42objs.h, src/type42/t42objs.c,
src/type42/type42.c: New files.
(t42_get_glyph_name, t42_get_ps_name, t42_get_name_index): Use
`face->type1'.
(Get_Interface): Renamed to...
(T42_Get_Interface): This.
Updated.
(T42_Open_Face, T42_Face_Done): Updated.
(T42_Face_Init): Add new cmap support.
Updated.
(T42_Driver_Init, T42_Driver_Done, T42_Size_Init, T42_Size_Done,
T42_GlyphSlot_Init, T42_GlyphSlot_Done): Updated.
(Get_Char_Index, Get_Next_Char): Renamed to...
(T42_CMap_CharIndex, T42_CMap_CharNext): This.
Updated.
(T42_Char_Size, T42_Pixel_Size): Renamed to...
(T42_Size_SetChars, T42_Size_SetPixels): This.
(T42_Load_Glyph): Renamed to...
(T42_GlyphSlot_Load): This.
(t42_init_loader, t42_done_loader): Renamed to...
(t42_loader_init, t42_loader_done): This.
(T42_New_Parser, T42_Finalize_Parser): Renamed to...
(t42_parser_init, t42_parser_done): This.
(parse_dict): Renamed to...
(t42_parse_dict): This.
(is_alpha, is_space, hexval): Renamed to...
(t42_is_alpha, t42_is_space, t42_hexval): This.
(parse_font_name, parse_font_bbox, parse_font_matrix,
parse_encoding, parse_sfnts, parse_charstrings, parse_dict):
Renamed to...
(t42_parse_font_name, t42_parse_font_bbox, t42_parse_font_matrix,
t42_parse_encoding, t42_parse_sfnts, t42_parse_charstrings,
t42_parse_dict): This.
Updated.
(t42_keywords): Updated.
* src/type42/Jamfile, src/type42/descrip.mms: Updated.
2002-06-03 Werner Lemberg <wl@gnu.org>
Add 8bpp support.
Add 8bpp support to BDF driver.
* src/bdf/bdflib.c (_bdf_parse_start): Handle 8bpp.
* src/bdf/bdfdrivr.c (BDF_Glyph_Load): Ditto.

View File

@ -4,7 +4,7 @@
/* */
/* FreeType internal cache interface (specification). */
/* */
/* Copyright 2000-2001 by */
/* Copyright 2000-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -26,6 +26,7 @@
/* define to use linear hash table */
#define FTC_CACHE_USE_LINEAR_HASHING
FT_BEGIN_HEADER
/* handle to cache object */

View File

@ -22,6 +22,7 @@
#include <ft2build.h>
#include FT_SFNT_NAMES_H
#include FT_INTERNAL_TRUETYPE_TYPES_H
#include FT_INTERNAL_STREAM_H
#ifdef TT_CONFIG_OPTION_SFNT_NAMES

44
src/cache/ftccache.c vendored
View File

@ -30,7 +30,7 @@
#define FTC_HASH_MIN_LOAD 1
#define FTC_HASH_SUB_LOAD ( FTC_HASH_MAX_LOAD - FTC_HASH_MIN_LOAD )
/* this one _must_ be a power of 2 !! */
/* this one _must_ be a power of 2! */
#define FTC_HASH_INITIAL_SIZE 8
#endif /* FTC_CACHE_USE_LINEAR_HASHING */
@ -72,6 +72,7 @@
{
FTC_Node last = first->mru_prev;
FT_ASSERT( last->mru_next == first );
node->mru_prev = last;
@ -102,6 +103,7 @@
FTC_Node prev = node->mru_prev;
FTC_Node next = node->mru_next;
FT_ASSERT( first != NULL && manager->num_nodes > 0 );
FT_ASSERT( next->mru_prev == node );
FT_ASSERT( prev->mru_next == node );
@ -111,6 +113,7 @@
if ( node == first )
{
/* this is the last node in the list; update its head pointer */
if ( node == next )
manager->nodes_list = NULL;
else
@ -137,6 +140,7 @@
FTC_Node next = node->mru_next;
FTC_Node last;
prev->mru_next = next;
next->mru_prev = prev;
@ -162,6 +166,7 @@
FTC_Node *pnode;
FT_UInt index, num_buckets;
index = (FT_UInt)( node->hash & cache->mask );
if ( index < cache->p )
index = (FT_UInt)( node->hash & ( 2 * cache->mask + 1 ) );
@ -172,8 +177,8 @@
{
if ( *pnode == NULL )
{
FT_ERROR(( "FreeType.cache.hash_unlink: unknown node!\n" ));
return 0;
FT_ERROR(( "ftc_node_hash_unlink: unknown node!\n" ));
return FT_Err_Ok;
}
if ( *pnode == node )
@ -195,6 +200,7 @@
FT_UInt old_index = p + mask;
FTC_Node* pold;
FT_ASSERT( old_index >= FTC_HASH_INITIAL_SIZE );
if ( p == 0 )
@ -205,9 +211,9 @@
cache->mask >>= 1;
p = cache->mask;
if ( FT_RENEW_ARRAY( cache->buckets, (mask+1)*2, (mask) ) )
if ( FT_RENEW_ARRAY( cache->buckets, ( mask + 1 ) * 2, mask ) )
{
FT_ERROR(( "FreeType.cache.hash_unlink: couldn't shunk buckets !\n" ));
FT_ERROR(( "ftc_node_hash_unlink: couldn't shunk buckets!\n" ));
goto Exit;
}
}
@ -239,6 +245,7 @@
{
FTC_Node *pnode = cache->buckets + ( node->hash % cache->size );
for (;;)
{
if ( *pnode == NULL )
@ -274,6 +281,7 @@
FT_UInt index;
FT_Error error = 0;
index = (FT_UInt)( node->hash & cache->mask );
if ( index < cache->p )
index = (FT_UInt)( node->hash & (2 * cache->mask + 1 ) );
@ -289,9 +297,11 @@
FT_UInt mask = cache->mask;
FTC_Node new_list;
/* split a single bucket */
new_list = NULL;
pnode = cache->buckets + p;
for (;;)
{
node = *pnode;
@ -317,9 +327,10 @@
FT_Memory memory = cache->memory;
if ( FT_RENEW_ARRAY( cache->buckets, (mask+1)*2, (mask+1)*4 ) )
if ( FT_RENEW_ARRAY( cache->buckets,
( mask + 1 ) * 2, ( mask + 1 ) * 4 ) )
{
FT_ERROR(( "FreeType.cache.hash_unlink: couldn't expand buckets !\n" ));
FT_ERROR(( "ftc_node_hash_link: couldn't expand buckets!\n" ));
goto Exit;
}
@ -343,6 +354,7 @@
{
FTC_Node *pnode = cache->buckets + ( node->hash % cache->size );
node->link = *pnode;
*pnode = node;
@ -466,6 +478,7 @@
#ifdef FTC_CACHE_USE_LINEAR_HASHING
/* nothing */
#else /* !FTC_CACHE_USE_LINEAR_HASHING */
@ -583,6 +596,7 @@
#endif /* !FTC_CACHE_USE_LINEAR_HASHING */
FT_EXPORT_DEF( FT_Error )
ftc_cache_init( FTC_Cache cache )
{
@ -601,6 +615,7 @@
goto Exit;
#else /* !FTC_CACHE_USE_LINEAR_HASHING */
cache->nodes = 0;
cache->size = FTC_PRIMES_MIN;
@ -728,7 +743,7 @@
FTC_Query query,
FTC_Node *anode )
{
FT_Error error = 0;
FT_Error error = FT_Err_Ok;
FT_LruNode lru;
@ -740,8 +755,9 @@
query->hash = 0;
query->family = NULL;
/* XXX: we break encapsulation for the sake of speed !! */
#if 1
/* XXX: we break encapsulation for the sake of speed! */
{
/* first of all, find the relevant family */
FT_LruList list = cache->families;
@ -780,27 +796,35 @@
lru = fam;
Skip:
;
}
#else
error = FT_LruList_Lookup( cache->families, query, &lru );
if ( !error )
#endif
{
FTC_Family family = (FTC_Family) lru;
FT_UFast hash = query->hash;
FTC_Node* bucket;
#ifdef FTC_CACHE_USE_LINEAR_HASHING
FT_UInt index;
index = hash & cache->mask;
if ( index < cache->p )
index = hash & ( cache->mask * 2 + 1 );
bucket = cache->buckets + index;
#else
bucket = cache->buckets + (hash % cache->size);
#endif

31
src/cache/ftccache.i vendored
View File

@ -1,11 +1,30 @@
/***************************************************************************/
/* */
/* ftccache.i */
/* */
/* FreeType template for generic cache. */
/* */
/* Copyright 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef GEN_CACHE_FAMILY_COMPARE
#error "GEN_CACHE_FAMILY_COMPARE not defined in template instanciation"
#error "GEN_CACHE_FAMILY_COMPARE not defined in template instantiation"
#endif
#ifndef GEN_CACHE_NODE_COMPARE
#error "GEN_CACHE_NODE_COMPARE not defined in template instanciation"
#error "GEN_CACHE_NODE_COMPARE not defined in template instantiation"
#endif
static FT_Error
GEN_CACHE_LOOKUP( FTC_Cache cache,
FTC_Query query,
@ -17,12 +36,13 @@
query->hash = 0;
query->family = NULL;
/* XXX: we break encapsulation for the sake of speed !! */
/* XXX: we break encapsulation for the sake of speed! */
{
/* first of all, find the relevant family */
FT_LruList list = cache->families;
FT_LruNode fam, *pfam;
pfam = &list->nodes;
for (;;)
{
@ -58,6 +78,7 @@
#ifdef FTC_CACHE_USE_LINEAR_HASHING
FT_UInt index;
index = hash & cache->mask;
if ( index < cache->p )
index = hash & ( cache->mask * 2 + 1 );
@ -119,6 +140,7 @@
FTC_Node next = node->mru_next;
FTC_Node last;
prev->mru_next = next;
next->mru_prev = prev;
@ -139,3 +161,6 @@
#undef GEN_CACHE_NODE_COMPARE
#undef GEN_CACHE_FAMILY_COMPARE
#undef GEN_CACHE_LOOKUP
/* END */

2
src/cache/ftccmap.c vendored
View File

@ -327,6 +327,7 @@
ftc_cmap_node_compare( (FTC_CMapNode)(n), (FTC_CMapQuery)(q) )
#define GEN_CACHE_LOOKUP ftc_cmap_cache_lookup
#include "ftccache.i"
#else /* !FTC_CACHE_USE_INLINE */
@ -335,6 +336,7 @@
#endif /* !FTC_CACHE_USE_INLINE */
/* documentation is in ftccmap.h */
FT_EXPORT_DEF( FT_UInt )

View File

@ -32,7 +32,8 @@ T42_DRV_SRC := $(T42_DIR_)t42objs.c \
# Type42 driver headers
#
T42_DRV_H := $(T42_DRV_SRC:%.c=%.h)
T42_DRV_H := $(T42_DRV_SRC:%.c=%.h) \
$(T42_DIR_)t42error.h
# Type42 driver object(s)

View File

@ -1,10 +1,30 @@
/***************************************************************************/
/* */
/* t42drivr.c */
/* */
/* High-level Type 42 driver interface (body). */
/* */
/* Copyright 2002 by Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include "t42drivr.h"
#include "t42objs.h"
#include "t42error.h"
#include FT_INTERNAL_DEBUG_H
#undef FT_COMPONENT
#define FT_COMPONENT trace_t42
static FT_Error
t42_get_glyph_name( T42_Face face,
FT_UInt glyph_index,
@ -28,7 +48,7 @@
((FT_Byte*)buffer)[len] = 0;
}
return FT_Err_Ok;
return T42_Err_Ok;
}
@ -127,3 +147,5 @@
(FT_CharMap_CharNextFunc) T42_CMap_CharNext,
};
/* END */

View File

@ -4,8 +4,7 @@
/* */
/* High-level Type 42 driver interface (specification). */
/* */
/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* Copyright 2002 by Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@ -16,8 +15,8 @@
/***************************************************************************/
#ifndef __T42DRIVER_H__
#define __T42DRIVER_H__
#ifndef __T42DRIVR_H__
#define __T42DRIVR_H__
#include <ft2build.h>
@ -32,7 +31,8 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __T42DRIVER_H__ */
#endif /* __T42DRIVR_H__ */
/* END */

View File

@ -1,9 +1,28 @@
/***************************************************************************/
/* */
/* t42objs.c */
/* */
/* Type 42 objects manager (body). */
/* */
/* Copyright 2002 by Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include "t42objs.h"
#include "t42parse.h"
#include "t42error.h"
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_LIST_H
#undef FT_COMPONENT
#define FT_COMPONENT trace_t42
@ -38,7 +57,7 @@
if ( type1->font_type != 42 )
{
error = FT_Err_Unknown_File_Format;
error = T42_Err_Unknown_File_Format;
goto Exit;
}
@ -48,7 +67,7 @@
if ( !loader.charstrings.init ) {
FT_ERROR(( "T42_Open_Face: no charstrings array in face!\n" ));
error = FT_Err_Invalid_File_Format;
error = T42_Err_Invalid_File_Format;
}
loader.charstrings.init = 0;
@ -165,7 +184,7 @@
if ( face_index != 0 )
{
FT_ERROR(( "T42_Face_Init: invalid face index\n" ));
error = FT_Err_Invalid_Argument;
error = T42_Err_Invalid_Argument;
goto Exit;
}
@ -330,6 +349,7 @@
{
FT_CharMap charmap = face->charmaprecs;
/* synthesize a Unicode charmap if there is support in the `PSNames' */
/* module */
if ( psnames && psnames->unicode_value )
@ -352,7 +372,7 @@
/* simply clear the error in case of failure (which really) */
/* means that out of memory or no unicode glyph names */
error = FT_Err_Ok;
error = T42_Err_Ok;
}
/* now, support either the standard, expert, or custom encoding */
@ -383,7 +403,7 @@
default:
FT_ERROR(( "T42_Face_Init: invalid encoding\n" ));
error = FT_Err_Invalid_File_Format;
error = T42_Err_Invalid_File_Format;
goto Exit;
}
@ -454,6 +474,7 @@
}
}
/*************************************************************************/
/* */
/* <Function> */
@ -477,7 +498,7 @@
ttmodule = FT_Get_Module( FT_MODULE(driver)->library, "truetype" );
driver->ttclazz = (FT_Driver_Class)ttmodule->clazz;
return FT_Err_Ok;
return T42_Err_Ok;
}
@ -608,7 +629,7 @@
FT_Face face = size->root.face;
T42_Face t42face = (T42_Face)face;
FT_Size ttsize;
FT_Error error = FT_Err_Ok;
FT_Error error = T42_Err_Ok;
error = FT_New_Size( t42face->ttf_face, &ttsize );
@ -641,7 +662,7 @@
FT_Face face = slot->root.face;
T42_Face t42face = (T42_Face)face;
FT_GlyphSlot ttslot;
FT_Error error = FT_Err_Ok;
FT_Error error = T42_Err_Ok;
if ( face->glyph == NULL )
@ -879,3 +900,5 @@
return 0;
}
/* END */

View File

@ -1,5 +1,22 @@
#ifndef __TYPE42_OBJS_H__
#define __TYPE42_OBJS_H__
/***************************************************************************/
/* */
/* t42objs.h */
/* */
/* Type 42 objects manager (specification). */
/* */
/* Copyright 2002 by Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __T42OBJS_H__
#define __T42OBJS_H__
#include <ft2build.h>
#include FT_FREETYPE_H
@ -10,6 +27,7 @@
#include FT_INTERNAL_POSTSCRIPT_NAMES_H
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
FT_BEGIN_HEADER
/* Type42 face */
@ -32,7 +50,6 @@ FT_BEGIN_HEADER
} T42_FaceRec, *T42_Face;
/* Type42 size */
typedef struct T42_SizeRec_
{
@ -60,8 +77,10 @@ FT_BEGIN_HEADER
} T42_DriverRec, *T42_Driver;
/* */
FT_LOCAL( FT_Error )
T42_Face_Init( FT_Stream stream,
T42_Face face,
@ -127,4 +146,8 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __TYPE42_OBJS_H__ */
#endif /* __T42OBJS_H__ */
/* END */

View File

@ -1,9 +1,28 @@
/***************************************************************************/
/* */
/* t42parse.c */
/* */
/* Type 42 font parser (body). */
/* */
/* Copyright 2002 by Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include "t42parse.h"
#include "t42error.h"
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_LIST_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
@ -13,6 +32,7 @@
#undef FT_COMPONENT
#define FT_COMPONENT trace_t42
static void
t42_parse_font_name( T42_Face face,
T42_Loader loader );
@ -118,7 +138,7 @@
FT_Memory memory,
PSAux_Service psaux )
{
FT_Error error = FT_Err_Ok;
FT_Error error = T42_Err_Ok;
FT_Long size;
@ -176,7 +196,7 @@
if (size <= 17 ||
( ft_strncmp( (const char*)parser->base_dict,
"%!PS-TrueTypeFont", 17) ) )
error = FT_Err_Unknown_File_Format;
error = T42_Err_Unknown_File_Format;
else
{
parser->root.base = parser->base_dict;
@ -346,7 +366,7 @@
if ( cur >= limit )
{
FT_ERROR(( "t42_parse_encoding: out of bounds!\n" ));
parser->root.error = FT_Err_Invalid_File_Format;
parser->root.error = T42_Err_Invalid_File_Format;
return;
}
}
@ -485,7 +505,7 @@
else {
FT_ERROR(( "t42_parse_encoding: invalid token!\n" ));
parser->root.error = FT_Err_Invalid_File_Format;
parser->root.error = T42_Err_Invalid_File_Format;
}
}
}
@ -549,7 +569,7 @@
else
{
FT_ERROR(( "t42_parse_sfnts: can't find begin of sfnts vector!\n" ));
error = FT_Err_Invalid_File_Format;
error = T42_Err_Invalid_File_Format;
goto Fail;
}
@ -574,7 +594,7 @@
if ( !in_string )
{
FT_ERROR(( "t42_parse_sfnts: found unpaired `>'!\n" ));
error = FT_Err_Invalid_File_Format;
error = T42_Err_Invalid_File_Format;
goto Fail;
}
@ -597,7 +617,7 @@
else
{
FT_ERROR(( "t42_parse_sfnts: found `%' in string!\n" ));
error = FT_Err_Invalid_File_Format;
error = T42_Err_Invalid_File_Format;
goto Fail;
}
@ -605,7 +625,7 @@
if ( !ft_xdigit( *cur ) || !ft_xdigit( *(cur + 1) ) )
{
FT_ERROR(( "t42_parse_sfnts: found non-hex characters in string" ));
error = FT_Err_Invalid_File_Format;
error = T42_Err_Invalid_File_Format;
goto Fail;
}
@ -670,7 +690,7 @@
}
/* If control reaches this point, the format was not valid */
error = FT_Err_Invalid_File_Format;
error = T42_Err_Invalid_File_Format;
Fail:
parser->root.error = error;
@ -780,7 +800,7 @@
if ( ft_strcmp( (char *)name_table->elements[0], ".notdef" ) )
{
FT_ERROR(( "t42_parse_charstrings: Index 0 is not `.notdef'!\n" ));
error = FT_Err_Invalid_File_Format;
error = T42_Err_Invalid_File_Format;
goto Fail;
}
@ -970,3 +990,4 @@
}
/* END */

View File

@ -1,9 +1,28 @@
#ifndef __TYPE42_PARSE_H__
#define __TYPE42_PARSE_H__
/***************************************************************************/
/* */
/* t42parse.h */
/* */
/* Type 42 font parser (specification). */
/* */
/* Copyright 2002 by Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __T42PARSE_H__
#define __T42PARSE_H__
#include "t42objs.h"
#include FT_INTERNAL_POSTSCRIPT_AUX_H
FT_BEGIN_HEADER
typedef struct T42_ParserRec_
@ -63,4 +82,8 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __TYPE42_PARSE_H__ */
#endif /* __T42PARSE_H__ */
/* END */

View File

@ -1,12 +1,20 @@
/***************************************************************************/
/* */
/* type42c */
/* type42.c */
/* */
/* FreeType Type 42 driver component */
/* FreeType Type 42 driver component. */
/* */
/* Copyright 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#define FT_MAKE_OPTION_SINGLE_OBJECT
#include <ft2build.h>