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,1276 +0,0 @@
1
- /****************************************************************************
2
- *
3
- * ftimage.h
4
- *
5
- * FreeType glyph image formats and default raster interface
6
- * (specification).
7
- *
8
- * Copyright (C) 1996-2021 by
9
- * David Turner, Robert Wilhelm, and Werner Lemberg.
10
- *
11
- * This file is part of the FreeType project, and may only be used,
12
- * modified, and distributed under the terms of the FreeType project
13
- * license, LICENSE.TXT. By continuing to use, modify, or distribute
14
- * this file you indicate that you have read the license and
15
- * understand and accept it fully.
16
- *
17
- */
18
-
19
- /**************************************************************************
20
- *
21
- * Note: A 'raster' is simply a scan-line converter, used to render
22
- * FT_Outlines into FT_Bitmaps.
23
- *
24
- */
25
-
26
-
27
- #ifndef FTIMAGE_H_
28
- #define FTIMAGE_H_
29
-
30
-
31
- /* STANDALONE_ is from ftgrays.c */
32
- #ifndef STANDALONE_
33
- #endif
34
-
35
-
36
- FT_BEGIN_HEADER
37
-
38
-
39
- /**************************************************************************
40
- *
41
- * @section:
42
- * basic_types
43
- *
44
- */
45
-
46
-
47
- /**************************************************************************
48
- *
49
- * @type:
50
- * FT_Pos
51
- *
52
- * @description:
53
- * The type FT_Pos is used to store vectorial coordinates. Depending on
54
- * the context, these can represent distances in integer font units, or
55
- * 16.16, or 26.6 fixed-point pixel coordinates.
56
- */
57
- typedef signed long FT_Pos;
58
-
59
-
60
- /**************************************************************************
61
- *
62
- * @struct:
63
- * FT_Vector
64
- *
65
- * @description:
66
- * A simple structure used to store a 2D vector; coordinates are of the
67
- * FT_Pos type.
68
- *
69
- * @fields:
70
- * x ::
71
- * The horizontal coordinate.
72
- * y ::
73
- * The vertical coordinate.
74
- */
75
- typedef struct FT_Vector_
76
- {
77
- FT_Pos x;
78
- FT_Pos y;
79
-
80
- } FT_Vector;
81
-
82
-
83
- /**************************************************************************
84
- *
85
- * @struct:
86
- * FT_BBox
87
- *
88
- * @description:
89
- * A structure used to hold an outline's bounding box, i.e., the
90
- * coordinates of its extrema in the horizontal and vertical directions.
91
- *
92
- * @fields:
93
- * xMin ::
94
- * The horizontal minimum (left-most).
95
- *
96
- * yMin ::
97
- * The vertical minimum (bottom-most).
98
- *
99
- * xMax ::
100
- * The horizontal maximum (right-most).
101
- *
102
- * yMax ::
103
- * The vertical maximum (top-most).
104
- *
105
- * @note:
106
- * The bounding box is specified with the coordinates of the lower left
107
- * and the upper right corner. In PostScript, those values are often
108
- * called (llx,lly) and (urx,ury), respectively.
109
- *
110
- * If `yMin` is negative, this value gives the glyph's descender.
111
- * Otherwise, the glyph doesn't descend below the baseline. Similarly,
112
- * if `ymax` is positive, this value gives the glyph's ascender.
113
- *
114
- * `xMin` gives the horizontal distance from the glyph's origin to the
115
- * left edge of the glyph's bounding box. If `xMin` is negative, the
116
- * glyph extends to the left of the origin.
117
- */
118
- typedef struct FT_BBox_
119
- {
120
- FT_Pos xMin, yMin;
121
- FT_Pos xMax, yMax;
122
-
123
- } FT_BBox;
124
-
125
-
126
- /**************************************************************************
127
- *
128
- * @enum:
129
- * FT_Pixel_Mode
130
- *
131
- * @description:
132
- * An enumeration type used to describe the format of pixels in a given
133
- * bitmap. Note that additional formats may be added in the future.
134
- *
135
- * @values:
136
- * FT_PIXEL_MODE_NONE ::
137
- * Value~0 is reserved.
138
- *
139
- * FT_PIXEL_MODE_MONO ::
140
- * A monochrome bitmap, using 1~bit per pixel. Note that pixels are
141
- * stored in most-significant order (MSB), which means that the
142
- * left-most pixel in a byte has value 128.
143
- *
144
- * FT_PIXEL_MODE_GRAY ::
145
- * An 8-bit bitmap, generally used to represent anti-aliased glyph
146
- * images. Each pixel is stored in one byte. Note that the number of
147
- * 'gray' levels is stored in the `num_grays` field of the @FT_Bitmap
148
- * structure (it generally is 256).
149
- *
150
- * FT_PIXEL_MODE_GRAY2 ::
151
- * A 2-bit per pixel bitmap, used to represent embedded anti-aliased
152
- * bitmaps in font files according to the OpenType specification. We
153
- * haven't found a single font using this format, however.
154
- *
155
- * FT_PIXEL_MODE_GRAY4 ::
156
- * A 4-bit per pixel bitmap, representing embedded anti-aliased bitmaps
157
- * in font files according to the OpenType specification. We haven't
158
- * found a single font using this format, however.
159
- *
160
- * FT_PIXEL_MODE_LCD ::
161
- * An 8-bit bitmap, representing RGB or BGR decimated glyph images used
162
- * for display on LCD displays; the bitmap is three times wider than
163
- * the original glyph image. See also @FT_RENDER_MODE_LCD.
164
- *
165
- * FT_PIXEL_MODE_LCD_V ::
166
- * An 8-bit bitmap, representing RGB or BGR decimated glyph images used
167
- * for display on rotated LCD displays; the bitmap is three times
168
- * taller than the original glyph image. See also
169
- * @FT_RENDER_MODE_LCD_V.
170
- *
171
- * FT_PIXEL_MODE_BGRA ::
172
- * [Since 2.5] An image with four 8-bit channels per pixel,
173
- * representing a color image (such as emoticons) with alpha channel.
174
- * For each pixel, the format is BGRA, which means, the blue channel
175
- * comes first in memory. The color channels are pre-multiplied and in
176
- * the sRGB colorspace. For example, full red at half-translucent
177
- * opacity will be represented as '00,00,80,80', not '00,00,FF,80'.
178
- * See also @FT_LOAD_COLOR.
179
- */
180
- typedef enum FT_Pixel_Mode_
181
- {
182
- FT_PIXEL_MODE_NONE = 0,
183
- FT_PIXEL_MODE_MONO,
184
- FT_PIXEL_MODE_GRAY,
185
- FT_PIXEL_MODE_GRAY2,
186
- FT_PIXEL_MODE_GRAY4,
187
- FT_PIXEL_MODE_LCD,
188
- FT_PIXEL_MODE_LCD_V,
189
- FT_PIXEL_MODE_BGRA,
190
-
191
- FT_PIXEL_MODE_MAX /* do not remove */
192
-
193
- } FT_Pixel_Mode;
194
-
195
-
196
- /* these constants are deprecated; use the corresponding `FT_Pixel_Mode` */
197
- /* values instead. */
198
- #define ft_pixel_mode_none FT_PIXEL_MODE_NONE
199
- #define ft_pixel_mode_mono FT_PIXEL_MODE_MONO
200
- #define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY
201
- #define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
202
- #define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4
203
-
204
- /* */
205
-
206
- /* For debugging, the @FT_Pixel_Mode enumeration must stay in sync */
207
- /* with the `pixel_modes` array in file `ftobjs.c`. */
208
-
209
-
210
- /**************************************************************************
211
- *
212
- * @struct:
213
- * FT_Bitmap
214
- *
215
- * @description:
216
- * A structure used to describe a bitmap or pixmap to the raster. Note
217
- * that we now manage pixmaps of various depths through the `pixel_mode`
218
- * field.
219
- *
220
- * @fields:
221
- * rows ::
222
- * The number of bitmap rows.
223
- *
224
- * width ::
225
- * The number of pixels in bitmap row.
226
- *
227
- * pitch ::
228
- * The pitch's absolute value is the number of bytes taken by one
229
- * bitmap row, including padding. However, the pitch is positive when
230
- * the bitmap has a 'down' flow, and negative when it has an 'up' flow.
231
- * In all cases, the pitch is an offset to add to a bitmap pointer in
232
- * order to go down one row.
233
- *
234
- * Note that 'padding' means the alignment of a bitmap to a byte
235
- * border, and FreeType functions normally align to the smallest
236
- * possible integer value.
237
- *
238
- * For the B/W rasterizer, `pitch` is always an even number.
239
- *
240
- * To change the pitch of a bitmap (say, to make it a multiple of 4),
241
- * use @FT_Bitmap_Convert. Alternatively, you might use callback
242
- * functions to directly render to the application's surface; see the
243
- * file `example2.cpp` in the tutorial for a demonstration.
244
- *
245
- * buffer ::
246
- * A typeless pointer to the bitmap buffer. This value should be
247
- * aligned on 32-bit boundaries in most cases.
248
- *
249
- * num_grays ::
250
- * This field is only used with @FT_PIXEL_MODE_GRAY; it gives the
251
- * number of gray levels used in the bitmap.
252
- *
253
- * pixel_mode ::
254
- * The pixel mode, i.e., how pixel bits are stored. See @FT_Pixel_Mode
255
- * for possible values.
256
- *
257
- * palette_mode ::
258
- * This field is intended for paletted pixel modes; it indicates how
259
- * the palette is stored. Not used currently.
260
- *
261
- * palette ::
262
- * A typeless pointer to the bitmap palette; this field is intended for
263
- * paletted pixel modes. Not used currently.
264
- */
265
- typedef struct FT_Bitmap_
266
- {
267
- unsigned int rows;
268
- unsigned int width;
269
- int pitch;
270
- unsigned char* buffer;
271
- unsigned short num_grays;
272
- unsigned char pixel_mode;
273
- unsigned char palette_mode;
274
- void* palette;
275
-
276
- } FT_Bitmap;
277
-
278
-
279
- /**************************************************************************
280
- *
281
- * @section:
282
- * outline_processing
283
- *
284
- */
285
-
286
-
287
- /**************************************************************************
288
- *
289
- * @struct:
290
- * FT_Outline
291
- *
292
- * @description:
293
- * This structure is used to describe an outline to the scan-line
294
- * converter.
295
- *
296
- * @fields:
297
- * n_contours ::
298
- * The number of contours in the outline.
299
- *
300
- * n_points ::
301
- * The number of points in the outline.
302
- *
303
- * points ::
304
- * A pointer to an array of `n_points` @FT_Vector elements, giving the
305
- * outline's point coordinates.
306
- *
307
- * tags ::
308
- * A pointer to an array of `n_points` chars, giving each outline
309
- * point's type.
310
- *
311
- * If bit~0 is unset, the point is 'off' the curve, i.e., a Bezier
312
- * control point, while it is 'on' if set.
313
- *
314
- * Bit~1 is meaningful for 'off' points only. If set, it indicates a
315
- * third-order Bezier arc control point; and a second-order control
316
- * point if unset.
317
- *
318
- * If bit~2 is set, bits 5-7 contain the drop-out mode (as defined in
319
- * the OpenType specification; the value is the same as the argument to
320
- * the 'SCANMODE' instruction).
321
- *
322
- * Bits 3 and~4 are reserved for internal purposes.
323
- *
324
- * contours ::
325
- * An array of `n_contours` shorts, giving the end point of each
326
- * contour within the outline. For example, the first contour is
327
- * defined by the points '0' to `contours[0]`, the second one is
328
- * defined by the points `contours[0]+1` to `contours[1]`, etc.
329
- *
330
- * flags ::
331
- * A set of bit flags used to characterize the outline and give hints
332
- * to the scan-converter and hinter on how to convert/grid-fit it. See
333
- * @FT_OUTLINE_XXX.
334
- *
335
- * @note:
336
- * The B/W rasterizer only checks bit~2 in the `tags` array for the first
337
- * point of each contour. The drop-out mode as given with
338
- * @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and
339
- * @FT_OUTLINE_INCLUDE_STUBS in `flags` is then overridden.
340
- */
341
- typedef struct FT_Outline_
342
- {
343
- short n_contours; /* number of contours in glyph */
344
- short n_points; /* number of points in the glyph */
345
-
346
- FT_Vector* points; /* the outline's points */
347
- char* tags; /* the points flags */
348
- short* contours; /* the contour end points */
349
-
350
- int flags; /* outline masks */
351
-
352
- } FT_Outline;
353
-
354
- /* */
355
-
356
- /* Following limits must be consistent with */
357
- /* FT_Outline.{n_contours,n_points} */
358
- #define FT_OUTLINE_CONTOURS_MAX SHRT_MAX
359
- #define FT_OUTLINE_POINTS_MAX SHRT_MAX
360
-
361
-
362
- /**************************************************************************
363
- *
364
- * @enum:
365
- * FT_OUTLINE_XXX
366
- *
367
- * @description:
368
- * A list of bit-field constants used for the flags in an outline's
369
- * `flags` field.
370
- *
371
- * @values:
372
- * FT_OUTLINE_NONE ::
373
- * Value~0 is reserved.
374
- *
375
- * FT_OUTLINE_OWNER ::
376
- * If set, this flag indicates that the outline's field arrays (i.e.,
377
- * `points`, `flags`, and `contours`) are 'owned' by the outline
378
- * object, and should thus be freed when it is destroyed.
379
- *
380
- * FT_OUTLINE_EVEN_ODD_FILL ::
381
- * By default, outlines are filled using the non-zero winding rule. If
382
- * set to 1, the outline will be filled using the even-odd fill rule
383
- * (only works with the smooth rasterizer).
384
- *
385
- * FT_OUTLINE_REVERSE_FILL ::
386
- * By default, outside contours of an outline are oriented in
387
- * clock-wise direction, as defined in the TrueType specification.
388
- * This flag is set if the outline uses the opposite direction
389
- * (typically for Type~1 fonts). This flag is ignored by the scan
390
- * converter.
391
- *
392
- * FT_OUTLINE_IGNORE_DROPOUTS ::
393
- * By default, the scan converter will try to detect drop-outs in an
394
- * outline and correct the glyph bitmap to ensure consistent shape
395
- * continuity. If set, this flag hints the scan-line converter to
396
- * ignore such cases. See below for more information.
397
- *
398
- * FT_OUTLINE_SMART_DROPOUTS ::
399
- * Select smart dropout control. If unset, use simple dropout control.
400
- * Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more
401
- * information.
402
- *
403
- * FT_OUTLINE_INCLUDE_STUBS ::
404
- * If set, turn pixels on for 'stubs', otherwise exclude them. Ignored
405
- * if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more
406
- * information.
407
- *
408
- * FT_OUTLINE_OVERLAP ::
409
- * This flag indicates that this outline contains overlapping contrours
410
- * and the anti-aliased renderer should perform oversampling to
411
- * mitigate possible artifacts. This flag should _not_ be set for
412
- * well designed glyphs without overlaps because it quadruples the
413
- * rendering time.
414
- *
415
- * FT_OUTLINE_HIGH_PRECISION ::
416
- * This flag indicates that the scan-line converter should try to
417
- * convert this outline to bitmaps with the highest possible quality.
418
- * It is typically set for small character sizes. Note that this is
419
- * only a hint that might be completely ignored by a given
420
- * scan-converter.
421
- *
422
- * FT_OUTLINE_SINGLE_PASS ::
423
- * This flag is set to force a given scan-converter to only use a
424
- * single pass over the outline to render a bitmap glyph image.
425
- * Normally, it is set for very large character sizes. It is only a
426
- * hint that might be completely ignored by a given scan-converter.
427
- *
428
- * @note:
429
- * The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and
430
- * @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth rasterizer.
431
- *
432
- * There exists a second mechanism to pass the drop-out mode to the B/W
433
- * rasterizer; see the `tags` field in @FT_Outline.
434
- *
435
- * Please refer to the description of the 'SCANTYPE' instruction in the
436
- * OpenType specification (in file `ttinst1.doc`) how simple drop-outs,
437
- * smart drop-outs, and stubs are defined.
438
- */
439
- #define FT_OUTLINE_NONE 0x0
440
- #define FT_OUTLINE_OWNER 0x1
441
- #define FT_OUTLINE_EVEN_ODD_FILL 0x2
442
- #define FT_OUTLINE_REVERSE_FILL 0x4
443
- #define FT_OUTLINE_IGNORE_DROPOUTS 0x8
444
- #define FT_OUTLINE_SMART_DROPOUTS 0x10
445
- #define FT_OUTLINE_INCLUDE_STUBS 0x20
446
- #define FT_OUTLINE_OVERLAP 0x40
447
-
448
- #define FT_OUTLINE_HIGH_PRECISION 0x100
449
- #define FT_OUTLINE_SINGLE_PASS 0x200
450
-
451
-
452
- /* these constants are deprecated; use the corresponding */
453
- /* `FT_OUTLINE_XXX` values instead */
454
- #define ft_outline_none FT_OUTLINE_NONE
455
- #define ft_outline_owner FT_OUTLINE_OWNER
456
- #define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL
457
- #define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL
458
- #define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS
459
- #define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION
460
- #define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS
461
-
462
- /* */
463
-
464
- #define FT_CURVE_TAG( flag ) ( flag & 0x03 )
465
-
466
- /* see the `tags` field in `FT_Outline` for a description of the values */
467
- #define FT_CURVE_TAG_ON 0x01
468
- #define FT_CURVE_TAG_CONIC 0x00
469
- #define FT_CURVE_TAG_CUBIC 0x02
470
-
471
- #define FT_CURVE_TAG_HAS_SCANMODE 0x04
472
-
473
- #define FT_CURVE_TAG_TOUCH_X 0x08 /* reserved for TrueType hinter */
474
- #define FT_CURVE_TAG_TOUCH_Y 0x10 /* reserved for TrueType hinter */
475
-
476
- #define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \
477
- FT_CURVE_TAG_TOUCH_Y )
478
- /* values 0x20, 0x40, and 0x80 are reserved */
479
-
480
-
481
- /* these constants are deprecated; use the corresponding */
482
- /* `FT_CURVE_TAG_XXX` values instead */
483
- #define FT_Curve_Tag_On FT_CURVE_TAG_ON
484
- #define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC
485
- #define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC
486
- #define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X
487
- #define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y
488
-
489
-
490
- /**************************************************************************
491
- *
492
- * @functype:
493
- * FT_Outline_MoveToFunc
494
- *
495
- * @description:
496
- * A function pointer type used to describe the signature of a 'move to'
497
- * function during outline walking/decomposition.
498
- *
499
- * A 'move to' is emitted to start a new contour in an outline.
500
- *
501
- * @input:
502
- * to ::
503
- * A pointer to the target point of the 'move to'.
504
- *
505
- * user ::
506
- * A typeless pointer, which is passed from the caller of the
507
- * decomposition function.
508
- *
509
- * @return:
510
- * Error code. 0~means success.
511
- */
512
- typedef int
513
- (*FT_Outline_MoveToFunc)( const FT_Vector* to,
514
- void* user );
515
-
516
- #define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc
517
-
518
-
519
- /**************************************************************************
520
- *
521
- * @functype:
522
- * FT_Outline_LineToFunc
523
- *
524
- * @description:
525
- * A function pointer type used to describe the signature of a 'line to'
526
- * function during outline walking/decomposition.
527
- *
528
- * A 'line to' is emitted to indicate a segment in the outline.
529
- *
530
- * @input:
531
- * to ::
532
- * A pointer to the target point of the 'line to'.
533
- *
534
- * user ::
535
- * A typeless pointer, which is passed from the caller of the
536
- * decomposition function.
537
- *
538
- * @return:
539
- * Error code. 0~means success.
540
- */
541
- typedef int
542
- (*FT_Outline_LineToFunc)( const FT_Vector* to,
543
- void* user );
544
-
545
- #define FT_Outline_LineTo_Func FT_Outline_LineToFunc
546
-
547
-
548
- /**************************************************************************
549
- *
550
- * @functype:
551
- * FT_Outline_ConicToFunc
552
- *
553
- * @description:
554
- * A function pointer type used to describe the signature of a 'conic to'
555
- * function during outline walking or decomposition.
556
- *
557
- * A 'conic to' is emitted to indicate a second-order Bezier arc in the
558
- * outline.
559
- *
560
- * @input:
561
- * control ::
562
- * An intermediate control point between the last position and the new
563
- * target in `to`.
564
- *
565
- * to ::
566
- * A pointer to the target end point of the conic arc.
567
- *
568
- * user ::
569
- * A typeless pointer, which is passed from the caller of the
570
- * decomposition function.
571
- *
572
- * @return:
573
- * Error code. 0~means success.
574
- */
575
- typedef int
576
- (*FT_Outline_ConicToFunc)( const FT_Vector* control,
577
- const FT_Vector* to,
578
- void* user );
579
-
580
- #define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc
581
-
582
-
583
- /**************************************************************************
584
- *
585
- * @functype:
586
- * FT_Outline_CubicToFunc
587
- *
588
- * @description:
589
- * A function pointer type used to describe the signature of a 'cubic to'
590
- * function during outline walking or decomposition.
591
- *
592
- * A 'cubic to' is emitted to indicate a third-order Bezier arc.
593
- *
594
- * @input:
595
- * control1 ::
596
- * A pointer to the first Bezier control point.
597
- *
598
- * control2 ::
599
- * A pointer to the second Bezier control point.
600
- *
601
- * to ::
602
- * A pointer to the target end point.
603
- *
604
- * user ::
605
- * A typeless pointer, which is passed from the caller of the
606
- * decomposition function.
607
- *
608
- * @return:
609
- * Error code. 0~means success.
610
- */
611
- typedef int
612
- (*FT_Outline_CubicToFunc)( const FT_Vector* control1,
613
- const FT_Vector* control2,
614
- const FT_Vector* to,
615
- void* user );
616
-
617
- #define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc
618
-
619
-
620
- /**************************************************************************
621
- *
622
- * @struct:
623
- * FT_Outline_Funcs
624
- *
625
- * @description:
626
- * A structure to hold various function pointers used during outline
627
- * decomposition in order to emit segments, conic, and cubic Beziers.
628
- *
629
- * @fields:
630
- * move_to ::
631
- * The 'move to' emitter.
632
- *
633
- * line_to ::
634
- * The segment emitter.
635
- *
636
- * conic_to ::
637
- * The second-order Bezier arc emitter.
638
- *
639
- * cubic_to ::
640
- * The third-order Bezier arc emitter.
641
- *
642
- * shift ::
643
- * The shift that is applied to coordinates before they are sent to the
644
- * emitter.
645
- *
646
- * delta ::
647
- * The delta that is applied to coordinates before they are sent to the
648
- * emitter, but after the shift.
649
- *
650
- * @note:
651
- * The point coordinates sent to the emitters are the transformed version
652
- * of the original coordinates (this is important for high accuracy
653
- * during scan-conversion). The transformation is simple:
654
- *
655
- * ```
656
- * x' = (x << shift) - delta
657
- * y' = (y << shift) - delta
658
- * ```
659
- *
660
- * Set the values of `shift` and `delta` to~0 to get the original point
661
- * coordinates.
662
- */
663
- typedef struct FT_Outline_Funcs_
664
- {
665
- FT_Outline_MoveToFunc move_to;
666
- FT_Outline_LineToFunc line_to;
667
- FT_Outline_ConicToFunc conic_to;
668
- FT_Outline_CubicToFunc cubic_to;
669
-
670
- int shift;
671
- FT_Pos delta;
672
-
673
- } FT_Outline_Funcs;
674
-
675
-
676
- /**************************************************************************
677
- *
678
- * @section:
679
- * basic_types
680
- *
681
- */
682
-
683
-
684
- /**************************************************************************
685
- *
686
- * @macro:
687
- * FT_IMAGE_TAG
688
- *
689
- * @description:
690
- * This macro converts four-letter tags to an unsigned long type.
691
- *
692
- * @note:
693
- * Since many 16-bit compilers don't like 32-bit enumerations, you should
694
- * redefine this macro in case of problems to something like this:
695
- *
696
- * ```
697
- * #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value
698
- * ```
699
- *
700
- * to get a simple enumeration without assigning special numbers.
701
- */
702
- #ifndef FT_IMAGE_TAG
703
- #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
704
- value = ( ( (unsigned long)_x1 << 24 ) | \
705
- ( (unsigned long)_x2 << 16 ) | \
706
- ( (unsigned long)_x3 << 8 ) | \
707
- (unsigned long)_x4 )
708
- #endif /* FT_IMAGE_TAG */
709
-
710
-
711
- /**************************************************************************
712
- *
713
- * @enum:
714
- * FT_Glyph_Format
715
- *
716
- * @description:
717
- * An enumeration type used to describe the format of a given glyph
718
- * image. Note that this version of FreeType only supports two image
719
- * formats, even though future font drivers will be able to register
720
- * their own format.
721
- *
722
- * @values:
723
- * FT_GLYPH_FORMAT_NONE ::
724
- * The value~0 is reserved.
725
- *
726
- * FT_GLYPH_FORMAT_COMPOSITE ::
727
- * The glyph image is a composite of several other images. This format
728
- * is _only_ used with @FT_LOAD_NO_RECURSE, and is used to report
729
- * compound glyphs (like accented characters).
730
- *
731
- * FT_GLYPH_FORMAT_BITMAP ::
732
- * The glyph image is a bitmap, and can be described as an @FT_Bitmap.
733
- * You generally need to access the `bitmap` field of the
734
- * @FT_GlyphSlotRec structure to read it.
735
- *
736
- * FT_GLYPH_FORMAT_OUTLINE ::
737
- * The glyph image is a vectorial outline made of line segments and
738
- * Bezier arcs; it can be described as an @FT_Outline; you generally
739
- * want to access the `outline` field of the @FT_GlyphSlotRec structure
740
- * to read it.
741
- *
742
- * FT_GLYPH_FORMAT_PLOTTER ::
743
- * The glyph image is a vectorial path with no inside and outside
744
- * contours. Some Type~1 fonts, like those in the Hershey family,
745
- * contain glyphs in this format. These are described as @FT_Outline,
746
- * but FreeType isn't currently capable of rendering them correctly.
747
- */
748
- typedef enum FT_Glyph_Format_
749
- {
750
- FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),
751
-
752
- FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
753
- FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP, 'b', 'i', 't', 's' ),
754
- FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ),
755
- FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' )
756
-
757
- } FT_Glyph_Format;
758
-
759
-
760
- /* these constants are deprecated; use the corresponding */
761
- /* `FT_Glyph_Format` values instead. */
762
- #define ft_glyph_format_none FT_GLYPH_FORMAT_NONE
763
- #define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE
764
- #define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP
765
- #define ft_glyph_format_outline FT_GLYPH_FORMAT_OUTLINE
766
- #define ft_glyph_format_plotter FT_GLYPH_FORMAT_PLOTTER
767
-
768
-
769
- /*************************************************************************/
770
- /*************************************************************************/
771
- /*************************************************************************/
772
- /***** *****/
773
- /***** R A S T E R D E F I N I T I O N S *****/
774
- /***** *****/
775
- /*************************************************************************/
776
- /*************************************************************************/
777
- /*************************************************************************/
778
-
779
-
780
-
781
- /**************************************************************************
782
- *
783
- * @section:
784
- * raster
785
- *
786
- * @title:
787
- * Scanline Converter
788
- *
789
- * @abstract:
790
- * How vectorial outlines are converted into bitmaps and pixmaps.
791
- *
792
- * @description:
793
- * A raster or a rasterizer is a scan converter in charge of producing a
794
- * pixel coverage bitmap that can be used as an alpha channel when
795
- * compositing a glyph with a background. FreeType comes with two
796
- * rasterizers: bilevel `raster1` and anti-aliased `smooth` are two
797
- * separate modules. They are usually called from the high-level
798
- * @FT_Load_Glyph or @FT_Render_Glyph functions and produce the entire
799
- * coverage bitmap at once, while staying largely invisible to users.
800
- *
801
- * Instead of working with complete coverage bitmaps, it is also possible
802
- * to intercept consecutive pixel runs on the same scanline with the same
803
- * coverage, called _spans_, and process them individually. Only the
804
- * `smooth` rasterizer permits this when calling @FT_Outline_Render with
805
- * @FT_Raster_Params as described below.
806
- *
807
- * Working with either complete bitmaps or spans it is important to think
808
- * of them as colorless coverage objects suitable as alpha channels to
809
- * blend arbitrary colors with a background. For best results, it is
810
- * recommended to use gamma correction, too.
811
- *
812
- * This section also describes the public API needed to set up alternative
813
- * @FT_Renderer modules.
814
- *
815
- * @order:
816
- * FT_Span
817
- * FT_SpanFunc
818
- * FT_Raster_Params
819
- * FT_RASTER_FLAG_XXX
820
- *
821
- * FT_Raster
822
- * FT_Raster_NewFunc
823
- * FT_Raster_DoneFunc
824
- * FT_Raster_ResetFunc
825
- * FT_Raster_SetModeFunc
826
- * FT_Raster_RenderFunc
827
- * FT_Raster_Funcs
828
- *
829
- */
830
-
831
-
832
- /**************************************************************************
833
- *
834
- * @struct:
835
- * FT_Span
836
- *
837
- * @description:
838
- * A structure to model a single span of consecutive pixels when
839
- * rendering an anti-aliased bitmap.
840
- *
841
- * @fields:
842
- * x ::
843
- * The span's horizontal start position.
844
- *
845
- * len ::
846
- * The span's length in pixels.
847
- *
848
- * coverage ::
849
- * The span color/coverage, ranging from 0 (background) to 255
850
- * (foreground).
851
- *
852
- * @note:
853
- * This structure is used by the span drawing callback type named
854
- * @FT_SpanFunc that takes the y~coordinate of the span as a parameter.
855
- *
856
- * The anti-aliased rasterizer produces coverage values from 0 to 255,
857
- * this is, from completely transparent to completely opaque.
858
- */
859
- typedef struct FT_Span_
860
- {
861
- short x;
862
- unsigned short len;
863
- unsigned char coverage;
864
-
865
- } FT_Span;
866
-
867
-
868
- /**************************************************************************
869
- *
870
- * @functype:
871
- * FT_SpanFunc
872
- *
873
- * @description:
874
- * A function used as a call-back by the anti-aliased renderer in order
875
- * to let client applications draw themselves the pixel spans on each
876
- * scan line.
877
- *
878
- * @input:
879
- * y ::
880
- * The scanline's upward y~coordinate.
881
- *
882
- * count ::
883
- * The number of spans to draw on this scanline.
884
- *
885
- * spans ::
886
- * A table of `count` spans to draw on the scanline.
887
- *
888
- * user ::
889
- * User-supplied data that is passed to the callback.
890
- *
891
- * @note:
892
- * This callback allows client applications to directly render the spans
893
- * of the anti-aliased bitmap to any kind of surfaces.
894
- *
895
- * This can be used to write anti-aliased outlines directly to a given
896
- * background bitmap using alpha compositing. It can also be used for
897
- * oversampling and averaging.
898
- */
899
- typedef void
900
- (*FT_SpanFunc)( int y,
901
- int count,
902
- const FT_Span* spans,
903
- void* user );
904
-
905
- #define FT_Raster_Span_Func FT_SpanFunc
906
-
907
-
908
- /**************************************************************************
909
- *
910
- * @functype:
911
- * FT_Raster_BitTest_Func
912
- *
913
- * @description:
914
- * Deprecated, unimplemented.
915
- */
916
- typedef int
917
- (*FT_Raster_BitTest_Func)( int y,
918
- int x,
919
- void* user );
920
-
921
-
922
- /**************************************************************************
923
- *
924
- * @functype:
925
- * FT_Raster_BitSet_Func
926
- *
927
- * @description:
928
- * Deprecated, unimplemented.
929
- */
930
- typedef void
931
- (*FT_Raster_BitSet_Func)( int y,
932
- int x,
933
- void* user );
934
-
935
-
936
- /**************************************************************************
937
- *
938
- * @enum:
939
- * FT_RASTER_FLAG_XXX
940
- *
941
- * @description:
942
- * A list of bit flag constants as used in the `flags` field of a
943
- * @FT_Raster_Params structure.
944
- *
945
- * @values:
946
- * FT_RASTER_FLAG_DEFAULT ::
947
- * This value is 0.
948
- *
949
- * FT_RASTER_FLAG_AA ::
950
- * This flag is set to indicate that an anti-aliased glyph image should
951
- * be generated. Otherwise, it will be monochrome (1-bit).
952
- *
953
- * FT_RASTER_FLAG_DIRECT ::
954
- * This flag is set to indicate direct rendering. In this mode, client
955
- * applications must provide their own span callback. This lets them
956
- * directly draw or compose over an existing bitmap. If this bit is
957
- * _not_ set, the target pixmap's buffer _must_ be zeroed before
958
- * rendering and the output will be clipped to its size.
959
- *
960
- * Direct rendering is only possible with anti-aliased glyphs.
961
- *
962
- * FT_RASTER_FLAG_CLIP ::
963
- * This flag is only used in direct rendering mode. If set, the output
964
- * will be clipped to a box specified in the `clip_box` field of the
965
- * @FT_Raster_Params structure. Otherwise, the `clip_box` is
966
- * effectively set to the bounding box and all spans are generated.
967
- *
968
- * FT_RASTER_FLAG_SDF ::
969
- * This flag is set to indicate that a signed distance field glyph
970
- * image should be generated. This is only used while rendering with
971
- * the @FT_RENDER_MODE_SDF render mode.
972
- */
973
- #define FT_RASTER_FLAG_DEFAULT 0x0
974
- #define FT_RASTER_FLAG_AA 0x1
975
- #define FT_RASTER_FLAG_DIRECT 0x2
976
- #define FT_RASTER_FLAG_CLIP 0x4
977
- #define FT_RASTER_FLAG_SDF 0x8
978
-
979
- /* these constants are deprecated; use the corresponding */
980
- /* `FT_RASTER_FLAG_XXX` values instead */
981
- #define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT
982
- #define ft_raster_flag_aa FT_RASTER_FLAG_AA
983
- #define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT
984
- #define ft_raster_flag_clip FT_RASTER_FLAG_CLIP
985
-
986
-
987
- /**************************************************************************
988
- *
989
- * @struct:
990
- * FT_Raster_Params
991
- *
992
- * @description:
993
- * A structure to hold the parameters used by a raster's render function,
994
- * passed as an argument to @FT_Outline_Render.
995
- *
996
- * @fields:
997
- * target ::
998
- * The target bitmap.
999
- *
1000
- * source ::
1001
- * A pointer to the source glyph image (e.g., an @FT_Outline).
1002
- *
1003
- * flags ::
1004
- * The rendering flags.
1005
- *
1006
- * gray_spans ::
1007
- * The gray span drawing callback.
1008
- *
1009
- * black_spans ::
1010
- * Unused.
1011
- *
1012
- * bit_test ::
1013
- * Unused.
1014
- *
1015
- * bit_set ::
1016
- * Unused.
1017
- *
1018
- * user ::
1019
- * User-supplied data that is passed to each drawing callback.
1020
- *
1021
- * clip_box ::
1022
- * An optional span clipping box expressed in _integer_ pixels
1023
- * (not in 26.6 fixed-point units).
1024
- *
1025
- * @note:
1026
- * The @FT_RASTER_FLAG_AA bit flag must be set in the `flags` to
1027
- * generate an anti-aliased glyph bitmap, otherwise a monochrome bitmap
1028
- * is generated. The `target` should have appropriate pixel mode and its
1029
- * dimensions define the clipping region.
1030
- *
1031
- * If both @FT_RASTER_FLAG_AA and @FT_RASTER_FLAG_DIRECT bit flags
1032
- * are set in `flags`, the raster calls an @FT_SpanFunc callback
1033
- * `gray_spans` with `user` data as an argument ignoring `target`. This
1034
- * allows direct composition over a pre-existing user surface to perform
1035
- * the span drawing and composition. To optionally clip the spans, set
1036
- * the @FT_RASTER_FLAG_CLIP flag and `clip_box`. The monochrome raster
1037
- * does not support the direct mode.
1038
- *
1039
- * The gray-level rasterizer always uses 256 gray levels. If you want
1040
- * fewer gray levels, you have to use @FT_RASTER_FLAG_DIRECT and reduce
1041
- * the levels in the callback function.
1042
- */
1043
- typedef struct FT_Raster_Params_
1044
- {
1045
- const FT_Bitmap* target;
1046
- const void* source;
1047
- int flags;
1048
- FT_SpanFunc gray_spans;
1049
- FT_SpanFunc black_spans; /* unused */
1050
- FT_Raster_BitTest_Func bit_test; /* unused */
1051
- FT_Raster_BitSet_Func bit_set; /* unused */
1052
- void* user;
1053
- FT_BBox clip_box;
1054
-
1055
- } FT_Raster_Params;
1056
-
1057
-
1058
- /**************************************************************************
1059
- *
1060
- * @type:
1061
- * FT_Raster
1062
- *
1063
- * @description:
1064
- * An opaque handle (pointer) to a raster object. Each object can be
1065
- * used independently to convert an outline into a bitmap or pixmap.
1066
- *
1067
- * @note:
1068
- * In FreeType 2, all rasters are now encapsulated within specific
1069
- * @FT_Renderer modules and only used in their context.
1070
- *
1071
- */
1072
- typedef struct FT_RasterRec_* FT_Raster;
1073
-
1074
-
1075
- /**************************************************************************
1076
- *
1077
- * @functype:
1078
- * FT_Raster_NewFunc
1079
- *
1080
- * @description:
1081
- * A function used to create a new raster object.
1082
- *
1083
- * @input:
1084
- * memory ::
1085
- * A handle to the memory allocator.
1086
- *
1087
- * @output:
1088
- * raster ::
1089
- * A handle to the new raster object.
1090
- *
1091
- * @return:
1092
- * Error code. 0~means success.
1093
- *
1094
- * @note:
1095
- * The `memory` parameter is a typeless pointer in order to avoid
1096
- * un-wanted dependencies on the rest of the FreeType code. In practice,
1097
- * it is an @FT_Memory object, i.e., a handle to the standard FreeType
1098
- * memory allocator. However, this field can be completely ignored by a
1099
- * given raster implementation.
1100
- */
1101
- typedef int
1102
- (*FT_Raster_NewFunc)( void* memory,
1103
- FT_Raster* raster );
1104
-
1105
- #define FT_Raster_New_Func FT_Raster_NewFunc
1106
-
1107
-
1108
- /**************************************************************************
1109
- *
1110
- * @functype:
1111
- * FT_Raster_DoneFunc
1112
- *
1113
- * @description:
1114
- * A function used to destroy a given raster object.
1115
- *
1116
- * @input:
1117
- * raster ::
1118
- * A handle to the raster object.
1119
- */
1120
- typedef void
1121
- (*FT_Raster_DoneFunc)( FT_Raster raster );
1122
-
1123
- #define FT_Raster_Done_Func FT_Raster_DoneFunc
1124
-
1125
-
1126
- /**************************************************************************
1127
- *
1128
- * @functype:
1129
- * FT_Raster_ResetFunc
1130
- *
1131
- * @description:
1132
- * FreeType used to provide an area of memory called the 'render pool'
1133
- * available to all registered rasterizers. This was not thread safe,
1134
- * however, and now FreeType never allocates this pool.
1135
- *
1136
- * This function is called after a new raster object is created.
1137
- *
1138
- * @input:
1139
- * raster ::
1140
- * A handle to the new raster object.
1141
- *
1142
- * pool_base ::
1143
- * Previously, the address in memory of the render pool. Set this to
1144
- * `NULL`.
1145
- *
1146
- * pool_size ::
1147
- * Previously, the size in bytes of the render pool. Set this to 0.
1148
- *
1149
- * @note:
1150
- * Rasterizers should rely on dynamic or stack allocation if they want to
1151
- * (a handle to the memory allocator is passed to the rasterizer
1152
- * constructor).
1153
- */
1154
- typedef void
1155
- (*FT_Raster_ResetFunc)( FT_Raster raster,
1156
- unsigned char* pool_base,
1157
- unsigned long pool_size );
1158
-
1159
- #define FT_Raster_Reset_Func FT_Raster_ResetFunc
1160
-
1161
-
1162
- /**************************************************************************
1163
- *
1164
- * @functype:
1165
- * FT_Raster_SetModeFunc
1166
- *
1167
- * @description:
1168
- * This function is a generic facility to change modes or attributes in a
1169
- * given raster. This can be used for debugging purposes, or simply to
1170
- * allow implementation-specific 'features' in a given raster module.
1171
- *
1172
- * @input:
1173
- * raster ::
1174
- * A handle to the new raster object.
1175
- *
1176
- * mode ::
1177
- * A 4-byte tag used to name the mode or property.
1178
- *
1179
- * args ::
1180
- * A pointer to the new mode/property to use.
1181
- */
1182
- typedef int
1183
- (*FT_Raster_SetModeFunc)( FT_Raster raster,
1184
- unsigned long mode,
1185
- void* args );
1186
-
1187
- #define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc
1188
-
1189
-
1190
- /**************************************************************************
1191
- *
1192
- * @functype:
1193
- * FT_Raster_RenderFunc
1194
- *
1195
- * @description:
1196
- * Invoke a given raster to scan-convert a given glyph image into a
1197
- * target bitmap.
1198
- *
1199
- * @input:
1200
- * raster ::
1201
- * A handle to the raster object.
1202
- *
1203
- * params ::
1204
- * A pointer to an @FT_Raster_Params structure used to store the
1205
- * rendering parameters.
1206
- *
1207
- * @return:
1208
- * Error code. 0~means success.
1209
- *
1210
- * @note:
1211
- * The exact format of the source image depends on the raster's glyph
1212
- * format defined in its @FT_Raster_Funcs structure. It can be an
1213
- * @FT_Outline or anything else in order to support a large array of
1214
- * glyph formats.
1215
- *
1216
- * Note also that the render function can fail and return a
1217
- * `FT_Err_Unimplemented_Feature` error code if the raster used does not
1218
- * support direct composition.
1219
- */
1220
- typedef int
1221
- (*FT_Raster_RenderFunc)( FT_Raster raster,
1222
- const FT_Raster_Params* params );
1223
-
1224
- #define FT_Raster_Render_Func FT_Raster_RenderFunc
1225
-
1226
-
1227
- /**************************************************************************
1228
- *
1229
- * @struct:
1230
- * FT_Raster_Funcs
1231
- *
1232
- * @description:
1233
- * A structure used to describe a given raster class to the library.
1234
- *
1235
- * @fields:
1236
- * glyph_format ::
1237
- * The supported glyph format for this raster.
1238
- *
1239
- * raster_new ::
1240
- * The raster constructor.
1241
- *
1242
- * raster_reset ::
1243
- * Used to reset the render pool within the raster.
1244
- *
1245
- * raster_render ::
1246
- * A function to render a glyph into a given bitmap.
1247
- *
1248
- * raster_done ::
1249
- * The raster destructor.
1250
- */
1251
- typedef struct FT_Raster_Funcs_
1252
- {
1253
- FT_Glyph_Format glyph_format;
1254
-
1255
- FT_Raster_NewFunc raster_new;
1256
- FT_Raster_ResetFunc raster_reset;
1257
- FT_Raster_SetModeFunc raster_set_mode;
1258
- FT_Raster_RenderFunc raster_render;
1259
- FT_Raster_DoneFunc raster_done;
1260
-
1261
- } FT_Raster_Funcs;
1262
-
1263
- /* */
1264
-
1265
-
1266
- FT_END_HEADER
1267
-
1268
- #endif /* FTIMAGE_H_ */
1269
-
1270
-
1271
- /* END */
1272
-
1273
-
1274
- /* Local Variables: */
1275
- /* coding: utf-8 */
1276
- /* End: */