blend2d-bindings 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/ChangeLog +26 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +41 -0
  5. data/examples/test.rb +46 -0
  6. data/examples/util/setup_blend2d.rb +46 -0
  7. data/lib/blend2d.rb +95 -0
  8. data/lib/blend2d_api.rb +255 -0
  9. data/lib/blend2d_array.rb +319 -0
  10. data/lib/blend2d_bitarray.rb +275 -0
  11. data/lib/blend2d_bitset.rb +311 -0
  12. data/lib/blend2d_context.rb +1613 -0
  13. data/lib/blend2d_filesystem.rb +211 -0
  14. data/lib/blend2d_font.rb +281 -0
  15. data/lib/blend2d_fontdata.rb +209 -0
  16. data/lib/blend2d_fontdefs.rb +552 -0
  17. data/lib/blend2d_fontface.rb +345 -0
  18. data/lib/blend2d_fontfeaturesettings.rb +210 -0
  19. data/lib/blend2d_fontmanager.rb +187 -0
  20. data/lib/blend2d_fontvariationsettings.rb +210 -0
  21. data/lib/blend2d_format.rb +112 -0
  22. data/lib/blend2d_geometry.rb +424 -0
  23. data/lib/blend2d_glyphbuffer.rb +141 -0
  24. data/lib/blend2d_glyphrun.rb +101 -0
  25. data/lib/blend2d_gradient.rb +429 -0
  26. data/lib/blend2d_image.rb +291 -0
  27. data/lib/blend2d_imagecodec.rb +219 -0
  28. data/lib/blend2d_imagedecoder.rb +168 -0
  29. data/lib/blend2d_imageencoder.rb +159 -0
  30. data/lib/blend2d_matrix.rb +132 -0
  31. data/lib/blend2d_object.rb +326 -0
  32. data/lib/blend2d_path.rb +511 -0
  33. data/lib/blend2d_pattern.rb +202 -0
  34. data/lib/blend2d_pixelconverter.rb +109 -0
  35. data/lib/blend2d_random.rb +77 -0
  36. data/lib/blend2d_rgba.rb +95 -0
  37. data/lib/blend2d_runtime.rb +259 -0
  38. data/lib/blend2d_string.rb +245 -0
  39. data/lib/blend2d_var.rb +294 -0
  40. data/lib/libblend2d.aarch64.so +0 -0
  41. data/lib/libblend2d.arm64.dylib +0 -0
  42. data/lib/libblend2d.dll +0 -0
  43. data/lib/libblend2d.x86_64.dylib +0 -0
  44. data/lib/libblend2d.x86_64.so +0 -0
  45. metadata +99 -0
@@ -0,0 +1,552 @@
1
+ # Ruby-Blend2D : Yet another Blend2D wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/blend2d-bindings
4
+ #
5
+ # [NOTICE] Autogenerated. Do not edit.
6
+
7
+ require 'ffi'
8
+ require_relative 'blend2d_geometry'
9
+
10
+ module Blend2D
11
+ extend FFI::Library
12
+ # Define/Macro
13
+
14
+
15
+ # Enum
16
+
17
+ BL_ORIENTATION_HORIZONTAL = 0
18
+ BL_ORIENTATION_VERTICAL = 1
19
+ BL_ORIENTATION_MAX_VALUE = 1
20
+ BL_ORIENTATION_FORCE_UINT = -1
21
+ BL_FONT_FACE_TYPE_NONE = 0
22
+ BL_FONT_FACE_TYPE_OPENTYPE = 1
23
+ BL_FONT_FACE_TYPE_MAX_VALUE = 1
24
+ BL_FONT_FACE_TYPE_FORCE_UINT = -1
25
+ BL_FONT_STRETCH_ULTRA_CONDENSED = 1
26
+ BL_FONT_STRETCH_EXTRA_CONDENSED = 2
27
+ BL_FONT_STRETCH_CONDENSED = 3
28
+ BL_FONT_STRETCH_SEMI_CONDENSED = 4
29
+ BL_FONT_STRETCH_NORMAL = 5
30
+ BL_FONT_STRETCH_SEMI_EXPANDED = 6
31
+ BL_FONT_STRETCH_EXPANDED = 7
32
+ BL_FONT_STRETCH_EXTRA_EXPANDED = 8
33
+ BL_FONT_STRETCH_ULTRA_EXPANDED = 9
34
+ BL_FONT_STRETCH_MAX_VALUE = 9
35
+ BL_FONT_STRETCH_FORCE_UINT = -1
36
+ BL_FONT_STYLE_NORMAL = 0
37
+ BL_FONT_STYLE_OBLIQUE = 1
38
+ BL_FONT_STYLE_ITALIC = 2
39
+ BL_FONT_STYLE_MAX_VALUE = 2
40
+ BL_FONT_STYLE_FORCE_UINT = -1
41
+ BL_FONT_WEIGHT_THIN = 100
42
+ BL_FONT_WEIGHT_EXTRA_LIGHT = 200
43
+ BL_FONT_WEIGHT_LIGHT = 300
44
+ BL_FONT_WEIGHT_SEMI_LIGHT = 350
45
+ BL_FONT_WEIGHT_NORMAL = 400
46
+ BL_FONT_WEIGHT_MEDIUM = 500
47
+ BL_FONT_WEIGHT_SEMI_BOLD = 600
48
+ BL_FONT_WEIGHT_BOLD = 700
49
+ BL_FONT_WEIGHT_EXTRA_BOLD = 800
50
+ BL_FONT_WEIGHT_BLACK = 900
51
+ BL_FONT_WEIGHT_EXTRA_BLACK = 950
52
+ BL_FONT_WEIGHT_FORCE_UINT = -1
53
+ BL_FONT_STRING_ID_COPYRIGHT_NOTICE = 0
54
+ BL_FONT_STRING_ID_FAMILY_NAME = 1
55
+ BL_FONT_STRING_ID_SUBFAMILY_NAME = 2
56
+ BL_FONT_STRING_ID_UNIQUE_IDENTIFIER = 3
57
+ BL_FONT_STRING_ID_FULL_NAME = 4
58
+ BL_FONT_STRING_ID_VERSION_STRING = 5
59
+ BL_FONT_STRING_ID_POST_SCRIPT_NAME = 6
60
+ BL_FONT_STRING_ID_TRADEMARK = 7
61
+ BL_FONT_STRING_ID_MANUFACTURER_NAME = 8
62
+ BL_FONT_STRING_ID_DESIGNER_NAME = 9
63
+ BL_FONT_STRING_ID_DESCRIPTION = 10
64
+ BL_FONT_STRING_ID_VENDOR_URL = 11
65
+ BL_FONT_STRING_ID_DESIGNER_URL = 12
66
+ BL_FONT_STRING_ID_LICENSE_DESCRIPTION = 13
67
+ BL_FONT_STRING_ID_LICENSE_INFO_URL = 14
68
+ BL_FONT_STRING_ID_RESERVED = 15
69
+ BL_FONT_STRING_ID_TYPOGRAPHIC_FAMILY_NAME = 16
70
+ BL_FONT_STRING_ID_TYPOGRAPHIC_SUBFAMILY_NAME = 17
71
+ BL_FONT_STRING_ID_COMPATIBLE_FULL_NAME = 18
72
+ BL_FONT_STRING_ID_SAMPLE_TEXT = 19
73
+ BL_FONT_STRING_ID_POST_SCRIPT_CID_NAME = 20
74
+ BL_FONT_STRING_ID_WWS_FAMILY_NAME = 21
75
+ BL_FONT_STRING_ID_WWS_SUBFAMILY_NAME = 22
76
+ BL_FONT_STRING_ID_LIGHT_BACKGROUND_PALETTE = 23
77
+ BL_FONT_STRING_ID_DARK_BACKGROUND_PALETTE = 24
78
+ BL_FONT_STRING_ID_VARIATIONS_POST_SCRIPT_PREFIX = 25
79
+ BL_FONT_STRING_ID_COMMON_MAX_VALUE = 26
80
+ BL_FONT_STRING_ID_CUSTOM_START_INDEX = 255
81
+ BL_FONT_STRING_ID_FORCE_UINT = -1
82
+ BL_FONT_UC_INDEX_BASIC_LATIN = 0
83
+ BL_FONT_UC_INDEX_LATIN1_SUPPLEMENT = 1
84
+ BL_FONT_UC_INDEX_LATIN_EXTENDED_A = 2
85
+ BL_FONT_UC_INDEX_LATIN_EXTENDED_B = 3
86
+ BL_FONT_UC_INDEX_IPA_EXTENSIONS = 4
87
+ BL_FONT_UC_INDEX_SPACING_MODIFIER_LETTERS = 5
88
+ BL_FONT_UC_INDEX_COMBINING_DIACRITICAL_MARKS = 6
89
+ BL_FONT_UC_INDEX_GREEK_AND_COPTIC = 7
90
+ BL_FONT_UC_INDEX_COPTIC = 8
91
+ BL_FONT_UC_INDEX_CYRILLIC = 9
92
+ BL_FONT_UC_INDEX_ARMENIAN = 10
93
+ BL_FONT_UC_INDEX_HEBREW = 11
94
+ BL_FONT_UC_INDEX_VAI = 12
95
+ BL_FONT_UC_INDEX_ARABIC = 13
96
+ BL_FONT_UC_INDEX_NKO = 14
97
+ BL_FONT_UC_INDEX_DEVANAGARI = 15
98
+ BL_FONT_UC_INDEX_BENGALI = 16
99
+ BL_FONT_UC_INDEX_GURMUKHI = 17
100
+ BL_FONT_UC_INDEX_GUJARATI = 18
101
+ BL_FONT_UC_INDEX_ORIYA = 19
102
+ BL_FONT_UC_INDEX_TAMIL = 20
103
+ BL_FONT_UC_INDEX_TELUGU = 21
104
+ BL_FONT_UC_INDEX_KANNADA = 22
105
+ BL_FONT_UC_INDEX_MALAYALAM = 23
106
+ BL_FONT_UC_INDEX_THAI = 24
107
+ BL_FONT_UC_INDEX_LAO = 25
108
+ BL_FONT_UC_INDEX_GEORGIAN = 26
109
+ BL_FONT_UC_INDEX_BALINESE = 27
110
+ BL_FONT_UC_INDEX_HANGUL_JAMO = 28
111
+ BL_FONT_UC_INDEX_LATIN_EXTENDED_ADDITIONAL = 29
112
+ BL_FONT_UC_INDEX_GREEK_EXTENDED = 30
113
+ BL_FONT_UC_INDEX_GENERAL_PUNCTUATION = 31
114
+ BL_FONT_UC_INDEX_SUPERSCRIPTS_AND_SUBSCRIPTS = 32
115
+ BL_FONT_UC_INDEX_CURRENCY_SYMBOLS = 33
116
+ BL_FONT_UC_INDEX_COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS = 34
117
+ BL_FONT_UC_INDEX_LETTERLIKE_SYMBOLS = 35
118
+ BL_FONT_UC_INDEX_NUMBER_FORMS = 36
119
+ BL_FONT_UC_INDEX_ARROWS = 37
120
+ BL_FONT_UC_INDEX_MATHEMATICAL_OPERATORS = 38
121
+ BL_FONT_UC_INDEX_MISCELLANEOUS_TECHNICAL = 39
122
+ BL_FONT_UC_INDEX_CONTROL_PICTURES = 40
123
+ BL_FONT_UC_INDEX_OPTICAL_CHARACTER_RECOGNITION = 41
124
+ BL_FONT_UC_INDEX_ENCLOSED_ALPHANUMERICS = 42
125
+ BL_FONT_UC_INDEX_BOX_DRAWING = 43
126
+ BL_FONT_UC_INDEX_BLOCK_ELEMENTS = 44
127
+ BL_FONT_UC_INDEX_GEOMETRIC_SHAPES = 45
128
+ BL_FONT_UC_INDEX_MISCELLANEOUS_SYMBOLS = 46
129
+ BL_FONT_UC_INDEX_DINGBATS = 47
130
+ BL_FONT_UC_INDEX_CJK_SYMBOLS_AND_PUNCTUATION = 48
131
+ BL_FONT_UC_INDEX_HIRAGANA = 49
132
+ BL_FONT_UC_INDEX_KATAKANA = 50
133
+ BL_FONT_UC_INDEX_BOPOMOFO = 51
134
+ BL_FONT_UC_INDEX_HANGUL_COMPATIBILITY_JAMO = 52
135
+ BL_FONT_UC_INDEX_PHAGS_PA = 53
136
+ BL_FONT_UC_INDEX_ENCLOSED_CJK_LETTERS_AND_MONTHS = 54
137
+ BL_FONT_UC_INDEX_CJK_COMPATIBILITY = 55
138
+ BL_FONT_UC_INDEX_HANGUL_SYLLABLES = 56
139
+ BL_FONT_UC_INDEX_NON_PLANE = 57
140
+ BL_FONT_UC_INDEX_PHOENICIAN = 58
141
+ BL_FONT_UC_INDEX_CJK_UNIFIED_IDEOGRAPHS = 59
142
+ BL_FONT_UC_INDEX_PRIVATE_USE_PLANE0 = 60
143
+ BL_FONT_UC_INDEX_CJK_STROKES = 61
144
+ BL_FONT_UC_INDEX_ALPHABETIC_PRESENTATION_FORMS = 62
145
+ BL_FONT_UC_INDEX_ARABIC_PRESENTATION_FORMS_A = 63
146
+ BL_FONT_UC_INDEX_COMBINING_HALF_MARKS = 64
147
+ BL_FONT_UC_INDEX_VERTICAL_FORMS = 65
148
+ BL_FONT_UC_INDEX_SMALL_FORM_VARIANTS = 66
149
+ BL_FONT_UC_INDEX_ARABIC_PRESENTATION_FORMS_B = 67
150
+ BL_FONT_UC_INDEX_HALFWIDTH_AND_FULLWIDTH_FORMS = 68
151
+ BL_FONT_UC_INDEX_SPECIALS = 69
152
+ BL_FONT_UC_INDEX_TIBETAN = 70
153
+ BL_FONT_UC_INDEX_SYRIAC = 71
154
+ BL_FONT_UC_INDEX_THAANA = 72
155
+ BL_FONT_UC_INDEX_SINHALA = 73
156
+ BL_FONT_UC_INDEX_MYANMAR = 74
157
+ BL_FONT_UC_INDEX_ETHIOPIC = 75
158
+ BL_FONT_UC_INDEX_CHEROKEE = 76
159
+ BL_FONT_UC_INDEX_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS = 77
160
+ BL_FONT_UC_INDEX_OGHAM = 78
161
+ BL_FONT_UC_INDEX_RUNIC = 79
162
+ BL_FONT_UC_INDEX_KHMER = 80
163
+ BL_FONT_UC_INDEX_MONGOLIAN = 81
164
+ BL_FONT_UC_INDEX_BRAILLE_PATTERNS = 82
165
+ BL_FONT_UC_INDEX_YI_SYLLABLES_AND_RADICALS = 83
166
+ BL_FONT_UC_INDEX_TAGALOG_HANUNOO_BUHID_TAGBANWA = 84
167
+ BL_FONT_UC_INDEX_OLD_ITALIC = 85
168
+ BL_FONT_UC_INDEX_GOTHIC = 86
169
+ BL_FONT_UC_INDEX_DESERET = 87
170
+ BL_FONT_UC_INDEX_MUSICAL_SYMBOLS = 88
171
+ BL_FONT_UC_INDEX_MATHEMATICAL_ALPHANUMERIC_SYMBOLS = 89
172
+ BL_FONT_UC_INDEX_PRIVATE_USE_PLANE_15_16 = 90
173
+ BL_FONT_UC_INDEX_VARIATION_SELECTORS = 91
174
+ BL_FONT_UC_INDEX_TAGS = 92
175
+ BL_FONT_UC_INDEX_LIMBU = 93
176
+ BL_FONT_UC_INDEX_TAI_LE = 94
177
+ BL_FONT_UC_INDEX_NEW_TAI_LUE = 95
178
+ BL_FONT_UC_INDEX_BUGINESE = 96
179
+ BL_FONT_UC_INDEX_GLAGOLITIC = 97
180
+ BL_FONT_UC_INDEX_TIFINAGH = 98
181
+ BL_FONT_UC_INDEX_YIJING_HEXAGRAM_SYMBOLS = 99
182
+ BL_FONT_UC_INDEX_SYLOTI_NAGRI = 100
183
+ BL_FONT_UC_INDEX_LINEAR_B_SYLLABARY_AND_IDEOGRAMS = 101
184
+ BL_FONT_UC_INDEX_ANCIENT_GREEK_NUMBERS = 102
185
+ BL_FONT_UC_INDEX_UGARITIC = 103
186
+ BL_FONT_UC_INDEX_OLD_PERSIAN = 104
187
+ BL_FONT_UC_INDEX_SHAVIAN = 105
188
+ BL_FONT_UC_INDEX_OSMANYA = 106
189
+ BL_FONT_UC_INDEX_CYPRIOT_SYLLABARY = 107
190
+ BL_FONT_UC_INDEX_KHAROSHTHI = 108
191
+ BL_FONT_UC_INDEX_TAI_XUAN_JING_SYMBOLS = 109
192
+ BL_FONT_UC_INDEX_CUNEIFORM = 110
193
+ BL_FONT_UC_INDEX_COUNTING_ROD_NUMERALS = 111
194
+ BL_FONT_UC_INDEX_SUNDANESE = 112
195
+ BL_FONT_UC_INDEX_LEPCHA = 113
196
+ BL_FONT_UC_INDEX_OL_CHIKI = 114
197
+ BL_FONT_UC_INDEX_SAURASHTRA = 115
198
+ BL_FONT_UC_INDEX_KAYAH_LI = 116
199
+ BL_FONT_UC_INDEX_REJANG = 117
200
+ BL_FONT_UC_INDEX_CHAM = 118
201
+ BL_FONT_UC_INDEX_ANCIENT_SYMBOLS = 119
202
+ BL_FONT_UC_INDEX_PHAISTOS_DISC = 120
203
+ BL_FONT_UC_INDEX_CARIAN_LYCIAN_LYDIAN = 121
204
+ BL_FONT_UC_INDEX_DOMINO_AND_MAHJONG_TILES = 122
205
+ BL_FONT_UC_INDEX_INTERNAL_USAGE_123 = 123
206
+ BL_FONT_UC_INDEX_INTERNAL_USAGE_124 = 124
207
+ BL_FONT_UC_INDEX_INTERNAL_USAGE_125 = 125
208
+ BL_FONT_UC_INDEX_INTERNAL_USAGE_126 = 126
209
+ BL_FONT_UC_INDEX_INTERNAL_USAGE_127 = 127
210
+ BL_FONT_UC_INDEX_MAX_VALUE = 128
211
+ BL_FONT_UC_INDEX_FORCE_UINT = -1
212
+ BL_TEXT_DIRECTION_LTR = 0
213
+ BL_TEXT_DIRECTION_RTL = 1
214
+ BL_TEXT_DIRECTION_MAX_VALUE = 1
215
+ BL_TEXT_DIRECTION_FORCE_UINT = -1
216
+
217
+ # Typedef
218
+
219
+
220
+ class BLFontPanose_text < FFI::Struct
221
+ layout(
222
+ :familyKind, :uchar,
223
+ :serifStyle, :uchar,
224
+ :weight, :uchar,
225
+ :proportion, :uchar,
226
+ :contrast, :uchar,
227
+ :strokeVariation, :uchar,
228
+ :armStyle, :uchar,
229
+ :letterform, :uchar,
230
+ :midline, :uchar,
231
+ :xHeight, :uchar,
232
+ )
233
+ end
234
+
235
+ class BLFontPanose_script < FFI::Struct
236
+ layout(
237
+ :familyKind, :uchar,
238
+ :toolKind, :uchar,
239
+ :weight, :uchar,
240
+ :spacing, :uchar,
241
+ :aspectRatio, :uchar,
242
+ :contrast, :uchar,
243
+ :topology, :uchar,
244
+ :form, :uchar,
245
+ :finials, :uchar,
246
+ :xAscent, :uchar,
247
+ )
248
+ end
249
+
250
+ class BLFontPanose_decorative < FFI::Struct
251
+ layout(
252
+ :familyKind, :uchar,
253
+ :decorativeClass, :uchar,
254
+ :weight, :uchar,
255
+ :aspect, :uchar,
256
+ :contrast, :uchar,
257
+ :serifVariant, :uchar,
258
+ :treatment, :uchar,
259
+ :lining, :uchar,
260
+ :topology, :uchar,
261
+ :characterRange, :uchar,
262
+ )
263
+ end
264
+
265
+ class BLFontPanose_symbol < FFI::Struct
266
+ layout(
267
+ :familyKind, :uchar,
268
+ :symbolKind, :uchar,
269
+ :weight, :uchar,
270
+ :spacing, :uchar,
271
+ :aspectRatioAndContrast, :uchar,
272
+ :aspectRatio94, :uchar,
273
+ :aspectRatio119, :uchar,
274
+ :aspectRatio157, :uchar,
275
+ :aspectRatio163, :uchar,
276
+ :aspectRatio211, :uchar,
277
+ )
278
+ end
279
+
280
+ class BLFontPanose_union < FFI::Union
281
+ layout(
282
+ :data, [:uchar, 10],
283
+ :familyKind, :uchar,
284
+ :text, BLFontPanose_text,
285
+ :script, BLFontPanose_script,
286
+ :decorative, BLFontPanose_decorative,
287
+ :symbol, BLFontPanose_symbol,
288
+ )
289
+ end
290
+
291
+ class BLFontPanose < FFI::Struct
292
+ layout(
293
+ :_union, BLFontPanose_union,
294
+ )
295
+ end
296
+
297
+ class BLFontMatrix_matrix_elements < FFI::Struct
298
+ layout(
299
+ :m00, :double,
300
+ :m01, :double,
301
+ :m10, :double,
302
+ :m11, :double,
303
+ )
304
+ end
305
+
306
+ class BLFontMatrix_matrix < FFI::Union
307
+ layout(
308
+ :m, [:double, 4],
309
+ :elements, BLFontMatrix_matrix_elements,
310
+ )
311
+ end
312
+
313
+ class BLFontMatrix < FFI::Struct
314
+ layout(
315
+ :matrix, BLFontMatrix_matrix,
316
+ )
317
+ end
318
+
319
+ class BLFontMetrics_OrientationInfo_Elements < FFI::Struct
320
+ layout(
321
+ :ascent, :float,
322
+ :vAscent, :float,
323
+ :descent, :float,
324
+ :vDescent, :float,
325
+ )
326
+ end
327
+
328
+ class BLFontMetrics_OrientationInfo_Array < FFI::Struct
329
+ layout(
330
+ :ascentByOrientation, [:float, 2],
331
+ :descentByOrientation, [:float, 2],
332
+ )
333
+ end
334
+
335
+ class BLFontMetrics_OrientationInfo < FFI::Union
336
+ layout(
337
+ :elements, BLFontMetrics_OrientationInfo_Elements,
338
+ :array, BLFontMetrics_OrientationInfo_Array,
339
+ )
340
+ end
341
+
342
+ class BLFontMetrics < FFI::Struct
343
+ layout(
344
+ :size, :float,
345
+ :orientation, BLFontMetrics_OrientationInfo,
346
+ :lineGap, :float,
347
+ :xHeight, :float,
348
+ :capHeight, :float,
349
+ :xMin, :float,
350
+ :yMin, :float,
351
+ :xMax, :float,
352
+ :yMax, :float,
353
+ :underlinePosition, :float,
354
+ :underlineThickness, :float,
355
+ :strikethroughPosition, :float,
356
+ :strikethroughThickness, :float,
357
+ )
358
+ end
359
+
360
+ class BLFontDesignMetrics_Orientation_Elements < FFI::Struct
361
+ layout(
362
+ :ascent, :int,
363
+ :vAscent, :int,
364
+ :descent, :int,
365
+ :vDescent, :int,
366
+ :hMinLSB, :int,
367
+ :vMinLSB, :int,
368
+ :hMinTSB, :int,
369
+ :vMinTSB, :int,
370
+ :hMaxAdvance, :int,
371
+ :vMaxAdvance, :int,
372
+ )
373
+ end
374
+
375
+ class BLFontDesignMetrics_Orientation_Array < FFI::Struct
376
+ layout(
377
+ :ascentByOrientation, [:int, 2],
378
+ :descentByOrientation, [:int, 2],
379
+ :minLSBByOrientation, [:int, 2],
380
+ :minTSBByOrientation, [:int, 2],
381
+ :maxAdvanceByOrientation, [:int, 2],
382
+ )
383
+ end
384
+
385
+ class BLFontDesignMetrics_Orientation < FFI::Union
386
+ layout(
387
+ :elements, BLFontDesignMetrics_Orientation_Elements,
388
+ :array, BLFontDesignMetrics_Orientation_Array,
389
+ )
390
+ end
391
+
392
+ class BLFontDesignMetrics < FFI::Struct
393
+ layout(
394
+ :unitsPerEm, :int,
395
+ :lowestPPEM, :int,
396
+ :lineGap, :int,
397
+ :xHeight, :int,
398
+ :capHeight, :int,
399
+ :orientation, BLFontDesignMetrics_Orientation,
400
+ :glyphBoundingBox, BLBoxI,
401
+ :underlinePosition, :int,
402
+ :underlineThickness, :int,
403
+ :strikethroughPosition, :int,
404
+ :strikethroughThickness, :int,
405
+ )
406
+ end
407
+
408
+ typedef :int, :BLOrientation
409
+ typedef :int, :BLFontFaceType
410
+ typedef :int, :BLFontStretch
411
+ typedef :int, :BLFontStyle
412
+ typedef :int, :BLFontWeight
413
+ typedef :int, :BLFontStringId
414
+ typedef :int, :BLFontUnicodeCoverageIndex
415
+ typedef :int, :BLTextDirection
416
+ typedef :uint, :BLGlyphId
417
+
418
+ # Struct
419
+
420
+ class BLGlyphInfo < FFI::Struct
421
+ layout(
422
+ :cluster, :uint,
423
+ :reserved, :uint,
424
+ )
425
+ def cluster = self[:cluster]
426
+ def cluster=(v) self[:cluster] = v end
427
+ def reserved = self[:reserved]
428
+ def reserved=(v) self[:reserved] = v end
429
+ def self.create_as(_cluster_, _reserved_)
430
+ instance = BLGlyphInfo.new
431
+ instance[:cluster] = _cluster_
432
+ instance[:reserved] = _reserved_
433
+ instance
434
+ end
435
+ end
436
+
437
+ class BLGlyphPlacement < FFI::Struct
438
+ layout(
439
+ :placement, BLPointI,
440
+ :advance, BLPointI,
441
+ )
442
+ def placement = self[:placement]
443
+ def placement=(v) self[:placement] = v end
444
+ def advance = self[:advance]
445
+ def advance=(v) self[:advance] = v end
446
+ def self.create_as(_placement_, _advance_)
447
+ instance = BLGlyphPlacement.new
448
+ instance[:placement] = _placement_
449
+ instance[:advance] = _advance_
450
+ instance
451
+ end
452
+ end
453
+
454
+ class BLGlyphMappingState < FFI::Struct
455
+ layout(
456
+ :glyphCount, :ulong_long,
457
+ :undefinedFirst, :ulong_long,
458
+ :undefinedCount, :ulong_long,
459
+ )
460
+ def glyphCount = self[:glyphCount]
461
+ def glyphCount=(v) self[:glyphCount] = v end
462
+ def undefinedFirst = self[:undefinedFirst]
463
+ def undefinedFirst=(v) self[:undefinedFirst] = v end
464
+ def undefinedCount = self[:undefinedCount]
465
+ def undefinedCount=(v) self[:undefinedCount] = v end
466
+ def self.create_as(_glyphCount_, _undefinedFirst_, _undefinedCount_)
467
+ instance = BLGlyphMappingState.new
468
+ instance[:glyphCount] = _glyphCount_
469
+ instance[:undefinedFirst] = _undefinedFirst_
470
+ instance[:undefinedCount] = _undefinedCount_
471
+ instance
472
+ end
473
+ end
474
+
475
+ class BLGlyphOutlineSinkInfo < FFI::Struct
476
+ layout(
477
+ :glyphIndex, :ulong_long,
478
+ :contourCount, :ulong_long,
479
+ )
480
+ def glyphIndex = self[:glyphIndex]
481
+ def glyphIndex=(v) self[:glyphIndex] = v end
482
+ def contourCount = self[:contourCount]
483
+ def contourCount=(v) self[:contourCount] = v end
484
+ def self.create_as(_glyphIndex_, _contourCount_)
485
+ instance = BLGlyphOutlineSinkInfo.new
486
+ instance[:glyphIndex] = _glyphIndex_
487
+ instance[:contourCount] = _contourCount_
488
+ instance
489
+ end
490
+ end
491
+
492
+ class BLFontUnicodeCoverage < FFI::Struct
493
+ layout(
494
+ :data, [:uint, 4],
495
+ )
496
+ def data = self[:data]
497
+ def data=(v) self[:data] = v end
498
+ def self.create_as(_data_)
499
+ instance = BLFontUnicodeCoverage.new
500
+ instance[:data] = _data_
501
+ instance
502
+ end
503
+ end
504
+
505
+ class BLTextMetrics < FFI::Struct
506
+ layout(
507
+ :advance, BLPoint,
508
+ :leadingBearing, BLPoint,
509
+ :trailingBearing, BLPoint,
510
+ :boundingBox, BLBox,
511
+ )
512
+ def advance = self[:advance]
513
+ def advance=(v) self[:advance] = v end
514
+ def leadingBearing = self[:leadingBearing]
515
+ def leadingBearing=(v) self[:leadingBearing] = v end
516
+ def trailingBearing = self[:trailingBearing]
517
+ def trailingBearing=(v) self[:trailingBearing] = v end
518
+ def boundingBox = self[:boundingBox]
519
+ def boundingBox=(v) self[:boundingBox] = v end
520
+ def self.create_as(_advance_, _leadingBearing_, _trailingBearing_, _boundingBox_)
521
+ instance = BLTextMetrics.new
522
+ instance[:advance] = _advance_
523
+ instance[:leadingBearing] = _leadingBearing_
524
+ instance[:trailingBearing] = _trailingBearing_
525
+ instance[:boundingBox] = _boundingBox_
526
+ instance
527
+ end
528
+ end
529
+
530
+
531
+ # Function
532
+
533
+ def self.setup_fontdefs_symbols(output_error = false)
534
+ symbols = [
535
+ ]
536
+ apis = {
537
+ }
538
+ args = {
539
+ }
540
+ retvals = {
541
+ }
542
+ symbols.each do |sym|
543
+ begin
544
+ attach_function apis[sym], sym, args[sym], retvals[sym]
545
+ rescue FFI::NotFoundError => error
546
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
547
+ end
548
+ end
549
+ end
550
+
551
+ end
552
+