Commit f12944ec authored by David Turner's avatar David Turner
Browse files

still more logical transformations. This time, some public API headers have

been touched, while keeping everything backwards-compatible..

        * include/freetype/t1tables.h: re-naming structure types. This done
        basically:

          typedef T1_Struct_
          {
          } T1_Struct;

        becomes:

          typedef PS_StructRec_
          {
          } PS_StructRec, *PS_Struct;

          typedef PS_StructRec  T1_Struct;  /* backwards-compatibility */


        hence, we increase the coherency of the source code by effectuively
        using the 'Rec' prefix for structure types..
parent aa919383
2002-02-28 David Turner <david@freetype.org>
* include/freetype/t1tables.h: re-naming structure types. This done
basically:
typedef T1_Struct_
{
} T1_Struct;
becomes:
typedef PS_StructRec_
{
} PS_StructRec, *PS_Struct;
typedef PS_StructRec T1_Struct; /* backwards-compatibility */
hence, we increase the coherency of the source code by effectuively
using the 'Rec' prefix for structure types..
2002-02-27 David Turner <david@freetype.org>
* src/sfnt/ttload.c (TT_Load_Names): simplifying and securing the
names table loader. Invalid individual name entries are now handled
correctly. This allows the loading of very buggy fonts like
......
......@@ -31,7 +31,7 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Struct> */
/* CFF_Index */
/* CFF_IndexRec */
/* */
/* <Description> */
/* A structure used to model a CFF Index table. */
......@@ -50,7 +50,7 @@ FT_BEGIN_HEADER
/* */
/* bytes :: If the index is loaded in memory, its bytes. */
/* */
typedef struct CFF_Index_
typedef struct CFF_IndexRec_
{
FT_Stream stream;
FT_UInt count;
......@@ -60,10 +60,10 @@ FT_BEGIN_HEADER
FT_ULong* offsets;
FT_Byte* bytes;
} CFF_Index;
} CFF_IndexRec, *CFF_Index;
typedef struct CFF_Encoding_
typedef struct CFF_EncodingRec_
{
FT_UInt format;
FT_ULong offset;
......@@ -71,7 +71,7 @@ FT_BEGIN_HEADER
FT_UShort* sids;
FT_UShort* codes;
} CFF_Encoding;
} CFF_EncodingRec, *CFF_Encoding;
typedef struct CFF_Charset_
......@@ -132,7 +132,7 @@ FT_BEGIN_HEADER
} CFF_Font_Dict;
typedef struct CFF_Private_
typedef struct CFF_PrivateRec_
{
FT_Byte num_blue_values;
FT_Byte num_other_blues;
......@@ -164,7 +164,7 @@ FT_BEGIN_HEADER
FT_Pos default_width;
FT_Pos nominal_width;
} CFF_Private;
} CFF_PrivateRec, *CFF_Private;
typedef struct CFF_FD_Select_
......@@ -189,9 +189,9 @@ FT_BEGIN_HEADER
typedef struct CFF_SubFont_
{
CFF_Font_Dict font_dict;
CFF_Private private_dict;
CFF_PrivateRec private_dict;
CFF_Index local_subrs_index;
CFF_IndexRec local_subrs_index;
FT_UInt num_local_subrs;
FT_Byte** local_subrs;
......@@ -215,18 +215,18 @@ FT_BEGIN_HEADER
FT_Byte absolute_offsize;
CFF_Index name_index;
CFF_Index top_dict_index;
CFF_Index string_index;
CFF_Index global_subrs_index;
CFF_IndexRec name_index;
CFF_IndexRec top_dict_index;
CFF_IndexRec string_index;
CFF_IndexRec global_subrs_index;
CFF_Encoding encoding;
CFF_EncodingRec encoding;
CFF_Charset charset;
CFF_Index charstrings_index;
CFF_Index font_dict_index;
CFF_Index private_index;
CFF_Index local_subrs_index;
CFF_IndexRec charstrings_index;
CFF_IndexRec font_dict_index;
CFF_IndexRec private_index;
CFF_IndexRec local_subrs_index;
FT_String* font_name;
FT_UInt num_global_subrs;
......
......@@ -602,7 +602,7 @@ FT_BEGIN_HEADER
FT_Size size,
FT_GlyphSlot slot,
FT_Byte** glyph_names,
T1_Blend* blend,
PS_Blend blend,
FT_Bool hinting,
T1_Decoder_Callback callback );
......@@ -643,7 +643,7 @@ FT_BEGIN_HEADER
FT_Int num_flex_vectors;
FT_Vector flex_vectors[7];
T1_Blend* blend; /* for multiple master support */
PS_Blend blend; /* for multiple master support */
T1_Decoder_Callback parse_callback;
T1_Decoder_FuncsRec funcs;
......
......@@ -46,7 +46,7 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Struct> */
/* T1_Encoding */
/* T1_EncodingRec */
/* */
/* <Description> */
/* A structure modeling a custom encoding. */
......@@ -63,7 +63,7 @@ FT_BEGIN_HEADER
/* */
/* char_name :: An array of corresponding glyph names. */
/* */
typedef struct T1_Encoding_
typedef struct T1_EncodingRecRec_
{
FT_Int num_chars;
FT_Int code_first;
......@@ -72,33 +72,33 @@ FT_BEGIN_HEADER
FT_UShort* char_index;
FT_String** char_name;
} T1_Encoding;
} T1_EncodingRec, *T1_Encoding;
typedef enum T1_EncodingType_
{
t1_encoding_none = 0,
t1_encoding_array,
t1_encoding_standard,
t1_encoding_isolatin1,
t1_encoding_expert
T1_ENCODING_TYPE_NONE = 0,
T1_ENCODING_TYPE_ARRAY,
T1_ENCODING_TYPE_STANDARD,
T1_ENCODING_TYPE_ISOLATIN1,
T1_ENCODING_TYPE_EXPORT
} T1_EncodingType;
typedef struct T1_Font_
typedef struct T1_FontRec_
{
/* font info dictionary */
T1_FontInfo font_info;
PS_FontInfoRec font_info;
/* private dictionary */
T1_Private private_dict;
PS_PrivateRec private_dict;
/* top-level dictionary */
FT_String* font_name;
T1_EncodingType encoding_type;
T1_Encoding encoding;
T1_EncodingRec encoding;
FT_Byte* subrs_block;
FT_Byte* charstrings_block;
......@@ -122,15 +122,15 @@ FT_BEGIN_HEADER
FT_Int stroke_width;
} T1_Font;
} T1_FontRec, *T1_Font;
typedef struct CID_Subrs_
typedef struct CID_SubrsRec_
{
FT_UInt num_subrs;
FT_Byte** code;
} CID_Subrs;
} CID_SubrsRec, *CID_Subrs;
/*************************************************************************/
......@@ -164,7 +164,7 @@ FT_BEGIN_HEADER
typedef struct T1_FaceRec_
{
FT_FaceRec root;
T1_Font type1;
T1_FontRec type1;
void* psnames;
void* psaux;
void* afm_data;
......@@ -173,7 +173,7 @@ FT_BEGIN_HEADER
PS_Unicodes unicode_map;
/* support for Multiple Masters fonts */
T1_Blend* blend;
PS_Blend blend;
/* since FT 2.1 - interface to PostScript hinter */
void* pshinter;
......@@ -183,15 +183,15 @@ FT_BEGIN_HEADER
typedef struct CID_FaceRec_
{
FT_FaceRec root;
void* psnames;
void* psaux;
CID_Info cid;
void* afm_data;
CID_Subrs* subrs;
FT_FaceRec root;
void* psnames;
void* psaux;
CID_FaceInfoRec cid;
void* afm_data;
CID_Subrs subrs;
/* since FT 2.1 - interface to PostScript hinter */
void* pshinter;
void* pshinter;
} CID_FaceRec;
......
......@@ -46,21 +46,21 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* Note that we separate font data in T1_FontInfo and T1_Private */
/* structures in order to support Multiple Master fonts. */
/* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
/* structures in order to support Multiple Master fonts. */
/*************************************************************************/
/* */
/* <Struct> */
/* T1_FontInfo */
/* PS_FontInfoRec */
/* */
/* <Description> */
/* A structure used to model a Type1/Type2 FontInfo dictionary. Note */
/* that for Multiple Master fonts, each instance has its own */
/* FontInfo. */
/* */
typedef struct T1_FontInfo
typedef struct PS_FontInfoRec
{
FT_String* version;
FT_String* notice;
......@@ -72,20 +72,33 @@ FT_BEGIN_HEADER
FT_Short underline_position;
FT_UShort underline_thickness;
} T1_FontInfo;
} PS_FontInfoRec, *PS_FontInfo;
/*************************************************************************/
/* */
/* <Struct> */
/* T1_Private */
/* T1_FontInfo */
/* */
/* <Description> */
/* A structure used to model a Type1/Type2 FontInfo dictionary. Note */
/* this type is equivalent to @PS_FontInfoRec but has been deprecated */
/* it is kept to maintain source compatibility between various */
/* versions of FreeType */
/* */
typedef PS_FontInfoRec T1_FontInfo;
/*************************************************************************/
/* */
/* <Struct> */
/* PS_PrivateRec */
/* */
/* <Description> */
/* A structure used to model a Type1/Type2 private dictionary. Note */
/* that for Multiple Master fonts, each instance has its own Private */
/* dict. */
/* */
typedef struct T1_Private
typedef struct PS_PrivateRec_
{
FT_Int unique_id;
FT_Int lenIV;
......@@ -121,7 +134,20 @@ FT_BEGIN_HEADER
FT_Short min_feature[2];
} T1_Private;
} PS_PrivateRec, *PS_Private;
/*************************************************************************/
/* */
/* <Struct> */
/* T1_Private */
/* */
/* <Description> */
/* this type is equivalent to @PS_PrivateRec but has been deprecated */
/* it is kept to maintain source compatibility between various */
/* versions of FreeType */
/* */
typedef PS_PrivateRec T1_Private;
/*************************************************************************/
......@@ -137,29 +163,47 @@ FT_BEGIN_HEADER
typedef enum
{
/*# required fields in a FontInfo blend dictionary */
t1_blend_underline_position = 0,
t1_blend_underline_thickness,
t1_blend_italic_angle,
T1_BLEND_UNDERLINE_POSITION = 0,
T1_BLEND_UNDERLINE_THICKNESS,
T1_BLEND_ITALIC_ANGLE,
/*# required fields in a Private blend dictionary */
t1_blend_blue_values,
t1_blend_other_blues,
t1_blend_standard_width,
t1_blend_standard_height,
t1_blend_stem_snap_widths,
t1_blend_stem_snap_heights,
t1_blend_blue_scale,
t1_blend_blue_shift,
t1_blend_family_blues,
t1_blend_family_other_blues,
t1_blend_force_bold,
T1_BLEND_BLUE_VALUES,
T1_BLEND_OTHER_BLUES,
T1_BLEND_STANDARD_WIDTH,
T1_BLEND_STANDARD_HEIGHT,
T1_BLEND_STEM_SNAP_WIDTHS,
T1_BLEND_STEM_SNAP_HEIGHTS,
T1_BLEND_BLUE_SCALE,
T1_BLEND_BLUE_SHIFT,
T1_BLEND_FAMILY_BLUES,
T1_BLEND_FAMILY_OTHER_BLUES,
T1_BLEND_FORCE_BOLD,
/*# never remove */
t1_blend_max
T1_BLEND_MAX
} T1_Blend_Flags;
/* backwards compatible definitions */
#define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
#define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
#define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
#define t1_blend_blue_values T1_BLEND_BLUE_VALUES
#define t1_blend_other_blues T1_BLEND_OTHER_BLUES
#define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH
#define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT
#define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS
#define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS
#define t1_blend_blue_scale T1_BLEND_BLUE_SCALE
#define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT
#define t1_blend_family_blues T1_BLEND_FAMILY_BLUES
#define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES
#define t1_blend_force_bold T1_BLEND_FORCE_BOLD
#define t1_blend_max T1_BELND_MAX
/* maximum number of Multiple Masters designs, as defined in the spec */
#define T1_MAX_MM_DESIGNS 16
......@@ -171,87 +215,110 @@ FT_BEGIN_HEADER
/* this structure is used to store the BlendDesignMap entry for an axis */
typedef struct T1_DesignMap_
typedef struct PS_DesignMap_
{
FT_Byte num_points;
FT_Fixed* design_points;
FT_Fixed* blend_points;
} T1_DesignMap;
} PS_DesignMapRec, *PS_DesignMap;
/* backwards-compatible definition */
typedef PS_DesignMapRec T1_DesignMap;
typedef struct T1_Blend_
typedef struct PS_BlendRec_
{
FT_UInt num_designs;
FT_UInt num_axis;
FT_UInt num_designs;
FT_UInt num_axis;
FT_String* axis_names[T1_MAX_MM_AXIS];
FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
PS_DesignMapRec design_map[T1_MAX_MM_AXIS];
FT_Fixed* weight_vector;
FT_Fixed* default_weight_vector;
FT_String* axis_names[T1_MAX_MM_AXIS];
FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
T1_DesignMap design_map[T1_MAX_MM_AXIS];
PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1];
PS_Private privates [T1_MAX_MM_DESIGNS + 1];
FT_Fixed* weight_vector;
FT_Fixed* default_weight_vector;
FT_ULong blend_bitflags;
T1_FontInfo* font_infos[T1_MAX_MM_DESIGNS + 1];
T1_Private* privates [T1_MAX_MM_DESIGNS + 1];
} PS_BlendRec, *PS_Blend;
FT_ULong blend_bitflags;
} T1_Blend;
/* backwards-compatible definition */
typedef PS_BlendRec T1_Blend;
typedef struct CID_FontDict_
typedef struct CID_FaceDictRec_
{
T1_Private private_dict;
PS_PrivateRec private_dict;
FT_UInt len_buildchar;
FT_Fixed forcebold_threshold;
FT_Pos stroke_width;
FT_Fixed expansion_factor;
FT_UInt len_buildchar;
FT_Fixed forcebold_threshold;
FT_Pos stroke_width;
FT_Fixed expansion_factor;
FT_Byte paint_type;
FT_Byte font_type;
FT_Matrix font_matrix;
FT_Vector font_offset;
FT_Byte paint_type;
FT_Byte font_type;
FT_Matrix font_matrix;
FT_Vector font_offset;
FT_UInt num_subrs;
FT_ULong subrmap_offset;
FT_Int sd_bytes;
FT_UInt num_subrs;
FT_ULong subrmap_offset;
FT_Int sd_bytes;
} CID_FontDict;
} CID_FaceDictRec, *CID_FaceDict;
typedef struct CID_Info_
/* backwards-compatible definition */
typedef CID_FaceDictRec CID_FontDict;
typedef struct CID_FaceInfoRec_
{
FT_String* cid_font_name;
FT_Fixed cid_version;
FT_Int cid_font_type;
FT_String* cid_font_name;
FT_Fixed cid_version;
FT_Int cid_font_type;
FT_String* registry;
FT_String* ordering;
FT_Int supplement;
FT_String* registry;
FT_String* ordering;
FT_Int supplement;
T1_FontInfo font_info;
FT_BBox font_bbox;
FT_ULong uid_base;
PS_FontInfoRec font_info;
FT_BBox font_bbox;
FT_ULong uid_base;
FT_Int num_xuid;
FT_ULong xuid[16];
FT_Int num_xuid;
FT_ULong xuid[16];
FT_ULong cidmap_offset;
FT_Int fd_bytes;
FT_Int gd_bytes;
FT_ULong cid_count;
FT_ULong cidmap_offset;
FT_Int fd_bytes;
FT_Int gd_bytes;
FT_ULong cid_count;
FT_Int num_dicts;
CID_FontDict* font_dicts;
FT_Int num_dicts;
CID_FaceDict font_dicts;
FT_ULong data_offset;
FT_ULong data_offset;
} CID_Info;
} CID_FaceInfoRec, *CID_FaceInfo;
/*************************************************************************/
/* */
/* <Struct> */
/* CID_Info */
/* */
/* <Description> */
/* this type is equivalent to @CID_FaceInfoRec but has been deprecated */
/* it is kept to maintain source compatibility between various */
/* versions of FreeType */
/* */
typedef CID_FaceInfoRec CID_Info;
/* */
......
......@@ -2225,7 +2225,7 @@
&charstring, &charstring_len );
if ( !error )
{
CFF_Index csindex = cff->charstrings_index;
CFF_IndexRec csindex = cff->charstrings_index;
CFF_Prepare_Decoder( &decoder, glyph_index );
......
......@@ -1082,7 +1082,7 @@
static FT_Error
cff_new_index( CFF_Index* index,
cff_new_index( CFF_Index index,
FT_Stream stream,
FT_Bool load )
{
......@@ -1155,7 +1155,7 @@
static void
cff_done_index( CFF_Index* index )
cff_done_index( CFF_Index index )
{
if ( index->stream )
{
......@@ -1173,7 +1173,7 @@
static FT_Error
cff_explicit_index( CFF_Index* index,
cff_explicit_index( CFF_Index index,
FT_Byte*** table )
{
FT_Error error = 0;
......@@ -1205,7 +1205,7 @@
FT_LOCAL_DEF FT_Error
CFF_Access_Element( CFF_Index* index,
CFF_Access_Element( CFF_Index index,
FT_UInt element,
FT_Byte** pbytes,
FT_ULong* pbyte_len )
......@@ -1270,7 +1270,7 @@
FT_LOCAL_DEF void
CFF_Forget_Element( CFF_Index* index,
CFF_Forget_Element( CFF_Index index,
FT_Byte** pbytes )
{
if ( index->bytes == 0 )
......@@ -1284,7 +1284,7 @@
FT_LOCAL_DEF FT_String*
CFF_Get_Name( CFF_Index* index,
CFF_Get_Name( CFF_Index index,
FT_UInt element )
{
FT_Memory memory = index->stream->memory;
......@@ -1311,7 +1311,7 @@
FT_LOCAL_DEF FT_String*
CFF_Get_String( CFF_Index* index,