[xorg-commit-diffs] xc/extras/freetype2/src/type1 rules.mk, 1.1,
1.1.4.1 t1afm.c, 1.1.4.1, 1.1.4.2 t1driver.c, 1.1.4.1,
1.1.4.2 t1gload.c, 1.1.4.2, 1.1.4.3 t1gload.h, 1.1.4.1,
1.1.4.2 t1load.c, 1.1.4.1, 1.1.4.2 t1objs.c, 1.1.4.2,
1.1.4.3 t1parse.c, 1.1.4.1, 1.1.4.2 t1parse.h, 1.1.4.1,
1.1.4.2 t1tokens.h, 1.1.4.1, 1.1.4.2 descrip.mms, 1.1, NONE
Egbert Eich
xorg-commit at pdx.freedesktop.org
Thu Apr 15 03:14:48 PDT 2004
- Previous message: [xorg-commit-diffs] xc/extras/freetype2/src/truetype rules.mk, 1.1,
1.1.4.1 ttdriver.c, 1.1.4.1, 1.1.4.2 ttgload.c, 1.1.4.1,
1.1.4.2 ttgload.h, 1.1.4.1, 1.1.4.2 ttinterp.c, 1.1.4.1,
1.1.4.2 ttobjs.c, 1.1.4.1, 1.1.4.2 ttobjs.h, 1.1.4.1, 1.1.4.2
- Next message: [xorg-commit-diffs]
xc/extras/freetype2/src/type42 t42types.h, NONE,
1.1.6.1 rules.mk, 1.1, 1.1.4.1 t42drivr.c, 1.1.4.1,
1.1.4.2 t42error.h, 1.1, 1.1.4.1 t42objs.c, 1.1.4.1,
1.1.4.2 t42objs.h, 1.1.4.1, 1.1.4.2 t42parse.c, 1.1.4.1,
1.1.4.2 t42parse.h, 1.1, 1.1.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: eich
Update of /cvs/xorg/xc/extras/freetype2/src/type1
In directory pdx:/home/eich/tstbuild/xc/extras/freetype2/src/type1
Modified Files:
Tag: XORG-CURRENT
rules.mk t1afm.c t1driver.c t1gload.c t1gload.h t1load.c
t1objs.c t1parse.c t1parse.h t1tokens.h
Removed Files:
Tag: XORG-CURRENT
descrip.mms
Log Message:
2004-04-15 Egbert Eich <eich at freedesktop.org>
Merged changes from RELEASE-1 branch
Index: rules.mk
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/type1/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 15 Apr 2004 10:14:44 -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,29 +15,28 @@
# Type1 driver directory
#
-T1_DIR := $(SRC_)type1
-T1_DIR_ := $(T1_DIR)$(SEP)
+T1_DIR := $(SRC_DIR)/type1
# compilation flags for the driver
#
-T1_COMPILE := $(FT_COMPILE) $I$(T1_DIR)
+T1_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(T1_DIR))
# Type1 driver sources (i.e., C files)
#
-T1_DRV_SRC := $(T1_DIR_)t1parse.c \
- $(T1_DIR_)t1load.c \
- $(T1_DIR_)t1driver.c \
- $(T1_DIR_)t1afm.c \
- $(T1_DIR_)t1gload.c \
- $(T1_DIR_)t1objs.c
+T1_DRV_SRC := $(T1_DIR)/t1parse.c \
+ $(T1_DIR)/t1load.c \
+ $(T1_DIR)/t1driver.c \
+ $(T1_DIR)/t1afm.c \
+ $(T1_DIR)/t1gload.c \
+ $(T1_DIR)/t1objs.c
# Type1 driver headers
#
T1_DRV_H := $(T1_DRV_SRC:%.c=%.h) \
- $(T1_DIR_)t1tokens.h \
- $(T1_DIR_)t1errors.h
+ $(T1_DIR)/t1tokens.h \
+ $(T1_DIR)/t1errors.h
# Type1 driver object(s)
@@ -45,24 +44,24 @@
# T1_DRV_OBJ_M is used during `multi' builds
# T1_DRV_OBJ_S is used during `single' builds
#
-T1_DRV_OBJ_M := $(T1_DRV_SRC:$(T1_DIR_)%.c=$(OBJ_)%.$O)
-T1_DRV_OBJ_S := $(OBJ_)type1.$O
+T1_DRV_OBJ_M := $(T1_DRV_SRC:$(T1_DIR)/%.c=$(OBJ_DIR)/%.$O)
+T1_DRV_OBJ_S := $(OBJ_DIR)/type1.$O
# Type1 driver source file for single build
#
-T1_DRV_SRC_S := $(T1_DIR_)type1.c
+T1_DRV_SRC_S := $(T1_DIR)/type1.c
# Type1 driver - single object
#
$(T1_DRV_OBJ_S): $(T1_DRV_SRC_S) $(T1_DRV_SRC) $(FREETYPE_H) $(T1_DRV_H)
- $(T1_COMPILE) $T$@ $(T1_DRV_SRC_S)
+ $(T1_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(T1_DRV_SRC_S))
# Type1 driver - multiple objects
#
-$(OBJ_)%.$O: $(T1_DIR_)%.c $(FREETYPE_H) $(T1_DRV_H)
- $(T1_COMPILE) $T$@ $<
+$(OBJ_DIR)/%.$O: $(T1_DIR)/%.c $(FREETYPE_H) $(T1_DRV_H)
+ $(T1_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
# update main driver object lists
@@ -70,4 +69,5 @@
DRV_OBJS_S += $(T1_DRV_OBJ_S)
DRV_OBJS_M += $(T1_DRV_OBJ_M)
+
# EOF
Index: t1afm.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/type1/t1afm.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/t1afm.c 26 Nov 2003 22:48:28 -0000 1.1.4.1
+++ b/t1afm.c 15 Apr 2004 10:14:44 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* AFM support for Type 1 fonts (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, */
@@ -148,7 +148,7 @@
FT_ULong index2 = KERN_INDEX( pair2->glyph1, pair2->glyph2 );
- return ( index1 - index2 );
+ return (int)( index1 - index2 );
}
Index: t1driver.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/type1/t1driver.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/t1driver.c 26 Nov 2003 22:48:28 -0000 1.1.4.1
+++ b/t1driver.c 15 Apr 2004 10:14:44 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* Type 1 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, */
@@ -29,8 +29,13 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
-#include FT_INTERNAL_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_MULTIPLE_MASTERS_H
+#include FT_SERVICE_GLYPH_DICT_H
+#include FT_SERVICE_XFREE86_NAME_H
+#include FT_SERVICE_POSTSCRIPT_NAME_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
+#include FT_SERVICE_POSTSCRIPT_INFO_H
/*************************************************************************/
/* */
@@ -41,6 +46,10 @@
#undef FT_COMPONENT
#define FT_COMPONENT trace_t1driver
+ /*
+ * GLYPH DICT SERVICE
+ *
+ */
static FT_Error
t1_get_glyph_name( T1_Face face,
@@ -69,23 +78,6 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* t1_get_name_index */
- /* */
- /* <Description> */
- /* Uses the Type 1 font's `glyph_names' table to find a given glyph */
- /* name's glyph index. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* glyph_name :: The glyph name. */
- /* */
- /* <Return> */
- /* Glyph index. 0 means `undefined character code'. */
- /* */
static FT_UInt
t1_get_name_index( T1_Face face,
FT_String* glyph_name )
@@ -105,6 +97,17 @@
return 0;
}
+ static const FT_Service_GlyphDictRec t1_service_glyph_dict =
+ {
+ (FT_GlyphDict_GetNameFunc) t1_get_glyph_name,
+ (FT_GlyphDict_NameIndexFunc)t1_get_name_index
+ };
+
+
+ /*
+ * POSTSCRIPT NAME SERVICE
+ *
+ */
static const char*
t1_get_ps_name( T1_Face face )
@@ -112,61 +115,83 @@
return (const char*) face->type1.font_name;
}
+ static const FT_Service_PsFontNameRec t1_service_ps_name =
+ {
+ (FT_PsName_GetFunc)t1_get_ps_name
+ };
- /*************************************************************************/
- /* */
- /* <Function> */
- /* Get_Interface */
- /* */
- /* <Description> */
- /* Each driver can provide one or more extensions to the base */
- /* FreeType API. These can be used to access format specific */
- /* features (e.g., all TrueType/OpenType resources share a common */
- /* file structure and common tables which can be accessed through the */
- /* `sfnt' interface), or more simply generic ones (e.g., the */
- /* `postscript names' interface which can be used to retrieve the */
- /* PostScript name of a given glyph index). */
- /* */
- /* <InOut> */
- /* driver :: A handle to a driver object. */
- /* */
- /* <Input> */
- /* t1_interface :: A string designing the interface. Examples are */
- /* `sfnt', `post_names', `charmaps', etc. */
- /* */
- /* <Return> */
- /* A typeless pointer to the extension's interface (normally a table */
- /* of function pointers). Returns NULL if the requested extension */
- /* isn't available (i.e., wasn't compiled in the driver at build */
- /* time). */
- /* */
- static FT_Module_Interface
- Get_Interface( FT_Driver driver,
- const FT_String* t1_interface )
+
+ /*
+ * MULTIPLE MASTERS SERVICE
+ *
+ */
+
+#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
+ static const FT_Service_MultiMastersRec t1_service_multi_masters =
{
- FT_UNUSED( driver );
- FT_UNUSED( t1_interface );
+ (FT_Get_MM_Func) T1_Get_Multi_Master,
+ (FT_Set_MM_Design_Func)T1_Set_MM_Design,
+ (FT_Set_MM_Blend_Func) T1_Set_MM_Blend
+ };
+#endif
- if ( ft_strcmp( (const char*)t1_interface, "glyph_name" ) == 0 )
- return (FT_Module_Interface)t1_get_glyph_name;
- if ( ft_strcmp( (const char*)t1_interface, "name_index" ) == 0 )
- return (FT_Module_Interface)t1_get_name_index;
+ /*
+ * POSTSCRIPT INFO SERVICE
+ *
+ */
- if ( ft_strcmp( (const char*)t1_interface, "postscript_name" ) == 0 )
- return (FT_Module_Interface)t1_get_ps_name;
+ static FT_Error
+ t1_ps_get_font_info( FT_Face face,
+ PS_FontInfoRec* afont_info )
+ {
+ *afont_info = ((T1_Face)face)->type1.font_info;
+ return 0;
+ }
-#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
- if ( ft_strcmp( (const char*)t1_interface, "get_mm" ) == 0 )
- return (FT_Module_Interface)T1_Get_Multi_Master;
- if ( ft_strcmp( (const char*)t1_interface, "set_mm_design") == 0 )
- return (FT_Module_Interface)T1_Set_MM_Design;
+ static FT_Int
+ t1_ps_has_glyph_names( FT_Face face )
+ {
+ FT_UNUSED( face );
+ return 1;
+ }
- if ( ft_strcmp( (const char*)t1_interface, "set_mm_blend") == 0 )
- return (FT_Module_Interface)T1_Set_MM_Blend;
+
+ static const FT_Service_PsInfoRec t1_service_ps_info =
+ {
+ (PS_GetFontInfoFunc) t1_ps_get_font_info,
+ (PS_HasGlyphNamesFunc)t1_ps_has_glyph_names
+ };
+
+
+ /*
+ * SERVICE LIST
+ *
+ */
+
+ static const FT_ServiceDescRec t1_services[] =
+ {
+ { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t1_service_ps_name },
+ { FT_SERVICE_ID_GLYPH_DICT, &t1_service_glyph_dict },
+ { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TYPE_1 },
+ { FT_SERVICE_ID_POSTSCRIPT_INFO, &t1_service_ps_info },
+
+#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
+ { FT_SERVICE_ID_MULTI_MASTERS, &t1_service_multi_masters },
#endif
- return 0;
+ { NULL, NULL }
+ };
+
+
+ static FT_Module_Interface
+ Get_Interface( FT_Driver driver,
+ const FT_String* t1_interface )
+ {
+ FT_UNUSED( driver );
+ FT_UNUSED( t1_interface );
+
+ return ft_service_list_lookup( t1_services, t1_interface );
}
@@ -227,15 +252,13 @@
#endif /* T1_CONFIG_OPTION_NO_AFM */
-
-
FT_CALLBACK_TABLE_DEF
const FT_Driver_ClassRec t1_driver_class =
{
{
- 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 ),
Index: t1gload.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/type1/t1gload.c,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -u -d -r1.1.4.2 -r1.1.4.3
--- a/t1gload.c 5 Mar 2004 13:38:44 -0000 1.1.4.2
+++ b/t1gload.c 15 Apr 2004 10:14:44 -0000 1.1.4.3
@@ -4,7 +4,7 @@
/* */
/* Type 1 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, */
@@ -14,7 +14,6 @@
/* understand and accept it fully. */
/* */
/***************************************************************************/
-/* $XFree86$ */
#include <ft2build.h>
#include "t1gload.h"
@@ -98,8 +97,8 @@
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 );
@@ -120,7 +119,7 @@
FT_UInt glyph_index )
{
FT_Data glyph_data;
- FT_Error error = T1_Parse_Glyph_And_Get_Char_String(
+ FT_Error error = T1_Parse_Glyph_And_Get_Char_String(
decoder, glyph_index, &glyph_data );
@@ -130,7 +129,7 @@
T1_Face face = (T1_Face)decoder->builder.face;
- if ( face->root.internal->incremental_interface )
+ if ( face->root.internal->incremental_interface )
face->root.internal->incremental_interface->funcs->free_glyph_data(
face->root.internal->incremental_interface->object,
&glyph_data );
@@ -143,7 +142,7 @@
FT_LOCAL_DEF( FT_Error )
T1_Compute_Max_Advance( T1_Face face,
- FT_Int* max_advance )
+ FT_Pos* max_advance )
{
FT_Error error;
T1_DecoderRec decoder;
@@ -184,8 +183,8 @@
error = T1_Parse_Glyph( &decoder, glyph_index );
if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance )
*max_advance = decoder.builder.advance.x;
-
- /* ignore the error if one occured - skip to next glyph */
+
+ /* ignore the error if one occurred - skip to next glyph */
}
return T1_Err_Ok;
@@ -304,6 +303,7 @@
{
FT_BBox cbox;
FT_Glyph_Metrics* metrics = &glyph->root.metrics;
+ FT_Vector advance;
/* copy the _unscaled_ advance width */
@@ -330,6 +330,15 @@
FT_Outline_Translate( &glyph->root.outline,
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;
#endif
if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 )
Index: t1gload.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/type1/t1gload.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/t1gload.h 26 Nov 2003 22:48:28 -0000 1.1.4.1
+++ b/t1gload.h 15 Apr 2004 10:14:44 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* Type 1 Glyph 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, */
@@ -29,7 +29,7 @@
FT_LOCAL( FT_Error )
T1_Compute_Max_Advance( T1_Face face,
- FT_Int* max_advance );
+ FT_Pos* max_advance );
FT_LOCAL( FT_Error )
T1_Load_Glyph( T1_GlyphSlot glyph,
Index: t1load.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/type1/t1load.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/t1load.c 26 Nov 2003 22:48:28 -0000 1.1.4.1
+++ b/t1load.c 15 Apr 2004 10:14:44 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* Type 1 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, */
@@ -41,11 +41,10 @@
/* */
/* All other common cases are handled very simply. The matching rules */
[...1227 lines suppressed...]
}
break;
}
}
}
+
+ /*
+ * Yes, this happens: Certain PDF-embedded fonts have only a
+ * `.notdef' glyph defined!
+ */
+
+ if ( min_char > max_char )
+ {
+ min_char = 0;
+ max_char = loader.encoding_table.max_elems;
+ }
+
type1->encoding.code_first = min_char;
type1->encoding.code_last = max_char;
type1->encoding.num_chars = loader.num_chars;
Index: t1objs.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/type1/t1objs.c,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -u -d -r1.1.4.2 -r1.1.4.3
--- a/t1objs.c 5 Mar 2004 13:38:44 -0000 1.1.4.2
+++ b/t1objs.c 15 Apr 2004 10:14:44 -0000 1.1.4.3
@@ -4,7 +4,7 @@
/* */
/* Type 1 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, */
@@ -14,7 +14,6 @@
/* understand and accept it fully. */
/* */
/***************************************************************************/
-/* $XFree86: xc/extras/freetype2/src/type1/t1objs.c,v 1.2 2003/05/27 22:26:23 tsi Exp $ */
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
@@ -29,7 +28,7 @@
#include "t1afm.h"
#endif
-#include FT_INTERNAL_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
@@ -118,9 +117,9 @@
if ( funcs )
error = funcs->set_scale( (PSH_Globals)size->root.internal,
- size->root.metrics.x_scale,
- size->root.metrics.y_scale,
- 0, 0 );
+ size->root.metrics.x_scale,
+ size->root.metrics.y_scale,
+ 0, 0 );
return error;
}
@@ -275,9 +274,11 @@
FT_Int num_params,
FT_Parameter* params )
{
- FT_Error error;
- PSNames_Service psnames;
- PSAux_Service psaux;
+ FT_Error error;
+ FT_Service_PsCMaps psnames;
+ PSAux_Service psaux;
+ T1_Font type1 = &face->type1;
+ PS_FontInfo info = &type1->font_info;
FT_UNUSED( num_params );
FT_UNUSED( params );
@@ -287,9 +288,8 @@
face->root.num_faces = 1;
- face->psnames = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
- "psnames" );
- psnames = (PSNames_Service)face->psnames;
+ FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
+ face->psnames = psnames;
face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
"psaux" );
@@ -298,7 +298,7 @@
face->pshinter = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
"pshinter" );
- /* open the tokenizer, this will also check the font format */
+ /* open the tokenizer; this will also check the font format */
error = T1_Open_Face( face );
if ( error )
goto Exit;
@@ -315,22 +315,23 @@
goto Exit;
}
- /* Now, load the font program into the face object */
+ /* now load the font program into the face object */
- /* Init the face object fields */
- /* Now set up root face fields */
+ /* initialize the face object fields */
+
+ /* set up root face fields */
{
FT_Face root = (FT_Face)&face->root;
- root->num_glyphs = face->type1.num_glyphs;
+ root->num_glyphs = type1->num_glyphs;
root->face_index = face_index;
- root->face_flags = FT_FACE_FLAG_SCALABLE;
+ root->face_flags = FT_FACE_FLAG_SCALABLE;
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
- if ( face->type1.font_info.is_fixed_pitch )
+ if ( info->is_fixed_pitch )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
if ( face->blend )
@@ -340,45 +341,55 @@
/* get style name -- be careful, some broken fonts only */
/* have a `/FontName' dictionary entry! */
- root->family_name = face->type1.font_info.family_name;
+ 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 = face->type1.font_info.full_name;
+ char* full = info->full_name;
char* family = root->family_name;
if ( full )
{
- while ( *family && *full == *family )
+ while ( *full )
{
- family++;
- full++;
+ if ( *full == *family )
+ {
+ family++;
+ full++;
+ }
+ else
+ {
+ if ( *full == ' ' || *full == '-' )
+ full++;
+ else if ( *family == ' ' || *family == '-' )
+ family++;
+ else
+ {
+ if ( !*family )
+ root->style_name = full;
+ break;
+ }
+ }
}
-
- root->style_name = ( *full == ' ' ? full + 1
- : (char *)"Regular" );
}
- else
- root->style_name = (char *)"Regular";
}
else
{
/* do we have a `/FontName'? */
- if ( face->type1.font_name )
- {
- root->family_name = face->type1.font_name;
- root->style_name = (char *)"Regular";
- }
+ if ( type1->font_name )
+ root->family_name = type1->font_name;
}
/* compute style flags */
root->style_flags = 0;
- if ( face->type1.font_info.italic_angle )
+ if ( info->italic_angle )
root->style_flags |= FT_STYLE_FLAG_ITALIC;
- if ( face->type1.font_info.weight )
+ if ( info->weight )
{
- if ( !ft_strcmp( face->type1.font_info.weight, "Bold" ) ||
- !ft_strcmp( face->type1.font_info.weight, "Black" ) )
+ if ( !ft_strcmp( info->weight, "Bold" ) ||
+ !ft_strcmp( info->weight, "Black" ) )
root->style_flags |= FT_STYLE_FLAG_BOLD;
}
@@ -386,10 +397,10 @@
root->num_fixed_sizes = 0;
root->available_sizes = 0;
- root->bbox.xMin = face->type1.font_bbox.xMin >> 16;
- root->bbox.yMin = face->type1.font_bbox.yMin >> 16;
- root->bbox.xMax = ( face->type1.font_bbox.xMax + 0xFFFFU ) >> 16;
- root->bbox.yMax = ( face->type1.font_bbox.yMax + 0xFFFFU ) >> 16;
+ root->bbox.xMin = type1->font_bbox.xMin >> 16;
+ root->bbox.yMin = type1->font_bbox.yMin >> 16;
+ root->bbox.xMax = ( type1->font_bbox.xMax + 0xFFFFU ) >> 16;
+ root->bbox.yMax = ( type1->font_bbox.yMax + 0xFFFFU ) >> 16;
/* Set units_per_EM if we didn't set it in parse_font_matrix. */
if ( !root->units_per_EM )
@@ -398,13 +409,13 @@
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->ascender - root->descender ) * 12 ) / 10 );
/* now compute the maximum advance width */
root->max_advance_width =
(FT_Short)( root->bbox.xMax );
{
- FT_Int max_advance;
+ FT_Pos max_advance;
error = T1_Compute_Max_Advance( face, &max_advance );
@@ -418,8 +429,10 @@
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->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;
@@ -449,7 +462,7 @@
charmap.platform_id = 7;
clazz = NULL;
- switch ( face->type1.encoding_type )
+ switch ( type1->encoding_type )
{
case T1_ENCODING_TYPE_STANDARD:
charmap.encoding = FT_ENCODING_ADOBE_STANDARD;
Index: t1parse.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/type1/t1parse.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/t1parse.c 26 Nov 2003 22:48:28 -0000 1.1.4.1
+++ b/t1parse.c 15 Apr 2004 10:14:44 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* Type 1 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, */
@@ -65,53 +65,30 @@
/*************************************************************************/
-#define IS_T1_WHITESPACE( c ) ( (c) == ' ' || (c) == '\t' )
-#define IS_T1_LINESPACE( c ) ( (c) == '\r' || (c) == '\n' )
-
-#define IS_T1_SPACE( c ) ( IS_T1_WHITESPACE( c ) || IS_T1_LINESPACE( c ) )
-
-
- typedef struct PFB_Tag_
+ static FT_Error
+ read_pfb_tag( FT_Stream stream,
+ FT_UShort *atag,
+ FT_Long *asize )
{
+ FT_Error error;
FT_UShort tag;
FT_Long size;
- } PFB_Tag;
-
-
-#undef FT_STRUCTURE
-#define FT_STRUCTURE PFB_Tag
-
-
- static
- const FT_Frame_Field pfb_tag_fields[] =
- {
- FT_FRAME_START( 6 ),
- FT_FRAME_USHORT ( tag ),
- FT_FRAME_LONG_LE( size ),
- FT_FRAME_END
- };
-
-
- static FT_Error
- read_pfb_tag( FT_Stream stream,
- FT_UShort* tag,
- FT_Long* size )
- {
- FT_Error error;
- PFB_Tag head;
+ *atag = 0;
+ *asize = 0;
- *tag = 0;
- *size = 0;
- if ( !FT_STREAM_READ_FIELDS( pfb_tag_fields, &head ) )
+ if ( !FT_READ_USHORT( tag ) )
{
- if ( head.tag == 0x8001U || head.tag == 0x8002U )
+ if ( tag == 0x8001U || tag == 0x8002U )
{
- *tag = head.tag;
- *size = head.size;
+ if ( !FT_READ_LONG_LE( size ) )
+ *asize = size;
}
+
+ *atag = tag;
}
+
return error;
}
@@ -127,7 +104,7 @@
FT_Long size;
- psaux->ps_parser_funcs->init( &parser->root,0, 0, memory );
+ psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory );
parser->stream = stream;
parser->base_len = 0;
@@ -242,36 +219,13 @@
}
- /* return the value of an hexadecimal digit */
- static int
- hexa_value( char c )
- {
- unsigned int d;
-
-
- d = (unsigned int)( c - '0' );
- if ( d <= 9 )
- return (int)d;
-
- d = (unsigned int)( c - 'a' );
- if ( d <= 5 )
- return (int)( d + 10 );
-
- d = (unsigned int)( c - 'A' );
- if ( d <= 5 )
- return (int)( d + 10 );
-
- return -1;
- }
-
-
FT_LOCAL_DEF( FT_Error )
T1_Get_Private_Dict( T1_Parser parser,
PSAux_Service psaux )
{
FT_Stream stream = parser->stream;
FT_Memory memory = parser->root.memory;
- FT_Error error = 0;
+ FT_Error error = T1_Err_Ok;
FT_Long size;
@@ -325,7 +279,8 @@
break;
}
- if ( FT_STREAM_READ( parser->private_dict + parser->private_len, size ) )
+ if ( FT_STREAM_READ( parser->private_dict + parser->private_len,
+ size ) )
goto Fail;
parser->private_len += size;
@@ -333,9 +288,9 @@
}
else
{
- /* we have already `loaded' the whole PFA font file into memory; */
+ /* We have already `loaded' the whole PFA font file into memory; */
/* if this is a memory resource, allocate a new block to hold */
- /* the private dict. Otherwise, simply overwrite into the base */
+ /* the private dict. Otherwise, simply overwrite into the base */
/* dictionary block in the heap. */
/* first of all, look at the `eexec' keyword */
@@ -344,24 +299,18 @@
FT_Byte c;
+ Again:
for (;;)
{
c = cur[0];
if ( c == 'e' && cur + 9 < limit ) /* 9 = 5 letters for `eexec' + */
/* newline + 4 chars */
{
- if ( cur[1] == 'e' && cur[2] == 'x' &&
- cur[3] == 'e' && cur[4] == 'c' )
- {
- cur += 6; /* we skip the newling after the `eexec' */
-
- /* XXX: Some fonts use DOS-linefeeds, i.e. \r\n; we need to */
- /* skip the extra \n if we find it */
- if ( cur[0] == '\n' )
- cur++;
-
+ if ( cur[1] == 'e' &&
+ cur[2] == 'x' &&
+ cur[3] == 'e' &&
+ cur[4] == 'c' )
break;
- }
}
cur++;
if ( cur >= limit )
@@ -373,10 +322,43 @@
}
}
+ /* check whether `eexec' was real -- it could be in a comment */
+ /* or string (as e.g. in u003043t.gsf from ghostscript) */
+
+ parser->root.cursor = parser->base_dict;
+ parser->root.limit = cur + 9;
+
+ cur = parser->root.cursor;
+ limit = parser->root.limit;
+
+ while ( cur < limit )
+ {
+ if ( *cur == 'e' && ft_strncmp( (char*)cur, "eexec", 5 ) == 0 )
+ goto Found;
+
+ T1_Skip_PS_Token( parser );
+ T1_Skip_Spaces ( parser );
+ cur = parser->root.cursor;
+ }
+
+ /* we haven't found the correct `eexec'; go back and continue */
+ /* searching */
+
+ cur = limit;
+ limit = parser->base_dict + parser->base_len;
+ goto Again;
+
/* now determine where to write the _encrypted_ binary private */
/* dictionary. We overwrite the base dictionary for disk-based */
/* resources and allocate a new block otherwise */
+ Found:
+ parser->root.limit = parser->base_dict + parser->base_len;
+
+ T1_Skip_PS_Token( parser );
+ T1_Skip_Spaces ( parser );
+ cur = parser->root.cursor;
+
size = (FT_Long)( parser->base_len - ( cur - parser->base_dict ) );
if ( parser->in_memory )
@@ -402,51 +384,38 @@
/* the `eexec' keyword); if they all are hexadecimal digits, then */
/* we have a case of ASCII storage */
- if ( ( hexa_value( cur[0] ) | hexa_value( cur[1] ) |
- hexa_value( cur[2] ) | hexa_value( cur[3] ) ) < 0 )
-
- /* binary encoding -- `simply' copy the private dict */
- FT_MEM_COPY( parser->private_dict, cur, size );
-
- else
+ if ( ft_isxdigit( cur[0] ) && ft_isxdigit( cur[1] ) &&
+ ft_isxdigit( cur[2] ) && ft_isxdigit( cur[3] ) )
{
/* ASCII hexadecimal encoding */
+ FT_Long len;
- FT_Byte* write;
- FT_Int count;
-
-
- write = parser->private_dict;
- count = 0;
-
- for ( ;cur < limit; cur++ )
- {
- int hex1;
-
-
- /* check for newline */
- if ( cur[0] == '\r' || cur[0] == '\n' )
- continue;
-
- /* exit if we have a non-hexadecimal digit that isn't a newline */
- hex1 = hexa_value( cur[0] );
- if ( hex1 < 0 || cur + 1 >= limit )
- break;
- /* otherwise, store byte */
- *write++ = (FT_Byte)( ( hex1 << 4 ) | hexa_value( cur[1] ) );
- count++;
- cur++;
- }
+ parser->root.cursor = cur;
+ (void)psaux->ps_parser_funcs->to_bytes( &parser->root,
+ parser->private_dict,
+ parser->private_len,
+ &len,
+ 0 );
+ parser->private_len = len;
/* put a safeguard */
- parser->private_len = write - parser->private_dict;
- *write++ = 0;
+ parser->private_dict[len] = '\0';
}
+ else
+ /* binary encoding -- copy the private dict */
+ FT_MEM_COPY( parser->private_dict, cur, size );
}
/* we now decrypt the encoded binary private dictionary */
psaux->t1_decrypt( parser->private_dict, parser->private_len, 55665U );
+
+ /* replace the four random bytes at the beginning with whitespace */
+ parser->private_dict[0] = ' ';
+ parser->private_dict[1] = ' ';
+ parser->private_dict[2] = ' ';
+ parser->private_dict[3] = ' ';
+
parser->root.base = parser->private_dict;
parser->root.cursor = parser->private_dict;
parser->root.limit = parser->root.cursor + parser->private_len;
Index: t1parse.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/type1/t1parse.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/t1parse.h 26 Nov 2003 22:48:28 -0000 1.1.4.1
+++ b/t1parse.h 15 Apr 2004 10:14:44 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* Type 1 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, */
@@ -69,9 +69,9 @@
FT_Byte* private_dict;
FT_Long private_len;
- FT_Byte in_pfb;
- FT_Byte in_memory;
- FT_Byte single_block;
+ FT_Bool in_pfb;
+ FT_Bool in_memory;
+ FT_Bool single_block;
} T1_ParserRec, *T1_Parser;
@@ -91,8 +91,8 @@
} while ( 0 )
-#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root )
-#define T1_Skip_Alpha( p ) (p)->root.funcs.skip_alpha ( &(p)->root )
+#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root )
+#define T1_Skip_PS_Token( p ) (p)->root.funcs.skip_PS_token( &(p)->root )
#define T1_ToInt( p ) (p)->root.funcs.to_int( &(p)->root )
#define T1_ToFixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t )
Index: t1tokens.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/type1/t1tokens.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/t1tokens.h 26 Nov 2003 22:48:28 -0000 1.1.4.1
+++ b/t1tokens.h 15 Apr 2004 10:14:44 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* Type 1 tokenizer (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, */
@@ -21,16 +21,17 @@
#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_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_TYPE_BOOL( "isFixedPitch", is_fixed_pitch )
- T1_FIELD_NUM ( "UnderlinePosition", underline_position )
- T1_FIELD_NUM ( "UnderlineThickness", underline_thickness )
+ /* we use pointers to detect modifications made by synthetic fonts */
+ 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
@@ -43,7 +44,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 )
@@ -65,9 +66,10 @@
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_FONT_DICT
- T1_FIELD_NUM( "PaintType", paint_type )
- T1_FIELD_NUM( "FontType", font_type )
- T1_FIELD_NUM( "StrokeWidth", stroke_width )
+ T1_FIELD_KEY ( "FontName", font_name )
+ T1_FIELD_NUM ( "PaintType", paint_type )
+ T1_FIELD_NUM ( "FontType", font_type )
+ T1_FIELD_FIXED( "StrokeWidth", stroke_width )
#undef FT_STRUCTURE
#define FT_STRUCTURE FT_BBox
--- descrip.mms DELETED ---
- Previous message: [xorg-commit-diffs] xc/extras/freetype2/src/truetype rules.mk, 1.1,
1.1.4.1 ttdriver.c, 1.1.4.1, 1.1.4.2 ttgload.c, 1.1.4.1,
1.1.4.2 ttgload.h, 1.1.4.1, 1.1.4.2 ttinterp.c, 1.1.4.1,
1.1.4.2 ttobjs.c, 1.1.4.1, 1.1.4.2 ttobjs.h, 1.1.4.1, 1.1.4.2
- Next message: [xorg-commit-diffs]
xc/extras/freetype2/src/type42 t42types.h, NONE,
1.1.6.1 rules.mk, 1.1, 1.1.4.1 t42drivr.c, 1.1.4.1,
1.1.4.2 t42error.h, 1.1, 1.1.4.1 t42objs.c, 1.1.4.1,
1.1.4.2 t42objs.h, 1.1.4.1, 1.1.4.2 t42parse.c, 1.1.4.1,
1.1.4.2 t42parse.h, 1.1, 1.1.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the xorg-commit-diffs
mailing list