File: ttgsubtable.h

package info (click to toggle)
renpy 8.3.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 86,772 kB
  • sloc: python: 55,363; ansic: 13,858; javascript: 849; makefile: 87; sh: 13
file content (146 lines) | stat: -rw-r--r-- 3,547 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#ifndef TTGSUBTable_H
#define TTGSUBTable_H

#include <stdint.h>
#include <ft2build.h>
#include FT_OPENTYPE_VALIDATE_H

typedef struct
{
    uint32_t Version;
    uint16_t ScriptList;
    uint16_t FeatureList;
    uint16_t LookupList;
} tt_gsub_header;

typedef struct
{
    uint16_t LookupOrder;
    uint16_t ReqFeatureIndex;
    uint16_t FeatureCount;
    uint16_t *FeatureIndex;
} TLangSys;

typedef struct
{
    uint32_t LangSysTag;
    TLangSys LangSys;
} TLangSysRecord;

typedef struct
{
    uint16_t DefaultLangSys;
    uint16_t LangSysCount;
    TLangSysRecord *LangSysRecord;
} TScript;

typedef struct
{
    uint32_t ScriptTag;
    TScript Script;
} TScriptRecord;

typedef struct
{
    uint16_t ScriptCount;
    TScriptRecord *ScriptRecord;
} TScriptList;

typedef struct
{
    uint16_t FeatureParams;
    int LookupCount;
    uint16_t *LookupListIndex;
} TFeature;

typedef struct
{
    uint32_t FeatureTag;
    TFeature Feature;
} TFeatureRecord;

typedef struct
{
    int FeatureCount;
    TFeatureRecord *FeatureRecord;
} TFeatureList;

typedef struct
{
    uint16_t Start;
    uint16_t End;
    uint16_t StartCoverageIndex;
} TRangeRecord;

typedef struct
{
    uint16_t CoverageFormat;
    uint16_t GlyphCount;
    uint16_t *GlyphArray;
    uint16_t RangeCount;
    TRangeRecord *RangeRecord;
} TCoverageFormat;

typedef struct
{
    uint16_t SubstFormat;
    TCoverageFormat Coverage;
    int16_t DeltaGlyphID;
    uint16_t GlyphCount;
    uint16_t *Substitute;
} TSingleSubstFormat;

typedef struct
{
    uint16_t LookupType;
    uint16_t LookupFlag;
    uint16_t SubTableCount;
    TSingleSubstFormat *SubTable;
} TLookup;

typedef struct
{
    int LookupCount;
    TLookup *Lookup;
} TLookupList;

typedef struct
{
    int loaded;
    tt_gsub_header header;
    TScriptList ScriptList;
    TFeatureList FeatureList;
    TLookupList LookupList;
} TTGSUBTable;

void LoadGSUBTable(TTGSUBTable *table, FT_Face face);
int LoadGSUBTable2(TTGSUBTable *table, FT_Bytes gsub);
int GetVerticalGlyph(TTGSUBTable *table, uint32_t glyphnum, uint32_t *vglyphnum);

int Parse(TTGSUBTable *table, FT_Bytes scriptlist, FT_Bytes featurelist, FT_Bytes lookuplist);
void ParseScriptList(TTGSUBTable *table, FT_Bytes raw, TScriptList *rec);
void ParseScript(TTGSUBTable *table, FT_Bytes raw, TScript *rec);
void ParseLangSys(TTGSUBTable *table, FT_Bytes raw, TLangSys *rec);

void ParseFeatureList(TTGSUBTable *table, FT_Bytes raw, TFeatureList *rec);
void ParseFeature(TTGSUBTable *table, FT_Bytes raw, TFeature *rec);

void ParseLookupList(TTGSUBTable *table, FT_Bytes raw, TLookupList *rec);
void ParseLookup(TTGSUBTable *table, FT_Bytes raw, TLookup *rec);

void ParseCoverage(TTGSUBTable *table, FT_Bytes raw, TCoverageFormat *rec);
void ParseCoverageFormat1(TTGSUBTable *table, FT_Bytes raw, TCoverageFormat *rec);
void ParseCoverageFormat2(TTGSUBTable *table, FT_Bytes raw, TCoverageFormat *rec);

void ParseSingleSubst(TTGSUBTable *table, FT_Bytes raw, TSingleSubstFormat *rec);
void ParseSingleSubstFormat1(TTGSUBTable *table, FT_Bytes raw, TSingleSubstFormat *rec);
void ParseSingleSubstFormat2(TTGSUBTable *table, FT_Bytes raw, TSingleSubstFormat *rec);

int GetVerticalGlyphSub(TTGSUBTable *table, uint32_t glyphnum, uint32_t *vglyphnum, TFeature *Feature);
int GetVerticalGlyphSub2(TTGSUBTable *table, uint32_t glyphnum, uint32_t *vglyphnum, TLookup *Lookup);

int GetCoverageIndex(TTGSUBTable *table, TCoverageFormat *Coverage, uint32_t g);

void init_gsubtable(TTGSUBTable *table);
void free_gsubtable(TTGSUBTable *table);
#endif