mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Add Freetype2 to includes and lib folders, update CMakeLists.txt to
properly build the text_rendering example as just one more project.
This commit is contained in:
232
includes/freetype/internal/autohint.h
Normal file
232
includes/freetype/internal/autohint.h
Normal file
@@ -0,0 +1,232 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* autohint.h
|
||||
*
|
||||
* High-level 'autohint' module-specific interface (specification).
|
||||
*
|
||||
* Copyright (C) 1996-2020 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.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* The auto-hinter is used to load and automatically hint glyphs if a
|
||||
* format-specific hinter isn't available.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef AUTOHINT_H_
|
||||
#define AUTOHINT_H_
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* A small technical note regarding automatic hinting in order to clarify
|
||||
* this module interface.
|
||||
*
|
||||
* An automatic hinter might compute two kinds of data for a given face:
|
||||
*
|
||||
* - global hints: Usually some metrics that describe global properties
|
||||
* of the face. It is computed by scanning more or less
|
||||
* aggressively the glyphs in the face, and thus can be
|
||||
* very slow to compute (even if the size of global hints
|
||||
* is really small).
|
||||
*
|
||||
* - glyph hints: These describe some important features of the glyph
|
||||
* outline, as well as how to align them. They are
|
||||
* generally much faster to compute than global hints.
|
||||
*
|
||||
* The current FreeType auto-hinter does a pretty good job while performing
|
||||
* fast computations for both global and glyph hints. However, we might be
|
||||
* interested in introducing more complex and powerful algorithms in the
|
||||
* future, like the one described in the John D. Hobby paper, which
|
||||
* unfortunately requires a lot more horsepower.
|
||||
*
|
||||
* Because a sufficiently sophisticated font management system would
|
||||
* typically implement an LRU cache of opened face objects to reduce memory
|
||||
* usage, it is a good idea to be able to avoid recomputing global hints
|
||||
* every time the same face is re-opened.
|
||||
*
|
||||
* We thus provide the ability to cache global hints outside of the face
|
||||
* object, in order to speed up font re-opening time. Of course, this
|
||||
* feature is purely optional, so most client programs won't even notice
|
||||
* it.
|
||||
*
|
||||
* I initially thought that it would be a good idea to cache the glyph
|
||||
* hints too. However, my general idea now is that if you really need to
|
||||
* cache these too, you are simply in need of a new font format, where all
|
||||
* this information could be stored within the font file and decoded on the
|
||||
* fly.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef struct FT_AutoHinterRec_ *FT_AutoHinter;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_AutoHinter_GlobalGetFunc
|
||||
*
|
||||
* @description:
|
||||
* Retrieve the global hints computed for a given face object. The
|
||||
* resulting data is dissociated from the face and will survive a call to
|
||||
* FT_Done_Face(). It must be discarded through the API
|
||||
* FT_AutoHinter_GlobalDoneFunc().
|
||||
*
|
||||
* @input:
|
||||
* hinter ::
|
||||
* A handle to the source auto-hinter.
|
||||
*
|
||||
* face ::
|
||||
* A handle to the source face object.
|
||||
*
|
||||
* @output:
|
||||
* global_hints ::
|
||||
* A typeless pointer to the global hints.
|
||||
*
|
||||
* global_len ::
|
||||
* The size in bytes of the global hints.
|
||||
*/
|
||||
typedef void
|
||||
(*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter hinter,
|
||||
FT_Face face,
|
||||
void** global_hints,
|
||||
long* global_len );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_AutoHinter_GlobalDoneFunc
|
||||
*
|
||||
* @description:
|
||||
* Discard the global hints retrieved through
|
||||
* FT_AutoHinter_GlobalGetFunc(). This is the only way these hints are
|
||||
* freed from memory.
|
||||
*
|
||||
* @input:
|
||||
* hinter ::
|
||||
* A handle to the auto-hinter module.
|
||||
*
|
||||
* global ::
|
||||
* A pointer to retrieved global hints to discard.
|
||||
*/
|
||||
typedef void
|
||||
(*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter hinter,
|
||||
void* global );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_AutoHinter_GlobalResetFunc
|
||||
*
|
||||
* @description:
|
||||
* This function is used to recompute the global metrics in a given font.
|
||||
* This is useful when global font data changes (e.g. Multiple Masters
|
||||
* fonts where blend coordinates change).
|
||||
*
|
||||
* @input:
|
||||
* hinter ::
|
||||
* A handle to the source auto-hinter.
|
||||
*
|
||||
* face ::
|
||||
* A handle to the face.
|
||||
*/
|
||||
typedef void
|
||||
(*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter hinter,
|
||||
FT_Face face );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* FT_AutoHinter_GlyphLoadFunc
|
||||
*
|
||||
* @description:
|
||||
* This function is used to load, scale, and automatically hint a glyph
|
||||
* from a given face.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the face.
|
||||
*
|
||||
* glyph_index ::
|
||||
* The glyph index.
|
||||
*
|
||||
* load_flags ::
|
||||
* The load flags.
|
||||
*
|
||||
* @note:
|
||||
* This function is capable of loading composite glyphs by hinting each
|
||||
* sub-glyph independently (which improves quality).
|
||||
*
|
||||
* It will call the font driver with @FT_Load_Glyph, with
|
||||
* @FT_LOAD_NO_SCALE set.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter hinter,
|
||||
FT_GlyphSlot slot,
|
||||
FT_Size size,
|
||||
FT_UInt glyph_index,
|
||||
FT_Int32 load_flags );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_AutoHinter_InterfaceRec
|
||||
*
|
||||
* @description:
|
||||
* The auto-hinter module's interface.
|
||||
*/
|
||||
typedef struct FT_AutoHinter_InterfaceRec_
|
||||
{
|
||||
FT_AutoHinter_GlobalResetFunc reset_face;
|
||||
FT_AutoHinter_GlobalGetFunc get_global_hints;
|
||||
FT_AutoHinter_GlobalDoneFunc done_global_hints;
|
||||
FT_AutoHinter_GlyphLoadFunc load_glyph;
|
||||
|
||||
} FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;
|
||||
|
||||
|
||||
#define FT_DEFINE_AUTOHINTER_INTERFACE( \
|
||||
class_, \
|
||||
reset_face_, \
|
||||
get_global_hints_, \
|
||||
done_global_hints_, \
|
||||
load_glyph_ ) \
|
||||
FT_CALLBACK_TABLE_DEF \
|
||||
const FT_AutoHinter_InterfaceRec class_ = \
|
||||
{ \
|
||||
reset_face_, \
|
||||
get_global_hints_, \
|
||||
done_global_hints_, \
|
||||
load_glyph_ \
|
||||
};
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* AUTOHINT_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
108
includes/freetype/internal/cffotypes.h
Normal file
108
includes/freetype/internal/cffotypes.h
Normal file
@@ -0,0 +1,108 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* cffotypes.h
|
||||
*
|
||||
* Basic OpenType/CFF object type definitions (specification).
|
||||
*
|
||||
* Copyright (C) 2017-2020 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 CFFOTYPES_H_
|
||||
#define CFFOTYPES_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
#include FT_INTERNAL_CFF_TYPES_H
|
||||
#include FT_INTERNAL_TRUETYPE_TYPES_H
|
||||
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
|
||||
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef TT_Face CFF_Face;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* CFF_Size
|
||||
*
|
||||
* @description:
|
||||
* A handle to an OpenType size object.
|
||||
*/
|
||||
typedef struct CFF_SizeRec_
|
||||
{
|
||||
FT_SizeRec root;
|
||||
FT_ULong strike_index; /* 0xFFFFFFFF to indicate invalid */
|
||||
|
||||
} CFF_SizeRec, *CFF_Size;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* CFF_GlyphSlot
|
||||
*
|
||||
* @description:
|
||||
* A handle to an OpenType glyph slot object.
|
||||
*/
|
||||
typedef struct CFF_GlyphSlotRec_
|
||||
{
|
||||
FT_GlyphSlotRec root;
|
||||
|
||||
FT_Bool hint;
|
||||
FT_Bool scaled;
|
||||
|
||||
FT_Fixed x_scale;
|
||||
FT_Fixed y_scale;
|
||||
|
||||
} CFF_GlyphSlotRec, *CFF_GlyphSlot;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* CFF_Internal
|
||||
*
|
||||
* @description:
|
||||
* The interface to the 'internal' field of `FT_Size`.
|
||||
*/
|
||||
typedef struct CFF_InternalRec_
|
||||
{
|
||||
PSH_Globals topfont;
|
||||
PSH_Globals subfonts[CFF_MAX_CID_FONTS];
|
||||
|
||||
} CFF_InternalRec, *CFF_Internal;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Subglyph transformation record.
|
||||
*/
|
||||
typedef struct CFF_Transform_
|
||||
{
|
||||
FT_Fixed xx, xy; /* transformation matrix coefficients */
|
||||
FT_Fixed yx, yy;
|
||||
FT_F26Dot6 ox, oy; /* offsets */
|
||||
|
||||
} CFF_Transform;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* CFFOTYPES_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
417
includes/freetype/internal/cfftypes.h
Normal file
417
includes/freetype/internal/cfftypes.h
Normal file
@@ -0,0 +1,417 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* cfftypes.h
|
||||
*
|
||||
* Basic OpenType/CFF type definitions and interface (specification
|
||||
* only).
|
||||
*
|
||||
* Copyright (C) 1996-2020 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 CFFTYPES_H_
|
||||
#define CFFTYPES_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_TYPE1_TABLES_H
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
|
||||
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
|
||||
#include FT_INTERNAL_TYPE1_TYPES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* CFF_IndexRec
|
||||
*
|
||||
* @description:
|
||||
* A structure used to model a CFF Index table.
|
||||
*
|
||||
* @fields:
|
||||
* stream ::
|
||||
* The source input stream.
|
||||
*
|
||||
* start ::
|
||||
* The position of the first index byte in the input stream.
|
||||
*
|
||||
* count ::
|
||||
* The number of elements in the index.
|
||||
*
|
||||
* off_size ::
|
||||
* The size in bytes of object offsets in index.
|
||||
*
|
||||
* data_offset ::
|
||||
* The position of first data byte in the index's bytes.
|
||||
*
|
||||
* data_size ::
|
||||
* The size of the data table in this index.
|
||||
*
|
||||
* offsets ::
|
||||
* A table of element offsets in the index. Must be loaded explicitly.
|
||||
*
|
||||
* bytes ::
|
||||
* If the index is loaded in memory, its bytes.
|
||||
*/
|
||||
typedef struct CFF_IndexRec_
|
||||
{
|
||||
FT_Stream stream;
|
||||
FT_ULong start;
|
||||
FT_UInt hdr_size;
|
||||
FT_UInt count;
|
||||
FT_Byte off_size;
|
||||
FT_ULong data_offset;
|
||||
FT_ULong data_size;
|
||||
|
||||
FT_ULong* offsets;
|
||||
FT_Byte* bytes;
|
||||
|
||||
} CFF_IndexRec, *CFF_Index;
|
||||
|
||||
|
||||
typedef struct CFF_EncodingRec_
|
||||
{
|
||||
FT_UInt format;
|
||||
FT_ULong offset;
|
||||
|
||||
FT_UInt count;
|
||||
FT_UShort sids [256]; /* avoid dynamic allocations */
|
||||
FT_UShort codes[256];
|
||||
|
||||
} CFF_EncodingRec, *CFF_Encoding;
|
||||
|
||||
|
||||
typedef struct CFF_CharsetRec_
|
||||
{
|
||||
|
||||
FT_UInt format;
|
||||
FT_ULong offset;
|
||||
|
||||
FT_UShort* sids;
|
||||
FT_UShort* cids; /* the inverse mapping of `sids'; only needed */
|
||||
/* for CID-keyed fonts */
|
||||
FT_UInt max_cid;
|
||||
FT_UInt num_glyphs;
|
||||
|
||||
} CFF_CharsetRec, *CFF_Charset;
|
||||
|
||||
|
||||
/* cf. similar fields in file `ttgxvar.h' from the `truetype' module */
|
||||
|
||||
typedef struct CFF_VarData_
|
||||
{
|
||||
#if 0
|
||||
FT_UInt itemCount; /* not used; always zero */
|
||||
FT_UInt shortDeltaCount; /* not used; always zero */
|
||||
#endif
|
||||
|
||||
FT_UInt regionIdxCount; /* number of region indexes */
|
||||
FT_UInt* regionIndices; /* array of `regionIdxCount' indices; */
|
||||
/* these index `varRegionList' */
|
||||
} CFF_VarData;
|
||||
|
||||
|
||||
/* contribution of one axis to a region */
|
||||
typedef struct CFF_AxisCoords_
|
||||
{
|
||||
FT_Fixed startCoord;
|
||||
FT_Fixed peakCoord; /* zero peak means no effect (factor = 1) */
|
||||
FT_Fixed endCoord;
|
||||
|
||||
} CFF_AxisCoords;
|
||||
|
||||
|
||||
typedef struct CFF_VarRegion_
|
||||
{
|
||||
CFF_AxisCoords* axisList; /* array of axisCount records */
|
||||
|
||||
} CFF_VarRegion;
|
||||
|
||||
|
||||
typedef struct CFF_VStoreRec_
|
||||
{
|
||||
FT_UInt dataCount;
|
||||
CFF_VarData* varData; /* array of dataCount records */
|
||||
/* vsindex indexes this array */
|
||||
FT_UShort axisCount;
|
||||
FT_UInt regionCount; /* total number of regions defined */
|
||||
CFF_VarRegion* varRegionList;
|
||||
|
||||
} CFF_VStoreRec, *CFF_VStore;
|
||||
|
||||
|
||||
/* forward reference */
|
||||
typedef struct CFF_FontRec_* CFF_Font;
|
||||
|
||||
|
||||
/* This object manages one cached blend vector. */
|
||||
/* */
|
||||
/* There is a BlendRec for Private DICT parsing in each subfont */
|
||||
/* and a BlendRec for charstrings in CF2_Font instance data. */
|
||||
/* A cached BV may be used across DICTs or Charstrings if inputs */
|
||||
/* have not changed. */
|
||||
/* */
|
||||
/* `usedBV' is reset at the start of each parse or charstring. */
|
||||
/* vsindex cannot be changed after a BV is used. */
|
||||
/* */
|
||||
/* Note: NDV is long (32/64 bit), while BV is 16.16 (FT_Int32). */
|
||||
typedef struct CFF_BlendRec_
|
||||
{
|
||||
FT_Bool builtBV; /* blendV has been built */
|
||||
FT_Bool usedBV; /* blendV has been used */
|
||||
CFF_Font font; /* top level font struct */
|
||||
FT_UInt lastVsindex; /* last vsindex used */
|
||||
FT_UInt lenNDV; /* normDV length (aka numAxes) */
|
||||
FT_Fixed* lastNDV; /* last NDV used */
|
||||
FT_UInt lenBV; /* BlendV length (aka numMasters) */
|
||||
FT_Int32* BV; /* current blendV (per DICT/glyph) */
|
||||
|
||||
} CFF_BlendRec, *CFF_Blend;
|
||||
|
||||
|
||||
typedef struct CFF_FontRecDictRec_
|
||||
{
|
||||
FT_UInt version;
|
||||
FT_UInt notice;
|
||||
FT_UInt copyright;
|
||||
FT_UInt full_name;
|
||||
FT_UInt family_name;
|
||||
FT_UInt weight;
|
||||
FT_Bool is_fixed_pitch;
|
||||
FT_Fixed italic_angle;
|
||||
FT_Fixed underline_position;
|
||||
FT_Fixed underline_thickness;
|
||||
FT_Int paint_type;
|
||||
FT_Int charstring_type;
|
||||
FT_Matrix font_matrix;
|
||||
FT_Bool has_font_matrix;
|
||||
FT_ULong units_per_em; /* temporarily used as scaling value also */
|
||||
FT_Vector font_offset;
|
||||
FT_ULong unique_id;
|
||||
FT_BBox font_bbox;
|
||||
FT_Pos stroke_width;
|
||||
FT_ULong charset_offset;
|
||||
FT_ULong encoding_offset;
|
||||
FT_ULong charstrings_offset;
|
||||
FT_ULong private_offset;
|
||||
FT_ULong private_size;
|
||||
FT_Long synthetic_base;
|
||||
FT_UInt embedded_postscript;
|
||||
|
||||
/* these should only be used for the top-level font dictionary */
|
||||
FT_UInt cid_registry;
|
||||
FT_UInt cid_ordering;
|
||||
FT_Long cid_supplement;
|
||||
|
||||
FT_Long cid_font_version;
|
||||
FT_Long cid_font_revision;
|
||||
FT_Long cid_font_type;
|
||||
FT_ULong cid_count;
|
||||
FT_ULong cid_uid_base;
|
||||
FT_ULong cid_fd_array_offset;
|
||||
FT_ULong cid_fd_select_offset;
|
||||
FT_UInt cid_font_name;
|
||||
|
||||
/* the next fields come from the data of the deprecated */
|
||||
/* `MultipleMaster' operator; they are needed to parse the (also */
|
||||
/* deprecated) `blend' operator in Type 2 charstrings */
|
||||
FT_UShort num_designs;
|
||||
FT_UShort num_axes;
|
||||
|
||||
/* fields for CFF2 */
|
||||
FT_ULong vstore_offset;
|
||||
FT_UInt maxstack;
|
||||
|
||||
} CFF_FontRecDictRec, *CFF_FontRecDict;
|
||||
|
||||
|
||||
/* forward reference */
|
||||
typedef struct CFF_SubFontRec_* CFF_SubFont;
|
||||
|
||||
|
||||
typedef struct CFF_PrivateRec_
|
||||
{
|
||||
FT_Byte num_blue_values;
|
||||
FT_Byte num_other_blues;
|
||||
FT_Byte num_family_blues;
|
||||
FT_Byte num_family_other_blues;
|
||||
|
||||
FT_Pos blue_values[14];
|
||||
FT_Pos other_blues[10];
|
||||
FT_Pos family_blues[14];
|
||||
FT_Pos family_other_blues[10];
|
||||
|
||||
FT_Fixed blue_scale;
|
||||
FT_Pos blue_shift;
|
||||
FT_Pos blue_fuzz;
|
||||
FT_Pos standard_width;
|
||||
FT_Pos standard_height;
|
||||
|
||||
FT_Byte num_snap_widths;
|
||||
FT_Byte num_snap_heights;
|
||||
FT_Pos snap_widths[13];
|
||||
FT_Pos snap_heights[13];
|
||||
FT_Bool force_bold;
|
||||
FT_Fixed force_bold_threshold;
|
||||
FT_Int lenIV;
|
||||
FT_Int language_group;
|
||||
FT_Fixed expansion_factor;
|
||||
FT_Long initial_random_seed;
|
||||
FT_ULong local_subrs_offset;
|
||||
FT_Pos default_width;
|
||||
FT_Pos nominal_width;
|
||||
|
||||
/* fields for CFF2 */
|
||||
FT_UInt vsindex;
|
||||
CFF_SubFont subfont;
|
||||
|
||||
} CFF_PrivateRec, *CFF_Private;
|
||||
|
||||
|
||||
typedef struct CFF_FDSelectRec_
|
||||
{
|
||||
FT_Byte format;
|
||||
FT_UInt range_count;
|
||||
|
||||
/* that's the table, taken from the file `as is' */
|
||||
FT_Byte* data;
|
||||
FT_UInt data_size;
|
||||
|
||||
/* small cache for format 3 only */
|
||||
FT_UInt cache_first;
|
||||
FT_UInt cache_count;
|
||||
FT_Byte cache_fd;
|
||||
|
||||
} CFF_FDSelectRec, *CFF_FDSelect;
|
||||
|
||||
|
||||
/* A SubFont packs a font dict and a private dict together. They are */
|
||||
/* needed to support CID-keyed CFF fonts. */
|
||||
typedef struct CFF_SubFontRec_
|
||||
{
|
||||
CFF_FontRecDictRec font_dict;
|
||||
CFF_PrivateRec private_dict;
|
||||
|
||||
/* fields for CFF2 */
|
||||
CFF_BlendRec blend; /* current blend vector */
|
||||
FT_UInt lenNDV; /* current length NDV or zero */
|
||||
FT_Fixed* NDV; /* ptr to current NDV or NULL */
|
||||
|
||||
/* `blend_stack' is a writable buffer to hold blend results. */
|
||||
/* This buffer is to the side of the normal cff parser stack; */
|
||||
/* `cff_parse_blend' and `cff_blend_doBlend' push blend results here. */
|
||||
/* The normal stack then points to these values instead of the DICT */
|
||||
/* because all other operators in Private DICT clear the stack. */
|
||||
/* `blend_stack' could be cleared at each operator other than blend. */
|
||||
/* Blended values are stored as 5-byte fixed point values. */
|
||||
|
||||
FT_Byte* blend_stack; /* base of stack allocation */
|
||||
FT_Byte* blend_top; /* first empty slot */
|
||||
FT_UInt blend_used; /* number of bytes in use */
|
||||
FT_UInt blend_alloc; /* number of bytes allocated */
|
||||
|
||||
CFF_IndexRec local_subrs_index;
|
||||
FT_Byte** local_subrs; /* array of pointers */
|
||||
/* into Local Subrs INDEX data */
|
||||
|
||||
FT_UInt32 random;
|
||||
|
||||
} CFF_SubFontRec;
|
||||
|
||||
|
||||
#define CFF_MAX_CID_FONTS 256
|
||||
|
||||
|
||||
typedef struct CFF_FontRec_
|
||||
{
|
||||
FT_Library library;
|
||||
FT_Stream stream;
|
||||
FT_Memory memory; /* TODO: take this from stream->memory? */
|
||||
FT_ULong base_offset; /* offset to start of CFF */
|
||||
FT_UInt num_faces;
|
||||
FT_UInt num_glyphs;
|
||||
|
||||
FT_Byte version_major;
|
||||
FT_Byte version_minor;
|
||||
FT_Byte header_size;
|
||||
|
||||
FT_UInt top_dict_length; /* cff2 only */
|
||||
|
||||
FT_Bool cff2;
|
||||
|
||||
CFF_IndexRec name_index;
|
||||
CFF_IndexRec top_dict_index;
|
||||
CFF_IndexRec global_subrs_index;
|
||||
|
||||
CFF_EncodingRec encoding;
|
||||
CFF_CharsetRec charset;
|
||||
|
||||
CFF_IndexRec charstrings_index;
|
||||
CFF_IndexRec font_dict_index;
|
||||
CFF_IndexRec private_index;
|
||||
CFF_IndexRec local_subrs_index;
|
||||
|
||||
FT_String* font_name;
|
||||
|
||||
/* array of pointers into Global Subrs INDEX data */
|
||||
FT_Byte** global_subrs;
|
||||
|
||||
/* array of pointers into String INDEX data stored at string_pool */
|
||||
FT_UInt num_strings;
|
||||
FT_Byte** strings;
|
||||
FT_Byte* string_pool;
|
||||
FT_ULong string_pool_size;
|
||||
|
||||
CFF_SubFontRec top_font;
|
||||
FT_UInt num_subfonts;
|
||||
CFF_SubFont subfonts[CFF_MAX_CID_FONTS];
|
||||
|
||||
CFF_FDSelectRec fd_select;
|
||||
|
||||
/* interface to PostScript hinter */
|
||||
PSHinter_Service pshinter;
|
||||
|
||||
/* interface to Postscript Names service */
|
||||
FT_Service_PsCMaps psnames;
|
||||
|
||||
/* interface to CFFLoad service */
|
||||
const void* cffload;
|
||||
|
||||
/* since version 2.3.0 */
|
||||
PS_FontInfoRec* font_info; /* font info dictionary */
|
||||
|
||||
/* since version 2.3.6 */
|
||||
FT_String* registry;
|
||||
FT_String* ordering;
|
||||
|
||||
/* since version 2.4.12 */
|
||||
FT_Generic cf2_instance;
|
||||
|
||||
/* since version 2.7.1 */
|
||||
CFF_VStoreRec vstore; /* parsed vstore structure */
|
||||
|
||||
/* since version 2.9 */
|
||||
PS_FontExtraRec* font_extra;
|
||||
|
||||
} CFF_FontRec;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* CFFTYPES_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
510
includes/freetype/internal/ftcalc.h
Normal file
510
includes/freetype/internal/ftcalc.h
Normal file
@@ -0,0 +1,510 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftcalc.h
|
||||
*
|
||||
* Arithmetic computations (specification).
|
||||
*
|
||||
* Copyright (C) 1996-2020 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 FTCALC_H_
|
||||
#define FTCALC_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* FT_MulDiv() and FT_MulFix() are declared in freetype.h.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
|
||||
/* Provide assembler fragments for performance-critical functions. */
|
||||
/* These must be defined `static __inline__' with GCC. */
|
||||
|
||||
#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
|
||||
|
||||
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
static __inline FT_Int32
|
||||
FT_MulFix_arm( FT_Int32 a,
|
||||
FT_Int32 b )
|
||||
{
|
||||
FT_Int32 t, t2;
|
||||
|
||||
|
||||
__asm
|
||||
{
|
||||
smull t2, t, b, a /* (lo=t2,hi=t) = a*b */
|
||||
mov a, t, asr #31 /* a = (hi >> 31) */
|
||||
add a, a, #0x8000 /* a += 0x8000 */
|
||||
adds t2, t2, a /* t2 += a */
|
||||
adc t, t, #0 /* t += carry */
|
||||
mov a, t2, lsr #16 /* a = t2 >> 16 */
|
||||
orr a, a, t, lsl #16 /* a |= t << 16 */
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
#endif /* __CC_ARM || __ARMCC__ */
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
#if defined( __arm__ ) && \
|
||||
( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \
|
||||
!( defined( __CC_ARM ) || defined( __ARMCC__ ) )
|
||||
|
||||
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
static __inline__ FT_Int32
|
||||
FT_MulFix_arm( FT_Int32 a,
|
||||
FT_Int32 b )
|
||||
{
|
||||
FT_Int32 t, t2;
|
||||
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
|
||||
"mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
|
||||
#if defined( __clang__ ) && defined( __thumb2__ )
|
||||
"add.w %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
|
||||
#else
|
||||
"add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
|
||||
#endif
|
||||
"adds %1, %1, %0\n\t" /* %1 += %0 */
|
||||
"adc %2, %2, #0\n\t" /* %2 += carry */
|
||||
"mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
|
||||
"orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
|
||||
: "=r"(a), "=&r"(t2), "=&r"(t)
|
||||
: "r"(a), "r"(b)
|
||||
: "cc" );
|
||||
return a;
|
||||
}
|
||||
|
||||
#endif /* __arm__ && */
|
||||
/* ( __thumb2__ || !__thumb__ ) && */
|
||||
/* !( __CC_ARM || __ARMCC__ ) */
|
||||
|
||||
|
||||
#if defined( __i386__ )
|
||||
|
||||
#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
static __inline__ FT_Int32
|
||||
FT_MulFix_i386( FT_Int32 a,
|
||||
FT_Int32 b )
|
||||
{
|
||||
FT_Int32 result;
|
||||
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"imul %%edx\n"
|
||||
"movl %%edx, %%ecx\n"
|
||||
"sarl $31, %%ecx\n"
|
||||
"addl $0x8000, %%ecx\n"
|
||||
"addl %%ecx, %%eax\n"
|
||||
"adcl $0, %%edx\n"
|
||||
"shrl $16, %%eax\n"
|
||||
"shll $16, %%edx\n"
|
||||
"addl %%edx, %%eax\n"
|
||||
: "=a"(result), "=d"(b)
|
||||
: "a"(a), "d"(b)
|
||||
: "%ecx", "cc" );
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* i386 */
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
|
||||
#ifdef _MSC_VER /* Visual C++ */
|
||||
|
||||
#ifdef _M_IX86
|
||||
|
||||
#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
static __inline FT_Int32
|
||||
FT_MulFix_i386( FT_Int32 a,
|
||||
FT_Int32 b )
|
||||
{
|
||||
FT_Int32 result;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, a
|
||||
mov edx, b
|
||||
imul edx
|
||||
mov ecx, edx
|
||||
sar ecx, 31
|
||||
add ecx, 8000h
|
||||
add eax, ecx
|
||||
adc edx, 0
|
||||
shr eax, 16
|
||||
shl edx, 16
|
||||
add eax, edx
|
||||
mov result, eax
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* _M_IX86 */
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
|
||||
#if defined( __GNUC__ ) && defined( __x86_64__ )
|
||||
|
||||
#define FT_MULFIX_ASSEMBLER FT_MulFix_x86_64
|
||||
|
||||
static __inline__ FT_Int32
|
||||
FT_MulFix_x86_64( FT_Int32 a,
|
||||
FT_Int32 b )
|
||||
{
|
||||
/* Temporarily disable the warning that C90 doesn't support */
|
||||
/* `long long'. */
|
||||
#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wlong-long"
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
/* Technically not an assembly fragment, but GCC does a really good */
|
||||
/* job at inlining it and generating good machine code for it. */
|
||||
long long ret, tmp;
|
||||
|
||||
|
||||
ret = (long long)a * b;
|
||||
tmp = ret >> 63;
|
||||
ret += 0x8000 + tmp;
|
||||
|
||||
return (FT_Int32)( ret >> 16 );
|
||||
#else
|
||||
|
||||
/* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine */
|
||||
/* code from the lines below. The main issue is that `wide_a' is not */
|
||||
/* properly initialized by sign-extending `a'. Instead, the generated */
|
||||
/* machine code assumes that the register that contains `a' on input */
|
||||
/* can be used directly as a 64-bit value, which is wrong most of the */
|
||||
/* time. */
|
||||
long long wide_a = (long long)a;
|
||||
long long wide_b = (long long)b;
|
||||
long long result;
|
||||
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"imul %2, %1\n"
|
||||
"mov %1, %0\n"
|
||||
"sar $63, %0\n"
|
||||
"lea 0x8000(%1, %0), %0\n"
|
||||
"sar $16, %0\n"
|
||||
: "=&r"(result), "=&r"(wide_a)
|
||||
: "r"(wide_b)
|
||||
: "cc" );
|
||||
|
||||
return (FT_Int32)result;
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* __GNUC__ && __x86_64__ */
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
|
||||
#ifdef FT_MULFIX_ASSEMBLER
|
||||
#define FT_MulFix( a, b ) FT_MULFIX_ASSEMBLER( (FT_Int32)(a), (FT_Int32)(b) )
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_MulDiv_No_Round
|
||||
*
|
||||
* @description:
|
||||
* A very simple function used to perform the computation '(a*b)/c'
|
||||
* (without rounding) with maximum accuracy (it uses a 64-bit
|
||||
* intermediate integer whenever necessary).
|
||||
*
|
||||
* This function isn't necessarily as fast as some processor-specific
|
||||
* operations, but is at least completely portable.
|
||||
*
|
||||
* @input:
|
||||
* a ::
|
||||
* The first multiplier.
|
||||
* b ::
|
||||
* The second multiplier.
|
||||
* c ::
|
||||
* The divisor.
|
||||
*
|
||||
* @return:
|
||||
* The result of '(a*b)/c'. This function never traps when trying to
|
||||
* divide by zero; it simply returns 'MaxInt' or 'MinInt' depending on
|
||||
* the signs of 'a' and 'b'.
|
||||
*/
|
||||
FT_BASE( FT_Long )
|
||||
FT_MulDiv_No_Round( FT_Long a,
|
||||
FT_Long b,
|
||||
FT_Long c );
|
||||
|
||||
|
||||
/*
|
||||
* A variant of FT_Matrix_Multiply which scales its result afterwards. The
|
||||
* idea is that both `a' and `b' are scaled by factors of 10 so that the
|
||||
* values are as precise as possible to get a correct result during the
|
||||
* 64bit multiplication. Let `sa' and `sb' be the scaling factors of `a'
|
||||
* and `b', respectively, then the scaling factor of the result is `sa*sb'.
|
||||
*/
|
||||
FT_BASE( void )
|
||||
FT_Matrix_Multiply_Scaled( const FT_Matrix* a,
|
||||
FT_Matrix *b,
|
||||
FT_Long scaling );
|
||||
|
||||
|
||||
/*
|
||||
* Check a matrix. If the transformation would lead to extreme shear or
|
||||
* extreme scaling, for example, return 0. If everything is OK, return 1.
|
||||
*
|
||||
* Based on geometric considerations we use the following inequality to
|
||||
* identify a degenerate matrix.
|
||||
*
|
||||
* 50 * abs(xx*yy - xy*yx) < xx^2 + xy^2 + yx^2 + yy^2
|
||||
*
|
||||
* Value 50 is heuristic.
|
||||
*/
|
||||
FT_BASE( FT_Bool )
|
||||
FT_Matrix_Check( const FT_Matrix* matrix );
|
||||
|
||||
|
||||
/*
|
||||
* A variant of FT_Vector_Transform. See comments for
|
||||
* FT_Matrix_Multiply_Scaled.
|
||||
*/
|
||||
FT_BASE( void )
|
||||
FT_Vector_Transform_Scaled( FT_Vector* vector,
|
||||
const FT_Matrix* matrix,
|
||||
FT_Long scaling );
|
||||
|
||||
|
||||
/*
|
||||
* This function normalizes a vector and returns its original length. The
|
||||
* normalized vector is a 16.16 fixed-point unit vector with length close
|
||||
* to 0x10000. The accuracy of the returned length is limited to 16 bits
|
||||
* also. The function utilizes quick inverse square root approximation
|
||||
* without divisions and square roots relying on Newton's iterations
|
||||
* instead.
|
||||
*/
|
||||
FT_BASE( FT_UInt32 )
|
||||
FT_Vector_NormLen( FT_Vector* vector );
|
||||
|
||||
|
||||
/*
|
||||
* Return -1, 0, or +1, depending on the orientation of a given corner. We
|
||||
* use the Cartesian coordinate system, with positive vertical values going
|
||||
* upwards. The function returns +1 if the corner turns to the left, -1 to
|
||||
* the right, and 0 for undecidable cases.
|
||||
*/
|
||||
FT_BASE( FT_Int )
|
||||
ft_corner_orientation( FT_Pos in_x,
|
||||
FT_Pos in_y,
|
||||
FT_Pos out_x,
|
||||
FT_Pos out_y );
|
||||
|
||||
|
||||
/*
|
||||
* Return TRUE if a corner is flat or nearly flat. This is equivalent to
|
||||
* saying that the corner point is close to its neighbors, or inside an
|
||||
* ellipse defined by the neighbor focal points to be more precise.
|
||||
*/
|
||||
FT_BASE( FT_Int )
|
||||
ft_corner_is_flat( FT_Pos in_x,
|
||||
FT_Pos in_y,
|
||||
FT_Pos out_x,
|
||||
FT_Pos out_y );
|
||||
|
||||
|
||||
/*
|
||||
* Return the most significant bit index.
|
||||
*/
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
|
||||
|
||||
#if defined( __GNUC__ ) && \
|
||||
( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) )
|
||||
|
||||
#if FT_SIZEOF_INT == 4
|
||||
|
||||
#define FT_MSB( x ) ( 31 - __builtin_clz( x ) )
|
||||
|
||||
#elif FT_SIZEOF_LONG == 4
|
||||
|
||||
#define FT_MSB( x ) ( 31 - __builtin_clzl( x ) )
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
|
||||
#elif defined( _MSC_VER ) && ( _MSC_VER >= 1400 )
|
||||
|
||||
#if FT_SIZEOF_INT == 4
|
||||
|
||||
#include <intrin.h>
|
||||
#pragma intrinsic( _BitScanReverse )
|
||||
|
||||
static __inline FT_Int32
|
||||
FT_MSB_i386( FT_UInt32 x )
|
||||
{
|
||||
unsigned long where;
|
||||
|
||||
|
||||
_BitScanReverse( &where, x );
|
||||
|
||||
return (FT_Int32)where;
|
||||
}
|
||||
|
||||
#define FT_MSB( x ) ( FT_MSB_i386( x ) )
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
|
||||
|
||||
#ifndef FT_MSB
|
||||
|
||||
FT_BASE( FT_Int )
|
||||
FT_MSB( FT_UInt32 z );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses
|
||||
* two fixed-point arguments instead.
|
||||
*/
|
||||
FT_BASE( FT_Fixed )
|
||||
FT_Hypot( FT_Fixed x,
|
||||
FT_Fixed y );
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_SqrtFixed
|
||||
*
|
||||
* @description:
|
||||
* Computes the square root of a 16.16 fixed-point value.
|
||||
*
|
||||
* @input:
|
||||
* x ::
|
||||
* The value to compute the root for.
|
||||
*
|
||||
* @return:
|
||||
* The result of 'sqrt(x)'.
|
||||
*
|
||||
* @note:
|
||||
* This function is not very fast.
|
||||
*/
|
||||
FT_BASE( FT_Int32 )
|
||||
FT_SqrtFixed( FT_Int32 x );
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) * 64 ) /* << 6 */
|
||||
#define INT_TO_F2DOT14( x ) ( (FT_Long)(x) * 16384 ) /* << 14 */
|
||||
#define INT_TO_FIXED( x ) ( (FT_Long)(x) * 65536 ) /* << 16 */
|
||||
#define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) * 4 ) /* << 2 */
|
||||
#define FIXED_TO_INT( x ) ( FT_RoundFix( x ) >> 16 )
|
||||
|
||||
#define ROUND_F26DOT6( x ) ( x >= 0 ? ( ( (x) + 32 ) & -64 ) \
|
||||
: ( -( ( 32 - (x) ) & -64 ) ) )
|
||||
|
||||
/*
|
||||
* The following macros have two purposes.
|
||||
*
|
||||
* - Tag places where overflow is expected and harmless.
|
||||
*
|
||||
* - Avoid run-time sanitizer errors.
|
||||
*
|
||||
* Use with care!
|
||||
*/
|
||||
#define ADD_INT( a, b ) \
|
||||
(FT_Int)( (FT_UInt)(a) + (FT_UInt)(b) )
|
||||
#define SUB_INT( a, b ) \
|
||||
(FT_Int)( (FT_UInt)(a) - (FT_UInt)(b) )
|
||||
#define MUL_INT( a, b ) \
|
||||
(FT_Int)( (FT_UInt)(a) * (FT_UInt)(b) )
|
||||
#define NEG_INT( a ) \
|
||||
(FT_Int)( (FT_UInt)0 - (FT_UInt)(a) )
|
||||
|
||||
#define ADD_LONG( a, b ) \
|
||||
(FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) )
|
||||
#define SUB_LONG( a, b ) \
|
||||
(FT_Long)( (FT_ULong)(a) - (FT_ULong)(b) )
|
||||
#define MUL_LONG( a, b ) \
|
||||
(FT_Long)( (FT_ULong)(a) * (FT_ULong)(b) )
|
||||
#define NEG_LONG( a ) \
|
||||
(FT_Long)( (FT_ULong)0 - (FT_ULong)(a) )
|
||||
|
||||
#define ADD_INT32( a, b ) \
|
||||
(FT_Int32)( (FT_UInt32)(a) + (FT_UInt32)(b) )
|
||||
#define SUB_INT32( a, b ) \
|
||||
(FT_Int32)( (FT_UInt32)(a) - (FT_UInt32)(b) )
|
||||
#define MUL_INT32( a, b ) \
|
||||
(FT_Int32)( (FT_UInt32)(a) * (FT_UInt32)(b) )
|
||||
#define NEG_INT32( a ) \
|
||||
(FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
|
||||
|
||||
#ifdef FT_LONG64
|
||||
|
||||
#define ADD_INT64( a, b ) \
|
||||
(FT_Int64)( (FT_UInt64)(a) + (FT_UInt64)(b) )
|
||||
#define SUB_INT64( a, b ) \
|
||||
(FT_Int64)( (FT_UInt64)(a) - (FT_UInt64)(b) )
|
||||
#define MUL_INT64( a, b ) \
|
||||
(FT_Int64)( (FT_UInt64)(a) * (FT_UInt64)(b) )
|
||||
#define NEG_INT64( a ) \
|
||||
(FT_Int64)( (FT_UInt64)0 - (FT_UInt64)(a) )
|
||||
|
||||
#endif /* FT_LONG64 */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTCALC_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
283
includes/freetype/internal/ftdebug.h
Normal file
283
includes/freetype/internal/ftdebug.h
Normal file
@@ -0,0 +1,283 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftdebug.h
|
||||
*
|
||||
* Debugging and logging component (specification).
|
||||
*
|
||||
* Copyright (C) 1996-2020 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.
|
||||
*
|
||||
*
|
||||
* IMPORTANT: A description of FreeType's debugging support can be
|
||||
* found in 'docs/DEBUG.TXT'. Read it if you need to use or
|
||||
* understand this code.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTDEBUG_H_
|
||||
#define FTDEBUG_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_CONFIG_H
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */
|
||||
/* is already defined; this simplifies the following #ifdefs */
|
||||
/* */
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
#undef FT_DEBUG_LEVEL_ERROR
|
||||
#define FT_DEBUG_LEVEL_ERROR
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Define the trace enums as well as the trace levels array when they are
|
||||
* needed.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
|
||||
#define FT_TRACE_DEF( x ) trace_ ## x ,
|
||||
|
||||
/* defining the enumeration */
|
||||
typedef enum FT_Trace_
|
||||
{
|
||||
#include FT_INTERNAL_TRACE_H
|
||||
trace_count
|
||||
|
||||
} FT_Trace;
|
||||
|
||||
|
||||
/* a pointer to the array of trace levels, */
|
||||
/* provided by `src/base/ftdebug.c' */
|
||||
extern int* ft_trace_levels;
|
||||
|
||||
#undef FT_TRACE_DEF
|
||||
|
||||
#endif /* FT_DEBUG_LEVEL_TRACE */
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Define the FT_TRACE macro
|
||||
*
|
||||
* IMPORTANT!
|
||||
*
|
||||
* Each component must define the macro FT_COMPONENT to a valid FT_Trace
|
||||
* value before using any TRACE macro.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
|
||||
/* we need two macros here to make cpp expand `FT_COMPONENT' */
|
||||
#define FT_TRACE_COMP( x ) FT_TRACE_COMP_( x )
|
||||
#define FT_TRACE_COMP_( x ) trace_ ## x
|
||||
|
||||
#define FT_TRACE( level, varformat ) \
|
||||
do \
|
||||
{ \
|
||||
if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
|
||||
FT_Message varformat; \
|
||||
} while ( 0 )
|
||||
|
||||
#else /* !FT_DEBUG_LEVEL_TRACE */
|
||||
|
||||
#define FT_TRACE( level, varformat ) do { } while ( 0 ) /* nothing */
|
||||
|
||||
#endif /* !FT_DEBUG_LEVEL_TRACE */
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Trace_Get_Count
|
||||
*
|
||||
* @description:
|
||||
* Return the number of available trace components.
|
||||
*
|
||||
* @return:
|
||||
* The number of trace components. 0 if FreeType 2 is not built with
|
||||
* FT_DEBUG_LEVEL_TRACE definition.
|
||||
*
|
||||
* @note:
|
||||
* This function may be useful if you want to access elements of the
|
||||
* internal trace levels array by an index.
|
||||
*/
|
||||
FT_BASE( FT_Int )
|
||||
FT_Trace_Get_Count( void );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Trace_Get_Name
|
||||
*
|
||||
* @description:
|
||||
* Return the name of a trace component.
|
||||
*
|
||||
* @input:
|
||||
* The index of the trace component.
|
||||
*
|
||||
* @return:
|
||||
* The name of the trace component. This is a statically allocated
|
||||
* C~string, so do not free it after use. `NULL` if FreeType is not
|
||||
* built with FT_DEBUG_LEVEL_TRACE definition.
|
||||
*
|
||||
* @note:
|
||||
* Use @FT_Trace_Get_Count to get the number of available trace
|
||||
* components.
|
||||
*/
|
||||
FT_BASE( const char* )
|
||||
FT_Trace_Get_Name( FT_Int idx );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Trace_Disable
|
||||
*
|
||||
* @description:
|
||||
* Switch off tracing temporarily. It can be activated again with
|
||||
* @FT_Trace_Enable.
|
||||
*/
|
||||
FT_BASE( void )
|
||||
FT_Trace_Disable( void );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Trace_Enable
|
||||
*
|
||||
* @description:
|
||||
* Activate tracing. Use it after tracing has been switched off with
|
||||
* @FT_Trace_Disable.
|
||||
*/
|
||||
FT_BASE( void )
|
||||
FT_Trace_Enable( void );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* You need two opening and closing parentheses!
|
||||
*
|
||||
* Example: FT_TRACE0(( "Value is %i", foo ))
|
||||
*
|
||||
* Output of the FT_TRACEX macros is sent to stderr.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT_TRACE0( varformat ) FT_TRACE( 0, varformat )
|
||||
#define FT_TRACE1( varformat ) FT_TRACE( 1, varformat )
|
||||
#define FT_TRACE2( varformat ) FT_TRACE( 2, varformat )
|
||||
#define FT_TRACE3( varformat ) FT_TRACE( 3, varformat )
|
||||
#define FT_TRACE4( varformat ) FT_TRACE( 4, varformat )
|
||||
#define FT_TRACE5( varformat ) FT_TRACE( 5, varformat )
|
||||
#define FT_TRACE6( varformat ) FT_TRACE( 6, varformat )
|
||||
#define FT_TRACE7( varformat ) FT_TRACE( 7, varformat )
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Define the FT_ERROR macro.
|
||||
*
|
||||
* Output of this macro is sent to stderr.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_ERROR
|
||||
|
||||
#define FT_ERROR( varformat ) FT_Message varformat
|
||||
|
||||
#else /* !FT_DEBUG_LEVEL_ERROR */
|
||||
|
||||
#define FT_ERROR( varformat ) do { } while ( 0 ) /* nothing */
|
||||
|
||||
#endif /* !FT_DEBUG_LEVEL_ERROR */
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Define the FT_ASSERT and FT_THROW macros. The call to `FT_Throw` makes
|
||||
* it possible to easily set a breakpoint at this function.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_ERROR
|
||||
|
||||
#define FT_ASSERT( condition ) \
|
||||
do \
|
||||
{ \
|
||||
if ( !( condition ) ) \
|
||||
FT_Panic( "assertion failed on line %d of file %s\n", \
|
||||
__LINE__, __FILE__ ); \
|
||||
} while ( 0 )
|
||||
|
||||
#define FT_THROW( e ) \
|
||||
( FT_Throw( FT_ERR_CAT( FT_ERR_PREFIX, e ), \
|
||||
__LINE__, \
|
||||
__FILE__ ) | \
|
||||
FT_ERR_CAT( FT_ERR_PREFIX, e ) )
|
||||
|
||||
#else /* !FT_DEBUG_LEVEL_ERROR */
|
||||
|
||||
#define FT_ASSERT( condition ) do { } while ( 0 )
|
||||
|
||||
#define FT_THROW( e ) FT_ERR_CAT( FT_ERR_PREFIX, e )
|
||||
|
||||
#endif /* !FT_DEBUG_LEVEL_ERROR */
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Define `FT_Message` and `FT_Panic` when needed.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_ERROR
|
||||
|
||||
#include "stdio.h" /* for vfprintf() */
|
||||
|
||||
/* print a message */
|
||||
FT_BASE( void )
|
||||
FT_Message( const char* fmt,
|
||||
... );
|
||||
|
||||
/* print a message and exit */
|
||||
FT_BASE( void )
|
||||
FT_Panic( const char* fmt,
|
||||
... );
|
||||
|
||||
/* report file name and line number of an error */
|
||||
FT_BASE( int )
|
||||
FT_Throw( FT_Error error,
|
||||
int line,
|
||||
const char* file );
|
||||
|
||||
#endif /* FT_DEBUG_LEVEL_ERROR */
|
||||
|
||||
|
||||
FT_BASE( void )
|
||||
ft_debug_init( void );
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTDEBUG_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
288
includes/freetype/internal/ftdrv.h
Normal file
288
includes/freetype/internal/ftdrv.h
Normal file
@@ -0,0 +1,288 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftdrv.h
|
||||
*
|
||||
* FreeType internal font driver interface (specification).
|
||||
*
|
||||
* Copyright (C) 1996-2020 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 FTDRV_H_
|
||||
#define FTDRV_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_MODULE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Face_InitFunc)( FT_Stream stream,
|
||||
FT_Face face,
|
||||
FT_Int typeface_index,
|
||||
FT_Int num_params,
|
||||
FT_Parameter* parameters );
|
||||
|
||||
typedef void
|
||||
(*FT_Face_DoneFunc)( FT_Face face );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Size_InitFunc)( FT_Size size );
|
||||
|
||||
typedef void
|
||||
(*FT_Size_DoneFunc)( FT_Size size );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Slot_InitFunc)( FT_GlyphSlot slot );
|
||||
|
||||
typedef void
|
||||
(*FT_Slot_DoneFunc)( FT_GlyphSlot slot );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Size_RequestFunc)( FT_Size size,
|
||||
FT_Size_Request req );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Size_SelectFunc)( FT_Size size,
|
||||
FT_ULong size_index );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
|
||||
FT_Size size,
|
||||
FT_UInt glyph_index,
|
||||
FT_Int32 load_flags );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Face_GetKerningFunc)( FT_Face face,
|
||||
FT_UInt left_glyph,
|
||||
FT_UInt right_glyph,
|
||||
FT_Vector* kerning );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Face_AttachFunc)( FT_Face face,
|
||||
FT_Stream stream );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Face_GetAdvancesFunc)( FT_Face face,
|
||||
FT_UInt first,
|
||||
FT_UInt count,
|
||||
FT_Int32 flags,
|
||||
FT_Fixed* advances );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_Driver_ClassRec
|
||||
*
|
||||
* @description:
|
||||
* The font driver class. This structure mostly contains pointers to
|
||||
* driver methods.
|
||||
*
|
||||
* @fields:
|
||||
* root ::
|
||||
* The parent module.
|
||||
*
|
||||
* face_object_size ::
|
||||
* The size of a face object in bytes.
|
||||
*
|
||||
* size_object_size ::
|
||||
* The size of a size object in bytes.
|
||||
*
|
||||
* slot_object_size ::
|
||||
* The size of a glyph object in bytes.
|
||||
*
|
||||
* init_face ::
|
||||
* The format-specific face constructor.
|
||||
*
|
||||
* done_face ::
|
||||
* The format-specific face destructor.
|
||||
*
|
||||
* init_size ::
|
||||
* The format-specific size constructor.
|
||||
*
|
||||
* done_size ::
|
||||
* The format-specific size destructor.
|
||||
*
|
||||
* init_slot ::
|
||||
* The format-specific slot constructor.
|
||||
*
|
||||
* done_slot ::
|
||||
* The format-specific slot destructor.
|
||||
*
|
||||
*
|
||||
* load_glyph ::
|
||||
* A function handle to load a glyph to a slot. This field is
|
||||
* mandatory!
|
||||
*
|
||||
* get_kerning ::
|
||||
* A function handle to return the unscaled kerning for a given pair of
|
||||
* glyphs. Can be set to 0 if the format doesn't support kerning.
|
||||
*
|
||||
* attach_file ::
|
||||
* This function handle is used to read additional data for a face from
|
||||
* another file/stream. For example, this can be used to add data from
|
||||
* AFM or PFM files on a Type 1 face, or a CIDMap on a CID-keyed face.
|
||||
*
|
||||
* get_advances ::
|
||||
* A function handle used to return advance widths of 'count' glyphs
|
||||
* (in font units), starting at 'first'. The 'vertical' flag must be
|
||||
* set to get vertical advance heights. The 'advances' buffer is
|
||||
* caller-allocated. The idea of this function is to be able to
|
||||
* perform device-independent text layout without loading a single
|
||||
* glyph image.
|
||||
*
|
||||
* request_size ::
|
||||
* A handle to a function used to request the new character size. Can
|
||||
* be set to 0 if the scaling done in the base layer suffices.
|
||||
*
|
||||
* select_size ::
|
||||
* A handle to a function used to select a new fixed size. It is used
|
||||
* only if @FT_FACE_FLAG_FIXED_SIZES is set. Can be set to 0 if the
|
||||
* scaling done in the base layer suffices.
|
||||
* @note:
|
||||
* Most function pointers, with the exception of `load_glyph`, can be set
|
||||
* to 0 to indicate a default behaviour.
|
||||
*/
|
||||
typedef struct FT_Driver_ClassRec_
|
||||
{
|
||||
FT_Module_Class root;
|
||||
|
||||
FT_Long face_object_size;
|
||||
FT_Long size_object_size;
|
||||
FT_Long slot_object_size;
|
||||
|
||||
FT_Face_InitFunc init_face;
|
||||
FT_Face_DoneFunc done_face;
|
||||
|
||||
FT_Size_InitFunc init_size;
|
||||
FT_Size_DoneFunc done_size;
|
||||
|
||||
FT_Slot_InitFunc init_slot;
|
||||
FT_Slot_DoneFunc done_slot;
|
||||
|
||||
FT_Slot_LoadFunc load_glyph;
|
||||
|
||||
FT_Face_GetKerningFunc get_kerning;
|
||||
FT_Face_AttachFunc attach_file;
|
||||
FT_Face_GetAdvancesFunc get_advances;
|
||||
|
||||
/* since version 2.2 */
|
||||
FT_Size_RequestFunc request_size;
|
||||
FT_Size_SelectFunc select_size;
|
||||
|
||||
} FT_Driver_ClassRec, *FT_Driver_Class;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_DECLARE_DRIVER
|
||||
*
|
||||
* @description:
|
||||
* Used to create a forward declaration of an FT_Driver_ClassRec struct
|
||||
* instance.
|
||||
*
|
||||
* @macro:
|
||||
* FT_DEFINE_DRIVER
|
||||
*
|
||||
* @description:
|
||||
* Used to initialize an instance of FT_Driver_ClassRec struct.
|
||||
*
|
||||
* `ftinit.c` (ft_create_default_module_classes) already contains a
|
||||
* mechanism to call these functions for the default modules described in
|
||||
* `ftmodule.h`.
|
||||
*
|
||||
* The struct will be allocated in the global scope (or the scope where
|
||||
* the macro is used).
|
||||
*/
|
||||
#define FT_DECLARE_DRIVER( class_ ) \
|
||||
FT_CALLBACK_TABLE \
|
||||
const FT_Driver_ClassRec class_;
|
||||
|
||||
#define FT_DEFINE_DRIVER( \
|
||||
class_, \
|
||||
flags_, \
|
||||
size_, \
|
||||
name_, \
|
||||
version_, \
|
||||
requires_, \
|
||||
interface_, \
|
||||
init_, \
|
||||
done_, \
|
||||
get_interface_, \
|
||||
face_object_size_, \
|
||||
size_object_size_, \
|
||||
slot_object_size_, \
|
||||
init_face_, \
|
||||
done_face_, \
|
||||
init_size_, \
|
||||
done_size_, \
|
||||
init_slot_, \
|
||||
done_slot_, \
|
||||
load_glyph_, \
|
||||
get_kerning_, \
|
||||
attach_file_, \
|
||||
get_advances_, \
|
||||
request_size_, \
|
||||
select_size_ ) \
|
||||
FT_CALLBACK_TABLE_DEF \
|
||||
const FT_Driver_ClassRec class_ = \
|
||||
{ \
|
||||
FT_DEFINE_ROOT_MODULE( flags_, \
|
||||
size_, \
|
||||
name_, \
|
||||
version_, \
|
||||
requires_, \
|
||||
interface_, \
|
||||
init_, \
|
||||
done_, \
|
||||
get_interface_ ) \
|
||||
\
|
||||
face_object_size_, \
|
||||
size_object_size_, \
|
||||
slot_object_size_, \
|
||||
\
|
||||
init_face_, \
|
||||
done_face_, \
|
||||
\
|
||||
init_size_, \
|
||||
done_size_, \
|
||||
\
|
||||
init_slot_, \
|
||||
done_slot_, \
|
||||
\
|
||||
load_glyph_, \
|
||||
\
|
||||
get_kerning_, \
|
||||
attach_file_, \
|
||||
get_advances_, \
|
||||
\
|
||||
request_size_, \
|
||||
select_size_ \
|
||||
};
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTDRV_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
149
includes/freetype/internal/ftgloadr.h
Normal file
149
includes/freetype/internal/ftgloadr.h
Normal file
@@ -0,0 +1,149 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftgloadr.h
|
||||
*
|
||||
* The FreeType glyph loader (specification).
|
||||
*
|
||||
* Copyright (C) 2002-2020 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 FTGLOADR_H_
|
||||
#define FTGLOADR_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FT_GlyphLoader
|
||||
*
|
||||
* @description:
|
||||
* The glyph loader is an internal object used to load several glyphs
|
||||
* together (for example, in the case of composites).
|
||||
*/
|
||||
typedef struct FT_SubGlyphRec_
|
||||
{
|
||||
FT_Int index;
|
||||
FT_UShort flags;
|
||||
FT_Int arg1;
|
||||
FT_Int arg2;
|
||||
FT_Matrix transform;
|
||||
|
||||
} FT_SubGlyphRec;
|
||||
|
||||
|
||||
typedef struct FT_GlyphLoadRec_
|
||||
{
|
||||
FT_Outline outline; /* outline */
|
||||
FT_Vector* extra_points; /* extra points table */
|
||||
FT_Vector* extra_points2; /* second extra points table */
|
||||
FT_UInt num_subglyphs; /* number of subglyphs */
|
||||
FT_SubGlyph subglyphs; /* subglyphs */
|
||||
|
||||
} FT_GlyphLoadRec, *FT_GlyphLoad;
|
||||
|
||||
|
||||
typedef struct FT_GlyphLoaderRec_
|
||||
{
|
||||
FT_Memory memory;
|
||||
FT_UInt max_points;
|
||||
FT_UInt max_contours;
|
||||
FT_UInt max_subglyphs;
|
||||
FT_Bool use_extra;
|
||||
|
||||
FT_GlyphLoadRec base;
|
||||
FT_GlyphLoadRec current;
|
||||
|
||||
void* other; /* for possible future extension? */
|
||||
|
||||
} FT_GlyphLoaderRec, *FT_GlyphLoader;
|
||||
|
||||
|
||||
/* create new empty glyph loader */
|
||||
FT_BASE( FT_Error )
|
||||
FT_GlyphLoader_New( FT_Memory memory,
|
||||
FT_GlyphLoader *aloader );
|
||||
|
||||
/* add an extra points table to a glyph loader */
|
||||
FT_BASE( FT_Error )
|
||||
FT_GlyphLoader_CreateExtra( FT_GlyphLoader loader );
|
||||
|
||||
/* destroy a glyph loader */
|
||||
FT_BASE( void )
|
||||
FT_GlyphLoader_Done( FT_GlyphLoader loader );
|
||||
|
||||
/* reset a glyph loader (frees everything int it) */
|
||||
FT_BASE( void )
|
||||
FT_GlyphLoader_Reset( FT_GlyphLoader loader );
|
||||
|
||||
/* rewind a glyph loader */
|
||||
FT_BASE( void )
|
||||
FT_GlyphLoader_Rewind( FT_GlyphLoader loader );
|
||||
|
||||
/* check that there is enough space to add `n_points' and `n_contours' */
|
||||
/* to the glyph loader */
|
||||
FT_BASE( FT_Error )
|
||||
FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader,
|
||||
FT_UInt n_points,
|
||||
FT_UInt n_contours );
|
||||
|
||||
|
||||
#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \
|
||||
( (_count) == 0 || \
|
||||
( (FT_UInt)(_loader)->base.outline.n_points + \
|
||||
(FT_UInt)(_loader)->current.outline.n_points + \
|
||||
(FT_UInt)(_count) ) <= (_loader)->max_points )
|
||||
|
||||
#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \
|
||||
( (_count) == 0 || \
|
||||
( (FT_UInt)(_loader)->base.outline.n_contours + \
|
||||
(FT_UInt)(_loader)->current.outline.n_contours + \
|
||||
(FT_UInt)(_count) ) <= (_loader)->max_contours )
|
||||
|
||||
#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points, _contours ) \
|
||||
( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \
|
||||
FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \
|
||||
? 0 \
|
||||
: FT_GlyphLoader_CheckPoints( (_loader), \
|
||||
(FT_UInt)(_points), \
|
||||
(FT_UInt)(_contours) ) )
|
||||
|
||||
|
||||
/* check that there is enough space to add `n_subs' sub-glyphs to */
|
||||
/* a glyph loader */
|
||||
FT_BASE( FT_Error )
|
||||
FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader,
|
||||
FT_UInt n_subs );
|
||||
|
||||
/* prepare a glyph loader, i.e. empty the current glyph */
|
||||
FT_BASE( void )
|
||||
FT_GlyphLoader_Prepare( FT_GlyphLoader loader );
|
||||
|
||||
/* add the current glyph to the base glyph */
|
||||
FT_BASE( void )
|
||||
FT_GlyphLoader_Add( FT_GlyphLoader loader );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTGLOADR_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
136
includes/freetype/internal/fthash.h
Normal file
136
includes/freetype/internal/fthash.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* fthash.h
|
||||
*
|
||||
* Hashing functions (specification).
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2000 Computing Research Labs, New Mexico State University
|
||||
* Copyright 2001-2015
|
||||
* Francesco Zappa Nardelli
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
|
||||
* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50
|
||||
*
|
||||
* taken from Mark Leisher's xmbdfed package
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTHASH_H_
|
||||
#define FTHASH_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef union FT_Hashkey_
|
||||
{
|
||||
FT_Int num;
|
||||
const char* str;
|
||||
|
||||
} FT_Hashkey;
|
||||
|
||||
|
||||
typedef struct FT_HashnodeRec_
|
||||
{
|
||||
FT_Hashkey key;
|
||||
size_t data;
|
||||
|
||||
} FT_HashnodeRec;
|
||||
|
||||
typedef struct FT_HashnodeRec_ *FT_Hashnode;
|
||||
|
||||
|
||||
typedef FT_ULong
|
||||
(*FT_Hash_LookupFunc)( FT_Hashkey* key );
|
||||
|
||||
typedef FT_Bool
|
||||
(*FT_Hash_CompareFunc)( FT_Hashkey* a,
|
||||
FT_Hashkey* b );
|
||||
|
||||
|
||||
typedef struct FT_HashRec_
|
||||
{
|
||||
FT_UInt limit;
|
||||
FT_UInt size;
|
||||
FT_UInt used;
|
||||
|
||||
FT_Hash_LookupFunc lookup;
|
||||
FT_Hash_CompareFunc compare;
|
||||
|
||||
FT_Hashnode* table;
|
||||
|
||||
} FT_HashRec;
|
||||
|
||||
typedef struct FT_HashRec_ *FT_Hash;
|
||||
|
||||
|
||||
FT_Error
|
||||
ft_hash_str_init( FT_Hash hash,
|
||||
FT_Memory memory );
|
||||
|
||||
FT_Error
|
||||
ft_hash_num_init( FT_Hash hash,
|
||||
FT_Memory memory );
|
||||
|
||||
void
|
||||
ft_hash_str_free( FT_Hash hash,
|
||||
FT_Memory memory );
|
||||
|
||||
#define ft_hash_num_free ft_hash_str_free
|
||||
|
||||
FT_Error
|
||||
ft_hash_str_insert( const char* key,
|
||||
size_t data,
|
||||
FT_Hash hash,
|
||||
FT_Memory memory );
|
||||
|
||||
FT_Error
|
||||
ft_hash_num_insert( FT_Int num,
|
||||
size_t data,
|
||||
FT_Hash hash,
|
||||
FT_Memory memory );
|
||||
|
||||
size_t*
|
||||
ft_hash_str_lookup( const char* key,
|
||||
FT_Hash hash );
|
||||
|
||||
size_t*
|
||||
ft_hash_num_lookup( FT_Int num,
|
||||
FT_Hash hash );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* FTHASH_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
400
includes/freetype/internal/ftmemory.h
Normal file
400
includes/freetype/internal/ftmemory.h
Normal file
@@ -0,0 +1,400 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftmemory.h
|
||||
*
|
||||
* The FreeType memory management macros (specification).
|
||||
*
|
||||
* Copyright (C) 1996-2020 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 FTMEMORY_H_
|
||||
#define FTMEMORY_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_CONFIG_H
|
||||
#include FT_TYPES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SET_ERROR
|
||||
*
|
||||
* @description:
|
||||
* This macro is used to set an implicit 'error' variable to a given
|
||||
* expression's value (usually a function call), and convert it to a
|
||||
* boolean which is set whenever the value is != 0.
|
||||
*/
|
||||
#undef FT_SET_ERROR
|
||||
#define FT_SET_ERROR( expression ) \
|
||||
( ( error = (expression) ) != 0 )
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** M E M O R Y ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* The calculation `NULL + n' is undefined in C. Even if the resulting */
|
||||
/* pointer doesn't get dereferenced, this causes warnings with */
|
||||
/* sanitizers. */
|
||||
/* */
|
||||
/* We thus provide a macro that should be used if `base' can be NULL. */
|
||||
#define FT_OFFSET( base, count ) ( (base) ? (base) + (count) : NULL )
|
||||
|
||||
|
||||
/*
|
||||
* C++ refuses to handle statements like p = (void*)anything, with `p' a
|
||||
* typed pointer. Since we don't have a `typeof' operator in standard C++,
|
||||
* we have to use a template to emulate it.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C++"
|
||||
{
|
||||
template <typename T> inline T*
|
||||
cplusplus_typeof( T*,
|
||||
void *v )
|
||||
{
|
||||
return static_cast <T*> ( v );
|
||||
}
|
||||
}
|
||||
|
||||
#define FT_ASSIGNP( p, val ) (p) = cplusplus_typeof( (p), (val) )
|
||||
|
||||
#else
|
||||
|
||||
#define FT_ASSIGNP( p, val ) (p) = (val)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_MEMORY
|
||||
|
||||
FT_BASE( const char* ) _ft_debug_file;
|
||||
FT_BASE( long ) _ft_debug_lineno;
|
||||
|
||||
#define FT_DEBUG_INNER( exp ) ( _ft_debug_file = __FILE__, \
|
||||
_ft_debug_lineno = __LINE__, \
|
||||
(exp) )
|
||||
|
||||
#define FT_ASSIGNP_INNER( p, exp ) ( _ft_debug_file = __FILE__, \
|
||||
_ft_debug_lineno = __LINE__, \
|
||||
FT_ASSIGNP( p, exp ) )
|
||||
|
||||
#else /* !FT_DEBUG_MEMORY */
|
||||
|
||||
#define FT_DEBUG_INNER( exp ) (exp)
|
||||
#define FT_ASSIGNP_INNER( p, exp ) FT_ASSIGNP( p, exp )
|
||||
|
||||
#endif /* !FT_DEBUG_MEMORY */
|
||||
|
||||
|
||||
/*
|
||||
* The allocation functions return a pointer, and the error code is written
|
||||
* to through the `p_error' parameter.
|
||||
*/
|
||||
|
||||
/* The `q' variants of the functions below (`q' for `quick') don't fill */
|
||||
/* the allocated or reallocated memory with zero bytes. */
|
||||
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_alloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
FT_Error *p_error );
|
||||
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_qalloc( FT_Memory memory,
|
||||
FT_Long size,
|
||||
FT_Error *p_error );
|
||||
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_realloc( FT_Memory memory,
|
||||
FT_Long item_size,
|
||||
FT_Long cur_count,
|
||||
FT_Long new_count,
|
||||
void* block,
|
||||
FT_Error *p_error );
|
||||
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_qrealloc( FT_Memory memory,
|
||||
FT_Long item_size,
|
||||
FT_Long cur_count,
|
||||
FT_Long new_count,
|
||||
void* block,
|
||||
FT_Error *p_error );
|
||||
|
||||
FT_BASE( void )
|
||||
ft_mem_free( FT_Memory memory,
|
||||
const void* P );
|
||||
|
||||
|
||||
/* The `Q' variants of the macros below (`Q' for `quick') don't fill */
|
||||
/* the allocated or reallocated memory with zero bytes. */
|
||||
|
||||
#define FT_MEM_ALLOC( ptr, size ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, \
|
||||
(FT_Long)(size), \
|
||||
&error ) )
|
||||
|
||||
#define FT_MEM_FREE( ptr ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FT_DEBUG_INNER( ft_mem_free( memory, (ptr) ) ); \
|
||||
(ptr) = NULL; \
|
||||
FT_END_STMNT
|
||||
|
||||
#define FT_MEM_NEW( ptr ) \
|
||||
FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )
|
||||
|
||||
#define FT_MEM_REALLOC( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
|
||||
1, \
|
||||
(FT_Long)(cursz), \
|
||||
(FT_Long)(newsz), \
|
||||
(ptr), \
|
||||
&error ) )
|
||||
|
||||
#define FT_MEM_QALLOC( ptr, size ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, \
|
||||
(FT_Long)(size), \
|
||||
&error ) )
|
||||
|
||||
#define FT_MEM_QNEW( ptr ) \
|
||||
FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )
|
||||
|
||||
#define FT_MEM_QREALLOC( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
|
||||
1, \
|
||||
(FT_Long)(cursz), \
|
||||
(FT_Long)(newsz), \
|
||||
(ptr), \
|
||||
&error ) )
|
||||
|
||||
#define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
|
||||
(FT_Long)(item_size), \
|
||||
0, \
|
||||
(FT_Long)(count), \
|
||||
NULL, \
|
||||
&error ) )
|
||||
|
||||
#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
|
||||
(FT_Long)(itmsz), \
|
||||
(FT_Long)(oldcnt), \
|
||||
(FT_Long)(newcnt), \
|
||||
(ptr), \
|
||||
&error ) )
|
||||
|
||||
#define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
|
||||
(FT_Long)(item_size), \
|
||||
0, \
|
||||
(FT_Long)(count), \
|
||||
NULL, \
|
||||
&error ) )
|
||||
|
||||
#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
|
||||
(FT_Long)(itmsz), \
|
||||
(FT_Long)(oldcnt), \
|
||||
(FT_Long)(newcnt), \
|
||||
(ptr), \
|
||||
&error ) )
|
||||
|
||||
|
||||
#define FT_MEM_SET_ERROR( cond ) ( (cond), error != 0 )
|
||||
|
||||
|
||||
#define FT_MEM_SET( dest, byte, count ) \
|
||||
ft_memset( dest, byte, (FT_Offset)(count) )
|
||||
|
||||
#define FT_MEM_COPY( dest, source, count ) \
|
||||
ft_memcpy( dest, source, (FT_Offset)(count) )
|
||||
|
||||
#define FT_MEM_MOVE( dest, source, count ) \
|
||||
ft_memmove( dest, source, (FT_Offset)(count) )
|
||||
|
||||
|
||||
#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count )
|
||||
|
||||
#define FT_ZERO( p ) FT_MEM_ZERO( p, sizeof ( *(p) ) )
|
||||
|
||||
|
||||
#define FT_ARRAY_ZERO( dest, count ) \
|
||||
FT_MEM_ZERO( dest, \
|
||||
(FT_Offset)(count) * sizeof ( *(dest) ) )
|
||||
|
||||
#define FT_ARRAY_COPY( dest, source, count ) \
|
||||
FT_MEM_COPY( dest, \
|
||||
source, \
|
||||
(FT_Offset)(count) * sizeof ( *(dest) ) )
|
||||
|
||||
#define FT_ARRAY_MOVE( dest, source, count ) \
|
||||
FT_MEM_MOVE( dest, \
|
||||
source, \
|
||||
(FT_Offset)(count) * sizeof ( *(dest) ) )
|
||||
|
||||
|
||||
/*
|
||||
* Return the maximum number of addressable elements in an array. We limit
|
||||
* ourselves to INT_MAX, rather than UINT_MAX, to avoid any problems.
|
||||
*/
|
||||
#define FT_ARRAY_MAX( ptr ) ( FT_INT_MAX / sizeof ( *(ptr) ) )
|
||||
|
||||
#define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) )
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* The following functions macros expect that their pointer argument is
|
||||
* _typed_ in order to automatically compute array element sizes.
|
||||
*/
|
||||
|
||||
#define FT_MEM_NEW_ARRAY( ptr, count ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
|
||||
sizeof ( *(ptr) ), \
|
||||
0, \
|
||||
(FT_Long)(count), \
|
||||
NULL, \
|
||||
&error ) )
|
||||
|
||||
#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
|
||||
sizeof ( *(ptr) ), \
|
||||
(FT_Long)(cursz), \
|
||||
(FT_Long)(newsz), \
|
||||
(ptr), \
|
||||
&error ) )
|
||||
|
||||
#define FT_MEM_QNEW_ARRAY( ptr, count ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
|
||||
sizeof ( *(ptr) ), \
|
||||
0, \
|
||||
(FT_Long)(count), \
|
||||
NULL, \
|
||||
&error ) )
|
||||
|
||||
#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
|
||||
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
|
||||
sizeof ( *(ptr) ), \
|
||||
(FT_Long)(cursz), \
|
||||
(FT_Long)(newsz), \
|
||||
(ptr), \
|
||||
&error ) )
|
||||
|
||||
#define FT_ALLOC( ptr, size ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )
|
||||
|
||||
#define FT_REALLOC( ptr, cursz, newsz ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )
|
||||
|
||||
#define FT_ALLOC_MULT( ptr, count, item_size ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )
|
||||
|
||||
#define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt, \
|
||||
newcnt, itmsz ) )
|
||||
|
||||
#define FT_QALLOC( ptr, size ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )
|
||||
|
||||
#define FT_QREALLOC( ptr, cursz, newsz ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )
|
||||
|
||||
#define FT_QALLOC_MULT( ptr, count, item_size ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )
|
||||
|
||||
#define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt, \
|
||||
newcnt, itmsz ) )
|
||||
|
||||
#define FT_FREE( ptr ) FT_MEM_FREE( ptr )
|
||||
|
||||
#define FT_NEW( ptr ) FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )
|
||||
|
||||
#define FT_NEW_ARRAY( ptr, count ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
|
||||
|
||||
#define FT_RENEW_ARRAY( ptr, curcnt, newcnt ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
|
||||
|
||||
#define FT_QNEW( ptr ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
|
||||
|
||||
#define FT_QNEW_ARRAY( ptr, count ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
|
||||
|
||||
#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
|
||||
|
||||
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_strdup( FT_Memory memory,
|
||||
const char* str,
|
||||
FT_Error *p_error );
|
||||
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_mem_dup( FT_Memory memory,
|
||||
const void* address,
|
||||
FT_ULong size,
|
||||
FT_Error *p_error );
|
||||
|
||||
|
||||
#define FT_MEM_STRDUP( dst, str ) \
|
||||
(dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )
|
||||
|
||||
#define FT_STRDUP( dst, str ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )
|
||||
|
||||
#define FT_MEM_DUP( dst, address, size ) \
|
||||
(dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )
|
||||
|
||||
#define FT_DUP( dst, address, size ) \
|
||||
FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )
|
||||
|
||||
|
||||
/* Return >= 1 if a truncation occurs. */
|
||||
/* Return 0 if the source string fits the buffer. */
|
||||
/* This is *not* the same as strlcpy(). */
|
||||
FT_BASE( FT_Int )
|
||||
ft_mem_strcpyn( char* dst,
|
||||
const char* src,
|
||||
FT_ULong size );
|
||||
|
||||
#define FT_STRCPYN( dst, src, size ) \
|
||||
ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTMEMORY_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
1234
includes/freetype/internal/ftobjs.h
Normal file
1234
includes/freetype/internal/ftobjs.h
Normal file
File diff suppressed because it is too large
Load Diff
48
includes/freetype/internal/ftpsprop.h
Normal file
48
includes/freetype/internal/ftpsprop.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftpsprop.h
|
||||
*
|
||||
* Get and set properties of PostScript drivers (specification).
|
||||
*
|
||||
* Copyright (C) 2017-2020 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 FTPSPROP_H_
|
||||
#define FTPSPROP_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
FT_BASE_CALLBACK( FT_Error )
|
||||
ps_property_set( FT_Module module, /* PS_Driver */
|
||||
const char* property_name,
|
||||
const void* value,
|
||||
FT_Bool value_is_string );
|
||||
|
||||
FT_BASE_CALLBACK( FT_Error )
|
||||
ps_property_get( FT_Module module, /* PS_Driver */
|
||||
const char* property_name,
|
||||
void* value );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* FTPSPROP_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
246
includes/freetype/internal/ftrfork.h
Normal file
246
includes/freetype/internal/ftrfork.h
Normal file
@@ -0,0 +1,246 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftrfork.h
|
||||
*
|
||||
* Embedded resource forks accessor (specification).
|
||||
*
|
||||
* Copyright (C) 2004-2020 by
|
||||
* Masatake YAMATO and Redhat K.K.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Development of the code in this file is support of
|
||||
* Information-technology Promotion Agency, Japan.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTRFORK_H_
|
||||
#define FTRFORK_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* Number of guessing rules supported in `FT_Raccess_Guess'. */
|
||||
/* Don't forget to increment the number if you add a new guessing rule. */
|
||||
#define FT_RACCESS_N_RULES 9
|
||||
|
||||
|
||||
/* A structure to describe a reference in a resource by its resource ID */
|
||||
/* and internal offset. The `POST' resource expects to be concatenated */
|
||||
/* by the order of resource IDs instead of its appearance in the file. */
|
||||
|
||||
typedef struct FT_RFork_Ref_
|
||||
{
|
||||
FT_Short res_id;
|
||||
FT_Long offset;
|
||||
|
||||
} FT_RFork_Ref;
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
|
||||
typedef FT_Error
|
||||
(*ft_raccess_guess_func)( FT_Library library,
|
||||
FT_Stream stream,
|
||||
char *base_file_name,
|
||||
char **result_file_name,
|
||||
FT_Long *result_offset );
|
||||
|
||||
typedef enum FT_RFork_Rule_ {
|
||||
FT_RFork_Rule_invalid = -2,
|
||||
FT_RFork_Rule_uknown, /* -1 */
|
||||
FT_RFork_Rule_apple_double,
|
||||
FT_RFork_Rule_apple_single,
|
||||
FT_RFork_Rule_darwin_ufs_export,
|
||||
FT_RFork_Rule_darwin_newvfs,
|
||||
FT_RFork_Rule_darwin_hfsplus,
|
||||
FT_RFork_Rule_vfat,
|
||||
FT_RFork_Rule_linux_cap,
|
||||
FT_RFork_Rule_linux_double,
|
||||
FT_RFork_Rule_linux_netatalk
|
||||
} FT_RFork_Rule;
|
||||
|
||||
/* For fast translation between rule index and rule type,
|
||||
* the macros FT_RFORK_xxx should be kept consistent with the
|
||||
* raccess_guess_funcs table
|
||||
*/
|
||||
typedef struct ft_raccess_guess_rec_ {
|
||||
ft_raccess_guess_func func;
|
||||
FT_RFork_Rule type;
|
||||
} ft_raccess_guess_rec;
|
||||
|
||||
|
||||
#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \
|
||||
static const type name[] = {
|
||||
#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix ) \
|
||||
{ raccess_guess_ ## func_suffix, \
|
||||
FT_RFork_Rule_ ## type_suffix },
|
||||
/* this array is a storage, thus a final `;' is needed */
|
||||
#define CONST_FT_RFORK_RULE_ARRAY_END };
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Raccess_Guess
|
||||
*
|
||||
* @description:
|
||||
* Guess a file name and offset where the actual resource fork is stored.
|
||||
* The macro FT_RACCESS_N_RULES holds the number of guessing rules; the
|
||||
* guessed result for the Nth rule is represented as a triplet: a new
|
||||
* file name (new_names[N]), a file offset (offsets[N]), and an error
|
||||
* code (errors[N]).
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A FreeType library instance.
|
||||
*
|
||||
* stream ::
|
||||
* A file stream containing the resource fork.
|
||||
*
|
||||
* base_name ::
|
||||
* The (base) file name of the resource fork used for some guessing
|
||||
* rules.
|
||||
*
|
||||
* @output:
|
||||
* new_names ::
|
||||
* An array of guessed file names in which the resource forks may
|
||||
* exist. If 'new_names[N]' is `NULL`, the guessed file name is equal
|
||||
* to `base_name`.
|
||||
*
|
||||
* offsets ::
|
||||
* An array of guessed file offsets. 'offsets[N]' holds the file
|
||||
* offset of the possible start of the resource fork in file
|
||||
* 'new_names[N]'.
|
||||
*
|
||||
* errors ::
|
||||
* An array of FreeType error codes. 'errors[N]' is the error code of
|
||||
* Nth guessing rule function. If 'errors[N]' is not FT_Err_Ok,
|
||||
* 'new_names[N]' and 'offsets[N]' are meaningless.
|
||||
*/
|
||||
FT_BASE( void )
|
||||
FT_Raccess_Guess( FT_Library library,
|
||||
FT_Stream stream,
|
||||
char* base_name,
|
||||
char** new_names,
|
||||
FT_Long* offsets,
|
||||
FT_Error* errors );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Raccess_Get_HeaderInfo
|
||||
*
|
||||
* @description:
|
||||
* Get the information from the header of resource fork. The information
|
||||
* includes the file offset where the resource map starts, and the file
|
||||
* offset where the resource data starts. `FT_Raccess_Get_DataOffsets`
|
||||
* requires these two data.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A FreeType library instance.
|
||||
*
|
||||
* stream ::
|
||||
* A file stream containing the resource fork.
|
||||
*
|
||||
* rfork_offset ::
|
||||
* The file offset where the resource fork starts.
|
||||
*
|
||||
* @output:
|
||||
* map_offset ::
|
||||
* The file offset where the resource map starts.
|
||||
*
|
||||
* rdata_pos ::
|
||||
* The file offset where the resource data starts.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. FT_Err_Ok means success.
|
||||
*/
|
||||
FT_BASE( FT_Error )
|
||||
FT_Raccess_Get_HeaderInfo( FT_Library library,
|
||||
FT_Stream stream,
|
||||
FT_Long rfork_offset,
|
||||
FT_Long *map_offset,
|
||||
FT_Long *rdata_pos );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Raccess_Get_DataOffsets
|
||||
*
|
||||
* @description:
|
||||
* Get the data offsets for a tag in a resource fork. Offsets are stored
|
||||
* in an array because, in some cases, resources in a resource fork have
|
||||
* the same tag.
|
||||
*
|
||||
* @input:
|
||||
* library ::
|
||||
* A FreeType library instance.
|
||||
*
|
||||
* stream ::
|
||||
* A file stream containing the resource fork.
|
||||
*
|
||||
* map_offset ::
|
||||
* The file offset where the resource map starts.
|
||||
*
|
||||
* rdata_pos ::
|
||||
* The file offset where the resource data starts.
|
||||
*
|
||||
* tag ::
|
||||
* The resource tag.
|
||||
*
|
||||
* sort_by_res_id ::
|
||||
* A Boolean to sort the fragmented resource by their ids. The
|
||||
* fragmented resources for 'POST' resource should be sorted to restore
|
||||
* Type1 font properly. For 'sfnt' resources, sorting may induce a
|
||||
* different order of the faces in comparison to that by QuickDraw API.
|
||||
*
|
||||
* @output:
|
||||
* offsets ::
|
||||
* The stream offsets for the resource data specified by 'tag'. This
|
||||
* array is allocated by the function, so you have to call @ft_mem_free
|
||||
* after use.
|
||||
*
|
||||
* count ::
|
||||
* The length of offsets array.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. FT_Err_Ok means success.
|
||||
*
|
||||
* @note:
|
||||
* Normally you should use `FT_Raccess_Get_HeaderInfo` to get the value
|
||||
* for `map_offset` and `rdata_pos`.
|
||||
*/
|
||||
FT_BASE( FT_Error )
|
||||
FT_Raccess_Get_DataOffsets( FT_Library library,
|
||||
FT_Stream stream,
|
||||
FT_Long map_offset,
|
||||
FT_Long rdata_pos,
|
||||
FT_Long tag,
|
||||
FT_Bool sort_by_res_id,
|
||||
FT_Long **offsets,
|
||||
FT_Long *count );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTRFORK_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
521
includes/freetype/internal/ftserv.h
Normal file
521
includes/freetype/internal/ftserv.h
Normal file
@@ -0,0 +1,521 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftserv.h
|
||||
*
|
||||
* The FreeType services (specification only).
|
||||
*
|
||||
* Copyright (C) 2003-2020 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.
|
||||
*
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Each module can export one or more 'services'. Each service is
|
||||
* identified by a constant string and modeled by a pointer; the latter
|
||||
* generally corresponds to a structure containing function pointers.
|
||||
*
|
||||
* Note that a service's data cannot be a mere function pointer because in
|
||||
* C it is possible that function pointers might be implemented differently
|
||||
* than data pointers (e.g. 48 bits instead of 32).
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FTSERV_H_
|
||||
#define FTSERV_H_
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_FACE_FIND_SERVICE
|
||||
*
|
||||
* @description:
|
||||
* This macro is used to look up a service from a face's driver module.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The source face handle.
|
||||
*
|
||||
* id ::
|
||||
* A string describing the service as defined in the service's header
|
||||
* files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
|
||||
* 'multi-masters'). It is automatically prefixed with
|
||||
* `FT_SERVICE_ID_`.
|
||||
*
|
||||
* @output:
|
||||
* ptr ::
|
||||
* A variable that receives the service pointer. Will be `NULL` if not
|
||||
* found.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
|
||||
#define FT_FACE_FIND_SERVICE( face, ptr, id ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
|
||||
FT_Pointer _tmp_ = NULL; \
|
||||
FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
|
||||
\
|
||||
\
|
||||
if ( module->clazz->get_interface ) \
|
||||
_tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
|
||||
*_pptr_ = _tmp_; \
|
||||
FT_END_STMNT
|
||||
|
||||
#else /* !C++ */
|
||||
|
||||
#define FT_FACE_FIND_SERVICE( face, ptr, id ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
|
||||
FT_Pointer _tmp_ = NULL; \
|
||||
\
|
||||
if ( module->clazz->get_interface ) \
|
||||
_tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
|
||||
ptr = _tmp_; \
|
||||
FT_END_STMNT
|
||||
|
||||
#endif /* !C++ */
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_FACE_FIND_GLOBAL_SERVICE
|
||||
*
|
||||
* @description:
|
||||
* This macro is used to look up a service from all modules.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The source face handle.
|
||||
*
|
||||
* id ::
|
||||
* A string describing the service as defined in the service's header
|
||||
* files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
|
||||
* 'multi-masters'). It is automatically prefixed with
|
||||
* `FT_SERVICE_ID_`.
|
||||
*
|
||||
* @output:
|
||||
* ptr ::
|
||||
* A variable that receives the service pointer. Will be `NULL` if not
|
||||
* found.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
|
||||
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
|
||||
FT_Pointer _tmp_; \
|
||||
FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
|
||||
\
|
||||
\
|
||||
_tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id, 1 ); \
|
||||
*_pptr_ = _tmp_; \
|
||||
FT_END_STMNT
|
||||
|
||||
#else /* !C++ */
|
||||
|
||||
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
|
||||
FT_Pointer _tmp_; \
|
||||
\
|
||||
\
|
||||
_tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id, 1 ); \
|
||||
ptr = _tmp_; \
|
||||
FT_END_STMNT
|
||||
|
||||
#endif /* !C++ */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** S E R V I C E D E S C R I P T O R S *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* The following structure is used to _describe_ a given service to the
|
||||
* library. This is useful to build simple static service lists.
|
||||
*/
|
||||
typedef struct FT_ServiceDescRec_
|
||||
{
|
||||
const char* serv_id; /* service name */
|
||||
const void* serv_data; /* service pointer/data */
|
||||
|
||||
} FT_ServiceDescRec;
|
||||
|
||||
typedef const FT_ServiceDescRec* FT_ServiceDesc;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_DEFINE_SERVICEDESCREC1
|
||||
* FT_DEFINE_SERVICEDESCREC2
|
||||
* FT_DEFINE_SERVICEDESCREC3
|
||||
* FT_DEFINE_SERVICEDESCREC4
|
||||
* FT_DEFINE_SERVICEDESCREC5
|
||||
* FT_DEFINE_SERVICEDESCREC6
|
||||
* FT_DEFINE_SERVICEDESCREC7
|
||||
* FT_DEFINE_SERVICEDESCREC8
|
||||
* FT_DEFINE_SERVICEDESCREC9
|
||||
* FT_DEFINE_SERVICEDESCREC10
|
||||
*
|
||||
* @description:
|
||||
* Used to initialize an array of FT_ServiceDescRec structures.
|
||||
*
|
||||
* The array will be allocated in the global scope (or the scope where
|
||||
* the macro is used).
|
||||
*/
|
||||
#define FT_DEFINE_SERVICEDESCREC1( class_, \
|
||||
serv_id_1, serv_data_1 ) \
|
||||
static const FT_ServiceDescRec class_[] = \
|
||||
{ \
|
||||
{ serv_id_1, serv_data_1 }, \
|
||||
{ NULL, NULL } \
|
||||
};
|
||||
|
||||
#define FT_DEFINE_SERVICEDESCREC2( class_, \
|
||||
serv_id_1, serv_data_1, \
|
||||
serv_id_2, serv_data_2 ) \
|
||||
static const FT_ServiceDescRec class_[] = \
|
||||
{ \
|
||||
{ serv_id_1, serv_data_1 }, \
|
||||
{ serv_id_2, serv_data_2 }, \
|
||||
{ NULL, NULL } \
|
||||
};
|
||||
|
||||
#define FT_DEFINE_SERVICEDESCREC3( class_, \
|
||||
serv_id_1, serv_data_1, \
|
||||
serv_id_2, serv_data_2, \
|
||||
serv_id_3, serv_data_3 ) \
|
||||
static const FT_ServiceDescRec class_[] = \
|
||||
{ \
|
||||
{ serv_id_1, serv_data_1 }, \
|
||||
{ serv_id_2, serv_data_2 }, \
|
||||
{ serv_id_3, serv_data_3 }, \
|
||||
{ NULL, NULL } \
|
||||
};
|
||||
|
||||
#define FT_DEFINE_SERVICEDESCREC4( class_, \
|
||||
serv_id_1, serv_data_1, \
|
||||
serv_id_2, serv_data_2, \
|
||||
serv_id_3, serv_data_3, \
|
||||
serv_id_4, serv_data_4 ) \
|
||||
static const FT_ServiceDescRec class_[] = \
|
||||
{ \
|
||||
{ serv_id_1, serv_data_1 }, \
|
||||
{ serv_id_2, serv_data_2 }, \
|
||||
{ serv_id_3, serv_data_3 }, \
|
||||
{ serv_id_4, serv_data_4 }, \
|
||||
{ NULL, NULL } \
|
||||
};
|
||||
|
||||
#define FT_DEFINE_SERVICEDESCREC5( class_, \
|
||||
serv_id_1, serv_data_1, \
|
||||
serv_id_2, serv_data_2, \
|
||||
serv_id_3, serv_data_3, \
|
||||
serv_id_4, serv_data_4, \
|
||||
serv_id_5, serv_data_5 ) \
|
||||
static const FT_ServiceDescRec class_[] = \
|
||||
{ \
|
||||
{ serv_id_1, serv_data_1 }, \
|
||||
{ serv_id_2, serv_data_2 }, \
|
||||
{ serv_id_3, serv_data_3 }, \
|
||||
{ serv_id_4, serv_data_4 }, \
|
||||
{ serv_id_5, serv_data_5 }, \
|
||||
{ NULL, NULL } \
|
||||
};
|
||||
|
||||
#define FT_DEFINE_SERVICEDESCREC6( class_, \
|
||||
serv_id_1, serv_data_1, \
|
||||
serv_id_2, serv_data_2, \
|
||||
serv_id_3, serv_data_3, \
|
||||
serv_id_4, serv_data_4, \
|
||||
serv_id_5, serv_data_5, \
|
||||
serv_id_6, serv_data_6 ) \
|
||||
static const FT_ServiceDescRec class_[] = \
|
||||
{ \
|
||||
{ serv_id_1, serv_data_1 }, \
|
||||
{ serv_id_2, serv_data_2 }, \
|
||||
{ serv_id_3, serv_data_3 }, \
|
||||
{ serv_id_4, serv_data_4 }, \
|
||||
{ serv_id_5, serv_data_5 }, \
|
||||
{ serv_id_6, serv_data_6 }, \
|
||||
{ NULL, NULL } \
|
||||
};
|
||||
|
||||
#define FT_DEFINE_SERVICEDESCREC7( class_, \
|
||||
serv_id_1, serv_data_1, \
|
||||
serv_id_2, serv_data_2, \
|
||||
serv_id_3, serv_data_3, \
|
||||
serv_id_4, serv_data_4, \
|
||||
serv_id_5, serv_data_5, \
|
||||
serv_id_6, serv_data_6, \
|
||||
serv_id_7, serv_data_7 ) \
|
||||
static const FT_ServiceDescRec class_[] = \
|
||||
{ \
|
||||
{ serv_id_1, serv_data_1 }, \
|
||||
{ serv_id_2, serv_data_2 }, \
|
||||
{ serv_id_3, serv_data_3 }, \
|
||||
{ serv_id_4, serv_data_4 }, \
|
||||
{ serv_id_5, serv_data_5 }, \
|
||||
{ serv_id_6, serv_data_6 }, \
|
||||
{ serv_id_7, serv_data_7 }, \
|
||||
{ NULL, NULL } \
|
||||
};
|
||||
|
||||
#define FT_DEFINE_SERVICEDESCREC8( class_, \
|
||||
serv_id_1, serv_data_1, \
|
||||
serv_id_2, serv_data_2, \
|
||||
serv_id_3, serv_data_3, \
|
||||
serv_id_4, serv_data_4, \
|
||||
serv_id_5, serv_data_5, \
|
||||
serv_id_6, serv_data_6, \
|
||||
serv_id_7, serv_data_7, \
|
||||
serv_id_8, serv_data_8 ) \
|
||||
static const FT_ServiceDescRec class_[] = \
|
||||
{ \
|
||||
{ serv_id_1, serv_data_1 }, \
|
||||
{ serv_id_2, serv_data_2 }, \
|
||||
{ serv_id_3, serv_data_3 }, \
|
||||
{ serv_id_4, serv_data_4 }, \
|
||||
{ serv_id_5, serv_data_5 }, \
|
||||
{ serv_id_6, serv_data_6 }, \
|
||||
{ serv_id_7, serv_data_7 }, \
|
||||
{ serv_id_8, serv_data_8 }, \
|
||||
{ NULL, NULL } \
|
||||
};
|
||||
|
||||
#define FT_DEFINE_SERVICEDESCREC9( class_, \
|
||||
serv_id_1, serv_data_1, \
|
||||
serv_id_2, serv_data_2, \
|
||||
serv_id_3, serv_data_3, \
|
||||
serv_id_4, serv_data_4, \
|
||||
serv_id_5, serv_data_5, \
|
||||
serv_id_6, serv_data_6, \
|
||||
serv_id_7, serv_data_7, \
|
||||
serv_id_8, serv_data_8, \
|
||||
serv_id_9, serv_data_9 ) \
|
||||
static const FT_ServiceDescRec class_[] = \
|
||||
{ \
|
||||
{ serv_id_1, serv_data_1 }, \
|
||||
{ serv_id_2, serv_data_2 }, \
|
||||
{ serv_id_3, serv_data_3 }, \
|
||||
{ serv_id_4, serv_data_4 }, \
|
||||
{ serv_id_5, serv_data_5 }, \
|
||||
{ serv_id_6, serv_data_6 }, \
|
||||
{ serv_id_7, serv_data_7 }, \
|
||||
{ serv_id_8, serv_data_8 }, \
|
||||
{ serv_id_9, serv_data_9 }, \
|
||||
{ NULL, NULL } \
|
||||
};
|
||||
|
||||
#define FT_DEFINE_SERVICEDESCREC10( class_, \
|
||||
serv_id_1, serv_data_1, \
|
||||
serv_id_2, serv_data_2, \
|
||||
serv_id_3, serv_data_3, \
|
||||
serv_id_4, serv_data_4, \
|
||||
serv_id_5, serv_data_5, \
|
||||
serv_id_6, serv_data_6, \
|
||||
serv_id_7, serv_data_7, \
|
||||
serv_id_8, serv_data_8, \
|
||||
serv_id_9, serv_data_9, \
|
||||
serv_id_10, serv_data_10 ) \
|
||||
static const FT_ServiceDescRec class_[] = \
|
||||
{ \
|
||||
{ serv_id_1, serv_data_1 }, \
|
||||
{ serv_id_2, serv_data_2 }, \
|
||||
{ serv_id_3, serv_data_3 }, \
|
||||
{ serv_id_4, serv_data_4 }, \
|
||||
{ serv_id_5, serv_data_5 }, \
|
||||
{ serv_id_6, serv_data_6 }, \
|
||||
{ serv_id_7, serv_data_7 }, \
|
||||
{ serv_id_8, serv_data_8 }, \
|
||||
{ serv_id_9, serv_data_9 }, \
|
||||
{ serv_id_10, serv_data_10 }, \
|
||||
{ NULL, NULL } \
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Parse a list of FT_ServiceDescRec descriptors and look for a specific
|
||||
* service by ID. Note that the last element in the array must be { NULL,
|
||||
* NULL }, and that the function should return NULL if the service isn't
|
||||
* available.
|
||||
*
|
||||
* This function can be used by modules to implement their `get_service'
|
||||
* method.
|
||||
*/
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_service_list_lookup( FT_ServiceDesc service_descriptors,
|
||||
const char* service_id );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** S E R V I C E S C A C H E *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* This structure is used to store a cache for several frequently used
|
||||
* services. It is the type of `face->internal->services'. You should
|
||||
* only use FT_FACE_LOOKUP_SERVICE to access it.
|
||||
*
|
||||
* All fields should have the type FT_Pointer to relax compilation
|
||||
* dependencies. We assume the developer isn't completely stupid.
|
||||
*
|
||||
* Each field must be named `service_XXXX' where `XXX' corresponds to the
|
||||
* correct FT_SERVICE_ID_XXXX macro. See the definition of
|
||||
* FT_FACE_LOOKUP_SERVICE below how this is implemented.
|
||||
*
|
||||
*/
|
||||
typedef struct FT_ServiceCacheRec_
|
||||
{
|
||||
FT_Pointer service_POSTSCRIPT_FONT_NAME;
|
||||
FT_Pointer service_MULTI_MASTERS;
|
||||
FT_Pointer service_METRICS_VARIATIONS;
|
||||
FT_Pointer service_GLYPH_DICT;
|
||||
FT_Pointer service_PFR_METRICS;
|
||||
FT_Pointer service_WINFNT;
|
||||
|
||||
} FT_ServiceCacheRec, *FT_ServiceCache;
|
||||
|
||||
|
||||
/*
|
||||
* A magic number used within the services cache.
|
||||
*/
|
||||
|
||||
/* ensure that value `1' has the same width as a pointer */
|
||||
#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)~(FT_PtrDist)1)
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_FACE_LOOKUP_SERVICE
|
||||
*
|
||||
* @description:
|
||||
* This macro is used to look up a service from a face's driver module
|
||||
* using its cache.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The source face handle containing the cache.
|
||||
*
|
||||
* field ::
|
||||
* The field name in the cache.
|
||||
*
|
||||
* id ::
|
||||
* The service ID.
|
||||
*
|
||||
* @output:
|
||||
* ptr ::
|
||||
* A variable receiving the service data. `NULL` if not available.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
|
||||
#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FT_Pointer svc; \
|
||||
FT_Pointer* Pptr = (FT_Pointer*)&(ptr); \
|
||||
\
|
||||
\
|
||||
svc = FT_FACE( face )->internal->services. service_ ## id; \
|
||||
if ( svc == FT_SERVICE_UNAVAILABLE ) \
|
||||
svc = NULL; \
|
||||
else if ( svc == NULL ) \
|
||||
{ \
|
||||
FT_FACE_FIND_SERVICE( face, svc, id ); \
|
||||
\
|
||||
FT_FACE( face )->internal->services. service_ ## id = \
|
||||
(FT_Pointer)( svc != NULL ? svc \
|
||||
: FT_SERVICE_UNAVAILABLE ); \
|
||||
} \
|
||||
*Pptr = svc; \
|
||||
FT_END_STMNT
|
||||
|
||||
#else /* !C++ */
|
||||
|
||||
#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FT_Pointer svc; \
|
||||
\
|
||||
\
|
||||
svc = FT_FACE( face )->internal->services. service_ ## id; \
|
||||
if ( svc == FT_SERVICE_UNAVAILABLE ) \
|
||||
svc = NULL; \
|
||||
else if ( svc == NULL ) \
|
||||
{ \
|
||||
FT_FACE_FIND_SERVICE( face, svc, id ); \
|
||||
\
|
||||
FT_FACE( face )->internal->services. service_ ## id = \
|
||||
(FT_Pointer)( svc != NULL ? svc \
|
||||
: FT_SERVICE_UNAVAILABLE ); \
|
||||
} \
|
||||
ptr = svc; \
|
||||
FT_END_STMNT
|
||||
|
||||
#endif /* !C++ */
|
||||
|
||||
/*
|
||||
* A macro used to define new service structure types.
|
||||
*/
|
||||
|
||||
#define FT_DEFINE_SERVICE( name ) \
|
||||
typedef struct FT_Service_ ## name ## Rec_ \
|
||||
FT_Service_ ## name ## Rec ; \
|
||||
typedef struct FT_Service_ ## name ## Rec_ \
|
||||
const * FT_Service_ ## name ; \
|
||||
struct FT_Service_ ## name ## Rec_
|
||||
|
||||
/* */
|
||||
|
||||
/*
|
||||
* The header files containing the services.
|
||||
*/
|
||||
|
||||
#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h>
|
||||
#define FT_SERVICE_CFF_TABLE_LOAD_H <freetype/internal/services/svcfftl.h>
|
||||
#define FT_SERVICE_CID_H <freetype/internal/services/svcid.h>
|
||||
#define FT_SERVICE_FONT_FORMAT_H <freetype/internal/services/svfntfmt.h>
|
||||
#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
|
||||
#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h>
|
||||
#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h>
|
||||
#define FT_SERVICE_METRICS_VARIATIONS_H <freetype/internal/services/svmetric.h>
|
||||
#define FT_SERVICE_MULTIPLE_MASTERS_H <freetype/internal/services/svmm.h>
|
||||
#define FT_SERVICE_OPENTYPE_VALIDATE_H <freetype/internal/services/svotval.h>
|
||||
#define FT_SERVICE_PFR_H <freetype/internal/services/svpfr.h>
|
||||
#define FT_SERVICE_POSTSCRIPT_CMAPS_H <freetype/internal/services/svpscmap.h>
|
||||
#define FT_SERVICE_POSTSCRIPT_INFO_H <freetype/internal/services/svpsinfo.h>
|
||||
#define FT_SERVICE_POSTSCRIPT_NAME_H <freetype/internal/services/svpostnm.h>
|
||||
#define FT_SERVICE_PROPERTIES_H <freetype/internal/services/svprop.h>
|
||||
#define FT_SERVICE_SFNT_H <freetype/internal/services/svsfnt.h>
|
||||
#define FT_SERVICE_TRUETYPE_ENGINE_H <freetype/internal/services/svtteng.h>
|
||||
#define FT_SERVICE_TRUETYPE_GLYF_H <freetype/internal/services/svttglyf.h>
|
||||
#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h>
|
||||
#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h>
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTSERV_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
572
includes/freetype/internal/ftstream.h
Normal file
572
includes/freetype/internal/ftstream.h
Normal file
@@ -0,0 +1,572 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftstream.h
|
||||
*
|
||||
* Stream handling (specification).
|
||||
*
|
||||
* Copyright (C) 1996-2020 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 FTSTREAM_H_
|
||||
#define FTSTREAM_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_SYSTEM_H
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* format of an 8-bit frame_op value: */
|
||||
/* */
|
||||
/* bit 76543210 */
|
||||
/* xxxxxxes */
|
||||
/* */
|
||||
/* s is set to 1 if the value is signed. */
|
||||
/* e is set to 1 if the value is little-endian. */
|
||||
/* xxx is a command. */
|
||||
|
||||
#define FT_FRAME_OP_SHIFT 2
|
||||
#define FT_FRAME_OP_SIGNED 1
|
||||
#define FT_FRAME_OP_LITTLE 2
|
||||
#define FT_FRAME_OP_COMMAND( x ) ( x >> FT_FRAME_OP_SHIFT )
|
||||
|
||||
#define FT_MAKE_FRAME_OP( command, little, sign ) \
|
||||
( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )
|
||||
|
||||
#define FT_FRAME_OP_END 0
|
||||
#define FT_FRAME_OP_START 1 /* start a new frame */
|
||||
#define FT_FRAME_OP_BYTE 2 /* read 1-byte value */
|
||||
#define FT_FRAME_OP_SHORT 3 /* read 2-byte value */
|
||||
#define FT_FRAME_OP_LONG 4 /* read 4-byte value */
|
||||
#define FT_FRAME_OP_OFF3 5 /* read 3-byte value */
|
||||
#define FT_FRAME_OP_BYTES 6 /* read a bytes sequence */
|
||||
|
||||
|
||||
typedef enum FT_Frame_Op_
|
||||
{
|
||||
ft_frame_end = 0,
|
||||
ft_frame_start = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),
|
||||
|
||||
ft_frame_byte = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 0 ),
|
||||
ft_frame_schar = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 1 ),
|
||||
|
||||
ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),
|
||||
ft_frame_short_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),
|
||||
ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),
|
||||
ft_frame_short_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),
|
||||
|
||||
ft_frame_ulong_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),
|
||||
ft_frame_long_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),
|
||||
ft_frame_ulong_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),
|
||||
ft_frame_long_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),
|
||||
|
||||
ft_frame_uoff3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),
|
||||
ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),
|
||||
ft_frame_uoff3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),
|
||||
ft_frame_off3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),
|
||||
|
||||
ft_frame_bytes = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),
|
||||
ft_frame_skip = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )
|
||||
|
||||
} FT_Frame_Op;
|
||||
|
||||
|
||||
typedef struct FT_Frame_Field_
|
||||
{
|
||||
FT_Byte value;
|
||||
FT_Byte size;
|
||||
FT_UShort offset;
|
||||
|
||||
} FT_Frame_Field;
|
||||
|
||||
|
||||
/* Construct an FT_Frame_Field out of a structure type and a field name. */
|
||||
/* The structure type must be set in the FT_STRUCTURE macro before */
|
||||
/* calling the FT_FRAME_START() macro. */
|
||||
/* */
|
||||
#define FT_FIELD_SIZE( f ) \
|
||||
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )
|
||||
|
||||
#define FT_FIELD_SIZE_DELTA( f ) \
|
||||
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )
|
||||
|
||||
#define FT_FIELD_OFFSET( f ) \
|
||||
(FT_UShort)( offsetof( FT_STRUCTURE, f ) )
|
||||
|
||||
#define FT_FRAME_FIELD( frame_op, field ) \
|
||||
{ \
|
||||
frame_op, \
|
||||
FT_FIELD_SIZE( field ), \
|
||||
FT_FIELD_OFFSET( field ) \
|
||||
}
|
||||
|
||||
#define FT_MAKE_EMPTY_FIELD( frame_op ) { frame_op, 0, 0 }
|
||||
|
||||
#define FT_FRAME_START( size ) { ft_frame_start, 0, size }
|
||||
#define FT_FRAME_END { ft_frame_end, 0, 0 }
|
||||
|
||||
#define FT_FRAME_LONG( f ) FT_FRAME_FIELD( ft_frame_long_be, f )
|
||||
#define FT_FRAME_ULONG( f ) FT_FRAME_FIELD( ft_frame_ulong_be, f )
|
||||
#define FT_FRAME_SHORT( f ) FT_FRAME_FIELD( ft_frame_short_be, f )
|
||||
#define FT_FRAME_USHORT( f ) FT_FRAME_FIELD( ft_frame_ushort_be, f )
|
||||
#define FT_FRAME_OFF3( f ) FT_FRAME_FIELD( ft_frame_off3_be, f )
|
||||
#define FT_FRAME_UOFF3( f ) FT_FRAME_FIELD( ft_frame_uoff3_be, f )
|
||||
#define FT_FRAME_BYTE( f ) FT_FRAME_FIELD( ft_frame_byte, f )
|
||||
#define FT_FRAME_CHAR( f ) FT_FRAME_FIELD( ft_frame_schar, f )
|
||||
|
||||
#define FT_FRAME_LONG_LE( f ) FT_FRAME_FIELD( ft_frame_long_le, f )
|
||||
#define FT_FRAME_ULONG_LE( f ) FT_FRAME_FIELD( ft_frame_ulong_le, f )
|
||||
#define FT_FRAME_SHORT_LE( f ) FT_FRAME_FIELD( ft_frame_short_le, f )
|
||||
#define FT_FRAME_USHORT_LE( f ) FT_FRAME_FIELD( ft_frame_ushort_le, f )
|
||||
#define FT_FRAME_OFF3_LE( f ) FT_FRAME_FIELD( ft_frame_off3_le, f )
|
||||
#define FT_FRAME_UOFF3_LE( f ) FT_FRAME_FIELD( ft_frame_uoff3_le, f )
|
||||
|
||||
#define FT_FRAME_SKIP_LONG { ft_frame_long_be, 0, 0 }
|
||||
#define FT_FRAME_SKIP_SHORT { ft_frame_short_be, 0, 0 }
|
||||
#define FT_FRAME_SKIP_BYTE { ft_frame_byte, 0, 0 }
|
||||
|
||||
#define FT_FRAME_BYTES( field, count ) \
|
||||
{ \
|
||||
ft_frame_bytes, \
|
||||
count, \
|
||||
FT_FIELD_OFFSET( field ) \
|
||||
}
|
||||
|
||||
#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Integer extraction macros -- the 'buffer' parameter must ALWAYS be of
|
||||
* type 'char*' or equivalent (1-byte elements).
|
||||
*/
|
||||
|
||||
#define FT_BYTE_( p, i ) ( ((const FT_Byte*)(p))[(i)] )
|
||||
|
||||
#define FT_INT16( x ) ( (FT_Int16)(x) )
|
||||
#define FT_UINT16( x ) ( (FT_UInt16)(x) )
|
||||
#define FT_INT32( x ) ( (FT_Int32)(x) )
|
||||
#define FT_UINT32( x ) ( (FT_UInt32)(x) )
|
||||
|
||||
|
||||
#define FT_BYTE_U16( p, i, s ) ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )
|
||||
#define FT_BYTE_U32( p, i, s ) ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
|
||||
|
||||
|
||||
/*
|
||||
* function acts on increases does range for emits
|
||||
* pointer checking frames error
|
||||
* -------------------------------------------------------------------
|
||||
* FT_PEEK_XXX buffer pointer no no no no
|
||||
* FT_NEXT_XXX buffer pointer yes no no no
|
||||
* FT_GET_XXX stream->cursor yes yes yes no
|
||||
* FT_READ_XXX stream->pos yes yes no yes
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* `FT_PEEK_XXX' are generic macros to get data from a buffer position. No
|
||||
* safety checks are performed.
|
||||
*/
|
||||
#define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8 ) | \
|
||||
FT_BYTE_U16( p, 1, 0 ) )
|
||||
|
||||
#define FT_PEEK_USHORT( p ) FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \
|
||||
FT_BYTE_U16( p, 1, 0 ) )
|
||||
|
||||
#define FT_PEEK_LONG( p ) FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \
|
||||
FT_BYTE_U32( p, 1, 16 ) | \
|
||||
FT_BYTE_U32( p, 2, 8 ) | \
|
||||
FT_BYTE_U32( p, 3, 0 ) )
|
||||
|
||||
#define FT_PEEK_ULONG( p ) FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \
|
||||
FT_BYTE_U32( p, 1, 16 ) | \
|
||||
FT_BYTE_U32( p, 2, 8 ) | \
|
||||
FT_BYTE_U32( p, 3, 0 ) )
|
||||
|
||||
#define FT_PEEK_OFF3( p ) FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \
|
||||
FT_BYTE_U32( p, 1, 8 ) | \
|
||||
FT_BYTE_U32( p, 2, 0 ) )
|
||||
|
||||
#define FT_PEEK_UOFF3( p ) FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
|
||||
FT_BYTE_U32( p, 1, 8 ) | \
|
||||
FT_BYTE_U32( p, 2, 0 ) )
|
||||
|
||||
#define FT_PEEK_SHORT_LE( p ) FT_INT16( FT_BYTE_U16( p, 1, 8 ) | \
|
||||
FT_BYTE_U16( p, 0, 0 ) )
|
||||
|
||||
#define FT_PEEK_USHORT_LE( p ) FT_UINT16( FT_BYTE_U16( p, 1, 8 ) | \
|
||||
FT_BYTE_U16( p, 0, 0 ) )
|
||||
|
||||
#define FT_PEEK_LONG_LE( p ) FT_INT32( FT_BYTE_U32( p, 3, 24 ) | \
|
||||
FT_BYTE_U32( p, 2, 16 ) | \
|
||||
FT_BYTE_U32( p, 1, 8 ) | \
|
||||
FT_BYTE_U32( p, 0, 0 ) )
|
||||
|
||||
#define FT_PEEK_ULONG_LE( p ) FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \
|
||||
FT_BYTE_U32( p, 2, 16 ) | \
|
||||
FT_BYTE_U32( p, 1, 8 ) | \
|
||||
FT_BYTE_U32( p, 0, 0 ) )
|
||||
|
||||
#define FT_PEEK_OFF3_LE( p ) FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \
|
||||
FT_BYTE_U32( p, 1, 8 ) | \
|
||||
FT_BYTE_U32( p, 0, 0 ) )
|
||||
|
||||
#define FT_PEEK_UOFF3_LE( p ) FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
|
||||
FT_BYTE_U32( p, 1, 8 ) | \
|
||||
FT_BYTE_U32( p, 0, 0 ) )
|
||||
|
||||
/*
|
||||
* `FT_NEXT_XXX' are generic macros to get data from a buffer position
|
||||
* which is then increased appropriately. No safety checks are performed.
|
||||
*/
|
||||
#define FT_NEXT_CHAR( buffer ) \
|
||||
( (signed char)*buffer++ )
|
||||
|
||||
#define FT_NEXT_BYTE( buffer ) \
|
||||
( (unsigned char)*buffer++ )
|
||||
|
||||
#define FT_NEXT_SHORT( buffer ) \
|
||||
( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )
|
||||
|
||||
#define FT_NEXT_USHORT( buffer ) \
|
||||
( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )
|
||||
|
||||
#define FT_NEXT_OFF3( buffer ) \
|
||||
( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )
|
||||
|
||||
#define FT_NEXT_UOFF3( buffer ) \
|
||||
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )
|
||||
|
||||
#define FT_NEXT_LONG( buffer ) \
|
||||
( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )
|
||||
|
||||
#define FT_NEXT_ULONG( buffer ) \
|
||||
( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )
|
||||
|
||||
|
||||
#define FT_NEXT_SHORT_LE( buffer ) \
|
||||
( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )
|
||||
|
||||
#define FT_NEXT_USHORT_LE( buffer ) \
|
||||
( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )
|
||||
|
||||
#define FT_NEXT_OFF3_LE( buffer ) \
|
||||
( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )
|
||||
|
||||
#define FT_NEXT_UOFF3_LE( buffer ) \
|
||||
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )
|
||||
|
||||
#define FT_NEXT_LONG_LE( buffer ) \
|
||||
( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )
|
||||
|
||||
#define FT_NEXT_ULONG_LE( buffer ) \
|
||||
( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* The `FT_GET_XXX` macros use an implicit 'stream' variable.
|
||||
*
|
||||
* Note that a call to `FT_STREAM_SEEK` or `FT_STREAM_POS` has **no**
|
||||
* effect on `FT_GET_XXX`! They operate on `stream->pos`, while
|
||||
* `FT_GET_XXX` use `stream->cursor`.
|
||||
*/
|
||||
#if 0
|
||||
#define FT_GET_MACRO( type ) FT_NEXT_ ## type ( stream->cursor )
|
||||
|
||||
#define FT_GET_CHAR() FT_GET_MACRO( CHAR )
|
||||
#define FT_GET_BYTE() FT_GET_MACRO( BYTE )
|
||||
#define FT_GET_SHORT() FT_GET_MACRO( SHORT )
|
||||
#define FT_GET_USHORT() FT_GET_MACRO( USHORT )
|
||||
#define FT_GET_OFF3() FT_GET_MACRO( OFF3 )
|
||||
#define FT_GET_UOFF3() FT_GET_MACRO( UOFF3 )
|
||||
#define FT_GET_LONG() FT_GET_MACRO( LONG )
|
||||
#define FT_GET_ULONG() FT_GET_MACRO( ULONG )
|
||||
#define FT_GET_TAG4() FT_GET_MACRO( ULONG )
|
||||
|
||||
#define FT_GET_SHORT_LE() FT_GET_MACRO( SHORT_LE )
|
||||
#define FT_GET_USHORT_LE() FT_GET_MACRO( USHORT_LE )
|
||||
#define FT_GET_LONG_LE() FT_GET_MACRO( LONG_LE )
|
||||
#define FT_GET_ULONG_LE() FT_GET_MACRO( ULONG_LE )
|
||||
|
||||
#else
|
||||
#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
|
||||
|
||||
#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
|
||||
#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )
|
||||
#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )
|
||||
#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )
|
||||
#define FT_GET_OFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )
|
||||
#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )
|
||||
#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Long )
|
||||
#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
|
||||
#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
|
||||
|
||||
#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )
|
||||
#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )
|
||||
#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )
|
||||
#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )
|
||||
#endif
|
||||
|
||||
|
||||
#define FT_READ_MACRO( func, type, var ) \
|
||||
( var = (type)func( stream, &error ), \
|
||||
error != FT_Err_Ok )
|
||||
|
||||
/*
|
||||
* The `FT_READ_XXX' macros use implicit `stream' and `error' variables.
|
||||
*
|
||||
* `FT_READ_XXX' can be controlled with `FT_STREAM_SEEK' and
|
||||
* `FT_STREAM_POS'. They use the full machinery to check whether a read is
|
||||
* valid.
|
||||
*/
|
||||
#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
|
||||
#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
|
||||
#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )
|
||||
#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )
|
||||
#define FT_READ_OFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )
|
||||
#define FT_READ_UOFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )
|
||||
#define FT_READ_LONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )
|
||||
#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )
|
||||
|
||||
#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )
|
||||
#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )
|
||||
#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )
|
||||
#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )
|
||||
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
|
||||
|
||||
/* initialize a stream for reading a regular system stream */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_Open( FT_Stream stream,
|
||||
const char* filepathname );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
|
||||
|
||||
|
||||
/* create a new (input) stream from an FT_Open_Args structure */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_New( FT_Library library,
|
||||
const FT_Open_Args* args,
|
||||
FT_Stream *astream );
|
||||
|
||||
/* free a stream */
|
||||
FT_BASE( void )
|
||||
FT_Stream_Free( FT_Stream stream,
|
||||
FT_Int external );
|
||||
|
||||
/* initialize a stream for reading in-memory data */
|
||||
FT_BASE( void )
|
||||
FT_Stream_OpenMemory( FT_Stream stream,
|
||||
const FT_Byte* base,
|
||||
FT_ULong size );
|
||||
|
||||
/* close a stream (does not destroy the stream structure) */
|
||||
FT_BASE( void )
|
||||
FT_Stream_Close( FT_Stream stream );
|
||||
|
||||
|
||||
/* seek within a stream. position is relative to start of stream */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_Seek( FT_Stream stream,
|
||||
FT_ULong pos );
|
||||
|
||||
/* skip bytes in a stream */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_Skip( FT_Stream stream,
|
||||
FT_Long distance );
|
||||
|
||||
/* return current stream position */
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_Pos( FT_Stream stream );
|
||||
|
||||
/* read bytes from a stream into a user-allocated buffer, returns an */
|
||||
/* error if not all bytes could be read. */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_Read( FT_Stream stream,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong count );
|
||||
|
||||
/* read bytes from a stream at a given position */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_ReadAt( FT_Stream stream,
|
||||
FT_ULong pos,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong count );
|
||||
|
||||
/* try to read bytes at the end of a stream; return number of bytes */
|
||||
/* really available */
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_TryRead( FT_Stream stream,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong count );
|
||||
|
||||
/* Enter a frame of `count' consecutive bytes in a stream. Returns an */
|
||||
/* error if the frame could not be read/accessed. The caller can use */
|
||||
/* the `FT_Stream_GetXXX' functions to retrieve frame data without */
|
||||
/* error checks. */
|
||||
/* */
|
||||
/* You must _always_ call `FT_Stream_ExitFrame' once you have entered */
|
||||
/* a stream frame! */
|
||||
/* */
|
||||
/* Nested frames are not permitted. */
|
||||
/* */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_EnterFrame( FT_Stream stream,
|
||||
FT_ULong count );
|
||||
|
||||
/* exit a stream frame */
|
||||
FT_BASE( void )
|
||||
FT_Stream_ExitFrame( FT_Stream stream );
|
||||
|
||||
|
||||
/* Extract a stream frame. If the stream is disk-based, a heap block */
|
||||
/* is allocated and the frame bytes are read into it. If the stream */
|
||||
/* is memory-based, this function simply sets a pointer to the data. */
|
||||
/* */
|
||||
/* Useful to optimize access to memory-based streams transparently. */
|
||||
/* */
|
||||
/* `FT_Stream_GetXXX' functions can't be used. */
|
||||
/* */
|
||||
/* An extracted frame must be `freed' with a call to the function */
|
||||
/* `FT_Stream_ReleaseFrame'. */
|
||||
/* */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_ExtractFrame( FT_Stream stream,
|
||||
FT_ULong count,
|
||||
FT_Byte** pbytes );
|
||||
|
||||
/* release an extract frame (see `FT_Stream_ExtractFrame') */
|
||||
FT_BASE( void )
|
||||
FT_Stream_ReleaseFrame( FT_Stream stream,
|
||||
FT_Byte** pbytes );
|
||||
|
||||
|
||||
/* read a byte from an entered frame */
|
||||
FT_BASE( FT_Char )
|
||||
FT_Stream_GetChar( FT_Stream stream );
|
||||
|
||||
/* read a 16-bit big-endian unsigned integer from an entered frame */
|
||||
FT_BASE( FT_UShort )
|
||||
FT_Stream_GetUShort( FT_Stream stream );
|
||||
|
||||
/* read a 24-bit big-endian unsigned integer from an entered frame */
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_GetUOffset( FT_Stream stream );
|
||||
|
||||
/* read a 32-bit big-endian unsigned integer from an entered frame */
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_GetULong( FT_Stream stream );
|
||||
|
||||
/* read a 16-bit little-endian unsigned integer from an entered frame */
|
||||
FT_BASE( FT_UShort )
|
||||
FT_Stream_GetUShortLE( FT_Stream stream );
|
||||
|
||||
/* read a 32-bit little-endian unsigned integer from an entered frame */
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_GetULongLE( FT_Stream stream );
|
||||
|
||||
|
||||
/* read a byte from a stream */
|
||||
FT_BASE( FT_Char )
|
||||
FT_Stream_ReadChar( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* read a 16-bit big-endian unsigned integer from a stream */
|
||||
FT_BASE( FT_UShort )
|
||||
FT_Stream_ReadUShort( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* read a 24-bit big-endian unsigned integer from a stream */
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_ReadUOffset( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* read a 32-bit big-endian integer from a stream */
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_ReadULong( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* read a 16-bit little-endian unsigned integer from a stream */
|
||||
FT_BASE( FT_UShort )
|
||||
FT_Stream_ReadUShortLE( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* read a 32-bit little-endian unsigned integer from a stream */
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_ReadULongLE( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* Read a structure from a stream. The structure must be described */
|
||||
/* by an array of FT_Frame_Field records. */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_ReadFields( FT_Stream stream,
|
||||
const FT_Frame_Field* fields,
|
||||
void* structure );
|
||||
|
||||
|
||||
#define FT_STREAM_POS() \
|
||||
FT_Stream_Pos( stream )
|
||||
|
||||
#define FT_STREAM_SEEK( position ) \
|
||||
FT_SET_ERROR( FT_Stream_Seek( stream, \
|
||||
(FT_ULong)(position) ) )
|
||||
|
||||
#define FT_STREAM_SKIP( distance ) \
|
||||
FT_SET_ERROR( FT_Stream_Skip( stream, \
|
||||
(FT_Long)(distance) ) )
|
||||
|
||||
#define FT_STREAM_READ( buffer, count ) \
|
||||
FT_SET_ERROR( FT_Stream_Read( stream, \
|
||||
(FT_Byte*)(buffer), \
|
||||
(FT_ULong)(count) ) )
|
||||
|
||||
#define FT_STREAM_READ_AT( position, buffer, count ) \
|
||||
FT_SET_ERROR( FT_Stream_ReadAt( stream, \
|
||||
(FT_ULong)(position), \
|
||||
(FT_Byte*)(buffer), \
|
||||
(FT_ULong)(count) ) )
|
||||
|
||||
#define FT_STREAM_READ_FIELDS( fields, object ) \
|
||||
FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )
|
||||
|
||||
|
||||
#define FT_FRAME_ENTER( size ) \
|
||||
FT_SET_ERROR( \
|
||||
FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, \
|
||||
(FT_ULong)(size) ) ) )
|
||||
|
||||
#define FT_FRAME_EXIT() \
|
||||
FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )
|
||||
|
||||
#define FT_FRAME_EXTRACT( size, bytes ) \
|
||||
FT_SET_ERROR( \
|
||||
FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, \
|
||||
(FT_ULong)(size), \
|
||||
(FT_Byte**)&(bytes) ) ) )
|
||||
|
||||
#define FT_FRAME_RELEASE( bytes ) \
|
||||
FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream, \
|
||||
(FT_Byte**)&(bytes) ) )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTSTREAM_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
158
includes/freetype/internal/fttrace.h
Normal file
158
includes/freetype/internal/fttrace.h
Normal file
@@ -0,0 +1,158 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* fttrace.h
|
||||
*
|
||||
* Tracing handling (specification only).
|
||||
*
|
||||
* Copyright (C) 2002-2020 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.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* definitions of trace levels for FreeType 2 */
|
||||
|
||||
/* the first level must always be `trace_any' */
|
||||
FT_TRACE_DEF( any )
|
||||
|
||||
/* base components */
|
||||
FT_TRACE_DEF( calc ) /* calculations (ftcalc.c) */
|
||||
FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.c) */
|
||||
FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */
|
||||
FT_TRACE_DEF( memory ) /* memory manager (ftobjs.c) */
|
||||
FT_TRACE_DEF( init ) /* initialization (ftinit.c) */
|
||||
FT_TRACE_DEF( io ) /* i/o interface (ftsystem.c) */
|
||||
FT_TRACE_DEF( list ) /* list management (ftlist.c) */
|
||||
FT_TRACE_DEF( objs ) /* base objects (ftobjs.c) */
|
||||
FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */
|
||||
FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */
|
||||
|
||||
FT_TRACE_DEF( bitmap ) /* bitmap manipulation (ftbitmap.c) */
|
||||
FT_TRACE_DEF( checksum ) /* bitmap checksum (ftobjs.c) */
|
||||
FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
|
||||
FT_TRACE_DEF( psprops ) /* PS driver properties (ftpsprop.c) */
|
||||
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
|
||||
FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */
|
||||
FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
|
||||
FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
|
||||
|
||||
/* Cache sub-system */
|
||||
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
|
||||
|
||||
/* SFNT driver components */
|
||||
FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */
|
||||
FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */
|
||||
FT_TRACE_DEF( sfwoff ) /* WOFF format handler (sfwoff.c) */
|
||||
FT_TRACE_DEF( sfwoff2 ) /* WOFF2 format handler (sfwoff2.c) */
|
||||
FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
|
||||
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
|
||||
FT_TRACE_DEF( ttcolr ) /* glyph layer table (ttcolr.c) */
|
||||
FT_TRACE_DEF( ttcpal ) /* color palette table (ttcpal.c) */
|
||||
FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
|
||||
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
|
||||
FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
|
||||
FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */
|
||||
FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */
|
||||
|
||||
/* TrueType driver components */
|
||||
FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */
|
||||
FT_TRACE_DEF( ttgload ) /* TT glyph loader (ttgload.c) */
|
||||
FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */
|
||||
FT_TRACE_DEF( ttinterp ) /* bytecode interpreter (ttinterp.c) */
|
||||
FT_TRACE_DEF( ttobjs ) /* TT objects manager (ttobjs.c) */
|
||||
FT_TRACE_DEF( ttpload ) /* TT data/program loader (ttpload.c) */
|
||||
|
||||
/* Type 1 driver components */
|
||||
FT_TRACE_DEF( t1afm )
|
||||
FT_TRACE_DEF( t1driver )
|
||||
FT_TRACE_DEF( t1gload )
|
||||
FT_TRACE_DEF( t1load )
|
||||
FT_TRACE_DEF( t1objs )
|
||||
FT_TRACE_DEF( t1parse )
|
||||
|
||||
/* PostScript helper module `psaux' */
|
||||
FT_TRACE_DEF( cffdecode )
|
||||
FT_TRACE_DEF( psconv )
|
||||
FT_TRACE_DEF( psobjs )
|
||||
FT_TRACE_DEF( t1decode )
|
||||
|
||||
/* PostScript hinting module `pshinter' */
|
||||
FT_TRACE_DEF( pshalgo )
|
||||
FT_TRACE_DEF( pshrec )
|
||||
|
||||
/* Type 2 driver components */
|
||||
FT_TRACE_DEF( cffdriver )
|
||||
FT_TRACE_DEF( cffgload )
|
||||
FT_TRACE_DEF( cffload )
|
||||
FT_TRACE_DEF( cffobjs )
|
||||
FT_TRACE_DEF( cffparse )
|
||||
|
||||
FT_TRACE_DEF( cf2blues )
|
||||
FT_TRACE_DEF( cf2hints )
|
||||
FT_TRACE_DEF( cf2interp )
|
||||
|
||||
/* Type 42 driver component */
|
||||
FT_TRACE_DEF( t42 )
|
||||
|
||||
/* CID driver components */
|
||||
FT_TRACE_DEF( ciddriver )
|
||||
FT_TRACE_DEF( cidgload )
|
||||
FT_TRACE_DEF( cidload )
|
||||
FT_TRACE_DEF( cidobjs )
|
||||
FT_TRACE_DEF( cidparse )
|
||||
|
||||
/* Windows font component */
|
||||
FT_TRACE_DEF( winfnt )
|
||||
|
||||
/* PCF font components */
|
||||
FT_TRACE_DEF( pcfdriver )
|
||||
FT_TRACE_DEF( pcfread )
|
||||
|
||||
/* BDF font components */
|
||||
FT_TRACE_DEF( bdfdriver )
|
||||
FT_TRACE_DEF( bdflib )
|
||||
|
||||
/* PFR font component */
|
||||
FT_TRACE_DEF( pfr )
|
||||
|
||||
/* OpenType validation components */
|
||||
FT_TRACE_DEF( otvcommon )
|
||||
FT_TRACE_DEF( otvbase )
|
||||
FT_TRACE_DEF( otvgdef )
|
||||
FT_TRACE_DEF( otvgpos )
|
||||
FT_TRACE_DEF( otvgsub )
|
||||
FT_TRACE_DEF( otvjstf )
|
||||
FT_TRACE_DEF( otvmath )
|
||||
FT_TRACE_DEF( otvmodule )
|
||||
|
||||
/* TrueTypeGX/AAT validation components */
|
||||
FT_TRACE_DEF( gxvbsln )
|
||||
FT_TRACE_DEF( gxvcommon )
|
||||
FT_TRACE_DEF( gxvfeat )
|
||||
FT_TRACE_DEF( gxvjust )
|
||||
FT_TRACE_DEF( gxvkern )
|
||||
FT_TRACE_DEF( gxvmodule )
|
||||
FT_TRACE_DEF( gxvmort )
|
||||
FT_TRACE_DEF( gxvmorx )
|
||||
FT_TRACE_DEF( gxvlcar )
|
||||
FT_TRACE_DEF( gxvopbd )
|
||||
FT_TRACE_DEF( gxvprop )
|
||||
FT_TRACE_DEF( gxvtrak )
|
||||
|
||||
/* autofit components */
|
||||
FT_TRACE_DEF( afcjk )
|
||||
FT_TRACE_DEF( afglobal )
|
||||
FT_TRACE_DEF( afhints )
|
||||
FT_TRACE_DEF( afmodule )
|
||||
FT_TRACE_DEF( aflatin )
|
||||
FT_TRACE_DEF( aflatin2 )
|
||||
FT_TRACE_DEF( afshaper )
|
||||
FT_TRACE_DEF( afwarp )
|
||||
|
||||
/* END */
|
||||
159
includes/freetype/internal/ftvalid.h
Normal file
159
includes/freetype/internal/ftvalid.h
Normal file
@@ -0,0 +1,159 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* ftvalid.h
|
||||
*
|
||||
* FreeType validation support (specification).
|
||||
*
|
||||
* Copyright (C) 2004-2020 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 FTVALID_H_
|
||||
#define FTVALID_H_
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_setjmp and ft_longjmp */
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/**** V A L I D A T I O N ****/
|
||||
/**** ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* handle to a validation object */
|
||||
typedef struct FT_ValidatorRec_ volatile* FT_Validator;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* There are three distinct validation levels defined here:
|
||||
*
|
||||
* FT_VALIDATE_DEFAULT ::
|
||||
* A table that passes this validation level can be used reliably by
|
||||
* FreeType. It generally means that all offsets have been checked to
|
||||
* prevent out-of-bound reads, that array counts are correct, etc.
|
||||
*
|
||||
* FT_VALIDATE_TIGHT ::
|
||||
* A table that passes this validation level can be used reliably and
|
||||
* doesn't contain invalid data. For example, a charmap table that
|
||||
* returns invalid glyph indices will not pass, even though it can be
|
||||
* used with FreeType in default mode (the library will simply return an
|
||||
* error later when trying to load the glyph).
|
||||
*
|
||||
* It also checks that fields which must be a multiple of 2, 4, or 8,
|
||||
* don't have incorrect values, etc.
|
||||
*
|
||||
* FT_VALIDATE_PARANOID ::
|
||||
* Only for font debugging. Checks that a table follows the
|
||||
* specification by 100%. Very few fonts will be able to pass this level
|
||||
* anyway but it can be useful for certain tools like font
|
||||
* editors/converters.
|
||||
*/
|
||||
typedef enum FT_ValidationLevel_
|
||||
{
|
||||
FT_VALIDATE_DEFAULT = 0,
|
||||
FT_VALIDATE_TIGHT,
|
||||
FT_VALIDATE_PARANOID
|
||||
|
||||
} FT_ValidationLevel;
|
||||
|
||||
|
||||
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
|
||||
/* We disable the warning `structure was padded due to */
|
||||
/* __declspec(align())' in order to compile cleanly with */
|
||||
/* the maximum level of warnings. */
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4324 )
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* validator structure */
|
||||
typedef struct FT_ValidatorRec_
|
||||
{
|
||||
ft_jmp_buf jump_buffer; /* used for exception handling */
|
||||
|
||||
const FT_Byte* base; /* address of table in memory */
|
||||
const FT_Byte* limit; /* `base' + sizeof(table) in memory */
|
||||
FT_ValidationLevel level; /* validation level */
|
||||
FT_Error error; /* error returned. 0 means success */
|
||||
|
||||
} FT_ValidatorRec;
|
||||
|
||||
#if defined( _MSC_VER )
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#define FT_VALIDATOR( x ) ( (FT_Validator)( x ) )
|
||||
|
||||
|
||||
FT_BASE( void )
|
||||
ft_validator_init( FT_Validator valid,
|
||||
const FT_Byte* base,
|
||||
const FT_Byte* limit,
|
||||
FT_ValidationLevel level );
|
||||
|
||||
/* Do not use this. It's broken and will cause your validator to crash */
|
||||
/* if you run it on an invalid font. */
|
||||
FT_BASE( FT_Int )
|
||||
ft_validator_run( FT_Validator valid );
|
||||
|
||||
/* Sets the error field in a validator, then calls `longjmp' to return */
|
||||
/* to high-level caller. Using `setjmp/longjmp' avoids many stupid */
|
||||
/* error checks within the validation routines. */
|
||||
/* */
|
||||
FT_BASE( void )
|
||||
ft_validator_error( FT_Validator valid,
|
||||
FT_Error error );
|
||||
|
||||
|
||||
/* Calls ft_validate_error. Assumes that the `valid' local variable */
|
||||
/* holds a pointer to the current validator object. */
|
||||
/* */
|
||||
#define FT_INVALID( _error ) FT_INVALID_( _error )
|
||||
#define FT_INVALID_( _error ) \
|
||||
ft_validator_error( valid, FT_THROW( _error ) )
|
||||
|
||||
/* called when a broken table is detected */
|
||||
#define FT_INVALID_TOO_SHORT \
|
||||
FT_INVALID( Invalid_Table )
|
||||
|
||||
/* called when an invalid offset is detected */
|
||||
#define FT_INVALID_OFFSET \
|
||||
FT_INVALID( Invalid_Offset )
|
||||
|
||||
/* called when an invalid format/value is detected */
|
||||
#define FT_INVALID_FORMAT \
|
||||
FT_INVALID( Invalid_Table )
|
||||
|
||||
/* called when an invalid glyph index is detected */
|
||||
#define FT_INVALID_GLYPH_ID \
|
||||
FT_INVALID( Invalid_Glyph_Index )
|
||||
|
||||
/* called when an invalid field value is detected */
|
||||
#define FT_INVALID_DATA \
|
||||
FT_INVALID( Invalid_Table )
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTVALID_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
67
includes/freetype/internal/internal.h
Normal file
67
includes/freetype/internal/internal.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* internal.h
|
||||
*
|
||||
* Internal header files (specification only).
|
||||
*
|
||||
* Copyright (C) 1996-2020 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.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* This file is automatically included by `ft2build.h`. Do not include it
|
||||
* manually!
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h>
|
||||
#define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h>
|
||||
#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h>
|
||||
#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>
|
||||
#define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h>
|
||||
#define FT_INTERNAL_HASH_H <freetype/internal/fthash.h>
|
||||
#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdrv.h>
|
||||
#define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h>
|
||||
#define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h>
|
||||
#define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h>
|
||||
#define FT_INTERNAL_SERVICE_H <freetype/internal/ftserv.h>
|
||||
#define FT_INTERNAL_RFORK_H <freetype/internal/ftrfork.h>
|
||||
#define FT_INTERNAL_VALIDATE_H <freetype/internal/ftvalid.h>
|
||||
|
||||
#define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h>
|
||||
#define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h>
|
||||
#define FT_INTERNAL_WOFF_TYPES_H <freetype/internal/wofftypes.h>
|
||||
|
||||
#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h>
|
||||
#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h>
|
||||
#define FT_INTERNAL_POSTSCRIPT_PROPS_H <freetype/internal/ftpsprop.h>
|
||||
|
||||
#define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h>
|
||||
|
||||
#define FT_INTERNAL_CFF_TYPES_H <freetype/internal/cfftypes.h>
|
||||
#define FT_INTERNAL_CFF_OBJECTS_TYPES_H <freetype/internal/cffotypes.h>
|
||||
|
||||
|
||||
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
|
||||
|
||||
/* We disable the warning `conditional expression is constant' here */
|
||||
/* in order to compile cleanly with the maximum level of warnings. */
|
||||
/* In particular, the warning complains about stuff like `while(0)' */
|
||||
/* which is very useful in macro definitions. There is no benefit */
|
||||
/* in having it enabled. */
|
||||
#pragma warning( disable : 4127 )
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
|
||||
/* END */
|
||||
1439
includes/freetype/internal/psaux.h
Normal file
1439
includes/freetype/internal/psaux.h
Normal file
File diff suppressed because it is too large
Load Diff
700
includes/freetype/internal/pshints.h
Normal file
700
includes/freetype/internal/pshints.h
Normal file
@@ -0,0 +1,700 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* pshints.h
|
||||
*
|
||||
* Interface to Postscript-specific (Type 1 and Type 2) hints
|
||||
* recorders (specification only). These are used to support native
|
||||
* T1/T2 hints in the 'type1', 'cid', and 'cff' font drivers.
|
||||
*
|
||||
* Copyright (C) 2001-2020 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 PSHINTS_H_
|
||||
#define PSHINTS_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_TYPE1_TABLES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** INTERNAL REPRESENTATION OF GLOBALS *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct PSH_GlobalsRec_* PSH_Globals;
|
||||
|
||||
typedef FT_Error
|
||||
(*PSH_Globals_NewFunc)( FT_Memory memory,
|
||||
T1_Private* private_dict,
|
||||
PSH_Globals* aglobals );
|
||||
|
||||
typedef void
|
||||
(*PSH_Globals_SetScaleFunc)( PSH_Globals globals,
|
||||
FT_Fixed x_scale,
|
||||
FT_Fixed y_scale,
|
||||
FT_Fixed x_delta,
|
||||
FT_Fixed y_delta );
|
||||
|
||||
typedef void
|
||||
(*PSH_Globals_DestroyFunc)( PSH_Globals globals );
|
||||
|
||||
|
||||
typedef struct PSH_Globals_FuncsRec_
|
||||
{
|
||||
PSH_Globals_NewFunc create;
|
||||
PSH_Globals_SetScaleFunc set_scale;
|
||||
PSH_Globals_DestroyFunc destroy;
|
||||
|
||||
} PSH_Globals_FuncsRec, *PSH_Globals_Funcs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** PUBLIC TYPE 1 HINTS RECORDER *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* T1_Hints
|
||||
*
|
||||
* @description:
|
||||
* This is a handle to an opaque structure used to record glyph hints
|
||||
* from a Type 1 character glyph character string.
|
||||
*
|
||||
* The methods used to operate on this object are defined by the
|
||||
* @T1_Hints_FuncsRec structure. Recording glyph hints is normally
|
||||
* achieved through the following scheme:
|
||||
*
|
||||
* - Open a new hint recording session by calling the 'open' method.
|
||||
* This rewinds the recorder and prepare it for new input.
|
||||
*
|
||||
* - For each hint found in the glyph charstring, call the corresponding
|
||||
* method ('stem', 'stem3', or 'reset'). Note that these functions do
|
||||
* not return an error code.
|
||||
*
|
||||
* - Close the recording session by calling the 'close' method. It
|
||||
* returns an error code if the hints were invalid or something strange
|
||||
* happened (e.g., memory shortage).
|
||||
*
|
||||
* The hints accumulated in the object can later be used by the
|
||||
* PostScript hinter.
|
||||
*
|
||||
*/
|
||||
typedef struct T1_HintsRec_* T1_Hints;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* T1_Hints_Funcs
|
||||
*
|
||||
* @description:
|
||||
* A pointer to the @T1_Hints_FuncsRec structure that defines the API of
|
||||
* a given @T1_Hints object.
|
||||
*
|
||||
*/
|
||||
typedef const struct T1_Hints_FuncsRec_* T1_Hints_Funcs;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T1_Hints_OpenFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T1_Hints class used to prepare it for a new Type 1
|
||||
* hints recording session.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 1 hints recorder.
|
||||
*
|
||||
* @note:
|
||||
* You should always call the @T1_Hints_CloseFunc method in order to
|
||||
* close an opened recording session.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T1_Hints_OpenFunc)( T1_Hints hints );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T1_Hints_SetStemFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T1_Hints class used to record a new horizontal or
|
||||
* vertical stem. This corresponds to the Type 1 'hstem' and 'vstem'
|
||||
* operators.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 1 hints recorder.
|
||||
*
|
||||
* dimension ::
|
||||
* 0 for horizontal stems (hstem), 1 for vertical ones (vstem).
|
||||
*
|
||||
* coords ::
|
||||
* Array of 2 coordinates in 16.16 format, used as (position,length)
|
||||
* stem descriptor.
|
||||
*
|
||||
* @note:
|
||||
* Use vertical coordinates (y) for horizontal stems (dim=0). Use
|
||||
* horizontal coordinates (x) for vertical stems (dim=1).
|
||||
*
|
||||
* 'coords[0]' is the absolute stem position (lowest coordinate);
|
||||
* 'coords[1]' is the length.
|
||||
*
|
||||
* The length can be negative, in which case it must be either -20 or
|
||||
* -21. It is interpreted as a 'ghost' stem, according to the Type 1
|
||||
* specification.
|
||||
*
|
||||
* If the length is -21 (corresponding to a bottom ghost stem), then the
|
||||
* real stem position is 'coords[0]+coords[1]'.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T1_Hints_SetStemFunc)( T1_Hints hints,
|
||||
FT_UInt dimension,
|
||||
FT_Fixed* coords );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T1_Hints_SetStem3Func
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T1_Hints class used to record three
|
||||
* counter-controlled horizontal or vertical stems at once.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 1 hints recorder.
|
||||
*
|
||||
* dimension ::
|
||||
* 0 for horizontal stems, 1 for vertical ones.
|
||||
*
|
||||
* coords ::
|
||||
* An array of 6 values in 16.16 format, holding 3 (position,length)
|
||||
* pairs for the counter-controlled stems.
|
||||
*
|
||||
* @note:
|
||||
* Use vertical coordinates (y) for horizontal stems (dim=0). Use
|
||||
* horizontal coordinates (x) for vertical stems (dim=1).
|
||||
*
|
||||
* The lengths cannot be negative (ghost stems are never
|
||||
* counter-controlled).
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T1_Hints_SetStem3Func)( T1_Hints hints,
|
||||
FT_UInt dimension,
|
||||
FT_Fixed* coords );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T1_Hints_ResetFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T1_Hints class used to reset the stems hints in a
|
||||
* recording session.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 1 hints recorder.
|
||||
*
|
||||
* end_point ::
|
||||
* The index of the last point in the input glyph in which the
|
||||
* previously defined hints apply.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T1_Hints_ResetFunc)( T1_Hints hints,
|
||||
FT_UInt end_point );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T1_Hints_CloseFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T1_Hints class used to close a hint recording
|
||||
* session.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 1 hints recorder.
|
||||
*
|
||||
* end_point ::
|
||||
* The index of the last point in the input glyph.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* The error code is set to indicate that an error occurred during the
|
||||
* recording session.
|
||||
*
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*T1_Hints_CloseFunc)( T1_Hints hints,
|
||||
FT_UInt end_point );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T1_Hints_ApplyFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T1_Hints class used to apply hints to the
|
||||
* corresponding glyph outline. Must be called once all hints have been
|
||||
* recorded.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 1 hints recorder.
|
||||
*
|
||||
* outline ::
|
||||
* A pointer to the target outline descriptor.
|
||||
*
|
||||
* globals ::
|
||||
* The hinter globals for this font.
|
||||
*
|
||||
* hint_mode ::
|
||||
* Hinting information.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* On input, all points within the outline are in font coordinates. On
|
||||
* output, they are in 1/64th of pixels.
|
||||
*
|
||||
* The scaling transformation is taken from the 'globals' object which
|
||||
* must correspond to the same font as the glyph.
|
||||
*
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*T1_Hints_ApplyFunc)( T1_Hints hints,
|
||||
FT_Outline* outline,
|
||||
PSH_Globals globals,
|
||||
FT_Render_Mode hint_mode );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* T1_Hints_FuncsRec
|
||||
*
|
||||
* @description:
|
||||
* The structure used to provide the API to @T1_Hints objects.
|
||||
*
|
||||
* @fields:
|
||||
* hints ::
|
||||
* A handle to the T1 Hints recorder.
|
||||
*
|
||||
* open ::
|
||||
* The function to open a recording session.
|
||||
*
|
||||
* close ::
|
||||
* The function to close a recording session.
|
||||
*
|
||||
* stem ::
|
||||
* The function to set a simple stem.
|
||||
*
|
||||
* stem3 ::
|
||||
* The function to set counter-controlled stems.
|
||||
*
|
||||
* reset ::
|
||||
* The function to reset stem hints.
|
||||
*
|
||||
* apply ::
|
||||
* The function to apply the hints to the corresponding glyph outline.
|
||||
*
|
||||
*/
|
||||
typedef struct T1_Hints_FuncsRec_
|
||||
{
|
||||
T1_Hints hints;
|
||||
T1_Hints_OpenFunc open;
|
||||
T1_Hints_CloseFunc close;
|
||||
T1_Hints_SetStemFunc stem;
|
||||
T1_Hints_SetStem3Func stem3;
|
||||
T1_Hints_ResetFunc reset;
|
||||
T1_Hints_ApplyFunc apply;
|
||||
|
||||
} T1_Hints_FuncsRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** PUBLIC TYPE 2 HINTS RECORDER *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* T2_Hints
|
||||
*
|
||||
* @description:
|
||||
* This is a handle to an opaque structure used to record glyph hints
|
||||
* from a Type 2 character glyph character string.
|
||||
*
|
||||
* The methods used to operate on this object are defined by the
|
||||
* @T2_Hints_FuncsRec structure. Recording glyph hints is normally
|
||||
* achieved through the following scheme:
|
||||
*
|
||||
* - Open a new hint recording session by calling the 'open' method.
|
||||
* This rewinds the recorder and prepare it for new input.
|
||||
*
|
||||
* - For each hint found in the glyph charstring, call the corresponding
|
||||
* method ('stems', 'hintmask', 'counters'). Note that these functions
|
||||
* do not return an error code.
|
||||
*
|
||||
* - Close the recording session by calling the 'close' method. It
|
||||
* returns an error code if the hints were invalid or something strange
|
||||
* happened (e.g., memory shortage).
|
||||
*
|
||||
* The hints accumulated in the object can later be used by the
|
||||
* Postscript hinter.
|
||||
*
|
||||
*/
|
||||
typedef struct T2_HintsRec_* T2_Hints;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* T2_Hints_Funcs
|
||||
*
|
||||
* @description:
|
||||
* A pointer to the @T2_Hints_FuncsRec structure that defines the API of
|
||||
* a given @T2_Hints object.
|
||||
*
|
||||
*/
|
||||
typedef const struct T2_Hints_FuncsRec_* T2_Hints_Funcs;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T2_Hints_OpenFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T2_Hints class used to prepare it for a new Type 2
|
||||
* hints recording session.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 2 hints recorder.
|
||||
*
|
||||
* @note:
|
||||
* You should always call the @T2_Hints_CloseFunc method in order to
|
||||
* close an opened recording session.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T2_Hints_OpenFunc)( T2_Hints hints );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T2_Hints_StemsFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T2_Hints class used to set the table of stems in
|
||||
* either the vertical or horizontal dimension. Equivalent to the
|
||||
* 'hstem', 'vstem', 'hstemhm', and 'vstemhm' Type 2 operators.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 2 hints recorder.
|
||||
*
|
||||
* dimension ::
|
||||
* 0 for horizontal stems (hstem), 1 for vertical ones (vstem).
|
||||
*
|
||||
* count ::
|
||||
* The number of stems.
|
||||
*
|
||||
* coords ::
|
||||
* An array of 'count' (position,length) pairs in 16.16 format.
|
||||
*
|
||||
* @note:
|
||||
* Use vertical coordinates (y) for horizontal stems (dim=0). Use
|
||||
* horizontal coordinates (x) for vertical stems (dim=1).
|
||||
*
|
||||
* There are '2*count' elements in the 'coords' array. Each even element
|
||||
* is an absolute position in font units, each odd element is a length in
|
||||
* font units.
|
||||
*
|
||||
* A length can be negative, in which case it must be either -20 or -21.
|
||||
* It is interpreted as a 'ghost' stem, according to the Type 1
|
||||
* specification.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T2_Hints_StemsFunc)( T2_Hints hints,
|
||||
FT_UInt dimension,
|
||||
FT_Int count,
|
||||
FT_Fixed* coordinates );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T2_Hints_MaskFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T2_Hints class used to set a given hintmask (this
|
||||
* corresponds to the 'hintmask' Type 2 operator).
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 2 hints recorder.
|
||||
*
|
||||
* end_point ::
|
||||
* The glyph index of the last point to which the previously defined or
|
||||
* activated hints apply.
|
||||
*
|
||||
* bit_count ::
|
||||
* The number of bits in the hint mask.
|
||||
*
|
||||
* bytes ::
|
||||
* An array of bytes modelling the hint mask.
|
||||
*
|
||||
* @note:
|
||||
* If the hintmask starts the charstring (before any glyph point
|
||||
* definition), the value of `end_point` should be 0.
|
||||
*
|
||||
* `bit_count` is the number of meaningful bits in the 'bytes' array; it
|
||||
* must be equal to the total number of hints defined so far (i.e.,
|
||||
* horizontal+verticals).
|
||||
*
|
||||
* The 'bytes' array can come directly from the Type 2 charstring and
|
||||
* respects the same format.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T2_Hints_MaskFunc)( T2_Hints hints,
|
||||
FT_UInt end_point,
|
||||
FT_UInt bit_count,
|
||||
const FT_Byte* bytes );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T2_Hints_CounterFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T2_Hints class used to set a given counter mask (this
|
||||
* corresponds to the 'hintmask' Type 2 operator).
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 2 hints recorder.
|
||||
*
|
||||
* end_point ::
|
||||
* A glyph index of the last point to which the previously defined or
|
||||
* active hints apply.
|
||||
*
|
||||
* bit_count ::
|
||||
* The number of bits in the hint mask.
|
||||
*
|
||||
* bytes ::
|
||||
* An array of bytes modelling the hint mask.
|
||||
*
|
||||
* @note:
|
||||
* If the hintmask starts the charstring (before any glyph point
|
||||
* definition), the value of `end_point` should be 0.
|
||||
*
|
||||
* `bit_count` is the number of meaningful bits in the 'bytes' array; it
|
||||
* must be equal to the total number of hints defined so far (i.e.,
|
||||
* horizontal+verticals).
|
||||
*
|
||||
* The 'bytes' array can come directly from the Type 2 charstring and
|
||||
* respects the same format.
|
||||
*
|
||||
*/
|
||||
typedef void
|
||||
(*T2_Hints_CounterFunc)( T2_Hints hints,
|
||||
FT_UInt bit_count,
|
||||
const FT_Byte* bytes );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T2_Hints_CloseFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T2_Hints class used to close a hint recording
|
||||
* session.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 2 hints recorder.
|
||||
*
|
||||
* end_point ::
|
||||
* The index of the last point in the input glyph.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* The error code is set to indicate that an error occurred during the
|
||||
* recording session.
|
||||
*
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*T2_Hints_CloseFunc)( T2_Hints hints,
|
||||
FT_UInt end_point );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* T2_Hints_ApplyFunc
|
||||
*
|
||||
* @description:
|
||||
* A method of the @T2_Hints class used to apply hints to the
|
||||
* corresponding glyph outline. Must be called after the 'close' method.
|
||||
*
|
||||
* @input:
|
||||
* hints ::
|
||||
* A handle to the Type 2 hints recorder.
|
||||
*
|
||||
* outline ::
|
||||
* A pointer to the target outline descriptor.
|
||||
*
|
||||
* globals ::
|
||||
* The hinter globals for this font.
|
||||
*
|
||||
* hint_mode ::
|
||||
* Hinting information.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* On input, all points within the outline are in font coordinates. On
|
||||
* output, they are in 1/64th of pixels.
|
||||
*
|
||||
* The scaling transformation is taken from the 'globals' object which
|
||||
* must correspond to the same font than the glyph.
|
||||
*
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*T2_Hints_ApplyFunc)( T2_Hints hints,
|
||||
FT_Outline* outline,
|
||||
PSH_Globals globals,
|
||||
FT_Render_Mode hint_mode );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* T2_Hints_FuncsRec
|
||||
*
|
||||
* @description:
|
||||
* The structure used to provide the API to @T2_Hints objects.
|
||||
*
|
||||
* @fields:
|
||||
* hints ::
|
||||
* A handle to the T2 hints recorder object.
|
||||
*
|
||||
* open ::
|
||||
* The function to open a recording session.
|
||||
*
|
||||
* close ::
|
||||
* The function to close a recording session.
|
||||
*
|
||||
* stems ::
|
||||
* The function to set the dimension's stems table.
|
||||
*
|
||||
* hintmask ::
|
||||
* The function to set hint masks.
|
||||
*
|
||||
* counter ::
|
||||
* The function to set counter masks.
|
||||
*
|
||||
* apply ::
|
||||
* The function to apply the hints on the corresponding glyph outline.
|
||||
*
|
||||
*/
|
||||
typedef struct T2_Hints_FuncsRec_
|
||||
{
|
||||
T2_Hints hints;
|
||||
T2_Hints_OpenFunc open;
|
||||
T2_Hints_CloseFunc close;
|
||||
T2_Hints_StemsFunc stems;
|
||||
T2_Hints_MaskFunc hintmask;
|
||||
T2_Hints_CounterFunc counter;
|
||||
T2_Hints_ApplyFunc apply;
|
||||
|
||||
} T2_Hints_FuncsRec;
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
typedef struct PSHinter_Interface_
|
||||
{
|
||||
PSH_Globals_Funcs (*get_globals_funcs)( FT_Module module );
|
||||
T1_Hints_Funcs (*get_t1_funcs) ( FT_Module module );
|
||||
T2_Hints_Funcs (*get_t2_funcs) ( FT_Module module );
|
||||
|
||||
} PSHinter_Interface;
|
||||
|
||||
typedef PSHinter_Interface* PSHinter_Service;
|
||||
|
||||
|
||||
#define FT_DEFINE_PSHINTER_INTERFACE( \
|
||||
class_, \
|
||||
get_globals_funcs_, \
|
||||
get_t1_funcs_, \
|
||||
get_t2_funcs_ ) \
|
||||
static const PSHinter_Interface class_ = \
|
||||
{ \
|
||||
get_globals_funcs_, \
|
||||
get_t1_funcs_, \
|
||||
get_t2_funcs_ \
|
||||
};
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* PSHINTS_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
66
includes/freetype/internal/services/svbdf.h
Normal file
66
includes/freetype/internal/services/svbdf.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svbdf.h
|
||||
*
|
||||
* The FreeType BDF services (specification).
|
||||
*
|
||||
* Copyright (C) 2003-2020 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 SVBDF_H_
|
||||
#define SVBDF_H_
|
||||
|
||||
#include FT_BDF_H
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_BDF "bdf"
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_BDF_GetCharsetIdFunc)( FT_Face face,
|
||||
const char* *acharset_encoding,
|
||||
const char* *acharset_registry );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_BDF_GetPropertyFunc)( FT_Face face,
|
||||
const char* prop_name,
|
||||
BDF_PropertyRec *aproperty );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( BDF )
|
||||
{
|
||||
FT_BDF_GetCharsetIdFunc get_charset_id;
|
||||
FT_BDF_GetPropertyFunc get_property;
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_BDFRec( class_, \
|
||||
get_charset_id_, \
|
||||
get_property_ ) \
|
||||
static const FT_Service_BDFRec class_ = \
|
||||
{ \
|
||||
get_charset_id_, get_property_ \
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVBDF_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
90
includes/freetype/internal/services/svcfftl.h
Normal file
90
includes/freetype/internal/services/svcfftl.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svcfftl.h
|
||||
*
|
||||
* The FreeType CFF tables loader service (specification).
|
||||
*
|
||||
* Copyright (C) 2017-2020 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 SVCFFTL_H_
|
||||
#define SVCFFTL_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_INTERNAL_CFF_TYPES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_CFF_LOAD "cff-load"
|
||||
|
||||
|
||||
typedef FT_UShort
|
||||
(*FT_Get_Standard_Encoding_Func)( FT_UInt charcode );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Load_Private_Dict_Func)( CFF_Font font,
|
||||
CFF_SubFont subfont,
|
||||
FT_UInt lenNDV,
|
||||
FT_Fixed* NDV );
|
||||
|
||||
typedef FT_Byte
|
||||
(*FT_FD_Select_Get_Func)( CFF_FDSelect fdselect,
|
||||
FT_UInt glyph_index );
|
||||
|
||||
typedef FT_Bool
|
||||
(*FT_Blend_Check_Vector_Func)( CFF_Blend blend,
|
||||
FT_UInt vsindex,
|
||||
FT_UInt lenNDV,
|
||||
FT_Fixed* NDV );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Blend_Build_Vector_Func)( CFF_Blend blend,
|
||||
FT_UInt vsindex,
|
||||
FT_UInt lenNDV,
|
||||
FT_Fixed* NDV );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( CFFLoad )
|
||||
{
|
||||
FT_Get_Standard_Encoding_Func get_standard_encoding;
|
||||
FT_Load_Private_Dict_Func load_private_dict;
|
||||
FT_FD_Select_Get_Func fd_select_get;
|
||||
FT_Blend_Check_Vector_Func blend_check_vector;
|
||||
FT_Blend_Build_Vector_Func blend_build_vector;
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_CFFLOADREC( class_, \
|
||||
get_standard_encoding_, \
|
||||
load_private_dict_, \
|
||||
fd_select_get_, \
|
||||
blend_check_vector_, \
|
||||
blend_build_vector_ ) \
|
||||
static const FT_Service_CFFLoadRec class_ = \
|
||||
{ \
|
||||
get_standard_encoding_, \
|
||||
load_private_dict_, \
|
||||
fd_select_get_, \
|
||||
blend_check_vector_, \
|
||||
blend_build_vector_ \
|
||||
};
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* END */
|
||||
69
includes/freetype/internal/services/svcid.h
Normal file
69
includes/freetype/internal/services/svcid.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svcid.h
|
||||
*
|
||||
* The FreeType CID font services (specification).
|
||||
*
|
||||
* Copyright (C) 2007-2020 by
|
||||
* Derek Clegg and Michael Toftdal.
|
||||
*
|
||||
* 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 SVCID_H_
|
||||
#define SVCID_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_CID "CID"
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face face,
|
||||
const char* *registry,
|
||||
const char* *ordering,
|
||||
FT_Int *supplement );
|
||||
typedef FT_Error
|
||||
(*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face face,
|
||||
FT_Bool *is_cid );
|
||||
typedef FT_Error
|
||||
(*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face face,
|
||||
FT_UInt glyph_index,
|
||||
FT_UInt *cid );
|
||||
|
||||
FT_DEFINE_SERVICE( CID )
|
||||
{
|
||||
FT_CID_GetRegistryOrderingSupplementFunc get_ros;
|
||||
FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid;
|
||||
FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index;
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_CIDREC( class_, \
|
||||
get_ros_, \
|
||||
get_is_cid_, \
|
||||
get_cid_from_glyph_index_ ) \
|
||||
static const FT_Service_CIDRec class_ = \
|
||||
{ \
|
||||
get_ros_, get_is_cid_, get_cid_from_glyph_index_ \
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVCID_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
55
includes/freetype/internal/services/svfntfmt.h
Normal file
55
includes/freetype/internal/services/svfntfmt.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svfntfmt.h
|
||||
*
|
||||
* The FreeType font format service (specification only).
|
||||
*
|
||||
* Copyright (C) 2003-2020 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 SVFNTFMT_H_
|
||||
#define SVFNTFMT_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* A trivial service used to return the name of a face's font driver,
|
||||
* according to the XFree86 nomenclature. Note that the service data is a
|
||||
* simple constant string pointer.
|
||||
*/
|
||||
|
||||
#define FT_SERVICE_ID_FONT_FORMAT "font-format"
|
||||
|
||||
#define FT_FONT_FORMAT_TRUETYPE "TrueType"
|
||||
#define FT_FONT_FORMAT_TYPE_1 "Type 1"
|
||||
#define FT_FONT_FORMAT_BDF "BDF"
|
||||
#define FT_FONT_FORMAT_PCF "PCF"
|
||||
#define FT_FONT_FORMAT_TYPE_42 "Type 42"
|
||||
#define FT_FONT_FORMAT_CID "CID Type 1"
|
||||
#define FT_FONT_FORMAT_CFF "CFF"
|
||||
#define FT_FONT_FORMAT_PFR "PFR"
|
||||
#define FT_FONT_FORMAT_WINFNT "Windows FNT"
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVFNTFMT_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
72
includes/freetype/internal/services/svgldict.h
Normal file
72
includes/freetype/internal/services/svgldict.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svgldict.h
|
||||
*
|
||||
* The FreeType glyph dictionary services (specification).
|
||||
*
|
||||
* Copyright (C) 2003-2020 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 SVGLDICT_H_
|
||||
#define SVGLDICT_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* A service used to retrieve glyph names, as well as to find the index of
|
||||
* a given glyph name in a font.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT_SERVICE_ID_GLYPH_DICT "glyph-dict"
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_GlyphDict_GetNameFunc)( FT_Face face,
|
||||
FT_UInt glyph_index,
|
||||
FT_Pointer buffer,
|
||||
FT_UInt buffer_max );
|
||||
|
||||
typedef FT_UInt
|
||||
(*FT_GlyphDict_NameIndexFunc)( FT_Face face,
|
||||
const FT_String* glyph_name );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( GlyphDict )
|
||||
{
|
||||
FT_GlyphDict_GetNameFunc get_name;
|
||||
FT_GlyphDict_NameIndexFunc name_index; /* optional */
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
|
||||
get_name_, \
|
||||
name_index_ ) \
|
||||
static const FT_Service_GlyphDictRec class_ = \
|
||||
{ \
|
||||
get_name_, name_index_ \
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVGLDICT_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
72
includes/freetype/internal/services/svgxval.h
Normal file
72
includes/freetype/internal/services/svgxval.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svgxval.h
|
||||
*
|
||||
* FreeType API for validating TrueTypeGX/AAT tables (specification).
|
||||
*
|
||||
* Copyright (C) 2004-2020 by
|
||||
* Masatake YAMATO, Red Hat K.K.,
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* gxvalid is derived from both gxlayout module and otvalid module.
|
||||
* Development of gxlayout is supported by the Information-technology
|
||||
* Promotion Agency(IPA), Japan.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SVGXVAL_H_
|
||||
#define SVGXVAL_H_
|
||||
|
||||
#include FT_GX_VALIDATE_H
|
||||
#include FT_INTERNAL_VALIDATE_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_GX_VALIDATE "truetypegx-validate"
|
||||
#define FT_SERVICE_ID_CLASSICKERN_VALIDATE "classickern-validate"
|
||||
|
||||
typedef FT_Error
|
||||
(*gxv_validate_func)( FT_Face face,
|
||||
FT_UInt gx_flags,
|
||||
FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
|
||||
FT_UInt table_length );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*ckern_validate_func)( FT_Face face,
|
||||
FT_UInt ckern_flags,
|
||||
FT_Bytes *ckern_table );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( GXvalidate )
|
||||
{
|
||||
gxv_validate_func validate;
|
||||
};
|
||||
|
||||
FT_DEFINE_SERVICE( CKERNvalidate )
|
||||
{
|
||||
ckern_validate_func validate;
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVGXVAL_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
51
includes/freetype/internal/services/svkern.h
Normal file
51
includes/freetype/internal/services/svkern.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svkern.h
|
||||
*
|
||||
* The FreeType Kerning service (specification).
|
||||
*
|
||||
* Copyright (C) 2006-2020 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 SVKERN_H_
|
||||
#define SVKERN_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
#define FT_SERVICE_ID_KERNING "kerning"
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Kerning_TrackGetFunc)( FT_Face face,
|
||||
FT_Fixed point_size,
|
||||
FT_Int degree,
|
||||
FT_Fixed* akerning );
|
||||
|
||||
FT_DEFINE_SERVICE( Kerning )
|
||||
{
|
||||
FT_Kerning_TrackGetFunc get_track;
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVKERN_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
125
includes/freetype/internal/services/svmetric.h
Normal file
125
includes/freetype/internal/services/svmetric.h
Normal file
@@ -0,0 +1,125 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svmetric.h
|
||||
*
|
||||
* The FreeType services for metrics variations (specification).
|
||||
*
|
||||
* Copyright (C) 2016-2020 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 SVMETRIC_H_
|
||||
#define SVMETRIC_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* A service to manage the `HVAR, `MVAR', and `VVAR' OpenType tables.
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT_SERVICE_ID_METRICS_VARIATIONS "metrics-variations"
|
||||
|
||||
|
||||
/* HVAR */
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_HAdvance_Adjust_Func)( FT_Face face,
|
||||
FT_UInt gindex,
|
||||
FT_Int *avalue );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_LSB_Adjust_Func)( FT_Face face,
|
||||
FT_UInt gindex,
|
||||
FT_Int *avalue );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_RSB_Adjust_Func)( FT_Face face,
|
||||
FT_UInt gindex,
|
||||
FT_Int *avalue );
|
||||
|
||||
/* VVAR */
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_VAdvance_Adjust_Func)( FT_Face face,
|
||||
FT_UInt gindex,
|
||||
FT_Int *avalue );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_TSB_Adjust_Func)( FT_Face face,
|
||||
FT_UInt gindex,
|
||||
FT_Int *avalue );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_BSB_Adjust_Func)( FT_Face face,
|
||||
FT_UInt gindex,
|
||||
FT_Int *avalue );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_VOrg_Adjust_Func)( FT_Face face,
|
||||
FT_UInt gindex,
|
||||
FT_Int *avalue );
|
||||
|
||||
/* MVAR */
|
||||
|
||||
typedef void
|
||||
(*FT_Metrics_Adjust_Func)( FT_Face face );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( MetricsVariations )
|
||||
{
|
||||
FT_HAdvance_Adjust_Func hadvance_adjust;
|
||||
FT_LSB_Adjust_Func lsb_adjust;
|
||||
FT_RSB_Adjust_Func rsb_adjust;
|
||||
|
||||
FT_VAdvance_Adjust_Func vadvance_adjust;
|
||||
FT_TSB_Adjust_Func tsb_adjust;
|
||||
FT_BSB_Adjust_Func bsb_adjust;
|
||||
FT_VOrg_Adjust_Func vorg_adjust;
|
||||
|
||||
FT_Metrics_Adjust_Func metrics_adjust;
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
|
||||
hadvance_adjust_, \
|
||||
lsb_adjust_, \
|
||||
rsb_adjust_, \
|
||||
vadvance_adjust_, \
|
||||
tsb_adjust_, \
|
||||
bsb_adjust_, \
|
||||
vorg_adjust_, \
|
||||
metrics_adjust_ ) \
|
||||
static const FT_Service_MetricsVariationsRec class_ = \
|
||||
{ \
|
||||
hadvance_adjust_, \
|
||||
lsb_adjust_, \
|
||||
rsb_adjust_, \
|
||||
vadvance_adjust_, \
|
||||
tsb_adjust_, \
|
||||
bsb_adjust_, \
|
||||
vorg_adjust_, \
|
||||
metrics_adjust_ \
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* SVMETRIC_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
156
includes/freetype/internal/services/svmm.h
Normal file
156
includes/freetype/internal/services/svmm.h
Normal file
@@ -0,0 +1,156 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svmm.h
|
||||
*
|
||||
* The FreeType Multiple Masters and GX var services (specification).
|
||||
*
|
||||
* Copyright (C) 2003-2020 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 SVMM_H_
|
||||
#define SVMM_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* A service used to manage multiple-masters data in a given face.
|
||||
*
|
||||
* See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).
|
||||
*
|
||||
*/
|
||||
|
||||
#define FT_SERVICE_ID_MULTI_MASTERS "multi-masters"
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Get_MM_Func)( FT_Face face,
|
||||
FT_Multi_Master* master );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Get_MM_Var_Func)( FT_Face face,
|
||||
FT_MM_Var* *master );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Set_MM_Design_Func)( FT_Face face,
|
||||
FT_UInt num_coords,
|
||||
FT_Long* coords );
|
||||
|
||||
/* use return value -1 to indicate that the new coordinates */
|
||||
/* are equal to the current ones; no changes are thus needed */
|
||||
typedef FT_Error
|
||||
(*FT_Set_Var_Design_Func)( FT_Face face,
|
||||
FT_UInt num_coords,
|
||||
FT_Fixed* coords );
|
||||
|
||||
/* use return value -1 to indicate that the new coordinates */
|
||||
/* are equal to the current ones; no changes are thus needed */
|
||||
typedef FT_Error
|
||||
(*FT_Set_MM_Blend_Func)( FT_Face face,
|
||||
FT_UInt num_coords,
|
||||
FT_Long* coords );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Get_Var_Design_Func)( FT_Face face,
|
||||
FT_UInt num_coords,
|
||||
FT_Fixed* coords );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Set_Instance_Func)( FT_Face face,
|
||||
FT_UInt instance_index );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Get_MM_Blend_Func)( FT_Face face,
|
||||
FT_UInt num_coords,
|
||||
FT_Long* coords );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Get_Var_Blend_Func)( FT_Face face,
|
||||
FT_UInt *num_coords,
|
||||
FT_Fixed* *coords,
|
||||
FT_Fixed* *normalizedcoords,
|
||||
FT_MM_Var* *mm_var );
|
||||
|
||||
typedef void
|
||||
(*FT_Done_Blend_Func)( FT_Face );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Set_MM_WeightVector_Func)( FT_Face face,
|
||||
FT_UInt len,
|
||||
FT_Fixed* weight_vector );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Get_MM_WeightVector_Func)( FT_Face face,
|
||||
FT_UInt* len,
|
||||
FT_Fixed* weight_vector );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( MultiMasters )
|
||||
{
|
||||
FT_Get_MM_Func get_mm;
|
||||
FT_Set_MM_Design_Func set_mm_design;
|
||||
FT_Set_MM_Blend_Func set_mm_blend;
|
||||
FT_Get_MM_Blend_Func get_mm_blend;
|
||||
FT_Get_MM_Var_Func get_mm_var;
|
||||
FT_Set_Var_Design_Func set_var_design;
|
||||
FT_Get_Var_Design_Func get_var_design;
|
||||
FT_Set_Instance_Func set_instance;
|
||||
FT_Set_MM_WeightVector_Func set_mm_weightvector;
|
||||
FT_Get_MM_WeightVector_Func get_mm_weightvector;
|
||||
|
||||
/* for internal use; only needed for code sharing between modules */
|
||||
FT_Get_Var_Blend_Func get_var_blend;
|
||||
FT_Done_Blend_Func done_blend;
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
|
||||
get_mm_, \
|
||||
set_mm_design_, \
|
||||
set_mm_blend_, \
|
||||
get_mm_blend_, \
|
||||
get_mm_var_, \
|
||||
set_var_design_, \
|
||||
get_var_design_, \
|
||||
set_instance_, \
|
||||
set_weightvector_, \
|
||||
get_weightvector_, \
|
||||
get_var_blend_, \
|
||||
done_blend_ ) \
|
||||
static const FT_Service_MultiMastersRec class_ = \
|
||||
{ \
|
||||
get_mm_, \
|
||||
set_mm_design_, \
|
||||
set_mm_blend_, \
|
||||
get_mm_blend_, \
|
||||
get_mm_var_, \
|
||||
set_var_design_, \
|
||||
get_var_design_, \
|
||||
set_instance_, \
|
||||
set_weightvector_, \
|
||||
get_weightvector_, \
|
||||
get_var_blend_, \
|
||||
done_blend_ \
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* SVMM_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
55
includes/freetype/internal/services/svotval.h
Normal file
55
includes/freetype/internal/services/svotval.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svotval.h
|
||||
*
|
||||
* The FreeType OpenType validation service (specification).
|
||||
*
|
||||
* Copyright (C) 2004-2020 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 SVOTVAL_H_
|
||||
#define SVOTVAL_H_
|
||||
|
||||
#include FT_OPENTYPE_VALIDATE_H
|
||||
#include FT_INTERNAL_VALIDATE_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_OPENTYPE_VALIDATE "opentype-validate"
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*otv_validate_func)( FT_Face volatile face,
|
||||
FT_UInt ot_flags,
|
||||
FT_Bytes *base,
|
||||
FT_Bytes *gdef,
|
||||
FT_Bytes *gpos,
|
||||
FT_Bytes *gsub,
|
||||
FT_Bytes *jstf );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( OTvalidate )
|
||||
{
|
||||
otv_validate_func validate;
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVOTVAL_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
66
includes/freetype/internal/services/svpfr.h
Normal file
66
includes/freetype/internal/services/svpfr.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svpfr.h
|
||||
*
|
||||
* Internal PFR service functions (specification).
|
||||
*
|
||||
* Copyright (C) 2003-2020 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 SVPFR_H_
|
||||
#define SVPFR_H_
|
||||
|
||||
#include FT_PFR_H
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_PFR_METRICS "pfr-metrics"
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_PFR_GetMetricsFunc)( FT_Face face,
|
||||
FT_UInt *aoutline,
|
||||
FT_UInt *ametrics,
|
||||
FT_Fixed *ax_scale,
|
||||
FT_Fixed *ay_scale );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_PFR_GetKerningFunc)( FT_Face face,
|
||||
FT_UInt left,
|
||||
FT_UInt right,
|
||||
FT_Vector *avector );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_PFR_GetAdvanceFunc)( FT_Face face,
|
||||
FT_UInt gindex,
|
||||
FT_Pos *aadvance );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( PfrMetrics )
|
||||
{
|
||||
FT_PFR_GetMetricsFunc get_metrics;
|
||||
FT_PFR_GetKerningFunc get_kerning;
|
||||
FT_PFR_GetAdvanceFunc get_advance;
|
||||
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* SVPFR_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
65
includes/freetype/internal/services/svpostnm.h
Normal file
65
includes/freetype/internal/services/svpostnm.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svpostnm.h
|
||||
*
|
||||
* The FreeType PostScript name services (specification).
|
||||
*
|
||||
* Copyright (C) 2003-2020 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 SVPOSTNM_H_
|
||||
#define SVPOSTNM_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*
|
||||
* A trivial service used to retrieve the PostScript name of a given font
|
||||
* when available. The `get_name' field should never be `NULL`.
|
||||
*
|
||||
* The corresponding function can return `NULL` to indicate that the
|
||||
* PostScript name is not available.
|
||||
*
|
||||
* The name is owned by the face and will be destroyed with it.
|
||||
*/
|
||||
|
||||
#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME "postscript-font-name"
|
||||
|
||||
|
||||
typedef const char*
|
||||
(*FT_PsName_GetFunc)( FT_Face face );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( PsFontName )
|
||||
{
|
||||
FT_PsName_GetFunc get_ps_font_name;
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \
|
||||
static const FT_Service_PsFontNameRec class_ = \
|
||||
{ \
|
||||
get_ps_font_name_ \
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVPOSTNM_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
66
includes/freetype/internal/services/svprop.h
Normal file
66
includes/freetype/internal/services/svprop.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svprop.h
|
||||
*
|
||||
* The FreeType property service (specification).
|
||||
*
|
||||
* Copyright (C) 2012-2020 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 SVPROP_H_
|
||||
#define SVPROP_H_
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_PROPERTIES "properties"
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Properties_SetFunc)( FT_Module module,
|
||||
const char* property_name,
|
||||
const void* value,
|
||||
FT_Bool value_is_string );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Properties_GetFunc)( FT_Module module,
|
||||
const char* property_name,
|
||||
void* value );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( Properties )
|
||||
{
|
||||
FT_Properties_SetFunc set_property;
|
||||
FT_Properties_GetFunc get_property;
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \
|
||||
set_property_, \
|
||||
get_property_ ) \
|
||||
static const FT_Service_PropertiesRec class_ = \
|
||||
{ \
|
||||
set_property_, \
|
||||
get_property_ \
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVPROP_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
145
includes/freetype/internal/services/svpscmap.h
Normal file
145
includes/freetype/internal/services/svpscmap.h
Normal file
@@ -0,0 +1,145 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svpscmap.h
|
||||
*
|
||||
* The FreeType PostScript charmap service (specification).
|
||||
*
|
||||
* Copyright (C) 2003-2020 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 SVPSCMAP_H_
|
||||
#define SVPSCMAP_H_
|
||||
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_POSTSCRIPT_CMAPS "postscript-cmaps"
|
||||
|
||||
|
||||
/*
|
||||
* Adobe glyph name to unicode value.
|
||||
*/
|
||||
typedef FT_UInt32
|
||||
(*PS_Unicode_ValueFunc)( const char* glyph_name );
|
||||
|
||||
/*
|
||||
* Macintosh name id to glyph name. `NULL` if invalid index.
|
||||
*/
|
||||
typedef const char*
|
||||
(*PS_Macintosh_NameFunc)( FT_UInt name_index );
|
||||
|
||||
/*
|
||||
* Adobe standard string ID to glyph name. `NULL` if invalid index.
|
||||
*/
|
||||
typedef const char*
|
||||
(*PS_Adobe_Std_StringsFunc)( FT_UInt string_index );
|
||||
|
||||
|
||||
/*
|
||||
* Simple unicode -> glyph index charmap built from font glyph names table.
|
||||
*/
|
||||
typedef struct PS_UniMap_
|
||||
{
|
||||
FT_UInt32 unicode; /* bit 31 set: is glyph variant */
|
||||
FT_UInt glyph_index;
|
||||
|
||||
} PS_UniMap;
|
||||
|
||||
|
||||
typedef struct PS_UnicodesRec_* PS_Unicodes;
|
||||
|
||||
typedef struct PS_UnicodesRec_
|
||||
{
|
||||
FT_CMapRec cmap;
|
||||
FT_UInt num_maps;
|
||||
PS_UniMap* maps;
|
||||
|
||||
} PS_UnicodesRec;
|
||||
|
||||
|
||||
/*
|
||||
* A function which returns a glyph name for a given index. Returns
|
||||
* `NULL` if invalid index.
|
||||
*/
|
||||
typedef const char*
|
||||
(*PS_GetGlyphNameFunc)( FT_Pointer data,
|
||||
FT_UInt string_index );
|
||||
|
||||
/*
|
||||
* A function used to release the glyph name returned by
|
||||
* PS_GetGlyphNameFunc, when needed
|
||||
*/
|
||||
typedef void
|
||||
(*PS_FreeGlyphNameFunc)( FT_Pointer data,
|
||||
const char* name );
|
||||
|
||||
typedef FT_Error
|
||||
(*PS_Unicodes_InitFunc)( FT_Memory memory,
|
||||
PS_Unicodes unicodes,
|
||||
FT_UInt num_glyphs,
|
||||
PS_GetGlyphNameFunc get_glyph_name,
|
||||
PS_FreeGlyphNameFunc free_glyph_name,
|
||||
FT_Pointer glyph_data );
|
||||
|
||||
typedef FT_UInt
|
||||
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
|
||||
FT_UInt32 unicode );
|
||||
|
||||
typedef FT_UInt32
|
||||
(*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
|
||||
FT_UInt32 *unicode );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( PsCMaps )
|
||||
{
|
||||
PS_Unicode_ValueFunc unicode_value;
|
||||
|
||||
PS_Unicodes_InitFunc unicodes_init;
|
||||
PS_Unicodes_CharIndexFunc unicodes_char_index;
|
||||
PS_Unicodes_CharNextFunc unicodes_char_next;
|
||||
|
||||
PS_Macintosh_NameFunc macintosh_name;
|
||||
PS_Adobe_Std_StringsFunc adobe_std_strings;
|
||||
const unsigned short* adobe_std_encoding;
|
||||
const unsigned short* adobe_expert_encoding;
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \
|
||||
unicode_value_, \
|
||||
unicodes_init_, \
|
||||
unicodes_char_index_, \
|
||||
unicodes_char_next_, \
|
||||
macintosh_name_, \
|
||||
adobe_std_strings_, \
|
||||
adobe_std_encoding_, \
|
||||
adobe_expert_encoding_ ) \
|
||||
static const FT_Service_PsCMapsRec class_ = \
|
||||
{ \
|
||||
unicode_value_, unicodes_init_, \
|
||||
unicodes_char_index_, unicodes_char_next_, macintosh_name_, \
|
||||
adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVPSCMAP_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
86
includes/freetype/internal/services/svpsinfo.h
Normal file
86
includes/freetype/internal/services/svpsinfo.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svpsinfo.h
|
||||
*
|
||||
* The FreeType PostScript info service (specification).
|
||||
*
|
||||
* Copyright (C) 2003-2020 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 SVPSINFO_H_
|
||||
#define SVPSINFO_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_INTERNAL_TYPE1_TYPES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_POSTSCRIPT_INFO "postscript-info"
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*PS_GetFontInfoFunc)( FT_Face face,
|
||||
PS_FontInfoRec* afont_info );
|
||||
|
||||
typedef FT_Error
|
||||
(*PS_GetFontExtraFunc)( FT_Face face,
|
||||
PS_FontExtraRec* afont_extra );
|
||||
|
||||
typedef FT_Int
|
||||
(*PS_HasGlyphNamesFunc)( FT_Face face );
|
||||
|
||||
typedef FT_Error
|
||||
(*PS_GetFontPrivateFunc)( FT_Face face,
|
||||
PS_PrivateRec* afont_private );
|
||||
|
||||
typedef FT_Long
|
||||
(*PS_GetFontValueFunc)( FT_Face face,
|
||||
PS_Dict_Keys key,
|
||||
FT_UInt idx,
|
||||
void *value,
|
||||
FT_Long value_len );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( PsInfo )
|
||||
{
|
||||
PS_GetFontInfoFunc ps_get_font_info;
|
||||
PS_GetFontExtraFunc ps_get_font_extra;
|
||||
PS_HasGlyphNamesFunc ps_has_glyph_names;
|
||||
PS_GetFontPrivateFunc ps_get_font_private;
|
||||
PS_GetFontValueFunc ps_get_font_value;
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_PSINFOREC( class_, \
|
||||
get_font_info_, \
|
||||
ps_get_font_extra_, \
|
||||
has_glyph_names_, \
|
||||
get_font_private_, \
|
||||
get_font_value_ ) \
|
||||
static const FT_Service_PsInfoRec class_ = \
|
||||
{ \
|
||||
get_font_info_, ps_get_font_extra_, has_glyph_names_, \
|
||||
get_font_private_, get_font_value_ \
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVPSINFO_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
88
includes/freetype/internal/services/svsfnt.h
Normal file
88
includes/freetype/internal/services/svsfnt.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svsfnt.h
|
||||
*
|
||||
* The FreeType SFNT table loading service (specification).
|
||||
*
|
||||
* Copyright (C) 2003-2020 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 SVSFNT_H_
|
||||
#define SVSFNT_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* SFNT table loading service.
|
||||
*/
|
||||
|
||||
#define FT_SERVICE_ID_SFNT_TABLE "sfnt-table"
|
||||
|
||||
|
||||
/*
|
||||
* Used to implement FT_Load_Sfnt_Table().
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*FT_SFNT_TableLoadFunc)( FT_Face face,
|
||||
FT_ULong tag,
|
||||
FT_Long offset,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong* length );
|
||||
|
||||
/*
|
||||
* Used to implement FT_Get_Sfnt_Table().
|
||||
*/
|
||||
typedef void*
|
||||
(*FT_SFNT_TableGetFunc)( FT_Face face,
|
||||
FT_Sfnt_Tag tag );
|
||||
|
||||
|
||||
/*
|
||||
* Used to implement FT_Sfnt_Table_Info().
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*FT_SFNT_TableInfoFunc)( FT_Face face,
|
||||
FT_UInt idx,
|
||||
FT_ULong *tag,
|
||||
FT_ULong *offset,
|
||||
FT_ULong *length );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( SFNT_Table )
|
||||
{
|
||||
FT_SFNT_TableLoadFunc load_table;
|
||||
FT_SFNT_TableGetFunc get_table;
|
||||
FT_SFNT_TableInfoFunc table_info;
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \
|
||||
static const FT_Service_SFNT_TableRec class_ = \
|
||||
{ \
|
||||
load_, get_, info_ \
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVSFNT_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
90
includes/freetype/internal/services/svttcmap.h
Normal file
90
includes/freetype/internal/services/svttcmap.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svttcmap.h
|
||||
*
|
||||
* The FreeType TrueType/sfnt cmap extra information service.
|
||||
*
|
||||
* Copyright (C) 2003-2020 by
|
||||
* Masatake YAMATO, Redhat K.K.,
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
/* Development of this service is support of
|
||||
Information-technology Promotion Agency, Japan. */
|
||||
|
||||
#ifndef SVTTCMAP_H_
|
||||
#define SVTTCMAP_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_TT_CMAP "tt-cmaps"
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* TT_CMapInfo
|
||||
*
|
||||
* @description:
|
||||
* A structure used to store TrueType/sfnt specific cmap information
|
||||
* which is not covered by the generic @FT_CharMap structure. This
|
||||
* structure can be accessed with the @FT_Get_TT_CMap_Info function.
|
||||
*
|
||||
* @fields:
|
||||
* language ::
|
||||
* The language ID used in Mac fonts. Definitions of values are in
|
||||
* `ttnameid.h`.
|
||||
*
|
||||
* format ::
|
||||
* The cmap format. OpenType 1.6 defines the formats 0 (byte encoding
|
||||
* table), 2~(high-byte mapping through table), 4~(segment mapping to
|
||||
* delta values), 6~(trimmed table mapping), 8~(mixed 16-bit and 32-bit
|
||||
* coverage), 10~(trimmed array), 12~(segmented coverage), 13~(last
|
||||
* resort font), and 14 (Unicode Variation Sequences).
|
||||
*/
|
||||
typedef struct TT_CMapInfo_
|
||||
{
|
||||
FT_ULong language;
|
||||
FT_Long format;
|
||||
|
||||
} TT_CMapInfo;
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*TT_CMap_Info_GetFunc)( FT_CharMap charmap,
|
||||
TT_CMapInfo *cmap_info );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( TTCMaps )
|
||||
{
|
||||
TT_CMap_Info_GetFunc get_cmap_info;
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \
|
||||
static const FT_Service_TTCMapsRec class_ = \
|
||||
{ \
|
||||
get_cmap_info_ \
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* SVTTCMAP_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
53
includes/freetype/internal/services/svtteng.h
Normal file
53
includes/freetype/internal/services/svtteng.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svtteng.h
|
||||
*
|
||||
* The FreeType TrueType engine query service (specification).
|
||||
*
|
||||
* Copyright (C) 2006-2020 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 SVTTENG_H_
|
||||
#define SVTTENG_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_MODULE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* SFNT table loading service.
|
||||
*/
|
||||
|
||||
#define FT_SERVICE_ID_TRUETYPE_ENGINE "truetype-engine"
|
||||
|
||||
/*
|
||||
* Used to implement FT_Get_TrueType_Engine_Type
|
||||
*/
|
||||
|
||||
FT_DEFINE_SERVICE( TrueTypeEngine )
|
||||
{
|
||||
FT_TrueTypeEngineType engine_type;
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVTTENG_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
56
includes/freetype/internal/services/svttglyf.h
Normal file
56
includes/freetype/internal/services/svttglyf.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svttglyf.h
|
||||
*
|
||||
* The FreeType TrueType glyph service.
|
||||
*
|
||||
* Copyright (C) 2007-2020 by
|
||||
* David Turner.
|
||||
*
|
||||
* 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 SVTTGLYF_H_
|
||||
#define SVTTGLYF_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_TT_GLYF "tt-glyf"
|
||||
|
||||
|
||||
typedef FT_ULong
|
||||
(*TT_Glyf_GetLocationFunc)( FT_Face face,
|
||||
FT_UInt gindex,
|
||||
FT_ULong *psize );
|
||||
|
||||
FT_DEFINE_SERVICE( TTGlyf )
|
||||
{
|
||||
TT_Glyf_GetLocationFunc get_location;
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \
|
||||
static const FT_Service_TTGlyfRec class_ = \
|
||||
{ \
|
||||
get_location_ \
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* SVTTGLYF_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
50
includes/freetype/internal/services/svwinfnt.h
Normal file
50
includes/freetype/internal/services/svwinfnt.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* svwinfnt.h
|
||||
*
|
||||
* The FreeType Windows FNT/FONT service (specification).
|
||||
*
|
||||
* Copyright (C) 2003-2020 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 SVWINFNT_H_
|
||||
#define SVWINFNT_H_
|
||||
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_WINFONTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define FT_SERVICE_ID_WINFNT "winfonts"
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_WinFnt_GetHeaderFunc)( FT_Face face,
|
||||
FT_WinFNT_HeaderRec *aheader );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( WinFnt )
|
||||
{
|
||||
FT_WinFnt_GetHeaderFunc get_header;
|
||||
};
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* SVWINFNT_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
876
includes/freetype/internal/sfnt.h
Normal file
876
includes/freetype/internal/sfnt.h
Normal file
@@ -0,0 +1,876 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* sfnt.h
|
||||
*
|
||||
* High-level 'sfnt' driver interface (specification).
|
||||
*
|
||||
* Copyright (C) 1996-2020 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 SFNT_H_
|
||||
#define SFNT_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_DRIVER_H
|
||||
#include FT_INTERNAL_TRUETYPE_TYPES_H
|
||||
#include FT_INTERNAL_WOFF_TYPES_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Init_Face_Func
|
||||
*
|
||||
* @description:
|
||||
* First part of the SFNT face object initialization. This finds the
|
||||
* face in a SFNT file or collection, and load its format tag in
|
||||
* face->format_tag.
|
||||
*
|
||||
* @input:
|
||||
* stream ::
|
||||
* The input stream.
|
||||
*
|
||||
* face ::
|
||||
* A handle to the target face object.
|
||||
*
|
||||
* face_index ::
|
||||
* The index of the TrueType font, if we are opening a collection, in
|
||||
* bits 0-15. The numbered instance index~+~1 of a GX (sub)font, if
|
||||
* applicable, in bits 16-30.
|
||||
*
|
||||
* num_params ::
|
||||
* The number of additional parameters.
|
||||
*
|
||||
* params ::
|
||||
* Optional additional parameters.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* The stream cursor must be at the font file's origin.
|
||||
*
|
||||
* This function recognizes fonts embedded in a 'TrueType collection'.
|
||||
*
|
||||
* Once the format tag has been validated by the font driver, it should
|
||||
* then call the TT_Load_Face_Func() callback to read the rest of the
|
||||
* SFNT tables in the object.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Init_Face_Func)( FT_Stream stream,
|
||||
TT_Face face,
|
||||
FT_Int face_index,
|
||||
FT_Int num_params,
|
||||
FT_Parameter* params );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Load_Face_Func
|
||||
*
|
||||
* @description:
|
||||
* Second part of the SFNT face object initialization. This loads the
|
||||
* common SFNT tables (head, OS/2, maxp, metrics, etc.) in the face
|
||||
* object.
|
||||
*
|
||||
* @input:
|
||||
* stream ::
|
||||
* The input stream.
|
||||
*
|
||||
* face ::
|
||||
* A handle to the target face object.
|
||||
*
|
||||
* face_index ::
|
||||
* The index of the TrueType font, if we are opening a collection, in
|
||||
* bits 0-15. The numbered instance index~+~1 of a GX (sub)font, if
|
||||
* applicable, in bits 16-30.
|
||||
*
|
||||
* num_params ::
|
||||
* The number of additional parameters.
|
||||
*
|
||||
* params ::
|
||||
* Optional additional parameters.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* This function must be called after TT_Init_Face_Func().
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Load_Face_Func)( FT_Stream stream,
|
||||
TT_Face face,
|
||||
FT_Int face_index,
|
||||
FT_Int num_params,
|
||||
FT_Parameter* params );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Done_Face_Func
|
||||
*
|
||||
* @description:
|
||||
* A callback used to delete the common SFNT data from a face.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the target face object.
|
||||
*
|
||||
* @note:
|
||||
* This function does NOT destroy the face object.
|
||||
*/
|
||||
typedef void
|
||||
(*TT_Done_Face_Func)( TT_Face face );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Load_Any_Func
|
||||
*
|
||||
* @description:
|
||||
* Load any font table into client memory.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The face object to look for.
|
||||
*
|
||||
* tag ::
|
||||
* The tag of table to load. Use the value 0 if you want to access the
|
||||
* whole font file, else set this parameter to a valid TrueType table
|
||||
* tag that you can forge with the MAKE_TT_TAG macro.
|
||||
*
|
||||
* offset ::
|
||||
* The starting offset in the table (or the file if tag == 0).
|
||||
*
|
||||
* length ::
|
||||
* The address of the decision variable:
|
||||
*
|
||||
* If `length == NULL`: Loads the whole table. Returns an error if
|
||||
* 'offset' == 0!
|
||||
*
|
||||
* If `*length == 0`: Exits immediately; returning the length of the
|
||||
* given table or of the font file, depending on the value of 'tag'.
|
||||
*
|
||||
* If `*length != 0`: Loads the next 'length' bytes of table or font,
|
||||
* starting at offset 'offset' (in table or font too).
|
||||
*
|
||||
* @output:
|
||||
* buffer ::
|
||||
* The address of target buffer.
|
||||
*
|
||||
* @return:
|
||||
* TrueType error code. 0 means success.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Load_Any_Func)( TT_Face face,
|
||||
FT_ULong tag,
|
||||
FT_Long offset,
|
||||
FT_Byte *buffer,
|
||||
FT_ULong* length );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Find_SBit_Image_Func
|
||||
*
|
||||
* @description:
|
||||
* Check whether an embedded bitmap (an 'sbit') exists for a given glyph,
|
||||
* at a given strike.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The target face object.
|
||||
*
|
||||
* glyph_index ::
|
||||
* The glyph index.
|
||||
*
|
||||
* strike_index ::
|
||||
* The current strike index.
|
||||
*
|
||||
* @output:
|
||||
* arange ::
|
||||
* The SBit range containing the glyph index.
|
||||
*
|
||||
* astrike ::
|
||||
* The SBit strike containing the glyph index.
|
||||
*
|
||||
* aglyph_offset ::
|
||||
* The offset of the glyph data in 'EBDT' table.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success. Returns
|
||||
* SFNT_Err_Invalid_Argument if no sbit exists for the requested glyph.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Find_SBit_Image_Func)( TT_Face face,
|
||||
FT_UInt glyph_index,
|
||||
FT_ULong strike_index,
|
||||
TT_SBit_Range *arange,
|
||||
TT_SBit_Strike *astrike,
|
||||
FT_ULong *aglyph_offset );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Load_SBit_Metrics_Func
|
||||
*
|
||||
* @description:
|
||||
* Get the big metrics for a given embedded bitmap.
|
||||
*
|
||||
* @input:
|
||||
* stream ::
|
||||
* The input stream.
|
||||
*
|
||||
* range ::
|
||||
* The SBit range containing the glyph.
|
||||
*
|
||||
* @output:
|
||||
* big_metrics ::
|
||||
* A big SBit metrics structure for the glyph.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* The stream cursor must be positioned at the glyph's offset within the
|
||||
* 'EBDT' table before the call.
|
||||
*
|
||||
* If the image format uses variable metrics, the stream cursor is
|
||||
* positioned just after the metrics header in the 'EBDT' table on
|
||||
* function exit.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Load_SBit_Metrics_Func)( FT_Stream stream,
|
||||
TT_SBit_Range range,
|
||||
TT_SBit_Metrics metrics );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Load_SBit_Image_Func
|
||||
*
|
||||
* @description:
|
||||
* Load a given glyph sbit image from the font resource. This also
|
||||
* returns its metrics.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The target face object.
|
||||
*
|
||||
* strike_index ::
|
||||
* The strike index.
|
||||
*
|
||||
* glyph_index ::
|
||||
* The current glyph index.
|
||||
*
|
||||
* load_flags ::
|
||||
* The current load flags.
|
||||
*
|
||||
* stream ::
|
||||
* The input stream.
|
||||
*
|
||||
* @output:
|
||||
* amap ::
|
||||
* The target pixmap.
|
||||
*
|
||||
* ametrics ::
|
||||
* A big sbit metrics structure for the glyph image.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success. Returns an error if no glyph
|
||||
* sbit exists for the index.
|
||||
*
|
||||
* @note:
|
||||
* The `map.buffer` field is always freed before the glyph is loaded.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Load_SBit_Image_Func)( TT_Face face,
|
||||
FT_ULong strike_index,
|
||||
FT_UInt glyph_index,
|
||||
FT_UInt load_flags,
|
||||
FT_Stream stream,
|
||||
FT_Bitmap *amap,
|
||||
TT_SBit_MetricsRec *ametrics );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Set_SBit_Strike_Func
|
||||
*
|
||||
* @description:
|
||||
* Select an sbit strike for a given size request.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The target face object.
|
||||
*
|
||||
* req ::
|
||||
* The size request.
|
||||
*
|
||||
* @output:
|
||||
* astrike_index ::
|
||||
* The index of the sbit strike.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success. Returns an error if no sbit
|
||||
* strike exists for the selected ppem values.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Set_SBit_Strike_Func)( TT_Face face,
|
||||
FT_Size_Request req,
|
||||
FT_ULong* astrike_index );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Load_Strike_Metrics_Func
|
||||
*
|
||||
* @description:
|
||||
* Load the metrics of a given strike.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The target face object.
|
||||
*
|
||||
* strike_index ::
|
||||
* The strike index.
|
||||
*
|
||||
* @output:
|
||||
* metrics ::
|
||||
* the metrics of the strike.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success. Returns an error if no such
|
||||
* sbit strike exists.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Load_Strike_Metrics_Func)( TT_Face face,
|
||||
FT_ULong strike_index,
|
||||
FT_Size_Metrics* metrics );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Get_PS_Name_Func
|
||||
*
|
||||
* @description:
|
||||
* Get the PostScript glyph name of a glyph.
|
||||
*
|
||||
* @input:
|
||||
* idx ::
|
||||
* The glyph index.
|
||||
*
|
||||
* PSname ::
|
||||
* The address of a string pointer. Will be `NULL` in case of error,
|
||||
* otherwise it is a pointer to the glyph name.
|
||||
*
|
||||
* You must not modify the returned string!
|
||||
*
|
||||
* @output:
|
||||
* FreeType error code. 0 means success.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Get_PS_Name_Func)( TT_Face face,
|
||||
FT_UInt idx,
|
||||
FT_String** PSname );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Load_Metrics_Func
|
||||
*
|
||||
* @description:
|
||||
* Load a metrics table, which is a table with a horizontal and a
|
||||
* vertical version.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the target face object.
|
||||
*
|
||||
* stream ::
|
||||
* The input stream.
|
||||
*
|
||||
* vertical ::
|
||||
* A boolean flag. If set, load the vertical one.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Load_Metrics_Func)( TT_Face face,
|
||||
FT_Stream stream,
|
||||
FT_Bool vertical );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Get_Metrics_Func
|
||||
*
|
||||
* @description:
|
||||
* Load the horizontal or vertical header in a face object.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the target face object.
|
||||
*
|
||||
* vertical ::
|
||||
* A boolean flag. If set, load vertical metrics.
|
||||
*
|
||||
* gindex ::
|
||||
* The glyph index.
|
||||
*
|
||||
* @output:
|
||||
* abearing ::
|
||||
* The horizontal (or vertical) bearing. Set to zero in case of error.
|
||||
*
|
||||
* aadvance ::
|
||||
* The horizontal (or vertical) advance. Set to zero in case of error.
|
||||
*/
|
||||
typedef void
|
||||
(*TT_Get_Metrics_Func)( TT_Face face,
|
||||
FT_Bool vertical,
|
||||
FT_UInt gindex,
|
||||
FT_Short* abearing,
|
||||
FT_UShort* aadvance );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Set_Palette_Func
|
||||
*
|
||||
* @description:
|
||||
* Load the colors into `face->palette` for a given palette index.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The target face object.
|
||||
*
|
||||
* idx ::
|
||||
* The palette index.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Set_Palette_Func)( TT_Face face,
|
||||
FT_UInt idx );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Get_Colr_Layer_Func
|
||||
*
|
||||
* @description:
|
||||
* Iteratively get the color layer data of a given glyph index.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The target face object.
|
||||
*
|
||||
* base_glyph ::
|
||||
* The glyph index the colored glyph layers are associated with.
|
||||
*
|
||||
* @inout:
|
||||
* iterator ::
|
||||
* An @FT_LayerIterator object. For the first call you should set
|
||||
* `iterator->p` to `NULL`. For all following calls, simply use the
|
||||
* same object again.
|
||||
*
|
||||
* @output:
|
||||
* aglyph_index ::
|
||||
* The glyph index of the current layer.
|
||||
*
|
||||
* acolor_index ::
|
||||
* The color index into the font face's color palette of the current
|
||||
* layer. The value 0xFFFF is special; it doesn't reference a palette
|
||||
* entry but indicates that the text foreground color should be used
|
||||
* instead (to be set up by the application outside of FreeType).
|
||||
*
|
||||
* @return:
|
||||
* Value~1 if everything is OK. If there are no more layers (or if there
|
||||
* are no layers at all), value~0 gets returned. In case of an error,
|
||||
* value~0 is returned also.
|
||||
*/
|
||||
typedef FT_Bool
|
||||
(*TT_Get_Colr_Layer_Func)( TT_Face face,
|
||||
FT_UInt base_glyph,
|
||||
FT_UInt *aglyph_index,
|
||||
FT_UInt *acolor_index,
|
||||
FT_LayerIterator* iterator );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Blend_Colr_Func
|
||||
*
|
||||
* @description:
|
||||
* Blend the bitmap in `new_glyph` into `base_glyph` using the color
|
||||
* specified by `color_index`. If `color_index` is 0xFFFF, use
|
||||
* `face->foreground_color` if `face->have_foreground_color` is set.
|
||||
* Otherwise check `face->palette_data.palette_flags`: If present and
|
||||
* @FT_PALETTE_FOR_DARK_BACKGROUND is set, use BGRA value 0xFFFFFFFF
|
||||
* (white opaque). Otherwise use BGRA value 0x000000FF (black opaque).
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The target face object.
|
||||
*
|
||||
* color_index ::
|
||||
* Color index from the COLR table.
|
||||
*
|
||||
* base_glyph ::
|
||||
* Slot for bitmap to be merged into. The underlying bitmap may get
|
||||
* reallocated.
|
||||
*
|
||||
* new_glyph ::
|
||||
* Slot to be incooperated into `base_glyph`.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success. Returns an error if
|
||||
* color_index is invalid or reallocation fails.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Blend_Colr_Func)( TT_Face face,
|
||||
FT_UInt color_index,
|
||||
FT_GlyphSlot base_glyph,
|
||||
FT_GlyphSlot new_glyph );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Get_Name_Func
|
||||
*
|
||||
* @description:
|
||||
* From the 'name' table, return a given ENGLISH name record in ASCII.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the source face object.
|
||||
*
|
||||
* nameid ::
|
||||
* The name id of the name record to return.
|
||||
*
|
||||
* @inout:
|
||||
* name ::
|
||||
* The address of an allocated string pointer. `NULL` if no name is
|
||||
* present.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Get_Name_Func)( TT_Face face,
|
||||
FT_UShort nameid,
|
||||
FT_String** name );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Get_Name_ID_Func
|
||||
*
|
||||
* @description:
|
||||
* Search whether an ENGLISH version for a given name ID is in the 'name'
|
||||
* table.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the source face object.
|
||||
*
|
||||
* nameid ::
|
||||
* The name id of the name record to return.
|
||||
*
|
||||
* @output:
|
||||
* win ::
|
||||
* If non-negative, an index into the 'name' table with the
|
||||
* corresponding (3,1) or (3,0) Windows entry.
|
||||
*
|
||||
* apple ::
|
||||
* If non-negative, an index into the 'name' table with the
|
||||
* corresponding (1,0) Apple entry.
|
||||
*
|
||||
* @return:
|
||||
* 1 if there is either a win or apple entry (or both), 0 otheriwse.
|
||||
*/
|
||||
typedef FT_Bool
|
||||
(*TT_Get_Name_ID_Func)( TT_Face face,
|
||||
FT_UShort nameid,
|
||||
FT_Int *win,
|
||||
FT_Int *apple );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Load_Table_Func
|
||||
*
|
||||
* @description:
|
||||
* Load a given TrueType table.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the target face object.
|
||||
*
|
||||
* stream ::
|
||||
* The input stream.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* The function uses `face->goto_table` to seek the stream to the start
|
||||
* of the table, except while loading the font directory.
|
||||
*/
|
||||
typedef FT_Error
|
||||
(*TT_Load_Table_Func)( TT_Face face,
|
||||
FT_Stream stream );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @functype:
|
||||
* TT_Free_Table_Func
|
||||
*
|
||||
* @description:
|
||||
* Free a given TrueType table.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the target face object.
|
||||
*/
|
||||
typedef void
|
||||
(*TT_Free_Table_Func)( TT_Face face );
|
||||
|
||||
|
||||
/*
|
||||
* @functype:
|
||||
* TT_Face_GetKerningFunc
|
||||
*
|
||||
* @description:
|
||||
* Return the horizontal kerning value between two glyphs.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the source face object.
|
||||
*
|
||||
* left_glyph ::
|
||||
* The left glyph index.
|
||||
*
|
||||
* right_glyph ::
|
||||
* The right glyph index.
|
||||
*
|
||||
* @return:
|
||||
* The kerning value in font units.
|
||||
*/
|
||||
typedef FT_Int
|
||||
(*TT_Face_GetKerningFunc)( TT_Face face,
|
||||
FT_UInt left_glyph,
|
||||
FT_UInt right_glyph );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* SFNT_Interface
|
||||
*
|
||||
* @description:
|
||||
* This structure holds pointers to the functions used to load and free
|
||||
* the basic tables that are required in a 'sfnt' font file.
|
||||
*
|
||||
* @fields:
|
||||
* Check the various xxx_Func() descriptions for details.
|
||||
*/
|
||||
typedef struct SFNT_Interface_
|
||||
{
|
||||
TT_Loader_GotoTableFunc goto_table;
|
||||
|
||||
TT_Init_Face_Func init_face;
|
||||
TT_Load_Face_Func load_face;
|
||||
TT_Done_Face_Func done_face;
|
||||
FT_Module_Requester get_interface;
|
||||
|
||||
TT_Load_Any_Func load_any;
|
||||
|
||||
/* these functions are called by `load_face' but they can also */
|
||||
/* be called from external modules, if there is a need to do so */
|
||||
TT_Load_Table_Func load_head;
|
||||
TT_Load_Metrics_Func load_hhea;
|
||||
TT_Load_Table_Func load_cmap;
|
||||
TT_Load_Table_Func load_maxp;
|
||||
TT_Load_Table_Func load_os2;
|
||||
TT_Load_Table_Func load_post;
|
||||
|
||||
TT_Load_Table_Func load_name;
|
||||
TT_Free_Table_Func free_name;
|
||||
|
||||
/* this field was called `load_kerning' up to version 2.1.10 */
|
||||
TT_Load_Table_Func load_kern;
|
||||
|
||||
TT_Load_Table_Func load_gasp;
|
||||
TT_Load_Table_Func load_pclt;
|
||||
|
||||
/* see `ttload.h'; this field was called `load_bitmap_header' up to */
|
||||
/* version 2.1.10 */
|
||||
TT_Load_Table_Func load_bhed;
|
||||
|
||||
TT_Load_SBit_Image_Func load_sbit_image;
|
||||
|
||||
/* see `ttpost.h' */
|
||||
TT_Get_PS_Name_Func get_psname;
|
||||
TT_Free_Table_Func free_psnames;
|
||||
|
||||
/* starting here, the structure differs from version 2.1.7 */
|
||||
|
||||
/* this field was introduced in version 2.1.8, named `get_psname' */
|
||||
TT_Face_GetKerningFunc get_kerning;
|
||||
|
||||
/* new elements introduced after version 2.1.10 */
|
||||
|
||||
/* load the font directory, i.e., the offset table and */
|
||||
/* the table directory */
|
||||
TT_Load_Table_Func load_font_dir;
|
||||
TT_Load_Metrics_Func load_hmtx;
|
||||
|
||||
TT_Load_Table_Func load_eblc;
|
||||
TT_Free_Table_Func free_eblc;
|
||||
|
||||
TT_Set_SBit_Strike_Func set_sbit_strike;
|
||||
TT_Load_Strike_Metrics_Func load_strike_metrics;
|
||||
|
||||
TT_Load_Table_Func load_cpal;
|
||||
TT_Load_Table_Func load_colr;
|
||||
TT_Free_Table_Func free_cpal;
|
||||
TT_Free_Table_Func free_colr;
|
||||
TT_Set_Palette_Func set_palette;
|
||||
TT_Get_Colr_Layer_Func get_colr_layer;
|
||||
TT_Blend_Colr_Func colr_blend;
|
||||
|
||||
TT_Get_Metrics_Func get_metrics;
|
||||
|
||||
TT_Get_Name_Func get_name;
|
||||
TT_Get_Name_ID_Func get_name_id;
|
||||
|
||||
} SFNT_Interface;
|
||||
|
||||
|
||||
/* transitional */
|
||||
typedef SFNT_Interface* SFNT_Service;
|
||||
|
||||
|
||||
#define FT_DEFINE_SFNT_INTERFACE( \
|
||||
class_, \
|
||||
goto_table_, \
|
||||
init_face_, \
|
||||
load_face_, \
|
||||
done_face_, \
|
||||
get_interface_, \
|
||||
load_any_, \
|
||||
load_head_, \
|
||||
load_hhea_, \
|
||||
load_cmap_, \
|
||||
load_maxp_, \
|
||||
load_os2_, \
|
||||
load_post_, \
|
||||
load_name_, \
|
||||
free_name_, \
|
||||
load_kern_, \
|
||||
load_gasp_, \
|
||||
load_pclt_, \
|
||||
load_bhed_, \
|
||||
load_sbit_image_, \
|
||||
get_psname_, \
|
||||
free_psnames_, \
|
||||
get_kerning_, \
|
||||
load_font_dir_, \
|
||||
load_hmtx_, \
|
||||
load_eblc_, \
|
||||
free_eblc_, \
|
||||
set_sbit_strike_, \
|
||||
load_strike_metrics_, \
|
||||
load_cpal_, \
|
||||
load_colr_, \
|
||||
free_cpal_, \
|
||||
free_colr_, \
|
||||
set_palette_, \
|
||||
get_colr_layer_, \
|
||||
colr_blend_, \
|
||||
get_metrics_, \
|
||||
get_name_, \
|
||||
get_name_id_ ) \
|
||||
static const SFNT_Interface class_ = \
|
||||
{ \
|
||||
goto_table_, \
|
||||
init_face_, \
|
||||
load_face_, \
|
||||
done_face_, \
|
||||
get_interface_, \
|
||||
load_any_, \
|
||||
load_head_, \
|
||||
load_hhea_, \
|
||||
load_cmap_, \
|
||||
load_maxp_, \
|
||||
load_os2_, \
|
||||
load_post_, \
|
||||
load_name_, \
|
||||
free_name_, \
|
||||
load_kern_, \
|
||||
load_gasp_, \
|
||||
load_pclt_, \
|
||||
load_bhed_, \
|
||||
load_sbit_image_, \
|
||||
get_psname_, \
|
||||
free_psnames_, \
|
||||
get_kerning_, \
|
||||
load_font_dir_, \
|
||||
load_hmtx_, \
|
||||
load_eblc_, \
|
||||
free_eblc_, \
|
||||
set_sbit_strike_, \
|
||||
load_strike_metrics_, \
|
||||
load_cpal_, \
|
||||
load_colr_, \
|
||||
free_cpal_, \
|
||||
free_colr_, \
|
||||
set_palette_, \
|
||||
get_colr_layer_, \
|
||||
colr_blend_, \
|
||||
get_metrics_, \
|
||||
get_name_, \
|
||||
get_name_id_ \
|
||||
};
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* SFNT_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
260
includes/freetype/internal/t1types.h
Normal file
260
includes/freetype/internal/t1types.h
Normal file
@@ -0,0 +1,260 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* t1types.h
|
||||
*
|
||||
* Basic Type1/Type2 type definitions and interface (specification
|
||||
* only).
|
||||
*
|
||||
* Copyright (C) 1996-2020 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_HINTS_H
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
#include FT_INTERNAL_HASH_H
|
||||
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @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;
|
||||
const FT_String** char_name;
|
||||
|
||||
} T1_EncodingRec, *T1_Encoding;
|
||||
|
||||
|
||||
/* 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_
|
||||
{
|
||||
FT_UShort fs_type;
|
||||
|
||||
} PS_FontExtraRec;
|
||||
|
||||
|
||||
typedef struct T1_FontRec_
|
||||
{
|
||||
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;
|
||||
|
||||
FT_Byte* subrs_block;
|
||||
FT_Byte* charstrings_block;
|
||||
FT_Byte* glyph_names_block;
|
||||
|
||||
FT_Int num_subrs;
|
||||
FT_Byte** subrs;
|
||||
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_UInt* charstrings_len;
|
||||
|
||||
FT_Byte paint_type;
|
||||
FT_Byte font_type;
|
||||
FT_Matrix font_matrix;
|
||||
FT_Vector font_offset;
|
||||
FT_BBox font_bbox;
|
||||
FT_Long font_id;
|
||||
|
||||
FT_Fixed stroke_width;
|
||||
|
||||
} T1_FontRec, *T1_Font;
|
||||
|
||||
|
||||
typedef struct CID_SubrsRec_
|
||||
{
|
||||
FT_Int num_subrs;
|
||||
FT_Byte** code;
|
||||
|
||||
} CID_SubrsRec, *CID_Subrs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*** 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;
|
||||
FT_Fixed Descender;
|
||||
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 ***/
|
||||
/*** ***/
|
||||
/*** ***/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
typedef struct T1_FaceRec_* T1_Face;
|
||||
typedef struct CID_FaceRec_* CID_Face;
|
||||
|
||||
|
||||
typedef struct T1_FaceRec_
|
||||
{
|
||||
FT_FaceRec root;
|
||||
T1_FontRec type1;
|
||||
const void* psnames;
|
||||
const void* psaux;
|
||||
const void* afm_data;
|
||||
FT_CharMapRec charmaprecs[2];
|
||||
FT_CharMap charmaps[2];
|
||||
|
||||
/* support for Multiple Masters fonts */
|
||||
PS_Blend blend;
|
||||
|
||||
/* 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;
|
||||
|
||||
|
||||
typedef struct CID_FaceRec_
|
||||
{
|
||||
FT_FaceRec root;
|
||||
void* psnames;
|
||||
void* psaux;
|
||||
CID_FaceInfoRec cid;
|
||||
PS_FontExtraRec font_extra;
|
||||
#if 0
|
||||
void* afm_data;
|
||||
#endif
|
||||
CID_Subrs subrs;
|
||||
|
||||
/* 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_ */
|
||||
|
||||
|
||||
/* END */
|
||||
1781
includes/freetype/internal/tttypes.h
Normal file
1781
includes/freetype/internal/tttypes.h
Normal file
File diff suppressed because it is too large
Load Diff
313
includes/freetype/internal/wofftypes.h
Normal file
313
includes/freetype/internal/wofftypes.h
Normal file
@@ -0,0 +1,313 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* wofftypes.h
|
||||
*
|
||||
* Basic WOFF/WOFF2 type definitions and interface (specification
|
||||
* only).
|
||||
*
|
||||
* Copyright (C) 1996-2020 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 WOFFTYPES_H_
|
||||
#define WOFFTYPES_H_
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_TRUETYPE_TABLES_H
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* WOFF_HeaderRec
|
||||
*
|
||||
* @description:
|
||||
* WOFF file format header.
|
||||
*
|
||||
* @fields:
|
||||
* See
|
||||
*
|
||||
* https://www.w3.org/TR/WOFF/#WOFFHeader
|
||||
*/
|
||||
typedef struct WOFF_HeaderRec_
|
||||
{
|
||||
FT_ULong signature;
|
||||
FT_ULong flavor;
|
||||
FT_ULong length;
|
||||
FT_UShort num_tables;
|
||||
FT_UShort reserved;
|
||||
FT_ULong totalSfntSize;
|
||||
FT_UShort majorVersion;
|
||||
FT_UShort minorVersion;
|
||||
FT_ULong metaOffset;
|
||||
FT_ULong metaLength;
|
||||
FT_ULong metaOrigLength;
|
||||
FT_ULong privOffset;
|
||||
FT_ULong privLength;
|
||||
|
||||
} WOFF_HeaderRec, *WOFF_Header;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* WOFF_TableRec
|
||||
*
|
||||
* @description:
|
||||
* This structure describes a given table of a WOFF font.
|
||||
*
|
||||
* @fields:
|
||||
* Tag ::
|
||||
* A four-bytes tag describing the table.
|
||||
*
|
||||
* Offset ::
|
||||
* The offset of the table from the start of the WOFF font in its
|
||||
* resource.
|
||||
*
|
||||
* CompLength ::
|
||||
* Compressed table length (in bytes).
|
||||
*
|
||||
* OrigLength ::
|
||||
* Uncompressed table length (in bytes).
|
||||
*
|
||||
* CheckSum ::
|
||||
* The table checksum. This value can be ignored.
|
||||
*
|
||||
* OrigOffset ::
|
||||
* The uncompressed table file offset. This value gets computed while
|
||||
* constructing the (uncompressed) SFNT header. It is not contained in
|
||||
* the WOFF file.
|
||||
*/
|
||||
typedef struct WOFF_TableRec_
|
||||
{
|
||||
FT_ULong Tag; /* table ID */
|
||||
FT_ULong Offset; /* table file offset */
|
||||
FT_ULong CompLength; /* compressed table length */
|
||||
FT_ULong OrigLength; /* uncompressed table length */
|
||||
FT_ULong CheckSum; /* uncompressed checksum */
|
||||
|
||||
FT_ULong OrigOffset; /* uncompressed table file offset */
|
||||
/* (not in the WOFF file) */
|
||||
} WOFF_TableRec, *WOFF_Table;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* WOFF2_TtcFontRec
|
||||
*
|
||||
* @description:
|
||||
* Metadata for a TTC font entry in WOFF2.
|
||||
*
|
||||
* @fields:
|
||||
* flavor ::
|
||||
* TTC font flavor.
|
||||
*
|
||||
* num_tables ::
|
||||
* Number of tables in TTC, indicating number of elements in
|
||||
* `table_indices`.
|
||||
*
|
||||
* table_indices ::
|
||||
* Array of table indices for each TTC font.
|
||||
*/
|
||||
typedef struct WOFF2_TtcFontRec_
|
||||
{
|
||||
FT_ULong flavor;
|
||||
FT_UShort num_tables;
|
||||
FT_UShort* table_indices;
|
||||
|
||||
} WOFF2_TtcFontRec, *WOFF2_TtcFont;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* WOFF2_HeaderRec
|
||||
*
|
||||
* @description:
|
||||
* WOFF2 file format header.
|
||||
*
|
||||
* @fields:
|
||||
* See
|
||||
*
|
||||
* https://www.w3.org/TR/WOFF2/#woff20Header
|
||||
*
|
||||
* @note:
|
||||
* We don't care about the fields `reserved`, `majorVersion` and
|
||||
* `minorVersion`, so they are not included. The `totalSfntSize` field
|
||||
* does not necessarily represent the actual size of the uncompressed
|
||||
* SFNT font stream, so that is used as a reference value instead.
|
||||
*/
|
||||
typedef struct WOFF2_HeaderRec_
|
||||
{
|
||||
FT_ULong signature;
|
||||
FT_ULong flavor;
|
||||
FT_ULong length;
|
||||
FT_UShort num_tables;
|
||||
FT_ULong totalSfntSize;
|
||||
FT_ULong totalCompressedSize;
|
||||
FT_ULong metaOffset;
|
||||
FT_ULong metaLength;
|
||||
FT_ULong metaOrigLength;
|
||||
FT_ULong privOffset;
|
||||
FT_ULong privLength;
|
||||
|
||||
FT_ULong uncompressed_size; /* uncompressed brotli stream size */
|
||||
FT_ULong compressed_offset; /* compressed stream offset */
|
||||
FT_ULong header_version; /* version of original TTC Header */
|
||||
FT_UShort num_fonts; /* number of fonts in TTC */
|
||||
FT_ULong actual_sfnt_size; /* actual size of sfnt stream */
|
||||
|
||||
WOFF2_TtcFont ttc_fonts; /* metadata for fonts in a TTC */
|
||||
|
||||
} WOFF2_HeaderRec, *WOFF2_Header;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* WOFF2_TableRec
|
||||
*
|
||||
* @description:
|
||||
* This structure describes a given table of a WOFF2 font.
|
||||
*
|
||||
* @fields:
|
||||
* See
|
||||
*
|
||||
* https://www.w3.org/TR/WOFF2/#table_dir_format
|
||||
*/
|
||||
typedef struct WOFF2_TableRec_
|
||||
{
|
||||
FT_Byte FlagByte; /* table type and flags */
|
||||
FT_ULong Tag; /* table file offset */
|
||||
FT_ULong dst_length; /* uncompressed table length */
|
||||
FT_ULong TransformLength; /* transformed length */
|
||||
|
||||
FT_ULong flags; /* calculated flags */
|
||||
FT_ULong src_offset; /* compressed table offset */
|
||||
FT_ULong src_length; /* compressed table length */
|
||||
FT_ULong dst_offset; /* uncompressed table offset */
|
||||
|
||||
} WOFF2_TableRec, *WOFF2_Table;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* WOFF2_InfoRec
|
||||
*
|
||||
* @description:
|
||||
* Metadata for WOFF2 font that may be required for reconstruction of
|
||||
* sfnt tables.
|
||||
*
|
||||
* @fields:
|
||||
* header_checksum ::
|
||||
* Checksum of SFNT offset table.
|
||||
*
|
||||
* num_glyphs ::
|
||||
* Number of glyphs in the font.
|
||||
*
|
||||
* num_hmetrics ::
|
||||
* `numberOfHMetrics` field in the 'hhea' table.
|
||||
*
|
||||
* x_mins ::
|
||||
* `xMin` values of glyph bounding box.
|
||||
*
|
||||
* glyf_table ::
|
||||
* A pointer to the `glyf' table record.
|
||||
*
|
||||
* loca_table ::
|
||||
* A pointer to the `loca' table record.
|
||||
*
|
||||
* head_table ::
|
||||
* A pointer to the `head' table record.
|
||||
*/
|
||||
typedef struct WOFF2_InfoRec_
|
||||
{
|
||||
FT_ULong header_checksum;
|
||||
FT_UShort num_glyphs;
|
||||
FT_UShort num_hmetrics;
|
||||
FT_Short* x_mins;
|
||||
|
||||
WOFF2_Table glyf_table;
|
||||
WOFF2_Table loca_table;
|
||||
WOFF2_Table head_table;
|
||||
|
||||
} WOFF2_InfoRec, *WOFF2_Info;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* WOFF2_SubstreamRec
|
||||
*
|
||||
* @description:
|
||||
* This structure stores information about a substream in the transformed
|
||||
* 'glyf' table in a WOFF2 stream.
|
||||
*
|
||||
* @fields:
|
||||
* start ::
|
||||
* Beginning of the substream relative to uncompressed table stream.
|
||||
*
|
||||
* offset ::
|
||||
* Offset of the substream relative to uncompressed table stream.
|
||||
*
|
||||
* size ::
|
||||
* Size of the substream.
|
||||
*/
|
||||
typedef struct WOFF2_SubstreamRec_
|
||||
{
|
||||
FT_ULong start;
|
||||
FT_ULong offset;
|
||||
FT_ULong size;
|
||||
|
||||
} WOFF2_SubstreamRec, *WOFF2_Substream;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* WOFF2_PointRec
|
||||
*
|
||||
* @description:
|
||||
* This structure stores information about a point in the transformed
|
||||
* 'glyf' table in a WOFF2 stream.
|
||||
*
|
||||
* @fields:
|
||||
* x ::
|
||||
* x-coordinate of point.
|
||||
*
|
||||
* y ::
|
||||
* y-coordinate of point.
|
||||
*
|
||||
* on_curve ::
|
||||
* Set if point is on-curve.
|
||||
*/
|
||||
typedef struct WOFF2_PointRec_
|
||||
{
|
||||
FT_Int x;
|
||||
FT_Int y;
|
||||
FT_Bool on_curve;
|
||||
|
||||
} WOFF2_PointRec, *WOFF2_Point;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* WOFFTYPES_H_ */
|
||||
|
||||
|
||||
/* END */
|
||||
Reference in New Issue
Block a user