⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ftxgpos.h

📁 字体缩放显示
💻 H
📖 第 1 页 / 共 2 页
字号:
/******************************************************************* * *  ftxgpos.h * *    TrueType Open GPOS table support * *  Copyright 1996-2001 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 FTXOPEN_H#error "Don't include this file! Use ftxopen.h instead."#endif#ifndef FTXGPOS_H#define FTXGPOS_H#ifdef __cplusplusextern "C" {#endif#define TTO_Err_Invalid_GPOS_SubTable_Format  0x1020#define TTO_Err_Invalid_GPOS_SubTable         0x1021#define GPOS_ID  Build_Extension_ID( 'G', 'P', 'O', 'S' )/* Lookup types for glyph positioning */#define GPOS_LOOKUP_SINGLE     1#define GPOS_LOOKUP_PAIR       2#define GPOS_LOOKUP_CURSIVE    3#define GPOS_LOOKUP_MARKBASE   4#define GPOS_LOOKUP_MARKLIG    5#define GPOS_LOOKUP_MARKMARK   6#define GPOS_LOOKUP_CONTEXT    7#define GPOS_LOOKUP_CHAIN      8#define GPOS_LOOKUP_EXTENSION  9  /* A pointer to a function which loads a glyph.  Its parameters are     the same as in a call to TT_Load_Glyph() -- if no glyph loading     function will be registered with TTO_GPOS_Register_Glyph_Function(),     TT_Load_Glyph() will be called indeed.  The purpose of this function     pointer is to provide a hook for caching glyph outlines and sbits     (using the instance's generic pointer to hold the data).     If for some reason no outline data is available (e.g. for an     embedded bitmap glyph), _glyph->outline.n_points should be set to     zero.  _glyph can be computed with        _glyph = HANDLE_Glyph( glyph )                                    */  typedef TT_Error  (*TTO_GlyphFunction)(TT_Instance  instance,                                         TT_Glyph     glyph,                                         TT_UShort    glyphIndex,                                         TT_UShort    loadFlags );  /* A pointer to a function which accesses the PostScript interpreter.     Multiple Master fonts need this interface to convert a metric ID     (as stored in an OpenType font version 1.2 or higher) `metric_id'     into a metric value (returned in `metric_value').     `data' points to the user-defined structure specified during a     call to TT_GPOS_Register_MM_Function().     `metric_value' must be returned as a scaled value (but shouldn't     be rounded).                                                       */  typedef TT_Error  (*TTO_MMFunction)(TT_Instance  instance,                                      TT_UShort    metric_id,                                      TT_Pos*      metric_value,                                      void*        data );                                            struct  TTO_GPOSHeader_  {    TT_Bool            loaded;    TT_ULong           offset;    TT_Fixed           Version;    TTO_ScriptList     ScriptList;    TTO_FeatureList    FeatureList;    TTO_LookupList     LookupList;    TTO_GDEFHeader*    gdef;    /* the next field is used for a callback function to get the       glyph outline.                                            */    TTO_GlyphFunction  gfunc;    /* this is OpenType 1.2 -- Multiple Master fonts need this       callback function to get various metric values from the       PostScript interpreter.                                 */    TTO_MMFunction     mmfunc;    void*              data;  };  typedef struct TTO_GPOSHeader_  TTO_GPOSHeader;  /* shared tables */  struct  TTO_ValueRecord_  {    TT_Short    XPlacement;             /* horizontal adjustment for                                           placement                      */    TT_Short    YPlacement;             /* vertical adjustment for                                           placement                      */    TT_Short    XAdvance;               /* horizontal adjustment for                                           advance                        */    TT_Short    YAdvance;               /* vertical adjustment for                                           advance                        */    TTO_Device  XPlacementDevice;       /* device table for horizontal                                           placement                      */    TTO_Device  YPlacementDevice;       /* device table for vertical                                           placement                      */    TTO_Device  XAdvanceDevice;         /* device table for horizontal                                           advance                        */    TTO_Device  YAdvanceDevice;         /* device table for vertical                                           advance                        */    TT_UShort   XIdPlacement;           /* horizontal placement metric ID */    TT_UShort   YIdPlacement;           /* vertical placement metric ID   */    TT_UShort   XIdAdvance;             /* horizontal advance metric ID   */    TT_UShort   YIdAdvance;             /* vertical advance metric ID     */  };  typedef struct TTO_ValueRecord_  TTO_ValueRecord;/* Mask values to scan the value format of the ValueRecord structure.   We always expand compressed ValueRecords of the font.              */#define HAVE_X_PLACEMENT         0x0001#define HAVE_Y_PLACEMENT         0x0002#define HAVE_X_ADVANCE           0x0004#define HAVE_Y_ADVANCE           0x0008#define HAVE_X_PLACEMENT_DEVICE  0x0010#define HAVE_Y_PLACEMENT_DEVICE  0x0020#define HAVE_X_ADVANCE_DEVICE    0x0040#define HAVE_Y_ADVANCE_DEVICE    0x0080#define HAVE_X_ID_PLACEMENT      0x0100#define HAVE_Y_ID_PLACEMENT      0x0200#define HAVE_X_ID_ADVANCE        0x0400#define HAVE_Y_ID_ADVANCE        0x0800  struct  TTO_AnchorFormat1_  {    TT_Short   XCoordinate;             /* horizontal value */    TT_Short   YCoordinate;             /* vertical value   */  };  typedef struct TTO_AnchorFormat1_  TTO_AnchorFormat1;  struct  TTO_AnchorFormat2_  {    TT_Short   XCoordinate;             /* horizontal value             */    TT_Short   YCoordinate;             /* vertical value               */    TT_UShort  AnchorPoint;             /* index to glyph contour point */  };  typedef struct TTO_AnchorFormat2_  TTO_AnchorFormat2;  struct  TTO_AnchorFormat3_  {    TT_Short    XCoordinate;            /* horizontal value              */    TT_Short    YCoordinate;            /* vertical value                */    TTO_Device  XDeviceTable;           /* device table for X coordinate */    TTO_Device  YDeviceTable;           /* device table for Y coordinate */  };  typedef struct TTO_AnchorFormat3_  TTO_AnchorFormat3;  struct  TTO_AnchorFormat4_  {    TT_UShort  XIdAnchor;               /* horizontal metric ID */    TT_UShort  YIdAnchor;               /* vertical metric ID   */  };  typedef struct TTO_AnchorFormat4_  TTO_AnchorFormat4;  struct  TTO_Anchor_  {    TT_UShort  PosFormat;               /* 1, 2, 3, or 4 -- 0 indicates                                           that there is no Anchor table */    union    {      TTO_AnchorFormat1  af1;      TTO_AnchorFormat2  af2;      TTO_AnchorFormat3  af3;      TTO_AnchorFormat4  af4;    } af;  };  typedef struct TTO_Anchor_  TTO_Anchor;  struct  TTO_MarkRecord_  {    TT_UShort   Class;                  /* mark class   */    TTO_Anchor  MarkAnchor;             /* anchor table */  };  typedef struct TTO_MarkRecord_  TTO_MarkRecord;  struct  TTO_MarkArray_  {    TT_UShort        MarkCount;         /* number of MarkRecord tables */    TTO_MarkRecord*  MarkRecord;        /* array of MarkRecord tables  */  };  typedef struct TTO_MarkArray_  TTO_MarkArray;  /* LookupType 1 */  struct  TTO_SinglePosFormat1_  {    TTO_ValueRecord  Value;             /* ValueRecord for all covered                                           glyphs                      */  };  typedef struct TTO_SinglePosFormat1_  TTO_SinglePosFormat1;  struct  TTO_SinglePosFormat2_  {    TT_UShort         ValueCount;       /* number of ValueRecord tables */    TTO_ValueRecord*  Value;            /* array of ValueRecord tables  */  };  typedef struct TTO_SinglePosFormat2_  TTO_SinglePosFormat2;  struct  TTO_SinglePos_  {    TT_UShort     PosFormat;            /* 1 or 2         */    TTO_Coverage  Coverage;             /* Coverage table */    TT_UShort     ValueFormat;          /* format of ValueRecord table */    union    {      TTO_SinglePosFormat1  spf1;      TTO_SinglePosFormat2  spf2;    } spf;  };  typedef struct TTO_SinglePos_  TTO_SinglePos;  /* LookupType 2 */  struct  TTO_PairValueRecord_  {    TT_UShort        SecondGlyph;       /* glyph ID for second glyph  */    TTO_ValueRecord  Value1;            /* pos. data for first glyph  */    TTO_ValueRecord  Value2;            /* pos. data for second glyph */  };  typedef struct TTO_PairValueRecord_  TTO_PairValueRecord;  struct  TTO_PairSet_  {    TT_UShort             PairValueCount;                                        /* number of PairValueRecord tables */    TTO_PairValueRecord*  PairValueRecord;                                        /* array of PairValueRecord tables  */  };  typedef struct TTO_PairSet_  TTO_PairSet;  struct  TTO_PairPosFormat1_  {    TT_UShort     PairSetCount;         /* number of PairSet tables    */    TTO_PairSet*  PairSet;              /* array of PairSet tables     */  };  typedef struct TTO_PairPosFormat1_  TTO_PairPosFormat1;  struct  TTO_Class2Record_  {    TTO_ValueRecord  Value1;            /* pos. data for first glyph  */    TTO_ValueRecord  Value2;            /* pos. data for second glyph */  };  typedef struct TTO_Class2Record_  TTO_Class2Record;  struct  TTO_Class1Record_  {    TTO_Class2Record*  Class2Record;    /* array of Class2Record tables */  };  typedef struct TTO_Class1Record_  TTO_Class1Record;  struct  TTO_PairPosFormat2_  {    TTO_ClassDefinition  ClassDef1;     /* class def. for first glyph     */    TTO_ClassDefinition  ClassDef2;     /* class def. for second glyph    */    TT_UShort            Class1Count;   /* number of classes in ClassDef1                                           table                          */    TT_UShort            Class2Count;   /* number of classes in ClassDef2                                           table                          */    TTO_Class1Record*    Class1Record;  /* array of Class1Record tables   */  };  typedef struct TTO_PairPosFormat2_  TTO_PairPosFormat2;  struct  TTO_PairPos_  {    TT_UShort     PosFormat;            /* 1 or 2         */    TTO_Coverage  Coverage;             /* Coverage table */    TT_UShort     ValueFormat1;         /* format of ValueRecord table                                           for first glyph             */    TT_UShort     ValueFormat2;         /* format of ValueRecord table                                           for second glyph            */    union    {      TTO_PairPosFormat1  ppf1;      TTO_PairPosFormat2  ppf2;    } ppf;  };  typedef struct TTO_PairPos_  TTO_PairPos;  /* LookupType 3 */  struct  TTO_EntryExitRecord_  {    TTO_Anchor  EntryAnchor;            /* entry Anchor table */    TTO_Anchor  ExitAnchor;             /* exit Anchor table  */  };  typedef struct TTO_EntryExitRecord_  TTO_EntryExitRecord;  struct  TTO_CursivePos_  {    TT_UShort             PosFormat;    /* always 1                         */    TTO_Coverage          Coverage;     /* Coverage table                   */    TT_UShort             EntryExitCount;                                        /* number of EntryExitRecord tables */    TTO_EntryExitRecord*  EntryExitRecord;                                        /* array of EntryExitRecord tables  */  };  typedef struct TTO_CursivePos_  TTO_CursivePos;  /* LookupType 4 */  struct  TTO_BaseRecord_  {    TTO_Anchor*  BaseAnchor;            /* array of base glyph anchor                                           tables                     */  };  typedef struct TTO_BaseRecord_  TTO_BaseRecord;  struct  TTO_BaseArray_  {    TT_UShort        BaseCount;         /* number of BaseRecord tables */    TTO_BaseRecord*  BaseRecord;        /* array of BaseRecord tables  */  };  typedef struct TTO_BaseArray_  TTO_BaseArray;  struct  TTO_MarkBasePos_  {    TT_UShort      PosFormat;           /* always 1                  */    TTO_Coverage   MarkCoverage;        /* mark glyph coverage table */    TTO_Coverage   BaseCoverage;        /* base glyph coverage table */    TT_UShort      ClassCount;          /* number of mark classes    */    TTO_MarkArray  MarkArray;           /* mark array table          */    TTO_BaseArray  BaseArray;           /* base array table          */  };  typedef struct TTO_MarkBasePos_  TTO_MarkBasePos;  /* LookupType 5 */  struct  TTO_ComponentRecord_  {    TTO_Anchor*  LigatureAnchor;        /* array of ligature glyph anchor                                           tables                         */  };  typedef struct TTO_ComponentRecord_  TTO_ComponentRecord;  struct  TTO_LigatureAttach_  {    TT_UShort             ComponentCount;                                        /* number of ComponentRecord tables */    TTO_ComponentRecord*  ComponentRecord;                                        /* array of ComponentRecord tables  */  };  typedef struct TTO_LigatureAttach_  TTO_LigatureAttach;  struct  TTO_LigatureArray_  {    TT_UShort            LigatureCount; /* number of LigatureAttach tables */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -