jassub 1.7.13 → 1.7.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/package.json +4 -2
  2. package/dist/js/jassub-worker-modern.js +0 -128
  3. package/dist/js/jassub-worker-modern.wasm +0 -0
  4. package/dist/js/jassub-worker.js +0 -128
  5. package/dist/js/jassub-worker.wasm +0 -0
  6. package/dist/js/jassub-worker.wasm.js +0 -84
  7. package/dist/js/jassub.js +0 -832
  8. package/dist/libraries/bin/brotli.js +0 -1
  9. package/dist/libraries/include/ass/ass.h +0 -812
  10. package/dist/libraries/include/ass/ass_types.h +0 -292
  11. package/dist/libraries/include/brotli/decode.h +0 -344
  12. package/dist/libraries/include/brotli/encode.h +0 -448
  13. package/dist/libraries/include/brotli/port.h +0 -288
  14. package/dist/libraries/include/brotli/types.h +0 -83
  15. package/dist/libraries/include/expat.h +0 -1064
  16. package/dist/libraries/include/expat_config.h +0 -115
  17. package/dist/libraries/include/expat_external.h +0 -165
  18. package/dist/libraries/include/fontconfig/fcfreetype.h +0 -59
  19. package/dist/libraries/include/fontconfig/fcprivate.h +0 -134
  20. package/dist/libraries/include/fontconfig/fontconfig.h +0 -1154
  21. package/dist/libraries/include/freetype2/freetype/config/ftconfig.h +0 -63
  22. package/dist/libraries/include/freetype2/freetype/config/ftheader.h +0 -824
  23. package/dist/libraries/include/freetype2/freetype/config/ftmodule.h +0 -20
  24. package/dist/libraries/include/freetype2/freetype/config/ftoption.h +0 -1011
  25. package/dist/libraries/include/freetype2/freetype/config/ftstdlib.h +0 -175
  26. package/dist/libraries/include/freetype2/freetype/config/integer-types.h +0 -245
  27. package/dist/libraries/include/freetype2/freetype/config/mac-support.h +0 -49
  28. package/dist/libraries/include/freetype2/freetype/config/public-macros.h +0 -120
  29. package/dist/libraries/include/freetype2/freetype/freetype.h +0 -4833
  30. package/dist/libraries/include/freetype2/freetype/ftadvanc.h +0 -188
  31. package/dist/libraries/include/freetype2/freetype/ftbbox.h +0 -101
  32. package/dist/libraries/include/freetype2/freetype/ftbdf.h +0 -212
  33. package/dist/libraries/include/freetype2/freetype/ftbitmap.h +0 -329
  34. package/dist/libraries/include/freetype2/freetype/ftbzip2.h +0 -102
  35. package/dist/libraries/include/freetype2/freetype/ftcache.h +0 -1087
  36. package/dist/libraries/include/freetype2/freetype/ftchapters.h +0 -147
  37. package/dist/libraries/include/freetype2/freetype/ftcid.h +0 -167
  38. package/dist/libraries/include/freetype2/freetype/ftcolor.h +0 -1609
  39. package/dist/libraries/include/freetype2/freetype/ftdriver.h +0 -1193
  40. package/dist/libraries/include/freetype2/freetype/fterrdef.h +0 -279
  41. package/dist/libraries/include/freetype2/freetype/fterrors.h +0 -296
  42. package/dist/libraries/include/freetype2/freetype/ftfntfmt.h +0 -93
  43. package/dist/libraries/include/freetype2/freetype/ftgasp.h +0 -143
  44. package/dist/libraries/include/freetype2/freetype/ftglyph.h +0 -664
  45. package/dist/libraries/include/freetype2/freetype/ftgxval.h +0 -354
  46. package/dist/libraries/include/freetype2/freetype/ftgzip.h +0 -151
  47. package/dist/libraries/include/freetype2/freetype/ftimage.h +0 -1276
  48. package/dist/libraries/include/freetype2/freetype/ftincrem.h +0 -348
  49. package/dist/libraries/include/freetype2/freetype/ftlcdfil.h +0 -323
  50. package/dist/libraries/include/freetype2/freetype/ftlist.h +0 -296
  51. package/dist/libraries/include/freetype2/freetype/ftlogging.h +0 -184
  52. package/dist/libraries/include/freetype2/freetype/ftlzw.h +0 -100
  53. package/dist/libraries/include/freetype2/freetype/ftmac.h +0 -289
  54. package/dist/libraries/include/freetype2/freetype/ftmm.h +0 -752
  55. package/dist/libraries/include/freetype2/freetype/ftmodapi.h +0 -806
  56. package/dist/libraries/include/freetype2/freetype/ftmoderr.h +0 -204
  57. package/dist/libraries/include/freetype2/freetype/ftotval.h +0 -206
  58. package/dist/libraries/include/freetype2/freetype/ftoutln.h +0 -586
  59. package/dist/libraries/include/freetype2/freetype/ftparams.h +0 -203
  60. package/dist/libraries/include/freetype2/freetype/ftpfr.h +0 -179
  61. package/dist/libraries/include/freetype2/freetype/ftrender.h +0 -244
  62. package/dist/libraries/include/freetype2/freetype/ftsizes.h +0 -159
  63. package/dist/libraries/include/freetype2/freetype/ftsnames.h +0 -272
  64. package/dist/libraries/include/freetype2/freetype/ftstroke.h +0 -773
  65. package/dist/libraries/include/freetype2/freetype/ftsynth.h +0 -83
  66. package/dist/libraries/include/freetype2/freetype/ftsystem.h +0 -352
  67. package/dist/libraries/include/freetype2/freetype/fttrigon.h +0 -350
  68. package/dist/libraries/include/freetype2/freetype/fttypes.h +0 -615
  69. package/dist/libraries/include/freetype2/freetype/ftwinfnt.h +0 -276
  70. package/dist/libraries/include/freetype2/freetype/t1tables.h +0 -773
  71. package/dist/libraries/include/freetype2/freetype/ttnameid.h +0 -1235
  72. package/dist/libraries/include/freetype2/freetype/tttables.h +0 -855
  73. package/dist/libraries/include/freetype2/freetype/tttags.h +0 -123
  74. package/dist/libraries/include/freetype2/ft2build.h +0 -42
  75. package/dist/libraries/include/fribidi/fribidi-arabic.h +0 -81
  76. package/dist/libraries/include/fribidi/fribidi-begindecls.h +0 -3
  77. package/dist/libraries/include/fribidi/fribidi-bidi-types-list.h +0 -96
  78. package/dist/libraries/include/fribidi/fribidi-bidi-types.h +0 -405
  79. package/dist/libraries/include/fribidi/fribidi-bidi.h +0 -142
  80. package/dist/libraries/include/fribidi/fribidi-brackets.h +0 -89
  81. package/dist/libraries/include/fribidi/fribidi-char-sets-list.h +0 -54
  82. package/dist/libraries/include/fribidi/fribidi-char-sets.h +0 -106
  83. package/dist/libraries/include/fribidi/fribidi-common.h +0 -158
  84. package/dist/libraries/include/fribidi/fribidi-config.h +0 -23
  85. package/dist/libraries/include/fribidi/fribidi-deprecated.h +0 -175
  86. package/dist/libraries/include/fribidi/fribidi-enddecls.h +0 -3
  87. package/dist/libraries/include/fribidi/fribidi-flags.h +0 -72
  88. package/dist/libraries/include/fribidi/fribidi-joining-types-list.h +0 -44
  89. package/dist/libraries/include/fribidi/fribidi-joining-types.h +0 -249
  90. package/dist/libraries/include/fribidi/fribidi-joining.h +0 -74
  91. package/dist/libraries/include/fribidi/fribidi-mirroring.h +0 -86
  92. package/dist/libraries/include/fribidi/fribidi-shape.h +0 -71
  93. package/dist/libraries/include/fribidi/fribidi-types.h +0 -79
  94. package/dist/libraries/include/fribidi/fribidi-unicode-version.h +0 -10
  95. package/dist/libraries/include/fribidi/fribidi-unicode.h +0 -105
  96. package/dist/libraries/include/fribidi/fribidi.h +0 -129
  97. package/dist/libraries/include/harfbuzz/hb-aat-layout.h +0 -795
  98. package/dist/libraries/include/harfbuzz/hb-aat.h +0 -38
  99. package/dist/libraries/include/harfbuzz/hb-blob.h +0 -160
  100. package/dist/libraries/include/harfbuzz/hb-buffer.h +0 -799
  101. package/dist/libraries/include/harfbuzz/hb-common.h +0 -902
  102. package/dist/libraries/include/harfbuzz/hb-cplusplus.hh +0 -221
  103. package/dist/libraries/include/harfbuzz/hb-deprecated.h +0 -251
  104. package/dist/libraries/include/harfbuzz/hb-draw.h +0 -325
  105. package/dist/libraries/include/harfbuzz/hb-face.h +0 -181
  106. package/dist/libraries/include/harfbuzz/hb-font.h +0 -1108
  107. package/dist/libraries/include/harfbuzz/hb-ft.h +0 -145
  108. package/dist/libraries/include/harfbuzz/hb-map.h +0 -124
  109. package/dist/libraries/include/harfbuzz/hb-ot-color.h +0 -146
  110. package/dist/libraries/include/harfbuzz/hb-ot-deprecated.h +0 -141
  111. package/dist/libraries/include/harfbuzz/hb-ot-font.h +0 -45
  112. package/dist/libraries/include/harfbuzz/hb-ot-layout.h +0 -503
  113. package/dist/libraries/include/harfbuzz/hb-ot-math.h +0 -333
  114. package/dist/libraries/include/harfbuzz/hb-ot-meta.h +0 -72
  115. package/dist/libraries/include/harfbuzz/hb-ot-metrics.h +0 -129
  116. package/dist/libraries/include/harfbuzz/hb-ot-name.h +0 -158
  117. package/dist/libraries/include/harfbuzz/hb-ot-shape.h +0 -53
  118. package/dist/libraries/include/harfbuzz/hb-ot-var.h +0 -191
  119. package/dist/libraries/include/harfbuzz/hb-ot.h +0 -49
  120. package/dist/libraries/include/harfbuzz/hb-set.h +0 -200
  121. package/dist/libraries/include/harfbuzz/hb-shape-plan.h +0 -122
  122. package/dist/libraries/include/harfbuzz/hb-shape.h +0 -62
  123. package/dist/libraries/include/harfbuzz/hb-style.h +0 -81
  124. package/dist/libraries/include/harfbuzz/hb-subset-repacker.h +0 -81
  125. package/dist/libraries/include/harfbuzz/hb-subset.h +0 -234
  126. package/dist/libraries/include/harfbuzz/hb-unicode.h +0 -643
  127. package/dist/libraries/include/harfbuzz/hb-version.h +0 -95
  128. package/dist/libraries/include/harfbuzz/hb.h +0 -50
  129. package/dist/libraries/lib/cmake/expat-2.4.7/expat-config-version.cmake +0 -70
  130. package/dist/libraries/lib/cmake/expat-2.4.7/expat-config.cmake +0 -99
  131. package/dist/libraries/lib/cmake/expat-2.4.7/expat-noconfig.cmake +0 -19
  132. package/dist/libraries/lib/cmake/expat-2.4.7/expat.cmake +0 -99
  133. package/dist/libraries/lib/libass.a +0 -0
  134. package/dist/libraries/lib/libass.la +0 -41
  135. package/dist/libraries/lib/libbrotlicommon.a +0 -0
  136. package/dist/libraries/lib/libbrotlidec.a +0 -0
  137. package/dist/libraries/lib/libbrotlienc.a +0 -0
  138. package/dist/libraries/lib/libexpat.a +0 -0
  139. package/dist/libraries/lib/libfontconfig.a +0 -0
  140. package/dist/libraries/lib/libfontconfig.la +0 -41
  141. package/dist/libraries/lib/libfreetype.a +0 -0
  142. package/dist/libraries/lib/libfreetype.la +0 -41
  143. package/dist/libraries/lib/libfribidi.a +0 -0
  144. package/dist/libraries/lib/libfribidi.la +0 -41
  145. package/dist/libraries/lib/libharfbuzz-subset.a +0 -0
  146. package/dist/libraries/lib/libharfbuzz-subset.la +0 -41
  147. package/dist/libraries/lib/libharfbuzz.a +0 -0
  148. package/dist/libraries/lib/libharfbuzz.la +0 -41
  149. package/dist/libraries/lib/pkgconfig/expat.pc +0 -11
  150. package/dist/libraries/lib/pkgconfig/fontconfig.pc +0 -18
  151. package/dist/libraries/lib/pkgconfig/freetype2.pc +0 -14
  152. package/dist/libraries/lib/pkgconfig/fribidi.pc +0 -13
  153. package/dist/libraries/lib/pkgconfig/harfbuzz-subset.pc +0 -12
  154. package/dist/libraries/lib/pkgconfig/harfbuzz.pc +0 -13
  155. package/dist/libraries/lib/pkgconfig/libass.pc +0 -13
  156. package/dist/libraries/lib/pkgconfig/libbrotlicommon.pc +0 -11
  157. package/dist/libraries/lib/pkgconfig/libbrotlidec.pc +0 -12
  158. package/dist/libraries/lib/pkgconfig/libbrotlienc.pc +0 -12
  159. package/dist/libraries/share/aclocal/freetype2.m4 +0 -194
  160. package/dist/libraries/share/doc/expat/AUTHORS +0 -10
  161. package/dist/libraries/share/doc/expat/changelog +0 -1161
  162. package/dist/license/all +0 -951
  163. package/dist/license/all.tmp +0 -307
  164. package/dist/license/brotli +0 -12
  165. package/dist/license/expat +0 -71
  166. package/dist/license/fontconfig +0 -46
  167. package/dist/license/freetype +0 -92
  168. package/dist/license/fribidi +0 -15
  169. package/dist/license/harfbuzz +0 -32
  170. package/dist/license/jassub +0 -0
  171. package/dist/license/libass +0 -28
@@ -1,1609 +0,0 @@
1
- /****************************************************************************
2
- *
3
- * ftcolor.h
4
- *
5
- * FreeType's glyph color management (specification).
6
- *
7
- * Copyright (C) 2018-2021 by
8
- * David Turner, Robert Wilhelm, and Werner Lemberg.
9
- *
10
- * This file is part of the FreeType project, and may only be used,
11
- * modified, and distributed under the terms of the FreeType project
12
- * license, LICENSE.TXT. By continuing to use, modify, or distribute
13
- * this file you indicate that you have read the license and
14
- * understand and accept it fully.
15
- *
16
- */
17
-
18
-
19
- #ifndef FTCOLOR_H_
20
- #define FTCOLOR_H_
21
-
22
- #include <freetype/freetype.h>
23
-
24
- #ifdef FREETYPE_H
25
- #error "freetype.h of FreeType 1 has been loaded!"
26
- #error "Please fix the directory search order for header files"
27
- #error "so that freetype.h of FreeType 2 is found first."
28
- #endif
29
-
30
-
31
- FT_BEGIN_HEADER
32
-
33
-
34
- /**************************************************************************
35
- *
36
- * @section:
37
- * color_management
38
- *
39
- * @title:
40
- * Glyph Color Management
41
- *
42
- * @abstract:
43
- * Retrieving and manipulating OpenType's 'CPAL' table data.
44
- *
45
- * @description:
46
- * The functions described here allow access and manipulation of color
47
- * palette entries in OpenType's 'CPAL' tables.
48
- */
49
-
50
-
51
- /**************************************************************************
52
- *
53
- * @struct:
54
- * FT_Color
55
- *
56
- * @description:
57
- * This structure models a BGRA color value of a 'CPAL' palette entry.
58
- *
59
- * The used color space is sRGB; the colors are not pre-multiplied, and
60
- * alpha values must be explicitly set.
61
- *
62
- * @fields:
63
- * blue ::
64
- * Blue value.
65
- *
66
- * green ::
67
- * Green value.
68
- *
69
- * red ::
70
- * Red value.
71
- *
72
- * alpha ::
73
- * Alpha value, giving the red, green, and blue color's opacity.
74
- *
75
- * @since:
76
- * 2.10
77
- */
78
- typedef struct FT_Color_
79
- {
80
- FT_Byte blue;
81
- FT_Byte green;
82
- FT_Byte red;
83
- FT_Byte alpha;
84
-
85
- } FT_Color;
86
-
87
-
88
- /**************************************************************************
89
- *
90
- * @enum:
91
- * FT_PALETTE_XXX
92
- *
93
- * @description:
94
- * A list of bit field constants used in the `palette_flags` array of the
95
- * @FT_Palette_Data structure to indicate for which background a palette
96
- * with a given index is usable.
97
- *
98
- * @values:
99
- * FT_PALETTE_FOR_LIGHT_BACKGROUND ::
100
- * The palette is appropriate to use when displaying the font on a
101
- * light background such as white.
102
- *
103
- * FT_PALETTE_FOR_DARK_BACKGROUND ::
104
- * The palette is appropriate to use when displaying the font on a dark
105
- * background such as black.
106
- *
107
- * @since:
108
- * 2.10
109
- */
110
- #define FT_PALETTE_FOR_LIGHT_BACKGROUND 0x01
111
- #define FT_PALETTE_FOR_DARK_BACKGROUND 0x02
112
-
113
-
114
- /**************************************************************************
115
- *
116
- * @struct:
117
- * FT_Palette_Data
118
- *
119
- * @description:
120
- * This structure holds the data of the 'CPAL' table.
121
- *
122
- * @fields:
123
- * num_palettes ::
124
- * The number of palettes.
125
- *
126
- * palette_name_ids ::
127
- * An optional read-only array of palette name IDs with `num_palettes`
128
- * elements, corresponding to entries like 'dark' or 'light' in the
129
- * font's 'name' table.
130
- *
131
- * An empty name ID in the 'CPAL' table gets represented as value
132
- * 0xFFFF.
133
- *
134
- * `NULL` if the font's 'CPAL' table doesn't contain appropriate data.
135
- *
136
- * palette_flags ::
137
- * An optional read-only array of palette flags with `num_palettes`
138
- * elements. Possible values are an ORed combination of
139
- * @FT_PALETTE_FOR_LIGHT_BACKGROUND and
140
- * @FT_PALETTE_FOR_DARK_BACKGROUND.
141
- *
142
- * `NULL` if the font's 'CPAL' table doesn't contain appropriate data.
143
- *
144
- * num_palette_entries ::
145
- * The number of entries in a single palette. All palettes have the
146
- * same size.
147
- *
148
- * palette_entry_name_ids ::
149
- * An optional read-only array of palette entry name IDs with
150
- * `num_palette_entries`. In each palette, entries with the same index
151
- * have the same function. For example, index~0 might correspond to
152
- * string 'outline' in the font's 'name' table to indicate that this
153
- * palette entry is used for outlines, index~1 might correspond to
154
- * 'fill' to indicate the filling color palette entry, etc.
155
- *
156
- * An empty entry name ID in the 'CPAL' table gets represented as value
157
- * 0xFFFF.
158
- *
159
- * `NULL` if the font's 'CPAL' table doesn't contain appropriate data.
160
- *
161
- * @note:
162
- * Use function @FT_Get_Sfnt_Name to map name IDs and entry name IDs to
163
- * name strings.
164
- *
165
- * Use function @FT_Palette_Select to get the colors associated with a
166
- * palette entry.
167
- *
168
- * @since:
169
- * 2.10
170
- */
171
- typedef struct FT_Palette_Data_ {
172
- FT_UShort num_palettes;
173
- const FT_UShort* palette_name_ids;
174
- const FT_UShort* palette_flags;
175
-
176
- FT_UShort num_palette_entries;
177
- const FT_UShort* palette_entry_name_ids;
178
-
179
- } FT_Palette_Data;
180
-
181
-
182
- /**************************************************************************
183
- *
184
- * @function:
185
- * FT_Palette_Data_Get
186
- *
187
- * @description:
188
- * Retrieve the face's color palette data.
189
- *
190
- * @input:
191
- * face ::
192
- * The source face handle.
193
- *
194
- * @output:
195
- * apalette ::
196
- * A pointer to an @FT_Palette_Data structure.
197
- *
198
- * @return:
199
- * FreeType error code. 0~means success.
200
- *
201
- * @note:
202
- * All arrays in the returned @FT_Palette_Data structure are read-only.
203
- *
204
- * This function always returns an error if the config macro
205
- * `TT_CONFIG_OPTION_COLOR_LAYERS` is not defined in `ftoption.h`.
206
- *
207
- * @since:
208
- * 2.10
209
- */
210
- FT_EXPORT( FT_Error )
211
- FT_Palette_Data_Get( FT_Face face,
212
- FT_Palette_Data *apalette );
213
-
214
-
215
- /**************************************************************************
216
- *
217
- * @function:
218
- * FT_Palette_Select
219
- *
220
- * @description:
221
- * This function has two purposes.
222
- *
223
- * (1) It activates a palette for rendering color glyphs, and
224
- *
225
- * (2) it retrieves all (unmodified) color entries of this palette. This
226
- * function returns a read-write array, which means that a calling
227
- * application can modify the palette entries on demand.
228
- *
229
- * A corollary of (2) is that calling the function, then modifying some
230
- * values, then calling the function again with the same arguments resets
231
- * all color entries to the original 'CPAL' values; all user modifications
232
- * are lost.
233
- *
234
- * @input:
235
- * face ::
236
- * The source face handle.
237
- *
238
- * palette_index ::
239
- * The palette index.
240
- *
241
- * @output:
242
- * apalette ::
243
- * An array of color entries for a palette with index `palette_index`,
244
- * having `num_palette_entries` elements (as found in the
245
- * `FT_Palette_Data` structure). If `apalette` is set to `NULL`, no
246
- * array gets returned (and no color entries can be modified).
247
- *
248
- * In case the font doesn't support color palettes, `NULL` is returned.
249
- *
250
- * @return:
251
- * FreeType error code. 0~means success.
252
- *
253
- * @note:
254
- * The array pointed to by `apalette_entries` is owned and managed by
255
- * FreeType.
256
- *
257
- * This function always returns an error if the config macro
258
- * `TT_CONFIG_OPTION_COLOR_LAYERS` is not defined in `ftoption.h`.
259
- *
260
- * @since:
261
- * 2.10
262
- */
263
- FT_EXPORT( FT_Error )
264
- FT_Palette_Select( FT_Face face,
265
- FT_UShort palette_index,
266
- FT_Color* *apalette );
267
-
268
-
269
- /**************************************************************************
270
- *
271
- * @function:
272
- * FT_Palette_Set_Foreground_Color
273
- *
274
- * @description:
275
- * 'COLR' uses palette index 0xFFFF to indicate a 'text foreground
276
- * color'. This function sets this value.
277
- *
278
- * @input:
279
- * face ::
280
- * The source face handle.
281
- *
282
- * foreground_color ::
283
- * An `FT_Color` structure to define the text foreground color.
284
- *
285
- * @return:
286
- * FreeType error code. 0~means success.
287
- *
288
- * @note:
289
- * If this function isn't called, the text foreground color is set to
290
- * white opaque (BGRA value 0xFFFFFFFF) if
291
- * @FT_PALETTE_FOR_DARK_BACKGROUND is present for the current palette,
292
- * and black opaque (BGRA value 0x000000FF) otherwise, including the case
293
- * that no palette types are available in the 'CPAL' table.
294
- *
295
- * This function always returns an error if the config macro
296
- * `TT_CONFIG_OPTION_COLOR_LAYERS` is not defined in `ftoption.h`.
297
- *
298
- * @since:
299
- * 2.10
300
- */
301
- FT_EXPORT( FT_Error )
302
- FT_Palette_Set_Foreground_Color( FT_Face face,
303
- FT_Color foreground_color );
304
-
305
-
306
- /**************************************************************************
307
- *
308
- * @section:
309
- * layer_management
310
- *
311
- * @title:
312
- * Glyph Layer Management
313
- *
314
- * @abstract:
315
- * Retrieving and manipulating OpenType's 'COLR' table data.
316
- *
317
- * @description:
318
- * The functions described here allow access of colored glyph layer data
319
- * in OpenType's 'COLR' tables.
320
- */
321
-
322
-
323
- /**************************************************************************
324
- *
325
- * @struct:
326
- * FT_LayerIterator
327
- *
328
- * @description:
329
- * This iterator object is needed for @FT_Get_Color_Glyph_Layer.
330
- *
331
- * @fields:
332
- * num_layers ::
333
- * The number of glyph layers for the requested glyph index. Will be
334
- * set by @FT_Get_Color_Glyph_Layer.
335
- *
336
- * layer ::
337
- * The current layer. Will be set by @FT_Get_Color_Glyph_Layer.
338
- *
339
- * p ::
340
- * An opaque pointer into 'COLR' table data. The caller must set this
341
- * to `NULL` before the first call of @FT_Get_Color_Glyph_Layer.
342
- */
343
- typedef struct FT_LayerIterator_
344
- {
345
- FT_UInt num_layers;
346
- FT_UInt layer;
347
- FT_Byte* p;
348
-
349
- } FT_LayerIterator;
350
-
351
-
352
- /**************************************************************************
353
- *
354
- * @function:
355
- * FT_Get_Color_Glyph_Layer
356
- *
357
- * @description:
358
- * This is an interface to the 'COLR' table in OpenType fonts to
359
- * iteratively retrieve the colored glyph layers associated with the
360
- * current glyph slot.
361
- *
362
- * https://docs.microsoft.com/en-us/typography/opentype/spec/colr
363
- *
364
- * The glyph layer data for a given glyph index, if present, provides an
365
- * alternative, multi-color glyph representation: Instead of rendering
366
- * the outline or bitmap with the given glyph index, glyphs with the
367
- * indices and colors returned by this function are rendered layer by
368
- * layer.
369
- *
370
- * The returned elements are ordered in the z~direction from bottom to
371
- * top; the 'n'th element should be rendered with the associated palette
372
- * color and blended on top of the already rendered layers (elements 0,
373
- * 1, ..., n-1).
374
- *
375
- * @input:
376
- * face ::
377
- * A handle to the parent face object.
378
- *
379
- * base_glyph ::
380
- * The glyph index the colored glyph layers are associated with.
381
- *
382
- * @inout:
383
- * iterator ::
384
- * An @FT_LayerIterator object. For the first call you should set
385
- * `iterator->p` to `NULL`. For all following calls, simply use the
386
- * same object again.
387
- *
388
- * @output:
389
- * aglyph_index ::
390
- * The glyph index of the current layer.
391
- *
392
- * acolor_index ::
393
- * The color index into the font face's color palette of the current
394
- * layer. The value 0xFFFF is special; it doesn't reference a palette
395
- * entry but indicates that the text foreground color should be used
396
- * instead (to be set up by the application outside of FreeType).
397
- *
398
- * The color palette can be retrieved with @FT_Palette_Select.
399
- *
400
- * @return:
401
- * Value~1 if everything is OK. If there are no more layers (or if there
402
- * are no layers at all), value~0 gets returned. In case of an error,
403
- * value~0 is returned also.
404
- *
405
- * @note:
406
- * This function is necessary if you want to handle glyph layers by
407
- * yourself. In particular, functions that operate with @FT_GlyphRec
408
- * objects (like @FT_Get_Glyph or @FT_Glyph_To_Bitmap) don't have access
409
- * to this information.
410
- *
411
- * Note that @FT_Render_Glyph is able to handle colored glyph layers
412
- * automatically if the @FT_LOAD_COLOR flag is passed to a previous call
413
- * to @FT_Load_Glyph. [This is an experimental feature.]
414
- *
415
- * @example:
416
- * ```
417
- * FT_Color* palette;
418
- * FT_LayerIterator iterator;
419
- *
420
- * FT_Bool have_layers;
421
- * FT_UInt layer_glyph_index;
422
- * FT_UInt layer_color_index;
423
- *
424
- *
425
- * error = FT_Palette_Select( face, palette_index, &palette );
426
- * if ( error )
427
- * palette = NULL;
428
- *
429
- * iterator.p = NULL;
430
- * have_layers = FT_Get_Color_Glyph_Layer( face,
431
- * glyph_index,
432
- * &layer_glyph_index,
433
- * &layer_color_index,
434
- * &iterator );
435
- *
436
- * if ( palette && have_layers )
437
- * {
438
- * do
439
- * {
440
- * FT_Color layer_color;
441
- *
442
- *
443
- * if ( layer_color_index == 0xFFFF )
444
- * layer_color = text_foreground_color;
445
- * else
446
- * layer_color = palette[layer_color_index];
447
- *
448
- * // Load and render glyph `layer_glyph_index', then
449
- * // blend resulting pixmap (using color `layer_color')
450
- * // with previously created pixmaps.
451
- *
452
- * } while ( FT_Get_Color_Glyph_Layer( face,
453
- * glyph_index,
454
- * &layer_glyph_index,
455
- * &layer_color_index,
456
- * &iterator ) );
457
- * }
458
- * ```
459
- */
460
- FT_EXPORT( FT_Bool )
461
- FT_Get_Color_Glyph_Layer( FT_Face face,
462
- FT_UInt base_glyph,
463
- FT_UInt *aglyph_index,
464
- FT_UInt *acolor_index,
465
- FT_LayerIterator* iterator );
466
-
467
-
468
- /**************************************************************************
469
- *
470
- * @enum:
471
- * FT_PaintFormat
472
- *
473
- * @description:
474
- * Enumeration describing the different paint format types of the v1
475
- * extensions to the 'COLR' table, see
476
- * 'https://github.com/googlefonts/colr-gradients-spec'.
477
- *
478
- * The enumeration values losely correspond with the format numbers of
479
- * the specification: FreeType always returns a fully specified 'Paint'
480
- * structure for the 'Transform', 'Translate', 'Scale', 'Rotate', and
481
- * 'Skew' table types even though the specification has different formats
482
- * depending on whether or not a center is specified, whether the scale
483
- * is uniform in x and y~direction or not, etc. Also, only non-variable
484
- * format identifiers are listed in this enumeration; as soon as support
485
- * for variable 'COLR' v1 fonts is implemented, interpolation is
486
- * performed dependent on axis coordinates, which are configured on the
487
- * @FT_Face through @FT_Set_Var_Design_Coordinates. This implies that
488
- * always static, readily interpolated values are returned in the 'Paint'
489
- * structures.
490
- *
491
- * @since:
492
- * 2.11 -- **currently experimental only!** There might be changes
493
- * without retaining backward compatibility of both the API and ABI.
494
- *
495
- */
496
- typedef enum FT_PaintFormat_
497
- {
498
- FT_COLR_PAINTFORMAT_COLR_LAYERS = 1,
499
- FT_COLR_PAINTFORMAT_SOLID = 2,
500
- FT_COLR_PAINTFORMAT_LINEAR_GRADIENT = 4,
501
- FT_COLR_PAINTFORMAT_RADIAL_GRADIENT = 6,
502
- FT_COLR_PAINTFORMAT_SWEEP_GRADIENT = 8,
503
- FT_COLR_PAINTFORMAT_GLYPH = 10,
504
- FT_COLR_PAINTFORMAT_COLR_GLYPH = 11,
505
- FT_COLR_PAINTFORMAT_TRANSFORM = 12,
506
- FT_COLR_PAINTFORMAT_TRANSLATE = 14,
507
- FT_COLR_PAINTFORMAT_SCALE = 16,
508
- FT_COLR_PAINTFORMAT_ROTATE = 24,
509
- FT_COLR_PAINTFORMAT_SKEW = 28,
510
- FT_COLR_PAINTFORMAT_COMPOSITE = 32,
511
- FT_COLR_PAINT_FORMAT_MAX = 33,
512
- FT_COLR_PAINTFORMAT_UNSUPPORTED = 255
513
-
514
- } FT_PaintFormat;
515
-
516
-
517
- /**************************************************************************
518
- *
519
- * @struct:
520
- * FT_ColorStopIterator
521
- *
522
- * @description:
523
- * This iterator object is needed for @FT_Get_Colorline_Stops. It keeps
524
- * state while iterating over the stops of an @FT_ColorLine,
525
- * representing the `ColorLine` struct of the v1 extensions to 'COLR',
526
- * see 'https://github.com/googlefonts/colr-gradients-spec'.
527
- *
528
- * @fields:
529
- * num_color_stops ::
530
- * The number of color stops for the requested glyph index. Set by
531
- * @FT_Get_Colorline_Stops.
532
- *
533
- * current_color_stop ::
534
- * The current color stop. Set by @FT_Get_Colorline_Stops.
535
- *
536
- * p ::
537
- * An opaque pointer into 'COLR' table data. The caller must set this
538
- * to `NULL` before the first call of @FT_Get_Colorline_Stops.
539
- *
540
- * @since:
541
- * 2.11 -- **currently experimental only!** There might be changes
542
- * without retaining backward compatibility of both the API and ABI.
543
- *
544
- */
545
- typedef struct FT_ColorStopIterator_
546
- {
547
- FT_UInt num_color_stops;
548
- FT_UInt current_color_stop;
549
-
550
- FT_Byte* p;
551
-
552
- } FT_ColorStopIterator;
553
-
554
-
555
- /**************************************************************************
556
- *
557
- * @struct:
558
- * FT_ColorIndex
559
- *
560
- * @description:
561
- * A structure representing a `ColorIndex` value of the 'COLR' v1
562
- * extensions, see 'https://github.com/googlefonts/colr-gradients-spec'.
563
- *
564
- * @fields:
565
- * palette_index ::
566
- * The palette index into a 'CPAL' palette.
567
- *
568
- * alpha ::
569
- * Alpha transparency value multiplied with the value from 'CPAL'.
570
- *
571
- * @since:
572
- * 2.11 -- **currently experimental only!** There might be changes
573
- * without retaining backward compatibility of both the API and ABI.
574
- *
575
- */
576
- typedef struct FT_ColorIndex_
577
- {
578
- FT_UInt16 palette_index;
579
- FT_F2Dot14 alpha;
580
-
581
- } FT_ColorIndex;
582
-
583
-
584
- /**************************************************************************
585
- *
586
- * @struct:
587
- * FT_ColorStop
588
- *
589
- * @description:
590
- * A structure representing a `ColorStop` value of the 'COLR' v1
591
- * extensions, see 'https://github.com/googlefonts/colr-gradients-spec'.
592
- *
593
- * @fields:
594
- * stop_offset ::
595
- * The stop offset between 0 and 1 along the gradient.
596
- *
597
- * color ::
598
- * The color information for this stop, see @FT_ColorIndex.
599
- *
600
- * @since:
601
- * 2.11 -- **currently experimental only!** There might be changes
602
- * without retaining backward compatibility of both the API and ABI.
603
- *
604
- */
605
- typedef struct FT_ColorStop_
606
- {
607
- FT_F2Dot14 stop_offset;
608
- FT_ColorIndex color;
609
-
610
- } FT_ColorStop;
611
-
612
-
613
- /**************************************************************************
614
- *
615
- * @enum:
616
- * FT_PaintExtend
617
- *
618
- * @description:
619
- * An enumeration representing the 'Extend' mode of the 'COLR' v1
620
- * extensions, see 'https://github.com/googlefonts/colr-gradients-spec'.
621
- * It describes how the gradient fill continues at the other boundaries.
622
- *
623
- * @since:
624
- * 2.11 -- **currently experimental only!** There might be changes
625
- * without retaining backward compatibility of both the API and ABI.
626
- *
627
- */
628
- typedef enum FT_PaintExtend_
629
- {
630
- FT_COLR_PAINT_EXTEND_PAD = 0,
631
- FT_COLR_PAINT_EXTEND_REPEAT = 1,
632
- FT_COLR_PAINT_EXTEND_REFLECT = 2
633
-
634
- } FT_PaintExtend;
635
-
636
-
637
- /**************************************************************************
638
- *
639
- * @struct:
640
- * FT_ColorLine
641
- *
642
- * @description:
643
- * A structure representing a `ColorLine` value of the 'COLR' v1
644
- * extensions, see 'https://github.com/googlefonts/colr-gradients-spec'.
645
- * It describes a list of color stops along the defined gradient.
646
- *
647
- * @fields:
648
- * extend ::
649
- * The extend mode at the outer boundaries, see @FT_PaintExtend.
650
- *
651
- * color_stop_iterator ::
652
- * The @FT_ColorStopIterator used to enumerate and retrieve the
653
- * actual @FT_ColorStop's.
654
- *
655
- * @since:
656
- * 2.11 -- **currently experimental only!** There might be changes
657
- * without retaining backward compatibility of both the API and ABI.
658
- *
659
- */
660
- typedef struct FT_ColorLine_
661
- {
662
- FT_PaintExtend extend;
663
- FT_ColorStopIterator color_stop_iterator;
664
-
665
- } FT_ColorLine;
666
-
667
-
668
- /**************************************************************************
669
- *
670
- * @struct:
671
- * FT_Affine23
672
- *
673
- * @description:
674
- * A structure used to store a 2x3 matrix. Coefficients are in
675
- * 16.16 fixed-point format. The computation performed is
676
- *
677
- * ```
678
- * x' = x*xx + y*xy + dx
679
- * y' = x*yx + y*yy + dy
680
- * ```
681
- *
682
- * @fields:
683
- * xx ::
684
- * Matrix coefficient.
685
- *
686
- * xy ::
687
- * Matrix coefficient.
688
- *
689
- * dx ::
690
- * x translation.
691
- *
692
- * yx ::
693
- * Matrix coefficient.
694
- *
695
- * yy ::
696
- * Matrix coefficient.
697
- *
698
- * dy ::
699
- * y translation.
700
- *
701
- * @since:
702
- * 2.11 -- **currently experimental only!** There might be changes
703
- * without retaining backward compatibility of both the API and ABI.
704
- *
705
- */
706
- typedef struct FT_Affine_23_
707
- {
708
- FT_Fixed xx, xy, dx;
709
- FT_Fixed yx, yy, dy;
710
-
711
- } FT_Affine23;
712
-
713
-
714
- /**************************************************************************
715
- *
716
- * @enum:
717
- * FT_Composite_Mode
718
- *
719
- * @description:
720
- * An enumeration listing the 'COLR' v1 composite modes used in
721
- * @FT_PaintComposite. For more details on each paint mode, see
722
- * 'https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators'.
723
- *
724
- * @since:
725
- * 2.11 -- **currently experimental only!** There might be changes
726
- * without retaining backward compatibility of both the API and ABI.
727
- *
728
- */
729
- typedef enum FT_Composite_Mode_
730
- {
731
- FT_COLR_COMPOSITE_CLEAR = 0,
732
- FT_COLR_COMPOSITE_SRC = 1,
733
- FT_COLR_COMPOSITE_DEST = 2,
734
- FT_COLR_COMPOSITE_SRC_OVER = 3,
735
- FT_COLR_COMPOSITE_DEST_OVER = 4,
736
- FT_COLR_COMPOSITE_SRC_IN = 5,
737
- FT_COLR_COMPOSITE_DEST_IN = 6,
738
- FT_COLR_COMPOSITE_SRC_OUT = 7,
739
- FT_COLR_COMPOSITE_DEST_OUT = 8,
740
- FT_COLR_COMPOSITE_SRC_ATOP = 9,
741
- FT_COLR_COMPOSITE_DEST_ATOP = 10,
742
- FT_COLR_COMPOSITE_XOR = 11,
743
- FT_COLR_COMPOSITE_SCREEN = 12,
744
- FT_COLR_COMPOSITE_OVERLAY = 13,
745
- FT_COLR_COMPOSITE_DARKEN = 14,
746
- FT_COLR_COMPOSITE_LIGHTEN = 15,
747
- FT_COLR_COMPOSITE_COLOR_DODGE = 16,
748
- FT_COLR_COMPOSITE_COLOR_BURN = 17,
749
- FT_COLR_COMPOSITE_HARD_LIGHT = 18,
750
- FT_COLR_COMPOSITE_SOFT_LIGHT = 19,
751
- FT_COLR_COMPOSITE_DIFFERENCE = 20,
752
- FT_COLR_COMPOSITE_EXCLUSION = 21,
753
- FT_COLR_COMPOSITE_MULTIPLY = 22,
754
- FT_COLR_COMPOSITE_HSL_HUE = 23,
755
- FT_COLR_COMPOSITE_HSL_SATURATION = 24,
756
- FT_COLR_COMPOSITE_HSL_COLOR = 25,
757
- FT_COLR_COMPOSITE_HSL_LUMINOSITY = 26,
758
- FT_COLR_COMPOSITE_MAX = 27
759
-
760
- } FT_Composite_Mode;
761
-
762
-
763
- /**************************************************************************
764
- *
765
- * @struct:
766
- * FT_OpaquePaint
767
- *
768
- * @description:
769
- * A structure representing an offset to a `Paint` value stored in any
770
- * of the paint tables of a 'COLR' v1 font. Compare Offset<24> there.
771
- * When 'COLR' v1 paint tables represented by FreeType objects such as
772
- * @FT_PaintColrLayers, @FT_PaintComposite, or @FT_PaintTransform
773
- * reference downstream nested paint tables, we do not immediately
774
- * retrieve them but encapsulate their location in this type. Use
775
- * @FT_Get_Paint to retrieve the actual @FT_COLR_Paint object that
776
- * describes the details of the respective paint table.
777
- *
778
- * @fields:
779
- * p ::
780
- * An internal offset to a Paint table, needs to be set to NULL before
781
- * passing this struct as an argument to @FT_Get_Paint.
782
- *
783
- * insert_root_transform ::
784
- * An internal boolean to track whether an initial root transform is
785
- * to be provided. Do not set this value.
786
- *
787
- * @since:
788
- * 2.11 -- **currently experimental only!** There might be changes
789
- * without retaining backward compatibility of both the API and ABI.
790
- *
791
- */
792
- typedef struct FT_Opaque_Paint_
793
- {
794
- FT_Byte* p;
795
- FT_Bool insert_root_transform;
796
- } FT_OpaquePaint;
797
-
798
-
799
- /**************************************************************************
800
- *
801
- * @struct:
802
- * FT_PaintColrLayers
803
- *
804
- * @description:
805
- * A structure representing a `PaintColrLayers` table of a 'COLR' v1
806
- * font. This table describes a set of layers that are to be composited
807
- * with composite mode `FT_COLR_COMPOSITE_SRC_OVER`. The return value
808
- * of this function is an @FT_LayerIterator initialized so that it can
809
- * be used with @FT_Get_Paint_Layers to retrieve the @FT_OpaquePaint
810
- * objects as references to each layer.
811
- *
812
- * @fields:
813
- * layer_iterator ::
814
- * The layer iterator that describes the layers of this paint.
815
- *
816
- * @since:
817
- * 2.11 -- **currently experimental only!** There might be changes
818
- * without retaining backward compatibility of both the API and ABI.
819
- *
820
- */
821
- typedef struct FT_PaintColrLayers_
822
- {
823
- FT_LayerIterator layer_iterator;
824
-
825
- } FT_PaintColrLayers;
826
-
827
-
828
- /**************************************************************************
829
- *
830
- * @struct:
831
- * FT_PaintSolid
832
- *
833
- * @description:
834
- * A structure representing a `PaintSolid` value of the 'COLR' v1
835
- * extensions, see 'https://github.com/googlefonts/colr-gradients-spec'.
836
- * Using a `PaintSolid` value means that the glyph layer filled with
837
- * this paint is solid-colored and does not contain a gradient.
838
- *
839
- * @fields:
840
- * color ::
841
- * The color information for this solid paint, see @FT_ColorIndex.
842
- *
843
- * @since:
844
- * 2.11 -- **currently experimental only!** There might be changes
845
- * without retaining backward compatibility of both the API and ABI.
846
- *
847
- */
848
- typedef struct FT_PaintSolid_
849
- {
850
- FT_ColorIndex color;
851
-
852
- } FT_PaintSolid;
853
-
854
-
855
- /**************************************************************************
856
- *
857
- * @struct:
858
- * FT_PaintLinearGradient
859
- *
860
- * @description:
861
- * A structure representing a `PaintLinearGradient` value of the 'COLR'
862
- * v1 extensions, see
863
- * 'https://github.com/googlefonts/colr-gradients-spec'. The glyph
864
- * layer filled with this paint is drawn filled with a linear gradient.
865
- *
866
- * @fields:
867
- * colorline ::
868
- * The @FT_ColorLine information for this paint, i.e., the list of
869
- * color stops along the gradient.
870
- *
871
- * p0 ::
872
- * The starting point of the gradient definition (in font units).
873
- *
874
- * p1 ::
875
- * The end point of the gradient definition (in font units).
876
- *
877
- * p2 ::
878
- * Optional point~p2 to rotate the gradient (in font units).
879
- * Otherwise equal to~p0.
880
- *
881
- * @since:
882
- * 2.11 -- **currently experimental only!** There might be changes
883
- * without retaining backward compatibility of both the API and ABI.
884
- *
885
- */
886
- typedef struct FT_PaintLinearGradient_
887
- {
888
- FT_ColorLine colorline;
889
-
890
- /* TODO: Potentially expose those as x0, y0 etc. */
891
- FT_Vector p0;
892
- FT_Vector p1;
893
- FT_Vector p2;
894
-
895
- } FT_PaintLinearGradient;
896
-
897
-
898
- /**************************************************************************
899
- *
900
- * @struct:
901
- * FT_PaintRadialGradient
902
- *
903
- * @description:
904
- * A structure representing a `PaintRadialGradient` value of the 'COLR'
905
- * v1 extensions, see
906
- * 'https://github.com/googlefonts/colr-gradients-spec'. The glyph
907
- * layer filled with this paint is drawn filled filled with a radial
908
- * gradient.
909
- *
910
- * @fields:
911
- * colorline ::
912
- * The @FT_ColorLine information for this paint, i.e., the list of
913
- * color stops along the gradient.
914
- *
915
- * c0 ::
916
- * The center of the starting point of the radial gradient (in font
917
- * units).
918
- *
919
- * r0 ::
920
- * The radius of the starting circle of the radial gradient (in font
921
- * units).
922
- *
923
- * c1 ::
924
- * The center of the end point of the radial gradient (in font units).
925
- *
926
- * r1 ::
927
- * The radius of the end circle of the radial gradient (in font
928
- * units).
929
- *
930
- * @since:
931
- * 2.11 -- **currently experimental only!** There might be changes
932
- * without retaining backward compatibility of both the API and ABI.
933
- *
934
- */
935
- typedef struct FT_PaintRadialGradient_
936
- {
937
- FT_ColorLine colorline;
938
-
939
- FT_Vector c0;
940
- FT_UShort r0;
941
- FT_Vector c1;
942
- FT_UShort r1;
943
-
944
- } FT_PaintRadialGradient;
945
-
946
-
947
- /**************************************************************************
948
- *
949
- * @struct:
950
- * FT_PaintSweepGradient
951
- *
952
- * @description:
953
- * A structure representing a `PaintSweepGradient` value of the 'COLR'
954
- * v1 extensions, see
955
- * 'https://github.com/googlefonts/colr-gradients-spec'. The glyph
956
- * layer filled with this paint is drawn filled with a sweep gradient
957
- * from `start_angle` to `end_angle`.
958
- *
959
- * @fields:
960
- * colorline ::
961
- * The @FT_ColorLine information for this paint, i.e., the list of
962
- * color stops along the gradient.
963
- *
964
- * center ::
965
- * The center of the sweep gradient (in font units).
966
- *
967
- * start_angle ::
968
- * The start angle of the sweep gradient, in 16.16 fixed point format
969
- * specifying degrees. Values are given counter-clockwise, starting
970
- * from the (positive) y~axis.
971
- *
972
- * end_angle ::
973
- * The end angle of the sweep gradient, in 16.16 fixed point format
974
- * specifying degrees. Values are given counter-clockwise, starting
975
- * from the (positive) y~axis.
976
- *
977
- * @since:
978
- * 2.11 -- **currently experimental only!** There might be changes
979
- * without retaining backward compatibility of both the API and ABI.
980
- *
981
- */
982
- typedef struct FT_PaintSweepGradient_
983
- {
984
- FT_ColorLine colorline;
985
-
986
- FT_Vector center;
987
- FT_Fixed start_angle;
988
- FT_Fixed end_angle;
989
-
990
- } FT_PaintSweepGradient;
991
-
992
-
993
- /**************************************************************************
994
- *
995
- * @struct:
996
- * FT_PaintGlyph
997
- *
998
- * @description:
999
- * A structure representing a 'COLR' v1 `PaintGlyph` paint table.
1000
- *
1001
- * @fields:
1002
- * paint ::
1003
- * An opaque paint object pointing to a `Paint` table that serves as
1004
- * the fill for the glyph ID.
1005
- *
1006
- * glyphID ::
1007
- * The glyph ID from the 'glyf' table, which serves as the contour
1008
- * information that is filled with paint.
1009
- *
1010
- * @since:
1011
- * 2.11 -- **currently experimental only!** There might be changes
1012
- * without retaining backward compatibility of both the API and ABI.
1013
- *
1014
- */
1015
- typedef struct FT_PaintGlyph_
1016
- {
1017
- FT_OpaquePaint paint;
1018
- FT_UInt glyphID;
1019
-
1020
- } FT_PaintGlyph;
1021
-
1022
-
1023
- /**************************************************************************
1024
- *
1025
- * @struct:
1026
- * FT_PaintColrGlyph
1027
- *
1028
- * @description:
1029
- * A structure representing a 'COLR' v1 `PaintColorGlyph` paint table.
1030
- *
1031
- * @fields:
1032
- * glyphID ::
1033
- * The glyph ID from the `BaseGlyphV1List` table that is drawn for
1034
- * this paint.
1035
- *
1036
- * @since:
1037
- * 2.11 -- **currently experimental only!** There might be changes
1038
- * without retaining backward compatibility of both the API and ABI.
1039
- *
1040
- */
1041
- typedef struct FT_PaintColrGlyph_
1042
- {
1043
- FT_UInt glyphID;
1044
-
1045
- } FT_PaintColrGlyph;
1046
-
1047
-
1048
- /**************************************************************************
1049
- *
1050
- * @struct:
1051
- * FT_PaintTransform
1052
- *
1053
- * @description:
1054
- * A structure representing a 'COLR' v1 `PaintTransform` paint table.
1055
- *
1056
- * @fields:
1057
- * paint ::
1058
- * An opaque paint that is subject to being transformed.
1059
- *
1060
- * affine ::
1061
- * A 2x3 transformation matrix in @FT_Affine23 format.
1062
- *
1063
- * @since:
1064
- * 2.11 -- **currently experimental only!** There might be changes
1065
- * without retaining backward compatibility of both the API and ABI.
1066
- *
1067
- */
1068
- typedef struct FT_PaintTransform_
1069
- {
1070
- FT_OpaquePaint paint;
1071
- FT_Affine23 affine;
1072
-
1073
- } FT_PaintTransform;
1074
-
1075
-
1076
- /**************************************************************************
1077
- *
1078
- * @struct:
1079
- * FT_PaintTranslate
1080
- *
1081
- * @description:
1082
- * A structure representing a 'COLR' v1 `PaintTranslate` paint table.
1083
- * Used for translating downstream paints by a given x and y~delta.
1084
- *
1085
- * @fields:
1086
- * paint ::
1087
- * An @FT_OpaquePaint object referencing the paint that is to be
1088
- * rotated.
1089
- *
1090
- * dx ::
1091
- * Translation in x~direction (in font units).
1092
- *
1093
- * dy ::
1094
- * Translation in y~direction (in font units).
1095
- *
1096
- * @since:
1097
- * 2.11 -- **currently experimental only!** There might be changes
1098
- * without retaining backward compatibility of both the API and ABI.
1099
- *
1100
- */
1101
- typedef struct FT_PaintTranslate_
1102
- {
1103
- FT_OpaquePaint paint;
1104
-
1105
- FT_Fixed dx;
1106
- FT_Fixed dy;
1107
-
1108
- } FT_PaintTranslate;
1109
-
1110
-
1111
- /**************************************************************************
1112
- *
1113
- * @struct:
1114
- * FT_PaintScale
1115
- *
1116
- * @description:
1117
- * A structure representing all of the 'COLR' v1 'PaintScale*' paint
1118
- * tables. Used for scaling downstream paints by a given x and y~scale,
1119
- * with a given center. This structure is used for all 'PaintScale*'
1120
- * types that are part of specification; fields of this structure are
1121
- * filled accordingly. If there is a center, the center values are set,
1122
- * otherwise they are set to the zero coordinate. If the source font
1123
- * file has 'PaintScaleUniform*' set, the scale values are set
1124
- * accordingly to the same value.
1125
- *
1126
- * @fields:
1127
- * paint ::
1128
- * An @FT_OpaquePaint object referencing the paint that is to be
1129
- * scaled.
1130
- *
1131
- * scale_x ::
1132
- * Scale factor in x~direction.
1133
- *
1134
- * scale_y ::
1135
- * Scale factor in y~direction.
1136
- *
1137
- * center_x ::
1138
- * x~coordinate of center point to scale from.
1139
- *
1140
- * center_y ::
1141
- * y~coordinate of center point to scale from.
1142
- *
1143
- * @since:
1144
- * 2.11 -- **currently experimental only!** There might be changes
1145
- * without retaining backward-compatibility of both the API and ABI.
1146
- *
1147
- */
1148
- typedef struct FT_PaintScale_
1149
- {
1150
- FT_OpaquePaint paint;
1151
-
1152
- FT_Fixed scale_x;
1153
- FT_Fixed scale_y;
1154
-
1155
- FT_Fixed center_x;
1156
- FT_Fixed center_y;
1157
-
1158
- } FT_PaintScale;
1159
-
1160
-
1161
- /**************************************************************************
1162
- *
1163
- * @struct:
1164
- * FT_PaintRotate
1165
- *
1166
- * @description:
1167
- * A structure representing a 'COLR' v1 `PaintRotate` paint table. Used
1168
- * for rotating downstream paints with a given center and angle.
1169
- *
1170
- * @fields:
1171
- * paint ::
1172
- * An @FT_OpaquePaint object referencing the paint that is to be
1173
- * rotated.
1174
- *
1175
- * angle ::
1176
- * The rotation angle that is to be applied.
1177
- *
1178
- * center_x ::
1179
- * The x~coordinate of the pivot point of the rotation (in font
1180
- * units).
1181
- *
1182
- * center_y ::
1183
- * The y~coordinate of the pivot point of the rotation (in font
1184
- * units).
1185
- *
1186
- * @since:
1187
- * 2.11 -- **currently experimental only!** There might be changes
1188
- * without retaining backward compatibility of both the API and ABI.
1189
- *
1190
- */
1191
-
1192
- typedef struct FT_PaintRotate_
1193
- {
1194
- FT_OpaquePaint paint;
1195
-
1196
- FT_Fixed angle;
1197
-
1198
- FT_Fixed center_x;
1199
- FT_Fixed center_y;
1200
-
1201
- } FT_PaintRotate;
1202
-
1203
-
1204
- /**************************************************************************
1205
- *
1206
- * @struct:
1207
- * FT_PaintSkew
1208
- *
1209
- * @description:
1210
- * A structure representing a 'COLR' v1 `PaintSkew` paint table. Used
1211
- * for skewing or shearing downstream paints by a given center and
1212
- * angle.
1213
- *
1214
- * @fields:
1215
- * paint ::
1216
- * An @FT_OpaquePaint object referencing the paint that is to be
1217
- * skewed.
1218
- *
1219
- * x_skew_angle ::
1220
- * The skewing angle in x~direction.
1221
- *
1222
- * y_skew_angle ::
1223
- * The skewing angle in y~direction.
1224
- *
1225
- * center_x ::
1226
- * The x~coordinate of the pivot point of the skew (in font units).
1227
- *
1228
- * center_y ::
1229
- * The y~coordinate of the pivot point of the skew (in font units).
1230
- *
1231
- * @since:
1232
- * 2.11 -- **currently experimental only!** There might be changes
1233
- * without retaining backward compatibility of both the API and ABI.
1234
- *
1235
- */
1236
- typedef struct FT_PaintSkew_
1237
- {
1238
- FT_OpaquePaint paint;
1239
-
1240
- FT_Fixed x_skew_angle;
1241
- FT_Fixed y_skew_angle;
1242
-
1243
- FT_Fixed center_x;
1244
- FT_Fixed center_y;
1245
-
1246
- } FT_PaintSkew;
1247
-
1248
-
1249
- /**************************************************************************
1250
- *
1251
- * @struct:
1252
- * FT_PaintComposite
1253
- *
1254
- * @description:
1255
- * A structure representing a 'COLR'v1 `PaintComposite` paint table.
1256
- * Used for compositing two paints in a 'COLR' v1 directed acycling
1257
- * graph.
1258
- *
1259
- * @fields:
1260
- * source_paint ::
1261
- * An @FT_OpaquePaint object referencing the source that is to be
1262
- * composited.
1263
- *
1264
- * composite_mode ::
1265
- * An @FT_Composite_Mode enum value determining the composition
1266
- * operation.
1267
- *
1268
- * backdrop_paint ::
1269
- * An @FT_OpaquePaint object referencing the backdrop paint that
1270
- * `source_paint` is composited onto.
1271
- *
1272
- * @since:
1273
- * 2.11 -- **currently experimental only!** There might be changes
1274
- * without retaining backward compatibility of both the API and ABI.
1275
- *
1276
- */
1277
- typedef struct FT_PaintComposite_
1278
- {
1279
- FT_OpaquePaint source_paint;
1280
- FT_Composite_Mode composite_mode;
1281
- FT_OpaquePaint backdrop_paint;
1282
-
1283
- } FT_PaintComposite;
1284
-
1285
-
1286
- /**************************************************************************
1287
- *
1288
- * @union:
1289
- * FT_COLR_Paint
1290
- *
1291
- * @description:
1292
- * A union object representing format and details of a paint table of a
1293
- * 'COLR' v1 font, see
1294
- * 'https://github.com/googlefonts/colr-gradients-spec'. Use
1295
- * @FT_Get_Paint to retrieve a @FT_COLR_Paint for an @FT_OpaquePaint
1296
- * object.
1297
- *
1298
- * @fields:
1299
- * format ::
1300
- * The gradient format for this Paint structure.
1301
- *
1302
- * u ::
1303
- * Union of all paint table types:
1304
- *
1305
- * * @FT_PaintColrLayers
1306
- * * @FT_PaintGlyph
1307
- * * @FT_PaintSolid
1308
- * * @FT_PaintLinearGradient
1309
- * * @FT_PaintRadialGradient
1310
- * * @FT_PaintSweepGradient
1311
- * * @FT_PaintTransform
1312
- * * @FT_PaintTranslate
1313
- * * @FT_PaintRotate
1314
- * * @FT_PaintSkew
1315
- * * @FT_PaintComposite
1316
- * * @FT_PaintColrGlyph
1317
- *
1318
- * @since:
1319
- * 2.11 -- **currently experimental only!** There might be changes
1320
- * without retaining backward compatibility of both the API and ABI.
1321
- *
1322
- */
1323
- typedef struct FT_COLR_Paint_
1324
- {
1325
- FT_PaintFormat format;
1326
-
1327
- union
1328
- {
1329
- FT_PaintColrLayers colr_layers;
1330
- FT_PaintGlyph glyph;
1331
- FT_PaintSolid solid;
1332
- FT_PaintLinearGradient linear_gradient;
1333
- FT_PaintRadialGradient radial_gradient;
1334
- FT_PaintSweepGradient sweep_gradient;
1335
- FT_PaintTransform transform;
1336
- FT_PaintTranslate translate;
1337
- FT_PaintScale scale;
1338
- FT_PaintRotate rotate;
1339
- FT_PaintSkew skew;
1340
- FT_PaintComposite composite;
1341
- FT_PaintColrGlyph colr_glyph;
1342
-
1343
- } u;
1344
-
1345
- } FT_COLR_Paint;
1346
-
1347
-
1348
- /**************************************************************************
1349
- *
1350
- * @enum:
1351
- * FT_Color_Root_Transform
1352
- *
1353
- * @description:
1354
- * An enumeration to specify whether @FT_Get_Color_Glyph_Paint is to
1355
- * return a root transform to configure the client's graphics context
1356
- * matrix.
1357
- *
1358
- * @values:
1359
- * FT_COLOR_INCLUDE_ROOT_TRANSFORM ::
1360
- * Do include the root transform as the initial @FT_COLR_Paint object.
1361
- *
1362
- * FT_COLOR_NO_ROOT_TRANSFORM ::
1363
- * Do not output an initial root transform.
1364
- *
1365
- * @since:
1366
- * 2.11 -- **currently experimental only!** There might be changes
1367
- * without retaining backward compatibility of both the API and ABI.
1368
- *
1369
- */
1370
- typedef enum FT_Color_Root_Transform_
1371
- {
1372
- FT_COLOR_INCLUDE_ROOT_TRANSFORM,
1373
- FT_COLOR_NO_ROOT_TRANSFORM,
1374
-
1375
- FT_COLOR_ROOT_TRANSFORM_MAX
1376
-
1377
- } FT_Color_Root_Transform;
1378
-
1379
-
1380
- /**************************************************************************
1381
- *
1382
- * @function:
1383
- * FT_Get_Color_Glyph_Paint
1384
- *
1385
- * @description:
1386
- * This is the starting point and interface to color gradient
1387
- * information in a 'COLR' v1 table in OpenType fonts to recursively
1388
- * retrieve the paint tables for the directed acyclic graph of a colored
1389
- * glyph, given a glyph ID.
1390
- *
1391
- * https://github.com/googlefonts/colr-gradients-spec
1392
- *
1393
- * In a 'COLR' v1 font, each color glyph defines a directed acyclic
1394
- * graph of nested paint tables, such as `PaintGlyph`, `PaintSolid`,
1395
- * `PaintLinearGradient`, `PaintRadialGradient`, and so on. Using this
1396
- * function and specifying a glyph ID, one retrieves the root paint
1397
- * table for this glyph ID.
1398
- *
1399
- * This function allows control whether an initial root transform is
1400
- * returned to configure scaling, transform, and translation correctly
1401
- * on the client's graphics context. The initial root transform is
1402
- * computed and returned according to the values configured for @FT_Size
1403
- * and @FT_Set_Transform on the @FT_Face object, see below for details
1404
- * of the `root_transform` parameter. This has implications for a
1405
- * client 'COLR' v1 implementation: When this function returns an
1406
- * initially computed root transform, at the time of executing the
1407
- * @FT_PaintGlyph operation, the contours should be retrieved using
1408
- * @FT_Load_Glyph at unscaled, untransformed size. This is because the
1409
- * root transform applied to the graphics context will take care of
1410
- * correct scaling.
1411
- *
1412
- * Alternatively, to allow hinting of contours, at the time of executing
1413
- * @FT_Load_Glyph, the current graphics context transformation matrix
1414
- * can be decomposed into a scaling matrix and a remainder, and
1415
- * @FT_Load_Glyph can be used to retrieve the contours at scaled size.
1416
- * Care must then be taken to blit or clip to the graphics context with
1417
- * taking this remainder transformation into account.
1418
- *
1419
- * @input:
1420
- * face ::
1421
- * A handle to the parent face object.
1422
- *
1423
- * base_glyph ::
1424
- * The glyph index for which to retrieve the root paint table.
1425
- *
1426
- * root_transform ::
1427
- * Specifies whether an initially computed root is returned by the
1428
- * @FT_PaintTransform operation to account for the activated size
1429
- * (see @FT_Activate_Size) and the configured transform and translate
1430
- * (see @FT_Set_Transform).
1431
- *
1432
- * This root transform is returned before nodes of the glyph graph of
1433
- * the font are returned. Subsequent @FT_COLR_Paint structures
1434
- * contain unscaled and untransformed values. The inserted root
1435
- * transform enables the client application to apply an initial
1436
- * transform to its graphics context. When executing subsequent
1437
- * FT_COLR_Paint operations, values from @FT_COLR_Paint operations
1438
- * will ultimately be correctly scaled because of the root transform
1439
- * applied to the graphics context. Use
1440
- * @FT_COLOR_INCLUDE_ROOT_TRANSFORM to include the root transform, use
1441
- * @FT_COLOR_NO_ROOT_TRANSFORM to not include it. The latter may be
1442
- * useful when traversing the 'COLR' v1 glyph graph and reaching a
1443
- * @FT_PaintColrGlyph. When recursing into @FT_PaintColrGlyph and
1444
- * painting that inline, no additional root transform is needed as it
1445
- * has already been applied to the graphics context at the beginning
1446
- * of drawing this glyph.
1447
- *
1448
- * @output:
1449
- * paint ::
1450
- * The @FT_OpaquePaint object that references the actual paint table.
1451
- *
1452
- * The respective actual @FT_COLR_Paint object is retrieved via
1453
- * @FT_Get_Paint.
1454
- *
1455
- * @return:
1456
- * Value~1 if everything is OK. If no color glyph is found, or the root
1457
- * paint could not be retrieved, value~0 gets returned. In case of an
1458
- * error, value~0 is returned also.
1459
- *
1460
- * @since:
1461
- * 2.11 -- **currently experimental only!** There might be changes
1462
- * without retaining backward compatibility of both the API and ABI.
1463
- *
1464
- */
1465
- FT_EXPORT( FT_Bool )
1466
- FT_Get_Color_Glyph_Paint( FT_Face face,
1467
- FT_UInt base_glyph,
1468
- FT_Color_Root_Transform root_transform,
1469
- FT_OpaquePaint* paint );
1470
-
1471
-
1472
- /**************************************************************************
1473
- *
1474
- * @function:
1475
- * FT_Get_Paint_Layers
1476
- *
1477
- * @description:
1478
- * Access the layers of a `PaintColrLayers` table.
1479
- *
1480
- * If the root paint of a color glyph, or a nested paint of a 'COLR'
1481
- * glyph is a `PaintColrLayers` table, this function retrieves the
1482
- * layers of the `PaintColrLayers` table.
1483
- *
1484
- * The @FT_PaintColrLayers object contains an @FT_LayerIterator, which
1485
- * is used here to iterate over the layers. Each layer is returned as
1486
- * an @FT_OpaquePaint object, which then can be used with @FT_Get_Paint
1487
- * to retrieve the actual paint object.
1488
- *
1489
- * @input:
1490
- * face ::
1491
- * A handle to the parent face object.
1492
- *
1493
- * @inout:
1494
- * iterator ::
1495
- * The @FT_LayerIterator from an @FT_PaintColrLayers object, for which
1496
- * the layers are to be retrieved. The internal state of the iterator
1497
- * is incremented after one call to this function for retrieving one
1498
- * layer.
1499
- *
1500
- * @output:
1501
- * paint ::
1502
- * The @FT_OpaquePaint object that references the actual paint table.
1503
- * The respective actual @FT_COLR_Paint object is retrieved via
1504
- * @FT_Get_Paint.
1505
- *
1506
- * @return:
1507
- * Value~1 if everything is OK. Value~0 gets returned when the paint
1508
- * object can not be retrieved or any other error occurs.
1509
- *
1510
- * @since:
1511
- * 2.11 -- **currently experimental only!** There might be changes
1512
- * without retaining backward compatibility of both the API and ABI.
1513
- *
1514
- */
1515
- FT_EXPORT( FT_Bool )
1516
- FT_Get_Paint_Layers( FT_Face face,
1517
- FT_LayerIterator* iterator,
1518
- FT_OpaquePaint* paint );
1519
-
1520
-
1521
- /**************************************************************************
1522
- *
1523
- * @function:
1524
- * FT_Get_Colorline_Stops
1525
- *
1526
- * @description:
1527
- * This is an interface to color gradient information in a 'COLR' v1
1528
- * table in OpenType fonts to iteratively retrieve the gradient and
1529
- * solid fill information for colored glyph layers for a specified glyph
1530
- * ID.
1531
- *
1532
- * https://github.com/googlefonts/colr-gradients-spec
1533
- *
1534
- * @input:
1535
- * face ::
1536
- * A handle to the parent face object.
1537
- *
1538
- * @inout:
1539
- * iterator ::
1540
- * The retrieved @FT_ColorStopIterator, configured on an @FT_ColorLine,
1541
- * which in turn got retrieved via paint information in
1542
- * @FT_PaintLinearGradient or @FT_PaintRadialGradient.
1543
- *
1544
- * @output:
1545
- * color_stop ::
1546
- * Color index and alpha value for the retrieved color stop.
1547
- *
1548
- * @return:
1549
- * Value~1 if everything is OK. If there are no more color stops,
1550
- * value~0 gets returned. In case of an error, value~0 is returned
1551
- * also.
1552
- *
1553
- * @since:
1554
- * 2.11 -- **currently experimental only!** There might be changes
1555
- * without retaining backward compatibility of both the API and ABI.
1556
- *
1557
- */
1558
- FT_EXPORT( FT_Bool )
1559
- FT_Get_Colorline_Stops( FT_Face face,
1560
- FT_ColorStop* color_stop,
1561
- FT_ColorStopIterator* iterator );
1562
-
1563
-
1564
- /**************************************************************************
1565
- *
1566
- * @function:
1567
- * FT_Get_Paint
1568
- *
1569
- * @description:
1570
- * Access the details of a paint using an @FT_OpaquePaint opaque paint
1571
- * object, which internally stores the offset to the respective `Paint`
1572
- * object in the 'COLR' table.
1573
- *
1574
- * @input:
1575
- * face ::
1576
- * A handle to the parent face object.
1577
- *
1578
- * opaque_paint ::
1579
- * The opaque paint object for which the underlying @FT_COLR_Paint
1580
- * data is to be retrieved.
1581
- *
1582
- * @output:
1583
- * paint ::
1584
- * The specific @FT_COLR_Paint object containing information coming
1585
- * from one of the font's `Paint*` tables.
1586
- *
1587
- * @return:
1588
- * Value~1 if everything is OK. Value~0 if no details can be found for
1589
- * this paint or any other error occured.
1590
- *
1591
- * @since:
1592
- * 2.11 -- **currently experimental only!** There might be changes
1593
- * without retaining backward compatibility of both the API and ABI.
1594
- *
1595
- */
1596
- FT_EXPORT( FT_Bool )
1597
- FT_Get_Paint( FT_Face face,
1598
- FT_OpaquePaint opaque_paint,
1599
- FT_COLR_Paint* paint );
1600
-
1601
- /* */
1602
-
1603
-
1604
- FT_END_HEADER
1605
-
1606
- #endif /* FTCOLOR_H_ */
1607
-
1608
-
1609
- /* END */