Formatting.

Adding some trivial error checking.

Adding/Fixing tracing levels.
This commit is contained in:
Werner Lemberg 2000-07-08 19:51:42 +00:00
parent e1075ceabb
commit 7fa51b5535
72 changed files with 2884 additions and 2408 deletions

View File

@ -78,11 +78,19 @@
trace_ttpload, /* TT data/program loader (ttpload.c) */
/* Type 1 driver components */
trace_t1objs,
trace_t1load,
trace_t1driver,
trace_t1gload,
trace_t1hint,
trace_t1driver,
trace_t1load,
trace_t1objs,
/* experimental Type 1 driver components */
trace_z1driver,
trace_z1gload,
trace_z1hint,
trace_z1load,
trace_z1objs,
trace_z1parse,
/* Type 2 driver components */
trace_t2driver,

View File

@ -17,19 +17,24 @@
#ifdef FT_FLAT_COMPILE
#include "ftcalc.c"
#include "ftobjs.c"
#include "ftstream.c"
#include "ftlist.c"
#include "ftoutln.c"
#include "ftextend.c"
#else
#include <ftcalc.c>
#include <ftobjs.c>
#include <ftstream.c>
#include <ftlist.c>
#include <ftoutln.c>
#include <ftextend.c>
#endif
/* END */

View File

@ -2014,7 +2014,7 @@
metrics->y_scale = FT_DivFix( metrics->y_ppem << 6,
face->units_per_EM );
ft_recompute_scaled_metrics( face, metrics );
}

View File

@ -270,15 +270,16 @@
}
FT_EXPORT_FUNC( FT_Error ) FT_Outline_New_Internal( FT_Memory memory,
FT_UInt numPoints,
FT_Int numContours,
FT_Outline* outline )
FT_EXPORT_FUNC( FT_Error ) FT_Outline_New_Internal(
FT_Memory memory,
FT_UInt numPoints,
FT_Int numContours,
FT_Outline* outline )
{
FT_Error error;
FT_Error error;
if ( !outline )
if ( !outline || !memory )
return FT_Err_Invalid_Argument;
*outline = null_outline;
@ -302,7 +303,6 @@
}
/*************************************************************************/
/* */
/* <Function> */
@ -340,11 +340,13 @@
FT_Int numContours,
FT_Outline* outline )
{
if ( !library )
return FT_Err_Invalid_Library_Handle;
return FT_Outline_New_Internal( library->memory, numPoints,
numContours, outline );
}
/*************************************************************************/
/* */
@ -396,6 +398,25 @@
}
FT_EXPORT_FUNC( FT_Error ) FT_Outline_Done_Internal( FT_Memory memory,
FT_Outline* outline )
{
if ( outline )
{
if ( outline->flags & ft_outline_owner )
{
FREE( outline->points );
FREE( outline->tags );
FREE( outline->contours );
}
*outline = null_outline;
return FT_Err_Ok;
}
else
return FT_Err_Invalid_Argument;
}
/*************************************************************************/
/* */
@ -424,34 +445,18 @@
/* The reason why this function takes an `outline' parameter is */
/* simply to use FT_Free(). */
/* */
FT_EXPORT_FUNC( FT_Error ) FT_Outline_Done_Internal( FT_Memory memory,
FT_Outline* outline )
{
if ( outline )
{
if ( outline->flags & ft_outline_owner )
{
FREE( outline->points );
FREE( outline->tags );
FREE( outline->contours );
}
*outline = null_outline;
return FT_Err_Ok;
}
else
return FT_Err_Invalid_Argument;
}
FT_EXPORT_FUNC( FT_Error ) FT_Outline_Done( FT_Library library,
FT_Outline* outline )
{
/* check for valid `outline' in FT_Outline_Done_Internal() */
if ( !library )
return FT_Err_Invalid_Library_Handle;
return FT_Outline_Done_Internal( library->memory, outline );
}
/*************************************************************************/
/* */
/* <Function> */

View File

@ -636,8 +636,6 @@
}
BASE_FUNC( FT_Error ) FT_Read_Fields( FT_Stream stream,
const FT_Frame_Field* fields,
void* structure )

View File

@ -19,19 +19,22 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
#ifdef FT_FLAT_COMPILE
#include "t2driver.c" /* driver interface */
#include "t2parse.c" /* token parser */
#include "t2load.c" /* tables loader */
#include "t2objs.c" /* object management */
#include "t2gload.c" /* glyph loader */
#else
#include <cff/t2driver.c> /* driver interface */
#include <cff/t2parse.c> /* token parser */
#include <cff/t2load.c> /* tables loader */
#include <cff/t2objs.c> /* object management */
#include <cff/t2gload.c> /* glyph loader */
#endif
/* END */

View File

@ -24,14 +24,18 @@
#include <freetype/internal/t2errors.h>
#ifdef FT_FLAT_COMPILE
#include "t2driver.h"
#include "t2gload.h"
#else
#include <cff/t2driver.h>
#include <cff/t2gload.h>
#endif
#endif
/*************************************************************************/

View File

@ -23,14 +23,20 @@
#include <freetype/ftoutln.h>
#include <freetype/tttags.h>
#ifdef FT_FLAT_COMPILE
#include "t2load.h"
#include "t2gload.h"
#else
#include <cff/t2load.h>
#include <cff/t2gload.h>
#endif
#include <freetype/internal/t2errors.h>
@ -470,7 +476,8 @@
FT_Pos y )
{
FT_Error error = 0;
/* test whether we are building a new contour */
if ( !builder->path_begun )
{
@ -1155,7 +1162,6 @@
}
break;
case t2_op_rcurveline:
{
FT_Int num_curves = ( num_args - 2 ) / 6;
@ -1196,128 +1202,131 @@
}
break;
case t2_op_hflex1:
{
FT_Pos start_y;
FT_TRACE4(( " hflex1" ));
args = stack;
/* Adding five more points; 4 control points, 1 on curve point. */
if (start_point ( builder, x, y ) || check_points ( builder, 5 ) )
/* adding five more points; 4 control points, 1 on-curve point */
if ( start_point( builder, x, y ) ||
check_points( builder, 5 ) )
goto Memory_Error;
/* Record the starting point's y postion for later use */
start_y = y;
/* first control point */
x += args[0];
y += args[1];
add_point( builder, x, y, 0 );
/* second control point */
x += args[2];
y += args[3];
add_point( builder, x, y, 0 );
/* join point; on curve, with y-value the same as the last */
/* control point's y-value */
x += args[4];
add_point( builder, x, y, 1 );
/* third control point, with y-value the same as the join */
/* point's y-value */
x += args[5];
add_point( builder, x, y, 0 );
/* fourth control point */
x += args[6];
y += args[7];
add_point( builder, x, y, 0 );
/* ending point, with y-value the same as the start */
/* point's y-value. we don't add this point, though. */
/* ending point, with y-value the same as the start */
/* point's y-value -- we don't add this point, though */
x += args[8];
y = start_y;
args = stack;
break;
}
case t2_op_hflex:
{
FT_Pos start_y;
FT_TRACE4(( " hflex" ));
args = stack;
/* Adding five more points; 4 control points, 1 on curve point. */
if (start_point ( builder, x, y ) || check_points ( builder, 5 ) )
/* adding five more points; 4 control points, 1 on-curve point */
if ( start_point( builder, x, y ) ||
check_points ( builder, 5 ) )
goto Memory_Error;
/* Record the starting point's y postion for later use */
/* record the starting point's y-position for later use */
start_y = y;
/* first control point */
x += args[0];
add_point( builder, x, y, 0 );
/* second control point */
x += args[1];
y += args[2];
add_point( builder, x, y, 0 );
/* join point; on curve, with y-value the same as the last */
/* control point's y-value */
x += args[3];
add_point( builder, x, y, 1 );
/* third control point, with y-value the same as the join */
/* point's y-value */
x += args[4];
add_point( builder, x, y, 0 );
/* fourth control point */
x += args[5];
y = start_y;
add_point( builder, x, y, 0 );
/* ending point, with y-value the same as the start point's */
/* y-value we don't add this point, though. */
/* y-value -- we don't add this point, though */
x += args[6];
args = stack;
break;
}
case t2_op_flex1:
{
FT_Pos start_x, start_y; /* record start x,y values for alter use */
FT_Int dx = 0, dy = 0; /* used in hort./vert. algorithm below */
FT_Int horizontal, count;
FT_Pos start_x, start_y; /* record start x, y values for alter */
/* use */
FT_Int dx = 0, dy = 0; /* used in horizontal/vertical */
/* algorithm below */
FT_Int horizontal, count;
FT_TRACE4(( " flex1" ));
/* Adding five more points; 4 control points, 1 on curve point. */
if (start_point ( builder, x, y ) || check_points ( builder, 5 ) )
/* adding five more points; 4 control points, 1 on-curve point */
if ( start_point( builder, x, y ) ||
check_points( builder, 5 ) )
goto Memory_Error;
/* Record the starting point's x,y postion for later use */
/* record the starting point's x, y postion for later use */
start_x = x;
start_y = y;
/* XXXX: figure out if this is supposed to be a horizontal or */
/* vertical flex. The Type 2 specification is vague... */
/* XXX: figure out whether this is supposed to be a horizontal */
/* or vertical flex; the Type 2 specification is vague... */
args = stack;
/* grab up to the last argument */
for ( count = 5; count > 0; count-- )
{
@ -1325,25 +1334,25 @@
dy += args[1];
args += 2;
}
/* rewind */
args = stack;
if ( dx < 0 ) dx = -dx;
if ( dy < 0 ) dy = -dy;
/* strange test, but here it is... */
horizontal = (dx > dy);
horizontal = ( dx > dy );
for ( count = 5; count > 0; count-- )
{
x += args[0];
y += args[1];
add_point( builder, x, y, (FT_Bool)(count == 3) );
add_point( builder, x, y, (FT_Bool)( count == 3 ) );
args += 2;
}
if (horizontal)
if ( horizontal )
{
x += args[0];
y = start_y;
@ -1353,41 +1362,38 @@
x = start_x;
y += args[0];
}
args = stack;
break;
}
case t2_op_flex:
{
FT_UInt count;
FT_UInt count;
FT_TRACE4(( " flex" ));
if (start_point ( builder, x, y ) || check_points ( builder, 5 ) )
goto Memory_Error;
if ( start_point( builder, x, y ) ||
check_points( builder, 5 ) )
goto Memory_Error;
args = stack;
for ( count = 5; count > 0; count-- )
{
x += args[0];
y += args[1];
add_point( builder, x, y, (FT_Bool)(count == 3) );
add_point( builder, x, y, (FT_Bool)( count == 3 ) );
args += 2;
}
x += args[0];
y += args[1];
args = stack;
}
break;
case t2_op_endchar:
FT_TRACE4(( " endchar" ));

View File

@ -21,12 +21,18 @@
#include <freetype/freetype.h>
#ifdef FT_FLAT_COMPILE
#include "t2objs.h"
#else
#include <cff/t2objs.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -24,12 +24,17 @@
#include <freetype/internal/t2errors.h>
#include <freetype/tttags.h>
#ifdef FT_FLAT_COMPILE
#include "t2load.h"
#include "t2parse.h"
#else
#include <cff/t2load.h>
#include <cff/t2parse.h>
#endif
@ -324,7 +329,6 @@
}
/*************************************************************************/
/*************************************************************************/
/*** ***/

View File

@ -34,7 +34,6 @@
FT_UInt sid,
PSNames_Interface* interface );
LOCAL_DEF
FT_Error T2_Access_Element( CFF_Index* index,
FT_UInt element,

View File

@ -26,16 +26,24 @@
#include <freetype/internal/sfnt.h>
#include <freetype/internal/psnames.h>
#ifdef FT_FLAT_COMPILE
#include "t2objs.h"
#include "t2load.h"
#else
#include <cff/t2objs.h>
#include <cff/t2load.h>
#endif
#include <freetype/internal/t2errors.h>
#include <string.h> /* for strlen() */
/*************************************************************************/
/* */
@ -54,13 +62,15 @@
/*************************************************************************/
static
FT_String* T2_StrCopy( FT_Memory memory, const FT_String* source )
FT_String* T2_StrCopy( FT_Memory memory,
const FT_String* source )
{
FT_Error error;
FT_String* result = 0;
FT_Int len = (FT_Int)strlen(source);
if ( !ALLOC( result, len+1 ) )
FT_Error error;
FT_String* result = 0;
FT_Int len = (FT_Int)strlen( source );
if ( !ALLOC( result, len + 1 ) )
{
MEM_Copy( result, source, len );
result[len] = 0;
@ -70,12 +80,13 @@
#if 0
/* this function is used to build a Unicode charmap from the glyph names */
/* in a file.. */
/* in a file */
static
FT_Error CFF_Build_Unicode_Charmap( T2_Face face,
FT_ULong base_offset,
PSNames_Interface* psnames )
FT_Error CFF_Build_Unicode_Charmap( T2_Face face,
FT_ULong base_offset,
PSNames_Interface* psnames )
{
CFF_Font* font = (CFF_Font*)face->extra.data;
FT_Memory memory = FT_FACE_MEMORY(face);
@ -87,8 +98,9 @@
FT_Byte format;
FT_Stream stream = face->root.stream;
charset_offset = dict->charset_offset;
if (!charset_offset)
if ( !charset_offset )
{
FT_ERROR(( "CFF.Build_Unicode_Charmap: charset table is missing\n" ));
error = FT_Err_Invalid_File_Format;
@ -96,7 +108,7 @@
}
/* allocate the charmap */
if ( ALLOC( face->charmap,
if ( ALLOC( face->charmap, ...
/* seek to charset table and allocate glyph names table */
if ( FILE_Seek( base_offset + charset_offset ) ||
@ -104,19 +116,19 @@
goto Exit;
/* now, read each glyph name and store it in the glyph name table */
if ( READ_Byte(format) )
if ( READ_Byte( format ) )
goto Fail;
switch (format)
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] = T2_Get_String( &font->string_index,
GET_UShort(),
@ -124,22 +136,22 @@
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;
@ -150,7 +162,7 @@
count = GET_Byte();
FORGET_Frame();
for ( ; count > 0; count-- )
{
gname[0] = T2_Get_String( &font->string_index,
@ -162,7 +174,7 @@
}
break;
}
default: /* unknown charset format !! */
FT_ERROR(( "CFF: unknown charset format !!\n" ));
error = FT_Err_Invalid_File_Format;
@ -175,14 +187,14 @@
Fail:
for ( n = 0; n < num_glyphs; n++ )
FREE( glyph_names[n] );
FREE( glyph_names );
Exit:
return error;
}
#endif
#endif /* 0 */
static
@ -233,7 +245,7 @@
return ft_encoding_none;
}
/*************************************************************************/
/* */
/* <Function> */
@ -270,13 +282,14 @@
FT_Bool pure_cff = 1;
FT_Bool sfnt_format = 0;
sfnt = (SFNT_Interface*)FT_Get_Module_Interface(
face->root.driver->root.library, "sfnt" );
if ( !sfnt )
goto Bad_Format;
psnames = (PSNames_Interface*)FT_Get_Module_Interface(
face->root.driver->root.library, "psnames" );
face->root.driver->root.library, "psnames" );
/* create input stream from resource */
if ( FILE_Seek( 0 ) )
@ -296,27 +309,28 @@
if ( face_index < 0 )
return T2_Err_Ok;
sfnt_format = 1;
sfnt_format = 1;
/* now, the font can be either an OpenType/CFF font, or a SVG CEF font */
/* in the later case, it doesn't have a "head" table.. */
/* now, the font can be either an OpenType/CFF font, or a SVG CEF */
/* font in the later case; it doesn't have a `head' table */
error = face->goto_table( face, TTAG_head, stream, 0 );
if (!error)
if ( !error )
{
pure_cff = 0;
/* Load font directory */
error = sfnt->load_face( stream, face, face_index, num_params, params );
error = sfnt->load_face( stream, face,
face_index, num_params, params );
if ( error )
goto Exit;
}
else
{
/* load the "cmap" table by hand */
/* load the `cmap' table by hand */
error = sfnt->load_charmaps( face, stream );
if (error)
if ( error )
goto Exit;
/* XXX: for now, we don't load the GPOS table, as OpenType Layout */
/* support will be added later to FreeType 2 as a separate module */
}
@ -328,12 +342,11 @@
}
else
{
/* rewind to start of file, we're going to load a pure-CFF font */
(void)FILE_Seek(0);
/* rewind to start of file; we are going to load a pure-CFF font */
(void)FILE_Seek( 0 );
error = FT_Err_Ok;
}
/* now load and parse the CFF table in the file */
{
CFF_Font* cff;
@ -347,7 +360,7 @@
goto Exit;
base_offset = FILE_Pos();
face->extra.data = cff;
error = T2_Load_CFF_Font( stream, face_index, cff );
if ( error )
@ -355,125 +368,131 @@
/* Complement the root flags with some interesting information. */
/* Note that this is only necessary for pure CFF and CEF fonts */
root = &face->root;
if (pure_cff)
if ( pure_cff )
{
CFF_Font_Dict* dict = &cff->top_font.font_dict;
/* we need the psnames module for pure-CFF and CEF formats */
if (!psnames)
/* we need the `PSNames' module for pure-CFF and CEF formats */
if ( !psnames )
{
FT_ERROR(( "cannot open CFF & CEF fonts without the 'psnames' module\n" ));
FT_ERROR(( "T2_Init_Face:" ));
FT_ERROR(( " cannot open CFF & CEF fonts\n" ));
FT_ERROR(( " " ));
FT_ERROR(( " without the `PSNames' module\n" ));
goto Bad_Format;
}
/* compute number of glyphs */
if (dict->cid_registry)
if ( dict->cid_registry )
root->num_glyphs = dict->cid_count;
else
root->num_glyphs = cff->charstrings_index.count;
/* set global bbox, as well as EM size */
root->units_per_EM = FT_DivFix( 1000L << 16, dict->font_matrix.yy ) >> 16;
root->bbox = dict->font_bbox;
root->ascender = root->bbox.yMax;
root->descender = root->bbox.yMin;
root->units_per_EM = FT_DivFix( 1000L << 16,
dict->font_matrix.yy ) >> 16;
root->bbox = dict->font_bbox;
root->ascender = root->bbox.yMax;
root->descender = root->bbox.yMin;
/* retrieve font family & style name */
root->family_name = T2_Get_Name( &cff->name_index, face_index );
if (dict->cid_registry)
if ( dict->cid_registry )
{
root->style_name = T2_StrCopy( memory, "Regular" ); /* XXXX */
root->style_name = T2_StrCopy( memory, "Regular" ); /* XXXX */
}
else
{
root->style_name = T2_Get_String( &cff->string_index,
dict->weight,
psnames );
root->style_name = T2_Get_String( &cff->string_index,
dict->weight,
psnames );
}
/*********************************************************************/
/* */
/* Compute face flags. */
/* */
flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */
FT_FACE_FLAG_HORIZONTAL; /* horizontal data */
if (sfnt_format)
flags |= FT_FACE_FLAG_SFNT;
/* fixed width font? */
if ( dict->is_fixed_pitch )
flags |= FT_FACE_FLAG_FIXED_WIDTH;
/*******************************************************************/
/* */
/* Compute face flags. */
/* */
flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */
FT_FACE_FLAG_HORIZONTAL; /* horizontal data */
if ( sfnt_format )
flags |= FT_FACE_FLAG_SFNT;
/* fixed width font? */
if ( dict->is_fixed_pitch )
flags |= FT_FACE_FLAG_FIXED_WIDTH;
/* XXXX: WE DO NOT SUPPORT KERNING METRICS IN THE GPOS TABLE FOR NOW */
#if 0
/* kerning available ? */
if ( face->kern_pairs )
flags |= FT_FACE_FLAG_KERNING;
/* kerning available? */
if ( face->kern_pairs )
flags |= FT_FACE_FLAG_KERNING;
#endif
root->face_flags = flags;
/*********************************************************************/
/* */
/* Compute style flags. */
/* */
flags = 0;
if ( dict->italic_angle )
flags |= FT_STYLE_FLAG_ITALIC;
/* XXXX : may not be correct .. */
if ( cff->top_font.private_dict.force_bold )
flags |= FT_STYLE_FLAG_BOLD;
root->style_flags = flags;
/* set the charmaps if any */
if (sfnt_format)
{
/*********************************************************************/
/* */
/* Polish the charmaps. */
/* */
/* Try to set the charmap encoding according to the platform & */
/* encoding ID of each charmap. */
/* */
TT_CharMap charmap;
FT_Int n;
root->face_flags = flags;
charmap = face->charmaps;
root->num_charmaps = face->num_charmaps;
/* allocate table of pointers */
if ( ALLOC_ARRAY( root->charmaps, root->num_charmaps, FT_CharMap ) )
goto Exit;
for ( n = 0; n < root->num_charmaps; n++, charmap++ )
{
FT_Int platform = charmap->cmap.platformID;
FT_Int encoding = charmap->cmap.platformEncodingID;
charmap->root.face = (FT_Face)face;
charmap->root.platform_id = platform;
charmap->root.encoding_id = encoding;
charmap->root.encoding = find_encoding( platform, encoding );
/* now, set root->charmap with a unicode charmap */
/* wherever available */
if ( !root->charmap &&
charmap->root.encoding == ft_encoding_unicode )
root->charmap = (FT_CharMap)charmap;
root->charmaps[n] = (FT_CharMap)charmap;
}
/*******************************************************************/
/* */
/* Compute style flags. */
/* */
flags = 0;
if ( dict->italic_angle )
flags |= FT_STYLE_FLAG_ITALIC;
/* XXX: may not be correct */
if ( cff->top_font.private_dict.force_bold )
flags |= FT_STYLE_FLAG_BOLD;
root->style_flags = flags;
/* set the charmaps if any */
if ( sfnt_format )
{
/*****************************************************************/
/* */
/* Polish the charmaps. */
/* */
/* Try to set the charmap encoding according to the platform & */
/* encoding ID of each charmap. */
/* */
TT_CharMap charmap;
FT_Int n;
charmap = face->charmaps;
root->num_charmaps = face->num_charmaps;
/* allocate table of pointers */
if ( ALLOC_ARRAY( root->charmaps, root->num_charmaps, FT_CharMap ) )
goto Exit;
for ( n = 0; n < root->num_charmaps; n++, charmap++ )
{
FT_Int platform = charmap->cmap.platformID;
FT_Int encoding = charmap->cmap.platformEncodingID;
charmap->root.face = (FT_Face)face;
charmap->root.platform_id = platform;
charmap->root.encoding_id = encoding;
charmap->root.encoding = find_encoding( platform, encoding );
/* now, set root->charmap with a unicode charmap */
/* wherever available */
if ( !root->charmap &&
charmap->root.encoding == ft_encoding_unicode )
root->charmap = (FT_CharMap)charmap;
root->charmaps[n] = (FT_CharMap)charmap;
}
}
}
}
Exit:
return error;

View File

@ -89,8 +89,8 @@
} T2_Transform;
/* this is only used in the case of a pure CFF font with no charmap */
typedef struct T2_CharMapRec_
/* this is only used in the case of a pure CFF font with no charmap */
typedef struct T2_CharMapRec_
{
TT_CharMapRec root;
PS_Unicodes unicodes;

View File

@ -17,11 +17,16 @@
#ifdef FT_FLAT_COMPILE
#include "t2parse.h"
#else
#include <cff/t2parse.h>
#endif
#include <freetype/internal/t2errors.h>
@ -422,11 +427,17 @@
static const T2_Field_Handler t2_field_handlers[] =
{
#ifdef FT_FLAT_COMPILE
#include "t2tokens.h"
#else
#include <cff/t2tokens.h>
#endif
{ 0, 0, 0, 0, 0, 0, 0 }
};

View File

@ -15,12 +15,18 @@
/* */
/***************************************************************************/
#ifdef FT_FLAT_COMPILE
#include "cidafm.h"
#else
#include <cid/cidafm.h>
#endif
#include <freetype/internal/ftstream.h>
#include <freetype/internal/t1types.h>
#include <freetype/internal/t1errors.h>

View File

@ -19,10 +19,15 @@
#ifndef CIDAFM_H
#define CIDAFM_H
#ifdef FT_FLAT_COMPILE
#include "cidobjs.h"
#else
#include <cid/cidobjs.h>
#endif

View File

@ -17,13 +17,18 @@
#ifdef FT_FLAT_COMPILE
#include "cidload.h"
#include "cidgload.h"
#else
#include <cid/cidload.h>
#include <cid/cidgload.h>
#endif
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftstream.h>
#include <freetype/ftoutln.h>

View File

@ -19,12 +19,18 @@
#ifndef CIDGLOAD_H
#define CIDGLOAD_H
#ifdef FT_FLAT_COMPILE
#include "cidobjs.h"
#else
#include <cid/cidobjs.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -23,12 +23,18 @@
#include <freetype/internal/t1types.h>
#include <freetype/internal/t1errors.h>
#ifdef FT_FLAT_COMPILE
#include "cidload.h"
#else
#include <cid/cidload.h>
#endif
#include <stdio.h>
#include <ctype.h> /* for isspace(), isalnum() */
@ -243,11 +249,17 @@
static
const CID_Field_Rec t1_field_records[] =
{
#ifdef FT_FLAT_COMPILE
#include "cidtokens.h"
#else
#include <cid/cidtokens.h>
#endif
{ 0, 0, 0, 0, 0, 0, 0, 0 }
};

View File

@ -21,12 +21,18 @@
#include <freetype/internal/ftstream.h>
#ifdef FT_FLAT_COMPILE
#include "cidparse.h"
#else
#include <cid/cidparse.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -19,14 +19,20 @@
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftstream.h>
#ifdef FT_FLAT_COMPILE
#include "cidgload.h"
#include "cidload.h"
#else
#include <cid/cidgload.h>
#include <cid/cidload.h>
#endif
#include <freetype/internal/psnames.h>

View File

@ -22,12 +22,18 @@
#include <freetype/internal/ftstream.h>
#include <freetype/internal/t1errors.h>
#ifdef FT_FLAT_COMPILE
#include "cidparse.h"
#else
#include <cid/cidparse.h>
#endif
#include <string.h> /* for strncmp() */

View File

@ -17,13 +17,18 @@
#ifdef FT_FLAT_COMPILE
#include "cidriver.h"
#include "cidgload.h"
#else
#include <cid/cidriver.h>
#include <cid/cidgload.h>
#endif
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftstream.h>
#include <freetype/internal/psnames.h>

View File

@ -19,17 +19,21 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
#ifdef FT_FLAT_COMPILE
#include "cidparse.c"
#include "cidload.c"
#include "cidobjs.c"
#include "cidriver.c"
#include "cidgload.c"
#else
#include <cid/cidparse.c>
#include <cid/cidload.c>
#include <cid/cidobjs.c>
#include <cid/cidriver.c>
#include <cid/cidgload.c>
#endif

View File

@ -19,14 +19,20 @@
#include <freetype/internal/psnames.h>
#include <freetype/internal/ftobjs.h>
#ifdef FT_FLAT_COMPILE
#include "psmodule.h"
#include "pstables.h"
#else
#include <psnames/psmodule.h>
#include <psnames/pstables.h>
#endif
#include <stdlib.h> /* for qsort() */
#include <string.h> /* for strcmp(), strncpy() */

View File

@ -19,12 +19,17 @@
#include <freetype/internal/ftobjs.h>
#include <freetype/ftoutln.h>
#ifdef FT_FLAT_COMPILE
#include "ftrend1.h"
#include "ftraster.h"
#else
#include <raster1/ftrend1.h>
#include <raster1/ftraster.h>
#endif

View File

@ -18,12 +18,17 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
#ifdef FT_FLAT_COMPILE
#include "ftraster.c"
#include "ftrend1.c"
#else
#include <raster1/ftraster.c>
#include <raster1/ftrend1.c>
#endif

View File

@ -19,20 +19,25 @@
#include <freetype/internal/sfnt.h>
#include <freetype/internal/ftobjs.h>
#ifdef FT_FLAT_COMPILE
#include "sfdriver.h"
#include "ttload.h"
#include "ttsbit.h"
#include "ttpost.h"
#include "ttcmap.h"
#include "sfobjs.h"
#else
#include <sfnt/sfdriver.h>
#include <sfnt/ttload.h>
#include <sfnt/ttsbit.h>
#include <sfnt/ttpost.h>
#include <sfnt/ttcmap.h>
#include <sfnt/sfobjs.h>
#endif

View File

@ -18,6 +18,7 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
#ifdef FT_FLAT_COMPILE
#include "ttload.c"
@ -31,8 +32,8 @@
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
#include "ttpost.c"
#endif
#include "sfdriver.c"
#include "sfdriver.c"
#else /* FT_FLAT_COMPILE */
@ -47,12 +48,10 @@
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
#include <sfnt/ttpost.c>
#endif
#include <sfnt/sfdriver.c>
#endif /* FT_FLAT_COMPILE */
/* END */

View File

@ -17,11 +17,16 @@
#ifdef FT_FLAT_COMPILE
#include "sfobjs.h"
#else
#include <sfnt/sfobjs.h>
#endif
#include <freetype/internal/sfnt.h>
#include <freetype/internal/psnames.h>
#include <freetype/ttnameid.h>

View File

@ -19,17 +19,20 @@
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/tterrors.h>
#ifdef FT_FLAT_COMPILE
#include "ttload.h"
#include "ttcmap.h"
#else
#include <sfnt/ttload.h>
#include <sfnt/ttcmap.h>
#endif
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */

View File

@ -21,17 +21,20 @@
#include <freetype/internal/tterrors.h>
#include <freetype/tttags.h>
#ifdef FT_FLAT_COMPILE
#include "ttload.h"
#include "ttcmap.h"
#else
#include <sfnt/ttload.h>
#include <sfnt/ttcmap.h>
#endif
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */

View File

@ -29,14 +29,18 @@
#include <freetype/internal/tterrors.h>
#include <freetype/tttags.h>
#ifdef FT_FLAT_COMPILE
#include "ttpost.h"
#include "ttload.h"
#else
#include <sfnt/ttpost.h>
#include <sfnt/ttload.h>
#endif
#endif
/*************************************************************************/

View File

@ -20,12 +20,16 @@
#include <freetype/internal/tterrors.h>
#include <freetype/tttags.h>
#ifdef FT_FLAT_COMPILE
#include "ttsbit.h"
#else
#include <sfnt/ttsbit.h>
#endif
#ifdef FT_FLAT_COMPILE
#include "ttsbit.h"
#else
#include <sfnt/ttsbit.h>
#endif
/*************************************************************************/

View File

@ -19,12 +19,16 @@
#ifndef TTSBIT_H
#define TTSBIT_H
#ifdef FT_FLAT_COMPILE
#include "ttload.h"
#else
#include <sfnt/ttload.h>
#endif
#ifdef FT_FLAT_COMPILE
#include "ttload.h"
#else
#include <sfnt/ttload.h>
#endif
#ifdef __cplusplus

View File

@ -123,10 +123,15 @@
#else /* _STANDALONE_ */
#ifdef FT_FLAT_COMPILE
#include "ftgrays.h"
#else
#include <smooth/ftgrays.h>
#endif

View File

@ -19,17 +19,20 @@
#include <freetype/internal/ftobjs.h>
#include <freetype/ftoutln.h>
#ifdef FT_FLAT_COMPILE
#include "ftsmooth.h"
#include "ftgrays.h"
#else
#include <smooth/ftsmooth.h>
#include <smooth/ftgrays.h>
#endif
/* initialize renderer -- init its raster */
static
FT_Error ft_smooth_init( FT_Renderer render )

View File

@ -18,15 +18,18 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
#ifdef FT_FLAT_COMPILE
#include "ftgrays.c"
#include "ftsmooth.c"
#else
#include <smooth/ftgrays.c>
#include <smooth/ftsmooth.c>
#endif
/* END */

View File

@ -18,27 +18,30 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
#ifdef FT_FLAT_COMPILE
#include "ttdriver.c" /* driver interface */
#include "ttpload.c" /* tables loader */
#include "ttgload.c" /* glyph loader */
#include "ttobjs.c" /* object manager */
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#include "ttinterp.c" /* bytecode interpreter */
#endif
#else
#else /* FT_FLAT_COMPILE */
#include <truetype/ttdriver.c> /* driver interface */
#include <truetype/ttpload.c> /* tables loader */
#include <truetype/ttgload.c> /* glyph loader */
#include <truetype/ttobjs.c> /* object manager */
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#include <truetype/ttinterp.c> /* bytecode interpreter */
#endif
#endif
#endif /* FT_FLAT_COMPILE */
/* END */

View File

@ -21,14 +21,18 @@
#include <freetype/internal/sfnt.h>
#include <freetype/ttnameid.h>
#ifdef FT_FLAT_COMPILE
#include "ttdriver.h"
#include "ttgload.h"
#else
#include <truetype/ttdriver.h>
#include <truetype/ttgload.h>
#endif
#endif
/*************************************************************************/

View File

@ -23,12 +23,16 @@
#include <freetype/tttags.h>
#include <freetype/ftoutln.h>
#ifdef FT_FLAT_COMPILE
#include "ttgload.h"
#else
#include <truetype/ttgload.h>
#endif
#ifdef FT_FLAT_COMPILE
#include "ttgload.h"
#else
#include <truetype/ttgload.h>
#endif
/*************************************************************************/
@ -1048,7 +1052,7 @@
pts->tags[k] &= FT_Curve_Tag_On;
}
cur_to_org( num_points+2, pts );
cur_to_org( num_points + 2, pts );
/* now consider hinting */
if ( IS_HINTED( loader->load_flags ) && n_ins > 0 )

View File

@ -19,21 +19,24 @@
#ifndef TTGLOAD_H
#define TTGLOAD_H
#ifdef FT_FLAT_COMPILE
#include "ttobjs.h"
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#include "ttinterp.h"
#endif
#else
#else /* FT_FLAT_COMPILE */
#include <truetype/ttobjs.h>
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#include <truetype/ttinterp.h>
#endif
#endif
#endif /* FT_FLAT_COMPILE */
#ifdef __cplusplus

View File

@ -20,10 +20,15 @@
#include <freetype/internal/ftcalc.h>
#include <freetype/ftsystem.h>
#ifdef FT_FLAT_COMPILE
#include "ttinterp.h"
#else
#include <truetype/ttinterp.h>
#endif

View File

@ -19,12 +19,16 @@
#ifndef TTINTERP_H
#define TTINTERP_H
#ifdef FT_FLAT_COMPILE
#include "ttobjs.h"
#else
#include <truetype/ttobjs.h>
#endif
#ifdef FT_FLAT_COMPILE
#include "ttobjs.h"
#else
#include <truetype/ttobjs.h>
#endif
#ifdef __cplusplus

View File

@ -25,23 +25,27 @@
#include <freetype/internal/sfnt.h>
#include <freetype/internal/psnames.h>
#ifdef FT_FLAT_COMPILE
#include "ttgload.h"
#include "ttpload.h"
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#include "ttinterp.h"
#endif
#else
#else /* FT_FLAT_COMPILE */
#include <truetype/ttgload.h>
#include <truetype/ttpload.h>
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#include <truetype/ttinterp.h>
#endif
#endif
#endif /* FT_FLAT_COMPILE */
#include <freetype/internal/tterrors.h>

View File

@ -17,11 +17,16 @@
#ifdef FT_FLAT_COMPILE
#include "t1afm.h"
#else
#include <type1/t1afm.h>
#endif
#include <freetype/internal/ftstream.h>
#include <freetype/internal/t1types.h>

View File

@ -17,15 +17,20 @@
#ifdef FT_FLAT_COMPILE
#include "t1driver.h"
#include "t1gload.h"
#include "t1afm.h"
#else
#include <type1/t1driver.h>
#include <type1/t1gload.h>
#include <type1/t1afm.h>
#endif
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftstream.h>
#include <freetype/internal/psnames.h>
@ -217,8 +222,8 @@
result = psnames->lookup_unicode( &face->unicode_map,
(FT_ULong)charcode );
/* the function returns 0xFFFF when the Unicode charcode has */
/* no corresponding glyph. */
/* the function returns 0xFFFF if the Unicode charcode has */
/* no corresponding glyph */
if ( result == 0xFFFF )
result = 0;
goto Exit;
@ -264,7 +269,7 @@
if ( gname && gname[0] == glyph_name[0] &&
strcmp( gname, glyph_name ) == 0 )
strcmp( gname, glyph_name ) == 0 )
{
result = n;
break;
@ -316,7 +321,7 @@
#ifdef T1_CONFIG_OPTION_NO_AFM
(FTDriver_getKerning) 0,
(FTDriver_getAdvances) 0,
(FTDriver_attachFile) 0,
#else
(FTDriver_getKerning) Get_Kerning,
(FTDriver_attachFile) T1_Read_AFM,

View File

@ -19,24 +19,26 @@
#ifdef FT_FLAT_COMPILE
#include <type1/t1gload.h>
#ifndef T1_CONFIG_OPTION_DISABLE_HINTER
#include <type1/t1hinter.h>
#endif
#else
#else /* FT_FLAT_COMPILE */
#include <type1/t1gload.h>
#ifndef T1_CONFIG_OPTION_DISABLE_HINTER
#include <type1/t1hinter.h>
#endif
#endif
#endif /* FT_FLAT_COMPILE */
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftstream.h>
#include <freetype/ftoutln.h>
#include <string.h> /* for strcmp() */
@ -181,6 +183,7 @@
/* */
/* <Input> */
/* funcs :: The hinting functions interface. */
/* */
LOCAL_FUNC
void T1_Init_Decoder( T1_Decoder* decoder,
const T1_Hinter_Funcs* funcs )

View File

@ -19,10 +19,15 @@
#ifndef T1GLOAD_H
#define T1GLOAD_H
#ifdef FT_FLAT_COMPILE
#include "t1objs.h"
#else
#include <type1/t1objs.h>
#endif

View File

@ -26,14 +26,19 @@
#include <freetype/internal/ftdebug.h>
#ifdef FT_FLAT_COMPILE
#include "t1objs.h"
#include "t1hinter.h"
#else
#include <type1/t1objs.h>
#include <type1/t1hinter.h>
#endif
#endif
/*************************************************************************/

View File

@ -19,14 +19,20 @@
#ifndef T1HINTER_H
#define T1HINTER_H
#ifdef FT_FLAT_COMPILE
#include "t1objs.h"
#include "t1gload.h"
#else
#include <type1/t1objs.h>
#include <type1/t1gload.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -20,12 +20,17 @@
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/t1types.h>
#ifdef FT_FLAT_COMPILE
#include "t1tokens.h"
#include "t1parse.h"
#else
#include <type1/t1tokens.h>
#include <type1/t1parse.h>
#endif

View File

@ -21,10 +21,15 @@
#include <freetype/internal/ftstream.h>
#ifdef FT_FLAT_COMPILE
#include "t1parse.h"
#else
#include <type1/t1parse.h>
#endif

View File

@ -19,32 +19,33 @@
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftstream.h>
#ifdef FT_FLAT_COMPILE
#include "t1gload.h"
#include "t1load.h"
#include "t1afm.h"
#ifndef T1_CONFIG_OPTION_DISABLE_HINTER
#include "t1hinter.h"
#endif
#else
#else /* FT_FLAT_COMPILE */
#include <type1/t1gload.h>
#include <type1/t1load.h>
#include <type1/t1afm.h>
#ifndef T1_CONFIG_OPTION_DISABLE_HINTER
#include <type1/t1hinter.h>
#endif
#endif
#endif /* FT_FLAT_COMPILE */
#include <freetype/internal/psnames.h>
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
@ -174,7 +175,6 @@
/* */
/* FACE FUNCTIONS */
/* */
/* */
/*************************************************************************/
@ -245,7 +245,8 @@
/*************************************************************************/
/* */
/* <Function> T1_Init_Face */
/* <Function> */
/* T1_Init_Face */
/* */
/* <Description> */
/* The face object constructor. */

View File

@ -19,10 +19,15 @@
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/t1types.h>
#ifdef FT_FLAT_COMPILE
#include "t1parse.h"
#else
#include <type1/t1parse.h>
#endif

View File

@ -32,10 +32,15 @@
#include <freetype/internal/ftstream.h>
#ifdef FT_FLAT_COMPILE
#include "t1tokens.h"
#else
#include <type1/t1tokens.h>
#endif

View File

@ -32,12 +32,17 @@
#include <freetype/internal/ftstream.h>
#include <freetype/internal/ftdebug.h>
#ifdef FT_FLAT_COMPILE
#include "t1tokens.h"
#include "t1load.h"
#else
#include <type1/t1tokens.h>
#include <type1/t1load.h>
#endif

View File

@ -19,12 +19,16 @@
#ifndef T1TOKENS_H
#define T1TOKENS_H
#ifdef FT_FLAT_COMPILE
#include "t1objs.h"
#else
#include <type1/t1objs.h>
#endif
#ifdef FT_FLAT_COMPILE
#include "t1objs.h"
#else
#include <type1/t1objs.h>
#endif
#ifdef __cplusplus

View File

@ -18,6 +18,7 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
#ifdef FT_FLAT_COMPILE
#include "t1driver.c"
@ -26,9 +27,11 @@
#include "t1gload.c"
#include "t1tokens.c"
#include "t1parse.c"
#ifndef T1_CONFIG_OPTION_DISABLE_HINTER
#include "t1hinter.c"
#endif
#ifndef T1_CONFIG_OPTION_NO_AFM
#include "t1afm.c"
#endif
@ -41,16 +44,16 @@
#include <type1/t1gload.c>
#include <type1/t1tokens.c>
#include <type1/t1parse.c>
#ifndef T1_CONFIG_OPTION_DISABLE_HINTER
#include <type1/t1hinter.c>
#endif
#ifndef T1_CONFIG_OPTION_NO_AFM
#include <type1/t1afm.c>
#endif
#endif
#endif /* FT_FLAT_COMPILE */
/* END */

View File

@ -18,6 +18,7 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
#ifdef FT_FLAT_COMPILE
#include "z1parse.c"
@ -25,22 +26,24 @@
#include "z1objs.c"
#include "z1driver.c"
#include "z1gload.c"
#ifndef Z1_CONFIG_OPTION_NO_AFM
#include "z1afm.c"
#endif
#else
#else /* FT_FLAT_COMPILE */
#include <type1z/z1parse.c>
#include <type1z/z1load.c>
#include <type1z/z1objs.c>
#include <type1z/z1driver.c>
#include <type1z/z1gload.c>
#ifndef Z1_CONFIG_OPTION_NO_AFM
#include <type1z/z1afm.c>
#endif
#endif
#endif /* FT_FLAT_COMPILE */
/* END */

View File

@ -17,11 +17,16 @@
#ifdef FT_FLAT_COMPILE
#include "z1afm.h"
#else
#include <type1z/z1afm.h>
#endif
#include <freetype/internal/ftstream.h>
#include <freetype/internal/t1types.h>

View File

@ -19,12 +19,16 @@
#ifndef Z1AFM_H
#define Z1AFM_H
#ifdef FT_FLAT_COMPILE
#include "z1objs.h"
#else
#include <type1z/z1objs.h>
#endif
#ifdef FT_FLAT_COMPILE
#include "z1objs.h"
#else
#include <type1z/z1objs.h>
#endif
#ifdef __cplusplus

View File

@ -1,30 +1,35 @@
/*******************************************************************
*
* t1driver.c
*
* High-level Type1 driver interface for FreeType 2.0
*
* Copyright 1996-1998 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.
*
******************************************************************/
/***************************************************************************/
/* */
/* z1driver.c */
/* */
/* Experimental Type 1 driver interface (body). */
/* */
/* Copyright 1996-2000 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. */
/* */
/***************************************************************************/
#ifdef FT_FLAT_COMPILE
#include "z1driver.h"
#include "z1gload.h"
#include "z1load.h"
#include "z1afm.h"
#else
#include <type1z/z1driver.h>
#include <type1z/z1gload.h>
#include <type1z/z1load.h>
#include <type1z/z1afm.h>
#endif
@ -32,8 +37,18 @@
#include <freetype/internal/ftstream.h>
#include <freetype/internal/psnames.h>
#include <string.h> /* for strcmp() */
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
/* messages during execution. */
/* */
#undef FT_COMPONENT
#define FT_COMPONENT trace_t1driver
#define FT_COMPONENT trace_z1driver
/*************************************************************************/
/* */
@ -66,8 +81,8 @@
FT_Module_Interface Get_Interface( FT_Driver driver,
const FT_String* interface )
{
FT_UNUSED(driver);
FT_UNUSED(interface);
FT_UNUSED( driver );
FT_UNUSED( interface );
#ifndef Z1_CONFIG_OPTION_NO_MM_SUPPORT
if ( strcmp( (const char*)interface, "get_mm" ) == 0 )
@ -84,6 +99,8 @@
#ifndef Z1_CONFIG_OPTION_NO_AFM
/*************************************************************************/
/* */
/* <Function> */
@ -124,16 +141,20 @@
{
Z1_AFM* afm;
kerning->x = 0;
kerning->y = 0;
afm = (Z1_AFM*)face->afm_data;
if (afm)
if ( afm )
Z1_Get_Kerning( afm, left_glyph, right_glyph, kerning );
return T1_Err_Ok;
}
#endif
#endif /* T1_CONFIG_OPTION_NO_AFM */
/*************************************************************************/
/* */
@ -158,147 +179,128 @@
FT_UInt result = 0;
PSNames_Interface* psnames;
face = (T1_Face)charmap->face;
face = (T1_Face)charmap->face;
psnames = (PSNames_Interface*)face->psnames;
if (psnames)
switch (charmap->encoding)
if ( psnames )
switch ( charmap->encoding )
{
/********************************************************************/
/* */
/* Unicode encoding support */
/* */
case ft_encoding_unicode:
{
/* use the "psnames" module to synthetize the Unicode charmap */
result = psnames->lookup_unicode( &face->unicode_map,
(FT_ULong)charcode );
/*******************************************************************/
/* */
/* Unicode encoding support */
/* */
case ft_encoding_unicode:
/* use the `PSNames' module to synthetize the Unicode charmap */
result = psnames->lookup_unicode( &face->unicode_map,
(FT_ULong)charcode );
/* the function returns 0xFFFF when the Unicode charcode has */
/* no corresponding glyph.. */
if (result == 0xFFFF)
result = 0;
goto Exit;
}
/* the function returns 0xFFFF if the Unicode charcode has */
/* no corresponding glyph */
if ( result == 0xFFFF )
result = 0;
goto Exit;
/********************************************************************/
/* */
/* Custom Type 1 encoding */
/* */
case ft_encoding_adobe_custom:
/*******************************************************************/
/* */
/* Custom Type 1 encoding */
/* */
case ft_encoding_adobe_custom:
{
T1_Encoding* encoding = &face->type1.encoding;
if ( charcode >= encoding->code_first &&
charcode <= encoding->code_last )
result = encoding->char_index[charcode];
goto Exit;
}
/*******************************************************************/
/* */
/* Adobe Standard & Expert encoding support */
/* */
default:
if ( charcode < 256 )
{
FT_UInt code;
FT_Int n;
const char* glyph_name;
code = psnames->adobe_std_encoding[charcode];
if ( charmap->encoding == ft_encoding_adobe_expert )
code = psnames->adobe_expert_encoding[charcode];
glyph_name = psnames->adobe_std_strings( code );
if ( !glyph_name )
break;
for ( n = 0; n < face->type1.num_glyphs; n++ )
{
T1_Encoding* encoding = &face->type1.encoding;
if (charcode >= encoding->code_first &&
charcode <= encoding->code_last)
const char* gname = face->type1.glyph_names[n];
if ( gname && gname[0] == glyph_name[0] &&
strcmp( gname, glyph_name ) == 0 )
{
result = encoding->char_index[charcode];
result = n;
break;
}
goto Exit;
}
/********************************************************************/
/* */
/* Adobe Standard & Expert encoding support */
/* */
default:
if (charcode < 256)
{
FT_UInt code;
FT_Int n;
const char* glyph_name;
code = psnames->adobe_std_encoding[charcode];
if (charmap->encoding == ft_encoding_adobe_expert)
code = psnames->adobe_expert_encoding[charcode];
glyph_name = psnames->adobe_std_strings(code);
if (!glyph_name) break;
for ( n = 0; n < face->type1.num_glyphs; n++ )
{
const char* gname = face->type1.glyph_names[n];
if ( gname && gname[0] == glyph_name[0] &&
strcmp( gname, glyph_name ) == 0 )
{
result = n;
break;
}
}
}
}
}
Exit:
return result;
}
const FT_Driver_Class t1z_driver_class =
const FT_Driver_Class t1z_driver_class =
{
{
ft_module_font_driver | ft_module_driver_scalable,
sizeof( FT_DriverRec ),
"type1z",
0x10000,
0x20000,
0x10000L,
0x20000L,
0, /* format interface */
(FT_Module_Constructor) Z1_Init_Driver,
(FT_Module_Destructor) Z1_Done_Driver,
(FT_Module_Requester) Get_Interface,
(FT_Module_Constructor)Z1_Init_Driver,
(FT_Module_Destructor) Z1_Done_Driver,
(FT_Module_Requester) Get_Interface,
},
sizeof( T1_FaceRec ),
sizeof( Z1_SizeRec ),
sizeof( Z1_GlyphSlotRec ),
(FTDriver_initFace) Z1_Init_Face,
(FTDriver_doneFace) Z1_Done_Face,
(FTDriver_initSize) 0,
(FTDriver_doneSize) 0,
(FTDriver_initGlyphSlot) 0,
(FTDriver_doneGlyphSlot) 0,
(FTDriver_initFace) Z1_Init_Face,
(FTDriver_doneFace) Z1_Done_Face,
(FTDriver_initSize) 0,
(FTDriver_doneSize) 0,
(FTDriver_initGlyphSlot)0,
(FTDriver_doneGlyphSlot)0,
(FTDriver_setCharSizes) 0,
(FTDriver_setPixelSizes) 0,
(FTDriver_loadGlyph) Z1_Load_Glyph,
(FTDriver_getCharIndex) Get_Char_Index,
(FTDriver_setCharSizes) 0,
(FTDriver_setPixelSizes)0,
(FTDriver_loadGlyph) Z1_Load_Glyph,
(FTDriver_getCharIndex) Get_Char_Index,
#ifdef Z1_CONFIG_OPTION_NO_AFM
(FTDriver_getKerning) 0,
(FTDriver_attachFile) 0,
(FTDriver_getKerning) 0,
(FTDriver_attachFile) 0,
#else
(FTDriver_getKerning) Get_Kerning,
(FTDriver_attachFile) Z1_Read_AFM,
(FTDriver_getKerning) Get_Kerning,
(FTDriver_attachFile) Z1_Read_AFM,
#endif
(FTDriver_getAdvances) 0
(FTDriver_getAdvances) 0
};
/******************************************************************/
/* */
/* <Function> Get_FreeType_Driver_Interface */
/* */
/* <Description> */
/* This function is used when compiling the TrueType driver */
/* as a shared library (.DLL or .so). It will be used by the */
/* high-level library of FreeType to retrieve the address of */
/* the driver's generic interface. */
/* */
/* It shouldn't be implemented in a static build, as each */
/* driver must have the same function as an exported entry */
/* point. */
/* */
/* <Return> */
/* address of TrueType's driver generic interface. The */
/* forma-specific interface can then be retrieved through */
/* the method interface->get_format_interface.. */
/* */
#ifdef FT_CONFIG_OPTION_DYNAMIC_DRIVERS
EXPORT_FUNC(const FT_Driver_Class*) getDriverClass( void )
EXPORT_FUNC( const FT_Driver_Class* ) getDriverClass( void )
{
return &t1z_driver_class;
}
@ -306,3 +308,4 @@
#endif /* FT_CONFIG_OPTION_DYNAMIC_DRIVERS */
/* END */

View File

@ -1,26 +1,29 @@
/*******************************************************************
*
* t1driver.h
*
* High-level Type1 driver interface for FreeType 2.0
*
* Copyright 1996-1998 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.
*
******************************************************************/
/***************************************************************************/
/* */
/* z1driver.h */
/* */
/* High-level experimental Type 1 driver interface (specification). */
/* */
/* Copyright 1996-2000 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 Z1DRIVER_H
#define Z1DRIVER_H
#include <freetype/internal/ftdriver.h>
FT_EXPORT_VAR(const FT_Driver_Class) t1z_driver_class;
FT_EXPORT_VAR( const FT_Driver_Class ) t1z_driver_class;
#endif /* Z1DRIVER_H */
/* END */

File diff suppressed because it is too large Load Diff

View File

@ -1,44 +1,33 @@
/*******************************************************************
*
* t1gload.h 1.0
*
* Type1 Glyph Loader.
*
* Copyright 1996-1998 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.
*
*
* The Type 1 glyph loader uses three distinct objects to build
* scaled and hinted outlines from a charstrings program. These are :
*
* - a glyph builder, Z1_Builder, used to store the built outline
*
* - a glyph hinter, Z1_Hinter, used to record and apply the stem
* hints
*
* - a charstrings interpreter, Z1_Decoder, used to parse the
* Type 1 charstrings stream, manage a stack and call the builder
* and/or hinter depending on the opcodes.
*
* Ideally, a Type 2 glyph loader would only need to have its own
* T2_Decoder object (assuming the hinter is able to manage all
* kinds of hints).
*
******************************************************************/
/***************************************************************************/
/* */
/* z1gload.h */
/* */
/* Experimental Type 1 Glyph Loader (specification). */
/* */
/* Copyright 1996-2000 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 Z1GLOAD_H
#define Z1GLOAD_H
#ifdef FT_FLAT_COMPILE
#include "z1objs.h"
#else
#include <type1z/z1objs.h>
#endif
@ -47,46 +36,55 @@
#endif
/*************************************************************************/
/* */
/* <Structure> Z1_Builder */
/* */
/* <Description> */
/* a structure used during glyph loading to store its outline. */
/* */
/* <Fields> */
/* system :: current system object */
/* face :: current face object */
/* glyph :: current glyph slot */
/* */
/* current :: current glyph outline */
/* base :: base glyph outline */
/* */
/* max_points :: maximum points in builder outline */
/* max_contours :: maximum contours in builder outline */
/* */
/* last :: last point position */
/* */
/* scale_x :: horizontal scale ( FUnits to sub-pixels ) */
/* scale_y :: vertical scale ( FUnits to sub-pixels ) */
/* pos_x :: horizontal translation (composite glyphs) */
/* pos_y :: vertical translation (composite glyph) */
/* */
/* left_bearing :: left side bearing point */
/* advance :: horizontal advance vector */
/* */
/* path_begun :: flag, indicates that a new path has begun */
/* load_points :: flag, if not set, no points are loaded */
/* */
/* error :: an error code that is only used to report */
/* memory allocation problems.. */
/* */
/* metrics_only :: a boolean indicating that we only want to */
/* compute the metrics of a given glyph, not load */
/* all of its points.. */
/* */
typedef struct Z1_Builder_
/*************************************************************************/
/* */
/* <Structure> */
/* Z1_Builder */
/* */
/* <Description> */
/* A structure used during glyph loading to store its outline. */
/* */
/* <Fields> */
/* memory :: The current memory object. */
/* */
/* face :: The current face object. */
/* */
/* glyph :: The current glyph slot. */
/* */
/* loader :: The current glyph loader. */
/* */
/* current :: The current glyph outline. */
/* */
/* base :: The base glyph outline. */
/* */
/* last :: The last point position. */
/* */
/* scale_x :: The horizontal scale (FUnits to sub-pixels). */
/* */
/* scale_y :: The vertical scale (FUnits to sub-pixels). */
/* */
/* pos_x :: The horizontal translation (for composite glyphs). */
/* */
/* pos_y :: The vertical translation (for composite glyphs). */
/* */
/* left_bearing :: The left side bearing point. */
/* */
/* advance :: The horizontal advance vector. */
/* */
/* no_recurse :: */
/* */
/* bbox :: The glyph's bounding box. */
/* */
/* path_begun :: A flag which indicates that a new path has begun. */
/* */
/* load_points :: A flag which indicates, if not set, that no points */
/* are loaded. */
/* */
/* error :: The current error code. */
/* */
/* metrics_only :: A flag whether to compute metrics only. */
/* */
typedef struct Z1_Builder_
{
FT_Memory memory;
T1_Face face;
@ -119,7 +117,7 @@
/* execution context charstring zone */
typedef struct Z1_Decoder_Zone_
typedef struct Z1_Decoder_Zone_
{
FT_Byte* base;
FT_Byte* limit;
@ -128,47 +126,41 @@
} Z1_Decoder_Zone;
typedef struct Z1_Decoder_
typedef struct Z1_Decoder_
{
Z1_Builder builder;
Z1_Builder builder;
FT_Int stack[ T1_MAX_CHARSTRINGS_OPERANDS ];
FT_Int* top;
FT_Int stack[T1_MAX_CHARSTRINGS_OPERANDS];
FT_Int* top;
Z1_Decoder_Zone zones[ T1_MAX_SUBRS_CALLS+1 ];
Z1_Decoder_Zone* zone;
Z1_Decoder_Zone zones[T1_MAX_SUBRS_CALLS + 1];
Z1_Decoder_Zone* zone;
FT_Int flex_state;
FT_Int num_flex_vectors;
FT_Vector flex_vectors[7];
FT_Int flex_state;
FT_Int num_flex_vectors;
FT_Vector flex_vectors[7];
T1_Blend* blend; /* for multiple masters */
T1_Blend* blend; /* for multiple masters */
} Z1_Decoder;
LOCAL_DEF
void Z1_Init_Builder( Z1_Builder* builder,
T1_Face face,
Z1_Size size,
Z1_GlyphSlot glyph );
LOCAL_DEF
void Z1_Init_Builder( Z1_Builder* builder,
T1_Face face,
Z1_Size size,
Z1_GlyphSlot glyph );
void Z1_Done_Builder( Z1_Builder* builder );
LOCAL_DEF
void Z1_Done_Builder( Z1_Builder* builder );
void Z1_Init_Decoder( Z1_Decoder* decoder );
LOCAL_DEF
void Z1_Init_Decoder( Z1_Decoder* decoder );
/* Compute the maximum advance width of a font through quick parsing */
LOCAL_DEF
FT_Error Z1_Compute_Max_Advance( T1_Face face,
FT_Int *max_advance );
FT_Int* max_advance );
/* This function is exported, because it is used by the T1Dump utility */
LOCAL_DEF
FT_Error Z1_Parse_CharStrings( Z1_Decoder* decoder,
FT_Byte* charstring_base,
@ -177,8 +169,6 @@
FT_Byte** subrs_base,
FT_Int* subrs_len );
LOCAL_DEF
FT_Error Z1_Load_Glyph( Z1_GlyphSlot glyph,
Z1_Size size,
@ -190,4 +180,8 @@
}
#endif
#endif /* Z1GLOAD_H */
/* END */

View File

@ -1,19 +1,20 @@
/*******************************************************************
*
* t1load.h 2.0
*
* Type1 Loader.
*
* Copyright 1996-2000 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.
*
******************************************************************/
/***************************************************************************/
/* */
/* z1load.h */
/* */
/* Experimental Type 1 font loader (specification). */
/* */
/* Copyright 1996-2000 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 Z1LOAD_H
#define Z1LOAD_H
@ -22,40 +23,46 @@
#include <freetype/internal/t1types.h>
#include <freetype/ftmm.h>
#ifdef FT_FLAT_COMPILE
#include "z1parse.h"
#else
#include <type1z/z1parse.h>
#endif
#ifdef FT_FLAT_COMPILE
#include "z1parse.h"
#else
#include <type1z/z1parse.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct Z1_Loader_
typedef struct Z1_Loader_
{
Z1_Parser parser; /* parser used to read the stream */
Z1_Parser parser; /* parser used to read the stream */
FT_Int num_chars; /* number of characters in encoding */
Z1_Table encoding_table; /* Z1_Table used to store the */
FT_Int num_chars; /* number of characters in encoding */
Z1_Table encoding_table; /* Z1_Table used to store the */
/* encoding character names */
FT_Int num_glyphs;
Z1_Table glyph_names;
Z1_Table charstrings;
FT_Int num_glyphs;
Z1_Table glyph_names;
Z1_Table charstrings;
FT_Int num_subrs;
Z1_Table subrs;
FT_Bool fontdata;
FT_Int num_subrs;
Z1_Table subrs;
FT_Bool fontdata;
} Z1_Loader;
LOCAL_DEF
FT_Error Z1_Open_Face( T1_Face face );
#ifndef Z1_CONFIG_OPTION_NO_MM_SUPPORT
LOCAL_DEF
FT_Error Z1_Get_Multi_Master( T1_Face face,
FT_Multi_Master* master );
@ -72,7 +79,9 @@
LOCAL_DEF
void Z1_Done_Blend( T1_Face face );
#endif
#endif /* !Z1_CONFIG_OPTION_NO_MM_SUPPORT */
#ifdef __cplusplus
}

View File

@ -1,69 +1,79 @@
/*******************************************************************
*
* t1objs.c 1.0
*
* Type1 Objects manager.
*
* Copyright 1996-1998 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.
*
******************************************************************/
/***************************************************************************/
/* */
/* z1objs.c */
/* */
/* Experimental Type 1 objects manager (body). */
/* */
/* Copyright 1996-2000 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. */
/* */
/***************************************************************************/
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftstream.h>
#ifdef FT_FLAT_COMPILE
#include "z1gload.h"
#include "z1load.h"
#include "z1afm.h"
#else
#include <type1z/z1gload.h>
#include <type1z/z1load.h>
#include <type1z/z1afm.h>
#endif
#include <freetype/internal/psnames.h>
/* Required by tracing mode */
#undef FT_COMPONENT
#define FT_COMPONENT trace_t1objs
/*******************************************************************
* *
* FACE FUNCTIONS *
* *
* *
*******************************************************************/
/*************************************************************************/
/* */
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
/* messages during execution. */
/* */
#undef FT_COMPONENT
#define FT_COMPONENT trace_z1objs
/*******************************************************************
*
* <Function> Z1_Done_Face
*
* <Description>
* The face object destructor.
*
* <Input>
* face :: typeless pointer to the face object to destroy
*
* <Return>
* Error code.
*
******************************************************************/
/*************************************************************************/
/* */
/* FACE FUNCTIONS */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* Z1_Done_Face */
/* */
/* <Description> */
/* The face object destructor. */
/* */
/* <Input> */
/* face :: A typeless pointer to the face object to destroy. */
/* */
LOCAL_FUNC
void Z1_Done_Face( T1_Face face )
{
FT_Memory memory;
T1_Font* type1 = &face->type1;
if (face)
if ( face )
{
memory = face->root.memory;
@ -77,6 +87,7 @@
{
T1_FontInfo* info = &type1->font_info;
FREE( info->version );
FREE( info->notice );
FREE( info->full_name );
@ -101,7 +112,7 @@
#ifndef Z1_CONFIG_OPTION_NO_AFM
/* release afm data if present */
if ( face->afm_data)
if ( face->afm_data )
Z1_Done_AFM( memory, (Z1_AFM*)face->afm_data );
#endif
@ -114,22 +125,30 @@
}
}
/*******************************************************************
*
* <Function> Z1_Init_Face
*
* <Description>
* The face object constructor.
*
* <Input>
* face :: face record to build
* Input :: input stream where to load font data
*
* <Return>
* Error code.
*
******************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* Z1_Init_Face */
/* */
/* <Description> */
/* The face object constructor. */
/* */
/* <Input> */
/* stream :: input stream where to load font data. */
/* */
/* 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 face record to build. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error Z1_Init_Face( FT_Stream stream,
T1_Face face,
@ -137,146 +156,154 @@
FT_Int num_params,
FT_Parameter* params )
{
FT_Error error;
FT_Error error;
PSNames_Interface* psnames;
FT_UNUSED(num_params);
FT_UNUSED(params);
FT_UNUSED(face_index);
FT_UNUSED(stream);
FT_UNUSED( num_params );
FT_UNUSED( params );
FT_UNUSED( face_index );
FT_UNUSED( stream );
face->root.num_faces = 1;
psnames = (PSNames_Interface*)face->psnames;
if (!psnames)
if ( !psnames )
{
psnames = (PSNames_Interface*)
FT_Get_Module_Interface( FT_FACE_LIBRARY(face), "psnames" );
FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), "psnames" );
face->psnames = psnames;
}
/* open the tokenizer, this will also check the font format */
error = Z1_Open_Face( face );
if (error) goto Exit;
if ( error )
goto Exit;
/* if we just wanted to check the format, leave successfully now */
if (face_index < 0)
if ( face_index < 0 )
goto Exit;
/* check the face index */
if ( face_index != 0 )
{
FT_ERROR(( "T1.Init_Face : invalid face index\n" ));
FT_ERROR(( "Z1_Init_Face: invalid face index\n" ));
error = T1_Err_Invalid_Argument;
goto Exit;
}
/* Now, load the font program into the face object */
/* Init the face object fields */
/* Now set up root face fields */
{
/* Init the face object fields */
/* Now set up root face fields */
FT_Face root = (FT_Face)&face->root;
root->num_glyphs = face->type1.num_glyphs;
root->num_charmaps = 1;
root->face_index = face_index;
root->face_flags = FT_FACE_FLAG_SCALABLE;
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
if ( face->type1.font_info.is_fixed_pitch )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
if ( face->blend )
root->face_flags |= FT_FACE_FLAG_MULTIPLE_MASTERS;
/* XXX: TODO -- add kerning with .afm support */
/* get style name -- be careful, some broken fonts only */
/* have a `/FontName' dictionary entry! */
root->family_name = face->type1.font_info.family_name;
if ( root->family_name )
{
FT_Face root = (FT_Face)&face->root;
char* full = face->type1.font_info.full_name;
char* family = root->family_name;
root->num_glyphs = face->type1.num_glyphs;
root->num_charmaps = 1;
root->face_index = face_index;
root->face_flags = FT_FACE_FLAG_SCALABLE;
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
if ( face->type1.font_info.is_fixed_pitch )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
if ( face->blend )
root->face_flags |= FT_FACE_FLAG_MULTIPLE_MASTERS;
/* XXX : TO DO - add kerning with .afm support */
/* get style name - be careful, some broken fonts only */
/* have a /FontName dictionary entry .. !! */
root->family_name = face->type1.font_info.family_name;
if (root->family_name)
while ( *family && *full == *family )
{
char* full = face->type1.font_info.full_name;
char* family = root->family_name;
while ( *family && *full == *family )
{
family++;
full++;
}
root->style_name = ( *full == ' ' ? full + 1
: (char *)"Regular" );
}
else
{
/* do we have a /FontName ?? */
if (face->type1.font_name)
{
root->family_name = face->type1.font_name;
root->style_name = "Regular";
}
family++;
full++;
}
/* no embedded bitmap support */
root->num_fixed_sizes = 0;
root->available_sizes = 0;
root->bbox = face->type1.font_bbox;
root->units_per_EM = 1000;
root->ascender = (FT_Short)face->type1.font_bbox.yMax;
root->descender = -(FT_Short)face->type1.font_bbox.yMin;
root->height = ((root->ascender + root->descender)*12)/10;
/* now compute the maximum advance width */
root->max_advance_width = face->type1.private_dict.standard_width[0];
/* compute max advance width for proportional fonts */
if (!face->type1.font_info.is_fixed_pitch)
{
FT_Int max_advance;
error = Z1_Compute_Max_Advance( face, &max_advance );
/* in case of error, keep the standard width */
if (!error)
root->max_advance_width = max_advance;
else
error = 0; /* clear error */
}
root->max_advance_height = root->height;
root->underline_position = face->type1.font_info.underline_position;
root->underline_thickness = face->type1.font_info.underline_thickness;
root->max_points = 0;
root->max_contours = 0;
root->style_name = ( *full == ' ' ? full + 1
: (char *)"Regular" );
}
else
{
/* do we have a `/FontName'? */
if ( face->type1.font_name )
{
root->family_name = face->type1.font_name;
root->style_name = "Regular";
}
}
/* no embedded bitmap support */
root->num_fixed_sizes = 0;
root->available_sizes = 0;
root->bbox = face->type1.font_bbox;
root->units_per_EM = 1000;
root->ascender = (FT_Short)face->type1.font_bbox.yMax;
root->descender = -(FT_Short)face->type1.font_bbox.yMin;
root->height = ( ( root->ascender + root->descender ) * 12 ) / 10;
/* now compute the maximum advance width */
root->max_advance_width = face->type1.private_dict.standard_width[0];
/* compute max advance width for proportional fonts */
if ( !face->type1.font_info.is_fixed_pitch )
{
FT_Int max_advance;
error = Z1_Compute_Max_Advance( face, &max_advance );
/* in case of error, keep the standard width */
if ( !error )
root->max_advance_width = max_advance;
else
error = 0; /* clear error */
}
root->max_advance_height = root->height;
root->underline_position = face->type1.font_info.underline_position;
root->underline_thickness = face->type1.font_info.underline_thickness;
root->max_points = 0;
root->max_contours = 0;
}
/* charmap support - synthetize unicode charmap when possible */
/* charmap support -- synthetize unicode charmap if possible */
{
FT_Face root = &face->root;
FT_CharMap charmap = face->charmaprecs;
FT_Face root = &face->root;
FT_CharMap charmap = face->charmaprecs;
/* synthesize a Unicode charmap if there is support in the "psnames" */
/* module.. */
if (face->psnames)
/* synthesize a Unicode charmap if there is support in the `PSNames' */
/* module */
if ( face->psnames )
{
PSNames_Interface* psnames = (PSNames_Interface*)face->psnames;
if (psnames->unicode_value)
if ( psnames->unicode_value )
{
error = psnames->build_unicodes( root->memory,
face->type1.num_glyphs,
(const char**)face->type1.glyph_names,
&face->unicode_map );
if (!error)
error = psnames->build_unicodes(
root->memory,
face->type1.num_glyphs,
(const char**)face->type1.glyph_names,
&face->unicode_map );
if ( !error )
{
root->charmap = charmap;
charmap->face = (FT_Face)face;
@ -288,82 +315,81 @@
/* simply clear the error in case of failure (which really) */
/* means that out of memory or no unicode glyph names */
error = 0;
error = FT_Err_Ok;
}
}
/* now, support either the standard, expert, or custom encodings */
/* now, support either the standard, expert, or custom encoding */
charmap->face = (FT_Face)face;
charmap->platform_id = 7; /* a new platform id for Adobe fonts ?? */
charmap->platform_id = 7; /* a new platform id for Adobe fonts? */
switch (face->type1.encoding_type)
switch ( face->type1.encoding_type )
{
case t1_encoding_standard:
charmap->encoding = ft_encoding_adobe_standard;
charmap->encoding_id = 0;
break;
case t1_encoding_standard:
charmap->encoding = ft_encoding_adobe_standard;
charmap->encoding_id = 0;
break;
case t1_encoding_expert:
charmap->encoding = ft_encoding_adobe_expert;
charmap->encoding_id = 1;
break;
case t1_encoding_expert:
charmap->encoding = ft_encoding_adobe_expert;
charmap->encoding_id = 1;
break;
default:
charmap->encoding = ft_encoding_adobe_custom;
charmap->encoding_id = 2;
break;
default:
charmap->encoding = ft_encoding_adobe_custom;
charmap->encoding_id = 2;
break;
}
root->charmaps = face->charmaps;
root->charmaps = face->charmaps;
root->num_charmaps = charmap - face->charmaprecs + 1;
face->charmaps[0] = &face->charmaprecs[0];
face->charmaps[1] = &face->charmaprecs[1];
face->charmaps[0] = &face->charmaprecs[0];
face->charmaps[1] = &face->charmaprecs[1];
}
Exit:
return error;
}
/*******************************************************************
*
* <Function> Z1_Init_Driver
*
* <Description>
* Initialise a given Type 1 driver object
*
* <Input>
* driver :: handle to target driver object
*
* <Return>
* Error code.
*
******************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* Z1_Init_Driver */
/* */
/* <Description> */
/* Initializes a given Type 1 driver object. */
/* */
/* <Input> */
/* driver :: A handle to the target driver object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
LOCAL_FUNC
FT_Error Z1_Init_Driver( Z1_Driver driver )
{
FT_UNUSED(driver);
FT_UNUSED( driver );
return T1_Err_Ok;
}
/*******************************************************************
*
* <Function> Z1_Done_Driver
*
* <Description>
* finalise a given Type 1 driver
*
* <Input>
* driver :: handle to target Type 1 driver
*
******************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* Z1_Done_Driver */
/* */
/* <Description> */
/* Finalizes a given Type 1 driver. */
/* */
/* <Input> */
/* driver :: A handle to the target Type 1 driver. */
/* */
LOCAL_DEF
void Z1_Done_Driver( Z1_Driver driver )
{
FT_UNUSED(driver);
FT_UNUSED( driver );
}

View File

@ -1,19 +1,20 @@
/*******************************************************************
*
* t1objs.h 1.0
*
* Type1 objects definition.
*
* Copyright 1996-1999 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.
*
******************************************************************/
/***************************************************************************/
/* */
/* z1objs.h */
/* */
/* Experimental Type 1 objects manager (specification). */
/* */
/* Copyright 1996-2000 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 Z1OBJS_H
#define Z1OBJS_H
@ -31,86 +32,91 @@
typedef struct Z1_Size_Hints_ Z1_Size_Hints;
typedef struct Z1_Glyph_Hints_ Z1_Glyph_Hints;
/***********************************************************************/
/* */
/* <Type> Z1_Driver */
/* */
/* <Description> */
/* A handle to a Type 1 driver object. */
/* */
/*************************************************************************/
/* */
/* <Type> */
/* Z1_Driver */
/* */
/* <Description> */
/* A handle to a Type 1 driver object. */
/* */
typedef struct Z1_DriverRec_ *Z1_Driver;
/***********************************************************************/
/* */
/* <Type> Z1_Size */
/* */
/* <Description> */
/* A handle to a Type 1 size object. */
/* */
/*************************************************************************/
/* */
/* <Type> */
/* Z1_Size */
/* */
/* <Description> */
/* A handle to a Type 1 size object. */
/* */
typedef struct Z1_SizeRec_* Z1_Size;
/***********************************************************************/
/* */
/* <Type> Z1_GlyphSlot */
/* */
/* <Description> */
/* A handle to a Type 1 glyph slot object. */
/* */
/*************************************************************************/
/* */
/* <Type> */
/* Z1_GlyphSlot */
/* */
/* <Description> */
/* A handle to a Type 1 glyph slot object. */
/* */
typedef struct Z1_GlyphSlotRec_* Z1_GlyphSlot;
/***********************************************************************/
/* */
/* <Type> Z1_CharMap */
/* */
/* <Description> */
/* A handle to a Type 1 character mapping object. */
/* */
/* <Note> */
/* The Type 1 format doesn't use a charmap but an encoding table. */
/* The driver is responsible for making up charmap objects */
/* corresponding to these tables.. */
/* */
/*************************************************************************/
/* */
/* <Type> */
/* Z1_CharMap */
/* */
/* <Description> */
/* A handle to a Type 1 character mapping object. */
/* */
/* <Note> */
/* The Type 1 format doesn't use a charmap but an encoding table. */
/* The driver is responsible for making up charmap objects */
/* corresponding to these tables. */
/* */
typedef struct Z1_CharMapRec_* Z1_CharMap;
/**************************************************************************/
/* */
/* NOW BEGINS THE TYPE1 SPECIFIC STUFF .............................. */
/* */
/**************************************************************************/
/*************************************************************************/
/* */
/* HERE BEGINS THE TYPE1 SPECIFIC STUFF */
/* */
/*************************************************************************/
/***************************************************/
/* */
/* Z1_Size : */
/* */
/* Type 1 size record.. */
/* */
typedef struct Z1_SizeRec_
/*************************************************************************/
/* */
/* <Type> */
/* Z1_SizeRec */
/* */
/* <Description> */
/* Type 1 size record. */
/* */
typedef struct Z1_SizeRec_
{
FT_SizeRec root;
FT_Bool valid;
Z1_Size_Hints* hints; /* defined in the hinter. This allows */
/* us to experiment with different */
/* hinting schemes without having to */
/* change 't1objs' each time.. */
/* change `z1objs' each time. */
} Z1_SizeRec;
/***************************************************/
/* */
/* Z1_GlyphSlot : */
/* */
/* TrueDoc glyph record.. */
/* */
typedef struct Z1_GlyphSlotRec_
/*************************************************************************/
/* */
/* <Type> */
/* Z1_GlyphSlotRec */
/* */
/* <Description> */
/* Type 1 glyph slot record. */
/* */
typedef struct Z1_GlyphSlotRec_
{
FT_GlyphSlotRec root;
@ -128,83 +134,23 @@
} Z1_GlyphSlotRec;
/*******************************************************************
*
* <Function> Z1_Init_Face
*
* <Description>
* Initialise a given Type 1 face object
*
* <Input>
* face_index :: index of font face in resource
* resource :: source font resource
* face :: face record to build
*
* <Return>
* Error code.
*
******************************************************************/
LOCAL_DEF
FT_Error Z1_Init_Face( FT_Stream stream,
T1_Face face,
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params );
/*******************************************************************
*
* <Function> Z1_Done_Face
*
* <Description>
* Finalise a given face object
*
* <Input>
* face :: handle to the face object to destroy
*
******************************************************************/
FT_Error Z1_Init_Face( FT_Stream stream,
T1_Face face,
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params );
LOCAL_DEF
void Z1_Done_Face( T1_Face face );
/*******************************************************************
*
* <Function> Z1_Init_Driver
*
* <Description>
* Initialise a given Type 1 driver object
*
* <Input>
* driver :: handle to target driver object
*
* <Return>
* Error code.
*
******************************************************************/
LOCAL_DEF
FT_Error Z1_Init_Driver( Z1_Driver driver );
/*******************************************************************
*
* <Function> Z1_Done_Driver
*
* <Description>
* finalise a given Type 1 driver
*
* <Input>
* driver :: handle to target Type 1 driver
*
******************************************************************/
LOCAL_DEF
void Z1_Done_Driver( Z1_Driver driver );
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,32 +1,20 @@
/*******************************************************************
*
* t1parse.h 2.0
*
* Type1 parser.
*
* Copyright 1996-1998 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.
*
* The Type 1 parser is in charge of the following:
*
* - provide an implementation of a growing sequence of
* objects called a Z1_Table (used to build various tables
* needed by the loader).
*
* - opening .pfb and .pfa files to extract their top-level
* and private dictionaries
*
* - read numbers, arrays & strings from any dictionary
*
* See "t1load.c" to see how data is loaded from the font file
*
******************************************************************/
/***************************************************************************/
/* */
/* z1parse.h */
/* */
/* Experimental Type 1 parser (specification). */
/* */
/* Copyright 1996-2000 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 Z1PARSE_H
#define Z1PARSE_H
@ -39,7 +27,7 @@
/* simple enumeration type used to identify token types */
typedef enum Z1_Token_Type_
typedef enum Z1_Token_Type_
{
t1_token_none = 0,
t1_token_any,
@ -51,8 +39,9 @@
} Z1_Token_Type;
/* a simple structure used to identify tokens */
typedef struct Z1_Token_Rec_
typedef struct Z1_Token_Rec_
{
FT_Byte* start; /* first character of token in input stream */
FT_Byte* limit; /* first character after the token */
@ -60,8 +49,9 @@
} Z1_Token_Rec;
/* enumeration type used to identify object fields */
typedef enum Z1_Field_Type_
typedef enum Z1_Field_Type_
{
t1_field_none = 0,
t1_field_bool,
@ -76,8 +66,9 @@
} Z1_Field_Type;
/* structure type used to model object fields */
typedef struct Z1_Field_Rec_
typedef struct Z1_Field_Rec_
{
Z1_Field_Type type; /* type of field */
FT_UInt offset; /* offset of field in object */
@ -88,94 +79,114 @@
} Z1_Field_Rec;
#define Z1_FIELD_REF(s,f) (((s*)0)->f)
#define Z1_FIELD_BOOL( _ftype, _fname ) \
{ t1_field_bool, \
(FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \
sizeof(Z1_FIELD_REF(_ftype,_fname)), \
0, 0, 0 }
#define Z1_FIELD_REF( s, f ) ( ((s*)0)->f )
#define Z1_FIELD_NUM( _ftype, _fname ) \
{ t1_field_integer, \
(FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \
sizeof(Z1_FIELD_REF(_ftype,_fname)), \
0, 0, 0 }
#define Z1_FIELD_BOOL( _ftype, _fname ) \
{ \
t1_field_bool, \
(FT_UInt)(char*)&Z1_FIELD_REF( _ftype, _fname ), \
sizeof ( Z1_FIELD_REF( _ftype, _fname ) ), \
0, 0, 0 \
}
#define Z1_FIELD_FIXED( _ftype, _fname, _power ) \
{ t1_field_fixed, \
(FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \
sizeof(Z1_FIELD_REF(_ftype,_fname)), \
0, 0, 0 }
#define Z1_FIELD_NUM( _ftype, _fname ) \
{ \
t1_field_integer, \
(FT_UInt)(char*)&Z1_FIELD_REF( _ftype, _fname ), \
sizeof ( Z1_FIELD_REF( _ftype, _fname ) ), \
0, 0, 0 \
}
#define Z1_FIELD_STRING( _ftype, _fname ) \
{ t1_field_string, \
(FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \
sizeof(Z1_FIELD_REF(_ftype,_fname)), \
0, 0, 0 }
#define Z1_FIELD_FIXED( _ftype, _fname, _power ) \
{ \
t1_field_fixed, \
(FT_UInt)(char*)&Z1_FIELD_REF( _ftype, _fname ), \
sizeof ( Z1_FIELD_REF( _ftype, _fname ) ), \
0, 0, 0 \
}
#define Z1_FIELD_NUM_ARRAY( _ftype, _fname, _fcount, _fmax ) \
{ t1_field_integer, \
(FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \
sizeof(Z1_FIELD_REF(_ftype,_fname)[0]), \
_fmax, \
(FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fcount), \
0 }
#define Z1_FIELD_STRING( _ftype, _fname ) \
{ \
t1_field_string, \
(FT_UInt)(char*)&Z1_FIELD_REF( _ftype, _fname ), \
sizeof ( Z1_FIELD_REF( _ftype, _fname ) ), \
0, 0, 0 \
}
#define Z1_FIELD_NUM_ARRAY( _ftype, _fname, _fcount, _fmax ) \
{ \
t1_field_integer, \
(FT_UInt)(char*)&Z1_FIELD_REF( _ftype, _fname ), \
sizeof ( Z1_FIELD_REF( _ftype, _fname )[0] ), \
_fmax, \
(FT_UInt)(char*)&Z1_FIELD_REF( _ftype, _fcount ), \
0 \
}
#define Z1_FIELD_FIXED_ARRAY( _ftype, _fname, _fcount, _fmax ) \
{ t1_field_fixed, \
(FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \
sizeof(Z1_FIELD_REF(_ftype,_fname)[0]), \
_fmax, \
(FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fcount), \
0 }
{ \
t1_field_fixed, \
(FT_UInt)(char*)&Z1_FIELD_REF( _ftype, _fname ), \
sizeof ( Z1_FIELD_REF( _ftype, _fname )[0] ), \
_fmax, \
(FT_UInt)(char*)&Z1_FIELD_REF( _ftype, _fcount ), \
0 \
}
#define Z1_FIELD_NUM_ARRAY2( _ftype, _fname, _fmax ) \
{ t1_field_integer, \
(FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \
sizeof(Z1_FIELD_REF(_ftype,_fname)[0]), \
_fmax, \
0, 0 }
{ \
t1_field_integer, \
(FT_UInt)(char*)&Z1_FIELD_REF( _ftype, _fname ), \
sizeof ( Z1_FIELD_REF( _ftype, _fname )[0] ), \
_fmax, \
0, 0 \
}
#define Z1_FIELD_FIXED_ARRAY2( _ftype, _fname, _fmax ) \
{ t1_field_fixed, \
(FT_UInt)(char*)&Z1_FIELD_REF(_ftype,_fname), \
sizeof(Z1_FIELD_REF(_ftype,_fname)[0]), \
_fmax, \
0, 0 }
#define Z1_FIELD_FIXED_ARRAY2( _ftype, _fname, _fmax ) \
{ \
t1_field_fixed, \
(FT_UInt)(char*)&Z1_FIELD_REF( _ftype, _fname ), \
sizeof ( Z1_FIELD_REF( _ftype, _fname )[0] ), \
_fmax, \
0, 0 \
}
/*************************************************************************
*
* <Struct> Z1_Table
*
* <Description>
* A Z1_Table is a simple object used to store an array of objects
* in a single memory block.
*
* <Fields>
* block :: address in memory of the growheap's block. This
* can change between two object adds, due to the use
* of 'realloc'.
*
* cursor :: current top of the grow heap within its block
*
* capacity :: current size of the heap block. Increments by 1 Kb
*
* init :: boolean. set when the table has been initialized
* (the table user should set this field)
*
* max_elems :: maximum number of elements in table
* num_elems :: current number of elements in table
*
* elements :: table of element addresses within the block
* lengths :: table of element sizes within the block
*
* memory :: memory object used for memory operations (alloc/realloc)
*/
typedef struct Z1_Table_
/*************************************************************************/
/* */
/* <Struct> */
/* Z1_Table */
/* */
/* <Description> */
/* A Z1_Table is a simple object used to store an array of objects in */
/* a single memory block. */
/* */
/* <Fields> */
/* block :: The address in memory of the growheap's block. This */
/* can change between two object adds, due to the use of */
/* reallocation. */
/* */
/* cursor :: The current top of the grow heap within its block. */
/* */
/* capacity :: The current size of the heap block. Increments in */
/* 1kByte blocks. */
/* */
/* init :: A boolean. Set when the table has been initialized */
/* (the table user should set this field). */
/* */
/* max_elems :: The maximum number of elements in the table. */
/* */
/* num_elems :: The current number of elements in the table. */
/* */
/* elements :: A table of element addresses within the block. */
/* */
/* lengths :: A table of element sizes within the block. */
/* */
/* memory :: The memory object used for memory operations */
/* (allocation/reallocation). */
/* */
typedef struct Z1_Table_
{
FT_Byte* block; /* current memory block */
FT_Int cursor; /* current cursor in memory block */
@ -192,36 +203,44 @@
} Z1_Table;
/*************************************************************************
*
* <Struct> Z1_Parser
*
* <Description>
* A Z1_Parser is an object used to parse a Type 1 fonts very
* quickly.
*
* <Fields>
* stream :: current input stream
* memory :: current memory object
*
* base_dict :: pointer to top-level dictionary
* base_len :: length in bytes of top dict
*
* private_dict :: pointer to private dictionary
* private_len :: length in bytes of private dict
*
* in_pfb :: boolean. Indicates that we're in a .pfb file
* in_memory :: boolean. Indicates a memory-based stream
* single_block :: boolean. Indicates that the private dict
* is stored in lieu of the base dict
*
* cursor :: current parser cursor
* limit :: current parser limit (first byte after current
* dictionary).
*
* error :: current parsing error
*/
typedef struct Z1_Parser_
/*************************************************************************/
/* */
/* <Struct> */
/* Z1_Parser */
/* */
/* <Description> */
/* A Z1_Parser is an object used to parse a Type 1 fonts very */
/* quickly. */
/* */
/* <Fields> */
/* stream :: The current input stream. */
/* */
/* memory :: The current memory object. */
/* */
/* base_dict :: A pointer to the top-level dictionary. */
/* */
/* base_len :: The length in bytes of the top dictionary. */
/* */
/* private_dict :: A pointer to the private dictionary. */
/* */
/* private_len :: The length in bytes of the private dictionary. */
/* */
/* in_pfb :: A boolean. Indicates that we are handling a PFB */
/* file. */
/* */
/* in_memory :: A boolean. Indicates a memory-based stream. */
/* */
/* single_block :: A boolean. Indicates that the private dictionary */
/* is stored in lieu of the base dictionary. */
/* */
/* cursor :: The current parser cursor. */
/* */
/* limit :: The current parser limit (first byte after the */
/* current dictionary). */
/* */
/* error :: The current parsing error. */
/* */
typedef struct Z1_Parser_
{
FT_Stream stream;
FT_Memory memory;
@ -264,41 +283,38 @@
void Z1_Release_Table( Z1_Table* table );
LOCAL_DEF
FT_Long Z1_ToInt ( Z1_Parser* parser );
FT_Long Z1_ToInt( Z1_Parser* parser );
LOCAL_DEF
FT_Long Z1_ToFixed( Z1_Parser* parser, FT_Int power_ten );
FT_Long Z1_ToFixed( Z1_Parser* parser,
FT_Int power_ten );
LOCAL_DEF
FT_Int Z1_ToCoordArray( Z1_Parser* parser,
FT_Int max_coords,
FT_Short* coords );
FT_Int Z1_ToCoordArray( Z1_Parser* parser,
FT_Int max_coords,
FT_Short* coords );
LOCAL_DEF
FT_Int Z1_ToFixedArray( Z1_Parser* parser,
FT_Int max_values,
FT_Fixed* values,
FT_Int power_ten );
FT_Int Z1_ToFixedArray( Z1_Parser* parser,
FT_Int max_values,
FT_Fixed* values,
FT_Int power_ten );
#if 0
LOCAL_DEF
FT_String* Z1_ToString( Z1_Parser* parser );
FT_String* Z1_ToString( Z1_Parser* parser );
LOCAL_DEF
FT_Bool Z1_ToBool( Z1_Parser* parser );
FT_Bool Z1_ToBool( Z1_Parser* parser );
#endif
LOCAL_DEF
void Z1_Skip_Spaces( Z1_Parser* parser );
LOCAL_DEF
void Z1_Skip_Spaces( Z1_Parser* parser );
LOCAL_DEF
void Z1_ToToken( Z1_Parser* parser,
Z1_Token_Rec* token );
void Z1_ToToken( Z1_Parser* parser,
Z1_Token_Rec* token );
LOCAL_FUNC
void Z1_ToTokenArray( Z1_Parser* parser,
@ -345,4 +361,3 @@
/* END */

View File

@ -1,21 +1,20 @@
/*******************************************************************
*
* t1tokens.h
*
* Type 1 tokens definition
*
* Copyright 2000 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.
*
* This file only contains macros that are expanded when compiling
* the "t1load.c" source file.
*
******************************************************************/
/***************************************************************************/
/* */
/* z1tokens.h */
/* */
/* Experimental Type 1 tokenizer (specification). */
/* */
/* Copyright 1996-2000 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. */
/* */
/***************************************************************************/
#undef T1TYPE
#define T1TYPE T1_FontInfo
@ -26,35 +25,38 @@
Z1_FONTINFO_STRING( "FamilyName", family_name )
Z1_FONTINFO_STRING( "Weight", weight )
Z1_FONTINFO_NUM( "ItalicAngle", italic_angle )
Z1_FONTINFO_BOOL( "isFixedPitch", is_fixed_pitch )
Z1_FONTINFO_NUM( "UnderlinePosition", underline_position )
Z1_FONTINFO_NUM( "UnderlineThickness", underline_thickness )
Z1_FONTINFO_NUM ( "ItalicAngle", italic_angle )
Z1_FONTINFO_BOOL ( "isFixedPitch", is_fixed_pitch )
Z1_FONTINFO_NUM ( "UnderlinePosition", underline_position )
Z1_FONTINFO_NUM ( "UnderlineThickness", underline_thickness )
#undef T1TYPE
#define T1TYPE T1_Private
Z1_PRIVATE_NUM ( "UniqueID", unique_id )
Z1_PRIVATE_NUM ( "lenIV", lenIV )
Z1_PRIVATE_NUM ( "LanguageGroup", language_group )
Z1_PRIVATE_NUM ( "password", password )
Z1_PRIVATE_FIXED( "BlueScale", blue_scale )
Z1_PRIVATE_NUM ( "BlueShift", blue_shift )
Z1_PRIVATE_NUM ( "BlueFuzz", blue_fuzz )
Z1_PRIVATE_NUM_TABLE( "BlueValues", blue_values, 14, num_blue_values )
Z1_PRIVATE_NUM_TABLE( "OtherBlues", other_blues, 10, num_other_blues )
Z1_PRIVATE_NUM_TABLE( "FamilyBlues", family_blues, 14, num_family_blues )
Z1_PRIVATE_NUM_TABLE( "FamilyOtherBlues", family_other_blues, 10, num_family_other_blues )
Z1_PRIVATE_NUM ( "UniqueID", unique_id )
Z1_PRIVATE_NUM ( "lenIV", lenIV )
Z1_PRIVATE_NUM ( "LanguageGroup", language_group )
Z1_PRIVATE_NUM ( "password", password )
Z1_PRIVATE_FIXED ( "BlueScale", blue_scale )
Z1_PRIVATE_NUM ( "BlueShift", blue_shift )
Z1_PRIVATE_NUM ( "BlueFuzz", blue_fuzz )
Z1_PRIVATE_NUM_TABLE ( "BlueValues", blue_values, 14, num_blue_values )
Z1_PRIVATE_NUM_TABLE ( "OtherBlues", other_blues, 10, num_other_blues )
Z1_PRIVATE_NUM_TABLE ( "FamilyBlues", family_blues, 14, num_family_blues )
Z1_PRIVATE_NUM_TABLE ( "FamilyOtherBlues", family_other_blues, 10, \
num_family_other_blues )
Z1_PRIVATE_NUM_TABLE2( "StdHW", standard_width, 1 )
Z1_PRIVATE_NUM_TABLE2( "StdVW", standard_height, 1 )
Z1_PRIVATE_NUM_TABLE2( "MinFeature", min_feature, 2 )
Z1_PRIVATE_NUM_TABLE ( "StemSnapH", snap_widths, 12, num_snap_widths )
Z1_PRIVATE_NUM_TABLE ( "StemSnapV", snap_heights, 12, num_snap_heights )
#undef T1TYPE
#define T1TYPE T1_Font
@ -62,64 +64,69 @@
Z1_TOPDICT_NUM( "FontType", font_type )
Z1_TOPDICT_NUM( "StrokeWidth", stroke_width )
#if 0
/* define the font info dictionary parsing callbacks */
#undef FACE
#define FACE (face->type1.font_info)
PARSE_STRING("version",version)
PARSE_STRING("Notice",notice)
PARSE_STRING("FullName",full_name)
PARSE_STRING("FamilyName",family_name)
PARSE_STRING("Weight",weight)
PARSE_STRING( "version", version )
PARSE_STRING( "Notice", notice )
PARSE_STRING( "FullName", full_name )
PARSE_STRING( "FamilyName", family_name )
PARSE_STRING( "Weight", weight )
PARSE_INT("ItalicAngle",italic_angle)
PARSE_BOOL("isFixedPitch",is_fixed_pitch)
PARSE_NUM("UnderlinePosition",underline_position,FT_Short)
PARSE_NUM("UnderlineThickness",underline_thickness,FT_UShort)
PARSE_INT ( "ItalicAngle", italic_angle )
PARSE_BOOL ( "isFixedPitch", is_fixed_pitch )
PARSE_NUM ( "UnderlinePosition", underline_position, FT_Short )
PARSE_NUM ( "UnderlineThickness", underline_thickness, FT_UShort )
/* define the private dict parsing callbacks */
/* define the private dict parsing callbacks */
#undef FACE
#define FACE (face->type1.private_dict)
PARSE_INT("UniqueID",unique_id)
PARSE_INT("lenIV",lenIV)
PARSE_INT ("UniqueID", unique_id )
PARSE_INT ("lenIV", lenIV )
PARSE_COORDS( "BlueValues", num_blues, 14, blue_values)
PARSE_COORDS( "OtherBlues", num_other_blues, 10, other_blues)
PARSE_COORDS ( "BlueValues", num_blues, 14, blue_values)
PARSE_COORDS ( "OtherBlues", num_other_blues, 10, other_blues)
PARSE_COORDS( "FamilyBlues", num_family_blues, 14, family_blues)
PARSE_COORDS( "FamilyOtherBlues", num_family_other_blues, 10, family_other_blues)
PARSE_COORDS ( "FamilyBlues", num_family_blues, 14, family_blues )
PARSE_COORDS ( "FamilyOtherBlues", num_family_other_blues, 10,
family_other_blues )
PARSE_FIXED( "BlueScale", blue_scale)
PARSE_INT( "BlueShift", blue_shift)
PARSE_FIXED ( "BlueScale", blue_scale )
PARSE_INT ( "BlueShift", blue_shift )
PARSE_INT( "BlueFuzz", blue_fuzz)
PARSE_INT ( "BlueFuzz", blue_fuzz )
PARSE_COORDS2( "StdHW", 1, standard_width )
PARSE_COORDS2( "StdVW", 1, standard_height )
PARSE_COORDS2( "StdHW", 1, standard_width )
PARSE_COORDS2( "StdVW", 1, standard_height )
PARSE_COORDS( "StemSnapH", num_snap_widths, 12, stem_snap_widths )
PARSE_COORDS( "StemSnapV", num_snap_heights, 12, stem_snap_heights )
PARSE_COORDS ( "StemSnapH", num_snap_widths, 12, stem_snap_widths )
PARSE_COORDS ( "StemSnapV", num_snap_heights, 12, stem_snap_heights )
PARSE_INT( "LanguageGroup", language_group )
PARSE_INT( "password", password )
PARSE_COORDS2( "MinFeature", 2, min_feature )
PARSE_INT ( "LanguageGroup", language_group )
PARSE_INT ( "password", password )
PARSE_COORDS2( "MinFeature", 2, min_feature )
/* define the top-level dictionary parsing callbacks */
/* define the top-level dictionary parsing callbacks */
#undef FACE
#define FACE (face->type1)
/* PARSE_STRING( "FontName", font_name ) -- handled by special routine */
PARSE_NUM( "PaintType", paint_type, FT_Byte )
PARSE_NUM( "FontType", font_type, FT_Byte )
PARSE_FIXEDS2( "FontMatrix", 4, font_matrix )
/* PARSE_COORDS2( "FontBBox", 4, font_bbox ) -- handled by special func */
PARSE_INT( "StrokeWidth", stroke_width )
/*PARSE_STRING ( "FontName", font_name ) -- handled by special routine */
PARSE_NUM ( "PaintType", paint_type, FT_Byte )
PARSE_NUM ( "FontType", font_type, FT_Byte )
PARSE_FIXEDS2( "FontMatrix", 4, font_matrix )
/*PARSE_COORDS2( "FontBBox", 4, font_bbox ) -- handled by special routine */
PARSE_INT ( "StrokeWidth", stroke_width )
#undef FACE
#endif
#endif /* 0 */
/* END */