blob: 01841f0186ec4c54bee623063b3b0cb93bf8d778 [file] [log] [blame]
Werner Lembergc8f9cf32000-07-19 02:59:31 +00001/***************************************************************************/
2/* */
3/* t1types.h */
4/* */
5/* Basic Type1/Type2 type definitions and interface (specification */
6/* only). */
7/* */
8/* Copyright 1996-2000 by */
9/* David Turner, Robert Wilhelm, and Werner Lemberg. */
10/* */
11/* This file is part of the FreeType project, and may only be used, */
12/* modified, and distributed under the terms of the FreeType project */
13/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14/* this file you indicate that you have read the license and */
15/* understand and accept it fully. */
16/* */
17/***************************************************************************/
18
David Turnerd2b1f351999-12-16 23:11:37 +000019
David Turner8fba32d2000-11-30 23:12:33 +000020#ifndef __T1TYPES_H__
21#define __T1TYPES_H__
David Turnerd2b1f351999-12-16 23:11:37 +000022
Werner Lemberg90d99642000-12-09 00:45:38 +000023
24#include<ft2build.h>
25#include FT_TYPE1_TABLES_H
26#include FT_INTERNAL_POSTSCRIPT_NAMES_H
27
David Turner8fba32d2000-11-30 23:12:33 +000028
29FT_BEGIN_HEADER
Werner Lembergc713d922000-08-01 13:17:04 +000030
31
Werner Lembergc8f9cf32000-07-19 02:59:31 +000032 /*************************************************************************/
33 /*************************************************************************/
34 /*************************************************************************/
35 /*** ***/
36 /*** ***/
37 /*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/
38 /*** ***/
39 /*** ***/
40 /*************************************************************************/
41 /*************************************************************************/
42 /*************************************************************************/
David Turnerd2b1f351999-12-16 23:11:37 +000043
David Turnerd2b1f351999-12-16 23:11:37 +000044
Werner Lembergc8f9cf32000-07-19 02:59:31 +000045 /*************************************************************************/
46 /* */
47 /* <Struct> */
48 /* T1_Encoding */
49 /* */
50 /* <Description> */
Werner Lemberg4c80f0c2000-12-01 17:25:58 +000051 /* A structure modeling a custom encoding. */
Werner Lembergc8f9cf32000-07-19 02:59:31 +000052 /* */
53 /* <Fields> */
54 /* num_chars :: The number of character codes in the encoding. */
55 /* Usually 256. */
56 /* */
57 /* code_first :: The lowest valid character code in the encoding. */
58 /* */
59 /* code_last :: The highest valid character code in the encoding. */
60 /* */
61 /* char_index :: An array of corresponding glyph indices. */
62 /* */
63 /* char_name :: An array of corresponding glyph names. */
64 /* */
65 typedef struct T1_Encoding_
David Turnerd2b1f351999-12-16 23:11:37 +000066 {
Werner Lembergc8f9cf32000-07-19 02:59:31 +000067 FT_Int num_chars;
68 FT_Int code_first;
69 FT_Int code_last;
David Turnerd42c68e2000-01-27 13:56:02 +000070
Werner Lembergc8f9cf32000-07-19 02:59:31 +000071 FT_UShort* char_index;
72 FT_String** char_name;
David Turnerd42c68e2000-01-27 13:56:02 +000073
74 } T1_Encoding;
75
76
Werner Lembergc8f9cf32000-07-19 02:59:31 +000077 typedef enum T1_EncodingType_
David Turnerd42c68e2000-01-27 13:56:02 +000078 {
Werner Lemberg4e9dae62000-08-29 16:50:01 +000079 t1_encoding_none = 0,
80 t1_encoding_array,
81 t1_encoding_standard,
82 t1_encoding_expert
David Turnerd42c68e2000-01-27 13:56:02 +000083
84 } T1_EncodingType;
85
86
Werner Lembergc8f9cf32000-07-19 02:59:31 +000087 typedef struct T1_Font_
David Turnerd42c68e2000-01-27 13:56:02 +000088 {
Werner Lembergc8f9cf32000-07-19 02:59:31 +000089 /* font info dictionary */
90 T1_FontInfo font_info;
David Turnere49ab252000-05-16 23:44:38 +000091
Werner Lembergc8f9cf32000-07-19 02:59:31 +000092 /* private dictionary */
93 T1_Private private_dict;
David Turnerd2b1f351999-12-16 23:11:37 +000094
Werner Lembergc8f9cf32000-07-19 02:59:31 +000095 /* top-level dictionary */
96 FT_String* font_name;
David Turnerd2b1f351999-12-16 23:11:37 +000097
David Turnerd42c68e2000-01-27 13:56:02 +000098 T1_EncodingType encoding_type;
99 T1_Encoding encoding;
David Turnerd2b1f351999-12-16 23:11:37 +0000100
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000101 FT_Byte* subrs_block;
102 FT_Byte* charstrings_block;
103 FT_Byte* glyph_names_block;
David Turnerd2b1f351999-12-16 23:11:37 +0000104
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000105 FT_Int num_subrs;
106 FT_Byte** subrs;
107 FT_Int* subrs_len;
David Turnerd2b1f351999-12-16 23:11:37 +0000108
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000109 FT_Int num_glyphs;
110 FT_String** glyph_names; /* array of glyph names */
111 FT_Byte** charstrings; /* array of glyph charstrings */
112 FT_Int* charstrings_len;
David Turnerd2b1f351999-12-16 23:11:37 +0000113
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000114 FT_Byte paint_type;
115 FT_Byte font_type;
116 FT_Matrix font_matrix;
David Turner24d70242000-08-17 01:09:06 +0000117 FT_Vector font_offset;
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000118 FT_BBox font_bbox;
119 FT_Long font_id;
David Turnerd2b1f351999-12-16 23:11:37 +0000120
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000121 FT_Int stroke_width;
David Turnere49ab252000-05-16 23:44:38 +0000122
David Turnerd42c68e2000-01-27 13:56:02 +0000123 } T1_Font;
David Turnere49ab252000-05-16 23:44:38 +0000124
David Turnerd2b1f351999-12-16 23:11:37 +0000125
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000126 typedef struct CID_Subrs_
David Turner04aa8002000-06-01 03:27:48 +0000127 {
128 FT_UInt num_subrs;
129 FT_Byte** code;
Werner Lemberge4b32a52000-10-31 20:42:18 +0000130
David Turner04aa8002000-06-01 03:27:48 +0000131 } CID_Subrs;
132
David Turnerd2b1f351999-12-16 23:11:37 +0000133
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000134 /*************************************************************************/
135 /*************************************************************************/
136 /*************************************************************************/
137 /*** ***/
138 /*** ***/
139 /*** ORIGINAL T1_FACE CLASS DEFINITION ***/
140 /*** ***/
141 /*** ***/
142 /*************************************************************************/
143 /*************************************************************************/
144 /*************************************************************************/
David Turnerd2b1f351999-12-16 23:11:37 +0000145
146
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000147 /*************************************************************************/
148 /* */
149 /* This structure/class is defined here because it is common to the */
150 /* following formats: TTF, OpenType-TT, and OpenType-CFF. */
151 /* */
152 /* Note, however, that the classes TT_Size, TT_GlyphSlot, and TT_CharMap */
153 /* are not shared between font drivers, and are thus defined normally in */
154 /* `ttobjs.h'. */
155 /* */
156 /*************************************************************************/
157
David Turnerd2b1f351999-12-16 23:11:37 +0000158 typedef struct T1_FaceRec_* T1_Face;
David Turner04aa8002000-06-01 03:27:48 +0000159 typedef struct CID_FaceRec_* CID_Face;
David Turnerd2b1f351999-12-16 23:11:37 +0000160
David Turnerd2b1f351999-12-16 23:11:37 +0000161
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000162 typedef struct T1_FaceRec_
David Turnerd2b1f351999-12-16 23:11:37 +0000163 {
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000164 FT_FaceRec root;
165 T1_Font type1;
166 void* psnames;
David Turner97488072000-08-22 22:36:33 +0000167 void* psaux;
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000168 void* afm_data;
169 FT_CharMapRec charmaprecs[2];
170 FT_CharMap charmaps[2];
171 PS_Unicodes unicode_map;
David Turnerd2b1f351999-12-16 23:11:37 +0000172
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000173 /* support for Multiple Masters fonts */
174 T1_Blend* blend;
David Turner1c9a1ca2000-05-24 21:12:02 +0000175
David Turnerd2b1f351999-12-16 23:11:37 +0000176 } T1_FaceRec;
177
178
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000179 typedef struct CID_FaceRec_
David Turner04aa8002000-06-01 03:27:48 +0000180 {
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000181 FT_FaceRec root;
182 void* psnames;
David Turner34f1c2f2000-08-23 22:47:44 +0000183 void* psaux;
Werner Lembergc8f9cf32000-07-19 02:59:31 +0000184 CID_Info cid;
185 void* afm_data;
186 CID_Subrs* subrs;
Werner Lemberge4b32a52000-10-31 20:42:18 +0000187
David Turner04aa8002000-06-01 03:27:48 +0000188 } CID_FaceRec;
189
Werner Lembergb3880dd2000-06-27 05:58:22 +0000190
David Turner8fba32d2000-11-30 23:12:33 +0000191FT_END_HEADER
Werner Lembergc713d922000-08-01 13:17:04 +0000192
David Turner8fba32d2000-11-30 23:12:33 +0000193#endif /* __T1TYPES_H__ */
Werner Lembergb3880dd2000-06-27 05:58:22 +0000194
195
196/* END */