1999-12-17 00:11:37 +01:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* tttypes.h */
|
|
|
|
/* */
|
|
|
|
/* Basic SFNT/TrueType type definitions and interface (specification */
|
|
|
|
/* only). */
|
|
|
|
/* */
|
2000-01-07 15:07:21 +01:00
|
|
|
/* Copyright 1996-2000 by */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* This file is part of the FreeType project, and may only be used, */
|
|
|
|
/* modified, and distributed under the terms of the FreeType project */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* 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 TTTYPES_H
|
|
|
|
#define TTTYPES_H
|
|
|
|
|
|
|
|
|
2000-05-11 20:23:52 +02:00
|
|
|
#include <freetype/tttables.h>
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
2000-08-01 15:17:04 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*** ***/
|
|
|
|
/*** ***/
|
|
|
|
/*** REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/
|
|
|
|
/*** ***/
|
|
|
|
/*** ***/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TTC_Header */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* TrueType collection header. This table contains the offsets of */
|
|
|
|
/* the font headers of each distinct TrueType face in the file. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* tag :: Must be `ttc ' to indicate a TrueType collection. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* version :: The version number. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* count :: The number of faces in the collection. The */
|
|
|
|
/* specification says this should be an unsigned long, but */
|
|
|
|
/* we use a signed long since we need the value -1 for */
|
|
|
|
/* specific purposes. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* offsets :: The offsets of the font headers, one per face. */
|
|
|
|
/* */
|
|
|
|
typedef struct TTC_Header_
|
|
|
|
{
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_ULong tag;
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Fixed version;
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_Long count;
|
|
|
|
FT_ULong* offsets;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TTC_Header;
|
|
|
|
|
|
|
|
|
2000-05-29 22:37:41 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* SFNT_Header */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* SFNT file format header. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* format_tag :: The font format tag. */
|
|
|
|
/* */
|
|
|
|
/* num_tables :: The number of tables in file. */
|
|
|
|
/* */
|
|
|
|
/* search_range :: Must be 16*(max power of 2 <= num_tables). */
|
|
|
|
/* */
|
|
|
|
/* entry_selector :: Must be log2 of search_range/16. */
|
|
|
|
/* */
|
|
|
|
/* range_shift :: Must be num_tables*16 - search_range. */
|
2000-05-29 22:37:41 +02:00
|
|
|
/* */
|
|
|
|
typedef struct SFNT_Header_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_ULong format_tag;
|
|
|
|
FT_UShort num_tables;
|
|
|
|
FT_UShort search_range;
|
|
|
|
FT_UShort entry_selector;
|
|
|
|
FT_UShort range_shift;
|
2000-05-29 22:37:41 +02:00
|
|
|
|
|
|
|
} SFNT_Header;
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_TableDir */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* This structure models a TrueType table directory. It is used to */
|
|
|
|
/* access the various tables of the font face. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* version :: The version number; starts with 0x00010000. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* numTables :: The number of tables. */
|
|
|
|
/* */
|
|
|
|
/* searchRange :: Unused. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* entrySelector :: Unused. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* rangeShift :: Unused. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* This structure is only used during font opening. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_TableDir_
|
|
|
|
{
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_Fixed version; /* should be 0x10000 */
|
|
|
|
FT_UShort numTables; /* number of tables */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort searchRange; /* These parameters are only used */
|
|
|
|
FT_UShort entrySelector; /* for a dichotomy search in the */
|
|
|
|
FT_UShort rangeShift; /* directory. We ignore them. */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_TableDir;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_Table */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* This structure describes a given table of a TrueType font. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* Tag :: A four-bytes tag describing the table. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* CheckSum :: The table checksum. This value can be ignored. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* Offset :: The offset of the table from the start of the TrueType */
|
|
|
|
/* font in its resource. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* Length :: The table length (in bytes). */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_Table_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_ULong Tag; /* table type */
|
|
|
|
FT_ULong CheckSum; /* table checksum */
|
|
|
|
FT_ULong Offset; /* table file offset */
|
|
|
|
FT_ULong Length; /* table length */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_Table;
|
|
|
|
|
|
|
|
|
2000-05-02 12:59:01 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_CMapDir */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* This structure describes the directory of the `cmap' table, */
|
|
|
|
/* containing the font's character mappings table. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* tableVersionNumber :: The version number. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
2000-05-02 12:59:01 +02:00
|
|
|
/* numCMaps :: The number of charmaps in the font. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* This structure is only used during font loading. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_CMapDir_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort tableVersionNumber;
|
|
|
|
FT_UShort numCMaps;
|
2000-05-02 12:59:01 +02:00
|
|
|
|
|
|
|
} TT_CMapDir;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_CMapDirEntry */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* This structure describes a charmap in a TrueType font. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* platformID :: An ID used to specify for which platform this */
|
|
|
|
/* charmap is defined (FreeType manages all platforms). */
|
|
|
|
/* */
|
|
|
|
/* encodingID :: A platform-specific ID used to indicate which source */
|
|
|
|
/* encoding is used in this charmap. */
|
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* offset :: The offset of the charmap relative to the start of */
|
2000-05-02 12:59:01 +02:00
|
|
|
/* the `cmap' table. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* This structure is only used during font loading. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_CMapDirEntry_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort platformID;
|
|
|
|
FT_UShort platformEncodingID;
|
|
|
|
FT_Long offset;
|
2000-05-02 12:59:01 +02:00
|
|
|
|
|
|
|
} TT_CMapDirEntry;
|
|
|
|
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_LongMetrics */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure modeling the long metrics of the `hmtx' and `vmtx' */
|
|
|
|
/* TrueType tables. The values are expressed in font units. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* advance :: The advance width or height for the glyph. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* bearing :: The left-side or top-side bearing for the glyph. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_LongMetrics_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort advance;
|
|
|
|
FT_Short bearing;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_LongMetrics;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> TT_ShortMetrics */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A simple type to model the short metrics of the `hmtx' and `vmtx' */
|
|
|
|
/* tables. */
|
|
|
|
/* */
|
2000-06-16 21:34:52 +02:00
|
|
|
typedef FT_Short TT_ShortMetrics;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_NameRec */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure modeling TrueType name records. Name records are used */
|
|
|
|
/* to store important strings like family name, style name, */
|
|
|
|
/* copyright, etc. in _localized_ versions (i.e., language, encoding, */
|
|
|
|
/* etc). */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* platformID :: The ID of the name's encoding platform. */
|
|
|
|
/* */
|
|
|
|
/* encodingID :: The platform-specific ID for the name's encoding. */
|
|
|
|
/* */
|
|
|
|
/* languageID :: The platform-specific ID for the name's language. */
|
|
|
|
/* */
|
|
|
|
/* nameID :: The ID specifying what kind of name this is. */
|
|
|
|
/* */
|
|
|
|
/* stringLength :: The length of the string in bytes. */
|
|
|
|
/* */
|
|
|
|
/* stringOffset :: The offset to the string in the `name' table. */
|
|
|
|
/* */
|
|
|
|
/* string :: A pointer to the string's bytes. Note that these */
|
|
|
|
/* are usually UTF-16 encoded characters. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_NameRec_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort platformID;
|
|
|
|
FT_UShort encodingID;
|
|
|
|
FT_UShort languageID;
|
|
|
|
FT_UShort nameID;
|
|
|
|
FT_UShort stringLength;
|
|
|
|
FT_UShort stringOffset;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
/* this last field is not defined in the spec */
|
|
|
|
/* but used by the FreeType engine */
|
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Byte* string;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_NameRec;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_NameTable */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure modeling the TrueType name table. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* format :: The format of the name table. */
|
|
|
|
/* */
|
|
|
|
/* numNameRecords :: The number of names in table. */
|
|
|
|
/* */
|
|
|
|
/* storageOffset :: The offset of the name table in the `name' */
|
|
|
|
/* TrueType table. */
|
|
|
|
/* */
|
|
|
|
/* names :: An array of name records. */
|
|
|
|
/* */
|
|
|
|
/* storage :: The names storage area. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_NameTable_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort format;
|
|
|
|
FT_UShort numNameRecords;
|
|
|
|
FT_UShort storageOffset;
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_NameRec* names;
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Byte* storage;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_NameTable;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*** ***/
|
|
|
|
/*** ***/
|
|
|
|
/*** OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/
|
|
|
|
/*** ***/
|
|
|
|
/*** ***/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_GaspRange */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A tiny structure used to model a gasp range according to the */
|
|
|
|
/* TrueType specification. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* maxPPEM :: The maximum ppem value to which `gaspFlag' applies. */
|
|
|
|
/* */
|
|
|
|
/* gaspFlag :: A flag describing the grid-fitting and anti-aliasing */
|
|
|
|
/* modes to be used. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_GaspRange_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort maxPPEM;
|
|
|
|
FT_UShort gaspFlag;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_GaspRange;
|
|
|
|
|
|
|
|
|
|
|
|
#define TT_GASP_GRIDFIT 0x01
|
|
|
|
#define TT_GASP_DOGRAY 0x02
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_Gasp */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure modeling the TrueType `gasp' table used to specify */
|
|
|
|
/* grid-fitting and anti-aliasing behaviour. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* version :: The version number. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* numRanges :: The number of gasp ranges in table. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* gaspRanges :: An array of gasp ranges. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_Gasp_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort version;
|
|
|
|
FT_UShort numRanges;
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_GaspRange* gaspRanges;
|
|
|
|
|
|
|
|
} TT_Gasp;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_HdmxRec */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A small structure used to model the pre-computed widths of a given */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* size. They are found in the `hdmx' table. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* ppem :: The pixels per EM value at which these metrics apply. */
|
|
|
|
/* */
|
|
|
|
/* max_width :: The maximum advance width for this metric. */
|
|
|
|
/* */
|
|
|
|
/* widths :: An array of widths. Note: These are 8-bit bytes. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_HdmxRec_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Byte ppem;
|
|
|
|
FT_Byte max_width;
|
|
|
|
FT_Byte* widths;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_HdmxRec;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* TT_Hdmx */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure used to model the `hdmx' table, which contains */
|
|
|
|
/* pre-computed widths for a set of given sizes/dimensions. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* version :: The version number. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* num_records :: The number of hdmx records. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* records :: An array of hdmx records. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_Hdmx_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort version;
|
|
|
|
FT_Short num_records;
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_HdmxRec* records;
|
|
|
|
|
|
|
|
} TT_Hdmx;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_Kern_0_Pair */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure used to model a kerning pair for the kerning table */
|
|
|
|
/* format 0. The engine now loads this table if it finds one in the */
|
|
|
|
/* font file. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* left :: The index of the left glyph in pair. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* right :: The index of the right glyph in pair. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* value :: The kerning distance. A positive value spaces the */
|
|
|
|
/* glyphs, a negative one makes them closer. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_Kern_0_Pair_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort left; /* index of left glyph in pair */
|
|
|
|
FT_UShort right; /* index of right glyph in pair */
|
|
|
|
FT_FWord value; /* kerning value */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_Kern_0_Pair;
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*** ***/
|
|
|
|
/*** ***/
|
2000-07-19 08:25:56 +02:00
|
|
|
/*** EMBEDDED BITMAPS SUPPORT ***/
|
1999-12-17 00:11:37 +01:00
|
|
|
/*** ***/
|
|
|
|
/*** ***/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_SBit_Metrics */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure used to hold the big metrics of a given glyph bitmap */
|
|
|
|
/* in a TrueType or OpenType font. These are usually found in the */
|
|
|
|
/* `EBDT' (Microsoft) or `bdat' (Apple) table. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* height :: The glyph height in pixels. */
|
|
|
|
/* */
|
|
|
|
/* width :: The glyph width in pixels. */
|
|
|
|
/* */
|
|
|
|
/* horiBearingX :: The horizontal left bearing. */
|
|
|
|
/* */
|
|
|
|
/* horiBearingY :: The horizontal top bearing. */
|
|
|
|
/* */
|
|
|
|
/* horiAdvance :: The horizontal advance. */
|
|
|
|
/* */
|
|
|
|
/* vertBearingX :: The vertical left bearing. */
|
|
|
|
/* */
|
|
|
|
/* vertBearingY :: The vertical top bearing. */
|
|
|
|
/* */
|
|
|
|
/* vertAdvance :: The vertical advance. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_SBit_Metrics_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Byte height;
|
|
|
|
FT_Byte width;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Char horiBearingX;
|
|
|
|
FT_Char horiBearingY;
|
|
|
|
FT_Byte horiAdvance;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Char vertBearingX;
|
|
|
|
FT_Char vertBearingY;
|
|
|
|
FT_Byte vertAdvance;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_SBit_Metrics;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_SBit_Small_Metrics */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure used to hold the small metrics of a given glyph bitmap */
|
|
|
|
/* in a TrueType or OpenType font. These are usually found in the */
|
|
|
|
/* `EBDT' (Microsoft) or the `bdat' (Apple) table. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* height :: The glyph height in pixels. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* width :: The glyph width in pixels. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* bearingX :: The left-side bearing. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* bearingY :: The top-side bearing. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* advance :: The advance width or height. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
typedef struct TT_SBit_Small_Metrics_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Byte height;
|
|
|
|
FT_Byte width;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Char bearingX;
|
|
|
|
FT_Char bearingY;
|
|
|
|
FT_Byte advance;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_SBit_Small_Metrics;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_SBit_Line_Metrics */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure used to describe the text line metrics of a given */
|
|
|
|
/* bitmap strike, for either a horizontal or vertical layout. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* ascender :: The ascender in pixels. */
|
|
|
|
/* */
|
|
|
|
/* descender :: The descender in pixels. */
|
|
|
|
/* */
|
|
|
|
/* max_width :: The maximum glyph width in pixels. */
|
|
|
|
/* */
|
|
|
|
/* caret_slope_enumerator :: Rise of the caret slope, typically set */
|
|
|
|
/* to 1 for non-italic fonts. */
|
|
|
|
/* */
|
|
|
|
/* caret_slope_denominator :: Rise of the caret slope, typically set */
|
|
|
|
/* to 0 for non-italic fonts. */
|
|
|
|
/* */
|
|
|
|
/* caret_offset :: Offset in pixels to move the caret for */
|
|
|
|
/* proper positioning. */
|
|
|
|
/* */
|
|
|
|
/* min_origin_SB :: Minimum of horiBearingX (resp. */
|
|
|
|
/* vertBearingY). */
|
|
|
|
/* min_advance_SB :: Minimum of */
|
|
|
|
/* */
|
|
|
|
/* horizontal advance - */
|
|
|
|
/* ( horiBearingX + width ) */
|
|
|
|
/* */
|
|
|
|
/* resp. */
|
|
|
|
/* */
|
|
|
|
/* vertical advance - */
|
|
|
|
/* ( vertBearingY + height ) */
|
|
|
|
/* */
|
|
|
|
/* max_before_BL :: Maximum of horiBearingY (resp. */
|
|
|
|
/* vertBearingY). */
|
|
|
|
/* */
|
|
|
|
/* min_after_BL :: Minimum of */
|
|
|
|
/* */
|
|
|
|
/* horiBearingY - height */
|
|
|
|
/* */
|
|
|
|
/* resp. */
|
|
|
|
/* */
|
|
|
|
/* vertBearingX - width */
|
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* pads :: Unused (to make the size of the record */
|
|
|
|
/* a multiple of 32 bits. */
|
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
typedef struct TT_SBit_Line_Metrics_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Char ascender;
|
|
|
|
FT_Char descender;
|
|
|
|
FT_Byte max_width;
|
|
|
|
FT_Char caret_slope_numerator;
|
|
|
|
FT_Char caret_slope_denominator;
|
|
|
|
FT_Char caret_offset;
|
|
|
|
FT_Char min_origin_SB;
|
|
|
|
FT_Char min_advance_SB;
|
|
|
|
FT_Char max_before_BL;
|
|
|
|
FT_Char min_after_BL;
|
|
|
|
FT_Char pads[2];
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_SBit_Line_Metrics;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_SBit_Range */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A TrueType/OpenType subIndexTable as defined in the `EBLC' */
|
|
|
|
/* (Microsoft) or `bloc' (Apple) tables. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* first_glyph :: The first glyph index in the range. */
|
|
|
|
/* */
|
|
|
|
/* last_glyph :: The last glyph index in the range. */
|
|
|
|
/* */
|
|
|
|
/* index_format :: The format of index table. Valid values are 1 */
|
|
|
|
/* to 5. */
|
|
|
|
/* */
|
|
|
|
/* image_format :: The format of `EBDT' image data. */
|
|
|
|
/* */
|
|
|
|
/* image_offset :: The offset to image data in `EBDT'. */
|
|
|
|
/* */
|
|
|
|
/* image_size :: For index formats 2 and 5. This is the size in */
|
|
|
|
/* bytes of each glyph bitmap. */
|
|
|
|
/* */
|
|
|
|
/* big_metrics :: For index formats 2 and 5. This is the big */
|
|
|
|
/* metrics for each glyph bitmap. */
|
|
|
|
/* */
|
|
|
|
/* num_glyphs :: For index formats 4 and 5. This is the number of */
|
|
|
|
/* glyphs in the code array. */
|
|
|
|
/* */
|
|
|
|
/* glyph_offsets :: For index formats 1 and 3. */
|
|
|
|
/* */
|
|
|
|
/* glyph_codes :: For index formats 4 and 5. */
|
|
|
|
/* */
|
|
|
|
/* table_offset :: The offset of the index table in the `EBLC' */
|
|
|
|
/* table. Only used during strike loading. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_SBit_Range
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort first_glyph;
|
|
|
|
FT_UShort last_glyph;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort index_format;
|
|
|
|
FT_UShort image_format;
|
|
|
|
FT_ULong image_offset;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_ULong image_size;
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_SBit_Metrics metrics;
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_ULong num_glyphs;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_ULong* glyph_offsets;
|
|
|
|
FT_UShort* glyph_codes;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_ULong table_offset;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_SBit_Range;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_SBit_Strike */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure used describe a given bitmap strike in the `EBLC' */
|
|
|
|
/* (Microsoft) or `bloc' (Apple) tables. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* num_index_ranges :: The number of index ranges. */
|
|
|
|
/* */
|
|
|
|
/* index_ranges :: An array of glyph index ranges. */
|
|
|
|
/* */
|
|
|
|
/* color_ref :: Unused. A color reference? */
|
|
|
|
/* */
|
|
|
|
/* hori :: The line metrics for horizontal layouts. */
|
|
|
|
/* */
|
|
|
|
/* vert :: The line metrics for vertical layouts. */
|
|
|
|
/* */
|
|
|
|
/* start_glyph :: The lowest glyph index for this strike. */
|
|
|
|
/* */
|
|
|
|
/* end_glyph :: The highest glyph index for this strike. */
|
|
|
|
/* */
|
|
|
|
/* x_ppem :: The number of horizontal pixels per EM. */
|
|
|
|
/* */
|
|
|
|
/* y_ppem :: The number of vertical pixels per EM. */
|
|
|
|
/* */
|
|
|
|
/* bit_depth :: The bit depth. Valid values are 1, 2, 4, */
|
|
|
|
/* and 8. */
|
|
|
|
/* */
|
|
|
|
/* flags :: Is this a vertical or horizontal strike? */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_SBit_Strike_
|
|
|
|
{
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_Int num_ranges;
|
|
|
|
TT_SBit_Range* sbit_ranges;
|
|
|
|
FT_ULong ranges_offset;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_ULong color_ref;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
TT_SBit_Line_Metrics hori;
|
|
|
|
TT_SBit_Line_Metrics vert;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_UShort start_glyph;
|
|
|
|
FT_UShort end_glyph;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_Byte x_ppem;
|
|
|
|
FT_Byte y_ppem;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_Byte bit_depth;
|
|
|
|
FT_Char flags;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_SBit_Strike;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_SBit_Component */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A simple structure to describe a compound sbit element. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* glyph_code :: The element's glyph index. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* x_offset :: The element's left bearing. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* y_offset :: The element's top bearing. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_SBit_Component_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort glyph_code;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Char x_offset;
|
|
|
|
FT_Char y_offset;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_SBit_Component;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_SBit_Scale */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure used describe a given bitmap scaling table, as defined */
|
|
|
|
/* in the `EBSC' table. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* hori :: The horizontal line metrics. */
|
|
|
|
/* */
|
|
|
|
/* vert :: The vertical line metrics. */
|
|
|
|
/* */
|
|
|
|
/* x_ppem :: The number of horizontal pixels per EM. */
|
|
|
|
/* */
|
|
|
|
/* y_ppem :: The number of vertical pixels per EM. */
|
|
|
|
/* */
|
|
|
|
/* x_ppem_substitute :: Substitution x_ppem value. */
|
|
|
|
/* */
|
|
|
|
/* y_ppem_substitute :: Substitution y_ppem value. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_SBit_Scale_
|
|
|
|
{
|
|
|
|
TT_SBit_Line_Metrics hori;
|
|
|
|
TT_SBit_Line_Metrics vert;
|
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Byte x_ppem;
|
|
|
|
FT_Byte y_ppem;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Byte x_ppem_substitute;
|
|
|
|
FT_Byte y_ppem_substitute;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_SBit_Scale;
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*** ***/
|
|
|
|
/*** ***/
|
|
|
|
/*** POSTSCRIPT GLYPH NAMES SUPPORT ***/
|
|
|
|
/*** ***/
|
|
|
|
/*** ***/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_Post_20 */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Postscript names sub-table, format 2.0. Stores the PS name of */
|
|
|
|
/* each glyph in the font face. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* num_glyphs :: The number of named glyphs in the table. */
|
|
|
|
/* */
|
|
|
|
/* num_names :: The number of PS names stored in the table. */
|
|
|
|
/* */
|
|
|
|
/* glyph_indices :: The indices of the glyphs in the names arrays. */
|
|
|
|
/* */
|
|
|
|
/* glyph_names :: The PS names not in Mac Encoding. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_Post_20_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort num_glyphs;
|
|
|
|
FT_UShort num_names;
|
|
|
|
FT_UShort* glyph_indices;
|
|
|
|
FT_Char** glyph_names;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_Post_20;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_Post_25 */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Postscript names sub-table, format 2.5. Stores the PS name of */
|
|
|
|
/* each glyph in the font face. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* num_glyphs :: The number of glyphs in the table. */
|
|
|
|
/* */
|
|
|
|
/* offsets :: An array of signed offsets in a normal Mac */
|
|
|
|
/* Postscript name encoding. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_Post_25_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort num_glyphs;
|
|
|
|
FT_Char* offsets;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_Post_25;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_Post_Names */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Postscript names table, either format 2.0 or 2.5. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* loaded :: A flag to indicate whether the PS names are loaded. */
|
2000-05-17 01:44:38 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* format_20 :: The sub-table used for format 2.0. */
|
|
|
|
/* */
|
|
|
|
/* format_25 :: The sub-table used for format 2.5. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_Post_Names_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Bool loaded;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
union
|
|
|
|
{
|
|
|
|
TT_Post_20 format_20;
|
|
|
|
TT_Post_25 format_25;
|
|
|
|
|
|
|
|
} names;
|
|
|
|
|
|
|
|
} TT_Post_Names;
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*** ***/
|
|
|
|
/*** ***/
|
|
|
|
/*** TRUETYPE CHARMAPS SUPPORT ***/
|
|
|
|
/*** ***/
|
|
|
|
/*** ***/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/* format 0 */
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
typedef struct TT_CMap0_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Byte* glyphIdArray;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_CMap0;
|
|
|
|
|
|
|
|
|
|
|
|
/* format 2 */
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
typedef struct TT_CMap2SubHeader_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort firstCode; /* first valid low byte */
|
|
|
|
FT_UShort entryCount; /* number of valid low bytes */
|
|
|
|
FT_Short idDelta; /* delta value to glyphIndex */
|
|
|
|
FT_UShort idRangeOffset; /* offset from here to 1st code */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_CMap2SubHeader;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct TT_CMap2_
|
|
|
|
{
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_UShort* subHeaderKeys;
|
1999-12-17 00:11:37 +01:00
|
|
|
/* high byte mapping table */
|
|
|
|
/* value = subHeader index * 8 */
|
|
|
|
|
|
|
|
TT_CMap2SubHeader* subHeaders;
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort* glyphIdArray;
|
|
|
|
FT_UShort numGlyphId; /* control value */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_CMap2;
|
|
|
|
|
|
|
|
|
|
|
|
/* format 4 */
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
typedef struct TT_CMap4Segment_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort endCount;
|
|
|
|
FT_UShort startCount;
|
|
|
|
FT_Short idDelta;
|
|
|
|
FT_UShort idRangeOffset;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_CMap4Segment;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct TT_CMap4_
|
|
|
|
{
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_UShort segCountX2; /* number of segments * 2 */
|
|
|
|
FT_UShort searchRange; /* these parameters can be used */
|
|
|
|
FT_UShort entrySelector; /* for a binary search */
|
|
|
|
FT_UShort rangeShift;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
TT_CMap4Segment* segments;
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort* glyphIdArray;
|
|
|
|
FT_UShort numGlyphId; /* control value */
|
2000-05-27 00:13:17 +02:00
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
TT_CMap4Segment* last_segment; /* last used segment; this is a small */
|
2000-05-27 00:13:17 +02:00
|
|
|
/* cache to potentially increase speed */
|
1999-12-17 00:11:37 +01:00
|
|
|
} TT_CMap4;
|
|
|
|
|
|
|
|
|
|
|
|
/* format 6 */
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
typedef struct TT_CMap6_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort firstCode; /* first character code of subrange */
|
|
|
|
FT_UShort entryCount; /* number of character codes in subrange */
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort* glyphIdArray;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} TT_CMap6;
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
typedef struct TT_CMapTable_ TT_CMapTable;
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
typedef
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UInt (*TT_CharMap_Func)( TT_CMapTable* charmap,
|
|
|
|
FT_ULong char_code );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/* charmap table */
|
|
|
|
struct TT_CMapTable_
|
|
|
|
{
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort platformID;
|
|
|
|
FT_UShort platformEncodingID;
|
|
|
|
FT_UShort format;
|
|
|
|
FT_UShort length;
|
|
|
|
FT_UShort version;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Bool loaded;
|
|
|
|
FT_ULong offset;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
union
|
|
|
|
{
|
|
|
|
TT_CMap0 cmap0;
|
|
|
|
TT_CMap2 cmap2;
|
|
|
|
TT_CMap4 cmap4;
|
|
|
|
TT_CMap6 cmap6;
|
|
|
|
} c;
|
|
|
|
|
|
|
|
TT_CharMap_Func get_index;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_CharMapRec */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* The TrueType character map object type. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* root :: The parent character map structure. */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* cmap :: The used character map. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_CharMapRec_
|
|
|
|
{
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_CharMapRec root;
|
|
|
|
TT_CMapTable cmap;
|
2000-05-17 01:44:38 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
} TT_CharMapRec;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*** ***/
|
|
|
|
/*** ***/
|
|
|
|
/*** ORIGINAL TT_FACE CLASS DEFINITION ***/
|
|
|
|
/*** ***/
|
|
|
|
/*** ***/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* This structure/class is defined here because it is common to the */
|
|
|
|
/* following formats: TTF, OpenType-TT, and OpenType-CFF. */
|
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* Note, however, that the classes TT_Size, TT_GlyphSlot, and TT_CharMap */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* are not shared between font drivers, and are thus defined normally in */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* `ttobjs.h'. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* TT_Face */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A handle to a TrueType face/font object. A TT_Face encapsulates */
|
|
|
|
/* the resolution and scaling independent parts of a TrueType font */
|
|
|
|
/* resource. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* The TT_Face structure is also used as a `parent class' for the */
|
|
|
|
/* OpenType-CFF class (T2_Face). */
|
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
typedef struct TT_FaceRec_* TT_Face;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* TT_CharMap */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A handle to a TrueType character mapping object. */
|
|
|
|
/* */
|
|
|
|
typedef struct TT_CharMapRec_* TT_CharMap;
|
|
|
|
|
|
|
|
|
|
|
|
/* a function type used for the truetype bytecode interpreter hooks */
|
2000-06-16 21:34:52 +02:00
|
|
|
typedef FT_Error (*TT_Interpreter)( void* exec_context );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-25 06:49:19 +02:00
|
|
|
/* forward declaration */
|
|
|
|
typedef struct TT_Loader_ TT_Loader;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <FuncType> */
|
|
|
|
/* TT_Goto_Table_Func */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Seeks a stream to the start of a given TrueType table. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* face :: A handle to the target face object. */
|
|
|
|
/* */
|
|
|
|
/* tag :: A 4-byte tag used to name the table. */
|
|
|
|
/* */
|
|
|
|
/* stream :: The input stream. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Output> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* length :: The length of the table in bytes. Set to 0 if not */
|
|
|
|
/* needed. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* The stream cursor must be at the font file's origin. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
typedef
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Error (*TT_Goto_Table_Func)( TT_Face face,
|
|
|
|
FT_ULong tag,
|
1999-12-17 00:11:37 +01:00
|
|
|
FT_Stream stream,
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_ULong* length );
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-25 06:49:19 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <FuncType> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* TT_Access_Glyph_Frame_Func */
|
2000-06-25 06:49:19 +02:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* Seeks a stream to the start of a given glyph element, and opens a */
|
|
|
|
/* frame for it. */
|
2000-06-25 06:49:19 +02:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* loader :: The current TrueType glyph loader object. */
|
|
|
|
/* */
|
|
|
|
/* glyph index :: The index of the glyph to access. */
|
|
|
|
/* */
|
|
|
|
/* offset :: The offset of the glyph according to the */
|
|
|
|
/* `locations' table. */
|
|
|
|
/* */
|
|
|
|
/* byte_count :: The size of the frame in bytes. */
|
2000-06-25 06:49:19 +02:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
2000-06-25 06:49:19 +02:00
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* This function is normally equivalent to FILE_Seek(offset) */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* followed by ACCESS_Frame(byte_count) with the loader's stream, but */
|
|
|
|
/* alternative formats (e.g. compressed ones) might use something */
|
|
|
|
/* different. */
|
2000-06-25 06:49:19 +02:00
|
|
|
/* */
|
|
|
|
typedef
|
|
|
|
FT_Error (*TT_Access_Glyph_Frame_Func)( TT_Loader* loader,
|
|
|
|
FT_UInt glyph_index,
|
|
|
|
FT_ULong offset,
|
|
|
|
FT_UInt byte_count );
|
2000-07-19 08:25:56 +02:00
|
|
|
|
2000-06-25 06:49:19 +02:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <FuncType> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* TT_Load_Glyph_Element_Func */
|
2000-06-25 06:49:19 +02:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Reads one glyph element (its header, a simple glyph, or a */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* composite) from the loader's current stream frame. */
|
2000-06-25 06:49:19 +02:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* loader :: The current TrueType glyph loader object. */
|
2000-06-25 06:49:19 +02:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
2000-06-25 06:49:19 +02:00
|
|
|
/* */
|
|
|
|
typedef
|
|
|
|
FT_Error (*TT_Load_Glyph_Element_Func)( TT_Loader* loader );
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
2000-06-25 06:49:19 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <FuncType> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* TT_Forget_Glyph_Frame_Func */
|
2000-06-25 06:49:19 +02:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* Closes the current loader stream frame for the glyph. */
|
2000-06-25 06:49:19 +02:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* loader :: The current TrueType glyph loader object. */
|
2000-06-25 06:49:19 +02:00
|
|
|
/* */
|
|
|
|
typedef
|
2000-07-19 08:25:56 +02:00
|
|
|
void (*TT_Forget_Glyph_Frame_Func)( TT_Loader* loader );
|
2000-06-25 06:49:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* TrueType Face Type */
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_Face */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* The TrueType face class. These objects model the resolution and */
|
|
|
|
/* point-size independent data found in a TrueType font file. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* root :: The base FT_Face structure, managed by the */
|
|
|
|
/* base layer. */
|
|
|
|
/* */
|
|
|
|
/* ttc_header :: The TrueType collection header, used when */
|
|
|
|
/* the file is a `ttc' rather than a `ttf'. */
|
|
|
|
/* For ordinary font files, the field */
|
|
|
|
/* `ttc_header.count' is set to 0. */
|
|
|
|
/* */
|
|
|
|
/* format_tag :: The font format tag. */
|
|
|
|
/* */
|
|
|
|
/* num_tables :: The number of TrueType tables in this font */
|
|
|
|
/* file. */
|
|
|
|
/* */
|
|
|
|
/* dir_tables :: The directory of TrueType tables for this */
|
|
|
|
/* font file. */
|
|
|
|
/* */
|
|
|
|
/* header :: The font's font header (`head' table). */
|
|
|
|
/* Read on font opening. */
|
|
|
|
/* */
|
|
|
|
/* horizontal :: The font's horizontal header (`hhea' */
|
|
|
|
/* table). This field also contains the */
|
|
|
|
/* associated horizontal metrics table */
|
|
|
|
/* (`hmtx'). */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* max_profile :: The font's maximum profile table. Read on */
|
|
|
|
/* font opening. Note that some maximum */
|
|
|
|
/* values cannot be taken directly from this */
|
|
|
|
/* table. We thus define additional fields */
|
|
|
|
/* below to hold the computed maxima. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* max_components :: The maximum number of glyph components */
|
|
|
|
/* required to load any composite glyph from */
|
|
|
|
/* this font. Used to size the load stack. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* vertical_info :: A boolean which is set when the font file */
|
|
|
|
/* contains vertical metrics. If not, the */
|
|
|
|
/* value of the `vertical' field is */
|
|
|
|
/* undefined. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* vertical :: The font's vertical header (`vhea' table). */
|
|
|
|
/* This field also contains the associated */
|
|
|
|
/* vertical metrics table (`vmtx'), if found. */
|
|
|
|
/* IMPORTANT: The contents of this field is */
|
|
|
|
/* undefined if the `verticalInfo' field is */
|
|
|
|
/* unset. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* num_names :: The number of name records within this */
|
|
|
|
/* TrueType font. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* name_table :: The table of name records (`name'). */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* os2 :: The font's OS/2 table (`OS/2'). */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* postscript :: The font's PostScript table (`post' */
|
|
|
|
/* table). The PostScript glyph names are */
|
|
|
|
/* not loaded by the driver on face opening. */
|
|
|
|
/* See the `ttpost' module for more details. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* num_charmaps :: The number of character mappings in the */
|
|
|
|
/* font. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* charmaps :: The array of charmap objects for this font */
|
|
|
|
/* file. Note that this field is a typeless */
|
|
|
|
/* pointer. The Reason is that the format of */
|
|
|
|
/* charmaps varies with the underlying font */
|
|
|
|
/* format and cannot be determined here. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* goto_table :: A function called by each TrueType table */
|
|
|
|
/* loader to position a stream's cursor to */
|
|
|
|
/* the start of a given table according to */
|
|
|
|
/* its tag. It defaults to TT_Goto_Face but */
|
|
|
|
/* can be different for strange formats (e.g. */
|
|
|
|
/* Type 42). */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* access_glyph_frame :: XXX */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* read_glyph_header :: XXX */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* read_simple_glyph :: XXX */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* read_composite_glyph :: XXX */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* forget_glyph_frame :: XXX */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* sfnt :: A pointer to the SFNT `driver' interface. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* psnames :: A pointer to the `PSNames' module */
|
|
|
|
/* interface. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* hdmx :: The face's horizontal device metrics */
|
|
|
|
/* (`hdmx' table). This table is optional in */
|
|
|
|
/* TrueType/OpenType fonts. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* gasp :: The grid-fitting and scaling properties */
|
|
|
|
/* table (`gasp'). This table is optional in */
|
|
|
|
/* TrueType/OpenType fonts. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* pclt :: XXX */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* num_sbit_strikes :: The number of sbit strikes, i.e., bitmap */
|
|
|
|
/* sizes, embedded in this font. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* sbit_strikes :: An array of sbit strikes embedded in this */
|
|
|
|
/* font. This table is optional in a */
|
|
|
|
/* TrueType/OpenType font. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* num_sbit_scales :: The number of sbit scales for this font. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* sbit_scales :: Array of sbit scales embedded in this */
|
|
|
|
/* font. This table is optional in a */
|
|
|
|
/* TrueType/OpenType font. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* postscript_names :: A table used to store the Postscript names */
|
|
|
|
/* of the glyphs for this font. See the */
|
|
|
|
/* file `ttconfig.h' for comments on the */
|
|
|
|
/* TT_CONFIG_OPTION_POSTSCRIPT_NAMES option. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* num_locations :: The number of glyph locations in this */
|
|
|
|
/* TrueType file. This should be */
|
|
|
|
/* identical to the number of glyphs. */
|
|
|
|
/* Ignored for Type 2 fonts. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* glyph_locations :: An array of longs. These are offsets to */
|
|
|
|
/* glyph data within the `glyf' table. */
|
|
|
|
/* Ignored for Type 2 font faces. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* font_program_size :: Size in bytecodes of the face's font */
|
|
|
|
/* program. 0 if none defined. Ignored for */
|
|
|
|
/* Type 2 fonts. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* font_program :: The face's font program (bytecode stream) */
|
|
|
|
/* executed at load time, also used during */
|
|
|
|
/* glyph rendering. Comes from the `fpgm' */
|
|
|
|
/* table. Ignored for Type 2 font fonts. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* cvt_program_size :: The size in bytecodes of the face's cvt */
|
|
|
|
/* program. Ignored for Type 2 fonts. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* cvt_program :: The face's cvt program (bytecode stream) */
|
|
|
|
/* executed each time an instance/size is */
|
|
|
|
/* changed/reset. Comes from the `prep' */
|
|
|
|
/* table. Ignored for Type 2 fonts. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* cvt_size :: Size of the control value table (in */
|
|
|
|
/* entries). Ignored for Type 2 fonts. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* cvt :: The face's original control value table. */
|
|
|
|
/* Coordinates are expressed in unscaled font */
|
|
|
|
/* units. Comes from the `cvt ' table. */
|
|
|
|
/* Ignored for Type 2 fonts. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* num_kern_pairs :: The number of kerning pairs present in the */
|
|
|
|
/* font file. The engine only loads the */
|
|
|
|
/* first horizontal format 0 kern table it */
|
|
|
|
/* finds in the font file. You should use */
|
|
|
|
/* the `ttxkern' structures if you want to */
|
|
|
|
/* access other kerning tables. Ignored */
|
|
|
|
/* for Type 2 fonts. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-19 08:25:56 +02:00
|
|
|
/* kern_table_index :: The index of the kerning table in the font */
|
|
|
|
/* kerning directory. Only used by the */
|
|
|
|
/* ttxkern extension to avoid data */
|
|
|
|
/* duplication. Ignored for Type 2 fonts. */
|
|
|
|
/* */
|
|
|
|
/* interpreter :: A pointer to the TrueType bytecode */
|
|
|
|
/* interpreters field is also used to hook */
|
|
|
|
/* the debugger in `ttdebug'. */
|
|
|
|
/* */
|
|
|
|
/* extra :: XXX */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
typedef struct TT_FaceRec_
|
|
|
|
{
|
|
|
|
FT_FaceRec root;
|
|
|
|
|
|
|
|
TTC_Header ttc_header;
|
|
|
|
|
2000-05-18 18:18:05 +02:00
|
|
|
FT_ULong format_tag;
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort num_tables;
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_Table* dir_tables;
|
|
|
|
|
|
|
|
TT_Header header; /* TrueType header table */
|
|
|
|
TT_HoriHeader horizontal; /* TrueType horizontal header */
|
|
|
|
|
|
|
|
TT_MaxProfile max_profile;
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_ULong max_components;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Bool vertical_info;
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_VertHeader vertical; /* TT Vertical header, if present */
|
|
|
|
|
2000-10-26 12:04:16 +02:00
|
|
|
FT_UShort num_names; /* number of name records */
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_NameTable name_table; /* name table */
|
|
|
|
|
|
|
|
TT_OS2 os2; /* TrueType OS/2 table */
|
|
|
|
TT_Postscript postscript; /* TrueType Postscript table */
|
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Int num_charmaps;
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_CharMap charmaps; /* array of TT_CharMapRec */
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
TT_Goto_Table_Func goto_table;
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2000-06-25 06:49:19 +02:00
|
|
|
TT_Access_Glyph_Frame_Func access_glyph_frame;
|
|
|
|
TT_Load_Glyph_Element_Func read_glyph_header;
|
|
|
|
TT_Load_Glyph_Element_Func read_simple_glyph;
|
|
|
|
TT_Load_Glyph_Element_Func read_composite_glyph;
|
|
|
|
TT_Forget_Glyph_Frame_Func forget_glyph_frame;
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/* a typeless pointer to the SFNT_Interface table used to load */
|
|
|
|
/* the basic TrueType tables in the face object */
|
|
|
|
void* sfnt;
|
|
|
|
|
2000-02-10 18:01:24 +01:00
|
|
|
/* a typeless pointer to the PSNames_Interface table used to */
|
|
|
|
/* handle glyph names <-> unicode & Mac values */
|
|
|
|
void* psnames;
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Optional TrueType/OpenType tables */
|
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* horizontal device metrics */
|
|
|
|
TT_Hdmx hdmx;
|
|
|
|
|
|
|
|
/* grid-fitting and scaling table */
|
|
|
|
TT_Gasp gasp; /* the `gasp' table */
|
|
|
|
|
2000-05-18 18:18:05 +02:00
|
|
|
/* PCL 5 table */
|
2000-10-26 12:04:16 +02:00
|
|
|
TT_PCLT pclt;
|
2000-05-18 18:18:05 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/* embedded bitmaps support */
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Int num_sbit_strikes;
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_SBit_Strike* sbit_strikes;
|
|
|
|
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Int num_sbit_scales;
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_SBit_Scale* sbit_scales;
|
|
|
|
|
|
|
|
/* postscript names table */
|
|
|
|
TT_Post_Names postscript_names;
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
|
|
|
/* TrueType-specific fields (ignored by the OTF-Type2 driver) */
|
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* the glyph locations */
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_UShort num_locations;
|
|
|
|
FT_Long* glyph_locations;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
/* the font program, if any */
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_ULong font_program_size;
|
|
|
|
FT_Byte* font_program;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
/* the cvt program, if any */
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_ULong cvt_program_size;
|
|
|
|
FT_Byte* cvt_program;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
/* the original, unscaled, control value table */
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_ULong cvt_size;
|
|
|
|
FT_Short* cvt;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
/* the format 0 kerning table, if any */
|
2000-06-16 21:34:52 +02:00
|
|
|
FT_Int num_kern_pairs;
|
|
|
|
FT_Int kern_table_index;
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_Kern_0_Pair* kern_pairs;
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
/* A pointer to the bytecode interpreter to use. This is also */
|
|
|
|
/* used to hook the debugger for the `ttdebug' utility. */
|
1999-12-17 00:11:37 +01:00
|
|
|
TT_Interpreter interpreter;
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
|
2000-05-27 00:13:17 +02:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Other tables or fields. This is used by derivative formats like */
|
|
|
|
/* OpenType. */
|
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
2000-06-25 06:49:19 +02:00
|
|
|
FT_Generic extra;
|
2000-05-27 00:13:17 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
} TT_FaceRec;
|
|
|
|
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* TT_GlyphZone */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A glyph zone is used to load, scale and hint glyph outline */
|
|
|
|
/* coordinates. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* memory :: A handle to the memory manager. */
|
|
|
|
/* */
|
|
|
|
/* max_points :: The maximal size in points of the zone. */
|
|
|
|
/* */
|
|
|
|
/* max_contours :: Max size in links contours of thez one. */
|
|
|
|
/* */
|
|
|
|
/* n_points :: The current number of points in the zone. */
|
|
|
|
/* */
|
|
|
|
/* n_contours :: The current number of contours in the zone. */
|
|
|
|
/* */
|
|
|
|
/* org :: The original glyph coordinates (font */
|
|
|
|
/* units/scaled). */
|
|
|
|
/* */
|
|
|
|
/* cur :: The current glyph coordinates (scaled/hinted). */
|
|
|
|
/* */
|
|
|
|
/* tags :: The point control tags. */
|
|
|
|
/* */
|
|
|
|
/* contours :: The contours end points. */
|
|
|
|
/* */
|
2000-06-23 13:36:51 +02:00
|
|
|
typedef struct TT_GlyphZone_
|
|
|
|
{
|
|
|
|
FT_Memory memory;
|
|
|
|
FT_UShort max_points;
|
|
|
|
FT_UShort max_contours;
|
|
|
|
FT_UShort n_points; /* number of points in zone */
|
|
|
|
FT_Short n_contours; /* number of contours */
|
|
|
|
|
|
|
|
FT_Vector* org; /* original point coordinates */
|
|
|
|
FT_Vector* cur; /* current point coordinates */
|
|
|
|
|
|
|
|
FT_Byte* tags; /* current touch flags */
|
|
|
|
FT_UShort* contours; /* contour end points */
|
|
|
|
|
|
|
|
} TT_GlyphZone;
|
|
|
|
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
/* handle to execution context */
|
2000-06-23 13:36:51 +02:00
|
|
|
typedef struct TT_ExecContextRec_* TT_ExecContext;
|
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
/* glyph loader structure */
|
2000-06-25 06:49:19 +02:00
|
|
|
struct TT_Loader_
|
2000-06-23 13:36:51 +02:00
|
|
|
{
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_Face face;
|
|
|
|
FT_Size size;
|
|
|
|
FT_GlyphSlot glyph;
|
|
|
|
FT_GlyphLoader* gloader;
|
2000-06-23 13:36:51 +02:00
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_ULong load_flags;
|
|
|
|
FT_UInt glyph_index;
|
2000-06-23 13:36:51 +02:00
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_Stream stream;
|
|
|
|
FT_Int byte_len;
|
2000-06-23 13:36:51 +02:00
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_Short n_contours;
|
|
|
|
FT_BBox bbox;
|
|
|
|
FT_Int left_bearing;
|
|
|
|
FT_Int advance;
|
|
|
|
FT_Bool preserve_pps;
|
|
|
|
FT_Vector pp1;
|
|
|
|
FT_Vector pp2;
|
2000-06-23 13:36:51 +02:00
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
FT_ULong glyf_offset;
|
2000-06-23 13:36:51 +02:00
|
|
|
|
|
|
|
/* the zone where we load our glyphs */
|
2000-07-19 08:25:56 +02:00
|
|
|
TT_GlyphZone base;
|
|
|
|
TT_GlyphZone zone;
|
2000-06-23 13:36:51 +02:00
|
|
|
|
2000-07-19 08:25:56 +02:00
|
|
|
TT_ExecContext exec;
|
|
|
|
FT_Byte* instructions;
|
|
|
|
FT_ULong ins_pos;
|
2000-06-25 06:49:19 +02:00
|
|
|
|
|
|
|
/* for possible extensibility in other formats */
|
2000-07-19 08:25:56 +02:00
|
|
|
void* other;
|
2000-06-23 13:36:51 +02:00
|
|
|
|
2000-06-25 06:49:19 +02:00
|
|
|
};
|
2000-06-23 13:36:51 +02:00
|
|
|
|
|
|
|
|
2000-08-01 15:17:04 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
#endif /* TTTYPES_H */
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|