Hash :
d42c68e8
Author :
Date :
2000-01-27T13:56:02
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436
/*******************************************************************
*
* t1types.h 1.0
*
* Basic Type1/Type2 type definitions and interface.
*
* This code is shared by the Type1 and Type2 drivers
*
*
* Copyright 1996-2000 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.h>
#ifdef __cplusplus
extern "C" {
#endif
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*** ***/
/*** ***/
/*** DEFINITIONS OF BASIC DATA TYPES ***/
/*** ***/
/*** ***/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* The REDEFINE macro is used to convert a FreeType generic type into */
/* a TrueType-specific one. It simply replaces the "FT_" prefix by "T1_" */
/* in order to define compatible T1_Long, T1_Error, T1_Outline, etc.. */
/* */
#undef REDEFINE
#define REDEFINE( type ) typedef FT_##type T1_##type
/* <Type> T1_Bool */
/* */
/* <Description> */
/* A simple typedef of unsigned char, used for simple booleans. */
/* */
REDEFINE( Bool );
/* <Type> T1_FWord */
/* */
/* <Description> */
/* a signed 16-bit integer used to store a distance in original */
/* font units. */
/* */
REDEFINE( FWord );
/* <Type> T1_UFWord */
/* */
/* <Description> */
/* an unsigned 16-bit integer used to store a distance in original */
/* font units. */
/* */
REDEFINE( UFWord );
/* <Type> T1_Char */
/* */
/* <Description> */
/* a simple typedef for the _signed_ char type. */
/* */
REDEFINE( Char );
/* <Type> T1_Byte */
/* */
/* <Description> */
/* a simple typedef for the _unsigned_ char type. */
/* */
REDEFINE( Byte );
/* <Type> T1_String */
/* */
/* <Description> */
/* a simple typedef for the char type, used for strings usually. */
/* */
REDEFINE( String );
/* <Type> T1_Short */
/* */
/* <Description> */
/* a typedef for signed short */
/* */
REDEFINE( Short );
/* <Type> T1_UShort */
/* */
/* <Description> */
/* a typedef for unsigned short */
/* */
REDEFINE( UShort );
/* <Type> FT_Int */
/* */
/* <Description> */
/* a typedef for the int type */
/* */
REDEFINE( Int );
/* <Type> FT_UInt */
/* */
/* <Description> */
/* a typedef for the unsigned int type */
/* */
REDEFINE( UInt );
/* <Type> T1_Long */
/* */
/* <Description> */
/* a typedef for signed long */
/* */
REDEFINE( Long );
/* <Type> T1_ULong */
/* */
/* <Description> */
/* a typedef for unsigned long */
/* */
REDEFINE( ULong );
/* <Type> T1_F2Dot14 */
/* */
/* <Description> */
/* a signed 2.14 fixed float used for unit vectors */
/* */
REDEFINE( F2Dot14 );
/* <Type> T1_F26Dot6 */
/* */
/* <Description> */
/* a signed 26.6 fixed float used for vectorial pixel coordinates */
/* */
REDEFINE( F26Dot6 );
/* <Type> T1_Fixed */
/* */
/* <Description> */
/* This type is used to store 16.16 fixed float values, like */
/* scales or matrix coefficients.. */
/* */
REDEFINE( Fixed );
/* <Type> T1_Pos */
/* */
/* <Description> */
/* The type T1_Pos is a 32-bits integer used to store vectorial */
/* coordinates. Depending on the context, these can represent */
/* distances in integer font units, or 26.6 fixed float pixel */
/* coordinates.. */
/* */
REDEFINE( Pos );
/* <Struct> T1_Vector */
/* */
/* <Description> */
/* A simple structure used to store a 2d vector, coordinates */
/* are of the T1_Pos type. */
/* */
/* <Fields> */
/* x :: horizontal coordinate */
/* y :: vertical coordinate */
/* */
REDEFINE( Vector );
/* <Struct> T1_UnitVector */
/* */
/* <Description> */
/* A simple structure used to store a 2d vector unit vector. */
/* uses T1_F2Dot14 types. */
/* */
/* <Fields> */
/* x :: horizontal coordinate */
/* y :: vertical coordinate */
/* */
REDEFINE( UnitVector );
/* <Struct> T1_Matrix */
/* */
/* <Description> */
/* A simple structure used to store a 2x2 matrix. Coefficients */
/* are in 16.16 fixed float format. The computation performed */
/* is : */
/* { */
/* x' = x*xx + y*xy */
/* y' = x*yx + y*yy */
/* } */
/* */
/* <Fields> */
/* xx :: matrix coefficient */
/* xy :: matrix coefficient */
/* yx :: matrix coefficient */
/* yy :: matrix coefficient */
/* */
REDEFINE( Matrix );
/* <Struct> T1_BBox */
/* */
/* <Description> */
/* A structure used to hold an outline's bounding box, i.e. */
/* the coordinates of its extrema in the horizontal and vertical */
/* directions. */
/* */
/* <Fields> */
/* xMin :: the horizontal minimum (left-most) */
/* yMin :: the vertical minimum (bottom-most) */
/* xMax :: the horizontal maximum (right-most) */
/* yMax :: the vertical maximum (top-most) */
/* */
REDEFINE( BBox );
/* <Type> T1_Error */
/* */
/* <Description> */
/* The FreeType error code type. A value of 0 is always */
/* interpreted as a succesful operation. */
/* */
REDEFINE( Error );
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*** ***/
/*** ***/
/*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/
/*** ***/
/*** ***/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/***********************************************************************/
/* */
/* <Struct> T1_Encoding */
/* */
/* <Description> */
/* A structure modeling a custom encoding */
/* */
/* <Fields> */
/* num_chars :: number of char codes in encoding. Usually 256 */
/* code_first :: lower char code in encoding */
/* code_last :: higher char code in encoding */
/* */
/* char_code :: array of character codes */
/* char_index :: array of correpsonding glyph indices */
/* char_name :: array of correpsonding glyph names */
/* */
typedef struct T1_Encoding_
{
T1_Int num_chars;
T1_Int code_first;
T1_Int code_last;
T1_Short* char_index;
T1_String** char_name;
} T1_Encoding;
typedef enum T1_EncodingType_
{
t1_encoding_none = 0,
t1_encoding_array,
t1_encoding_standard,
t1_encoding_expert
} T1_EncodingType;
typedef struct T1_Font_
{
/* font info dictionary */
T1_String* version;
T1_String* notice;
T1_String* full_name;
T1_String* family_name;
T1_String* weight;
T1_Long italic_angle;
T1_Bool is_fixed_pitch;
T1_Short underline_position;
T1_UShort underline_thickness;
/* private dictionary */
T1_Int unique_id;
T1_Int lenIV;
T1_Byte num_blues;
T1_Byte num_other_blues;
T1_Byte num_family_blues;
T1_Byte num_family_other_blues;
T1_Short blue_values[14];
T1_Short other_blues[10];
T1_Short family_blues [14];
T1_Short family_other_blues[10];
T1_Fixed blue_scale;
T1_Int blue_shift;
T1_Int blue_fuzz;
T1_UShort standard_width;
T1_UShort standard_height;
T1_Byte num_snap_widths;
T1_Byte num_snap_heights;
T1_Bool force_bold;
T1_Bool round_stem_up;
T1_Short stem_snap_widths [13]; /* reserve one place for the std */
T1_Short stem_snap_heights[13]; /* reserve one place for the std */
T1_Long language_group;
T1_Long password;
T1_Short min_feature[2];
/* top-level dictionary */
FT_String* font_name;
T1_EncodingType encoding_type;
T1_Encoding encoding;
T1_Byte* subrs_block;
T1_Byte* charstrings_block;
T1_Byte* glyph_names_block;
T1_Int num_subrs;
T1_Byte** subrs;
T1_Int* subrs_len;
T1_Int num_glyphs;
T1_String** glyph_names; /* array of glyph names */
T1_Byte** charstrings; /* array of glyph charstrings */
T1_Int* charstrings_len;
T1_Byte paint_type;
T1_Byte font_type;
T1_Matrix font_matrix;
T1_BBox font_bbox;
T1_Long font_id;
T1_Int stroke_width;
} T1_Font;
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*** ***/
/*** ***/
/*** 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 "drivers/truetype/ttobjs.h" ***/
/*** ***/
/*** ***/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
typedef struct T1_FaceRec_* T1_Face;
/***************************************************/
/* */
/* T1_Face : */
/* */
/* Type1 face record.. */
/* */
typedef struct T1_FaceRec_
{
FT_FaceRec root;
T1_Font type1;
} T1_FaceRec;
#endif /* T1TYPES_H */