Eneboo - Documentación para desarrolladores
src/qt/src/3rdparty/opentype/ftxgpos.h
Ir a la documentación de este archivo.
00001 /*******************************************************************
00002  *
00003  *  ftxgpos.h
00004  *
00005  *    TrueType Open GPOS table support
00006  *
00007  *  Copyright 1996-2000 by
00008  *  David Turner, Robert Wilhelm, and Werner Lemberg.
00009  *
00010  *  This file is part of the FreeType project, and may only be used
00011  *  modified and distributed under the terms of the FreeType project
00012  *  license, LICENSE.TXT.  By continuing to use, modify, or distribute
00013  *  this file you indicate that you have read the license and
00014  *  understand and accept it fully.
00015  *
00016  ******************************************************************/
00017 
00018 #ifndef FTXOPEN_H
00019 #error "Don't include this file! Use ftxopen.h instead."
00020 #endif
00021 
00022 #ifndef FTXGPOS_H
00023 #define FTXGPOS_H
00024 
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028 
00029 #define TTO_Err_Invalid_GPOS_SubTable_Format  0x1020
00030 #define TTO_Err_Invalid_GPOS_SubTable         0x1021
00031 
00032 
00033 /* Lookup types for glyph positioning */
00034 
00035 #define GPOS_LOOKUP_SINGLE     1
00036 #define GPOS_LOOKUP_PAIR       2
00037 #define GPOS_LOOKUP_CURSIVE    3
00038 #define GPOS_LOOKUP_MARKBASE   4
00039 #define GPOS_LOOKUP_MARKLIG    5
00040 #define GPOS_LOOKUP_MARKMARK   6
00041 #define GPOS_LOOKUP_CONTEXT    7
00042 #define GPOS_LOOKUP_CHAIN      8
00043 #define GPOS_LOOKUP_EXTENSION  9
00044 
00045 
00046   /* A pointer to a function which loads a glyph.  Its parameters are
00047      the same as in a call to TT_Load_Glyph() -- if no glyph loading
00048      function will be registered with TTO_GPOS_Register_Glyph_Function(),
00049      TT_Load_Glyph() will be called indeed.  The purpose of this function
00050      pointer is to provide a hook for caching glyph outlines and sbits
00051      (using the instance's generic pointer to hold the data).
00052 
00053      If for some reason no outline data is available (e.g. for an
00054      embedded bitmap glyph), _glyph->outline.n_points should be set to
00055      zero.  _glyph can be computed with
00056 
00057         _glyph = HANDLE_Glyph( glyph )                                    */
00058 
00059   typedef FT_Error  (*TTO_GlyphFunction)(FT_Face      face,
00060                                          FT_UInt      glyphIndex,
00061                                          FT_Int       loadFlags );
00062 
00063 
00064   /* A pointer to a function which accesses the PostScript interpreter.
00065      Multiple Master fonts need this interface to convert a metric ID
00066      (as stored in an OpenType font version 1.2 or higher) `metric_id'
00067      into a metric value (returned in `metric_value').
00068 
00069      `data' points to the user-defined structure specified during a
00070      call to TT_GPOS_Register_MM_Function().
00071 
00072      `metric_value' must be returned as a scaled value (but shouldn't
00073      be rounded).                                                       */
00074 
00075   typedef FT_Error  (*TTO_MMFunction)(FT_Face      face,
00076                                       FT_UShort    metric_id,
00077                                       FT_Pos*      metric_value,
00078                                       void*        data );
00079                                           
00080 
00081   struct  TTO_GPOSHeader_
00082   {
00083     FT_Memory          memory;
00084     
00085     FT_Fixed           Version;
00086 
00087     TTO_ScriptList     ScriptList;
00088     TTO_FeatureList    FeatureList;
00089     TTO_LookupList     LookupList;
00090 
00091     TTO_GDEFHeader*    gdef;
00092 
00093     /* the next field is used for a callback function to get the
00094        glyph outline.                                            */
00095 
00096     TTO_GlyphFunction  gfunc;
00097 
00098     /* this is OpenType 1.2 -- Multiple Master fonts need this
00099        callback function to get various metric values from the
00100        PostScript interpreter.                                 */
00101 
00102     TTO_MMFunction     mmfunc;
00103     void*              data;
00104   };
00105 
00106   typedef struct TTO_GPOSHeader_  TTO_GPOSHeader;
00107   typedef struct TTO_GPOSHeader_* TTO_GPOS;
00108 
00109 
00110   /* shared tables */
00111 
00112   struct  TTO_ValueRecord_
00113   {
00114     FT_Short    XPlacement;             /* horizontal adjustment for
00115                                            placement                      */
00116     FT_Short    YPlacement;             /* vertical adjustment for
00117                                            placement                      */
00118     FT_Short    XAdvance;               /* horizontal adjustment for
00119                                            advance                        */
00120     FT_Short    YAdvance;               /* vertical adjustment for
00121                                            advance                        */
00122     TTO_Device  XPlacementDevice;       /* device table for horizontal
00123                                            placement                      */
00124     TTO_Device  YPlacementDevice;       /* device table for vertical
00125                                            placement                      */
00126     TTO_Device  XAdvanceDevice;         /* device table for horizontal
00127                                            advance                        */
00128     TTO_Device  YAdvanceDevice;         /* device table for vertical
00129                                            advance                        */
00130     FT_UShort   XIdPlacement;           /* horizontal placement metric ID */
00131     FT_UShort   YIdPlacement;           /* vertical placement metric ID   */
00132     FT_UShort   XIdAdvance;             /* horizontal advance metric ID   */
00133     FT_UShort   YIdAdvance;             /* vertical advance metric ID     */
00134   };
00135 
00136   typedef struct TTO_ValueRecord_  TTO_ValueRecord;
00137 
00138 
00139 /* Mask values to scan the value format of the ValueRecord structure.
00140    We always expand compressed ValueRecords of the font.              */
00141 
00142 #define HAVE_X_PLACEMENT         0x0001
00143 #define HAVE_Y_PLACEMENT         0x0002
00144 #define HAVE_X_ADVANCE           0x0004
00145 #define HAVE_Y_ADVANCE           0x0008
00146 #define HAVE_X_PLACEMENT_DEVICE  0x0010
00147 #define HAVE_Y_PLACEMENT_DEVICE  0x0020
00148 #define HAVE_X_ADVANCE_DEVICE    0x0040
00149 #define HAVE_Y_ADVANCE_DEVICE    0x0080
00150 #define HAVE_X_ID_PLACEMENT      0x0100
00151 #define HAVE_Y_ID_PLACEMENT      0x0200
00152 #define HAVE_X_ID_ADVANCE        0x0400
00153 #define HAVE_Y_ID_ADVANCE        0x0800
00154 
00155 
00156   struct  TTO_AnchorFormat1_
00157   {
00158     FT_Short   XCoordinate;             /* horizontal value */
00159     FT_Short   YCoordinate;             /* vertical value   */
00160   };
00161 
00162   typedef struct TTO_AnchorFormat1_  TTO_AnchorFormat1;
00163 
00164 
00165   struct  TTO_AnchorFormat2_
00166   {
00167     FT_Short   XCoordinate;             /* horizontal value             */
00168     FT_Short   YCoordinate;             /* vertical value               */
00169     FT_UShort  AnchorPoint;             /* index to glyph contour point */
00170   };
00171 
00172   typedef struct TTO_AnchorFormat2_  TTO_AnchorFormat2;
00173 
00174 
00175   struct  TTO_AnchorFormat3_
00176   {
00177     FT_Short    XCoordinate;            /* horizontal value              */
00178     FT_Short    YCoordinate;            /* vertical value                */
00179     TTO_Device  XDeviceTable;           /* device table for X coordinate */
00180     TTO_Device  YDeviceTable;           /* device table for Y coordinate */
00181   };
00182 
00183   typedef struct TTO_AnchorFormat3_  TTO_AnchorFormat3;
00184 
00185 
00186   struct  TTO_AnchorFormat4_
00187   {
00188     FT_UShort  XIdAnchor;               /* horizontal metric ID */
00189     FT_UShort  YIdAnchor;               /* vertical metric ID   */
00190   };
00191 
00192   typedef struct TTO_AnchorFormat4_  TTO_AnchorFormat4;
00193 
00194 
00195   struct  TTO_Anchor_
00196   {
00197     FT_UShort  PosFormat;               /* 1, 2, 3, or 4 -- 0 indicates
00198                                            that there is no Anchor table */
00199 
00200     union
00201     {
00202       TTO_AnchorFormat1  af1;
00203       TTO_AnchorFormat2  af2;
00204       TTO_AnchorFormat3  af3;
00205       TTO_AnchorFormat4  af4;
00206     } af;
00207   };
00208 
00209   typedef struct TTO_Anchor_  TTO_Anchor;
00210 
00211 
00212   struct  TTO_MarkRecord_
00213   {
00214     FT_UShort   Class;                  /* mark class   */
00215     TTO_Anchor  MarkAnchor;             /* anchor table */
00216   };
00217 
00218   typedef struct TTO_MarkRecord_  TTO_MarkRecord;
00219 
00220 
00221   struct  TTO_MarkArray_
00222   {
00223     FT_UShort        MarkCount;         /* number of MarkRecord tables */
00224     TTO_MarkRecord*  MarkRecord;        /* array of MarkRecord tables  */
00225   };
00226 
00227   typedef struct TTO_MarkArray_  TTO_MarkArray;
00228 
00229 
00230   /* LookupType 1 */
00231 
00232   struct  TTO_SinglePosFormat1_
00233   {
00234     TTO_ValueRecord  Value;             /* ValueRecord for all covered
00235                                            glyphs                      */
00236   };
00237 
00238   typedef struct TTO_SinglePosFormat1_  TTO_SinglePosFormat1;
00239 
00240 
00241   struct  TTO_SinglePosFormat2_
00242   {
00243     FT_UShort         ValueCount;       /* number of ValueRecord tables */
00244     TTO_ValueRecord*  Value;            /* array of ValueRecord tables  */
00245   };
00246 
00247   typedef struct TTO_SinglePosFormat2_  TTO_SinglePosFormat2;
00248 
00249 
00250   struct  TTO_SinglePos_
00251   {
00252     FT_UShort     PosFormat;            /* 1 or 2         */
00253     TTO_Coverage  Coverage;             /* Coverage table */
00254 
00255     FT_UShort     ValueFormat;          /* format of ValueRecord table */
00256 
00257     union
00258     {
00259       TTO_SinglePosFormat1  spf1;
00260       TTO_SinglePosFormat2  spf2;
00261     } spf;
00262   };
00263 
00264   typedef struct TTO_SinglePos_  TTO_SinglePos;
00265 
00266 
00267   /* LookupType 2 */
00268 
00269   struct  TTO_PairValueRecord_
00270   {
00271     FT_UShort        SecondGlyph;       /* glyph ID for second glyph  */
00272     TTO_ValueRecord  Value1;            /* pos. data for first glyph  */
00273     TTO_ValueRecord  Value2;            /* pos. data for second glyph */
00274   };
00275 
00276   typedef struct TTO_PairValueRecord_  TTO_PairValueRecord;
00277 
00278 
00279   struct  TTO_PairSet_
00280   {
00281     FT_UShort             PairValueCount;
00282                                         /* number of PairValueRecord tables */
00283     TTO_PairValueRecord*  PairValueRecord;
00284                                         /* array of PairValueRecord tables  */
00285   };
00286 
00287   typedef struct TTO_PairSet_  TTO_PairSet;
00288 
00289 
00290   struct  TTO_PairPosFormat1_
00291   {
00292     FT_UShort     PairSetCount;         /* number of PairSet tables    */
00293     TTO_PairSet*  PairSet;              /* array of PairSet tables     */
00294   };
00295 
00296   typedef struct TTO_PairPosFormat1_  TTO_PairPosFormat1;
00297 
00298 
00299   struct  TTO_Class2Record_
00300   {
00301     TTO_ValueRecord  Value1;            /* pos. data for first glyph  */
00302     TTO_ValueRecord  Value2;            /* pos. data for second glyph */
00303   };
00304 
00305   typedef struct TTO_Class2Record_  TTO_Class2Record;
00306 
00307 
00308   struct  TTO_Class1Record_
00309   {
00310     TTO_Class2Record*  Class2Record;    /* array of Class2Record tables */
00311   };
00312 
00313   typedef struct TTO_Class1Record_  TTO_Class1Record;
00314 
00315 
00316   struct  TTO_PairPosFormat2_
00317   {
00318     TTO_ClassDefinition  ClassDef1;     /* class def. for first glyph     */
00319     TTO_ClassDefinition  ClassDef2;     /* class def. for second glyph    */
00320     FT_UShort            Class1Count;   /* number of classes in ClassDef1
00321                                            table                          */
00322     FT_UShort            Class2Count;   /* number of classes in ClassDef2
00323                                            table                          */
00324     TTO_Class1Record*    Class1Record;  /* array of Class1Record tables   */
00325   };
00326 
00327   typedef struct TTO_PairPosFormat2_  TTO_PairPosFormat2;
00328 
00329 
00330   struct  TTO_PairPos_
00331   {
00332     FT_UShort     PosFormat;            /* 1 or 2         */
00333     TTO_Coverage  Coverage;             /* Coverage table */
00334     FT_UShort     ValueFormat1;         /* format of ValueRecord table
00335                                            for first glyph             */
00336     FT_UShort     ValueFormat2;         /* format of ValueRecord table
00337                                            for second glyph            */
00338 
00339     union
00340     {
00341       TTO_PairPosFormat1  ppf1;
00342       TTO_PairPosFormat2  ppf2;
00343     } ppf;
00344   };
00345 
00346   typedef struct TTO_PairPos_  TTO_PairPos;
00347 
00348 
00349   /* LookupType 3 */
00350 
00351   struct  TTO_EntryExitRecord_
00352   {
00353     TTO_Anchor  EntryAnchor;            /* entry Anchor table */
00354     TTO_Anchor  ExitAnchor;             /* exit Anchor table  */
00355   };
00356 
00357 
00358   typedef struct TTO_EntryExitRecord_  TTO_EntryExitRecord;
00359 
00360   struct  TTO_CursivePos_
00361   {
00362     FT_UShort             PosFormat;    /* always 1                         */
00363     TTO_Coverage          Coverage;     /* Coverage table                   */
00364     FT_UShort             EntryExitCount;
00365                                         /* number of EntryExitRecord tables */
00366     TTO_EntryExitRecord*  EntryExitRecord;
00367                                         /* array of EntryExitRecord tables  */
00368   };
00369 
00370   typedef struct TTO_CursivePos_  TTO_CursivePos;
00371 
00372 
00373   /* LookupType 4 */
00374 
00375   struct  TTO_BaseRecord_
00376   {
00377     TTO_Anchor*  BaseAnchor;            /* array of base glyph anchor
00378                                            tables                     */
00379   };
00380 
00381   typedef struct TTO_BaseRecord_  TTO_BaseRecord;
00382 
00383 
00384   struct  TTO_BaseArray_
00385   {
00386     FT_UShort        BaseCount;         /* number of BaseRecord tables */
00387     TTO_BaseRecord*  BaseRecord;        /* array of BaseRecord tables  */
00388   };
00389 
00390   typedef struct TTO_BaseArray_  TTO_BaseArray;
00391 
00392 
00393   struct  TTO_MarkBasePos_
00394   {
00395     FT_UShort      PosFormat;           /* always 1                  */
00396     TTO_Coverage   MarkCoverage;        /* mark glyph coverage table */
00397     TTO_Coverage   BaseCoverage;        /* base glyph coverage table */
00398     FT_UShort      ClassCount;          /* number of mark classes    */
00399     TTO_MarkArray  MarkArray;           /* mark array table          */
00400     TTO_BaseArray  BaseArray;           /* base array table          */
00401   };
00402 
00403   typedef struct TTO_MarkBasePos_  TTO_MarkBasePos;
00404 
00405 
00406   /* LookupType 5 */
00407 
00408   struct  TTO_ComponentRecord_
00409   {
00410     TTO_Anchor*  LigatureAnchor;        /* array of ligature glyph anchor
00411                                            tables                         */
00412   };
00413 
00414   typedef struct TTO_ComponentRecord_  TTO_ComponentRecord;
00415 
00416 
00417   struct  TTO_LigatureAttach_
00418   {
00419     FT_UShort             ComponentCount;
00420                                         /* number of ComponentRecord tables */
00421     TTO_ComponentRecord*  ComponentRecord;
00422                                         /* array of ComponentRecord tables  */
00423   };
00424 
00425   typedef struct TTO_LigatureAttach_  TTO_LigatureAttach;
00426 
00427 
00428   struct  TTO_LigatureArray_
00429   {
00430     FT_UShort            LigatureCount; /* number of LigatureAttach tables */
00431     TTO_LigatureAttach*  LigatureAttach;
00432                                         /* array of LigatureAttach tables  */
00433   };
00434 
00435   typedef struct TTO_LigatureArray_  TTO_LigatureArray;
00436 
00437 
00438   struct  TTO_MarkLigPos_
00439   {
00440     FT_UShort          PosFormat;       /* always 1                      */
00441     TTO_Coverage       MarkCoverage;    /* mark glyph coverage table     */
00442     TTO_Coverage       LigatureCoverage;
00443                                         /* ligature glyph coverage table */
00444     FT_UShort          ClassCount;      /* number of mark classes        */
00445     TTO_MarkArray      MarkArray;       /* mark array table              */
00446     TTO_LigatureArray  LigatureArray;   /* ligature array table          */
00447   };
00448 
00449   typedef struct TTO_MarkLigPos_  TTO_MarkLigPos;
00450 
00451 
00452   /* LookupType 6 */
00453 
00454   struct  TTO_Mark2Record_
00455   {
00456     TTO_Anchor*  Mark2Anchor;           /* array of mark glyph anchor
00457                                            tables                     */
00458   };
00459 
00460   typedef struct TTO_Mark2Record_  TTO_Mark2Record;
00461 
00462 
00463   struct  TTO_Mark2Array_
00464   {
00465     FT_UShort         Mark2Count;       /* number of Mark2Record tables */
00466     TTO_Mark2Record*  Mark2Record;      /* array of Mark2Record tables  */
00467   };
00468 
00469   typedef struct TTO_Mark2Array_  TTO_Mark2Array;
00470 
00471 
00472   struct  TTO_MarkMarkPos_
00473   {
00474     FT_UShort       PosFormat;          /* always 1                         */
00475     TTO_Coverage    Mark1Coverage;      /* first mark glyph coverage table  */
00476     TTO_Coverage    Mark2Coverage;      /* second mark glyph coverave table */
00477     FT_UShort       ClassCount;         /* number of combining mark classes */
00478     TTO_MarkArray   Mark1Array;         /* MarkArray table for first mark   */
00479     TTO_Mark2Array  Mark2Array;         /* MarkArray table for second mark  */
00480   };
00481 
00482   typedef struct TTO_MarkMarkPos_  TTO_MarkMarkPos;
00483 
00484 
00485   /* needed by both lookup type 7 and 8 */
00486 
00487   struct  TTO_PosLookupRecord_
00488   {
00489     FT_UShort  SequenceIndex;           /* index into current
00490                                            glyph sequence               */
00491     FT_UShort  LookupListIndex;         /* Lookup to apply to that pos. */
00492   };
00493 
00494   typedef struct TTO_PosLookupRecord_  TTO_PosLookupRecord;
00495 
00496 
00497   /* LookupType 7 */
00498 
00499   struct  TTO_PosRule_
00500   {
00501     FT_UShort             GlyphCount;   /* total number of input glyphs     */
00502     FT_UShort             PosCount;     /* number of PosLookupRecord tables */
00503     FT_UShort*            Input;        /* array of input glyph IDs         */
00504     TTO_PosLookupRecord*  PosLookupRecord;
00505                                         /* array of PosLookupRecord tables  */
00506   };
00507 
00508   typedef struct TTO_PosRule_  TTO_PosRule;
00509 
00510 
00511   struct  TTO_PosRuleSet_
00512   {
00513     FT_UShort     PosRuleCount;         /* number of PosRule tables */
00514     TTO_PosRule*  PosRule;              /* array of PosRule tables  */
00515   };
00516 
00517   typedef struct TTO_PosRuleSet_  TTO_PosRuleSet;
00518 
00519 
00520   struct  TTO_ContextPosFormat1_
00521   {
00522     TTO_Coverage     Coverage;          /* Coverage table              */
00523     FT_UShort        PosRuleSetCount;   /* number of PosRuleSet tables */
00524     TTO_PosRuleSet*  PosRuleSet;        /* array of PosRuleSet tables  */
00525   };
00526 
00527   typedef struct TTO_ContextPosFormat1_  TTO_ContextPosFormat1;
00528 
00529 
00530   struct  TTO_PosClassRule_
00531   {
00532     FT_UShort             GlyphCount;   /* total number of context classes  */
00533     FT_UShort             PosCount;     /* number of PosLookupRecord tables */
00534     FT_UShort*            Class;        /* array of classes                 */
00535     TTO_PosLookupRecord*  PosLookupRecord;
00536                                         /* array of PosLookupRecord tables  */
00537   };
00538 
00539   typedef struct TTO_PosClassRule_  TTO_PosClassRule;
00540 
00541 
00542   struct  TTO_PosClassSet_
00543   {
00544     FT_UShort          PosClassRuleCount;
00545                                         /* number of PosClassRule tables */
00546     TTO_PosClassRule*  PosClassRule;    /* array of PosClassRule tables  */
00547   };
00548 
00549   typedef struct TTO_PosClassSet_  TTO_PosClassSet;
00550 
00551 
00552   /* The `MaxContextLength' field is not defined in the TTO specification
00553      but simplifies the implementation of this format.  It holds the
00554      maximal context length used in the context rules.                    */
00555 
00556   struct  TTO_ContextPosFormat2_
00557   {
00558     FT_UShort            MaxContextLength;
00559                                         /* maximal context length       */
00560     TTO_Coverage         Coverage;      /* Coverage table               */
00561     TTO_ClassDefinition  ClassDef;      /* ClassDef table               */
00562     FT_UShort            PosClassSetCount;
00563                                         /* number of PosClassSet tables */
00564     TTO_PosClassSet*     PosClassSet;   /* array of PosClassSet tables  */
00565   };
00566 
00567   typedef struct TTO_ContextPosFormat2_  TTO_ContextPosFormat2;
00568 
00569 
00570   struct  TTO_ContextPosFormat3_
00571   {
00572     FT_UShort             GlyphCount;   /* number of input glyphs           */
00573     FT_UShort             PosCount;     /* number of PosLookupRecord tables */
00574     TTO_Coverage*         Coverage;     /* array of Coverage tables         */
00575     TTO_PosLookupRecord*  PosLookupRecord;
00576                                         /* array of PosLookupRecord tables  */
00577   };
00578 
00579   typedef struct TTO_ContextPosFormat3_  TTO_ContextPosFormat3;
00580 
00581 
00582   struct  TTO_ContextPos_
00583   {
00584     FT_UShort  PosFormat;               /* 1, 2, or 3     */
00585 
00586     union
00587     {
00588       TTO_ContextPosFormat1  cpf1;
00589       TTO_ContextPosFormat2  cpf2;
00590       TTO_ContextPosFormat3  cpf3;
00591     } cpf;
00592   };
00593 
00594   typedef struct TTO_ContextPos_  TTO_ContextPos;
00595 
00596 
00597   /* LookupType 8 */
00598 
00599   struct  TTO_ChainPosRule_
00600   {
00601     FT_UShort             BacktrackGlyphCount;
00602                                         /* total number of backtrack glyphs */
00603     FT_UShort*            Backtrack;    /* array of backtrack glyph IDs     */
00604     FT_UShort             InputGlyphCount;
00605                                         /* total number of input glyphs     */
00606     FT_UShort*            Input;        /* array of input glyph IDs         */
00607     FT_UShort             LookaheadGlyphCount;
00608                                         /* total number of lookahead glyphs */
00609     FT_UShort*            Lookahead;    /* array of lookahead glyph IDs     */
00610     FT_UShort             PosCount;     /* number of PosLookupRecords       */
00611     TTO_PosLookupRecord*  PosLookupRecord;
00612                                         /* array of PosLookupRecords       */
00613   };
00614 
00615   typedef struct TTO_ChainPosRule_  TTO_ChainPosRule;
00616 
00617 
00618   struct  TTO_ChainPosRuleSet_
00619   {
00620     FT_UShort          ChainPosRuleCount;
00621                                         /* number of ChainPosRule tables */
00622     TTO_ChainPosRule*  ChainPosRule;    /* array of ChainPosRule tables  */
00623   };
00624 
00625   typedef struct TTO_ChainPosRuleSet_  TTO_ChainPosRuleSet;
00626 
00627 
00628   struct  TTO_ChainContextPosFormat1_
00629   {
00630     TTO_Coverage          Coverage;     /* Coverage table                   */
00631     FT_UShort             ChainPosRuleSetCount;
00632                                         /* number of ChainPosRuleSet tables */
00633     TTO_ChainPosRuleSet*  ChainPosRuleSet;
00634                                         /* array of ChainPosRuleSet tables  */
00635   };
00636 
00637   typedef struct TTO_ChainContextPosFormat1_  TTO_ChainContextPosFormat1;
00638 
00639 
00640   struct  TTO_ChainPosClassRule_
00641   {
00642     FT_UShort             BacktrackGlyphCount;
00643                                         /* total number of backtrack
00644                                            classes                         */
00645     FT_UShort*            Backtrack;    /* array of backtrack classes      */
00646     FT_UShort             InputGlyphCount;
00647                                         /* total number of context classes */
00648     FT_UShort*            Input;        /* array of context classes        */
00649     FT_UShort             LookaheadGlyphCount;
00650                                         /* total number of lookahead
00651                                            classes                         */
00652     FT_UShort*            Lookahead;    /* array of lookahead classes      */
00653     FT_UShort             PosCount;     /* number of PosLookupRecords      */
00654     TTO_PosLookupRecord*  PosLookupRecord;
00655                                         /* array of substitution lookups   */
00656   };
00657 
00658   typedef struct TTO_ChainPosClassRule_  TTO_ChainPosClassRule;
00659 
00660 
00661   struct  TTO_ChainPosClassSet_
00662   {
00663     FT_UShort               ChainPosClassRuleCount;
00664                                         /* number of ChainPosClassRule
00665                                            tables                      */
00666     TTO_ChainPosClassRule*  ChainPosClassRule;
00667                                         /* array of ChainPosClassRule
00668                                            tables                      */
00669   };
00670 
00671   typedef struct TTO_ChainPosClassSet_  TTO_ChainPosClassSet;
00672 
00673 
00674   /* The `MaxXXXLength' fields are not defined in the TTO specification
00675      but simplifies the implementation of this format.  It holds the
00676      maximal context length used in the specific context rules.         */
00677 
00678   struct  TTO_ChainContextPosFormat2_
00679   {
00680     TTO_Coverage           Coverage;    /* Coverage table             */
00681 
00682     FT_UShort              MaxBacktrackLength;
00683                                         /* maximal backtrack length   */
00684     TTO_ClassDefinition    BacktrackClassDef;
00685                                         /* BacktrackClassDef table    */
00686     FT_UShort              MaxInputLength;
00687                                         /* maximal input length       */
00688     TTO_ClassDefinition    InputClassDef;
00689                                         /* InputClassDef table        */
00690     FT_UShort              MaxLookaheadLength;
00691                                         /* maximal lookahead length   */
00692     TTO_ClassDefinition    LookaheadClassDef;
00693                                         /* LookaheadClassDef table    */
00694 
00695     FT_UShort              ChainPosClassSetCount;
00696                                         /* number of ChainPosClassSet
00697                                            tables                     */
00698     TTO_ChainPosClassSet*  ChainPosClassSet;
00699                                         /* array of ChainPosClassSet
00700                                            tables                     */
00701   };
00702 
00703   typedef struct TTO_ChainContextPosFormat2_  TTO_ChainContextPosFormat2;
00704 
00705 
00706   struct  TTO_ChainContextPosFormat3_
00707   {
00708     FT_UShort             BacktrackGlyphCount;
00709                                         /* number of backtrack glyphs    */
00710     TTO_Coverage*         BacktrackCoverage;
00711                                         /* array of backtrack Coverage
00712                                            tables                        */
00713     FT_UShort             InputGlyphCount;
00714                                         /* number of input glyphs        */
00715     TTO_Coverage*         InputCoverage;
00716                                         /* array of input coverage
00717                                            tables                        */
00718     FT_UShort             LookaheadGlyphCount;
00719                                         /* number of lookahead glyphs    */
00720     TTO_Coverage*         LookaheadCoverage;
00721                                         /* array of lookahead coverage
00722                                            tables                        */
00723     FT_UShort             PosCount;     /* number of PosLookupRecords    */
00724     TTO_PosLookupRecord*  PosLookupRecord;
00725                                         /* array of substitution lookups */
00726   };
00727 
00728   typedef struct TTO_ChainContextPosFormat3_  TTO_ChainContextPosFormat3;
00729 
00730 
00731   struct  TTO_ChainContextPos_
00732   {
00733     FT_UShort  PosFormat;             /* 1, 2, or 3 */
00734 
00735     union
00736     {
00737       TTO_ChainContextPosFormat1  ccpf1;
00738       TTO_ChainContextPosFormat2  ccpf2;
00739       TTO_ChainContextPosFormat3  ccpf3;
00740     } ccpf;
00741   };
00742 
00743   typedef struct TTO_ChainContextPos_  TTO_ChainContextPos;
00744 
00745 
00746   union  TTO_GPOS_SubTable_
00747   {
00748     TTO_SinglePos        single;
00749     TTO_PairPos          pair;
00750     TTO_CursivePos       cursive;
00751     TTO_MarkBasePos      markbase;
00752     TTO_MarkLigPos       marklig;
00753     TTO_MarkMarkPos      markmark;
00754     TTO_ContextPos       context;
00755     TTO_ChainContextPos  chain;
00756   };
00757 
00758   typedef union TTO_GPOS_SubTable_  TTO_GPOS_SubTable;
00759 
00760 
00761   /* finally, the GPOS API */
00762 
00763   /*  EXPORT_DEF
00764       FT_Export ( FT_Error )  TT_Init_GPOS_Extension( TT_Engine  engine ); */
00765 
00766   EXPORT_DEF
00767   FT_Error  TT_Load_GPOS_Table( FT_Face          face,
00768                                 TTO_GPOSHeader** gpos,
00769                                 TTO_GDEFHeader*  gdef );
00770 
00771   EXPORT_DEF
00772   FT_Error  TT_Done_GPOS_Table( TTO_GPOSHeader* gpos );
00773 
00774   EXPORT_DEF
00775   FT_Error  TT_GPOS_Select_Script( TTO_GPOSHeader*  gpos,
00776                                    FT_ULong         script_tag,
00777                                    FT_UShort*       script_index );
00778   EXPORT_DEF
00779   FT_Error  TT_GPOS_Select_Language( TTO_GPOSHeader*  gpos,
00780                                      FT_ULong         language_tag,
00781                                      FT_UShort        script_index,
00782                                      FT_UShort*       language_index,
00783                                      FT_UShort*       req_feature_index );
00784   EXPORT_DEF
00785   FT_Error  TT_GPOS_Select_Feature( TTO_GPOSHeader*  gpos,
00786                                     FT_ULong         feature_tag,
00787                                     FT_UShort        script_index,
00788                                     FT_UShort        language_index,
00789                                     FT_UShort*       feature_index );
00790 
00791   EXPORT_DEF
00792   FT_Error  TT_GPOS_Query_Scripts( TTO_GPOSHeader*  gpos,
00793                                    FT_ULong**       script_tag_list );
00794   EXPORT_DEF
00795   FT_Error  TT_GPOS_Query_Languages( TTO_GPOSHeader*  gpos,
00796                                      FT_UShort        script_index,
00797                                      FT_ULong**       language_tag_list );
00798   EXPORT_DEF
00799   FT_Error  TT_GPOS_Query_Features( TTO_GPOSHeader*  gpos,
00800                                     FT_UShort        script_index,
00801                                     FT_UShort        language_index,
00802                                     FT_ULong**       feature_tag_list );
00803 
00804   EXPORT_DEF
00805   FT_Error  TT_GPOS_Add_Feature( TTO_GPOSHeader*  gpos,
00806                                  FT_UShort        feature_index,
00807                                  FT_UInt          property );
00808   EXPORT_DEF
00809   FT_Error  TT_GPOS_Clear_Features( TTO_GPOSHeader*  gpos );
00810 
00811   EXPORT_DEF
00812   FT_Error  TT_GPOS_Register_Glyph_Function( TTO_GPOSHeader*    gpos,
00813                                              TTO_GlyphFunction  gfunc );
00814 
00815   EXPORT_DEF
00816   FT_Error  TT_GPOS_Register_MM_Function( TTO_GPOSHeader*  gpos,
00817                                           TTO_MMFunction   mmfunc,
00818                                           void*            data );
00819 
00820   /* If `dvi' is TRUE, glyph contour points for anchor points and device
00821      tables are ignored -- you will get device independent values.         */
00822 
00823   EXPORT_DEF
00824   FT_Error  TT_GPOS_Apply_String( FT_Face           face,
00825                                   TTO_GPOSHeader*   gpos,
00826                                   FT_UShort         load_flags,
00827                                   OTL_Buffer        buffer,
00828                                   FT_Bool           dvi,
00829                                   FT_Bool           r2l );
00830 
00831 #ifdef __cplusplus
00832 }
00833 #endif
00834 
00835 #endif /* FTXGPOS_H */
00836 
00837 
00838 /* END */
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'