[Xorg-commit] xc/extras/freetype2/src/cid cidgload.c,1.1.4.1,1.1.4.2 cidload.c,1.1.4.1,1.1.4.2 cidload.h,1.1.4.1,1.1.4.2 cidobjs.c,1.1.4.1,1.1.4.2 cidparse.c,1.1.4.1,1.1.4.2 cidparse.h,1.1.4.1,1.1.4.2 cidriver.c,1.1.4.1,1.1.4.2 cidtoken.h,1.1,1.1.4.1 rules.mk,1.1,1.1.4.1
Kaleb Keithley
xorg-commit at pdx.freedesktop.org
Wed May 9 17:30:30 EEST 2007
- Previous message: [Xorg-commit] xc/extras/freetype2/src/cff cffcmap.c,1.1,1.1.4.1 cffcmap.h,1.1,1.1.4.1 cffdrivr.c,1.1.4.1,1.1.4.2 cffgload.c,1.1.4.1,1.1.4.2 cffgload.h,1.1.4.1,1.1.4.2 cffload.c,1.1.4.1,1.1.4.2 cffload.h,1.1.4.1,1.1.4.2 cffobjs.c,1.1.4.1,1.1.4.2 cffobjs.h,1.1.4.1,1.1.4.2 cffparse.c,1.1.4.1,1.1.4.2 cffparse.h,1.1.4.1,1.1.4.2 cfftoken.h,1.1,1.1.4.1 rules.mk,1.1.4.1,1.1.4.2
- Next message: [Xorg-commit] xc/extras/freetype2/src/gzip ftgzip.c,1.1,1.1.4.1 infblock.c,1.1,1.1.4.1 inffixed.h,1.1,1.1.4.1 inftrees.c,1.1,1.1.4.1 inftrees.h,1.1,1.1.4.1 infutil.c,1.1,1.1.4.1 infutil.h,1.1,1.1.4.1 rules.mk,1.1,1.1.4.1 zutil.h,1.1,1.1.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: kaleb
Update of /cvs/xorg/xc/extras/freetype2/src/cid
In directory pdx:/home/kaleb/xorg/xc.XORG-CURRENT/extras/freetype2/src/cid
Modified Files:
Tag: XORG-CURRENT
cidgload.c cidload.c cidload.h cidobjs.c cidparse.c cidparse.h
cidriver.c cidtoken.h rules.mk
Log Message:
merge most of XFree86 RC3 (4.3.99.903) from vendor branch.
bug #214
Index: cidgload.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/cid/cidgload.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/cidgload.c 26 Nov 2003 22:48:26 -0000 1.1.4.1
+++ b/cidgload.c 23 Feb 2004 21:32:46 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 Glyph Loader (body). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -40,15 +40,16 @@
cid_load_glyph( T1_Decoder decoder,
FT_UInt glyph_index )
{
- CID_Face face = (CID_Face)decoder->builder.face;
- CID_FaceInfo cid = &face->cid;
- FT_Byte* p;
- FT_UInt fd_select;
- FT_Stream stream = face->root.stream;
- FT_Error error = 0;
- FT_Byte* charstring = 0;
- FT_Memory memory = face->root.memory;
- FT_UInt glyph_length = 0;
+ CID_Face face = (CID_Face)decoder->builder.face;
+ CID_FaceInfo cid = &face->cid;
+ FT_Byte* p;
+ FT_UInt fd_select;
+ FT_Stream stream = face->root.stream;
+ FT_Error error = 0;
+ FT_Byte* charstring = 0;
+ FT_Memory memory = face->root.memory;
+ FT_ULong glyph_length = 0;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
#ifdef FT_CONFIG_OPTION_INCREMENTAL
@@ -107,8 +108,7 @@
fd_select = (FT_UInt) cid_get_offset( &p, (FT_Byte)cid->fd_bytes );
off1 = (FT_ULong)cid_get_offset( &p, (FT_Byte)cid->gd_bytes );
p += cid->fd_bytes;
- glyph_length = (FT_UInt) cid_get_offset(
- &p, (FT_Byte)cid->gd_bytes ) - off1;
+ glyph_length = cid_get_offset( &p, (FT_Byte)cid->gd_bytes ) - off1;
FT_FRAME_EXIT();
if ( glyph_length == 0 )
@@ -146,11 +146,11 @@
/* Decrypt only if lenIV >= 0. */
if ( decoder->lenIV >= 0 )
- cid_decrypt( charstring, glyph_length, 4330 );
+ psaux->t1_decrypt( charstring, glyph_length, 4330 );
- error = decoder->funcs.parse_charstrings( decoder,
- charstring + cs_offset,
- glyph_length - cs_offset );
+ error = decoder->funcs.parse_charstrings(
+ decoder, charstring + cs_offset,
+ (FT_Int)glyph_length - cs_offset );
}
FT_FREE( charstring );
@@ -158,15 +158,16 @@
#ifdef FT_CONFIG_OPTION_INCREMENTAL
/* Incremental fonts can optionally override the metrics. */
- if ( !error &&
- face->root.internal->incremental_interface &&
+ if ( !error &&
+ face->root.internal->incremental_interface &&
face->root.internal->incremental_interface->funcs->get_glyph_metrics )
{
FT_Incremental_MetricsRec metrics;
+
metrics.bearing_x = decoder->builder.left_bearing.x;
- metrics.bearing_y = decoder->builder.left_bearing.y;
- metrics.advance = decoder->builder.advance.x;
+ metrics.bearing_y = decoder->builder.left_bearing.y;
+ metrics.advance = decoder->builder.advance.x;
error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
face->root.internal->incremental_interface->object,
glyph_index, FALSE, &metrics );
@@ -347,6 +348,7 @@
{
FT_BBox cbox;
FT_Glyph_Metrics* metrics = &glyph->root.metrics;
+ FT_Vector advance;
/* copy the _unscaled_ advance width */
@@ -372,6 +374,15 @@
font_offset.x,
font_offset.y );
+ advance.x = metrics->horiAdvance;
+ advance.y = 0;
+ FT_Vector_Transform( &advance, &font_matrix );
+ metrics->horiAdvance = advance.x + font_offset.x;
+ advance.x = 0;
+ advance.y = metrics->vertAdvance;
+ FT_Vector_Transform( &advance, &font_matrix );
+ metrics->vertAdvance = advance.y + font_offset.y;
+
if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 )
{
/* scale the outline and the metrics */
Index: cidload.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/cid/cidload.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/cidload.c 26 Nov 2003 22:48:26 -0000 1.1.4.1
+++ b/cidload.c 23 Feb 2004 21:32:46 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 font loader (body). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -39,7 +39,7 @@
/* read a single offset */
FT_LOCAL_DEF( FT_Long )
- cid_get_offset( FT_Byte** start,
+ cid_get_offset( FT_Byte* *start,
FT_Byte offsize )
{
FT_Long result;
@@ -57,24 +57,6 @@
}
- FT_LOCAL_DEF( void )
- cid_decrypt( FT_Byte* buffer,
- FT_Offset length,
- FT_UShort seed )
- {
- while ( length > 0 )
- {
- FT_Byte plain;
-
-
- plain = (FT_Byte)( *buffer ^ ( seed >> 8 ) );
- seed = (FT_UShort)( ( *buffer + seed ) * 52845U + 22719 );
- *buffer++ = plain;
- length--;
- }
- }
-
-
/*************************************************************************/
/*************************************************************************/
/***** *****/
@@ -115,6 +97,10 @@
object = (FT_Byte*)&cid->font_info;
break;
+ case T1_FIELD_LOCATION_BBOX:
+ object = (FT_Byte*)&cid->font_bbox;
+ break;
+
default:
{
CID_FaceDict dict;
@@ -147,34 +133,16 @@
if ( keyword->type == T1_FIELD_TYPE_INTEGER_ARRAY ||
keyword->type == T1_FIELD_TYPE_FIXED_ARRAY )
error = cid_parser_load_field_table( &loader->parser, keyword,
- &dummy_object );
+ &dummy_object );
else
- error = cid_parser_load_field( &loader->parser, keyword, &dummy_object );
+ error = cid_parser_load_field( &loader->parser,
+ keyword, &dummy_object );
Exit:
return error;
}
FT_CALLBACK_DEF( FT_Error )
- parse_font_bbox( CID_Face face,
- CID_Parser* parser )
- {
- FT_Fixed temp[4];
- FT_BBox* bbox = &face->cid.font_bbox;
-
-
- (void)cid_parser_to_fixed_array( parser, 4, temp, 0 );
- bbox->xMin = FT_RoundFix( temp[0] );
- bbox->yMin = FT_RoundFix( temp[1] );
- bbox->xMax = FT_RoundFix( temp[2] );
- bbox->yMax = FT_RoundFix( temp[3] );
-
- return CID_Err_Ok; /* this is a callback function; */
- /* we must return an error code */
- }
-
-
- FT_CALLBACK_DEF( FT_Error )
parse_font_matrix( CID_Face face,
CID_Parser* parser )
{
@@ -196,9 +164,9 @@
temp_scale = ABS( temp[3] );
- /* Set Units per EM based on FontMatrix values. We set the value to */
+ /* Set units per EM based on FontMatrix values. We set the value to */
/* `1000/temp_scale', because temp_scale was already multiplied by */
- /* 1000 (in t1_tofixed(), from psobjs.c). */
+ /* 1000 (in `t1_tofixed', from psobjs.c). */
root->units_per_EM = (FT_UShort)( FT_DivFix( 0x10000L,
FT_DivFix( temp_scale, 1000 ) ) );
@@ -223,7 +191,7 @@
offset->y = temp[5] >> 16;
}
- return CID_Err_Ok; /* this is a callback function; */
+ return CID_Err_Ok; /* this is a callback function; */
/* we must return an error code */
}
@@ -272,22 +240,13 @@
#include "cidtoken.h"
- T1_FIELD_CALLBACK( "FontBBox", parse_font_bbox )
- T1_FIELD_CALLBACK( "FDArray", parse_fd_array )
+ T1_FIELD_CALLBACK( "FDArray", parse_fd_array )
T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix )
+
{ 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0 }
};
- static int
- is_alpha( char c )
- {
- return ( ft_isalnum( (int)c ) ||
- c == '.' ||
- c == '_' );
- }
-
-
static FT_Error
cid_parse_dict( CID_Face face,
CID_Loader* loader,
@@ -299,44 +258,61 @@
parser->root.cursor = base;
parser->root.limit = base + size;
- parser->root.error = 0;
+ parser->root.error = CID_Err_Ok;
{
FT_Byte* cur = base;
FT_Byte* limit = cur + size;
- for ( ;cur < limit; cur++ )
+ for (;;)
{
+ FT_Byte* newlimit;
+
+
+ parser->root.cursor = cur;
+ cid_parser_skip_spaces( parser );
+
+ if ( parser->root.cursor >= limit )
+ newlimit = limit - 1 - 17;
+ else
+ newlimit = parser->root.cursor - 17;
+
/* look for `%ADOBeginFontDict' */
- if ( *cur == '%' && cur + 20 < limit &&
- ft_strncmp( (char*)cur, "%ADOBeginFontDict", 17 ) == 0 )
+ for ( ; cur < newlimit; cur++ )
{
- cur += 17;
-
- /* if /FDArray was found, then cid->num_dicts is > 0, and */
- /* we can start increasing parser->num_dict */
- if ( face->cid.num_dicts > 0 )
- parser->num_dict++;
+ if ( *cur == '%' &&
+ ft_strncmp( (char*)cur, "%ADOBeginFontDict", 17 ) == 0 )
+ {
+ /* if /FDArray was found, then cid->num_dicts is > 0, and */
+ /* we can start increasing parser->num_dict */
+ if ( face->cid.num_dicts > 0 )
+ parser->num_dict++;
+ }
}
+
+ cur = parser->root.cursor;
+ /* no error can occur in cid_parser_skip_spaces */
+ if ( cur >= limit )
+ break;
+
+ cid_parser_skip_PS_token( parser );
+ if ( parser->root.cursor >= limit || parser->root.error )
+ break;
+
/* look for immediates */
- else if ( *cur == '/' && cur + 2 < limit )
+ if ( *cur == '/' && cur + 2 < limit )
{
- FT_Byte* cur2;
- FT_Int len;
+ FT_PtrDist len;
cur++;
+ len = parser->root.cursor - cur;
- cur2 = cur;
- while ( cur2 < limit && is_alpha( *cur2 ) )
- cur2++;
-
- len = (FT_Int)( cur2 - cur );
if ( len > 0 && len < 22 )
{
/* now compare the immediate name to the keyword table */
- T1_Field keyword = (T1_Field) cid_field_records;
+ T1_Field keyword = (T1_Field)cid_field_records;
for (;;)
@@ -348,10 +324,10 @@
if ( !name )
break;
- if ( cur[0] == name[0] &&
- len == (FT_Int)ft_strlen( (const char*)name ) )
+ if ( cur[0] == name[0] &&
+ len == ft_strlen( (const char*)name ) )
{
- FT_Int n;
+ FT_PtrDist n;
for ( n = 1; n < len; n++ )
@@ -361,15 +337,11 @@
if ( n >= len )
{
/* we found it - run the parsing callback */
- parser->root.cursor = cur2;
- cid_parser_skip_spaces( parser );
parser->root.error = cid_load_keyword( face,
loader,
keyword );
if ( parser->root.error )
return parser->root.error;
-
- cur = parser->root.cursor;
break;
}
}
@@ -377,6 +349,8 @@
}
}
}
+
+ cur = parser->root.cursor;
}
}
return parser->root.error;
@@ -387,14 +361,15 @@
static FT_Error
cid_read_subrs( CID_Face face )
{
- CID_FaceInfo cid = &face->cid;
- FT_Memory memory = face->root.memory;
- FT_Stream stream = face->root.stream;
- FT_Error error;
- FT_Int n;
- CID_Subrs subr;
- FT_UInt max_offsets = 0;
- FT_ULong* offsets = 0;
+ CID_FaceInfo cid = &face->cid;
+ FT_Memory memory = face->root.memory;
+ FT_Stream stream = face->root.stream;
+ FT_Error error;
+ FT_Int n;
+ CID_Subrs subr;
+ FT_UInt max_offsets = 0;
+ FT_ULong* offsets = 0;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
if ( FT_NEW_ARRAY( face->subrs, cid->num_dicts ) )
@@ -464,7 +439,7 @@
len = offsets[count + 1] - offsets[count];
- cid_decrypt( subr->code[count], len, 4330 );
+ psaux->t1_decrypt( subr->code[count], len, 4330 );
}
}
Index: cidload.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/cid/cidload.h,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/cidload.h 26 Nov 2003 22:48:26 -0000 1.1.4.1
+++ b/cidload.h 23 Feb 2004 21:32:46 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 font loader (specification). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -40,11 +40,6 @@
cid_get_offset( FT_Byte** start,
FT_Byte offsize );
- FT_LOCAL( void )
- cid_decrypt( FT_Byte* buffer,
- FT_Offset length,
- FT_UShort seed );
-
FT_LOCAL( FT_Error )
cid_face_open( CID_Face face );
Index: cidobjs.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/cid/cidobjs.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/cidobjs.c 26 Nov 2003 22:48:26 -0000 1.1.4.1
+++ b/cidobjs.c 23 Feb 2004 21:32:46 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* CID objects manager (body). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -19,9 +19,11 @@
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
+
#include "cidgload.h"
#include "cidload.h"
-#include FT_INTERNAL_POSTSCRIPT_NAMES_H
+
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
@@ -197,12 +199,12 @@
if ( face->subrs )
{
FT_Int n;
-
+
for ( n = 0; n < cid->num_dicts; n++ )
{
CID_Subrs subr = face->subrs + n;
-
+
if ( subr->code )
{
@@ -266,10 +268,10 @@
FT_Int num_params,
FT_Parameter* params )
{
- FT_Error error;
- PSNames_Service psnames;
- PSAux_Service psaux;
- PSHinter_Service pshinter;
+ FT_Error error;
+ FT_Service_PsCMaps psnames;
+ PSAux_Service psaux;
+ PSHinter_Service pshinter;
FT_UNUSED( num_params );
FT_UNUSED( params );
@@ -279,14 +281,7 @@
face->root.num_faces = 1;
- psnames = (PSNames_Service)face->psnames;
- if ( !psnames )
- {
- psnames = (PSNames_Service)FT_Get_Module_Interface(
- FT_FACE_LIBRARY( face ), "psnames" );
-
- face->psnames = psnames;
- }
+ FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
psaux = (PSAux_Service)face->psaux;
if ( !psaux )
@@ -326,77 +321,108 @@
goto Exit;
}
- /* Now, load the font program into the face object */
+ /* now load the font program into the face object */
+
+ /* initialize the face object fields */
+
+ /* set up root face fields */
{
- /* Init the face object fields */
- /* Now set up root face fields */
- {
- FT_Face root = (FT_Face)&face->root;
+ FT_Face root = (FT_Face)&face->root;
+ CID_FaceInfo cid = &face->cid;
+ PS_FontInfo info = &cid->font_info;
- root->num_glyphs = face->cid.cid_count;
- root->num_charmaps = 0;
+ root->num_glyphs = cid->cid_count;
+ root->num_charmaps = 0;
- root->face_index = face_index;
- root->face_flags = FT_FACE_FLAG_SCALABLE;
+ root->face_index = face_index;
+ root->face_flags = FT_FACE_FLAG_SCALABLE;
- root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
+ root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
- if ( face->cid.font_info.is_fixed_pitch )
- root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
+ if ( info->is_fixed_pitch )
+ root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
- /* XXX: TODO: add kerning with .afm support */
+ /* 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->cid.font_info.family_name;
- if ( root->family_name )
- {
- char* full = face->cid.font_info.full_name;
- char* family = root->family_name;
+ /* get style name -- be careful, some broken fonts only */
+ /* have a /FontName dictionary entry! */
+ root->family_name = info->family_name;
+ /* assume "Regular" style if we don't know better */
+ root->style_name = (char *)"Regular";
+ if ( root->family_name )
+ {
+ char* full = info->full_name;
+ char* family = root->family_name;
- while ( *family && *full == *family )
- {
- family++;
- full++;
- }
- root->style_name = ( *full == ' ' ) ? full + 1
- : (char *)"Regular";
- }
- else
+ if ( full )
{
- /* do we have a `/FontName'? */
- if ( face->cid.cid_font_name )
+ while ( *full )
{
- root->family_name = face->cid.cid_font_name;
- root->style_name = (char *)"Regular";
+ if ( *full == *family )
+ {
+ family++;
+ full++;
+ }
+ else
+ {
+ if ( *full == ' ' || *full == '-' )
+ full++;
+ else if ( *family == ' ' || *family == '-' )
+ family++;
+ else
+ {
+ if ( !*family )
+ root->style_name = full;
+ break;
+ }
+ }
}
}
+ }
+ else
+ {
+ /* do we have a `/FontName'? */
+ if ( cid->cid_font_name )
+ root->family_name = cid->cid_font_name;
+ }
- /* no embedded bitmap support */
- root->num_fixed_sizes = 0;
- root->available_sizes = 0;
+ /* compute style flags */
+ root->style_flags = 0;
+ if ( info->italic_angle )
+ root->style_flags |= FT_STYLE_FLAG_ITALIC;
+ if ( info->weight )
+ {
+ if ( !ft_strcmp( info->weight, "Bold" ) ||
+ !ft_strcmp( info->weight, "Black" ) )
+ root->style_flags |= FT_STYLE_FLAG_BOLD;
+ }
- root->bbox.xMin = face->cid.font_bbox.xMin >> 16;
- root->bbox.yMin = face->cid.font_bbox.yMin >> 16;
- root->bbox.xMax = ( face->cid.font_bbox.xMax + 0xFFFFU ) >> 16;
- root->bbox.yMax = ( face->cid.font_bbox.yMax + 0xFFFFU ) >> 16;
+ /* no embedded bitmap support */
+ root->num_fixed_sizes = 0;
+ root->available_sizes = 0;
- if ( !root->units_per_EM )
- root->units_per_EM = 1000;
+ root->bbox.xMin = cid->font_bbox.xMin >> 16;
+ root->bbox.yMin = cid->font_bbox.yMin >> 16;
+ root->bbox.xMax = ( cid->font_bbox.xMax + 0xFFFFU ) >> 16;
+ root->bbox.yMax = ( cid->font_bbox.yMax + 0xFFFFU ) >> 16;
- root->ascender = (FT_Short)( root->bbox.yMax );
- root->descender = (FT_Short)( root->bbox.yMin );
- root->height = (FT_Short)(
- ( ( root->ascender + root->descender ) * 12 ) / 10 );
+ if ( !root->units_per_EM )
+ root->units_per_EM = 1000;
- root->underline_position = face->cid.font_info.underline_position;
- root->underline_thickness = face->cid.font_info.underline_thickness;
+ root->ascender = (FT_Short)( root->bbox.yMax );
+ root->descender = (FT_Short)( root->bbox.yMin );
+ root->height = (FT_Short)(
+ ( ( root->ascender - root->descender ) * 12 ) / 10 );
- root->internal->max_points = 0;
- root->internal->max_contours = 0;
- }
+ root->underline_position =
+ (FT_Short)( info->underline_position >> 16 );
+ root->underline_thickness =
+ (FT_Short)( info->underline_thickness >> 16 );
+
+ root->internal->max_points = 0;
+ root->internal->max_contours = 0;
}
Exit:
Index: cidparse.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/cid/cidparse.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/cidparse.c 26 Nov 2003 22:48:26 -0000 1.1.4.1
+++ b/cidparse.c 23 Feb 2004 21:32:46 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 parser (body). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -58,6 +58,7 @@
FT_ULong base_offset, offset, ps_len;
FT_Byte buffer[256 + 10];
FT_Int buff_len;
+ FT_Byte *cur, *limit;
FT_MEM_ZERO( parser, sizeof ( *parser ) );
@@ -67,7 +68,7 @@
base_offset = FT_STREAM_POS();
- /* first of all, check the font format in the header */
+ /* first of all, check the font format in the header */
if ( FT_FRAME_ENTER( 31 ) )
goto Exit;
@@ -82,15 +83,17 @@
if ( error )
goto Exit;
- /* now, read the rest of the file, until we find a `StartData' */
+ Again:
+ /* now, read the rest of the file until we find a `StartData' */
buff_len = 256;
for (;;)
{
- FT_Byte *p, *limit = buffer + 256;
+ FT_Byte* p;
FT_ULong top_position;
/* fill input buffer */
+ limit = buffer + 256;
buff_len -= 256;
if ( buff_len > 0 )
FT_MEM_MOVE( buffer, limit, buff_len );
@@ -101,7 +104,7 @@
goto Exit;
top_position = FT_STREAM_POS() - buff_len;
- buff_len = 256 + 10;
+ buff_len = 256 + 10;
/* look for `StartData' */
for ( p = buffer; p < limit; p++ )
@@ -116,12 +119,12 @@
}
Found:
- /* we have found the start of the binary data. We will now */
- /* rewind and extract the frame of corresponding to the Postscript */
- /* section */
+ /* we have found the start of the binary data. We will now */
+ /* rewind and extract the frame corresponding to the PostScript */
+ /* section */
ps_len = offset - base_offset;
- if ( FT_STREAM_SEEK( base_offset ) ||
+ if ( FT_STREAM_SEEK( base_offset ) ||
FT_FRAME_EXTRACT( ps_len, parser->postscript ) )
goto Exit;
@@ -132,6 +135,32 @@
parser->root.limit = parser->root.cursor + ps_len;
parser->num_dict = -1;
+ /* finally we check whether `StartData' was real -- it could be */
+ /* in a comment or string */
+
+ limit = parser->root.limit;
+ cur = parser->root.cursor;
+
+ while ( cur < limit )
+ {
+ if ( *cur == 'S' && ft_strncmp( (char*)cur, "StartData", 9 ) == 0 )
+ {
+ limit = parser->root.limit;
+ cur = parser->root.cursor;
+ goto Exit;
+ }
+
+ cid_parser_skip_PS_token( parser );
+ cid_parser_skip_spaces ( parser );
+ cur = parser->root.cursor;
+ }
+
+ /* we haven't found the correct `StartData'; go back and continue */
+ /* searching */
+ FT_FRAME_RELEASE( parser->postscript );
+ if ( !FT_STREAM_SEEK( offset ) )
+ goto Again;
+
Exit:
return error;
}
Index: cidparse.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/cid/cidparse.h,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/cidparse.h 26 Nov 2003 22:48:26 -0000 1.1.4.1
+++ b/cidparse.h 23 Feb 2004 21:32:46 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 parser (specification). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -87,8 +87,10 @@
/* */
/*************************************************************************/
-#define cid_parser_skip_spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root )
-#define cid_parser_skip_alpha( p ) (p)->root.funcs.skip_alpha ( &(p)->root )
+#define cid_parser_skip_spaces( p ) \
+ (p)->root.funcs.skip_spaces( &(p)->root )
+#define cid_parser_skip_PS_token( p ) \
+ (p)->root.funcs.skip_PS_token( &(p)->root )
#define cid_parser_to_int( p ) (p)->root.funcs.to_int( &(p)->root )
#define cid_parser_to_fixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t )
Index: cidriver.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/cid/cidriver.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/cidriver.c 26 Nov 2003 22:48:26 -0000 1.1.4.1
+++ b/cidriver.c 23 Feb 2004 21:32:46 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* CID driver interface (body). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,10 +21,12 @@
#include "cidgload.h"
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
-#include FT_INTERNAL_POSTSCRIPT_NAMES_H
#include "ciderrs.h"
+#include FT_SERVICE_POSTSCRIPT_NAME_H
+#include FT_SERVICE_XFREE86_NAME_H
+#include FT_SERVICE_POSTSCRIPT_INFO_H
/*************************************************************************/
/* */
@@ -36,6 +38,11 @@
#define FT_COMPONENT trace_ciddriver
+ /*
+ * POSTSCRIPT NAME SERVICE
+ *
+ */
+
static const char*
cid_get_postscript_name( CID_Face face )
{
@@ -49,6 +56,47 @@
}
+ static const FT_Service_PsFontNameRec cid_service_ps_name =
+ {
+ (FT_PsName_GetFunc) cid_get_postscript_name
+ };
+
+
+ /*
+ * POSTSCRIPT INFO SERVICE
+ *
+ */
+
+ static FT_Error
+ cid_ps_get_font_info( FT_Face face,
+ PS_FontInfoRec* afont_info )
+ {
+ *afont_info = ((CID_Face)face)->cid.font_info;
+ return 0;
+ }
+
+
+ static const FT_Service_PsInfoRec cid_service_ps_info =
+ {
+ (PS_GetFontInfoFunc) cid_ps_get_font_info,
+ (PS_HasGlyphNamesFunc)NULL /* unsupported with CID fonts */
+ };
+
+
+ /*
+ * SERVICE LIST
+ *
+ */
+
+ static const FT_ServiceDescRec cid_services[] =
+ {
+ { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cid_service_ps_name },
+ { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_CID },
+ { FT_SERVICE_ID_POSTSCRIPT_INFO, &cid_service_ps_info },
+ { NULL, NULL }
+ };
+
+
static FT_Module_Interface
cid_get_interface( FT_Driver driver,
const FT_String* cid_interface )
@@ -56,10 +104,7 @@
FT_UNUSED( driver );
FT_UNUSED( cid_interface );
- if ( ft_strcmp( (const char*)cid_interface, "postscript_name" ) == 0 )
- return (FT_Module_Interface)cid_get_postscript_name;
-
- return 0;
+ return ft_service_list_lookup( cid_services, cid_interface );
}
@@ -69,9 +114,9 @@
{
/* first of all, the FT_Module_Class fields */
{
- ft_module_font_driver |
- ft_module_driver_scalable |
- ft_module_driver_has_hinter ,
+ FT_MODULE_FONT_DRIVER |
+ FT_MODULE_DRIVER_SCALABLE |
+ FT_MODULE_DRIVER_HAS_HINTER,
sizeof( FT_DriverRec ),
"t1cid", /* module name */
Index: cidtoken.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/cid/cidtoken.h,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/cidtoken.h 14 Nov 2003 16:48:24 -0000 1.1
+++ b/cidtoken.h 23 Feb 2004 21:32:46 -0000 1.1.4.1
@@ -4,7 +4,7 @@
/* */
/* CID token definitions (specification only). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,7 +21,7 @@
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_CID_INFO
- T1_FIELD_STRING( "CIDFontName", cid_font_name )
+ T1_FIELD_KEY ( "CIDFontName", cid_font_name )
T1_FIELD_NUM ( "CIDFontVersion", cid_version )
T1_FIELD_NUM ( "CIDFontType", cid_font_type )
T1_FIELD_STRING( "Registry", registry )
@@ -39,15 +39,15 @@
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_INFO
- T1_FIELD_STRING ( "version", version )
- T1_FIELD_STRING ( "Notice", notice )
- T1_FIELD_STRING ( "FullName", full_name )
- T1_FIELD_STRING ( "FamilyName", family_name )
- T1_FIELD_STRING ( "Weight", weight )
- T1_FIELD_FIXED ( "ItalicAngle", italic_angle )
- T1_FIELD_TYPE_BOOL( "isFixedPitch", is_fixed_pitch )
- T1_FIELD_NUM ( "UnderlinePosition", underline_position )
- T1_FIELD_NUM ( "UnderlineThickness", underline_thickness )
+ T1_FIELD_STRING( "version", version )
+ T1_FIELD_STRING( "Notice", notice )
+ T1_FIELD_STRING( "FullName", full_name )
+ T1_FIELD_STRING( "FamilyName", family_name )
+ T1_FIELD_STRING( "Weight", weight )
+ T1_FIELD_NUM ( "ItalicAngle", italic_angle )
+ T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch )
+ T1_FIELD_NUM ( "UnderlinePosition", underline_position )
+ T1_FIELD_NUM ( "UnderlineThickness", underline_thickness )
#undef FT_STRUCTURE
@@ -63,7 +63,7 @@
T1_FIELD_NUM ( "lenBuildCharArray", len_buildchar )
T1_FIELD_FIXED( "ForceBoldThreshold", forcebold_threshold )
T1_FIELD_FIXED( "ExpansionFactor", expansion_factor )
- T1_FIELD_NUM ( "StrokeWidth", stroke_width )
+ T1_FIELD_FIXED( "StrokeWidth", stroke_width )
#undef FT_STRUCTURE
@@ -76,7 +76,7 @@
T1_FIELD_NUM ( "LanguageGroup", language_group )
T1_FIELD_NUM ( "password", password )
- T1_FIELD_FIXED ( "BlueScale", blue_scale )
+ T1_FIELD_FIXED_1000( "BlueScale", blue_scale )
T1_FIELD_NUM ( "BlueShift", blue_shift )
T1_FIELD_NUM ( "BlueFuzz", blue_fuzz )
@@ -92,5 +92,12 @@
T1_FIELD_NUM_TABLE ( "StemSnapH", snap_widths, 12 )
T1_FIELD_NUM_TABLE ( "StemSnapV", snap_heights, 12 )
+#undef FT_STRUCTURE
+#define FT_STRUCTURE FT_BBox
+#undef T1CODE
+#define T1CODE T1_FIELD_LOCATION_BBOX
+
+ T1_FIELD_BBOX( "FontBBox", xMin )
+
/* END */
Index: rules.mk
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/cid/rules.mk,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/rules.mk 14 Nov 2003 16:48:24 -0000 1.1
+++ b/rules.mk 23 Feb 2004 21:32:46 -0000 1.1.4.1
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2001 by
+# Copyright 1996-2000, 2001, 2003 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -15,26 +15,25 @@
# CID driver directory
#
-CID_DIR := $(SRC_)cid
-CID_DIR_ := $(CID_DIR)$(SEP)
+CID_DIR := $(SRC_DIR)/cid
-CID_COMPILE := $(FT_COMPILE) $I$(CID_DIR)
+CID_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CID_DIR))
# CID driver sources (i.e., C files)
#
-CID_DRV_SRC := $(CID_DIR_)cidparse.c \
- $(CID_DIR_)cidload.c \
- $(CID_DIR_)cidriver.c \
- $(CID_DIR_)cidgload.c \
- $(CID_DIR_)cidobjs.c
+CID_DRV_SRC := $(CID_DIR)/cidparse.c \
+ $(CID_DIR)/cidload.c \
+ $(CID_DIR)/cidriver.c \
+ $(CID_DIR)/cidgload.c \
+ $(CID_DIR)/cidobjs.c
# CID driver headers
#
CID_DRV_H := $(CID_DRV_SRC:%.c=%.h) \
- $(CID_DIR_)cidtoken.h \
- $(CID_DIR_)ciderrs.h
+ $(CID_DIR)/cidtoken.h \
+ $(CID_DIR)/ciderrs.h
# CID driver object(s)
@@ -42,24 +41,24 @@
# CID_DRV_OBJ_M is used during `multi' builds
# CID_DRV_OBJ_S is used during `single' builds
#
-CID_DRV_OBJ_M := $(CID_DRV_SRC:$(CID_DIR_)%.c=$(OBJ_)%.$O)
-CID_DRV_OBJ_S := $(OBJ_)type1cid.$O
+CID_DRV_OBJ_M := $(CID_DRV_SRC:$(CID_DIR)/%.c=$(OBJ_DIR)/%.$O)
+CID_DRV_OBJ_S := $(OBJ_DIR)/type1cid.$O
# CID driver source file for single build
#
-CID_DRV_SRC_S := $(CID_DIR_)type1cid.c
+CID_DRV_SRC_S := $(CID_DIR)/type1cid.c
# CID driver - single object
#
$(CID_DRV_OBJ_S): $(CID_DRV_SRC_S) $(CID_DRV_SRC) $(FREETYPE_H) $(CID_DRV_H)
- $(CID_COMPILE) $T$@ $(CID_DRV_SRC_S)
+ $(CID_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(CID_DRV_SRC_S))
# CID driver - multiple objects
#
-$(OBJ_)%.$O: $(CID_DIR_)%.c $(FREETYPE_H) $(CID_DRV_H)
- $(CID_COMPILE) $T$@ $<
+$(OBJ_DIR)/%.$O: $(CID_DIR)/%.c $(FREETYPE_H) $(CID_DRV_H)
+ $(CID_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
# update main driver object lists
@@ -67,4 +66,5 @@
DRV_OBJS_S += $(CID_DRV_OBJ_S)
DRV_OBJS_M += $(CID_DRV_OBJ_M)
+
# EOF
- Previous message: [Xorg-commit] xc/extras/freetype2/src/cff cffcmap.c,1.1,1.1.4.1 cffcmap.h,1.1,1.1.4.1 cffdrivr.c,1.1.4.1,1.1.4.2 cffgload.c,1.1.4.1,1.1.4.2 cffgload.h,1.1.4.1,1.1.4.2 cffload.c,1.1.4.1,1.1.4.2 cffload.h,1.1.4.1,1.1.4.2 cffobjs.c,1.1.4.1,1.1.4.2 cffobjs.h,1.1.4.1,1.1.4.2 cffparse.c,1.1.4.1,1.1.4.2 cffparse.h,1.1.4.1,1.1.4.2 cfftoken.h,1.1,1.1.4.1 rules.mk,1.1.4.1,1.1.4.2
- Next message: [Xorg-commit] xc/extras/freetype2/src/gzip ftgzip.c,1.1,1.1.4.1 infblock.c,1.1,1.1.4.1 inffixed.h,1.1,1.1.4.1 inftrees.c,1.1,1.1.4.1 inftrees.h,1.1,1.1.4.1 infutil.c,1.1,1.1.4.1 infutil.h,1.1,1.1.4.1 rules.mk,1.1,1.1.4.1 zutil.h,1.1,1.1.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the xorg-commit
mailing list