odin-blend2d

Odin bindings to Blend2D
Log | Files | Refs | README | LICENSE

fontdefs.odin (24851B)


      1 // This file is part of Blend2D project <https://blend2d.com>
      2 //
      3 // See blend2d.h or LICENSE.md for license and copyright information
      4 // SPDX-License-Identifier: Zlib
      5 package blend2d
      6 
      7 import "core:c"
      8 
      9 when ODIN_OS == .Windows {
     10 	foreign import lib "blend2d.lib"
     11 } else when ODIN_OS == .Darwin {
     12 	foreign import lib "libblend2d.a"
     13 } else when ODIN_OS == .Linux {
     14 	foreign import lib "libblend2d.a"
     15 }
     16 
     17 
     18 //! Orientation.
     19 Orientation :: enum u32 {
     20 	//! Horizontal orientation.
     21 	HORIZONTAL = 0,
     22 
     23 	//! Vertical orientation.
     24 	VERTICAL   = 1,
     25 
     26 	//! Maximum value of `BLOrientation`.
     27 	MAX_VALUE  = 1,
     28 	FORCE_UINT = 4294967295,
     29 }
     30 
     31 //! Type of a font or font face, see \ref BLFontFace (or \ref BLFontFaceCore).
     32 FontFaceType :: enum u32 {
     33 	//! None or unknown font type.
     34 	NONE       = 0,
     35 
     36 	//! TrueType/OpenType font type (.ttf/.otf files and font collections).
     37 	OPENTYPE   = 1,
     38 
     39 	//! Maximum value of `BLFontFaceType`.
     40 	MAX_VALUE  = 1,
     41 	FORCE_UINT = 4294967295,
     42 }
     43 
     44 //! Font stretch.
     45 FontStretch :: enum u32 {
     46 	//! Ultra condensed stretch.
     47 	ULTRA_CONDENSED = 1,
     48 
     49 	//! Extra condensed stretch.
     50 	EXTRA_CONDENSED = 2,
     51 
     52 	//! Condensed stretch.
     53 	CONDENSED       = 3,
     54 
     55 	//! Semi condensed stretch.
     56 	SEMI_CONDENSED  = 4,
     57 
     58 	//! Normal stretch.
     59 	NORMAL          = 5,
     60 
     61 	//! Semi expanded stretch.
     62 	SEMI_EXPANDED   = 6,
     63 
     64 	//! Expanded stretch.
     65 	EXPANDED        = 7,
     66 
     67 	//! Extra expanded stretch.
     68 	EXTRA_EXPANDED  = 8,
     69 
     70 	//! Ultra expanded stretch.
     71 	ULTRA_EXPANDED  = 9,
     72 
     73 	//! Maximum value of `BLFontStretch`.
     74 	MAX_VALUE       = 9,
     75 	FORCE_UINT      = 4294967295,
     76 }
     77 
     78 //! Font style.
     79 FontStyle :: enum u32 {
     80 	//! Normal style.
     81 	NORMAL     = 0,
     82 
     83 	//! Oblique.
     84 	OBLIQUE    = 1,
     85 
     86 	//! Italic.
     87 	ITALIC     = 2,
     88 
     89 	//! Maximum value of `BLFontStyle`.
     90 	MAX_VALUE  = 2,
     91 	FORCE_UINT = 4294967295,
     92 }
     93 
     94 //! Font weight.
     95 FontWeight :: enum u32 {
     96 	//! Thin weight (100).
     97 	THIN        = 100,
     98 
     99 	//! Extra light weight (200).
    100 	EXTRA_LIGHT = 200,
    101 
    102 	//! Light weight (300).
    103 	LIGHT       = 300,
    104 
    105 	//! Semi light weight (350).
    106 	SEMI_LIGHT  = 350,
    107 
    108 	//! Normal weight (400).
    109 	NORMAL      = 400,
    110 
    111 	//! Medium weight (500).
    112 	MEDIUM      = 500,
    113 
    114 	//! Semi bold weight (600).
    115 	SEMI_BOLD   = 600,
    116 
    117 	//! Bold weight (700).
    118 	BOLD        = 700,
    119 
    120 	//! Extra bold weight (800).
    121 	EXTRA_BOLD  = 800,
    122 
    123 	//! Black weight (900).
    124 	BLACK       = 900,
    125 
    126 	//! Extra black weight (950).
    127 	EXTRA_BLACK = 950,
    128 	FORCE_UINT  = 4294967295,
    129 }
    130 
    131 //! Font string identifiers used by OpenType 'name' table.
    132 FontStringId :: enum u32 {
    133 	//! Copyright notice.
    134 	COPYRIGHT_NOTICE              = 0,
    135 
    136 	//! Font family name.
    137 	FAMILY_NAME                   = 1,
    138 
    139 	//! Font subfamily name.
    140 	SUBFAMILY_NAME                = 2,
    141 
    142 	//! Unique font identifier.
    143 	UNIQUE_IDENTIFIER             = 3,
    144 
    145 	//! Full font name that reflects all family and relevant subfamily descriptors.
    146 	FULL_NAME                     = 4,
    147 
    148 	//! Version string. Should begin with the synta `Version <number>.<number>`.
    149 	VERSION_STRING                = 5,
    150 
    151 	//! PostScript name for the font.
    152 	POST_SCRIPT_NAME              = 6,
    153 
    154 	//! Trademark notice/information for this font.
    155 	TRADEMARK                     = 7,
    156 
    157 	//! Manufacturer name.
    158 	MANUFACTURER_NAME             = 8,
    159 
    160 	//! Name of the designer of the typeface.
    161 	DESIGNER_NAME                 = 9,
    162 
    163 	//! Description of the typeface.
    164 	DESCRIPTION                   = 10,
    165 
    166 	//! URL of font vendor.
    167 	VENDOR_URL                    = 11,
    168 
    169 	//! URL of typeface designer.
    170 	DESIGNER_URL                  = 12,
    171 
    172 	//! Description of how the font may be legally used.
    173 	LICENSE_DESCRIPTION           = 13,
    174 
    175 	//! URL where additional licensing information can be found.
    176 	LICENSE_INFO_URL              = 14,
    177 
    178 	//! Reserved.
    179 	RESERVED                      = 15,
    180 
    181 	//! Typographic family name.
    182 	TYPOGRAPHIC_FAMILY_NAME       = 16,
    183 
    184 	//! Typographic subfamily name.
    185 	TYPOGRAPHIC_SUBFAMILY_NAME    = 17,
    186 
    187 	//! Compatible full name (MAC only).
    188 	COMPATIBLE_FULL_NAME          = 18,
    189 
    190 	//! Sample text - font name or any other text from the designer.
    191 	SAMPLE_TEXT                   = 19,
    192 
    193 	//! PostScript CID findfont name.
    194 	POST_SCRIPT_CID_NAME          = 20,
    195 
    196 	//! WWS family name.
    197 	WWS_FAMILY_NAME               = 21,
    198 
    199 	//! WWS subfamily name.
    200 	WWS_SUBFAMILY_NAME            = 22,
    201 
    202 	//! Light background palette.
    203 	LIGHT_BACKGROUND_PALETTE      = 23,
    204 
    205 	//! Dark background palette.
    206 	DARK_BACKGROUND_PALETTE       = 24,
    207 
    208 	//! Variations PostScript name prefix.
    209 	VARIATIONS_POST_SCRIPT_PREFIX = 25,
    210 
    211 	//! Count of common font string ids.
    212 	COMMON_MAX_VALUE              = 26,
    213 
    214 	//! Start of custom font string ids.
    215 	CUSTOM_START_INDEX            = 255,
    216 	FORCE_UINT                    = 4294967295,
    217 }
    218 
    219 //! Bit positions used by \ref BLFontCoverageInfo structure.
    220 //!
    221 //! Each bit represents a range (or multiple ranges) of unicode characters.
    222 FontCoverageGroup :: enum u32 {
    223 	BASIC_LATIN                             = 0,   //!< [000000-00007F] Basic Latin.
    224 	LATIN1_SUPPLEMENT                       = 1,   //!< [000080-0000FF] Latin-1 Supplement.
    225 	LATIN_EXTENDED_A                        = 2,   //!< [000100-00017F] Latin Extended-A.
    226 	LATIN_EXTENDED_B                        = 3,   //!< [000180-00024F] Latin Extended-B.
    227 	IPA_EXTENSIONS                          = 4,   //!< [000250-0002AF] IPA Extensions.
    228 
    229 	//!< [001D00-001D7F] Phonetic Extensions.
    230 	//!< [001D80-001DBF] Phonetic Extensions Supplement.
    231 	SPACING_MODIFIER_LETTERS                = 5,   //!< [0002B0-0002FF] Spacing Modifier Letters.
    232 
    233 	//!< [00A700-00A71F] Modifier Tone Letters.
    234 	//!< [001DC0-001DFF] Combining Diacritical Marks Supplement.
    235 	COMBINING_DIACRITICAL_MARKS             = 6,   //!< [000300-00036F] Combining Diacritical Marks.
    236 	GREEK_AND_COPTIC                        = 7,   //!< [000370-0003FF] Greek and Coptic.
    237 	COPTIC                                  = 8,   //!< [002C80-002CFF] Coptic.
    238 	CYRILLIC                                = 9,   //!< [000400-0004FF] Cyrillic.
    239 
    240 	//!< [000500-00052F] Cyrillic Supplement.
    241 	//!< [002DE0-002DFF] Cyrillic Extended-A.
    242 	//!< [00A640-00A69F] Cyrillic Extended-B.
    243 	ARMENIAN                                = 10,  //!< [000530-00058F] Armenian.
    244 	HEBREW                                  = 11,  //!< [000590-0005FF] Hebrew.
    245 	VAI                                     = 12,  //!< [00A500-00A63F] Vai.
    246 	ARABIC                                  = 13,  //!< [000600-0006FF] Arabic.
    247 
    248 	//!< [000750-00077F] Arabic Supplement.
    249 	NKO                                     = 14,  //!< [0007C0-0007FF] NKo.
    250 	DEVANAGARI                              = 15,  //!< [000900-00097F] Devanagari.
    251 	BENGALI                                 = 16,  //!< [000980-0009FF] Bengali.
    252 	GURMUKHI                                = 17,  //!< [000A00-000A7F] Gurmukhi.
    253 	GUJARATI                                = 18,  //!< [000A80-000AFF] Gujarati.
    254 	ORIYA                                   = 19,  //!< [000B00-000B7F] Oriya.
    255 	TAMIL                                   = 20,  //!< [000B80-000BFF] Tamil.
    256 	TELUGU                                  = 21,  //!< [000C00-000C7F] Telugu.
    257 	KANNADA                                 = 22,  //!< [000C80-000CFF] Kannada.
    258 	MALAYALAM                               = 23,  //!< [000D00-000D7F] Malayalam.
    259 	THAI                                    = 24,  //!< [000E00-000E7F] Thai.
    260 	LAO                                     = 25,  //!< [000E80-000EFF] Lao.
    261 	GEORGIAN                                = 26,  //!< [0010A0-0010FF] Georgian.
    262 
    263 	//!< [002D00-002D2F] Georgian Supplement.
    264 	BALINESE                                = 27,  //!< [001B00-001B7F] Balinese.
    265 	HANGUL_JAMO                             = 28,  //!< [001100-0011FF] Hangul Jamo.
    266 	LATIN_EXTENDED_ADDITIONAL               = 29,  //!< [001E00-001EFF] Latin Extended Additional.
    267 
    268 	//!< [002C60-002C7F] Latin Extended-C.
    269 	//!< [00A720-00A7FF] Latin Extended-D.
    270 	GREEK_EXTENDED                          = 30,  //!< [001F00-001FFF] Greek Extended.
    271 	GENERAL_PUNCTUATION                     = 31,  //!< [002000-00206F] General Punctuation.
    272 
    273 	//!< [002E00-002E7F] Supplemental Punctuation.
    274 	SUPERSCRIPTS_AND_SUBSCRIPTS             = 32,  //!< [002070-00209F] Superscripts And Subscripts.
    275 	CURRENCY_SYMBOLS                        = 33,  //!< [0020A0-0020CF] Currency Symbols.
    276 	COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS = 34,  //!< [0020D0-0020FF] Combining Diacritical Marks For Symbols.
    277 	LETTERLIKE_SYMBOLS                      = 35,  //!< [002100-00214F] Letterlike Symbols.
    278 	NUMBER_FORMS                            = 36,  //!< [002150-00218F] Number Forms.
    279 	ARROWS                                  = 37,  //!< [002190-0021FF] Arrows.
    280 
    281 	//!< [0027F0-0027FF] Supplemental Arrows-A.
    282 	//!< [002900-00297F] Supplemental Arrows-B.
    283 	//!< [002B00-002BFF] Miscellaneous Symbols and Arrows.
    284 	MATHEMATICAL_OPERATORS                  = 38,  //!< [002200-0022FF] Mathematical Operators.
    285 
    286 	//!< [002A00-002AFF] Supplemental Mathematical Operators.
    287 	//!< [0027C0-0027EF] Miscellaneous Mathematical Symbols-A.
    288 	//!< [002980-0029FF] Miscellaneous Mathematical Symbols-B.
    289 	MISCELLANEOUS_TECHNICAL                 = 39,  //!< [002300-0023FF] Miscellaneous Technical.
    290 	CONTROL_PICTURES                        = 40,  //!< [002400-00243F] Control Pictures.
    291 	OPTICAL_CHARACTER_RECOGNITION           = 41,  //!< [002440-00245F] Optical Character Recognition.
    292 	ENCLOSED_ALPHANUMERICS                  = 42,  //!< [002460-0024FF] Enclosed Alphanumerics.
    293 	BOX_DRAWING                             = 43,  //!< [002500-00257F] Box Drawing.
    294 	BLOCK_ELEMENTS                          = 44,  //!< [002580-00259F] Block Elements.
    295 	GEOMETRIC_SHAPES                        = 45,  //!< [0025A0-0025FF] Geometric Shapes.
    296 	MISCELLANEOUS_SYMBOLS                   = 46,  //!< [002600-0026FF] Miscellaneous Symbols.
    297 	DINGBATS                                = 47,  //!< [002700-0027BF] Dingbats.
    298 	CJK_SYMBOLS_AND_PUNCTUATION             = 48,  //!< [003000-00303F] CJK Symbols And Punctuation.
    299 	HIRAGANA                                = 49,  //!< [003040-00309F] Hiragana.
    300 	KATAKANA                                = 50,  //!< [0030A0-0030FF] Katakana.
    301 
    302 	//!< [0031F0-0031FF] Katakana Phonetic Extensions.
    303 	BOPOMOFO                                = 51,  //!< [003100-00312F] Bopomofo.
    304 
    305 	//!< [0031A0-0031BF] Bopomofo Extended.
    306 	HANGUL_COMPATIBILITY_JAMO               = 52,  //!< [003130-00318F] Hangul Compatibility Jamo.
    307 	PHAGS_PA                                = 53,  //!< [00A840-00A87F] Phags-pa.
    308 	ENCLOSED_CJK_LETTERS_AND_MONTHS         = 54,  //!< [003200-0032FF] Enclosed CJK Letters And Months.
    309 	CJK_COMPATIBILITY                       = 55,  //!< [003300-0033FF] CJK Compatibility.
    310 	HANGUL_SYLLABLES                        = 56,  //!< [00AC00-00D7AF] Hangul Syllables.
    311 	NON_PLANE                               = 57,  //!< [00D800-00DFFF] Non-Plane 0 *.
    312 	PHOENICIAN                              = 58,  //!< [010900-01091F] Phoenician.
    313 	CJK_UNIFIED_IDEOGRAPHS                  = 59,  //!< [004E00-009FFF] CJK Unified Ideographs.
    314 
    315 	//!< [002E80-002EFF] CJK Radicals Supplement.
    316 	//!< [002F00-002FDF] Kangxi Radicals.
    317 	//!< [002FF0-002FFF] Ideographic Description Characters.
    318 	//!< [003400-004DBF] CJK Unified Ideographs Extension A.
    319 	//!< [020000-02A6DF] CJK Unified Ideographs Extension B.
    320 	//!< [003190-00319F] Kanbun.
    321 	PRIVATE_USE_PLANE0                      = 60,  //!< [00E000-00F8FF] Private Use (Plane 0).
    322 	CJK_STROKES                             = 61,  //!< [0031C0-0031EF] CJK Strokes.
    323 
    324 	//!< [00F900-00FAFF] CJK Compatibility Ideographs.
    325 	//!< [02F800-02FA1F] CJK Compatibility Ideographs Supplement.
    326 	ALPHABETIC_PRESENTATION_FORMS           = 62,  //!< [00FB00-00FB4F] Alphabetic Presentation Forms.
    327 	ARABIC_PRESENTATION_FORMS_A             = 63,  //!< [00FB50-00FDFF] Arabic Presentation Forms-A.
    328 	COMBINING_HALF_MARKS                    = 64,  //!< [00FE20-00FE2F] Combining Half Marks.
    329 	VERTICAL_FORMS                          = 65,  //!< [00FE10-00FE1F] Vertical Forms.
    330 
    331 	//!< [00FE30-00FE4F] CJK Compatibility Forms.
    332 	SMALL_FORM_VARIANTS                     = 66,  //!< [00FE50-00FE6F] Small Form Variants.
    333 	ARABIC_PRESENTATION_FORMS_B             = 67,  //!< [00FE70-00FEFF] Arabic Presentation Forms-B.
    334 	HALFWIDTH_AND_FULLWIDTH_FORMS           = 68,  //!< [00FF00-00FFEF] Halfwidth And Fullwidth Forms.
    335 	SPECIALS                                = 69,  //!< [00FFF0-00FFFF] Specials.
    336 	TIBETAN                                 = 70,  //!< [000F00-000FFF] Tibetan.
    337 	SYRIAC                                  = 71,  //!< [000700-00074F] Syriac.
    338 	THAANA                                  = 72,  //!< [000780-0007BF] Thaana.
    339 	SINHALA                                 = 73,  //!< [000D80-000DFF] Sinhala.
    340 	MYANMAR                                 = 74,  //!< [001000-00109F] Myanmar.
    341 	ETHIOPIC                                = 75,  //!< [001200-00137F] Ethiopic.
    342 
    343 	//!< [001380-00139F] Ethiopic Supplement.
    344 	//!< [002D80-002DDF] Ethiopic Extended.
    345 	CHEROKEE                                = 76,  //!< [0013A0-0013FF] Cherokee.
    346 	UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS   = 77,  //!< [001400-00167F] Unified Canadian Aboriginal Syllabics.
    347 	OGHAM                                   = 78,  //!< [001680-00169F] Ogham.
    348 	RUNIC                                   = 79,  //!< [0016A0-0016FF] Runic.
    349 	KHMER                                   = 80,  //!< [001780-0017FF] Khmer.
    350 
    351 	//!< [0019E0-0019FF] Khmer Symbols.
    352 	MONGOLIAN                               = 81,  //!< [001800-0018AF] Mongolian.
    353 	BRAILLE_PATTERNS                        = 82,  //!< [002800-0028FF] Braille Patterns.
    354 	YI_SYLLABLES_AND_RADICALS               = 83,  //!< [00A000-00A48F] Yi Syllables.
    355 
    356 	//!< [00A490-00A4CF] Yi Radicals.
    357 	TAGALOG_HANUNOO_BUHID_TAGBANWA          = 84,  //!< [001700-00171F] Tagalog.
    358 
    359 	//!< [001720-00173F] Hanunoo.
    360 	//!< [001740-00175F] Buhid.
    361 	//!< [001760-00177F] Tagbanwa.
    362 	OLD_ITALIC                              = 85,  //!< [010300-01032F] Old Italic.
    363 	GOTHIC                                  = 86,  //!< [010330-01034F] Gothic.
    364 	DESERET                                 = 87,  //!< [010400-01044F] Deseret.
    365 	MUSICAL_SYMBOLS                         = 88,  //!< [01D000-01D0FF] Byzantine Musical Symbols.
    366 
    367 	//!< [01D100-01D1FF] Musical Symbols.
    368 	//!< [01D200-01D24F] Ancient Greek Musical Notation.
    369 	MATHEMATICAL_ALPHANUMERIC_SYMBOLS       = 89,  //!< [01D400-01D7FF] Mathematical Alphanumeric Symbols.
    370 	PRIVATE_USE_PLANE_15_16                 = 90,  //!< [0F0000-0FFFFD] Private Use (Plane 15).
    371 
    372 	//!< [100000-10FFFD] Private Use (Plane 16).
    373 	VARIATION_SELECTORS                     = 91,  //!< [00FE00-00FE0F] Variation Selectors.
    374 
    375 	//!< [0E0100-0E01EF] Variation Selectors Supplement.
    376 	TAGS                                    = 92,  //!< [0E0000-0E007F] Tags.
    377 	LIMBU                                   = 93,  //!< [001900-00194F] Limbu.
    378 	TAI_LE                                  = 94,  //!< [001950-00197F] Tai Le.
    379 	NEW_TAI_LUE                             = 95,  //!< [001980-0019DF] New Tai Lue.
    380 	BUGINESE                                = 96,  //!< [001A00-001A1F] Buginese.
    381 	GLAGOLITIC                              = 97,  //!< [002C00-002C5F] Glagolitic.
    382 	TIFINAGH                                = 98,  //!< [002D30-002D7F] Tifinagh.
    383 	YIJING_HEXAGRAM_SYMBOLS                 = 99,  //!< [004DC0-004DFF] Yijing Hexagram Symbols.
    384 	SYLOTI_NAGRI                            = 100, //!< [00A800-00A82F] Syloti Nagri.
    385 	LINEAR_B_SYLLABARY_AND_IDEOGRAMS        = 101, //!< [010000-01007F] Linear B Syllabary.
    386 
    387 	//!< [010080-0100FF] Linear B Ideograms.
    388 	//!< [010100-01013F] Aegean Numbers.
    389 	ANCIENT_GREEK_NUMBERS                   = 102, //!< [010140-01018F] Ancient Greek Numbers.
    390 	UGARITIC                                = 103, //!< [010380-01039F] Ugaritic.
    391 	OLD_PERSIAN                             = 104, //!< [0103A0-0103DF] Old Persian.
    392 	SHAVIAN                                 = 105, //!< [010450-01047F] Shavian.
    393 	OSMANYA                                 = 106, //!< [010480-0104AF] Osmanya.
    394 	CYPRIOT_SYLLABARY                       = 107, //!< [010800-01083F] Cypriot Syllabary.
    395 	KHAROSHTHI                              = 108, //!< [010A00-010A5F] Kharoshthi.
    396 	TAI_XUAN_JING_SYMBOLS                   = 109, //!< [01D300-01D35F] Tai Xuan Jing Symbols.
    397 	CUNEIFORM                               = 110, //!< [012000-0123FF] Cuneiform.
    398 
    399 	//!< [012400-01247F] Cuneiform Numbers and Punctuation.
    400 	COUNTING_ROD_NUMERALS                   = 111, //!< [01D360-01D37F] Counting Rod Numerals.
    401 	SUNDANESE                               = 112, //!< [001B80-001BBF] Sundanese.
    402 	LEPCHA                                  = 113, //!< [001C00-001C4F] Lepcha.
    403 	OL_CHIKI                                = 114, //!< [001C50-001C7F] Ol Chiki.
    404 	SAURASHTRA                              = 115, //!< [00A880-00A8DF] Saurashtra.
    405 	KAYAH_LI                                = 116, //!< [00A900-00A92F] Kayah Li.
    406 	REJANG                                  = 117, //!< [00A930-00A95F] Rejang.
    407 	CHAM                                    = 118, //!< [00AA00-00AA5F] Cham.
    408 	ANCIENT_SYMBOLS                         = 119, //!< [010190-0101CF] Ancient Symbols.
    409 	PHAISTOS_DISC                           = 120, //!< [0101D0-0101FF] Phaistos Disc.
    410 	CARIAN_LYCIAN_LYDIAN                    = 121, //!< [0102A0-0102DF] Carian.
    411 
    412 	//!< [010280-01029F] Lycian.
    413 	//!< [010920-01093F] Lydian.
    414 	DOMINO_AND_MAHJONG_TILES                = 122, //!< [01F030-01F09F] Domino Tiles.
    415 
    416 	//!< [01F000-01F02F] Mahjong Tiles.
    417 	INTERNAL_USAGE_123                      = 123, //!< Reserved for internal usage (123).
    418 	INTERNAL_USAGE_124                      = 124, //!< Reserved for internal usage (124).
    419 	INTERNAL_USAGE_125                      = 125, //!< Reserved for internal usage (125).
    420 	INTERNAL_USAGE_126                      = 126, //!< Reserved for internal usage (126).
    421 	INTERNAL_USAGE_127                      = 127, //!< Reserved for internal usage (127).
    422 
    423 	//! Maximum value of `BLFontCoverageGroup`.
    424 	MAX_VALUE                               = 127,
    425 	FORCE_UINT                              = 4294967295,
    426 }
    427 
    428 //! Text direction.
    429 TextDirection :: enum u32 {
    430 	//! Left-to-right direction.
    431 	LTR        = 0,
    432 
    433 	//! Right-to-left direction.
    434 	RTL        = 1,
    435 
    436 	//! Maximum value of `BLTextDirection`.
    437 	MAX_VALUE  = 1,
    438 	FORCE_UINT = 4294967295,
    439 }
    440 
    441 //! Glyph id - a 32-bit unsigned integer.
    442 GlyphId :: u32
    443 
    444 //! Contains additional information associated with a glyph used by \ref BLGlyphBuffer.
    445 GlyphInfo :: struct {
    446 	//! \name Members
    447 	//! \{
    448 	cluster:  u32,
    449 	reserved: u32,
    450 }
    451 
    452 //! Glyph placement.
    453 //!
    454 //! Provides information about glyph offset (x/y) and advance (x/y).
    455 GlyphPlacement :: struct {
    456 	//! \name Members
    457 	//! \{
    458 	placement: PointI,
    459 	advance:   PointI,
    460 }
    461 
    462 //! Character to glyph mapping state.
    463 GlyphMappingState :: struct {
    464 	//! \name Members
    465 	//! \{
    466 	
    467 	//! Number of glyphs or glyph-items on output.
    468 	glyph_count: c.size_t,
    469 
    470 	//! Index of the first undefined glyph (SIZE_MAX if none).
    471 	undefined_first: c.size_t,
    472 
    473 	//! Undefined glyph count (chars that have no mapping).
    474 	undefined_count: c.size_t,
    475 }
    476 
    477 //! Information passed to a \ref BLPathSinkFunc sink by \ref BLFont::get_glyph_outlines().
    478 GlyphOutlineSinkInfo :: struct {
    479 	glyph_index:   c.size_t,
    480 	contour_count: c.size_t,
    481 }
    482 
    483 //! Font coverage information struct provides information about ranges of unicode characters supported by a font-face.
    484 //!
    485 //! \remarks The information is stored in "OS/2" table in TTF/OTF font. Blend2D reads this information and populates
    486 //! `BLFontCoverageInfo` struct from such data, however, there is no guarantee that what font describes is actually
    487 //! true.
    488 FontCoverageInfo :: struct {
    489 	//! \name Members
    490 	//! \{
    491 	
    492 	//! Unicode coverage data as a bit array of 4 32-bit unsigned integers.
    493 	data: [4]u32,
    494 }
    495 
    496 //! Font PANOSE classification.
    497 FontPanoseInfo :: struct {
    498 	using _: struct #raw_union {
    499 		data:        [10]u8,
    500 		family_kind: u8,
    501 
    502 		text: struct {
    503 			family_kind:      u8,
    504 			serif_style:      u8,
    505 			weight:           u8,
    506 			proportion:       u8,
    507 			contrast:         u8,
    508 			stroke_variation: u8,
    509 			arm_style:        u8,
    510 			letterform:       u8,
    511 			midline:          u8,
    512 			x_height:         u8,
    513 		},
    514 
    515 		script: struct {
    516 			family_kind:  u8,
    517 			tool_kind:    u8,
    518 			weight:       u8,
    519 			spacing:      u8,
    520 			aspect_ratio: u8,
    521 			contrast:     u8,
    522 			topology:     u8,
    523 			form:         u8,
    524 			finials:      u8,
    525 			x_ascent:     u8,
    526 		},
    527 
    528 		decorative: struct {
    529 			family_kind:      u8,
    530 			decorative_class: u8,
    531 			weight:           u8,
    532 			aspect:           u8,
    533 			contrast:         u8,
    534 			serif_variant:    u8,
    535 			treatment:        u8,
    536 			lining:           u8,
    537 			topology:         u8,
    538 			character_range:  u8,
    539 		},
    540 
    541 		symbol: struct {
    542 			family_kind:               u8,
    543 			symbol_kind:               u8,
    544 			weight:                    u8,
    545 			spacing:                   u8,
    546 			aspect_ratio_and_contrast: u8,
    547 			aspect_ratio_94:           u8,
    548 			aspect_ratio_119:          u8,
    549 			aspect_ratio_157:          u8,
    550 			aspect_ratio_163:          u8,
    551 			aspect_ratio_211:          u8,
    552 		},
    553 	},
    554 }
    555 
    556 //! 2x2 transformation matrix used by \ref BLFont. It's similar to \ref BLMatrix2D,
    557 //! however, it doesn't provide a translation part as it's assumed to be zero.
    558 FontMatrix :: struct {
    559 	using _: struct #raw_union {
    560 		m: [4]f64,
    561 
    562 		using _: struct {
    563 			m00: f64,
    564 			m01: f64,
    565 			m10: f64,
    566 			m11: f64,
    567 		},
    568 	},
    569 }
    570 
    571 //! Scaled \ref BLFontDesignMetrics based on font size and other properties.
    572 FontMetrics :: struct {
    573 	//! Font size.
    574 	size: f32,
    575 
    576 	using _: struct #raw_union {
    577 		using _: struct {
    578 			//! Font ascent (horizontal orientation).
    579 			ascent: f32,
    580 
    581 			//! Font ascent (vertical orientation).
    582 			v_ascent: f32,
    583 
    584 			//! Font descent (horizontal orientation).
    585 			descent: f32,
    586 
    587 			//! Font descent (vertical orientation).
    588 			v_descent: f32,
    589 		},
    590 
    591 		using _: struct {
    592 			ascent_by_orientation:  [2]f32,
    593 			descent_by_orientation: [2]f32,
    594 		},
    595 	},
    596 
    597 	//! Line gap.
    598 	line_gap: f32,
    599 
    600 	//! Distance between the baseline and the mean line of lower-case letters.
    601 	x_height: f32,
    602 
    603 	//! Maximum height of a capital letter above the baseline.
    604 	cap_height: f32,
    605 
    606 	//! Minimum x, reported by the font.
    607 	x_min: f32,
    608 
    609 	//! Minimum y, reported by the font.
    610 	y_min: f32,
    611 
    612 	//! Maximum x, reported by the font.
    613 	x_max: f32,
    614 
    615 	//! Maximum y, reported by the font.
    616 	y_max: f32,
    617 
    618 	//! Text underline position.
    619 	underline_position: f32,
    620 
    621 	//! Text underline thickness.
    622 	underline_thickness: f32,
    623 
    624 	//! Text strikethrough position.
    625 	strikethrough_position: f32,
    626 
    627 	//! Text strikethrough thickness.
    628 	strikethrough_thickness: f32,
    629 }
    630 
    631 //! Design metrics of a font.
    632 //!
    633 //! Design metrics is information that \ref BLFontFace collected directly from the font data. It means that all
    634 //! fields are measured in font design units.
    635 //!
    636 //! When a new \ref BLFont instance is created a scaled metrics \ref BLFontMetrics is automatically calculated
    637 //! from \ref BLFontDesignMetrics including other members like transformation, etc...
    638 FontDesignMetrics :: struct {
    639 	//! Units per EM square.
    640 	units_per_em: i32,
    641 
    642 	//! Lowest readable size in pixels.
    643 	lowest_ppem: i32,
    644 
    645 	//! Line gap.
    646 	line_gap: i32,
    647 
    648 	//! Distance between the baseline and the mean line of lower-case letters.
    649 	x_height: i32,
    650 
    651 	//! Maximum height of a capital letter above the baseline.
    652 	cap_height: i32,
    653 
    654 	using _: struct #raw_union {
    655 		using _: struct {
    656 			//! Ascent (horizontal layout).
    657 			ascent: i32,
    658 
    659 			//! Ascent (vertical layout).
    660 			v_ascent: i32,
    661 
    662 			//! Descent (horizontal layout).
    663 			descent: i32,
    664 
    665 			//! Descent (vertical layout).
    666 			v_descent: i32,
    667 
    668 			//! Minimum leading-side bearing (horizontal layout).
    669 			h_min_lsb: i32,
    670 
    671 			//! Minimum leading-side bearing (vertical layout).
    672 			v_min_lsb: i32,
    673 
    674 			//! Minimum trailing-side bearing (horizontal layout).
    675 			h_min_tsb: i32,
    676 
    677 			//! Minimum trailing-side bearing (vertical layout).
    678 			v_min_tsb: i32,
    679 
    680 			//! Maximum advance (horizontal layout).
    681 			h_max_advance: i32,
    682 
    683 			//! Maximum advance (vertical layout).
    684 			v_max_advance: i32,
    685 		},
    686 
    687 		using _: struct {
    688 			//! Horizontal & vertical ascents.
    689 			ascent_by_orientation: [2]i32,
    690 
    691 			//! Horizontal & vertical descents.
    692 			descent_by_orientation: [2]i32,
    693 
    694 			//! Minimum leading-side bearing (horizontal and vertical).
    695 			min_lsb_by_orientation: [2]i32,
    696 
    697 			//! Minimum trailing-side bearing (horizontal and vertical)..
    698 			min_tsb_by_orientation: [2]i32,
    699 
    700 			//! Maximum advance width (horizontal) and height (vertical).
    701 			max_advance_by_orientation: [2]i32,
    702 		},
    703 	},
    704 
    705 	//! Aggregated bounding box of all glyphs in the font.
    706 	//!
    707 	//! \note This value is reported by the font data so it's not granted to be true.
    708 	glyph_bounding_box: BoxI,
    709 
    710 	//! Text underline position.
    711 	underline_position: i32,
    712 
    713 	//! Text underline thickness.
    714 	underline_thickness: i32,
    715 
    716 	//! Text strikethrough position.
    717 	strikethrough_position: i32,
    718 
    719 	//! Text strikethrough thickness.
    720 	strikethrough_thickness: i32,
    721 }
    722 
    723 //! Text metrics.
    724 TextMetrics :: struct {
    725 	advance:          Point,
    726 	leading_bearing:  Point,
    727 	trailing_bearing: Point,
    728 	bounding_box:     Box,
    729 }
    730