diff options
| author | David Boddie <david@boddie.org.uk> | 2024-02-28 01:52:58 +0100 |
|---|---|---|
| committer | David Boddie <david@boddie.org.uk> | 2024-02-28 01:52:58 +0100 |
| commit | cbd016cda002145743d87224f0a9f9068abbfc67 (patch) | |
| tree | bcfcc9b11ea078a5fa42b16f7ea98a29d112d040 /include/freetype/internal/t1types.h | |
| parent | 75323f4992b2b4e593bd2f548db9ac6897e894d3 (diff) | |
Removed libfreetype fork, replacing it with a submodule and some Inferno-specific files.
Retained the license documents and updated the header files.
Diffstat (limited to 'include/freetype/internal/t1types.h')
| -rw-r--r-- | include/freetype/internal/t1types.h | 216 |
1 files changed, 138 insertions, 78 deletions
diff --git a/include/freetype/internal/t1types.h b/include/freetype/internal/t1types.h index 26253946..be63e4dc 100644 --- a/include/freetype/internal/t1types.h +++ b/include/freetype/internal/t1types.h @@ -1,30 +1,31 @@ -/***************************************************************************/ -/* */ -/* t1types.h */ -/* */ -/* Basic Type1/Type2 type definitions and interface (specification */ -/* only). */ -/* */ -/* Copyright 1996-2001, 2002 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __T1TYPES_H__ -#define __T1TYPES_H__ - - -#include <ft2build.h> -#include FT_TYPE1_TABLES_H -#include FT_INTERNAL_POSTSCRIPT_NAMES_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H +/**************************************************************************** + * + * t1types.h + * + * Basic Type1/Type2 type definitions and interface (specification + * only). + * + * Copyright (C) 1996-2024 by + * David Turner, Robert Wilhelm, and Werner Lemberg. + * + * This file is part of the FreeType project, and may only be used, + * modified, and distributed under the terms of the FreeType project + * license, LICENSE.TXT. By continuing to use, modify, or distribute + * this file you indicate that you have read the license and + * understand and accept it fully. + * + */ + + +#ifndef T1TYPES_H_ +#define T1TYPES_H_ + + +#include <freetype/t1tables.h> +#include <freetype/internal/pshints.h> +#include <freetype/internal/ftserv.h> +#include <freetype/internal/fthash.h> +#include <freetype/internal/services/svpscmap.h> FT_BEGIN_HEADER @@ -43,54 +44,61 @@ FT_BEGIN_HEADER /*************************************************************************/ - /*************************************************************************/ - /* */ - /* <Struct> */ - /* T1_EncodingRec */ - /* */ - /* <Description> */ - /* A structure modeling a custom encoding. */ - /* */ - /* <Fields> */ - /* num_chars :: The number of character codes in the encoding. */ - /* Usually 256. */ - /* */ - /* code_first :: The lowest valid character code in the encoding. */ - /* */ - /* code_last :: The highest valid character code in the encoding. */ - /* */ - /* char_index :: An array of corresponding glyph indices. */ - /* */ - /* char_name :: An array of corresponding glyph names. */ - /* */ + /************************************************************************** + * + * @struct: + * T1_EncodingRec + * + * @description: + * A structure modeling a custom encoding. + * + * @fields: + * num_chars :: + * The number of character codes in the encoding. Usually 256. + * + * code_first :: + * The lowest valid character code in the encoding. + * + * code_last :: + * The highest valid character code in the encoding + 1. When equal to + * code_first there are no valid character codes. + * + * char_index :: + * An array of corresponding glyph indices. + * + * char_name :: + * An array of corresponding glyph names. + */ typedef struct T1_EncodingRecRec_ { FT_Int num_chars; FT_Int code_first; FT_Int code_last; - FT_UShort* char_index; - FT_String** char_name; + FT_UShort* char_index; + const FT_String** char_name; } T1_EncodingRec, *T1_Encoding; - typedef enum T1_EncodingType_ + /* used to hold extra data of PS_FontInfoRec that + * cannot be stored in the publicly defined structure. + * + * Note these can't be blended with multiple-masters. + */ + typedef struct PS_FontExtraRec_ { - T1_ENCODING_TYPE_NONE = 0, - T1_ENCODING_TYPE_ARRAY, - T1_ENCODING_TYPE_STANDARD, - T1_ENCODING_TYPE_ISOLATIN1, - T1_ENCODING_TYPE_EXPERT + FT_UShort fs_type; - } T1_EncodingType; + } PS_FontExtraRec; typedef struct T1_FontRec_ { - PS_FontInfoRec font_info; /* font info dictionary */ - PS_PrivateRec private_dict; /* private dictionary */ - FT_String* font_name; /* top-level dictionary */ + PS_FontInfoRec font_info; /* font info dictionary */ + PS_FontExtraRec font_extra; /* font info extra fields */ + PS_PrivateRec private_dict; /* private dictionary */ + FT_String* font_name; /* top-level dictionary */ T1_EncodingType encoding_type; T1_EncodingRec encoding; @@ -101,12 +109,13 @@ FT_BEGIN_HEADER FT_Int num_subrs; FT_Byte** subrs; - FT_Int* subrs_len; + FT_UInt* subrs_len; + FT_Hash subrs_hash; FT_Int num_glyphs; FT_String** glyph_names; /* array of glyph names */ FT_Byte** charstrings; /* array of glyph charstrings */ - FT_Int* charstrings_len; + FT_UInt* charstrings_len; FT_Byte paint_type; FT_Byte font_type; @@ -115,14 +124,14 @@ FT_BEGIN_HEADER FT_BBox font_bbox; FT_Long font_id; - FT_Int stroke_width; + FT_Fixed stroke_width; } T1_FontRec, *T1_Font; typedef struct CID_SubrsRec_ { - FT_UInt num_subrs; + FT_Int num_subrs; FT_Byte** code; } CID_SubrsRec, *CID_Subrs; @@ -133,25 +142,59 @@ FT_BEGIN_HEADER /*************************************************************************/ /*** ***/ /*** ***/ - /*** ORIGINAL T1_FACE CLASS DEFINITION ***/ + /*** AFM FONT INFORMATION STRUCTURES ***/ /*** ***/ /*** ***/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ + typedef struct AFM_TrackKernRec_ + { + FT_Int degree; + FT_Fixed min_ptsize; + FT_Fixed min_kern; + FT_Fixed max_ptsize; + FT_Fixed max_kern; + + } AFM_TrackKernRec, *AFM_TrackKern; + + typedef struct AFM_KernPairRec_ + { + FT_UInt index1; + FT_UInt index2; + FT_Int x; + FT_Int y; + + } AFM_KernPairRec, *AFM_KernPair; + typedef struct AFM_FontInfoRec_ + { + FT_Bool IsCIDFont; + FT_BBox FontBBox; + FT_Fixed Ascender; /* optional, mind the zero */ + FT_Fixed Descender; /* optional, mind the zero */ + AFM_TrackKern TrackKerns; /* free if non-NULL */ + FT_UInt NumTrackKern; + AFM_KernPair KernPairs; /* free if non-NULL */ + FT_UInt NumKernPair; + + } AFM_FontInfoRec, *AFM_FontInfo; + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /*** ***/ + /*** ***/ + /*** ORIGINAL T1_FACE CLASS DEFINITION ***/ + /*** ***/ + /*** ***/ + /*************************************************************************/ /*************************************************************************/ - /* */ - /* This structure/class is defined here because it is common to the */ - /* following formats: TTF, OpenType-TT, and OpenType-CFF. */ - /* */ - /* Note, however, that the classes TT_Size, TT_GlyphSlot, and TT_CharMap */ - /* are not shared between font drivers, and are thus defined normally in */ - /* `ttobjs.h'. */ - /* */ /*************************************************************************/ + typedef struct T1_FaceRec_* T1_Face; typedef struct CID_FaceRec_* CID_Face; @@ -165,12 +208,22 @@ FT_BEGIN_HEADER const void* afm_data; FT_CharMapRec charmaprecs[2]; FT_CharMap charmaps[2]; - PS_Unicodes unicode_map; /* support for Multiple Masters fonts */ PS_Blend blend; - - /* since FT 2.1 - interface to PostScript hinter */ + + /* undocumented, optional: indices of subroutines that express */ + /* the NormalizeDesignVector and the ConvertDesignVector procedure, */ + /* respectively, as Type 2 charstrings; -1 if keywords not present */ + FT_Int ndv_idx; + FT_Int cdv_idx; + + /* undocumented, optional: has the same meaning as len_buildchar */ + /* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25 */ + FT_UInt len_buildchar; + FT_Long* buildchar; + + /* since version 2.1 - interface to PostScript hinter */ const void* pshinter; } T1_FaceRec; @@ -182,18 +235,25 @@ FT_BEGIN_HEADER void* psnames; void* psaux; CID_FaceInfoRec cid; + PS_FontExtraRec font_extra; +#if 0 void* afm_data; +#endif CID_Subrs subrs; - - /* since FT 2.1 - interface to PostScript hinter */ + + /* since version 2.1 - interface to PostScript hinter */ void* pshinter; + /* since version 2.1.8, but was originally positioned after `afm_data' */ + FT_Byte* binary_data; /* used if hex data has been converted */ + FT_Stream cid_stream; + } CID_FaceRec; FT_END_HEADER -#endif /* __T1TYPES_H__ */ +#endif /* T1TYPES_H_ */ /* END */ |
