├── .gitignore ├── freetype.nimble ├── freetype ├── ftcffdrv.nim ├── ttunpat.nim ├── ftttdrv.nim ├── ftlzw.nim ├── ftbzip2.nim ├── ftbbox.nim ├── ftsynth.nim ├── ftfntfmt.nim ├── ftsizes.nim ├── ftgzip.nim ├── ftgasp.nim ├── ftautoh.nim ├── ftadvanc.nim ├── ftcid.nim ├── ftlcdfil.nim ├── ftpfr.nim ├── ftimport.nim ├── ftsnames.nim ├── ftbitmap.nim ├── ftbdf.nim ├── ftotval.nim ├── ftlist.nim ├── fttrigon.nim ├── ftmac.nim ├── ftsystem.nim ├── ftincrem.nim ├── ftmoderr.nim ├── ftmm.nim ├── fttypes.nim ├── ftwinfnt.nim ├── ftgxval.nim ├── ftoutln.nim ├── ftstroke.nim ├── ftmodapi.nim ├── ftcache.nim ├── tttags.nim ├── ftglyph.nim ├── tttables.nim ├── fterrdef.nim ├── ftimage.nim ├── t1tables.nim ├── freetype.nim └── ttnameid.nim ├── README.md ├── LICENSE.TXT ├── freetype.nim └── .github └── workflows └── ci.yml /.gitignore: -------------------------------------------------------------------------------- 1 | nimcache 2 | master 3 | *.exe 4 | -------------------------------------------------------------------------------- /freetype.nimble: -------------------------------------------------------------------------------- 1 | # Package 2 | 3 | version = "0.1.2" 4 | author = "Andri Lim" 5 | description = "FreeType2 library wrapper" 6 | license = "MIT" 7 | installDirs = @["freetype"] 8 | 9 | 10 | # Dependencies 11 | 12 | requires "nim >= 1.2.0" 13 | -------------------------------------------------------------------------------- /freetype/ftcffdrv.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | const 9 | FT_CFF_HINTING_FREETYPE* = 0 10 | FT_CFF_HINTING_ADOBE* = 1 11 | -------------------------------------------------------------------------------- /freetype/ttunpat.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes 9 | 10 | const 11 | FT_PARAM_TAG_UNPATENTED_HINTING * = FT_MAKE_TAG( 'u', 'n', 'p', 'a' ) 12 | -------------------------------------------------------------------------------- /freetype/ftttdrv.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | const 9 | TT_INTERPRETER_VERSION_35* = 35 10 | TT_INTERPRETER_VERSION_38* = 38 11 | TT_INTERPRETER_VERSION_40* = 40 12 | -------------------------------------------------------------------------------- /freetype/ftlzw.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, ftsystem 9 | include ftimport 10 | 11 | proc FT_Stream_OpenLZW*(stream: FT_Stream; source: FT_Stream): FT_Error {.ftimport.} 12 | -------------------------------------------------------------------------------- /freetype/ftbzip2.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, ftsystem 9 | include ftimport 10 | 11 | proc FT_Stream_OpenBzip2*(stream: FT_Stream; source: FT_Stream): FT_Error {.ftimport.} 12 | -------------------------------------------------------------------------------- /freetype/ftbbox.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, ftimage 9 | include ftimport 10 | 11 | proc FT_Outline_Get_BBox*(outline: ptr FT_Outline; abbox: ptr FT_BBox): FT_Error {.ftimport.} 12 | -------------------------------------------------------------------------------- /freetype/ftsynth.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import freetype 9 | include ftimport 10 | 11 | proc FT_GlyphSlot_Embolden*(slot: FT_GlyphSlot) {.ftimport.} 12 | 13 | proc FT_GlyphSlot_Oblique*(slot: FT_GlyphSlot) {.ftimport.} 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FreeType 2 | 3 | ![nimble](https://img.shields.io/badge/available%20on-nimble-yellow.svg?style=flat-square) 4 | ![license](https://img.shields.io/github/license/citycide/cascade.svg?style=flat-square) 5 | ![Github action](https://github.com/jangko/freetype/workflows/CI/badge.svg) 6 | 7 | For documentation or how to use the library, please take a look at [here](https://www.freetype.org/) 8 | -------------------------------------------------------------------------------- /freetype/ftfntfmt.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import freetype 9 | include ftimport 10 | 11 | proc FT_Get_Font_Format*(face: FT_Face): ptr cchar {.ftimport.} 12 | 13 | proc FT_Get_X11_Font_Format*(face: FT_Face): ptr cchar {.ftimport.} 14 | -------------------------------------------------------------------------------- /freetype/ftsizes.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype 9 | include ftimport 10 | 11 | proc FT_New_Size*(face: FT_Face; size: ptr FT_Size): FT_Error {.ftimport.} 12 | 13 | proc FT_Done_Size*(size: FT_Size): FT_Error {.ftimport.} 14 | 15 | proc FT_Activate_Size*(size: FT_Size): FT_Error {.ftimport.} 16 | -------------------------------------------------------------------------------- /freetype/ftgzip.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, ftsystem 9 | include ftimport 10 | 11 | proc FT_Stream_OpenGzip*(stream: FT_Stream; source: FT_Stream): FT_Error {.ftimport.} 12 | 13 | proc FT_Gzip_Uncompress*(memory: FT_Memory; output: ptr FT_Byte; 14 | output_len: ptr FT_ULong; input: ptr FT_Byte; input_len: FT_ULong): FT_Error {.ftimport.} 15 | -------------------------------------------------------------------------------- /freetype/ftgasp.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype 9 | include ftimport 10 | 11 | const 12 | FT_GASP_NO_TABLE* = - 1 13 | FT_GASP_DO_GRIDFIT* = 0x00000001 14 | FT_GASP_DO_GRAY* = 0x00000002 15 | FT_GASP_SYMMETRIC_SMOOTHING* = 0x00000008 16 | FT_GASP_SYMMETRIC_GRIDFIT* = 0x00000010 17 | 18 | proc FT_Get_Gasp*(face: FT_Face; ppem: FT_UInt): FT_Int {.ftimport.} 19 | -------------------------------------------------------------------------------- /freetype/ftautoh.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype 9 | include ftimport 10 | 11 | const 12 | FT_AUTOHINTER_SCRIPT_NONE* = 0 13 | FT_AUTOHINTER_SCRIPT_LATIN* = 1 14 | FT_AUTOHINTER_SCRIPT_CJK* = 2 15 | FT_AUTOHINTER_SCRIPT_INDIC* = 3 16 | 17 | type 18 | FT_Prop_GlyphToScriptMap* = object 19 | face*: FT_Face 20 | map*: ptr FT_UShort 21 | 22 | FT_Prop_IncreaseXHeight* = object 23 | face*: FT_Face 24 | limit*: FT_UInt 25 | -------------------------------------------------------------------------------- /freetype/ftadvanc.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import freetype, fttypes 9 | include ftimport 10 | 11 | const 12 | FT_ADVANCE_FLAG_FAST_ONLY* = 0x20000000 13 | 14 | proc FT_Get_Advance*(face: FT_Face; gindex: FT_UInt; load_flags: FT_Int32; 15 | padvance: ptr FT_Fixed): FT_Error {.ftimport.} 16 | 17 | proc FT_Get_Advances*(face: FT_Face; start: FT_UInt; count: FT_UInt; 18 | load_flags: FT_Int32; padvances: ptr FT_Fixed): FT_Error {.ftimport.} 19 | -------------------------------------------------------------------------------- /freetype/ftcid.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype 9 | include ftimport 10 | 11 | proc FT_Get_CID_Registry_Ordering_Supplement*(face: FT_Face; 12 | registry: ptr ptr cchar; ordering: ptr ptr cchar; supplement: ptr FT_Int): FT_Error {.ftimport.} 13 | 14 | proc FT_Get_CID_Is_Internally_CID_Keyed*(face: FT_Face; is_cid: ptr FT_Bool): FT_Error {.ftimport.} 15 | 16 | proc FT_Get_CID_From_Glyph_Index*(face: FT_Face; glyph_index: FT_UInt; 17 | cid: ptr FT_UInt): FT_Error {.ftimport.} 18 | -------------------------------------------------------------------------------- /freetype/ftlcdfil.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype 9 | include ftimport 10 | 11 | type 12 | FT_LcdFilter* = enum 13 | FT_LCD_FILTER_NONE = 0, FT_LCD_FILTER_DEFAULT = 1, FT_LCD_FILTER_LIGHT = 2, 14 | FT_LCD_FILTER_LEGACY1 = 3, FT_LCD_FILTER_LEGACY = 16, FT_LCD_FILTER_MAX 15 | 16 | 17 | proc FT_Library_SetLcdFilter*(library: FT_Library; filter: FT_LcdFilter): FT_Error {.ftimport.} 18 | 19 | proc FT_Library_SetLcdFilterWeights*(library: FT_Library; weights: ptr uint8): FT_Error {.ftimport.} 20 | -------------------------------------------------------------------------------- /freetype/ftpfr.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype, ftimage 9 | include ftimport 10 | 11 | proc FT_Get_PFR_Metrics*(face: FT_Face; aoutline_resolution: ptr FT_UInt; 12 | ametrics_resolution: ptr FT_UInt; ametrics_x_scale: ptr FT_Fixed; 13 | ametrics_y_scale: ptr FT_Fixed): FT_Error {.ftimport.} 14 | 15 | proc FT_Get_PFR_Kerning*(face: FT_Face; left: FT_UInt; right: FT_UInt; 16 | avector: ptr FT_Vector): FT_Error {.ftimport.} 17 | 18 | proc FT_Get_PFR_Advance*(face: FT_Face; gindex: FT_UInt; aadvance: ptr FT_Pos): FT_Error {.ftimport.} 19 | -------------------------------------------------------------------------------- /freetype/ftimport.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | when defined(MACOSX): 9 | const FT_LIB_NAME* = "libfreetype(-6|.6|).dylib" 10 | elif defined(UNIX): 11 | const FT_LIB_NAME* = "libfreetype.so.6" 12 | else: 13 | const FT_LIB_NAME* = "libfreetype-6.dll" 14 | 15 | when defined(emscripten): 16 | {.passL: "-sUSE_FREETYPE=1".} 17 | {.pragma: ftimport, cdecl, importc.} 18 | elif defined(freetypeStatic): 19 | when defined(vcc): 20 | {.link: "freetype.lib".} 21 | else: 22 | {.passL: "-lfreetype".} 23 | 24 | {.pragma: ftimport, cdecl, importc.} 25 | else: 26 | {.pragma: ftimport, cdecl, importc, dynlib: FT_LIB_NAME.} 27 | 28 | {.pragma: ftcallback, cdecl.} 29 | -------------------------------------------------------------------------------- /freetype/ftsnames.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype 9 | include ftimport 10 | 11 | type 12 | FT_SfntName* = object 13 | platform_id*: FT_UShort 14 | encoding_id*: FT_UShort 15 | language_id*: FT_UShort 16 | name_id*: FT_UShort 17 | string*: ptr FT_Byte 18 | string_len*: FT_UInt 19 | 20 | proc FT_Get_Sfnt_Name_Count*(face: FT_Face): FT_UInt {.ftimport.} 21 | 22 | proc FT_Get_Sfnt_Name*(face: FT_Face; idx: FT_UInt; aname: ptr FT_SfntName): FT_Error {.ftimport.} 23 | 24 | const 25 | FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY* = FT_MAKE_TAG('i', 'g', 'p', 'f') 26 | FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY* = FT_MAKE_TAG('i', 'g', 'p', 's') 27 | -------------------------------------------------------------------------------- /freetype/ftbitmap.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype, ftimage 9 | include ftimport 10 | 11 | proc FT_Bitmap_Init*(abitmap: var FT_Bitmap) {.ftimport.} 12 | 13 | proc FT_Bitmap_New*(abitmap: var FT_Bitmap) {.ftimport.} 14 | 15 | proc FT_Bitmap_Copy*(library: FT_Library; 16 | source: var FT_Bitmap; target: var FT_Bitmap): FT_Error {.ftimport.} 17 | 18 | proc FT_Bitmap_Embolden*(library: FT_Library; bitmap: var FT_Bitmap, 19 | xStrength: FT_Pos; yStrength: FT_Pos): FT_Error {.ftimport.} 20 | 21 | proc FT_Bitmap_Convert*(library: FT_Library; source: var FT_Bitmap; 22 | target: var FT_Bitmap; alignment: FT_Int): FT_Error {.ftimport.} 23 | 24 | proc FT_GlyphSlot_Own_Bitmap*(slot: FT_GlyphSlot): FT_Error {.ftimport.} 25 | 26 | proc FT_Bitmap_Done*(library: FT_Library; bitmap: var FT_Bitmap): FT_Error {.ftimport.} 27 | -------------------------------------------------------------------------------- /freetype/ftbdf.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype 9 | include ftimport 10 | 11 | type 12 | INNER_C_UNION_3982941592* {.union.} = object 13 | atom*: ptr cchar 14 | integer*: FT_Int32 15 | cardinal*: FT_UInt32 16 | 17 | BDF_PropertyType* = enum 18 | BDF_PROPERTY_TYPE_NONE = 0, BDF_PROPERTY_TYPE_ATOM = 1, 19 | BDF_PROPERTY_TYPE_INTEGER = 2, BDF_PROPERTY_TYPE_CARDINAL = 3 20 | 21 | BDF_Property* = ptr BDF_PropertyRec 22 | 23 | BDF_PropertyRec* = object 24 | typ*: BDF_PropertyType 25 | u*: INNER_C_UNION_3982941592 26 | 27 | proc FT_Get_BDF_Charset_ID*(face: FT_Face; acharset_encoding: ptr cstring; 28 | acharset_registry: ptr cstring): FT_Error {.ftimport.} 29 | proc FT_Get_BDF_Property*(face: FT_Face; prop_name: cstring; 30 | aproperty: var BDF_PropertyRec): FT_Error {.ftimport.} 31 | -------------------------------------------------------------------------------- /freetype/ftotval.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype 9 | include ftimport 10 | 11 | const 12 | FT_VALIDATE_BASE* = 0x00000100 13 | FT_VALIDATE_GDEF* = 0x00000200 14 | FT_VALIDATE_GPOS* = 0x00000400 15 | FT_VALIDATE_GSUB* = 0x00000800 16 | FT_VALIDATE_JSTF* = 0x00001000 17 | FT_VALIDATE_MATH* = 0x00002000 18 | FT_VALIDATE_OT* = (FT_VALIDATE_BASE or FT_VALIDATE_GDEF or FT_VALIDATE_GPOS or 19 | FT_VALIDATE_GSUB or FT_VALIDATE_JSTF or FT_VALIDATE_MATH) 20 | 21 | proc FT_OpenType_Validate*(face: FT_Face; validation_flags: FT_UInt; 22 | BASE_table: ptr FT_Bytes; GDEF_table: ptr FT_Bytes; 23 | GPOS_table: ptr FT_Bytes; GSUB_table: ptr FT_Bytes; 24 | JSTF_table: ptr FT_Bytes): FT_Error {.ftimport.} 25 | 26 | proc FT_OpenType_Free*(face: FT_Face; table: FT_Bytes){.ftimport.} 27 | -------------------------------------------------------------------------------- /freetype/ftlist.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, ftsystem 9 | include ftimport 10 | 11 | proc FT_List_Find*(list: FT_List; data: pointer): FT_ListNode {.ftimport.} 12 | 13 | proc FT_List_Add*(list: FT_List; node: FT_ListNode){.ftimport.} 14 | 15 | proc FT_List_Insert*(list: FT_List; node: FT_ListNode){.ftimport.} 16 | 17 | proc FT_List_Remove*(list: FT_List; node: FT_ListNode){.ftimport.} 18 | 19 | proc FT_List_Up*(list: FT_List; node: FT_ListNode){.ftimport.} 20 | 21 | type 22 | FT_List_Iterator* = proc(node: FT_ListNode; user: pointer): FT_Error {.ftcallback.} 23 | 24 | proc FT_List_Iterate*(list: FT_List; `iterator`: FT_List_Iterator; user: pointer): FT_Error {.ftimport.} 25 | 26 | type 27 | FT_List_Destructor* = proc(memory: FT_Memory; data: pointer; user: pointer) {.ftcallback.} 28 | 29 | proc FT_List_Finalize*(list: FT_List; destroy: FT_List_Destructor; memory: FT_Memory; 30 | user: pointer) {.ftimport.} 31 | -------------------------------------------------------------------------------- /LICENSE.TXT: -------------------------------------------------------------------------------- 1 | FreeType, Nim wrapper for FreeType2 Library 2 | 3 | Copyright (c) 2017 Andri Lim 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /freetype/fttrigon.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, ftimage 9 | include ftimport 10 | 11 | type FT_Angle* = FT_Fixed 12 | 13 | const 14 | FT_ANGLE_PI* = 180 shl 16 15 | FT_ANGLE_2PI* = FT_ANGLE_PI * 2 16 | FT_ANGLE_PI2* = FT_ANGLE_PI / 2 17 | FT_ANGLE_PI4* = FT_ANGLE_PI / 4 18 | 19 | proc FT_Sin*(angle: FT_Angle): FT_Fixed {.ft_import.} 20 | proc FT_Cos*(angle: FT_Angle): FT_Fixed {.ft_import.} 21 | proc FT_Tan*(angle: FT_Angle): FT_Fixed {.ft_import.} 22 | proc FT_Atan2*(x, y: FT_Fixed): FT_Angle {.ft_import.} 23 | proc FT_Angle_Diff*(angle1, angle2: FT_Angle): FT_Angle {.ft_import.} 24 | proc FT_Vector_Unit*(vec: var FT_Vector, angle: FT_Angle) {.ft_import.} 25 | proc FT_Vector_Rotate*(vec: var FT_Vector, angle: FT_Angle) {.ft_import.} 26 | proc FT_Vector_Length*(vec: var FT_Vector): FT_Fixed {.ft_import.} 27 | proc FT_Vector_Polarize*(vec: var FT_Vector, length: var FT_Fixed, angle: var FT_Angle) {.ft_import.} 28 | proc FT_Vector_From_Polar*(vec: var FT_Vector, length: FT_Fixed, angle: FT_Angle) {.ft_import.} 29 | -------------------------------------------------------------------------------- /freetype/ftmac.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype 9 | include ftimport 10 | 11 | type 12 | Handle = pointer 13 | PFSSpec = pointer 14 | PFSRef = pointer 15 | 16 | proc FT_New_Face_From_FOND*(library: FT_Library; fond: Handle; face_index: FT_Long; 17 | aface: ptr FT_Face): FT_Error {.ftimport, deprecated.} 18 | 19 | proc FT_GetFile_From_Mac_Name*(fontName: ptr cchar; pathSpec: PFSSpec; 20 | face_index: ptr FT_Long): FT_Error {.ftimport, deprecated.} 21 | 22 | proc FT_GetFile_From_Mac_ATS_Name*(fontName: ptr cchar; pathSpec: PFSSpec; 23 | face_index: ptr FT_Long): FT_Error {.ftimport, deprecated.} 24 | 25 | proc FT_GetFilePath_From_Mac_ATS_Name*(fontName: ptr cchar; path: ptr FT_UInt8; 26 | maxPathSize: FT_UInt32; face_index: ptr FT_Long): FT_Error {.ftimport, deprecated.} 27 | 28 | proc FT_New_Face_From_FSSpec*(library: FT_Library; spec: PFSSpec; 29 | face_index: FT_Long; aface: ptr FT_Face): FT_Error {.ftimport, deprecated.} 30 | 31 | proc FT_New_Face_From_FSRef*(library: FT_Library; `ref`: PFSRef; 32 | face_index: FT_Long; aface: ptr FT_Face): FT_Error {.ftimport, deprecated.} 33 | -------------------------------------------------------------------------------- /freetype.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import freetype/[ 9 | freetype, ftadvanc, 10 | ftautoh, ftbbox, 11 | ftbdf, ftbitmap, 12 | ftbzip2, ftcache, 13 | ftcffdrv, ftcid, 14 | fterrdef, ftfntfmt, 15 | ftgasp, ftglyph, 16 | ftgxval, ftgzip, 17 | ftimage, ftimport, 18 | ftincrem, ftlcdfil, 19 | ftlist, ftlzw, 20 | ftmac, ftmm, 21 | ftmodapi, ftmoderr, 22 | ftotval, ftoutln, 23 | ftpfr, ftsizes, 24 | ftsnames, ftstroke, 25 | ftsynth, ftsystem, 26 | fttrigon, ftttdrv, 27 | fttypes, ftwinfnt, 28 | t1tables, ttnameid, 29 | tttables, tttags, 30 | ttunpat] 31 | 32 | export 33 | freetype, ftadvanc, 34 | ftautoh, ftbbox, 35 | ftbdf, ftbitmap, 36 | ftbzip2, ftcache, 37 | ftcffdrv, ftcid, 38 | fterrdef, ftfntfmt, 39 | ftgasp, ftglyph, 40 | ftgxval, ftgzip, 41 | ftimage, ftimport, 42 | ftincrem, ftlcdfil, 43 | ftlist, ftlzw, 44 | ftmac, ftmm, 45 | ftmodapi, ftmoderr, 46 | ftotval, ftoutln, 47 | ftpfr, ftsizes, 48 | ftsnames, ftstroke, 49 | ftsynth, ftsystem, 50 | fttrigon, ftttdrv, 51 | fttypes, ftwinfnt, 52 | t1tables, ttnameid, 53 | tttables, tttags, 54 | ttunpat 55 | -------------------------------------------------------------------------------- /freetype/ftsystem.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | include ftimport 9 | 10 | type 11 | FT_Memory* = ptr FT_MemoryRec 12 | 13 | FT_Alloc_Func* = proc(memory: FT_Memory; size: clong): pointer {.ftcallback.} 14 | 15 | FT_Free_Func* = proc(memory: FT_Memory; `block`: pointer) {.ftcallback.} 16 | 17 | FT_Realloc_Func* = proc(memory: FT_Memory; cur_size: clong; new_size: clong; 18 | `block`: pointer): pointer {.ftcallback.} 19 | 20 | FT_MemoryRec* = object 21 | user*: pointer 22 | alloc*: FT_Alloc_Func 23 | free*: FT_Free_Func 24 | realloc*: FT_Realloc_Func 25 | 26 | FT_Stream* = ptr FT_StreamRec 27 | 28 | FT_StreamDesc* {.union.} = object 29 | value*: clong 30 | pointer*: pointer 31 | 32 | FT_Stream_IoFunc* = proc(stream: FT_Stream; offset: culong; buffer: cstring; 33 | count: culong): culong {.ftcallback.} 34 | 35 | FT_Stream_CloseFunc* = proc(stream: FT_Stream) {.ftcallback.} 36 | 37 | FT_StreamRec* = object 38 | base*: cstring 39 | size*: culong 40 | pos*: culong 41 | descriptor*: FT_StreamDesc 42 | pathname*: FT_StreamDesc 43 | read*: FT_Stream_IoFunc 44 | close*: FT_Stream_CloseFunc 45 | memory*: FT_Memory 46 | cursor*: cstring 47 | limit*: cstring 48 | -------------------------------------------------------------------------------- /freetype/ftincrem.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes 9 | include ftimport 10 | 11 | type 12 | FT_Incremental* = distinct pointer #ptr FT_IncrementalRec 13 | 14 | FT_Incremental_MetricsRec* = object 15 | bearing_x*: FT_Long 16 | bearing_y*: FT_Long 17 | advance*: FT_Long 18 | advance_v*: FT_Long 19 | 20 | FT_Incremental_Metrics* = ptr FT_Incremental_MetricsRec 21 | 22 | FT_Incremental_GetGlyphDataFunc* = proc(incremental: FT_Incremental; 23 | glyph_index: FT_UInt; adata: ptr FT_Data): FT_Error {.ftcallback.} 24 | 25 | FT_Incremental_FreeGlyphDataFunc* = proc(incremental: FT_Incremental; 26 | data: ptr FT_Data) {.ftcallback.} 27 | 28 | FT_Incremental_GetGlyphMetricsFunc* = proc(incremental: FT_Incremental; 29 | glyph_index: FT_UInt; vertical: FT_Bool; 30 | ametrics: ptr FT_Incremental_MetricsRec): FT_Error {.ftcallback.} 31 | 32 | FT_Incremental_FuncsRec* = object 33 | get_glyph_data*: FT_Incremental_GetGlyphDataFunc 34 | free_glyph_data*: FT_Incremental_FreeGlyphDataFunc 35 | get_glyph_metrics*: FT_Incremental_GetGlyphMetricsFunc 36 | 37 | FT_Incremental_InterfaceRec* = object 38 | funcs*: ptr FT_Incremental_FuncsRec 39 | `object`*: FT_Incremental 40 | 41 | FT_Incremental_Interface* = ptr FT_Incremental_InterfaceRec 42 | 43 | const 44 | FT_PARAM_TAG_INCREMENTAL* = FT_MAKE_TAG('i', 'n', 'c', 'r') 45 | -------------------------------------------------------------------------------- /freetype/ftmoderr.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, tables 9 | 10 | FT_ERROR_DEF(FT_ModErr): [ 11 | {Base, 0x000, "base module"}, 12 | {Autofit, 0x100, "autofitter module"}, 13 | {BDF, 0x200, "BDF module"}, 14 | {Bzip2, 0x300, "Bzip2 module"}, 15 | {Cache, 0x400, "cache module"}, 16 | {CFF, 0x500, "CFF module"}, 17 | {CID, 0x600, "CID module"}, 18 | {Gzip, 0x700, "Gzip module"}, 19 | {LZW, 0x800, "LZW module"}, 20 | {OTvalid, 0x900, "OpenType validation module"}, 21 | {PCF, 0xA00, "PCF module"}, 22 | {PFR, 0xB00, "PFR module"}, 23 | {PSaux, 0xC00, "PS auxiliary module"}, 24 | {PShinter, 0xD00, "PS hinter module"}, 25 | {PSnames, 0xE00, "PS names module"}, 26 | {Raster, 0xF00, "raster module"}, 27 | {SFNT, 0x1000, "SFNT module"}, 28 | {Smooth, 0x1100, "smooth raster module"}, 29 | {TrueType, 0x1200, "TrueType module"}, 30 | {Type1, 0x1300, "Type 1 module"}, 31 | {Type42, 0x1400, "Type 42 module"}, 32 | {Winfonts, 0x1500, "Windows FON/FNT module"}, 33 | {GXvalid, 0x1600, "GX validation module"}] 34 | 35 | type 36 | FT_ModErr_Msg* = object 37 | errors: TableRef[int, string] 38 | 39 | proc newModErrMsg*(): FT_ModErr_Msg = 40 | result.errors = FT_ModErr_Table.newTable() 41 | 42 | proc errorMessage*(self: FT_ModErr_Msg, errorCode: int): string = 43 | if self.errors.hasKey(errorCode): 44 | result = self.errors[errorCode] 45 | else: 46 | result = "" 47 | -------------------------------------------------------------------------------- /freetype/ftmm.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype, t1tables 9 | include ftimport 10 | 11 | type 12 | FT_MM_Axis* = object 13 | name*: ptr FT_String 14 | minimum*: FT_Long 15 | maximum*: FT_Long 16 | 17 | FT_Multi_Master* = object 18 | num_axis*: FT_UInt 19 | num_designs*: FT_UInt 20 | axis*: array[T1_MAX_MM_AXIS, FT_MM_Axis] 21 | 22 | FT_Var_Axis* = object 23 | name*: ptr FT_String 24 | minimum*: FT_Fixed 25 | def*: FT_Fixed 26 | maximum*: FT_Fixed 27 | tag*: FT_ULong 28 | strid*: FT_UInt 29 | 30 | FT_Var_Named_Style* = object 31 | coords*: ptr FT_Fixed 32 | strid*: FT_UInt 33 | psid*: FT_UInt 34 | 35 | FT_MM_Var* = object 36 | num_axis*: FT_UInt 37 | num_designs*: FT_UInt 38 | num_namedstyles*: FT_UInt 39 | axis*: ptr FT_Var_Axis 40 | namedstyle*: ptr FT_Var_Named_Style 41 | 42 | 43 | proc FT_Get_Multi_Master*(face: FT_Face; amaster: ptr FT_Multi_Master): FT_Error {.ftimport.} 44 | 45 | proc FT_Get_MM_Var*(face: FT_Face; amaster: ptr ptr FT_MM_Var): FT_Error {.ftimport.} 46 | 47 | proc FT_Set_MM_Design_Coordinates*(face: FT_Face; num_coords: FT_UInt; 48 | coords: ptr FT_Long): FT_Error {.ftimport.} 49 | 50 | proc FT_Set_Var_Design_Coordinates*(face: FT_Face; num_coords: FT_UInt; 51 | coords: ptr FT_Fixed): FT_Error {.ftimport.} 52 | 53 | proc FT_Get_Var_Design_Coordinates*(face: FT_Face; num_coords: FT_UInt; 54 | coords: ptr FT_Fixed): FT_Error {.ftimport.} 55 | 56 | proc FT_Set_MM_Blend_Coordinates*(face: FT_Face; num_coords: FT_UInt; 57 | coords: ptr FT_Fixed): FT_Error {.ftimport.} 58 | 59 | proc FT_Get_MM_Blend_Coordinates*(face: FT_Face; num_coords: FT_UInt; 60 | coords: ptr FT_Fixed): FT_Error {.ftimport.} 61 | 62 | proc FT_Set_Var_Blend_Coordinates*(face: FT_Face; num_coords: FT_UInt; 63 | coords: ptr FT_Fixed): FT_Error {.ftimport.} 64 | 65 | proc FT_Get_Var_Blend_Coordinates*(face: FT_Face; num_coords: FT_UInt; 66 | coords: ptr FT_Fixed): FT_Error {.ftimport.} 67 | -------------------------------------------------------------------------------- /freetype/fttypes.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | include ftimport 9 | 10 | type 11 | FT_Uint8* = uint8 12 | FT_Uint32* = uint32 13 | FT_Int32* = int32 14 | FT_Bool* = uint8 15 | FT_FWord* = cshort 16 | FT_UFWord* = cushort 17 | FT_Char* = cchar 18 | FT_Byte* = uint8 19 | FT_Bytes* = ptr FT_Byte 20 | FT_Tag* = FT_UInt32 21 | FT_String* = cchar 22 | FT_Short* = cshort 23 | FT_UShort* = cushort 24 | FT_Int* = cint 25 | FT_UInt* = cuint 26 | FT_Long* = clong 27 | FT_ULong* = culong 28 | FT_F2Dot14* = cshort 29 | FT_F26Dot6* = clong 30 | FT_Fixed* = clong 31 | FT_Error* = cint 32 | FT_Pointer* = pointer 33 | FT_Offset* = csize_t 34 | 35 | #ft_ptrdiff_t FT_PtrDist; 36 | 37 | proc FT_MAKE_TAG*[T](x1, x2, x3, x4: T): FT_Tag {.compileTime.} = 38 | result = FT_Tag( 39 | (FT_ULong(x1) shl 24 ) or 40 | (FT_ULong(x2) shl 16 ) or 41 | (FT_ULong(x3) shl 8 ) or 42 | FT_ULong(x4) ) 43 | 44 | 45 | type 46 | FT_Generic_Finalizer* = proc(obj: pointer) {.ftcallback.} 47 | 48 | FT_Generic* = object 49 | data: pointer 50 | finalizer: FT_Generic_Finalizer 51 | 52 | FT_UnitVector* = object 53 | x, y: FT_F2Dot14 54 | 55 | FT_Matrix* = object 56 | xx, xy: FT_Fixed 57 | yx, yy: FT_Fixed 58 | 59 | FT_Data* = object 60 | pointer: ptr FT_Byte 61 | length: FT_Int 62 | 63 | FT_ListNode* = ptr FT_ListNodeRec 64 | 65 | FT_List* = ptr FT_ListRec 66 | 67 | FT_ListNodeRec* = object 68 | prev, next: FT_ListNode 69 | data: pointer 70 | 71 | FT_ListRec* = object 72 | head, tail: FT_ListNode 73 | 74 | template FT_IS_EMPTY*(list: untyped): untyped = 75 | ( (list).head == nil ) 76 | 77 | import macros, strutils 78 | 79 | macro FT_ERROR_DEF*(name: untyped, body: untyped): untyped = 80 | var list = "const\n" 81 | var table = "const\n $1_Table* = {\n" % [$name] 82 | 83 | for x in body[0]: 84 | list.add(" $1_$2* = $3\n" % [$name, $x[0], $x[1].intVal]) 85 | table.add(" $1: \"$2\",\n" % [$x[1].intVal, $x[2]]) 86 | 87 | table.add " }\n" 88 | 89 | result = parseStmt(list & table) 90 | -------------------------------------------------------------------------------- /freetype/ftwinfnt.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype 9 | include ftimport 10 | 11 | const 12 | FT_WinFNT_ID_CP1252* = 0 13 | FT_WinFNT_ID_DEFAULT* = 1 14 | FT_WinFNT_ID_SYMBOL* = 2 15 | FT_WinFNT_ID_MAC* = 77 16 | FT_WinFNT_ID_CP932* = 128 17 | FT_WinFNT_ID_CP949* = 129 18 | FT_WinFNT_ID_CP1361* = 130 19 | FT_WinFNT_ID_CP936* = 134 20 | FT_WinFNT_ID_CP950* = 136 21 | FT_WinFNT_ID_CP1253* = 161 22 | FT_WinFNT_ID_CP1254* = 162 23 | FT_WinFNT_ID_CP1258* = 163 24 | FT_WinFNT_ID_CP1255* = 177 25 | FT_WinFNT_ID_CP1256* = 178 26 | FT_WinFNT_ID_CP1257* = 186 27 | FT_WinFNT_ID_CP1251* = 204 28 | FT_WinFNT_ID_CP874* = 222 29 | FT_WinFNT_ID_CP1250* = 238 30 | FT_WinFNT_ID_OEM* = 255 31 | 32 | type 33 | FT_WinFNT_HeaderRec* = object 34 | version*: FT_UShort 35 | file_size*: FT_ULong 36 | copyright*: array[60, FT_Byte] 37 | file_type*: FT_UShort 38 | nominal_point_size*: FT_UShort 39 | vertical_resolution*: FT_UShort 40 | horizontal_resolution*: FT_UShort 41 | ascent*: FT_UShort 42 | internal_leading*: FT_UShort 43 | external_leading*: FT_UShort 44 | italic*: FT_Byte 45 | underline*: FT_Byte 46 | strike_out*: FT_Byte 47 | weight*: FT_UShort 48 | charset*: FT_Byte 49 | pixel_width*: FT_UShort 50 | pixel_height*: FT_UShort 51 | pitch_and_family*: FT_Byte 52 | avg_width*: FT_UShort 53 | max_width*: FT_UShort 54 | first_char*: FT_Byte 55 | last_char*: FT_Byte 56 | default_char*: FT_Byte 57 | break_char*: FT_Byte 58 | bytes_per_row*: FT_UShort 59 | device_offset*: FT_ULong 60 | face_name_offset*: FT_ULong 61 | bits_pointer*: FT_ULong 62 | bits_offset*: FT_ULong 63 | reserved*: FT_Byte 64 | flags*: FT_ULong 65 | A_space*: FT_UShort 66 | B_space*: FT_UShort 67 | C_space*: FT_UShort 68 | color_table_offset*: FT_UShort 69 | reserved1*: array[4, FT_ULong] 70 | 71 | FT_WinFNT_Header* = ptr FT_WinFNT_HeaderRec 72 | 73 | proc FT_Get_WinFNT_Header*(face: FT_Face; aheader: ptr FT_WinFNT_HeaderRec): FT_Error {.ftimport.} 74 | -------------------------------------------------------------------------------- /freetype/ftgxval.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype 9 | include ftimport 10 | 11 | const 12 | FT_VALIDATE_feat_INDEX* = 0 13 | FT_VALIDATE_mort_INDEX* = 1 14 | FT_VALIDATE_morx_INDEX* = 2 15 | FT_VALIDATE_bsln_INDEX* = 3 16 | FT_VALIDATE_just_INDEX* = 4 17 | FT_VALIDATE_kern_INDEX* = 5 18 | FT_VALIDATE_opbd_INDEX* = 6 19 | FT_VALIDATE_trak_INDEX* = 7 20 | FT_VALIDATE_prop_INDEX* = 8 21 | FT_VALIDATE_lcar_INDEX* = 9 22 | FT_VALIDATE_GX_LAST_INDEX* = FT_VALIDATE_lcar_INDEX 23 | FT_VALIDATE_GX_LENGTH* = (FT_VALIDATE_GX_LAST_INDEX + 1) 24 | FT_VALIDATE_GX_START* = 0x00004000 25 | 26 | template FT_VALIDATE_GX_BITFIELD(tag: untyped): untyped = 27 | (FT_VALIDATE_GX_START shl `FT_VALIDATE tag INDEX`) 28 | 29 | const 30 | FT_VALIDATE_feat* = FT_VALIDATE_GX_BITFIELD(feat) 31 | FT_VALIDATE_mort* = FT_VALIDATE_GX_BITFIELD(mort) 32 | FT_VALIDATE_morx* = FT_VALIDATE_GX_BITFIELD(morx) 33 | FT_VALIDATE_bsln* = FT_VALIDATE_GX_BITFIELD(bsln) 34 | FT_VALIDATE_just* = FT_VALIDATE_GX_BITFIELD(just) 35 | FT_VALIDATE_kern* = FT_VALIDATE_GX_BITFIELD(kern) 36 | FT_VALIDATE_opbd* = FT_VALIDATE_GX_BITFIELD(opbd) 37 | FT_VALIDATE_trak* = FT_VALIDATE_GX_BITFIELD(trak) 38 | FT_VALIDATE_prop* = FT_VALIDATE_GX_BITFIELD(prop) 39 | FT_VALIDATE_lcar* = FT_VALIDATE_GX_BITFIELD(lcar) 40 | FT_VALIDATE_GX* = (FT_VALIDATE_feat or FT_VALIDATE_mort or FT_VALIDATE_morx or 41 | FT_VALIDATE_bsln or FT_VALIDATE_just or FT_VALIDATE_kern or FT_VALIDATE_opbd or 42 | FT_VALIDATE_trak or FT_VALIDATE_prop or FT_VALIDATE_lcar) 43 | 44 | proc FT_TrueTypeGX_Validate*(face: FT_Face; validation_flags: FT_UInt; 45 | tables: array[FT_VALIDATE_GX_LENGTH, FT_Bytes]; table_length: FT_UInt): FT_Error {.ftimport.} 46 | 47 | proc FT_TrueTypeGX_Free*(face: FT_Face; table: FT_Bytes){.ftimport.} 48 | 49 | const 50 | FT_VALIDATE_MS* = (FT_VALIDATE_GX_START shl 0) 51 | FT_VALIDATE_APPLE* = (FT_VALIDATE_GX_START shl 1) 52 | FT_VALIDATE_CKERN* = (FT_VALIDATE_MS or FT_VALIDATE_APPLE) 53 | 54 | proc FT_ClassicKern_Validate*(face: FT_Face; validation_flags: FT_UInt; 55 | ckern_table: ptr FT_Bytes): FT_Error {.ftimport.} 56 | 57 | proc FT_ClassicKern_Free*(face: FT_Face; table: FT_Bytes){.ftimport.} 58 | -------------------------------------------------------------------------------- /freetype/ftoutln.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype, ftimage, ftsystem 9 | include ftimport 10 | 11 | proc FT_Outline_Decompose*(outline: var FT_Outline; func_interface: var FT_Outline_Funcs; 12 | user: pointer): FT_Error {.ftimport.} 13 | 14 | proc decompose*(outline: var FT_Outline; funcInterface: var FT_Outline_Funcs; 15 | user: pointer): FT_Error {.inline.} = 16 | FT_Outline_Decompose(outline, funcInterface, user) 17 | 18 | proc FT_Outline_New*(library: FT_Library; numPoints: FT_UInt; numContours: FT_Int; 19 | anoutline: var FT_Outline): FT_Error {.ftimport.} 20 | 21 | proc FT_Outline_New_Internal*(memory: FT_Memory; numPoints: FT_UInt; 22 | numContours: FT_Int; anoutline: var FT_Outline): FT_Error {.ftimport.} 23 | 24 | proc FT_Outline_Done*(library: FT_Library; outline: var FT_Outline): FT_Error {.ftimport.} 25 | 26 | proc FT_Outline_Done_Internal*(memory: FT_Memory; outline: var FT_Outline): FT_Error {.ftimport.} 27 | 28 | proc FT_Outline_Check*(outline: var FT_Outline): FT_Error {.ftimport.} 29 | 30 | proc FT_Outline_Get_CBox*(outline: var FT_Outline; acbox: var FT_BBox){.ftimport.} 31 | 32 | proc FT_Outline_Translate*(outline: var FT_Outline; xOffset: FT_Pos; yOffset: FT_Pos){.ftimport.} 33 | 34 | proc FT_Outline_Copy*(source: var FT_Outline; target: var FT_Outline): FT_Error {.ftimport.} 35 | 36 | proc FT_Outline_Transform*(outline: var FT_Outline; matrix: var FT_Matrix){.ftimport.} 37 | 38 | proc FT_Outline_Embolden*(outline: var FT_Outline; strength: FT_Pos): FT_Error {.ftimport.} 39 | 40 | proc FT_Outline_EmboldenXY*(outline: var FT_Outline; xstrength: FT_Pos; 41 | ystrength: FT_Pos): FT_Error {.ftimport.} 42 | 43 | proc FT_Outline_Reverse*(outline: var FT_Outline){.ftimport.} 44 | 45 | proc FT_Outline_Get_Bitmap*(library: FT_Library; outline: var FT_Outline; 46 | abitmap: var FT_Bitmap): FT_Error {.ftimport.} 47 | 48 | proc FT_Outline_Render*(library: FT_Library; outline: var FT_Outline; 49 | params: var FT_Raster_Params): FT_Error {.ftimport.} 50 | 51 | type 52 | FT_Orientation* = enum 53 | FT_ORIENTATION_TRUETYPE = 0, FT_ORIENTATION_POSTSCRIPT = 1, FT_ORIENTATION_NONE 54 | 55 | const 56 | FT_ORIENTATION_FILL_RIGHT* = FT_ORIENTATION_TRUETYPE 57 | FT_ORIENTATION_FILL_LEFT* = FT_ORIENTATION_POSTSCRIPT 58 | 59 | proc FT_Outline_Get_Orientation*(outline: var FT_Outline): FT_Orientation {.ftimport.} 60 | -------------------------------------------------------------------------------- /freetype/ftstroke.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype, ftimage, ftglyph 9 | include ftimport 10 | 11 | type 12 | FT_Stroker* = distinct pointer #ptr FT_StrokerRec 13 | 14 | FT_Stroker_LineJoin* = enum 15 | FT_STROKER_LINEJOIN_ROUND = 0, FT_STROKER_LINEJOIN_BEVEL = 1, 16 | FT_STROKER_LINEJOIN_MITER_VARIABLE = 2, FT_STROKER_LINEJOIN_MITER_FIXED = 3 17 | 18 | FT_Stroker_LineCap* = enum 19 | FT_STROKER_LINECAP_BUTT = 0, FT_STROKER_LINECAP_ROUND, FT_STROKER_LINECAP_SQUARE 20 | 21 | FT_StrokerBorder* = enum 22 | FT_STROKER_BORDER_LEFT = 0, FT_STROKER_BORDER_RIGHT 23 | 24 | const 25 | FT_STROKER_LINEJOIN_MITER* = FT_STROKER_LINEJOIN_MITER_VARIABLE 26 | 27 | proc FT_Outline_GetInsideBorder*(outline: var FT_Outline): FT_StrokerBorder {.ftimport.} 28 | 29 | proc FT_Outline_GetOutsideBorder*(outline: var FT_Outline): FT_StrokerBorder {.ftimport.} 30 | 31 | proc FT_Stroker_New*(library: FT_Library; astroker: var FT_Stroker): FT_Error {.ftimport.} 32 | 33 | proc FT_Stroker_Set*(stroker: FT_Stroker; radius: FT_Fixed; line_cap: FT_Stroker_LineCap; 34 | line_join: FT_Stroker_LineJoin; miter_limit: FT_Fixed) {.ftimport.} 35 | 36 | proc FT_Stroker_Rewind*(stroker: FT_Stroker) {.ftimport.} 37 | 38 | proc FT_Stroker_ParseOutline*(stroker: FT_Stroker; outline: var FT_Outline; 39 | opened: FT_Bool): FT_Error {.ftimport.} 40 | 41 | proc FT_Stroker_BeginSubPath*(stroker: FT_Stroker; to: var FT_Vector; open: FT_Bool): FT_Error {.ftimport.} 42 | 43 | proc FT_Stroker_EndSubPath*(stroker: FT_Stroker): FT_Error {.ftimport.} 44 | 45 | proc FT_Stroker_LineTo*(stroker: FT_Stroker; to: var FT_Vector): FT_Error {.ftimport.} 46 | 47 | proc FT_Stroker_ConicTo*(stroker: FT_Stroker; control, to: var FT_Vector): FT_Error {.ftimport.} 48 | 49 | proc FT_Stroker_CubicTo*(stroker: FT_Stroker; control1, control2, to: var FT_Vector): FT_Error {.ftimport.} 50 | 51 | proc FT_Stroker_GetBorderCounts*(stroker: FT_Stroker; border: FT_StrokerBorder; 52 | anum_points, anum_contours: var FT_UInt): FT_Error {.ftimport.} 53 | 54 | proc FT_Stroker_ExportBorder*(stroker: FT_Stroker; border: FT_StrokerBorder; 55 | outline: var FT_Outline) {.ftimport.} 56 | 57 | proc FT_Stroker_GetCounts*(stroker: FT_Stroker; 58 | anum_points, anum_contours: var FT_UInt): FT_Error {.ftimport.} 59 | 60 | proc FT_Stroker_Export*(stroker: FT_Stroker; outline: var FT_Outline) {.ftimport.} 61 | 62 | proc FT_Stroker_Done*(stroker: FT_Stroker) {.ftimport.} 63 | 64 | proc FT_Glyph_Stroke*(pglyph: var FT_Glyph; stroker: FT_Stroker; destroy: FT_Bool): FT_Error {.ftimport.} 65 | 66 | proc FT_Glyph_StrokeBorder*(pglyph: var FT_Glyph; stroker: FT_Stroker; 67 | inside: FT_Bool; destroy: FT_Bool): FT_Error {.ftimport.} 68 | -------------------------------------------------------------------------------- /freetype/ftmodapi.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype, ftsystem 9 | include ftimport 10 | 11 | const 12 | FT_MODULE_FONT_DRIVER* = 1 13 | FT_MODULE_RENDERER* = 2 14 | FT_MODULE_HINTER* = 4 15 | FT_MODULE_STYLER* = 8 16 | FT_MODULE_DRIVER_SCALABLE* = 0x00000100 17 | FT_MODULE_DRIVER_NO_OUTLINES* = 0x00000200 18 | FT_MODULE_DRIVER_HAS_HINTER* = 0x00000400 19 | FT_MODULE_DRIVER_HINTS_LIGHTLY* = 0x00000800 20 | ft_module_font_driver* = FT_MODULE_FONT_DRIVER 21 | ft_module_renderer* = FT_MODULE_RENDERER 22 | ft_module_hinter* = FT_MODULE_HINTER 23 | ft_module_styler* = FT_MODULE_STYLER 24 | ft_module_driver_scalable* = FT_MODULE_DRIVER_SCALABLE 25 | ft_module_driver_no_outlines* = FT_MODULE_DRIVER_NO_OUTLINES 26 | ft_module_driver_has_hinter* = FT_MODULE_DRIVER_HAS_HINTER 27 | ft_module_driver_hints_lightly* = FT_MODULE_DRIVER_HINTS_LIGHTLY 28 | 29 | type 30 | FT_Module_Interface* = FT_Pointer 31 | FT_Module_Constructor* = proc(module: FT_Module): FT_Error {.ftcallback.} 32 | FT_Module_Destructor* = proc(module: FT_Module) {.ftcallback.} 33 | FT_Module_Requester* = proc(module: FT_Module; name: ptr cchar): FT_Module_Interface {.ftcallback.} 34 | 35 | FT_Module_Class* = object 36 | module_flags*: FT_ULong 37 | module_size*: FT_Long 38 | module_name*: ptr FT_String 39 | module_version*: FT_Fixed 40 | module_requires*: FT_Fixed 41 | module_interface*: pointer 42 | module_init*: FT_Module_Constructor 43 | module_done*: FT_Module_Destructor 44 | get_interface*: FT_Module_Requester 45 | 46 | 47 | proc FT_Add_Module*(library: FT_Library; clazz: ptr FT_Module_Class): FT_Error {.ftimport.} 48 | proc FT_Get_Module*(library: FT_Library; module_name: ptr cchar): FT_Module {.ftimport.} 49 | proc FT_Remove_Module*(library: FT_Library; module: FT_Module): FT_Error {.ftimport.} 50 | proc FT_Property_Set*(library: FT_Library; module_name: ptr FT_String; 51 | property_name: ptr FT_String; value: pointer): FT_Error {.ftimport.} 52 | proc FT_Property_Get*(library: FT_Library; module_name: ptr FT_String; 53 | property_name: ptr FT_String; value: pointer): FT_Error {.ftimport.} 54 | proc FT_Reference_Library*(library: FT_Library): FT_Error {.ftimport.} 55 | proc FT_New_Library*(memory: FT_Memory; alibrary: ptr FT_Library): FT_Error {.ftimport.} 56 | proc FT_Done_Library*(library: FT_Library): FT_Error {.ftimport.} 57 | 58 | type 59 | FT_DebugHook_Func* = proc(arg: pointer) {.ftcallback.} 60 | 61 | proc FT_Set_Debug_Hook*(library: FT_Library; hook_index: FT_UInt; 62 | debug_hook: FT_DebugHook_Func) {.ftimport.} 63 | proc FT_Add_Default_Modules*(library: FT_Library) {.ftimport.} 64 | 65 | type 66 | FT_TrueTypeEngineType* = enum 67 | FT_TRUETYPE_ENGINE_TYPE_NONE = 0, FT_TRUETYPE_ENGINE_TYPE_UNPATENTED, 68 | FT_TRUETYPE_ENGINE_TYPE_PATENTED 69 | 70 | proc FT_Get_TrueType_Engine_Type*(library: FT_Library): FT_TrueTypeEngineType {.ftimport.} 71 | -------------------------------------------------------------------------------- /freetype/ftcache.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype, ftglyph 9 | include ftimport 10 | 11 | type 12 | FTC_FaceID* = FT_Pointer 13 | FTC_Face_Requester* = proc(face_id: FTC_FaceID; library: FT_Library; 14 | req_data: FT_Pointer; aface: var FT_Face): FT_Error {.ftcallback.} 15 | FTC_Manager* = distinct pointer#ptr FTC_ManagerRec 16 | FTC_Node* = distinct pointer#ptr FTC_NodeRec 17 | 18 | proc FTC_Manager_New*(library: FT_Library; max_faces: FT_UInt; max_sizes: FT_UInt; 19 | max_bytes: FT_ULong; requester: FTC_Face_Requester; req_data: FT_Pointer; 20 | amanager: var FTC_Manager): FT_Error {.ftimport.} 21 | 22 | proc FTC_Manager_Reset*(manager: FTC_Manager) {.ftimport.} 23 | 24 | proc FTC_Manager_Done*(manager: FTC_Manager) {.ftimport.} 25 | 26 | proc FTC_Manager_LookupFace*(manager: FTC_Manager; face_id: FTC_FaceID; 27 | aface: var FT_Face): FT_Error {.ftimport.} 28 | 29 | type 30 | FTC_ScalerRec* = object 31 | face_id*: FTC_FaceID 32 | width*: FT_UInt 33 | height*: FT_UInt 34 | pixel*: FT_Int 35 | x_res*: FT_UInt 36 | y_res*: FT_UInt 37 | 38 | FTC_Scaler* = ptr FTC_ScalerRec 39 | 40 | proc FTC_Manager_LookupSize*(manager: FTC_Manager; scaler: FTC_Scaler; 41 | asize: ptr FT_Size): FT_Error {.ftimport.} 42 | 43 | proc FTC_Node_Unref*(node: FTC_Node; manager: FTC_Manager) {.ftimport.} 44 | 45 | proc FTC_Manager_RemoveFaceID*(manager: FTC_Manager; face_id: FTC_FaceID) {.ftimport.} 46 | 47 | type 48 | FTC_CMapCache* = distinct pointer #ptr FTC_CMapCacheRec 49 | 50 | proc FTC_CMapCache_New*(manager: FTC_Manager; acache: ptr FTC_CMapCache): FT_Error {.ftimport.} 51 | 52 | proc FTC_CMapCache_Lookup*(cache: FTC_CMapCache; face_id: FTC_FaceID; 53 | cmap_index: FT_Int; char_code: FT_UInt32): FT_UInt {.ftimport.} 54 | 55 | type 56 | FTC_ImageTypeRec* = object 57 | face_id*: FTC_FaceID 58 | width*: FT_UInt 59 | height*: FT_UInt 60 | flags*: FT_Int32 61 | 62 | FTC_ImageType* = ptr FTC_ImageTypeRec 63 | 64 | template FTC_IMAGE_TYPE_COMPARE*(d1, d2: untyped): untyped = 65 | ((d1).face_id == (d2).face_id and (d1).width == (d2).width and (d1).flags == (d2).flags) 66 | 67 | type 68 | FTC_ImageCache* = distinct pointer #ptr FTC_ImageCacheRec 69 | 70 | proc FTC_ImageCache_New*(manager: FTC_Manager; acache: var FTC_ImageCache): FT_Error {.ftimport.} 71 | 72 | proc FTC_ImageCache_Lookup*(cache: FTC_ImageCache; `type`: FTC_ImageType; 73 | gindex: FT_UInt; aglyph: var FT_Glyph; anode: var FTC_Node): FT_Error {.ftimport.} 74 | 75 | proc FTC_ImageCache_LookupScaler*(cache: FTC_ImageCache; scaler: FTC_Scaler; 76 | load_flags: FT_ULong; gindex: FT_UInt; aglyph: var FT_Glyph; anode: var FTC_Node): FT_Error {.ftimport.} 77 | 78 | type 79 | FTC_SBit* = ptr FTC_SBitRec 80 | 81 | FTC_SBitRec* = object 82 | width*: FT_Byte 83 | height*: FT_Byte 84 | left*: FT_Char 85 | top*: FT_Char 86 | format*: FT_Byte 87 | max_grays*: FT_Byte 88 | pitch*: FT_Short 89 | xadvance*: FT_Char 90 | yadvance*: FT_Char 91 | buffer*: ptr FT_Byte 92 | 93 | FTC_SBitCache* = distinct pointer#ptr FTC_SBitCacheRec 94 | 95 | proc FTC_SBitCache_New*(manager: FTC_Manager; acache: var FTC_SBitCache): FT_Error {.ftimport.} 96 | 97 | proc FTC_SBitCache_Lookup*(cache: FTC_SBitCache; `type`: FTC_ImageType; 98 | gindex: FT_UInt; sbit: var FTC_SBit; anode: var FTC_Node): FT_Error {.ftimport.} 99 | 100 | proc FTC_SBitCache_LookupScaler*(cache: FTC_SBitCache; scaler: FTC_Scaler; 101 | load_flags: FT_ULong; gindex: FT_UInt; sbit: var FTC_SBit; anode: var FTC_Node): FT_Error {.ftimport.} 102 | -------------------------------------------------------------------------------- /freetype/tttags.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes 9 | 10 | const 11 | TTAG_avar* = FT_MAKE_TAG( 'a', 'v', 'a', 'r' ) 12 | TTAG_BASE* = FT_MAKE_TAG( 'B', 'A', 'S', 'E' ) 13 | TTAG_bdat* = FT_MAKE_TAG( 'b', 'd', 'a', 't' ) 14 | TTAG_BDF * = FT_MAKE_TAG( 'B', 'D', 'F', ' ' ) 15 | TTAG_bhed* = FT_MAKE_TAG( 'b', 'h', 'e', 'd' ) 16 | TTAG_bloc* = FT_MAKE_TAG( 'b', 'l', 'o', 'c' ) 17 | TTAG_bsln* = FT_MAKE_TAG( 'b', 's', 'l', 'n' ) 18 | TTAG_CBDT* = FT_MAKE_TAG( 'C', 'B', 'D', 'T' ) 19 | TTAG_CBLC* = FT_MAKE_TAG( 'C', 'B', 'L', 'C' ) 20 | TTAG_CFF * = FT_MAKE_TAG( 'C', 'F', 'F', ' ' ) 21 | TTAG_CFF2* = FT_MAKE_TAG( 'C', 'F', 'F', '2' ) 22 | TTAG_CID * = FT_MAKE_TAG( 'C', 'I', 'D', ' ' ) 23 | TTAG_cmap* = FT_MAKE_TAG( 'c', 'm', 'a', 'p' ) 24 | TTAG_cvar* = FT_MAKE_TAG( 'c', 'v', 'a', 'r' ) 25 | TTAG_cvt * = FT_MAKE_TAG( 'c', 'v', 't', ' ' ) 26 | TTAG_DSIG* = FT_MAKE_TAG( 'D', 'S', 'I', 'G' ) 27 | TTAG_EBDT* = FT_MAKE_TAG( 'E', 'B', 'D', 'T' ) 28 | TTAG_EBLC* = FT_MAKE_TAG( 'E', 'B', 'L', 'C' ) 29 | TTAG_EBSC* = FT_MAKE_TAG( 'E', 'B', 'S', 'C' ) 30 | TTAG_feat* = FT_MAKE_TAG( 'f', 'e', 'a', 't' ) 31 | TTAG_FOND* = FT_MAKE_TAG( 'F', 'O', 'N', 'D' ) 32 | TTAG_fpgm* = FT_MAKE_TAG( 'f', 'p', 'g', 'm' ) 33 | TTAG_fvar* = FT_MAKE_TAG( 'f', 'v', 'a', 'r' ) 34 | TTAG_gasp* = FT_MAKE_TAG( 'g', 'a', 's', 'p' ) 35 | TTAG_GDEF* = FT_MAKE_TAG( 'G', 'D', 'E', 'F' ) 36 | TTAG_glyf* = FT_MAKE_TAG( 'g', 'l', 'y', 'f' ) 37 | TTAG_GPOS* = FT_MAKE_TAG( 'G', 'P', 'O', 'S' ) 38 | TTAG_GSUB* = FT_MAKE_TAG( 'G', 'S', 'U', 'B' ) 39 | TTAG_gvar* = FT_MAKE_TAG( 'g', 'v', 'a', 'r' ) 40 | TTAG_HVAR* = FT_MAKE_TAG( 'H', 'V', 'A', 'R' ) 41 | TTAG_hdmx* = FT_MAKE_TAG( 'h', 'd', 'm', 'x' ) 42 | TTAG_head* = FT_MAKE_TAG( 'h', 'e', 'a', 'd' ) 43 | TTAG_hhea* = FT_MAKE_TAG( 'h', 'h', 'e', 'a' ) 44 | TTAG_hmtx* = FT_MAKE_TAG( 'h', 'm', 't', 'x' ) 45 | TTAG_JSTF* = FT_MAKE_TAG( 'J', 'S', 'T', 'F' ) 46 | TTAG_just* = FT_MAKE_TAG( 'j', 'u', 's', 't' ) 47 | TTAG_kern* = FT_MAKE_TAG( 'k', 'e', 'r', 'n' ) 48 | TTAG_lcar* = FT_MAKE_TAG( 'l', 'c', 'a', 'r' ) 49 | TTAG_loca* = FT_MAKE_TAG( 'l', 'o', 'c', 'a' ) 50 | TTAG_LTSH* = FT_MAKE_TAG( 'L', 'T', 'S', 'H' ) 51 | TTAG_LWFN* = FT_MAKE_TAG( 'L', 'W', 'F', 'N' ) 52 | TTAG_MATH* = FT_MAKE_TAG( 'M', 'A', 'T', 'H' ) 53 | TTAG_maxp* = FT_MAKE_TAG( 'm', 'a', 'x', 'p' ) 54 | TTAG_META* = FT_MAKE_TAG( 'M', 'E', 'T', 'A' ) 55 | TTAG_MMFX* = FT_MAKE_TAG( 'M', 'M', 'F', 'X' ) 56 | TTAG_MMSD* = FT_MAKE_TAG( 'M', 'M', 'S', 'D' ) 57 | TTAG_mort* = FT_MAKE_TAG( 'm', 'o', 'r', 't' ) 58 | TTAG_morx* = FT_MAKE_TAG( 'm', 'o', 'r', 'x' ) 59 | TTAG_MVAR* = FT_MAKE_TAG( 'M', 'V', 'A', 'R' ) 60 | TTAG_name* = FT_MAKE_TAG( 'n', 'a', 'm', 'e' ) 61 | TTAG_opbd* = FT_MAKE_TAG( 'o', 'p', 'b', 'd' ) 62 | TTAG_OS2 * = FT_MAKE_TAG( 'O', 'S', '/', '2' ) 63 | TTAG_OTTO* = FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) 64 | TTAG_PCLT* = FT_MAKE_TAG( 'P', 'C', 'L', 'T' ) 65 | TTAG_POST* = FT_MAKE_TAG( 'P', 'O', 'S', 'T' ) 66 | TTAG_post_small* = FT_MAKE_TAG( 'p', 'o', 's', 't' ) 67 | TTAG_prep* = FT_MAKE_TAG( 'p', 'r', 'e', 'p' ) 68 | TTAG_prop* = FT_MAKE_TAG( 'p', 'r', 'o', 'p' ) 69 | TTAG_sbix* = FT_MAKE_TAG( 's', 'b', 'i', 'x' ) 70 | TTAG_sfnt* = FT_MAKE_TAG( 's', 'f', 'n', 't' ) 71 | TTAG_SING* = FT_MAKE_TAG( 'S', 'I', 'N', 'G' ) 72 | TTAG_trak* = FT_MAKE_TAG( 't', 'r', 'a', 'k' ) 73 | TTAG_true* = FT_MAKE_TAG( 't', 'r', 'u', 'e' ) 74 | TTAG_ttc * = FT_MAKE_TAG( 't', 't', 'c', ' ' ) 75 | TTAG_ttcf* = FT_MAKE_TAG( 't', 't', 'c', 'f' ) 76 | TTAG_TYP1* = FT_MAKE_TAG( 'T', 'Y', 'P', '1' ) 77 | TTAG_typ1_small* = FT_MAKE_TAG( 't', 'y', 'p', '1' ) 78 | TTAG_VDMX* = FT_MAKE_TAG( 'V', 'D', 'M', 'X' ) 79 | TTAG_vhea* = FT_MAKE_TAG( 'v', 'h', 'e', 'a' ) 80 | TTAG_vmtx* = FT_MAKE_TAG( 'v', 'm', 't', 'x' ) 81 | TTAG_VVAR* = FT_MAKE_TAG( 'V', 'V', 'A', 'R' ) 82 | TTAG_wOFF* = FT_MAKE_TAG( 'w', 'O', 'F', 'F' ) 83 | -------------------------------------------------------------------------------- /freetype/ftglyph.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype, ftimage, ftmodapi 9 | include ftimport 10 | 11 | type 12 | FT_Glyph* = ptr FT_GlyphRec 13 | 14 | FT_GlyphRec* = object 15 | library*: FT_Library 16 | clazz*: ptr FT_Glyph_Class 17 | format*: FT_Glyph_Format 18 | advance*: FT_Vector 19 | 20 | FT_BitmapGlyph* = ptr FT_BitmapGlyphRec 21 | 22 | FT_BitmapGlyphRec* = object 23 | root*: FT_GlyphRec 24 | left*: FT_Int 25 | top*: FT_Int 26 | bitmap*: FT_Bitmap 27 | 28 | FT_OutlineGlyph* = ptr FT_OutlineGlyphRec 29 | 30 | FT_OutlineGlyphRec* = object 31 | root*: FT_GlyphRec 32 | outline*: FT_Outline 33 | 34 | FT_Glyph_InitFunc* = proc(glyph: FT_Glyph; slot: FT_GlyphSlot): FT_Error {.ftcallback.} 35 | FT_Glyph_DoneFunc* = proc(glyph: FT_Glyph) {.ftcallback.} 36 | FT_Glyph_TransformFunc* = proc(glyph: FT_Glyph; matrix: var FT_Matrix; 37 | delta: var FT_Vector) {.ftcallback.} 38 | FT_Glyph_GetBBoxFunc* = proc(glyph: FT_Glyph; abbox: var FT_BBox) {.ftcallback.} 39 | FT_Glyph_CopyFunc* = proc(source: FT_Glyph; target: FT_Glyph): FT_Error {.ftcallback.} 40 | FT_Glyph_PrepareFunc* = proc(glyph: FT_Glyph; slot: FT_GlyphSlot): FT_Error {.ftcallback.} 41 | 42 | FT_Glyph_Class* = object 43 | glyph_size*: FT_Long 44 | glyph_format*: FT_Glyph_Format 45 | glyph_init*: FT_Glyph_InitFunc 46 | glyph_done*: FT_Glyph_DoneFunc 47 | glyph_copy*: FT_Glyph_CopyFunc 48 | glyph_transform*: FT_Glyph_TransformFunc 49 | glyph_bbox*: FT_Glyph_GetBBoxFunc 50 | glyph_prepare*: FT_Glyph_PrepareFunc 51 | 52 | FT_Renderer_RenderFunc* = proc(renderer: FT_Renderer; slot: FT_GlyphSlot; 53 | mode: FT_UInt; origin: var FT_Vector): FT_Error {.ftcallback.} 54 | 55 | FT_Renderer_TransformFunc* = proc(renderer: FT_Renderer; slot: FT_GlyphSlot; 56 | matrix: var FT_Matrix; delta: var FT_Vector): FT_Error {.ftcallback.} 57 | 58 | FT_Renderer_GetCBoxFunc* = proc(renderer: FT_Renderer; slot: FT_GlyphSlot; 59 | cbox: var FT_BBox) {.ftcallback.} 60 | 61 | FT_Renderer_SetModeFunc* = proc(renderer: FT_Renderer; mode_tag: FT_ULong; 62 | mode_ptr: FT_Pointer): FT_Error {.ftcallback.} 63 | 64 | FTRenderer_render* = FT_Renderer_RenderFunc 65 | FTRenderer_transform* = FT_Renderer_TransformFunc 66 | FTRenderer_getCBox* = FT_Renderer_GetCBoxFunc 67 | FTRenderer_setMode* = FT_Renderer_SetModeFunc 68 | 69 | FT_Renderer_Class* = object 70 | root*: FT_Module_Class 71 | glyph_format*: FT_Glyph_Format 72 | render_glyph*: FT_Renderer_RenderFunc 73 | transform_glyph*: FT_Renderer_TransformFunc 74 | get_glyph_cbox*: FT_Renderer_GetCBoxFunc 75 | set_mode*: FT_Renderer_SetModeFunc 76 | raster_class*: ptr FT_Raster_Funcs 77 | 78 | proc FT_Get_Renderer*(library: FT_Library; format: FT_Glyph_Format): FT_Renderer {.ftimport.} 79 | 80 | proc FT_Set_Renderer*(library: FT_Library; renderer: FT_Renderer; 81 | num_params: FT_UInt; parameters: var FT_Parameter): FT_Error {.ftimport.} 82 | 83 | proc FT_Get_Glyph*(slot: FT_GlyphSlot; aglyph: var FT_Glyph): FT_Error {.ftimport.} 84 | proc FT_Glyph_Copy*(source: FT_Glyph; target: var FT_Glyph): FT_Error {.ftimport.} 85 | proc FT_Glyph_Transform*(glyph: FT_Glyph; matrix: var FT_Matrix; delta: var FT_Vector): FT_Error {.ftimport.} 86 | 87 | type 88 | FT_Glyph_BBox_Mode* = enum 89 | FT_GLYPH_BBOX_UNSCALED = 0, FT_GLYPH_BBOX_GRIDFIT = 1, FT_GLYPH_BBOX_TRUNCATE = 2, 90 | FT_GLYPH_BBOX_PIXELS = 3 91 | 92 | const 93 | FT_GLYPH_BBOX_SUBPIXELS* = FT_GLYPH_BBOX_UNSCALED 94 | ft_glyph_bbox_unscaled* = FT_GLYPH_BBOX_UNSCALED 95 | ft_glyph_bbox_subpixels* = FT_GLYPH_BBOX_SUBPIXELS 96 | ft_glyph_bbox_gridfit* = FT_GLYPH_BBOX_GRIDFIT 97 | ft_glyph_bbox_truncate* = FT_GLYPH_BBOX_TRUNCATE 98 | ft_glyph_bbox_pixels* = FT_GLYPH_BBOX_PIXELS 99 | 100 | proc FT_Glyph_Get_CBox*(glyph: FT_Glyph; bbox_mode: FT_UInt; acbox: var FT_BBox) {.ftimport.} 101 | 102 | proc FT_Glyph_To_Bitmap*(the_glyph: var FT_Glyph; render_mode: FT_Render_Mode; 103 | origin: var FT_Vector; destroy: FT_Bool): FT_Error {.ftimport.} 104 | 105 | proc FT_Done_Glyph*(glyph: FT_Glyph) {.ftimport.} 106 | 107 | proc FT_Matrix_Multiply*(a: var FT_Matrix; b: var FT_Matrix) {.ftimport.} 108 | 109 | proc FT_Matrix_Invert*(matrix: var FT_Matrix): FT_Error {.ftimport.} 110 | -------------------------------------------------------------------------------- /freetype/tttables.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, freetype 9 | include ftimport 10 | 11 | type 12 | TT_Header* = object 13 | Table_Version*: FT_Fixed 14 | Font_Revision*: FT_Fixed 15 | CheckSum_Adjust*: FT_Long 16 | Magic_Number*: FT_Long 17 | Flags*: FT_UShort 18 | Units_Per_EM*: FT_UShort 19 | Created*: array[2, FT_Long] 20 | Modified*: array[2, FT_Long] 21 | xMin*: FT_Short 22 | yMin*: FT_Short 23 | xMax*: FT_Short 24 | yMax*: FT_Short 25 | Mac_Style*: FT_UShort 26 | Lowest_Rec_PPEM*: FT_UShort 27 | Font_Direction*: FT_Short 28 | Index_To_Loc_Format*: FT_Short 29 | Glyph_Data_Format*: FT_Short 30 | 31 | TT_HoriHeader* = object 32 | Version*: FT_Fixed 33 | Ascender*: FT_Short 34 | Descender*: FT_Short 35 | Line_Gap*: FT_Short 36 | advance_Width_Max*: FT_UShort 37 | min_Left_Side_Bearing*: FT_Short 38 | min_Right_Side_Bearing*: FT_Short 39 | xMax_Extent*: FT_Short 40 | caret_Slope_Rise*: FT_Short 41 | caret_Slope_Run*: FT_Short 42 | caret_Offset*: FT_Short 43 | Reserved*: array[4, FT_Short] 44 | metric_Data_Format*: FT_Short 45 | number_Of_HMetrics*: FT_UShort 46 | long_metrics*: pointer 47 | short_metrics*: pointer 48 | 49 | TT_VertHeader* = object 50 | Version*: FT_Fixed 51 | Ascender*: FT_Short 52 | Descender*: FT_Short 53 | Line_Gap*: FT_Short 54 | advance_Height_Max*: FT_UShort 55 | min_Top_Side_Bearing*: FT_Short 56 | min_Bottom_Side_Bearing*: FT_Short 57 | yMax_Extent*: FT_Short 58 | caret_Slope_Rise*: FT_Short 59 | caret_Slope_Run*: FT_Short 60 | caret_Offset*: FT_Short 61 | Reserved*: array[4, FT_Short] 62 | metric_Data_Format*: FT_Short 63 | number_Of_VMetrics*: FT_UShort 64 | long_metrics*: pointer 65 | short_metrics*: pointer 66 | 67 | TT_OS2* = object 68 | version*: FT_UShort 69 | xAvgCharWidth*: FT_Short 70 | usWeightClass*: FT_UShort 71 | usWidthClass*: FT_UShort 72 | fsType*: FT_UShort 73 | ySubscriptXSize*: FT_Short 74 | ySubscriptYSize*: FT_Short 75 | ySubscriptXOffset*: FT_Short 76 | ySubscriptYOffset*: FT_Short 77 | ySuperscriptXSize*: FT_Short 78 | ySuperscriptYSize*: FT_Short 79 | ySuperscriptXOffset*: FT_Short 80 | ySuperscriptYOffset*: FT_Short 81 | yStrikeoutSize*: FT_Short 82 | yStrikeoutPosition*: FT_Short 83 | sFamilyClass*: FT_Short 84 | panose*: array[10, FT_Byte] 85 | ulUnicodeRange1*: FT_ULong 86 | ulUnicodeRange2*: FT_ULong 87 | ulUnicodeRange3*: FT_ULong 88 | ulUnicodeRange4*: FT_ULong 89 | achVendID*: array[4, FT_Char] 90 | fsSelection*: FT_UShort 91 | usFirstCharIndex*: FT_UShort 92 | usLastCharIndex*: FT_UShort 93 | sTypoAscender*: FT_Short 94 | sTypoDescender*: FT_Short 95 | sTypoLineGap*: FT_Short 96 | usWinAscent*: FT_UShort 97 | usWinDescent*: FT_UShort 98 | ulCodePageRange1*: FT_ULong 99 | ulCodePageRange2*: FT_ULong 100 | sxHeight*: FT_Short 101 | sCapHeight*: FT_Short 102 | usDefaultChar*: FT_UShort 103 | usBreakChar*: FT_UShort 104 | usMaxContext*: FT_UShort 105 | usLowerOpticalPointSize*: FT_UShort 106 | usUpperOpticalPointSize*: FT_UShort 107 | 108 | TT_Postscript* = object 109 | FormatType*: FT_Fixed 110 | italicAngle*: FT_Fixed 111 | underlinePosition*: FT_Short 112 | underlineThickness*: FT_Short 113 | isFixedPitch*: FT_ULong 114 | minMemType42*: FT_ULong 115 | maxMemType42*: FT_ULong 116 | minMemType1*: FT_ULong 117 | maxMemType1*: FT_ULong 118 | 119 | TT_PCLT* = object 120 | Version*: FT_Fixed 121 | FontNumber*: FT_ULong 122 | Pitch*: FT_UShort 123 | xHeight*: FT_UShort 124 | Style*: FT_UShort 125 | TypeFamily*: FT_UShort 126 | CapHeight*: FT_UShort 127 | SymbolSet*: FT_UShort 128 | TypeFace*: array[16, FT_Char] 129 | CharacterComplement*: array[8, FT_Char] 130 | FileName*: array[6, FT_Char] 131 | StrokeWeight*: FT_Char 132 | WidthType*: FT_Char 133 | SerifStyle*: FT_Byte 134 | Reserved*: FT_Byte 135 | 136 | TT_MaxProfile* = object 137 | version*: FT_Fixed 138 | numGlyphs*: FT_UShort 139 | maxPoints*: FT_UShort 140 | maxContours*: FT_UShort 141 | maxCompositePoints*: FT_UShort 142 | maxCompositeContours*: FT_UShort 143 | maxZones*: FT_UShort 144 | maxTwilightPoints*: FT_UShort 145 | maxStorage*: FT_UShort 146 | maxFunctionDefs*: FT_UShort 147 | maxInstructionDefs*: FT_UShort 148 | maxStackElements*: FT_UShort 149 | maxSizeOfInstructions*: FT_UShort 150 | maxComponentElements*: FT_UShort 151 | maxComponentDepth*: FT_UShort 152 | 153 | FT_Sfnt_Tag* = enum 154 | FT_SFNT_HEAD, FT_SFNT_MAXP, FT_SFNT_OS2, FT_SFNT_HHEA, FT_SFNT_VHEA, 155 | FT_SFNT_POST, FT_SFNT_PCLT, FT_SFNT_MAX 156 | 157 | const 158 | ft_sfnt_head* = FT_SFNT_HEAD 159 | ft_sfnt_maxp* = FT_SFNT_MAXP 160 | ft_sfnt_os2* = FT_SFNT_OS2 161 | ft_sfnt_hhea* = FT_SFNT_HHEA 162 | ft_sfnt_vhea* = FT_SFNT_VHEA 163 | ft_sfnt_post* = FT_SFNT_POST 164 | ft_sfnt_pclt* = FT_SFNT_PCLT 165 | 166 | proc FT_Get_Sfnt_Table*(face: FT_Face, tag: FT_Sfnt_Tag): pointer {.ft_import.} 167 | 168 | proc FT_Load_Sfnt_Table*(face: FT_Face, tag: FT_ULong, offset: FT_Long, 169 | buffer: ptr FT_Byte, length: ptr FT_ULong): FT_Error {.ft_import.} 170 | 171 | proc FT_Sfnt_Table_Info*(face: FT_Face, table_index: FT_UInt, 172 | tag: ptr FT_ULong, length: ptr FT_ULong): FT_Error {.ft_import.} 173 | 174 | proc FT_Get_CMap_Language_ID*(charmap: FT_CharMap): FT_ULong {.ft_import.} 175 | 176 | proc FT_Get_CMap_Format*(charmap: FT_CharMap): FT_Long {.ft_import.} 177 | -------------------------------------------------------------------------------- /freetype/fterrdef.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, tables 9 | 10 | FT_ERROR_DEF(FT_Err): [ 11 | {Ok, 0x00, "no error"}, 12 | {Cannot_Open_Resource, 0x01, "cannot open resource"}, 13 | {Unknown_File_Format, 0x02, "unknown file format"}, 14 | {Invalid_File_Format, 0x03, "broken file"}, 15 | {Invalid_Version, 0x04, "invalid FreeType version"}, 16 | {Lower_Module_Version, 0x05, "module version is too low"}, 17 | {Invalid_Argument, 0x06, "invalid argument"}, 18 | {Unimplemented_Feature, 0x07, "unimplemented feature"}, 19 | {Invalid_Table, 0x08, "broken table"}, 20 | {Invalid_Offset, 0x09, "broken offset within table"}, 21 | {Array_Too_Large, 0x0A, "array allocation size too large"}, 22 | {Missing_Module, 0x0B, "missing module"}, 23 | {Missing_Property, 0x0C, "missing property"}, 24 | {Invalid_Glyph_Index, 0x10, "invalid glyph index"}, 25 | {Invalid_Character_Code, 0x11, "invalid character code"}, 26 | {Invalid_Glyph_Format, 0x12, "unsupported glyph image format"}, 27 | {Cannot_Render_Glyph, 0x13, "cannot render this glyph format"}, 28 | {Invalid_Outline, 0x14, "invalid outline"}, 29 | {Invalid_Composite, 0x15, "invalid composite glyph"}, 30 | {Too_Many_Hints, 0x16, "too many hints"}, 31 | {Invalid_Pixel_Size, 0x17, "invalid pixel size"}, 32 | {Invalid_Handle, 0x20, "invalid object handle"}, 33 | {Invalid_Library_Handle, 0x21, "invalid library handle"}, 34 | {Invalid_Driver_Handle, 0x22, "invalid module handle"}, 35 | {Invalid_Face_Handle, 0x23, "invalid face handle"}, 36 | {Invalid_Size_Handle, 0x24, "invalid size handle"}, 37 | {Invalid_Slot_Handle, 0x25, "invalid glyph slot handle"}, 38 | {Invalid_CharMap_Handle, 0x26, "invalid charmap handle"}, 39 | {Invalid_Cache_Handle, 0x27, "invalid cache manager handle"}, 40 | {Invalid_Stream_Handle, 0x28, "invalid stream handle"}, 41 | {Too_Many_Drivers, 0x30, "too many modules"}, 42 | {Too_Many_Extensions, 0x31, "too many extensions"}, 43 | {Out_Of_Memory, 0x40, "out of memory"}, 44 | {Unlisted_Object, 0x41, "unlisted object"}, 45 | {Cannot_Open_Stream, 0x51, "cannot open stream"}, 46 | {Invalid_Stream_Seek, 0x52, "invalid stream seek"}, 47 | {Invalid_Stream_Skip, 0x53, "invalid stream skip"}, 48 | {Invalid_Stream_Read, 0x54, "invalid stream read"}, 49 | {Invalid_Stream_Operation, 0x55, "invalid stream operation"}, 50 | {Invalid_Frame_Operation, 0x56, "invalid frame operation"}, 51 | {Nested_Frame_Access, 0x57, "nested frame access"}, 52 | {Invalid_Frame_Read, 0x58, "invalid frame read"}, 53 | {Raster_Uninitialized, 0x60, "raster uninitialized"}, 54 | {Raster_Corrupted, 0x61, "raster corrupted"}, 55 | {Raster_Overflow, 0x62, "raster overflow"}, 56 | {Raster_Negative_Height, 0x63, "negative height while rastering"}, 57 | {Too_Many_Caches, 0x70, "too many registered caches"}, 58 | {Invalid_Opcode, 0x80, "invalid opcode"}, 59 | {Too_Few_Arguments, 0x81, "too few arguments"}, 60 | {Stack_Overflow, 0x82, "stack overflow"}, 61 | {Code_Overflow, 0x83, "code overflow"}, 62 | {Bad_Argument, 0x84, "bad argument"}, 63 | {Divide_By_Zero, 0x85, "division by zero"}, 64 | {Invalid_Reference, 0x86, "invalid reference"}, 65 | {Debug_OpCode, 0x87, "found debug opcode"}, 66 | {ENDF_In_Exec_Stream, 0x88, "found ENDF opcode in execution stream"}, 67 | {Nested_DEFS, 0x89, "nested DEFS"}, 68 | {Invalid_CodeRange, 0x8A, "invalid code range"}, 69 | {Execution_Too_Long, 0x8B, "execution context too long"}, 70 | {Too_Many_Function_Defs, 0x8C, "too many function definitions"}, 71 | {Too_Many_Instruction_Defs, 0x8D, "too many instruction definitions"}, 72 | {Table_Missing, 0x8E, "SFNT font table missing"}, 73 | {Horiz_Header_Missing, 0x8F, "horizontal header (hhea) table missing"}, 74 | {Locations_Missing, 0x90, "locations (loca) table missing"}, 75 | {Name_Table_Missing, 0x91, "name table missing"}, 76 | {CMap_Table_Missing, 0x92, "character map (cmap) table missing"}, 77 | {Hmtx_Table_Missing, 0x93, "horizontal metrics (hmtx) table missing"}, 78 | {Post_Table_Missing, 0x94, "PostScript (post) table missing"}, 79 | {Invalid_Horiz_Metrics, 0x95, "invalid horizontal metrics"}, 80 | {Invalid_CharMap_Format, 0x96, "invalid character map (cmap) format"}, 81 | {Invalid_PPem, 0x97, "invalid ppem value"}, 82 | {Invalid_Vert_Metrics, 0x98, "invalid vertical metrics"}, 83 | {Could_Not_Find_Context, 0x99, "could not find context"}, 84 | {Invalid_Post_Table_Format, 0x9A, "invalid PostScript (post) table format"}, 85 | {Invalid_Post_Table, 0x9B, "invalid PostScript (post) table"}, 86 | {Syntax_Error, 0xA0, "opcode syntax error"}, 87 | {Stack_Underflow, 0xA1, "argument stack underflow"}, 88 | {Ignore, 0xA2, "ignore"}, 89 | {No_Unicode_Glyph_Name, 0xA3, "no Unicode glyph name found"}, 90 | {Glyph_Too_Big, 0xA4, "glyph too big for hinting"}, 91 | {Missing_Startfont_Field, 0xB0, "`STARTFONT' field missing"}, 92 | {Missing_Font_Field, 0xB1, "`FONT' field missing"}, 93 | {Missing_Size_Field, 0xB2, "`SIZE' field missing"}, 94 | {Missing_Fontboundingbox_Field, 0xB3, "`FONTBOUNDINGBOX' field missing"}, 95 | {Missing_Chars_Field, 0xB4, "`CHARS' field missing"}, 96 | {Missing_Startchar_Field, 0xB5, "`STARTCHAR' field missing"}, 97 | {Missing_Encoding_Field, 0xB6, "`ENCODING' field missing"}, 98 | {Missing_Bbx_Field, 0xB7, "`BBX' field missing"}, 99 | {Bbx_Too_Big, 0xB8, "`BBX' too big"}, 100 | {Corrupted_Font_Header, 0xB9, "Font header corrupted or missing fields"}, 101 | {Corrupted_Font_Glyphs, 0xBA, "Font glyphs corrupted or missing fields"}] 102 | 103 | type 104 | FT_Error_Msg* = object 105 | errors: TableRef[int, string] 106 | 107 | proc newErrorMsg*(): FT_Error_Msg = 108 | result.errors = FT_Err_Table.newTable() 109 | 110 | proc errorMessage*(self: FT_Error_Msg, errorCode: int): string = 111 | if self.errors.hasKey(errorCode): 112 | result = self.errors[errorCode] 113 | else: 114 | result = "" 115 | -------------------------------------------------------------------------------- /freetype/ftimage.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | include ftimport 9 | 10 | type 11 | FT_Pos* = clong 12 | 13 | FT_Vector* = object 14 | x*, y*: FT_Pos 15 | 16 | FT_BBox* = object 17 | xMin*, yMin*: FT_Pos 18 | xMax*, yMax*: FT_Pos 19 | 20 | FT_Pixel_Mode* = enum 21 | FT_PIXEL_MODE_NONE = 0, FT_PIXEL_MODE_MONO, FT_PIXEL_MODE_GRAY, 22 | FT_PIXEL_MODE_GRAY2, FT_PIXEL_MODE_GRAY4, FT_PIXEL_MODE_LCD, 23 | FT_PIXEL_MODE_LCD_V, FT_PIXEL_MODE_BGRA, FT_PIXEL_MODE_MAX 24 | 25 | FT_Glyph_Format* = distinct culong 26 | 27 | proc FT_IMAGE_TAG[T](a, b, c, d: T): FT_Glyph_Format {.compileTime.} = 28 | result = FT_Glyph_Format((culong(a) shl 24) or 29 | (culong(b) shl 16) or 30 | (culong(c) shl 8) or 31 | culong(d)) 32 | 33 | const 34 | FT_GLYPH_FORMAT_NONE* = FT_IMAGE_TAG(0, 0, 0, 0) 35 | FT_GLYPH_FORMAT_COMPOSITE* = FT_IMAGE_TAG('c', 'o', 'm', 'p') 36 | FT_GLYPH_FORMAT_BITMAP* = FT_IMAGE_TAG('b', 'i', 't', 's') 37 | FT_GLYPH_FORMAT_OUTLINE* = FT_IMAGE_TAG('o', 'u', 't', 'l') 38 | FT_GLYPH_FORMAT_PLOTTER* = FT_IMAGE_TAG('p', 'l', 'o', 't') 39 | 40 | const 41 | ft_pixel_mode_none* = FT_PIXEL_MODE_NONE 42 | ft_pixel_mode_mono* = FT_PIXEL_MODE_MONO 43 | ft_pixel_mode_grays* = FT_PIXEL_MODE_GRAY 44 | ft_pixel_mode_pal2* = FT_PIXEL_MODE_GRAY2 45 | ft_pixel_mode_pal4* = FT_PIXEL_MODE_GRAY4 46 | 47 | type 48 | FT_Bitmap* = object 49 | rows*: cuint 50 | width*: cuint 51 | pitch*: cint 52 | buffer*: cstring 53 | num_grays*: cushort 54 | pixel_mode*: uint8 55 | palette_mode*: uint8 56 | palette*: pointer 57 | 58 | FT_Outline* = object 59 | n_contours*: cshort 60 | n_points*: cshort 61 | points*: ptr FT_Vector 62 | tags*: ptr cchar 63 | contours*: ptr cshort 64 | flags*: cint 65 | 66 | const 67 | FT_OUTLINE_CONTOURS_MAX* = high(int16) 68 | FT_OUTLINE_POINTS_MAX* = high(int16) 69 | FT_OUTLINE_NONE* = 0x00000000 70 | FT_OUTLINE_OWNER* = 0x00000001 71 | FT_OUTLINE_EVEN_ODD_FILL* = 0x00000002 72 | FT_OUTLINE_REVERSE_FILL* = 0x00000004 73 | FT_OUTLINE_IGNORE_DROPOUTS* = 0x00000008 74 | FT_OUTLINE_SMART_DROPOUTS* = 0x00000010 75 | FT_OUTLINE_INCLUDE_STUBS* = 0x00000020 76 | FT_OUTLINE_HIGH_PRECISION* = 0x00000100 77 | FT_OUTLINE_SINGLE_PASS* = 0x00000200 78 | ft_outline_none* = FT_OUTLINE_NONE 79 | ft_outline_owner* = FT_OUTLINE_OWNER 80 | ft_outline_even_odd_fill* = FT_OUTLINE_EVEN_ODD_FILL 81 | ft_outline_reverse_fill* = FT_OUTLINE_REVERSE_FILL 82 | ft_outline_ignore_dropouts* = FT_OUTLINE_IGNORE_DROPOUTS 83 | ft_outline_high_precision* = FT_OUTLINE_HIGH_PRECISION 84 | ft_outline_single_pass* = FT_OUTLINE_SINGLE_PASS 85 | 86 | template FT_CURVE_TAG*(flag: untyped): untyped = 87 | (flag and 3) 88 | 89 | const 90 | FT_CURVE_TAG_ON* = 1 91 | FT_CURVE_TAG_CONIC* = 0 92 | FT_CURVE_TAG_CUBIC* = 2 93 | FT_CURVE_TAG_HAS_SCANMODE* = 4 94 | FT_CURVE_TAG_TOUCH_X* = 8 95 | FT_CURVE_TAG_TOUCH_Y* = 16 96 | FT_CURVE_TAG_TOUCH_BOTH* = (FT_CURVE_TAG_TOUCH_X or FT_CURVE_TAG_TOUCH_Y) 97 | 98 | type 99 | FT_Outline_MoveToFunc* = proc(to: var FT_Vector; user: pointer): cint {.ftcallback.} 100 | FT_Outline_LineToFunc* = proc(to: var FT_Vector; user: pointer): cint {.ftcallback.} 101 | FT_Outline_ConicToFunc* = proc(control, to: var FT_Vector; user: pointer): cint {.ftcallback.} 102 | FT_Outline_CubicToFunc* = proc(control1, control2, to: var FT_Vector; user: pointer): cint {.ftcallback.} 103 | 104 | FT_Outline_Funcs* = object 105 | moveTo*: FT_Outline_MoveToFunc 106 | lineTo*: FT_Outline_LineToFunc 107 | conicTo*: FT_Outline_ConicToFunc 108 | cubicTo*: FT_Outline_CubicToFunc 109 | shift*: cint 110 | delta*: FT_Pos 111 | 112 | const 113 | ft_glyph_format_none* = FT_GLYPH_FORMAT_NONE 114 | ft_glyph_format_composite* = FT_GLYPH_FORMAT_COMPOSITE 115 | ft_glyph_format_bitmap* = FT_GLYPH_FORMAT_BITMAP 116 | ft_glyph_format_outline* = FT_GLYPH_FORMAT_OUTLINE 117 | ft_glyph_format_plotter* = FT_GLYPH_FORMAT_PLOTTER 118 | 119 | type 120 | FT_Raster* = distinct pointer #ptr FT_RasterRec 121 | 122 | FT_Span* = object 123 | x*: cshort 124 | len*: cushort 125 | coverage*: uint8 126 | 127 | FT_SpanFunc* = proc(y, count: cint; spans: var FT_Span; user: pointer) {.ftcallback.} 128 | FT_Raster_Span_Func* = FT_SpanFunc 129 | FT_Raster_BitTest_Func* = proc(y, x: cint; user: pointer): cint {.ftcallback.} 130 | FT_Raster_BitSet_Func* = proc(y, x: cint; user: pointer) {.ftcallback.} 131 | 132 | const 133 | FT_RASTER_FLAG_DEFAULT* = 0x00000000 134 | FT_RASTER_FLAG_AA* = 0x00000001 135 | FT_RASTER_FLAG_DIRECT* = 0x00000002 136 | FT_RASTER_FLAG_CLIP* = 0x00000004 137 | ft_raster_flag_default* = FT_RASTER_FLAG_DEFAULT 138 | ft_raster_flag_aa* = FT_RASTER_FLAG_AA 139 | ft_raster_flag_direct* = FT_RASTER_FLAG_DIRECT 140 | ft_raster_flag_clip* = FT_RASTER_FLAG_CLIP 141 | 142 | type 143 | FT_Raster_Params* = object 144 | target*: ptr FT_Bitmap 145 | source*: pointer 146 | flags*: cint 147 | gray_spans*: FT_SpanFunc 148 | black_spans*: FT_SpanFunc 149 | bit_test*: FT_Raster_BitTest_Func 150 | bit_set*: FT_Raster_BitSet_Func 151 | user*: pointer 152 | clip_box*: FT_BBox 153 | 154 | FT_Raster_NewFunc* = proc(memory: pointer; raster: var FT_Raster): cint {.ftcallback.} 155 | FT_Raster_DoneFunc* = proc(raster: FT_Raster) {.ftcallback.} 156 | FT_Raster_ResetFunc* = proc(raster: FT_Raster; pool_base: cstring; pool_size: culong) {.ftcallback.} 157 | FT_Raster_SetModeFunc* = proc(raster: FT_Raster; mode: culong; args: pointer): cint {.ftcallback.} 158 | FT_Raster_RenderFunc* = proc(raster: FT_Raster; params: var FT_Raster_Params): cint {.ftcallback.} 159 | 160 | type 161 | FT_Raster_Funcs* = object 162 | glyph_format*: FT_Glyph_Format 163 | raster_new*: FT_Raster_NewFunc 164 | raster_reset*: FT_Raster_ResetFunc 165 | raster_set_mode*: FT_Raster_SetModeFunc 166 | raster_render*: FT_Raster_RenderFunc 167 | raster_done*: FT_Raster_DoneFunc 168 | -------------------------------------------------------------------------------- /freetype/t1tables.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, ftimage, freetype 9 | include ftimport 10 | 11 | type 12 | PS_FontInfoRec* = object 13 | version*: ptr FT_String 14 | notice*: ptr FT_String 15 | full_name*: ptr FT_String 16 | family_name*: ptr FT_String 17 | weight*: ptr FT_String 18 | italic_angle*: FT_Long 19 | is_fixed_pitch*: FT_Bool 20 | underline_position*: FT_Short 21 | underline_thickness*: FT_UShort 22 | 23 | PS_FontInfo* = ptr PS_FontInfoRec 24 | 25 | T1_FontInfo* = PS_FontInfoRec 26 | 27 | PS_PrivateRec* = object 28 | unique_id*: FT_Int 29 | lenIV*: FT_Int 30 | num_blue_values*: FT_Byte 31 | num_other_blues*: FT_Byte 32 | num_family_blues*: FT_Byte 33 | num_family_other_blues*: FT_Byte 34 | blue_values*: array[14, FT_Short] 35 | other_blues*: array[10, FT_Short] 36 | family_blues*: array[14, FT_Short] 37 | family_other_blues*: array[10, FT_Short] 38 | blue_scale*: FT_Fixed 39 | blue_shift*: FT_Int 40 | blue_fuzz*: FT_Int 41 | standard_width*: array[1, FT_UShort] 42 | standard_height*: array[1, FT_UShort] 43 | num_snap_widths*: FT_Byte 44 | num_snap_heights*: FT_Byte 45 | force_bold*: FT_Bool 46 | round_stem_up*: FT_Bool 47 | snap_widths*: array[13, FT_Short] 48 | snap_heights*: array[13, FT_Short] 49 | expansion_factor*: FT_Fixed 50 | language_group*: FT_Long 51 | password*: FT_Long 52 | min_feature*: array[2, FT_Short] 53 | 54 | PS_Private* = ptr PS_PrivateRec 55 | 56 | T1_Private* = PS_PrivateRec 57 | 58 | T1_Blend_Flags* = enum 59 | T1_BLEND_UNDERLINE_POSITION = 0, T1_BLEND_UNDERLINE_THICKNESS, 60 | T1_BLEND_ITALIC_ANGLE, T1_BLEND_BLUE_VALUES, T1_BLEND_OTHER_BLUES, 61 | T1_BLEND_STANDARD_WIDTH, T1_BLEND_STANDARD_HEIGHT, T1_BLEND_STEM_SNAP_WIDTHS, 62 | T1_BLEND_STEM_SNAP_HEIGHTS, T1_BLEND_BLUE_SCALE, T1_BLEND_BLUE_SHIFT, 63 | T1_BLEND_FAMILY_BLUES, T1_BLEND_FAMILY_OTHER_BLUES, T1_BLEND_FORCE_BOLD, 64 | T1_BLEND_MAX 65 | 66 | const 67 | t1_blend_underline_position* = T1_BLEND_UNDERLINE_POSITION 68 | t1_blend_underline_thickness* = T1_BLEND_UNDERLINE_THICKNESS 69 | t1_blend_italic_angle* = T1_BLEND_ITALIC_ANGLE 70 | t1_blend_blue_values* = T1_BLEND_BLUE_VALUES 71 | t1_blend_other_blues* = T1_BLEND_OTHER_BLUES 72 | t1_blend_standard_widths* = T1_BLEND_STANDARD_WIDTH 73 | t1_blend_standard_height* = T1_BLEND_STANDARD_HEIGHT 74 | t1_blend_stem_snap_widths* = T1_BLEND_STEM_SNAP_WIDTHS 75 | t1_blend_stem_snap_heights* = T1_BLEND_STEM_SNAP_HEIGHTS 76 | t1_blend_blue_scale* = T1_BLEND_BLUE_SCALE 77 | t1_blend_blue_shift* = T1_BLEND_BLUE_SHIFT 78 | t1_blend_family_blues* = T1_BLEND_FAMILY_BLUES 79 | t1_blend_family_other_blues* = T1_BLEND_FAMILY_OTHER_BLUES 80 | t1_blend_force_bold* = T1_BLEND_FORCE_BOLD 81 | t1_blend_max* = T1_BLEND_MAX 82 | T1_MAX_MM_DESIGNS* = 16 83 | T1_MAX_MM_AXIS* = 4 84 | T1_MAX_MM_MAP_POINTS* = 20 85 | 86 | type 87 | PS_DesignMapRec* = object 88 | num_points*: FT_Byte 89 | design_points*: ptr FT_Long 90 | blend_points*: ptr FT_Fixed 91 | 92 | PS_DesignMap* = ptr PS_DesignMapRec 93 | 94 | T1_DesignMap* = PS_DesignMapRec 95 | 96 | PS_BlendRec* = object 97 | num_designs*: FT_UInt 98 | num_axis*: FT_UInt 99 | axis_names*: array[T1_MAX_MM_AXIS, ptr FT_String] 100 | design_pos*: array[T1_MAX_MM_DESIGNS, ptr FT_Fixed] 101 | design_map*: array[T1_MAX_MM_AXIS, PS_DesignMapRec] 102 | weight_vector*: ptr FT_Fixed 103 | default_weight_vector*: ptr FT_Fixed 104 | font_infos*: array[T1_MAX_MM_DESIGNS + 1, PS_FontInfo] 105 | privates*: array[T1_MAX_MM_DESIGNS + 1, PS_Private] 106 | blend_bitflags*: FT_ULong 107 | bboxes*: array[T1_MAX_MM_DESIGNS + 1, ptr FT_BBox] 108 | default_design_vector*: array[T1_MAX_MM_DESIGNS, FT_UInt] 109 | num_default_design_vector*: FT_UInt 110 | 111 | PS_Blend* = ptr PS_BlendRec 112 | 113 | T1_Blend* = PS_BlendRec 114 | 115 | CID_FaceDictRec* = object 116 | private_dict*: PS_PrivateRec 117 | len_buildchar*: FT_UInt 118 | forcebold_threshold*: FT_Fixed 119 | stroke_width*: FT_Pos 120 | expansion_factor*: FT_Fixed 121 | paint_type*: FT_Byte 122 | font_type*: FT_Byte 123 | font_matrix*: FT_Matrix 124 | font_offset*: FT_Vector 125 | num_subrs*: FT_UInt 126 | subrmap_offset*: FT_ULong 127 | sd_bytes*: FT_Int 128 | 129 | CID_FaceDict* = ptr CID_FaceDictRec 130 | 131 | CID_FontDict* = CID_FaceDictRec 132 | 133 | CID_FaceInfoRec* = object 134 | cid_font_name*: ptr FT_String 135 | cid_version*: FT_Fixed 136 | cid_font_type*: FT_Int 137 | registry*: ptr FT_String 138 | ordering*: ptr FT_String 139 | supplement*: FT_Int 140 | font_info*: PS_FontInfoRec 141 | font_bbox*: FT_BBox 142 | uid_base*: FT_ULong 143 | num_xuid*: FT_Int 144 | xuid*: array[16, FT_ULong] 145 | cidmap_offset*: FT_ULong 146 | fd_bytes*: FT_Int 147 | gd_bytes*: FT_Int 148 | cid_count*: FT_ULong 149 | num_dicts*: FT_Int 150 | font_dicts*: CID_FaceDict 151 | data_offset*: FT_ULong 152 | 153 | CID_FaceInfo* = ptr CID_FaceInfoRec 154 | 155 | CID_Info* = CID_FaceInfoRec 156 | 157 | proc FT_Has_PS_Glyph_Names*(face: FT_Face): FT_Int {.ftimport.} 158 | 159 | proc FT_Get_PS_Font_Info*(face: FT_Face; afont_info: PS_FontInfo): FT_Error {.ftimport.} 160 | 161 | proc FT_Get_PS_Font_Private*(face: FT_Face; afont_private: PS_Private): FT_Error {.ftimport.} 162 | 163 | type 164 | T1_EncodingType* = enum 165 | T1_ENCODING_TYPE_NONE = 0, T1_ENCODING_TYPE_ARRAY, T1_ENCODING_TYPE_STANDARD, 166 | T1_ENCODING_TYPE_ISOLATIN1, T1_ENCODING_TYPE_EXPERT 167 | 168 | PS_Dict_Keys* = enum 169 | PS_DICT_FONT_TYPE, PS_DICT_FONT_MATRIX, PS_DICT_FONT_BBOX, PS_DICT_PAINT_TYPE, 170 | PS_DICT_FONT_NAME, PS_DICT_UNIQUE_ID, PS_DICT_NUM_CHAR_STRINGS, 171 | PS_DICT_CHAR_STRING_KEY, PS_DICT_CHAR_STRING, PS_DICT_ENCODING_TYPE, 172 | PS_DICT_ENCODING_ENTRY, PS_DICT_NUM_SUBRS, PS_DICT_SUBR, PS_DICT_STD_HW, 173 | PS_DICT_STD_VW, PS_DICT_NUM_BLUE_VALUES, PS_DICT_BLUE_VALUE, PS_DICT_BLUE_FUZZ, 174 | PS_DICT_NUM_OTHER_BLUES, PS_DICT_OTHER_BLUE, PS_DICT_NUM_FAMILY_BLUES, 175 | PS_DICT_FAMILY_BLUE, PS_DICT_NUM_FAMILY_OTHER_BLUES, 176 | PS_DICT_FAMILY_OTHER_BLUE, PS_DICT_BLUE_SCALE, PS_DICT_BLUE_SHIFT, 177 | PS_DICT_NUM_STEM_SNAP_H, PS_DICT_STEM_SNAP_H, PS_DICT_NUM_STEM_SNAP_V, 178 | PS_DICT_STEM_SNAP_V, PS_DICT_FORCE_BOLD, PS_DICT_RND_STEM_UP, 179 | PS_DICT_MIN_FEATURE, PS_DICT_LEN_IV, PS_DICT_PASSWORD, PS_DICT_LANGUAGE_GROUP, 180 | PS_DICT_VERSION, PS_DICT_NOTICE, PS_DICT_FULL_NAME, PS_DICT_FAMILY_NAME, 181 | PS_DICT_WEIGHT, PS_DICT_IS_FIXED_PITCH, PS_DICT_UNDERLINE_POSITION, 182 | PS_DICT_UNDERLINE_THICKNESS, PS_DICT_FS_TYPE, PS_DICT_ITALIC_ANGLE 183 | 184 | const 185 | PS_DICT_MAX* = PS_DICT_ITALIC_ANGLE 186 | 187 | proc FT_Get_PS_Font_Value*(face: FT_Face; key: PS_Dict_Keys; idx: FT_UInt; 188 | value: pointer; value_len: FT_Long): FT_Long {.ftimport.} 189 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | build: 6 | strategy: 7 | fail-fast: false 8 | max-parallel: 20 9 | matrix: 10 | test_lang: [c, cpp] 11 | target: 12 | - os: linux 13 | cpu: amd64 14 | - os: linux 15 | cpu: i386 16 | - os: macos 17 | cpu: amd64 18 | - os: windows 19 | cpu: amd64 20 | - os: windows 21 | cpu: i386 22 | include: 23 | - target: 24 | os: linux 25 | builder: ubuntu-20.04 26 | - target: 27 | os: macos 28 | builder: macos-11 29 | - target: 30 | os: windows 31 | builder: windows-latest 32 | 33 | name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ matrix.test_lang }}' 34 | runs-on: ${{ matrix.builder }} 35 | steps: 36 | - name: Checkout freetype 37 | uses: actions/checkout@v3 38 | with: 39 | path: freetype 40 | submodules: false 41 | 42 | - name: Install build dependencies (Linux i386) 43 | if: runner.os == 'Linux' && matrix.target.cpu == 'i386' 44 | run: | 45 | sudo dpkg --add-architecture i386 46 | sudo apt-fast update -qq 47 | sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \ 48 | --no-install-recommends -yq gcc-multilib g++-multilib \ 49 | libssl-dev:i386 50 | mkdir -p external/bin 51 | cat << EOF > external/bin/gcc 52 | #!/bin/bash 53 | exec $(which gcc) -m32 "\$@" 54 | EOF 55 | cat << EOF > external/bin/g++ 56 | #!/bin/bash 57 | exec $(which g++) -m32 "\$@" 58 | EOF 59 | chmod 755 external/bin/gcc external/bin/g++ 60 | echo '${{ github.workspace }}/external/bin' >> $GITHUB_PATH 61 | 62 | - name: Restore MinGW-W64 (Windows) from cache 63 | if: runner.os == 'Windows' 64 | id: windows-mingw-cache 65 | uses: actions/cache@v3 66 | with: 67 | path: external/mingw-${{ matrix.target.cpu }} 68 | key: 'mingw-${{ matrix.target.cpu }}' 69 | 70 | - name: Restore Nim DLLs dependencies (Windows) from cache 71 | if: runner.os == 'Windows' 72 | id: windows-dlls-cache 73 | uses: actions/cache@v3 74 | with: 75 | path: external/dlls-${{ matrix.target.cpu }} 76 | key: 'dlls-${{ matrix.target.cpu }}' 77 | 78 | - name: Install MinGW64 dependency (Windows) 79 | if: > 80 | steps.windows-mingw-cache.outputs.cache-hit != 'true' && 81 | runner.os == 'Windows' 82 | shell: bash 83 | run: | 84 | mkdir -p external 85 | MINGW_BASE="https://github.com/brechtsanders/winlibs_mingw/releases/download/11.2.0-12.0.1-9.0.0-r1" 86 | if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then 87 | MINGW_URL="$MINGW_BASE/winlibs-x86_64-posix-seh-gcc-11.2.0-mingw-w64-9.0.0-r1.7z" 88 | ARCH=64 89 | else 90 | MINGW_URL="$MINGW_BASE/winlibs-i686-posix-dwarf-gcc-11.2.0-mingw-w64-9.0.0-r1.7z" 91 | ARCH=32 92 | fi 93 | curl -L "$MINGW_URL" -o "external/mingw-${{ matrix.target.cpu }}.7z" 94 | 7z x -y "external/mingw-${{ matrix.target.cpu }}.7z" -oexternal/ 95 | mv external/mingw$ARCH external/mingw-${{ matrix.target.cpu }} 96 | 97 | - name: Install DLLs dependencies (Windows) 98 | if: > 99 | steps.windows-dlls-cache.outputs.cache-hit != 'true' && 100 | runner.os == 'Windows' 101 | shell: bash 102 | run: | 103 | mkdir -p external 104 | curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip 105 | 7z x -y external/windeps.zip -oexternal/dlls-${{ matrix.target.cpu }} 106 | 107 | - name: Path to cached dependencies (Windows) 108 | if: > 109 | runner.os == 'Windows' 110 | shell: bash 111 | run: | 112 | echo '${{ github.workspace }}'"/external/mingw-${{ matrix.target.cpu }}/bin" >> $GITHUB_PATH 113 | echo '${{ github.workspace }}'"/external/dlls-${{ matrix.target.cpu }}" >> $GITHUB_PATH 114 | 115 | - name: Setup environment 116 | shell: bash 117 | run: echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH 118 | 119 | - name: Get latest Nim commit hash 120 | id: versions 121 | shell: bash 122 | run: | 123 | getHash() { 124 | git ls-remote "https://github.com/$1" "${2:-HEAD}" | cut -f 1 125 | } 126 | nimHash=$(getHash nim-lang/Nim devel) 127 | csourcesHash=$(getHash nim-lang/csources_v2) 128 | echo "nimHash=$nimHash" >> $GITHUB_OUTPUT 129 | echo "csourcesHash=$csourcesHash" >> $GITHUB_OUTPUT 130 | 131 | 132 | - name: Restore prebuilt Nim from cache 133 | id: nim-cache 134 | uses: actions/cache@v3 135 | with: 136 | path: nim 137 | key: 'nim-${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ steps.versions.outputs.nimHash }}' 138 | 139 | - name: Restore prebuilt csources from cache 140 | if: steps.nim-cache.outputs.cache-hit != 'true' 141 | id: csources-cache 142 | uses: actions/cache@v3 143 | with: 144 | path: csources/bin 145 | key: 'csources-${{ matrix.target.os }}-${{ matrix.target.cpu }}-${{ steps.versions.outputs.csourcesHash }}' 146 | 147 | - name: Checkout Nim csources 148 | if: > 149 | steps.csources-cache.outputs.cache-hit != 'true' && 150 | steps.nim-cache.outputs.cache-hit != 'true' 151 | uses: actions/checkout@v3 152 | with: 153 | repository: nim-lang/csources_v2 154 | path: csources 155 | ref: ${{ steps.versions.outputs.csources }} 156 | 157 | - name: Checkout Nim 158 | if: steps.nim-cache.outputs.cache-hit != 'true' 159 | uses: actions/checkout@v3 160 | with: 161 | repository: nim-lang/Nim 162 | path: nim 163 | ref: ${{ steps.versions.outputs.nim }} 164 | 165 | - name: Build Nim and associated tools 166 | if: steps.nim-cache.outputs.cache-hit != 'true' 167 | shell: bash 168 | run: | 169 | ncpu= 170 | ext= 171 | case '${{ runner.os }}' in 172 | 'Linux') 173 | ncpu=$(nproc) 174 | ;; 175 | 'macOS') 176 | ncpu=$(sysctl -n hw.ncpu) 177 | ;; 178 | 'Windows') 179 | ncpu=$NUMBER_OF_PROCESSORS 180 | ext=.exe 181 | ;; 182 | esac 183 | [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1 184 | if [[ ! -e csources/bin/nim$ext ]]; then 185 | make -C csources -j $ncpu CC=gcc ucpu='${{ matrix.target.cpu }}' 186 | else 187 | echo 'Using prebuilt csources' 188 | fi 189 | cp -v csources/bin/nim$ext nim/bin 190 | cd nim 191 | nim c koch 192 | ./koch boot -d:release 193 | ./koch nimble -d:release 194 | # clean up to save cache space 195 | rm koch 196 | rm -rf nimcache 197 | rm -rf dist 198 | rm -rf .git 199 | 200 | - name: Run Freetype tests 201 | shell: bash 202 | working-directory: freetype 203 | run: | 204 | nim c freetype 205 | -------------------------------------------------------------------------------- /freetype/freetype.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | import fttypes, ftimage, ftsystem 9 | include ftimport 10 | 11 | type 12 | FT_Encoding* = distinct uint32 13 | 14 | proc FT_ENC_TAG*[T](a, b, c, d: T): FT_Encoding = 15 | result = FT_Encoding((FT_UInt32(a) shl 24) or 16 | (FT_UInt32(b) shl 16) or 17 | (FT_UInt32(c) shl 8) or 18 | FT_UInt32(d)) 19 | 20 | const 21 | FT_ENCODING_NONE* = FT_ENC_TAG(0, 0, 0, 0) 22 | FT_ENCODING_MS_SYMBOL* = FT_ENC_TAG('s', 'y', 'm', 'b') 23 | FT_ENCODING_UNICODE* = FT_ENC_TAG('u', 'n', 'i', 'c') 24 | 25 | FT_ENCODING_SJIS* = FT_ENC_TAG('s', 'j', 'i', 's') 26 | FT_ENCODING_GB2312* = FT_ENC_TAG('g', 'b', ' ', ' ') 27 | FT_ENCODING_BIG5* = FT_ENC_TAG('b', 'i', 'g', '5') 28 | FT_ENCODING_WANSUNG* = FT_ENC_TAG('w', 'a', 'n', 's') 29 | FT_ENCODING_JOHAB* = FT_ENC_TAG('j', 'o', 'h', 'a') 30 | 31 | # for backwards compatibility 32 | FT_ENCODING_MS_SJIS* = FT_ENCODING_SJIS 33 | FT_ENCODING_MS_GB2312* = FT_ENCODING_GB2312 34 | FT_ENCODING_MS_BIG5* = FT_ENCODING_BIG5 35 | FT_ENCODING_MS_WANSUNG* = FT_ENCODING_WANSUNG 36 | FT_ENCODING_MS_JOHAB* = FT_ENCODING_JOHAB 37 | 38 | FT_ENCODING_ADOBE_STANDARD* = FT_ENC_TAG('A', 'D', 'O', 'B') 39 | FT_ENCODING_ADOBE_EXPERT* = FT_ENC_TAG('A', 'D', 'B', 'E') 40 | FT_ENCODING_ADOBE_CUSTOM* = FT_ENC_TAG('A', 'D', 'B', 'C') 41 | FT_ENCODING_ADOBE_LATIN_1* = FT_ENC_TAG('l', 'a', 't', '1') 42 | 43 | FT_ENCODING_OLD_LATIN_2* = FT_ENC_TAG('l', 'a', 't', '2') 44 | FT_ENCODING_APPLE_ROMAN* = FT_ENC_TAG('a', 'r', 'm', 'n') 45 | 46 | type 47 | FT_Glyph_Metrics* = object 48 | width*: FT_Pos 49 | height*: FT_Pos 50 | horiBearingX*: FT_Pos 51 | horiBearingY*: FT_Pos 52 | horiAdvance*: FT_Pos 53 | vertBearingX*: FT_Pos 54 | vertBearingY*: FT_Pos 55 | vertAdvance*: FT_Pos 56 | 57 | FT_Bitmap_Size* = object 58 | height*: FT_Short 59 | width*: FT_Short 60 | size*: FT_Pos 61 | x_ppem*: FT_Pos 62 | y_ppem*: FT_Pos 63 | 64 | FT_Library* = distinct pointer #ptr FT_LibraryRec 65 | FT_Module* = distinct pointer #ptr FT_ModuleRec 66 | FT_Driver* = distinct pointer #ptr FT_DriverRec 67 | FT_Renderer* = distinct pointer #ptr FT_RendererRec 68 | FT_Face* = ptr FT_FaceRec 69 | FT_Size* = ptr FT_SizeRec 70 | FT_GlyphSlot* = ptr FT_GlyphSlotRec 71 | FT_CharMap* = ptr FT_CharMapRec 72 | 73 | FT_CharMapRec* = object 74 | face*: FT_Face 75 | encoding*: FT_Encoding 76 | platform_id*: FT_UShort 77 | encoding_id*: FT_UShort 78 | 79 | FT_Face_Internal* = distinct pointer #ptr FT_Face_InternalRec 80 | 81 | FT_FaceRec* = object 82 | num_faces*: FT_Long 83 | face_index*: FT_Long 84 | face_flags*: FT_Long 85 | style_flags*: FT_Long 86 | num_glyphs*: FT_Long 87 | family_name*: ptr FT_String 88 | style_name*: ptr FT_String 89 | num_fixed_sizes*: FT_Int 90 | available_sizes*: ptr FT_Bitmap_Size 91 | num_charmaps*: FT_Int 92 | charmaps*: ptr FT_CharMap 93 | `generic`*: FT_Generic 94 | bbox*: FT_BBox 95 | units_per_EM*: FT_UShort 96 | ascender*: FT_Short 97 | descender*: FT_Short 98 | height*: FT_Short 99 | max_advance_width*: FT_Short 100 | max_advance_height*: FT_Short 101 | underline_position*: FT_Short 102 | underline_thickness*: FT_Short 103 | glyph*: FT_GlyphSlot 104 | size*: FT_Size 105 | charmap*: FT_CharMap 106 | driver*: FT_Driver 107 | memory*: FT_Memory 108 | stream*: FT_Stream 109 | sizes_list*: FT_ListRec 110 | autohint*: FT_Generic 111 | extensions*: pointer 112 | internal*: FT_Face_Internal 113 | 114 | FT_Size_Internal* = distinct pointer #ptr FT_Size_InternalRec 115 | 116 | FT_Size_Metrics* = object 117 | x_ppem*: FT_UShort 118 | y_ppem*: FT_UShort 119 | x_scale*: FT_Fixed 120 | y_scale*: FT_Fixed 121 | ascender*: FT_Pos 122 | descender*: FT_Pos 123 | height*: FT_Pos 124 | max_advance*: FT_Pos 125 | 126 | FT_SizeRec* = object 127 | face*: FT_Face 128 | `generic`*: FT_Generic 129 | metrics*: FT_Size_Metrics 130 | internal*: FT_Size_Internal 131 | 132 | FT_SubGlyph* = distinct pointer#ptr FT_SubGlyphRec 133 | 134 | FT_Slot_Internal* = distinct pointer#ptr FT_Slot_InternalRec 135 | 136 | FT_GlyphSlotRec* = object 137 | library*: FT_Library 138 | face*: FT_Face 139 | next*: FT_GlyphSlot 140 | reserved*: FT_UInt 141 | `generic`*: FT_Generic 142 | metrics*: FT_Glyph_Metrics 143 | linearHoriAdvance*: FT_Fixed 144 | linearVertAdvance*: FT_Fixed 145 | advance*: FT_Vector 146 | format*: FT_Glyph_Format 147 | bitmap*: FT_Bitmap 148 | bitmap_left*: FT_Int 149 | bitmap_top*: FT_Int 150 | outline*: FT_Outline 151 | num_subglyphs*: FT_UInt 152 | subglyphs*: FT_SubGlyph 153 | control_data*: pointer 154 | control_len*: clong 155 | lsb_delta*: FT_Pos 156 | rsb_delta*: FT_Pos 157 | other*: pointer 158 | internal*: FT_Slot_Internal 159 | 160 | const 161 | ft_encoding_none* = FT_ENCODING_NONE 162 | ft_encoding_unicode* = FT_ENCODING_UNICODE 163 | ft_encoding_symbol* = FT_ENCODING_MS_SYMBOL 164 | ft_encoding_latin_1* = FT_ENCODING_ADOBE_LATIN_1 165 | ft_encoding_latin_2* = FT_ENCODING_OLD_LATIN_2 166 | ft_encoding_sjis* = FT_ENCODING_SJIS 167 | ft_encoding_gb2312* = FT_ENCODING_GB2312 168 | ft_encoding_big5* = FT_ENCODING_BIG5 169 | ft_encoding_wansung* = FT_ENCODING_WANSUNG 170 | ft_encoding_johab* = FT_ENCODING_JOHAB 171 | ft_encoding_adobe_standard* = FT_ENCODING_ADOBE_STANDARD 172 | ft_encoding_adobe_expert* = FT_ENCODING_ADOBE_EXPERT 173 | ft_encoding_adobe_custom* = FT_ENCODING_ADOBE_CUSTOM 174 | ft_encoding_apple_roman* = FT_ENCODING_APPLE_ROMAN 175 | 176 | const 177 | FT_FACE_FLAG_SCALABLE* = (1 shl 0) 178 | FT_FACE_FLAG_FIXED_SIZES* = (1 shl 1) 179 | FT_FACE_FLAG_FIXED_WIDTH* = (1 shl 2) 180 | FT_FACE_FLAG_SFNT* = (1 shl 3) 181 | FT_FACE_FLAG_HORIZONTAL* = (1 shl 4) 182 | FT_FACE_FLAG_VERTICAL* = (1 shl 5) 183 | FT_FACE_FLAG_KERNING* = (1 shl 6) 184 | FT_FACE_FLAG_FAST_GLYPHS* = (1 shl 7) 185 | FT_FACE_FLAG_MULTIPLE_MASTERS* = (1 shl 8) 186 | FT_FACE_FLAG_GLYPH_NAMES* = (1 shl 9) 187 | FT_FACE_FLAG_EXTERNAL_STREAM* = (1 shl 10) 188 | FT_FACE_FLAG_HINTER* = (1 shl 11) 189 | FT_FACE_FLAG_CID_KEYED* = (1 shl 12) 190 | FT_FACE_FLAG_TRICKY* = (1 shl 13) 191 | FT_FACE_FLAG_COLOR* = (1 shl 14) 192 | 193 | template FT_HAS_HORIZONTAL*(face: untyped): untyped = 194 | (((face).face_flags and FT_FACE_FLAG_HORIZONTAL) != 0) 195 | 196 | template FT_HAS_VERTICAL*(face: untyped): untyped = 197 | (((face).face_flags and FT_FACE_FLAG_VERTICAL) != 0) 198 | 199 | template FT_HAS_KERNING*(face: untyped): untyped = 200 | (((face).face_flags and FT_FACE_FLAG_KERNING) != 0) 201 | 202 | template FT_IS_SCALABLE*(face: untyped): untyped = 203 | (((face).face_flags and FT_FACE_FLAG_SCALABLE) != 0) 204 | 205 | template FT_IS_SFNT*(face: untyped): untyped = 206 | (((face).face_flags and FT_FACE_FLAG_SFNT) != 0) 207 | 208 | template FT_IS_FIXED_WIDTH*(face: untyped): untyped = 209 | (((face).face_flags and FT_FACE_FLAG_FIXED_WIDTH) != 0) 210 | 211 | template FT_HAS_FIXED_SIZES*(face: untyped): untyped = 212 | (((face).face_flags and FT_FACE_FLAG_FIXED_SIZES) != 0) 213 | 214 | template FT_HAS_FAST_GLYPHS*(face: untyped): untyped = 215 | false 216 | 217 | template FT_HAS_GLYPH_NAMES*(face: untyped): untyped = 218 | (((face).face_flags and FT_FACE_FLAG_GLYPH_NAMES) != 0) 219 | 220 | template FT_HAS_MULTIPLE_MASTERS*(face: untyped): untyped = 221 | (((face).face_flags and FT_FACE_FLAG_MULTIPLE_MASTERS) != 0) 222 | 223 | template FT_IS_NAMED_INSTANCE*(face: untyped): untyped = 224 | (((face).face_index and 0x7FFF0000) != 0) 225 | 226 | template FT_IS_CID_KEYED*(face: untyped): untyped = 227 | (((face).face_flags and FT_FACE_FLAG_CID_KEYED) != 0) 228 | 229 | template FT_IS_TRICKY*(face: untyped): untyped = 230 | (((face).face_flags and FT_FACE_FLAG_TRICKY) != 0) 231 | 232 | template FT_HAS_COLOR*(face: untyped): untyped = 233 | (((face).face_flags and FT_FACE_FLAG_COLOR) != 0) 234 | 235 | const 236 | FT_STYLE_FLAG_ITALIC* = (1 shl 0) 237 | FT_STYLE_FLAG_BOLD* = (1 shl 1) 238 | 239 | proc FT_Init_FreeType*(alibrary: var FT_Library): FT_Error {.ft_import.} 240 | proc FT_Done_FreeType*(library: FT_Library): FT_Error {.ft_import.} 241 | 242 | proc init*(lib: var FT_Library): FT_Error {.inline.} = 243 | FT_Init_FreeType(lib) 244 | 245 | proc done*(lib: FT_Library): FT_Error {.inline,discardable.} = 246 | FT_Done_FreeType(lib) 247 | 248 | const 249 | FT_OPEN_MEMORY* = 0x00000001 250 | FT_OPEN_STREAM* = 0x00000002 251 | FT_OPEN_PATHNAME* = 0x00000004 252 | FT_OPEN_DRIVER* = 0x00000008 253 | FT_OPEN_PARAMS* = 0x00000010 254 | ft_open_memory* = FT_OPEN_MEMORY 255 | ft_open_stream* = FT_OPEN_STREAM 256 | ft_open_pathname* = FT_OPEN_PATHNAME 257 | ft_open_driver* = FT_OPEN_DRIVER 258 | ft_open_params* = FT_OPEN_PARAMS 259 | 260 | type 261 | FT_Parameter* = object 262 | tag*: FT_ULong 263 | data*: FT_Pointer 264 | 265 | FT_Open_Args* = object 266 | flags*: FT_UInt 267 | memory_base*: ptr FT_Byte 268 | memory_size*: FT_Long 269 | pathname*: ptr FT_String 270 | stream*: FT_Stream 271 | driver*: FT_Module 272 | num_params*: FT_Int 273 | params*: ptr FT_Parameter 274 | 275 | proc FT_New_Face*(library: FT_Library; filepathname: cstring; face_index: FT_Long; 276 | aface: var FT_Face): FT_Error {.ft_import.} 277 | 278 | proc FT_New_Memory_Face*(library: FT_Library; file_base: cstring; 279 | file_size: FT_Long; face_index: FT_Long; aface: var FT_Face): FT_Error {.ft_import.} 280 | 281 | proc FT_Open_Face*(library: FT_Library; args: var FT_Open_Args; face_index: FT_Long; 282 | aface: var FT_Face): FT_Error {.ft_import.} 283 | 284 | proc FT_Attach_File*(face: FT_Face; filepathname: cstring): FT_Error {.ft_import.} 285 | proc FT_Attach_Stream*(face: FT_Face; parameters: var FT_Open_Args): FT_Error {.ft_import.} 286 | proc FT_Reference_Face*(face: FT_Face): FT_Error {.ft_import.} 287 | proc FT_Done_Face*(face: FT_Face): FT_Error {.ft_import.} 288 | proc FT_Select_Size*(face: FT_Face; strike_index: FT_Int): FT_Error {.ft_import.} 289 | 290 | proc newFace*(lib: FT_Library, filePathName: string; faceIndex: int; face: var FT_Face): FT_Error {.inline.} = 291 | FT_New_Face(lib, filePathName, FT_Long(faceIndex), face) 292 | 293 | proc done*(face: FT_Face): FT_Error {.inline,discardable.} = 294 | FT_Done_Face(face) 295 | 296 | type 297 | FT_Size_Request_Type* = enum 298 | FT_SIZE_REQUEST_TYPE_NOMINAL, FT_SIZE_REQUEST_TYPE_REAL_DIM, 299 | FT_SIZE_REQUEST_TYPE_BBOX, FT_SIZE_REQUEST_TYPE_CELL, 300 | FT_SIZE_REQUEST_TYPE_SCALES, FT_SIZE_REQUEST_TYPE_MAX 301 | 302 | FT_Size_Request* = object 303 | typ*: FT_Size_Request_Type 304 | width*: FT_Long 305 | height*: FT_Long 306 | horiResolution*: FT_UInt 307 | vertResolution*: FT_UInt 308 | 309 | proc FT_Request_Size*(face: FT_Face; req: var FT_Size_Request): FT_Error {.ft_import.} 310 | 311 | proc FT_Set_Char_Size*(face: FT_Face; char_width, char_height: FT_F26Dot6; 312 | horz_resolution, vert_resolution: FT_UInt): FT_Error {.ft_import.} 313 | 314 | proc FT_Set_Pixel_Sizes*(face: FT_Face; pixel_width: FT_UInt; pixel_height: FT_UInt): FT_Error {.ft_import.} 315 | proc FT_Load_Glyph*(face: FT_Face; glyph_index: FT_UInt; load_flags: FT_Int32): FT_Error {.ft_import.} 316 | proc FT_Load_Char*(face: FT_Face; char_code: FT_ULong; load_flags: FT_Int32): FT_Error {.ft_import.} 317 | 318 | proc setCharSize*(face: FT_Face; charWidth, charHeight: FT_F26Dot6; 319 | horzResolution, vertResolution: FT_UInt): FT_Error {.inline,discardable.} = 320 | FT_Set_Char_Size(face, FT_F26Dot6(charWidth), FT_F26Dot6(charHeight), 321 | FT_UInt(horzResolution), FT_UInt(vertResolution)) 322 | 323 | proc setPixelSizes*(face: FT_Face; pixelWidth, pixelHeight: FT_UInt): FT_Error {.inline,discardable.} = 324 | FT_Set_Pixel_Sizes(face, pixelWidth, pixelHeight) 325 | 326 | proc loadGlyph*(face: FT_Face; glyphIndex: FT_UInt; loadFlags: FT_Int32): FT_Error {.inline,discardable.} = 327 | FT_Load_Glyph(face, glyphIndex, loadFlags) 328 | 329 | proc FT_LOAD_TARGET[T](x: T): FT_Int32 {.compileTime.} = 330 | result = FT_Int32(FT_Int32(x) and 15) shl 16 331 | 332 | type 333 | FT_Render_Mode* = enum 334 | FT_RENDER_MODE_NORMAL = 0, FT_RENDER_MODE_LIGHT, FT_RENDER_MODE_MONO, 335 | FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V, FT_RENDER_MODE_MAX 336 | 337 | const 338 | FT_LOAD_DEFAULT* = 0x00000000 339 | FT_LOAD_NO_SCALE* = (1 shl 0) 340 | FT_LOAD_NO_HINTING* = (1 shl 1) 341 | FT_LOAD_RENDER* = (1 shl 2) 342 | FT_LOAD_NO_BITMAP* = (1 shl 3) 343 | FT_LOAD_VERTICAL_LAYOUT* = (1 shl 4) 344 | FT_LOAD_FORCE_AUTOHINT* = (1 shl 5) 345 | FT_LOAD_CROP_BITMAP* = (1 shl 6) 346 | FT_LOAD_PEDANTIC* = (1 shl 7) 347 | FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH* = (1 shl 9) 348 | FT_LOAD_NO_RECURSE* = (1 shl 10) 349 | FT_LOAD_IGNORE_TRANSFORM* = (1 shl 11) 350 | FT_LOAD_MONOCHROME* = (1 shl 12) 351 | FT_LOAD_LINEAR_DESIGN* = (1 shl 13) 352 | FT_LOAD_NO_AUTOHINT* = (1 shl 15) 353 | FT_LOAD_COLOR* = (1 shl 20) 354 | FT_LOAD_COMPUTE_METRICS* = (1 shl 21) 355 | FT_LOAD_BITMAP_METRICS_ONLY* = (1 shl 22) 356 | FT_LOAD_ADVANCE_ONLY* = (1 shl 8) 357 | FT_LOAD_SBITS_ONLY* = (1 shl 14) 358 | 359 | FT_LOAD_TARGET_NORMAL* = FT_LOAD_TARGET(FT_RENDER_MODE_NORMAL) 360 | FT_LOAD_TARGET_LIGHT* = FT_LOAD_TARGET(FT_RENDER_MODE_LIGHT) 361 | FT_LOAD_TARGET_MONO* = FT_LOAD_TARGET(FT_RENDER_MODE_MONO) 362 | FT_LOAD_TARGET_LCD* = FT_LOAD_TARGET(FT_RENDER_MODE_LCD) 363 | FT_LOAD_TARGET_LCD_V* = FT_LOAD_TARGET(FT_RENDER_MODE_LCD_V) 364 | 365 | 366 | template FT_LOAD_TARGET_MODE*(x: untyped): untyped = 367 | ((FT_Render_Mode)(((x) shr 16) and 15)) 368 | 369 | proc FT_Set_Transform*(face: FT_Face; matrix: var FT_Matrix; delta: var FT_Vector) {.ft_import.} 370 | 371 | const 372 | ft_render_mode_normal* = FT_RENDER_MODE_NORMAL 373 | ft_render_mode_mono* = FT_RENDER_MODE_MONO 374 | 375 | proc FT_Render_Glyph*(slot: FT_GlyphSlot; render_mode: FT_Render_Mode): FT_Error {.ft_import.} 376 | 377 | proc render*(slot: FT_GlyphSlot; renderMode: FT_Render_Mode): FT_Error {.inline,discardable.} = 378 | FT_Render_Glyph(slot, renderMode) 379 | 380 | type 381 | FT_Kerning_Mode* = enum 382 | FT_KERNING_DEFAULT = 0, FT_KERNING_UNFITTED, FT_KERNING_UNSCALED 383 | 384 | const 385 | ft_kerning_default* = FT_KERNING_DEFAULT 386 | ft_kerning_unfitted* = FT_KERNING_UNFITTED 387 | ft_kerning_unscaled* = FT_KERNING_UNSCALED 388 | 389 | proc FT_Get_Kerning*(face: FT_Face; left_glyph: FT_UInt; right_glyph: FT_UInt; 390 | kern_mode: FT_UInt; akerning: var FT_Vector): FT_Error {.ft_import.} 391 | 392 | proc FT_Get_Track_Kerning*(face: FT_Face; point_size: FT_Fixed; degree: FT_Int; 393 | akerning: var FT_Fixed): FT_Error {.ft_import.} 394 | 395 | proc FT_Get_Glyph_Name*(face: FT_Face; glyph_index: FT_UInt; buffer: FT_Pointer; 396 | buffer_max: FT_UInt): FT_Error {.ft_import.} 397 | 398 | proc FT_Get_Postscript_Name*(face: FT_Face): cstring {.ft_import.} 399 | proc FT_Select_Charmap*(face: FT_Face; encoding: FT_Encoding): FT_Error {.ft_import.} 400 | proc FT_Set_Charmap*(face: FT_Face; charmap: FT_CharMap): FT_Error {.ft_import.} 401 | proc FT_Get_Charmap_Index*(charmap: FT_CharMap): FT_Int {.ft_import.} 402 | proc FT_Get_Char_Index*(face: FT_Face; charcode: FT_ULong): FT_UInt {.ft_import.} 403 | proc FT_Get_First_Char*(face: FT_Face; agindex: var FT_UInt): FT_ULong {.ft_import.} 404 | proc FT_Get_Next_Char*(face: FT_Face; char_code: FT_ULong; agindex: var FT_UInt): FT_ULong {.ft_import.} 405 | proc FT_Get_Name_Index*(face: FT_Face; glyph_name: var FT_String): FT_UInt {.ft_import.} 406 | 407 | proc charIndex*(face: FT_Face; charCode: FT_ULong): FT_UInt {.inline.} = 408 | FT_Get_Char_Index(face, charCode) 409 | 410 | const 411 | FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS* = 1 412 | FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES* = 2 413 | FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID* = 4 414 | FT_SUBGLYPH_FLAG_SCALE* = 8 415 | FT_SUBGLYPH_FLAG_XY_SCALE* = 0x00000040 416 | FT_SUBGLYPH_FLAG_2X2* = 0x00000080 417 | FT_SUBGLYPH_FLAG_USE_MY_METRICS* = 0x00000200 418 | 419 | proc FT_Get_SubGlyph_Info*(glyph: FT_GlyphSlot; sub_index: FT_UInt; 420 | p_index: var FT_Int; p_flags: var FT_UInt; 421 | p_arg1: var FT_Int; p_arg2: var FT_Int; 422 | p_transform: var FT_Matrix): FT_Error {.ft_import.} 423 | const 424 | FT_FSTYPE_INSTALLABLE_EMBEDDING* = 0x00000000 425 | FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING* = 0x00000002 426 | FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING* = 0x00000004 427 | FT_FSTYPE_EDITABLE_EMBEDDING* = 0x00000008 428 | FT_FSTYPE_NO_SUBSETTING* = 0x00000100 429 | FT_FSTYPE_BITMAP_EMBEDDING_ONLY* = 0x00000200 430 | 431 | proc FT_Get_FSType_Flags*(face: FT_Face): FT_UShort {.ft_import.} 432 | 433 | proc FT_Face_GetCharVariantIndex*(face: FT_Face; charcode: FT_ULong; 434 | variantSelector: FT_ULong): FT_UInt {.ft_import.} 435 | 436 | proc FT_Face_GetCharVariantIsDefault*(face: FT_Face; charcode: FT_ULong; 437 | variantSelector: FT_ULong): FT_Int {.ft_import.} 438 | 439 | proc FT_Face_GetVariantSelectors*(face: FT_Face): ptr FT_UInt32 {.ft_import.} 440 | proc FT_Face_GetVariantsOfChar*(face: FT_Face; charcode: FT_ULong): ptr FT_UInt32 {.ft_import.} 441 | proc FT_Face_GetCharsOfVariant*(face: FT_Face; variantSelector: FT_ULong): ptr FT_UInt32 {.ft_import.} 442 | proc FT_MulDiv*(a: FT_Long; b: FT_Long; c: FT_Long): FT_Long {.ft_import.} 443 | proc FT_MulFix*(a: FT_Long; b: FT_Long): FT_Long {.ft_import.} 444 | proc FT_DivFix*(a: FT_Long; b: FT_Long): FT_Long {.ft_import.} 445 | proc FT_RoundFix*(a: FT_Fixed): FT_Fixed {.ft_import.} 446 | proc FT_CeilFix*(a: FT_Fixed): FT_Fixed {.ft_import.} 447 | proc FT_FloorFix*(a: FT_Fixed): FT_Fixed {.ft_import.} 448 | proc FT_Vector_Transform*(vec: var FT_Vector; matrix: var FT_Matrix) {.ft_import.} 449 | 450 | const 451 | FREETYPE_MAJOR* = 2 452 | FREETYPE_MINOR* = 7 453 | FREETYPE_PATCH* = 1 454 | 455 | proc FT_Library_Version*(library: FT_Library; amajor: var FT_Int; aminor: var FT_Int; 456 | apatch: var FT_Int) {.ft_import.} 457 | 458 | proc FT_Face_CheckTrueTypePatents*(face: FT_Face): FT_Bool {.ft_import.} 459 | 460 | proc FT_Face_SetUnpatentedHinting*(face: FT_Face; value: FT_Bool): FT_Bool {.ft_import.} 461 | -------------------------------------------------------------------------------- /freetype/ttnameid.nim: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Andri Lim 2 | # 3 | # Distributed under the MIT license 4 | # (See accompanying file LICENSE.txt) 5 | # 6 | #----------------------------------------- 7 | 8 | const 9 | TT_PLATFORM_APPLE_UNICODE* = 0 10 | TT_PLATFORM_MACINTOSH* = 1 11 | TT_PLATFORM_ISO* = 2 12 | TT_PLATFORM_MICROSOFT* = 3 13 | TT_PLATFORM_CUSTOM* = 4 14 | TT_PLATFORM_ADOBE* = 7 15 | TT_APPLE_ID_DEFAULT* = 0 16 | TT_APPLE_ID_UNICODE_1_1* = 1 17 | TT_APPLE_ID_ISO_10646* = 2 18 | TT_APPLE_ID_UNICODE_2_0* = 3 19 | TT_APPLE_ID_UNICODE_32* = 4 20 | TT_APPLE_ID_VARIANT_SELECTOR* = 5 21 | TT_MAC_ID_ROMAN* = 0 22 | TT_MAC_ID_JAPANESE* = 1 23 | TT_MAC_ID_TRADITIONAL_CHINESE* = 2 24 | TT_MAC_ID_KOREAN* = 3 25 | TT_MAC_ID_ARABIC* = 4 26 | TT_MAC_ID_HEBREW* = 5 27 | TT_MAC_ID_GREEK* = 6 28 | TT_MAC_ID_RUSSIAN* = 7 29 | TT_MAC_ID_RSYMBOL* = 8 30 | TT_MAC_ID_DEVANAGARI* = 9 31 | TT_MAC_ID_GURMUKHI* = 10 32 | TT_MAC_ID_GUJARATI* = 11 33 | TT_MAC_ID_ORIYA* = 12 34 | TT_MAC_ID_BENGALI* = 13 35 | TT_MAC_ID_TAMIL* = 14 36 | TT_MAC_ID_TELUGU* = 15 37 | TT_MAC_ID_KANNADA* = 16 38 | TT_MAC_ID_MALAYALAM* = 17 39 | TT_MAC_ID_SINHALESE* = 18 40 | TT_MAC_ID_BURMESE* = 19 41 | TT_MAC_ID_KHMER* = 20 42 | TT_MAC_ID_THAI* = 21 43 | TT_MAC_ID_LAOTIAN* = 22 44 | TT_MAC_ID_GEORGIAN* = 23 45 | TT_MAC_ID_ARMENIAN* = 24 46 | TT_MAC_ID_MALDIVIAN* = 25 47 | TT_MAC_ID_SIMPLIFIED_CHINESE* = 25 48 | TT_MAC_ID_TIBETAN* = 26 49 | TT_MAC_ID_MONGOLIAN* = 27 50 | TT_MAC_ID_GEEZ* = 28 51 | TT_MAC_ID_SLAVIC* = 29 52 | TT_MAC_ID_VIETNAMESE* = 30 53 | TT_MAC_ID_SINDHI* = 31 54 | TT_MAC_ID_UNINTERP* = 32 55 | TT_ISO_ID_7BIT_ASCII* = 0 56 | TT_ISO_ID_10646* = 1 57 | TT_ISO_ID_8859_1* = 2 58 | TT_MS_ID_SYMBOL_CS* = 0 59 | TT_MS_ID_UNICODE_CS* = 1 60 | TT_MS_ID_SJIS* = 2 61 | TT_MS_ID_GB2312* = 3 62 | TT_MS_ID_BIG_5* = 4 63 | TT_MS_ID_WANSUNG* = 5 64 | TT_MS_ID_JOHAB* = 6 65 | TT_MS_ID_UCS_4* = 10 66 | TT_ADOBE_ID_STANDARD* = 0 67 | TT_ADOBE_ID_EXPERT* = 1 68 | TT_ADOBE_ID_CUSTOM* = 2 69 | TT_ADOBE_ID_LATIN_1* = 3 70 | TT_MAC_LANGID_ENGLISH* = 0 71 | TT_MAC_LANGID_FRENCH* = 1 72 | TT_MAC_LANGID_GERMAN* = 2 73 | TT_MAC_LANGID_ITALIAN* = 3 74 | TT_MAC_LANGID_DUTCH* = 4 75 | TT_MAC_LANGID_SWEDISH* = 5 76 | TT_MAC_LANGID_SPANISH* = 6 77 | TT_MAC_LANGID_DANISH* = 7 78 | TT_MAC_LANGID_PORTUGUESE* = 8 79 | TT_MAC_LANGID_NORWEGIAN* = 9 80 | TT_MAC_LANGID_HEBREW* = 10 81 | TT_MAC_LANGID_JAPANESE* = 11 82 | TT_MAC_LANGID_ARABIC* = 12 83 | TT_MAC_LANGID_FINNISH* = 13 84 | TT_MAC_LANGID_GREEK* = 14 85 | TT_MAC_LANGID_ICELANDIC* = 15 86 | TT_MAC_LANGID_MALTESE* = 16 87 | TT_MAC_LANGID_TURKISH* = 17 88 | TT_MAC_LANGID_CROATIAN* = 18 89 | TT_MAC_LANGID_CHINESE_TRADITIONAL* = 19 90 | TT_MAC_LANGID_URDU* = 20 91 | TT_MAC_LANGID_HINDI* = 21 92 | TT_MAC_LANGID_THAI* = 22 93 | TT_MAC_LANGID_KOREAN* = 23 94 | TT_MAC_LANGID_LITHUANIAN* = 24 95 | TT_MAC_LANGID_POLISH* = 25 96 | TT_MAC_LANGID_HUNGARIAN* = 26 97 | TT_MAC_LANGID_ESTONIAN* = 27 98 | TT_MAC_LANGID_LETTISH* = 28 99 | TT_MAC_LANGID_SAAMISK* = 29 100 | TT_MAC_LANGID_FAEROESE* = 30 101 | TT_MAC_LANGID_FARSI* = 31 102 | TT_MAC_LANGID_RUSSIAN* = 32 103 | TT_MAC_LANGID_CHINESE_SIMPLIFIED* = 33 104 | TT_MAC_LANGID_FLEMISH* = 34 105 | TT_MAC_LANGID_IRISH* = 35 106 | TT_MAC_LANGID_ALBANIAN* = 36 107 | TT_MAC_LANGID_ROMANIAN* = 37 108 | TT_MAC_LANGID_CZECH* = 38 109 | TT_MAC_LANGID_SLOVAK* = 39 110 | TT_MAC_LANGID_SLOVENIAN* = 40 111 | TT_MAC_LANGID_YIDDISH* = 41 112 | TT_MAC_LANGID_SERBIAN* = 42 113 | TT_MAC_LANGID_MACEDONIAN* = 43 114 | TT_MAC_LANGID_BULGARIAN* = 44 115 | TT_MAC_LANGID_UKRAINIAN* = 45 116 | TT_MAC_LANGID_BYELORUSSIAN* = 46 117 | TT_MAC_LANGID_UZBEK* = 47 118 | TT_MAC_LANGID_KAZAKH* = 48 119 | TT_MAC_LANGID_AZERBAIJANI* = 49 120 | TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT* = 49 121 | TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT* = 50 122 | TT_MAC_LANGID_ARMENIAN* = 51 123 | TT_MAC_LANGID_GEORGIAN* = 52 124 | TT_MAC_LANGID_MOLDAVIAN* = 53 125 | TT_MAC_LANGID_KIRGHIZ* = 54 126 | TT_MAC_LANGID_TAJIKI* = 55 127 | TT_MAC_LANGID_TURKMEN* = 56 128 | TT_MAC_LANGID_MONGOLIAN* = 57 129 | TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT* = 57 130 | TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT* = 58 131 | TT_MAC_LANGID_PASHTO* = 59 132 | TT_MAC_LANGID_KURDISH* = 60 133 | TT_MAC_LANGID_KASHMIRI* = 61 134 | TT_MAC_LANGID_SINDHI* = 62 135 | TT_MAC_LANGID_TIBETAN* = 63 136 | TT_MAC_LANGID_NEPALI* = 64 137 | TT_MAC_LANGID_SANSKRIT* = 65 138 | TT_MAC_LANGID_MARATHI* = 66 139 | TT_MAC_LANGID_BENGALI* = 67 140 | TT_MAC_LANGID_ASSAMESE* = 68 141 | TT_MAC_LANGID_GUJARATI* = 69 142 | TT_MAC_LANGID_PUNJABI* = 70 143 | TT_MAC_LANGID_ORIYA* = 71 144 | TT_MAC_LANGID_MALAYALAM* = 72 145 | TT_MAC_LANGID_KANNADA* = 73 146 | TT_MAC_LANGID_TAMIL* = 74 147 | TT_MAC_LANGID_TELUGU* = 75 148 | TT_MAC_LANGID_SINHALESE* = 76 149 | TT_MAC_LANGID_BURMESE* = 77 150 | TT_MAC_LANGID_KHMER* = 78 151 | TT_MAC_LANGID_LAO* = 79 152 | TT_MAC_LANGID_VIETNAMESE* = 80 153 | TT_MAC_LANGID_INDONESIAN* = 81 154 | TT_MAC_LANGID_TAGALOG* = 82 155 | TT_MAC_LANGID_MALAY_ROMAN_SCRIPT* = 83 156 | TT_MAC_LANGID_MALAY_ARABIC_SCRIPT* = 84 157 | TT_MAC_LANGID_AMHARIC* = 85 158 | TT_MAC_LANGID_TIGRINYA* = 86 159 | TT_MAC_LANGID_GALLA* = 87 160 | TT_MAC_LANGID_SOMALI* = 88 161 | TT_MAC_LANGID_SWAHILI* = 89 162 | TT_MAC_LANGID_RUANDA* = 90 163 | TT_MAC_LANGID_RUNDI* = 91 164 | TT_MAC_LANGID_CHEWA* = 92 165 | TT_MAC_LANGID_MALAGASY* = 93 166 | TT_MAC_LANGID_ESPERANTO* = 94 167 | TT_MAC_LANGID_WELSH* = 128 168 | TT_MAC_LANGID_BASQUE* = 129 169 | TT_MAC_LANGID_CATALAN* = 130 170 | TT_MAC_LANGID_LATIN* = 131 171 | TT_MAC_LANGID_QUECHUA* = 132 172 | TT_MAC_LANGID_GUARANI* = 133 173 | TT_MAC_LANGID_AYMARA* = 134 174 | TT_MAC_LANGID_TATAR* = 135 175 | TT_MAC_LANGID_UIGHUR* = 136 176 | TT_MAC_LANGID_DZONGKHA* = 137 177 | TT_MAC_LANGID_JAVANESE* = 138 178 | TT_MAC_LANGID_SUNDANESE* = 139 179 | 180 | const 181 | TT_MAC_LANGID_GALICIAN* = 140 182 | TT_MAC_LANGID_AFRIKAANS* = 141 183 | TT_MAC_LANGID_BRETON* = 142 184 | TT_MAC_LANGID_INUKTITUT* = 143 185 | TT_MAC_LANGID_SCOTTISH_GAELIC* = 144 186 | TT_MAC_LANGID_MANX_GAELIC* = 145 187 | TT_MAC_LANGID_IRISH_GAELIC* = 146 188 | TT_MAC_LANGID_TONGAN* = 147 189 | TT_MAC_LANGID_GREEK_POLYTONIC* = 148 190 | TT_MAC_LANGID_GREELANDIC* = 149 191 | TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT* = 150 192 | TT_MS_LANGID_ARABIC_GENERAL* = 0x00000001 193 | TT_MS_LANGID_ARABIC_SAUDI_ARABIA* = 0x00000401 194 | TT_MS_LANGID_ARABIC_IRAQ* = 0x00000801 195 | TT_MS_LANGID_ARABIC_EGYPT* = 0x00000C01 196 | TT_MS_LANGID_ARABIC_LIBYA* = 0x00001001 197 | TT_MS_LANGID_ARABIC_ALGERIA* = 0x00001401 198 | TT_MS_LANGID_ARABIC_MOROCCO* = 0x00001801 199 | TT_MS_LANGID_ARABIC_TUNISIA* = 0x00001C01 200 | TT_MS_LANGID_ARABIC_OMAN* = 0x00002001 201 | TT_MS_LANGID_ARABIC_YEMEN* = 0x00002401 202 | TT_MS_LANGID_ARABIC_SYRIA* = 0x00002801 203 | TT_MS_LANGID_ARABIC_JORDAN* = 0x00002C01 204 | TT_MS_LANGID_ARABIC_LEBANON* = 0x00003001 205 | TT_MS_LANGID_ARABIC_KUWAIT* = 0x00003401 206 | TT_MS_LANGID_ARABIC_UAE* = 0x00003801 207 | TT_MS_LANGID_ARABIC_BAHRAIN* = 0x00003C01 208 | TT_MS_LANGID_ARABIC_QATAR* = 0x00004001 209 | TT_MS_LANGID_BULGARIAN_BULGARIA* = 0x00000402 210 | TT_MS_LANGID_CATALAN_SPAIN* = 0x00000403 211 | TT_MS_LANGID_CHINESE_GENERAL* = 0x00000004 212 | TT_MS_LANGID_CHINESE_TAIWAN* = 0x00000404 213 | TT_MS_LANGID_CHINESE_PRC* = 0x00000804 214 | TT_MS_LANGID_CHINESE_HONG_KONG* = 0x00000C04 215 | TT_MS_LANGID_CHINESE_SINGAPORE* = 0x00001004 216 | TT_MS_LANGID_CHINESE_MACAU* = 0x00001404 217 | TT_MS_LANGID_CZECH_CZECH_REPUBLIC* = 0x00000405 218 | TT_MS_LANGID_DANISH_DENMARK* = 0x00000406 219 | TT_MS_LANGID_GERMAN_GERMANY* = 0x00000407 220 | TT_MS_LANGID_GERMAN_SWITZERLAND* = 0x00000807 221 | TT_MS_LANGID_GERMAN_AUSTRIA* = 0x00000C07 222 | TT_MS_LANGID_GERMAN_LUXEMBOURG* = 0x00001007 223 | TT_MS_LANGID_GERMAN_LIECHTENSTEI* = 0x00001407 224 | TT_MS_LANGID_GREEK_GREECE* = 0x00000408 225 | TT_MS_LANGID_ENGLISH_GENERAL* = 0x00000009 226 | TT_MS_LANGID_ENGLISH_UNITED_STATES* = 0x00000409 227 | TT_MS_LANGID_ENGLISH_UNITED_KINGDOM* = 0x00000809 228 | TT_MS_LANGID_ENGLISH_AUSTRALIA* = 0x00000C09 229 | TT_MS_LANGID_ENGLISH_CANADA* = 0x00001009 230 | TT_MS_LANGID_ENGLISH_NEW_ZEALAND* = 0x00001409 231 | TT_MS_LANGID_ENGLISH_IRELAND* = 0x00001809 232 | TT_MS_LANGID_ENGLISH_SOUTH_AFRICA* = 0x00001C09 233 | TT_MS_LANGID_ENGLISH_JAMAICA* = 0x00002009 234 | TT_MS_LANGID_ENGLISH_CARIBBEAN* = 0x00002409 235 | TT_MS_LANGID_ENGLISH_BELIZE* = 0x00002809 236 | TT_MS_LANGID_ENGLISH_TRINIDAD* = 0x00002C09 237 | TT_MS_LANGID_ENGLISH_ZIMBABWE* = 0x00003009 238 | TT_MS_LANGID_ENGLISH_PHILIPPINES* = 0x00003409 239 | TT_MS_LANGID_ENGLISH_INDONESIA* = 0x00003809 240 | TT_MS_LANGID_ENGLISH_HONG_KONG* = 0x00003C09 241 | TT_MS_LANGID_ENGLISH_INDIA* = 0x00004009 242 | TT_MS_LANGID_ENGLISH_MALAYSIA* = 0x00004409 243 | TT_MS_LANGID_ENGLISH_SINGAPORE* = 0x00004809 244 | TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT* = 0x0000040A 245 | TT_MS_LANGID_SPANISH_MEXICO* = 0x0000080A 246 | TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT* = 0x00000C0A 247 | TT_MS_LANGID_SPANISH_GUATEMALA* = 0x0000100A 248 | TT_MS_LANGID_SPANISH_COSTA_RICA* = 0x0000140A 249 | TT_MS_LANGID_SPANISH_PANAMA* = 0x0000180A 250 | TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC* = 0x00001C0A 251 | TT_MS_LANGID_SPANISH_VENEZUELA* = 0x0000200A 252 | TT_MS_LANGID_SPANISH_COLOMBIA* = 0x0000240A 253 | TT_MS_LANGID_SPANISH_PERU* = 0x0000280A 254 | TT_MS_LANGID_SPANISH_ARGENTINA* = 0x00002C0A 255 | TT_MS_LANGID_SPANISH_ECUADOR* = 0x0000300A 256 | TT_MS_LANGID_SPANISH_CHILE* = 0x0000340A 257 | TT_MS_LANGID_SPANISH_URUGUAY* = 0x0000380A 258 | TT_MS_LANGID_SPANISH_PARAGUAY* = 0x00003C0A 259 | TT_MS_LANGID_SPANISH_BOLIVIA* = 0x0000400A 260 | TT_MS_LANGID_SPANISH_EL_SALVADOR* = 0x0000440A 261 | TT_MS_LANGID_SPANISH_HONDURAS* = 0x0000480A 262 | TT_MS_LANGID_SPANISH_NICARAGUA* = 0x00004C0A 263 | TT_MS_LANGID_SPANISH_PUERTO_RICO* = 0x0000500A 264 | TT_MS_LANGID_SPANISH_UNITED_STATES* = 0x0000540A 265 | TT_MS_LANGID_SPANISH_LATIN_AMERICA* = 0x0000E40A 266 | TT_MS_LANGID_FINNISH_FINLAND* = 0x0000040B 267 | TT_MS_LANGID_FRENCH_FRANCE* = 0x0000040C 268 | TT_MS_LANGID_FRENCH_BELGIUM* = 0x0000080C 269 | TT_MS_LANGID_FRENCH_CANADA* = 0x00000C0C 270 | TT_MS_LANGID_FRENCH_SWITZERLAND* = 0x0000100C 271 | TT_MS_LANGID_FRENCH_LUXEMBOURG* = 0x0000140C 272 | TT_MS_LANGID_FRENCH_MONACO* = 0x0000180C 273 | TT_MS_LANGID_FRENCH_WEST_INDIES* = 0x00001C0C 274 | TT_MS_LANGID_FRENCH_REUNION* = 0x0000200C 275 | TT_MS_LANGID_FRENCH_CONGO* = 0x0000240C 276 | TT_MS_LANGID_FRENCH_ZAIRE* = TT_MS_LANGID_FRENCH_CONGO 277 | TT_MS_LANGID_FRENCH_SENEGAL* = 0x0000280C 278 | TT_MS_LANGID_FRENCH_CAMEROON* = 0x00002C0C 279 | TT_MS_LANGID_FRENCH_COTE_D_IVOIRE* = 0x0000300C 280 | TT_MS_LANGID_FRENCH_MALI* = 0x0000340C 281 | TT_MS_LANGID_FRENCH_MOROCCO* = 0x0000380C 282 | TT_MS_LANGID_FRENCH_HAITI* = 0x00003C0C 283 | TT_MS_LANGID_FRENCH_NORTH_AFRICA* = 0x0000E40C 284 | TT_MS_LANGID_HEBREW_ISRAEL* = 0x0000040D 285 | TT_MS_LANGID_HUNGARIAN_HUNGARY* = 0x0000040E 286 | TT_MS_LANGID_ICELANDIC_ICELAND* = 0x0000040F 287 | TT_MS_LANGID_ITALIAN_ITALY* = 0x00000410 288 | TT_MS_LANGID_ITALIAN_SWITZERLAND* = 0x00000810 289 | TT_MS_LANGID_JAPANESE_JAPAN* = 0x00000411 290 | TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA* = 0x00000412 291 | TT_MS_LANGID_KOREAN_JOHAB_KOREA* = 0x00000812 292 | TT_MS_LANGID_DUTCH_NETHERLANDS* = 0x00000413 293 | TT_MS_LANGID_DUTCH_BELGIUM* = 0x00000813 294 | TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL* = 0x00000414 295 | TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK* = 0x00000814 296 | TT_MS_LANGID_POLISH_POLAND* = 0x00000415 297 | TT_MS_LANGID_PORTUGUESE_BRAZIL* = 0x00000416 298 | TT_MS_LANGID_PORTUGUESE_PORTUGAL* = 0x00000816 299 | TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND* = 0x00000417 300 | TT_MS_LANGID_ROMANIAN_ROMANIA* = 0x00000418 301 | TT_MS_LANGID_MOLDAVIAN_MOLDAVIA* = 0x00000818 302 | TT_MS_LANGID_RUSSIAN_RUSSIA* = 0x00000419 303 | TT_MS_LANGID_RUSSIAN_MOLDAVIA* = 0x00000819 304 | TT_MS_LANGID_CROATIAN_CROATIA* = 0x0000041A 305 | TT_MS_LANGID_SERBIAN_SERBIA_LATIN* = 0x0000081A 306 | TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC* = 0x00000C1A 307 | TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA* = 0x0000101A 308 | TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA* = 0x0000141A 309 | TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN* = 0x0000181A 310 | TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC* = 0x0000181A 311 | TT_MS_LANGID_SLOVAK_SLOVAKIA* = 0x0000041B 312 | TT_MS_LANGID_ALBANIAN_ALBANIA* = 0x0000041C 313 | TT_MS_LANGID_SWEDISH_SWEDEN* = 0x0000041D 314 | TT_MS_LANGID_SWEDISH_FINLAND* = 0x0000081D 315 | TT_MS_LANGID_THAI_THAILAND* = 0x0000041E 316 | TT_MS_LANGID_TURKISH_TURKEY* = 0x0000041F 317 | TT_MS_LANGID_URDU_PAKISTAN* = 0x00000420 318 | TT_MS_LANGID_URDU_INDIA* = 0x00000820 319 | TT_MS_LANGID_INDONESIAN_INDONESIA* = 0x00000421 320 | TT_MS_LANGID_UKRAINIAN_UKRAINE* = 0x00000422 321 | TT_MS_LANGID_BELARUSIAN_BELARUS* = 0x00000423 322 | TT_MS_LANGID_SLOVENE_SLOVENIA* = 0x00000424 323 | TT_MS_LANGID_ESTONIAN_ESTONIA* = 0x00000425 324 | TT_MS_LANGID_LATVIAN_LATVIA* = 0x00000426 325 | TT_MS_LANGID_LITHUANIAN_LITHUANIA* = 0x00000427 326 | TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA* = 0x00000827 327 | TT_MS_LANGID_TAJIK_TAJIKISTAN* = 0x00000428 328 | TT_MS_LANGID_FARSI_IRAN* = 0x00000429 329 | TT_MS_LANGID_VIETNAMESE_VIET_NAM* = 0x0000042A 330 | TT_MS_LANGID_ARMENIAN_ARMENIA* = 0x0000042B 331 | TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN* = 0x0000042C 332 | TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC* = 0x0000082C 333 | TT_MS_LANGID_BASQUE_SPAIN* = 0x0000042D 334 | TT_MS_LANGID_SORBIAN_GERMANY* = 0x0000042E 335 | TT_MS_LANGID_MACEDONIAN_MACEDONIA* = 0x0000042F 336 | TT_MS_LANGID_SUTU_SOUTH_AFRICA* = 0x00000430 337 | TT_MS_LANGID_TSONGA_SOUTH_AFRICA* = 0x00000431 338 | TT_MS_LANGID_TSWANA_SOUTH_AFRICA* = 0x00000432 339 | TT_MS_LANGID_VENDA_SOUTH_AFRICA* = 0x00000433 340 | TT_MS_LANGID_XHOSA_SOUTH_AFRICA* = 0x00000434 341 | TT_MS_LANGID_ZULU_SOUTH_AFRICA* = 0x00000435 342 | TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA* = 0x00000436 343 | TT_MS_LANGID_GEORGIAN_GEORGIA* = 0x00000437 344 | TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS* = 0x00000438 345 | TT_MS_LANGID_HINDI_INDIA* = 0x00000439 346 | TT_MS_LANGID_MALTESE_MALTA* = 0x0000043A 347 | TT_MS_LANGID_SAMI_NORTHERN_NORWAY* = 0x0000043B 348 | TT_MS_LANGID_SAMI_NORTHERN_SWEDEN* = 0x0000083B 349 | TT_MS_LANGID_SAMI_NORTHERN_FINLAND* = 0x00000C3B 350 | TT_MS_LANGID_SAMI_LULE_NORWAY* = 0x0000103B 351 | TT_MS_LANGID_SAMI_LULE_SWEDEN* = 0x0000143B 352 | TT_MS_LANGID_SAMI_SOUTHERN_NORWAY* = 0x0000183B 353 | TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN* = 0x00001C3B 354 | TT_MS_LANGID_SAMI_SKOLT_FINLAND* = 0x0000203B 355 | TT_MS_LANGID_SAMI_INARI_FINLAND* = 0x0000243B 356 | TT_MS_LANGID_SAAMI_LAPONIA* = 0x0000043B 357 | TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM* = 0x0000083C 358 | TT_MS_LANGID_IRISH_GAELIC_IRELAND* = 0x0000043C 359 | TT_MS_LANGID_YIDDISH_GERMANY* = 0x0000043D 360 | TT_MS_LANGID_MALAY_MALAYSIA* = 0x0000043E 361 | TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM* = 0x0000083E 362 | TT_MS_LANGID_KAZAK_KAZAKSTAN* = 0x0000043F 363 | TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN* = 0x00000440 364 | TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC* = TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN 365 | TT_MS_LANGID_SWAHILI_KENYA* = 0x00000441 366 | TT_MS_LANGID_TURKMEN_TURKMENISTAN* = 0x00000442 367 | TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN* = 0x00000443 368 | TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC* = 0x00000843 369 | TT_MS_LANGID_TATAR_TATARSTAN* = 0x00000444 370 | TT_MS_LANGID_BENGALI_INDIA* = 0x00000445 371 | TT_MS_LANGID_BENGALI_BANGLADESH* = 0x00000845 372 | TT_MS_LANGID_PUNJABI_INDIA* = 0x00000446 373 | TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN* = 0x00000846 374 | TT_MS_LANGID_GUJARATI_INDIA* = 0x00000447 375 | TT_MS_LANGID_ORIYA_INDIA* = 0x00000448 376 | TT_MS_LANGID_TAMIL_INDIA* = 0x00000449 377 | TT_MS_LANGID_TELUGU_INDIA* = 0x0000044A 378 | TT_MS_LANGID_KANNADA_INDIA* = 0x0000044B 379 | TT_MS_LANGID_MALAYALAM_INDIA* = 0x0000044C 380 | TT_MS_LANGID_ASSAMESE_INDIA* = 0x0000044D 381 | TT_MS_LANGID_MARATHI_INDIA* = 0x0000044E 382 | TT_MS_LANGID_SANSKRIT_INDIA* = 0x0000044F 383 | TT_MS_LANGID_MONGOLIAN_MONGOLIA* = 0x00000450 384 | TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN* = 0x00000850 385 | TT_MS_LANGID_TIBETAN_CHINA* = 0x00000451 386 | TT_MS_LANGID_DZONGHKA_BHUTAN* = 0x00000851 387 | TT_MS_LANGID_TIBETAN_BHUTAN* = TT_MS_LANGID_DZONGHKA_BHUTAN 388 | TT_MS_LANGID_WELSH_WALES* = 0x00000452 389 | TT_MS_LANGID_KHMER_CAMBODIA* = 0x00000453 390 | TT_MS_LANGID_LAO_LAOS* = 0x00000454 391 | TT_MS_LANGID_BURMESE_MYANMAR* = 0x00000455 392 | TT_MS_LANGID_GALICIAN_SPAIN* = 0x00000456 393 | TT_MS_LANGID_KONKANI_INDIA* = 0x00000457 394 | TT_MS_LANGID_MANIPURI_INDIA* = 0x00000458 395 | TT_MS_LANGID_SINDHI_INDIA* = 0x00000459 396 | TT_MS_LANGID_SINDHI_PAKISTAN* = 0x00000859 397 | TT_MS_LANGID_SYRIAC_SYRIA* = 0x0000045A 398 | TT_MS_LANGID_SINHALESE_SRI_LANKA* = 0x0000045B 399 | TT_MS_LANGID_CHEROKEE_UNITED_STATES* = 0x0000045C 400 | TT_MS_LANGID_INUKTITUT_CANADA* = 0x0000045D 401 | TT_MS_LANGID_AMHARIC_ETHIOPIA* = 0x0000045E 402 | TT_MS_LANGID_TAMAZIGHT_MOROCCO* = 0x0000045F 403 | TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN* = 0x0000085F 404 | TT_MS_LANGID_KASHMIRI_PAKISTAN* = 0x00000460 405 | TT_MS_LANGID_KASHMIRI_SASIA* = 0x00000860 406 | TT_MS_LANGID_KASHMIRI_INDIA* = TT_MS_LANGID_KASHMIRI_SASIA 407 | TT_MS_LANGID_NEPALI_NEPAL* = 0x00000461 408 | TT_MS_LANGID_NEPALI_INDIA* = 0x00000861 409 | TT_MS_LANGID_FRISIAN_NETHERLANDS* = 0x00000462 410 | TT_MS_LANGID_PASHTO_AFGHANISTAN* = 0x00000463 411 | TT_MS_LANGID_FILIPINO_PHILIPPINES* = 0x00000464 412 | TT_MS_LANGID_DHIVEHI_MALDIVES* = 0x00000465 413 | TT_MS_LANGID_DIVEHI_MALDIVES* = TT_MS_LANGID_DHIVEHI_MALDIVES 414 | TT_MS_LANGID_EDO_NIGERIA* = 0x00000466 415 | TT_MS_LANGID_FULFULDE_NIGERIA* = 0x00000467 416 | TT_MS_LANGID_HAUSA_NIGERIA* = 0x00000468 417 | TT_MS_LANGID_IBIBIO_NIGERIA* = 0x00000469 418 | TT_MS_LANGID_YORUBA_NIGERIA* = 0x0000046A 419 | TT_MS_LANGID_QUECHUA_BOLIVIA* = 0x0000046B 420 | TT_MS_LANGID_QUECHUA_ECUADOR* = 0x0000086B 421 | TT_MS_LANGID_QUECHUA_PERU* = 0x00000C6B 422 | TT_MS_LANGID_SEPEDI_SOUTH_AFRICA* = 0x0000046C 423 | TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA* = TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 424 | TT_MS_LANGID_IGBO_NIGERIA* = 0x00000470 425 | TT_MS_LANGID_KANURI_NIGERIA* = 0x00000471 426 | TT_MS_LANGID_OROMO_ETHIOPIA* = 0x00000472 427 | TT_MS_LANGID_TIGRIGNA_ETHIOPIA* = 0x00000473 428 | TT_MS_LANGID_TIGRIGNA_ERYTHREA* = 0x00000873 429 | TT_MS_LANGID_TIGRIGNA_ERYTREA* = TT_MS_LANGID_TIGRIGNA_ERYTHREA 430 | TT_MS_LANGID_GUARANI_PARAGUAY* = 0x00000474 431 | TT_MS_LANGID_HAWAIIAN_UNITED_STATES* = 0x00000475 432 | TT_MS_LANGID_LATIN* = 0x00000476 433 | TT_MS_LANGID_SOMALI_SOMALIA* = 0x00000477 434 | TT_MS_LANGID_YI_CHINA* = 0x00000478 435 | TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES* = 0x00000479 436 | TT_MS_LANGID_UIGHUR_CHINA* = 0x00000480 437 | TT_MS_LANGID_MAORI_NEW_ZEALAND* = 0x00000481 438 | TT_NAME_ID_COPYRIGHT* = 0 439 | TT_NAME_ID_FONT_FAMILY* = 1 440 | TT_NAME_ID_FONT_SUBFAMILY* = 2 441 | TT_NAME_ID_UNIQUE_ID* = 3 442 | TT_NAME_ID_FULL_NAME* = 4 443 | TT_NAME_ID_VERSION_STRING* = 5 444 | TT_NAME_ID_PS_NAME* = 6 445 | TT_NAME_ID_TRADEMARK* = 7 446 | TT_NAME_ID_MANUFACTURER* = 8 447 | TT_NAME_ID_DESIGNER* = 9 448 | TT_NAME_ID_DESCRIPTION* = 10 449 | TT_NAME_ID_VENDOR_URL* = 11 450 | TT_NAME_ID_DESIGNER_URL* = 12 451 | TT_NAME_ID_LICENSE* = 13 452 | TT_NAME_ID_LICENSE_URL* = 14 453 | TT_NAME_ID_PREFERRED_FAMILY* = 16 454 | TT_NAME_ID_PREFERRED_SUBFAMILY* = 17 455 | TT_NAME_ID_MAC_FULL_NAME* = 18 456 | TT_NAME_ID_SAMPLE_TEXT* = 19 457 | TT_NAME_ID_CID_FINDFONT_NAME* = 20 458 | TT_NAME_ID_WWS_FAMILY* = 21 459 | TT_NAME_ID_WWS_SUBFAMILY* = 22 460 | TT_UCR_BASIC_LATIN* = (1 shl 0) 461 | TT_UCR_LATIN1_SUPPLEMENT* = (1 shl 1) 462 | TT_UCR_LATIN_EXTENDED_A* = (1 shl 2) 463 | TT_UCR_LATIN_EXTENDED_B* = (1 shl 3) 464 | TT_UCR_IPA_EXTENSIONS* = (1 shl 4) 465 | TT_UCR_SPACING_MODIFIER* = (1 shl 5) 466 | TT_UCR_COMBINING_DIACRITICS* = (1 shl 6) 467 | TT_UCR_GREEK* = (1 shl 7) 468 | TT_UCR_COPTIC* = (1 shl 8) 469 | TT_UCR_CYRILLIC* = (1 shl 9) 470 | TT_UCR_ARMENIAN* = (1 shl 10) 471 | TT_UCR_HEBREW* = (1 shl 11) 472 | TT_UCR_VAI* = (1 shl 12) 473 | TT_UCR_ARABIC* = (1 shl 13) 474 | TT_UCR_NKO* = (1 shl 14) 475 | TT_UCR_DEVANAGARI* = (1 shl 15) 476 | TT_UCR_BENGALI* = (1 shl 16) 477 | TT_UCR_GURMUKHI* = (1 shl 17) 478 | TT_UCR_GUJARATI* = (1 shl 18) 479 | TT_UCR_ORIYA* = (1 shl 19) 480 | TT_UCR_TAMIL* = (1 shl 20) 481 | TT_UCR_TELUGU* = (1 shl 21) 482 | TT_UCR_KANNADA* = (1 shl 22) 483 | TT_UCR_MALAYALAM* = (1 shl 23) 484 | TT_UCR_THAI* = (1 shl 24) 485 | TT_UCR_LAO* = (1 shl 25) 486 | TT_UCR_GEORGIAN* = (1 shl 26) 487 | TT_UCR_BALINESE* = (1 shl 27) 488 | TT_UCR_HANGUL_JAMO* = (1 shl 28) 489 | TT_UCR_LATIN_EXTENDED_ADDITIONAL* = (1 shl 29) 490 | TT_UCR_GREEK_EXTENDED* = (1 shl 30) 491 | TT_UCR_GENERAL_PUNCTUATION* = (1 shl 31) 492 | TT_UCR_SUPERSCRIPTS_SUBSCRIPTS* = (1 shl 0) 493 | TT_UCR_CURRENCY_SYMBOLS* = (1 shl 1) 494 | TT_UCR_COMBINING_DIACRITICS_SYMB* = (1 shl 2) 495 | TT_UCR_LETTERLIKE_SYMBOLS* = (1 shl 3) 496 | TT_UCR_NUMBER_FORMS* = (1 shl 4) 497 | TT_UCR_ARROWS* = (1 shl 5) 498 | TT_UCR_MATHEMATICAL_OPERATORS* = (1 shl 6) 499 | TT_UCR_MISCELLANEOUS_TECHNICAL* = (1 shl 7) 500 | TT_UCR_CONTROL_PICTURES* = (1 shl 8) 501 | TT_UCR_OCR* = (1 shl 9) 502 | TT_UCR_ENCLOSED_ALPHANUMERICS* = (1 shl 10) 503 | TT_UCR_BOX_DRAWING* = (1 shl 11) 504 | TT_UCR_BLOCK_ELEMENTS* = (1 shl 12) 505 | TT_UCR_GEOMETRIC_SHAPES* = (1 shl 13) 506 | TT_UCR_MISCELLANEOUS_SYMBOLS* = (1 shl 14) 507 | TT_UCR_DINGBATS* = (1 shl 15) 508 | TT_UCR_CJK_SYMBOLS* = (1 shl 16) 509 | TT_UCR_HIRAGANA* = (1 shl 17) 510 | TT_UCR_KATAKANA* = (1 shl 18) 511 | TT_UCR_BOPOMOFO* = (1 shl 19) 512 | TT_UCR_HANGUL_COMPATIBILITY_JAMO* = (1 shl 20) 513 | TT_UCR_CJK_MISC* = (1 shl 21) 514 | TT_UCR_KANBUN* = TT_UCR_CJK_MISC 515 | TT_UCR_PHAGSPA* = true 516 | TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS* = (1 shl 22) 517 | TT_UCR_CJK_COMPATIBILITY* = (1 shl 23) 518 | TT_UCR_HANGUL* = (1 shl 24) 519 | TT_UCR_SURROGATES* = (1 shl 25) 520 | TT_UCR_NON_PLANE_0* = TT_UCR_SURROGATES 521 | TT_UCR_PHOENICIAN* = (1 shl 26) 522 | TT_UCR_CJK_UNIFIED_IDEOGRAPHS* = (1 shl 27) 523 | TT_UCR_PRIVATE_USE* = (1 shl 28) 524 | TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS* = (1 shl 29) 525 | TT_UCR_ALPHABETIC_PRESENTATION_FORMS* = (1 shl 30) 526 | TT_UCR_ARABIC_PRESENTATIONS_A* = (1 shl 31) 527 | TT_UCR_COMBINING_HALF_MARKS* = (1 shl 0) 528 | TT_UCR_CJK_COMPATIBILITY_FORMS* = (1 shl 1) 529 | TT_UCR_SMALL_FORM_VARIANTS* = (1 shl 2) 530 | TT_UCR_ARABIC_PRESENTATIONS_B* = (1 shl 3) 531 | TT_UCR_HALFWIDTH_FULLWIDTH_FORMS* = (1 shl 4) 532 | TT_UCR_SPECIALS* = (1 shl 5) 533 | TT_UCR_TIBETAN* = (1 shl 6) 534 | TT_UCR_SYRIAC* = (1 shl 7) 535 | TT_UCR_THAANA* = (1 shl 8) 536 | TT_UCR_SINHALA* = (1 shl 9) 537 | TT_UCR_MYANMAR* = (1 shl 10) 538 | TT_UCR_ETHIOPIC* = (1 shl 11) 539 | TT_UCR_CHEROKEE* = (1 shl 12) 540 | TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS* = (1 shl 13) 541 | TT_UCR_OGHAM* = (1 shl 14) 542 | TT_UCR_RUNIC* = (1 shl 15) 543 | TT_UCR_KHMER* = (1 shl 16) 544 | TT_UCR_MONGOLIAN* = (1 shl 17) 545 | TT_UCR_BRAILLE* = (1 shl 18) 546 | TT_UCR_YI* = (1 shl 19) 547 | TT_UCR_PHILIPPINE* = (1 shl 20) 548 | TT_UCR_OLD_ITALIC* = (1 shl 21) 549 | TT_UCR_GOTHIC* = (1 shl 22) 550 | TT_UCR_DESERET* = (1 shl 23) 551 | TT_UCR_MUSICAL_SYMBOLS* = (1 shl 24) 552 | TT_UCR_MATH_ALPHANUMERIC_SYMBOLS* = (1 shl 25) 553 | TT_UCR_PRIVATE_USE_SUPPLEMENTARY* = (1 shl 26) 554 | TT_UCR_VARIATION_SELECTORS* = (1 shl 27) 555 | TT_UCR_TAGS* = (1 shl 28) 556 | TT_UCR_LIMBU* = (1 shl 29) 557 | TT_UCR_TAI_LE* = (1 shl 30) 558 | TT_UCR_NEW_TAI_LUE* = (1 shl 31) 559 | TT_UCR_BUGINESE* = (1 shl 0) 560 | TT_UCR_GLAGOLITIC* = (1 shl 1) 561 | TT_UCR_TIFINAGH* = (1 shl 2) 562 | TT_UCR_YIJING* = (1 shl 3) 563 | TT_UCR_SYLOTI_NAGRI* = (1 shl 4) 564 | TT_UCR_LINEAR_B* = (1 shl 5) 565 | TT_UCR_ANCIENT_GREEK_NUMBERS* = (1 shl 6) 566 | TT_UCR_UGARITIC* = (1 shl 7) 567 | TT_UCR_OLD_PERSIAN* = (1 shl 8) 568 | TT_UCR_SHAVIAN* = (1 shl 9) 569 | TT_UCR_OSMANYA* = (1 shl 10) 570 | TT_UCR_CYPRIOT_SYLLABARY* = (1 shl 11) 571 | TT_UCR_KHAROSHTHI* = (1 shl 12) 572 | TT_UCR_TAI_XUAN_JING* = (1 shl 13) 573 | TT_UCR_CUNEIFORM* = (1 shl 14) 574 | TT_UCR_COUNTING_ROD_NUMERALS* = (1 shl 15) 575 | TT_UCR_SUNDANESE* = (1 shl 16) 576 | TT_UCR_LEPCHA* = (1 shl 17) 577 | TT_UCR_OL_CHIKI* = (1 shl 18) 578 | TT_UCR_SAURASHTRA* = (1 shl 19) 579 | TT_UCR_KAYAH_LI* = (1 shl 20) 580 | TT_UCR_REJANG* = (1 shl 21) 581 | TT_UCR_CHAM* = (1 shl 22) 582 | TT_UCR_ANCIENT_SYMBOLS* = (1 shl 23) 583 | TT_UCR_PHAISTOS_DISC* = (1 shl 24) 584 | TT_UCR_OLD_ANATOLIAN* = (1 shl 25) 585 | TT_UCR_GAME_TILES* = (1 shl 26) 586 | TT_UCR_ARABIC_PRESENTATION_FORMS_A* = TT_UCR_ARABIC_PRESENTATIONS_A 587 | TT_UCR_ARABIC_PRESENTATION_FORMS_B* = TT_UCR_ARABIC_PRESENTATIONS_B 588 | TT_UCR_COMBINING_DIACRITICAL_MARKS* = TT_UCR_COMBINING_DIACRITICS 589 | TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB* = TT_UCR_COMBINING_DIACRITICS_SYMB 590 | --------------------------------------------------------------------------------