2000-12-13 20:55:11 +01:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* cfftypes.h */
|
|
|
|
/* */
|
|
|
|
/* Basic OpenType/CFF type definitions and interface (specification */
|
|
|
|
/* only). */
|
|
|
|
/* */
|
Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.
* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.
* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.
* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 11:12:50 +02:00
|
|
|
/* Copyright 1996-2001, 2002, 2003 by */
|
2000-12-13 20:55:11 +01:00
|
|
|
/* 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 __CFFTYPES_H__
|
|
|
|
#define __CFFTYPES_H__
|
|
|
|
|
2000-12-14 00:44:37 +01:00
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_FREETYPE_H
|
|
|
|
|
2000-12-13 20:55:11 +01:00
|
|
|
|
|
|
|
FT_BEGIN_HEADER
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
2002-03-30 00:23:28 +01:00
|
|
|
/* CFF_IndexRec */
|
2000-12-13 20:55:11 +01:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure used to model a CFF Index table. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
2001-01-03 01:27:46 +01:00
|
|
|
/* stream :: The source input stream. */
|
2000-12-13 20:55:11 +01:00
|
|
|
/* */
|
|
|
|
/* count :: The number of elements in the index. */
|
|
|
|
/* */
|
|
|
|
/* off_size :: The size in bytes of object offsets in index. */
|
|
|
|
/* */
|
|
|
|
/* data_offset :: The position of first data byte in the index's */
|
|
|
|
/* bytes. */
|
|
|
|
/* */
|
2001-01-03 01:27:46 +01:00
|
|
|
/* offsets :: A table of element offsets in the index. */
|
2000-12-13 20:55:11 +01:00
|
|
|
/* */
|
|
|
|
/* bytes :: If the index is loaded in memory, its bytes. */
|
|
|
|
/* */
|
2002-02-28 19:59:37 +01:00
|
|
|
typedef struct CFF_IndexRec_
|
2000-12-13 20:55:11 +01:00
|
|
|
{
|
|
|
|
FT_Stream stream;
|
|
|
|
FT_UInt count;
|
|
|
|
FT_Byte off_size;
|
|
|
|
FT_ULong data_offset;
|
|
|
|
|
|
|
|
FT_ULong* offsets;
|
|
|
|
FT_Byte* bytes;
|
|
|
|
|
2002-02-28 19:59:37 +01:00
|
|
|
} CFF_IndexRec, *CFF_Index;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
|
|
|
|
2002-02-28 19:59:37 +01:00
|
|
|
typedef struct CFF_EncodingRec_
|
2000-12-13 20:55:11 +01:00
|
|
|
{
|
2000-12-30 02:13:07 +01:00
|
|
|
FT_UInt format;
|
|
|
|
FT_ULong offset;
|
2001-06-28 19:49:10 +02:00
|
|
|
|
* src/cff/cffcmap.c, src/cff/cffcmap.h, Jamfile, rules.mk: new files added
to support charmaps for CFF fonts
* src/cff/cffload.c, src/cff/cffload.h, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/cff/cffparse.c, src/cffparse.h, src/cff/cffgload.c,
src/cff/cffgload.h: adding support for CFF charmaps, reformatting the
sources, and removing some bugs in the Encoding and Charset loaders
2002-07-10 18:52:06 +02:00
|
|
|
FT_UInt count;
|
|
|
|
FT_UShort sids [256]; /* avoid dynamic allocations */
|
|
|
|
FT_UShort codes[256];
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2002-02-28 19:59:37 +01:00
|
|
|
} CFF_EncodingRec, *CFF_Encoding;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
2000-12-30 02:13:07 +01:00
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
typedef struct CFF_CharsetRec_
|
2000-12-13 20:55:11 +01:00
|
|
|
{
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2000-12-30 02:13:07 +01:00
|
|
|
FT_UInt format;
|
|
|
|
FT_ULong offset;
|
|
|
|
|
|
|
|
FT_UShort* sids;
|
2003-12-12 16:38:39 +01:00
|
|
|
FT_UShort* cids; /* the inverse mapping of `sids'; only needed */
|
|
|
|
/* for CID-keyed fonts */
|
2002-03-14 09:57:10 +01:00
|
|
|
} CFF_CharsetRec, *CFF_Charset;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
typedef struct CFF_FontRecDictRec_
|
2000-12-13 20:55:11 +01:00
|
|
|
{
|
|
|
|
FT_UInt version;
|
|
|
|
FT_UInt notice;
|
|
|
|
FT_UInt copyright;
|
|
|
|
FT_UInt full_name;
|
|
|
|
FT_UInt family_name;
|
|
|
|
FT_UInt weight;
|
|
|
|
FT_Bool is_fixed_pitch;
|
|
|
|
FT_Fixed italic_angle;
|
Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.
* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.
* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.
* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers. Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.
* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.
* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 11:12:50 +02:00
|
|
|
FT_Fixed underline_position;
|
|
|
|
FT_Fixed underline_thickness;
|
2000-12-13 20:55:11 +01:00
|
|
|
FT_Int paint_type;
|
|
|
|
FT_Int charstring_type;
|
|
|
|
FT_Matrix font_matrix;
|
2001-02-07 02:13:21 +01:00
|
|
|
FT_UShort units_per_em;
|
2000-12-13 20:55:11 +01:00
|
|
|
FT_Vector font_offset;
|
|
|
|
FT_ULong unique_id;
|
|
|
|
FT_BBox font_bbox;
|
|
|
|
FT_Pos stroke_width;
|
|
|
|
FT_ULong charset_offset;
|
|
|
|
FT_ULong encoding_offset;
|
|
|
|
FT_ULong charstrings_offset;
|
|
|
|
FT_ULong private_offset;
|
|
|
|
FT_ULong private_size;
|
|
|
|
FT_Long synthetic_base;
|
|
|
|
FT_UInt embedded_postscript;
|
|
|
|
|
|
|
|
/* these should only be used for the top-level font dictionary */
|
|
|
|
FT_UInt cid_registry;
|
|
|
|
FT_UInt cid_ordering;
|
|
|
|
FT_ULong cid_supplement;
|
|
|
|
|
|
|
|
FT_Long cid_font_version;
|
|
|
|
FT_Long cid_font_revision;
|
|
|
|
FT_Long cid_font_type;
|
2003-12-18 09:18:37 +01:00
|
|
|
FT_ULong cid_count;
|
2000-12-13 20:55:11 +01:00
|
|
|
FT_ULong cid_uid_base;
|
|
|
|
FT_ULong cid_fd_array_offset;
|
|
|
|
FT_ULong cid_fd_select_offset;
|
|
|
|
FT_UInt cid_font_name;
|
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
} CFF_FontRecDictRec, *CFF_FontRecDict;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
|
|
|
|
2002-02-28 19:59:37 +01:00
|
|
|
typedef struct CFF_PrivateRec_
|
2000-12-13 20:55:11 +01:00
|
|
|
{
|
|
|
|
FT_Byte num_blue_values;
|
|
|
|
FT_Byte num_other_blues;
|
|
|
|
FT_Byte num_family_blues;
|
|
|
|
FT_Byte num_family_other_blues;
|
|
|
|
|
|
|
|
FT_Pos blue_values[14];
|
|
|
|
FT_Pos other_blues[10];
|
|
|
|
FT_Pos family_blues[14];
|
|
|
|
FT_Pos family_other_blues[10];
|
|
|
|
|
|
|
|
FT_Fixed blue_scale;
|
|
|
|
FT_Pos blue_shift;
|
|
|
|
FT_Pos blue_fuzz;
|
|
|
|
FT_Pos standard_width;
|
|
|
|
FT_Pos standard_height;
|
|
|
|
|
|
|
|
FT_Byte num_snap_widths;
|
|
|
|
FT_Byte num_snap_heights;
|
|
|
|
FT_Pos snap_widths[13];
|
|
|
|
FT_Pos snap_heights[13];
|
|
|
|
FT_Bool force_bold;
|
|
|
|
FT_Fixed force_bold_threshold;
|
|
|
|
FT_Int lenIV;
|
|
|
|
FT_Int language_group;
|
|
|
|
FT_Fixed expansion_factor;
|
|
|
|
FT_Long initial_random_seed;
|
|
|
|
FT_ULong local_subrs_offset;
|
|
|
|
FT_Pos default_width;
|
|
|
|
FT_Pos nominal_width;
|
|
|
|
|
2002-02-28 19:59:37 +01:00
|
|
|
} CFF_PrivateRec, *CFF_Private;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
typedef struct CFF_FDSelectRec_
|
2000-12-13 20:55:11 +01:00
|
|
|
{
|
|
|
|
FT_Byte format;
|
|
|
|
FT_UInt range_count;
|
|
|
|
|
|
|
|
/* that's the table, taken from the file `as is' */
|
|
|
|
FT_Byte* data;
|
|
|
|
FT_UInt data_size;
|
|
|
|
|
|
|
|
/* small cache for format 3 only */
|
|
|
|
FT_UInt cache_first;
|
|
|
|
FT_UInt cache_count;
|
|
|
|
FT_Byte cache_fd;
|
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
} CFF_FDSelectRec, *CFF_FDSelect;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* A SubFont packs a font dict and a private dict together. They are */
|
|
|
|
/* needed to support CID-keyed CFF fonts. */
|
2002-03-14 09:57:10 +01:00
|
|
|
typedef struct CFF_SubFontRec_
|
2000-12-13 20:55:11 +01:00
|
|
|
{
|
2002-03-14 09:57:10 +01:00
|
|
|
CFF_FontRecDictRec font_dict;
|
2002-03-30 00:23:28 +01:00
|
|
|
CFF_PrivateRec private_dict;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
CFF_IndexRec local_subrs_index;
|
|
|
|
FT_UInt num_local_subrs;
|
|
|
|
FT_Byte** local_subrs;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
} CFF_SubFontRec, *CFF_SubFont;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* maximum number of sub-fonts in a CID-keyed file */
|
|
|
|
#define CFF_MAX_CID_FONTS 16
|
|
|
|
|
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
typedef struct CFF_FontRec_
|
2000-12-13 20:55:11 +01:00
|
|
|
{
|
2002-03-14 09:57:10 +01:00
|
|
|
FT_Stream stream;
|
|
|
|
FT_Memory memory;
|
|
|
|
FT_UInt num_faces;
|
|
|
|
FT_UInt num_glyphs;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
FT_Byte version_major;
|
|
|
|
FT_Byte version_minor;
|
|
|
|
FT_Byte header_size;
|
|
|
|
FT_Byte absolute_offsize;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
CFF_IndexRec name_index;
|
|
|
|
CFF_IndexRec top_dict_index;
|
|
|
|
CFF_IndexRec string_index;
|
|
|
|
CFF_IndexRec global_subrs_index;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
CFF_EncodingRec encoding;
|
|
|
|
CFF_CharsetRec charset;
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
CFF_IndexRec charstrings_index;
|
|
|
|
CFF_IndexRec font_dict_index;
|
|
|
|
CFF_IndexRec private_index;
|
|
|
|
CFF_IndexRec local_subrs_index;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
FT_String* font_name;
|
|
|
|
FT_UInt num_global_subrs;
|
|
|
|
FT_Byte** global_subrs;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
CFF_SubFontRec top_font;
|
|
|
|
FT_UInt num_subfonts;
|
|
|
|
CFF_SubFont subfonts[CFF_MAX_CID_FONTS];
|
2000-12-13 20:55:11 +01:00
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
CFF_FDSelectRec fd_select;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
2001-12-20 14:14:18 +01:00
|
|
|
/* interface to PostScript hinter */
|
2002-03-14 09:57:10 +01:00
|
|
|
void* pshinter;
|
2001-12-20 14:14:18 +01:00
|
|
|
|
* src/cff/cffcmap.c, src/cff/cffcmap.h, Jamfile, rules.mk: new files added
to support charmaps for CFF fonts
* src/cff/cffload.c, src/cff/cffload.h, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/cff/cffparse.c, src/cffparse.h, src/cff/cffgload.c,
src/cff/cffgload.h: adding support for CFF charmaps, reformatting the
sources, and removing some bugs in the Encoding and Charset loaders
2002-07-10 18:52:06 +02:00
|
|
|
/* interface to Postscript Names service */
|
|
|
|
void* psnames;
|
|
|
|
|
2002-03-14 09:57:10 +01:00
|
|
|
} CFF_FontRec, *CFF_Font;
|
2000-12-13 20:55:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
FT_END_HEADER
|
|
|
|
|
|
|
|
#endif /* __CFFTYPES_H__ */
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|