├── .gitignore ├── CMakeLists.txt ├── Kconfig ├── LICENSE ├── README.md ├── README_zh.md ├── component.mk ├── example ├── Lato-Regular.ttf ├── esp_lv_example_freetype.c └── esp_lv_example_freetype.h ├── include ├── freetype │ ├── config │ │ ├── ftconfig.h │ │ ├── ftheader.h │ │ ├── ftmodule.h │ │ ├── ftoption.h │ │ ├── ftstdlib.h │ │ ├── integer-types.h │ │ ├── mac-support.h │ │ └── public-macros.h │ ├── freetype.h │ ├── ftadvanc.h │ ├── ftbbox.h │ ├── ftbdf.h │ ├── ftbitmap.h │ ├── ftbzip2.h │ ├── ftcache.h │ ├── ftchapters.h │ ├── ftcid.h │ ├── ftcolor.h │ ├── ftdriver.h │ ├── fterrdef.h │ ├── fterrors.h │ ├── ftfntfmt.h │ ├── ftgasp.h │ ├── ftglyph.h │ ├── ftgxval.h │ ├── ftgzip.h │ ├── ftimage.h │ ├── ftincrem.h │ ├── ftlcdfil.h │ ├── ftlist.h │ ├── ftlogging.h │ ├── ftlzw.h │ ├── ftmac.h │ ├── ftmm.h │ ├── ftmodapi.h │ ├── ftmoderr.h │ ├── ftotval.h │ ├── ftoutln.h │ ├── ftparams.h │ ├── ftpfr.h │ ├── ftrender.h │ ├── ftsizes.h │ ├── ftsnames.h │ ├── ftstroke.h │ ├── ftsynth.h │ ├── ftsystem.h │ ├── fttrigon.h │ ├── fttypes.h │ ├── ftwinfnt.h │ ├── internal │ │ ├── autohint.h │ │ ├── cffotypes.h │ │ ├── cfftypes.h │ │ ├── compiler-macros.h │ │ ├── ftcalc.h │ │ ├── ftdebug.h │ │ ├── ftdrv.h │ │ ├── ftgloadr.h │ │ ├── fthash.h │ │ ├── ftmemory.h │ │ ├── ftmmtypes.h │ │ ├── ftobjs.h │ │ ├── ftpsprop.h │ │ ├── ftrfork.h │ │ ├── ftserv.h │ │ ├── ftstream.h │ │ ├── fttrace.h │ │ ├── ftvalid.h │ │ ├── psaux.h │ │ ├── pshints.h │ │ ├── services │ │ │ ├── svbdf.h │ │ │ ├── svcfftl.h │ │ │ ├── svcid.h │ │ │ ├── svfntfmt.h │ │ │ ├── svgldict.h │ │ │ ├── svgxval.h │ │ │ ├── svkern.h │ │ │ ├── svmetric.h │ │ │ ├── svmm.h │ │ │ ├── svotval.h │ │ │ ├── svpfr.h │ │ │ ├── svpostnm.h │ │ │ ├── svprop.h │ │ │ ├── svpscmap.h │ │ │ ├── svpsinfo.h │ │ │ ├── svsfnt.h │ │ │ ├── svttcmap.h │ │ │ ├── svtteng.h │ │ │ ├── svttglyf.h │ │ │ └── svwinfnt.h │ │ ├── sfnt.h │ │ ├── svginterface.h │ │ ├── t1types.h │ │ ├── tttypes.h │ │ └── wofftypes.h │ ├── otsvg.h │ ├── t1tables.h │ ├── ttnameid.h │ ├── tttables.h │ └── tttags.h └── ft2build.h └── lib ├── esp32 └── libfreetype.a ├── esp32s2 └── libfreetype.a └── esp32s3 └── libfreetype.a /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vscode/ 3 | .tmp 4 | .old 5 | .o 6 | /*.zip -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(CONFIG_ESP_FREETYPE_EXAMPLE_LVGL) 2 | set(srcs "./example/esp_lv_example_freetype.c") 3 | endif() 4 | 5 | set(includes "example" 6 | "include" 7 | "include/freetype" 8 | "include/freetype/config" 9 | "include/freetype/internal" 10 | "include/freetype/internal/services") 11 | 12 | if(CONFIG_ESP_FREETYPE_EXAMPLE_LVGL) 13 | idf_component_register(SRCS ${srcs} 14 | INCLUDE_DIRS ${includes} 15 | REQUIRES lvgl) 16 | else() 17 | idf_component_register(INCLUDE_DIRS ${includes}) 18 | endif() 19 | 20 | if(CONFIG_IDF_TARGET_ESP32) 21 | add_prebuilt_library(esp_freetype "lib/esp32/libfreetype.a" REQUIRES esp_rom) 22 | elseif(CONFIG_IDF_TARGET_ESP32S2) 23 | add_prebuilt_library(esp_freetype "lib/esp32s2/libfreetype.a" REQUIRES esp_rom) 24 | elseif(CONFIG_IDF_TARGET_ESP32S3) 25 | add_prebuilt_library(esp_freetype "lib/esp32s3/libfreetype.a" REQUIRES esp_rom) 26 | endif() 27 | 28 | if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S2 OR CONFIG_IDF_TARGET_ESP32S3) 29 | target_link_libraries(${COMPONENT_LIB} INTERFACE esp_freetype) 30 | endif() 31 | -------------------------------------------------------------------------------- /Kconfig: -------------------------------------------------------------------------------- 1 | menu "FreeType" 2 | 3 | config ESP_FREETYPE_EXAMPLE_LVGL 4 | depends on LV_USE_FREETYPE 5 | bool "Use LVGL example freetype" 6 | default "n" 7 | 8 | help 9 | Forum: https://forums.100ask.net 10 | 11 | endmenu # FreeType 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | [esp_freetype](https://github.com/100askTeam/esp_freetype) is an out of the box [ESP-IDF component](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html#component-cmakelists-files) that is as convenient and simple as regular ESP-IDF components, and you can import it into your project for use. 4 | 5 | # Examples 6 | 7 | You can obtain corresponding usage examples in the example directory. 8 | 9 | Please note this before use: 10 | 11 | ![note](https://forum.lvgl.io/uploads/default/original/2X/6/66b04f421b4a899ca7c3e0c35d231b9d4c1ca6de.png) 12 | 13 | # Forum 14 | 15 | [https://forums.100ask.net](https://forums.100ask.net) 16 | -------------------------------------------------------------------------------- /README_zh.md: -------------------------------------------------------------------------------- 1 | # 说明 2 | 3 | [esp_freetype](https://github.com/100askTeam/esp_freetype) 是一个开箱即用的 [ESP-IDF 组件](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/api-guides/build-system.html#component-directories),和常规的 ESP-IDF 组件那样方便简单,你可以将其导入到你的项目工程中使用。 4 | 5 | # 使用示例 6 | 7 | 你可以在 `example` 目录中获取相应的使用示例。 8 | 9 | # 技术交流 10 | 11 | 如果你在使用过程中遇到问题需要帮助,可以发起 issue 或者在技术社区留言: [https://forums.100ask.net](https://forums.100ask.net)。 -------------------------------------------------------------------------------- /component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Component Makefile 3 | # 4 | 5 | COMPONENT_SRCDIRS := . $(IDF_TARGET) 6 | COMPONENT_ADD_INCLUDEDIRS := include 7 | -------------------------------------------------------------------------------- /example/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/esp_freetype/108d674ae9b7b6f10a8cd67cf5113c55d9ef2288/example/Lato-Regular.ttf -------------------------------------------------------------------------------- /example/esp_lv_example_freetype.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file esp_lv_example_freetype.c 3 | * @note forum: https://forums.100ask.net 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | 10 | //#ifdef CONFIG_ESP_FREETYPE_EXAMPLE_LVGL 11 | #if 1 12 | #include "esp_lv_example_freetype.h" 13 | #include "lvgl.h" 14 | 15 | /********************* 16 | * DEFINES 17 | *********************/ 18 | /* FreeType uses C standard file system, so no driver letter is required. 19 | * But on ESP, a mount point needs to be specified 20 | */ 21 | #define MOUNT_POINT CONFIG_FS_100ASK_MOUNT_POINT 22 | 23 | /* Store font files in the file system of the SD card 24 | *[Important] No need to specify a drive letter, but a mount point needs to be specified 25 | */ 26 | #define FREETYPE_FONT_FILE (MOUNT_POINT "/Lato-Regular.ttf") 27 | 28 | /********************** 29 | * TYPEDEFS 30 | **********************/ 31 | 32 | /********************** 33 | * STATIC PROTOTYPES 34 | **********************/ 35 | 36 | /********************** 37 | * STATIC VARIABLES 38 | **********************/ 39 | 40 | /********************** 41 | * MACROS 42 | **********************/ 43 | 44 | /********************** 45 | * GLOBAL FUNCTIONS 46 | **********************/ 47 | 48 | /** 49 | * Load a font with FreeType 50 | */ 51 | void esp_lv_example_freetype(void) 52 | { 53 | /*Create a font*/ 54 | static lv_ft_info_t info; 55 | /*FreeType uses C standard file system, so no driver letter is required.*/ 56 | info.name = FREETYPE_FONT_FILE; 57 | info.weight = 24; 58 | info.style = FT_FONT_STYLE_NORMAL; 59 | info.mem = NULL; 60 | if(!lv_ft_font_init(&info)) { 61 | LV_LOG_ERROR("create failed."); 62 | } 63 | 64 | /*Create style with the new font*/ 65 | static lv_style_t style; 66 | lv_style_init(&style); 67 | lv_style_set_text_font(&style, info.font); 68 | lv_style_set_text_align(&style, LV_TEXT_ALIGN_CENTER); 69 | 70 | /*Create a label with the new style*/ 71 | lv_obj_t * label = lv_label_create(lv_scr_act()); 72 | lv_obj_add_style(label, &style, 0); 73 | lv_label_set_text(label, "Hello Retro-Yao-Mio\nI'm a font created with FreeType"); 74 | lv_obj_center(label); 75 | } 76 | 77 | /********************** 78 | * STATIC FUNCTIONS 79 | **********************/ 80 | 81 | #endif/*CONFIG_ESP_FREETYPE_EXAMPLE_LVGL*/ 82 | -------------------------------------------------------------------------------- /example/esp_lv_example_freetype.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file esp_lv_example_freetype.h 3 | * 4 | */ 5 | 6 | #ifndef ESP_LV_EAMPLE_FREETYPE_H 7 | #define ESP_LV_EAMPLE_FREETYPE_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | //#ifdef CONFIG_ESP_FREETYPE_EXAMPLE_LVGL 18 | #if 1 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | void esp_lv_example_freetype(void); 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #endif /*CONFIG_ESP_FREETYPE_EXAMPLE_LVGL*/ 38 | 39 | #ifdef __cplusplus 40 | } /*extern "C"*/ 41 | #endif 42 | 43 | #endif /*ESP_LV_EAMPLE_FREETYPE_H*/ 44 | -------------------------------------------------------------------------------- /include/freetype/config/ftconfig.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftconfig.h 4 | * 5 | * ANSI-specific configuration file (specification only). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /************************************************************************** 20 | * 21 | * This header file contains a number of macro definitions that are used by 22 | * the rest of the engine. Most of the macros here are automatically 23 | * determined at compile time, and you should not need to change it to port 24 | * FreeType, except to compile the library with a non-ANSI compiler. 25 | * 26 | * Note however that if some specific modifications are needed, we advise 27 | * you to place a modified copy in your build directory. 28 | * 29 | * The build directory is usually `builds/`, and contains 30 | * system-specific files that are always included first when building the 31 | * library. 32 | * 33 | * This ANSI version should stay in `include/config/`. 34 | * 35 | */ 36 | 37 | #ifndef FTCONFIG_H_ 38 | #define FTCONFIG_H_ 39 | 40 | #include 41 | #include FT_CONFIG_OPTIONS_H 42 | #include FT_CONFIG_STANDARD_LIBRARY_H 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | #endif /* FTCONFIG_H_ */ 49 | 50 | 51 | /* END */ 52 | -------------------------------------------------------------------------------- /include/freetype/config/ftmodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file registers the FreeType modules compiled into the library. 3 | * 4 | * If you use GNU make, this file IS NOT USED! Instead, it is created in 5 | * the objects directory (normally `/objs/`) based on information 6 | * from `/modules.cfg`. 7 | * 8 | * Please read `docs/INSTALL.ANY` and `docs/CUSTOMIZE` how to compile 9 | * FreeType without GNU make. 10 | * 11 | */ 12 | 13 | FT_USE_MODULE( FT_Module_Class, autofit_module_class ) 14 | FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) 15 | FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) 16 | FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) 17 | FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) 18 | FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) 19 | FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) 20 | FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) 21 | FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) 22 | FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) 23 | FT_USE_MODULE( FT_Module_Class, psaux_module_class ) 24 | FT_USE_MODULE( FT_Module_Class, psnames_module_class ) 25 | FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) 26 | FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) 27 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) 28 | FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) 29 | FT_USE_MODULE( FT_Renderer_Class, ft_sdf_renderer_class ) 30 | FT_USE_MODULE( FT_Renderer_Class, ft_bitmap_sdf_renderer_class ) 31 | FT_USE_MODULE( FT_Renderer_Class, ft_svg_renderer_class ) 32 | 33 | /* EOF */ 34 | -------------------------------------------------------------------------------- /include/freetype/config/ftstdlib.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftstdlib.h 4 | * 5 | * ANSI-specific library and header configuration file (specification 6 | * only). 7 | * 8 | * Copyright (C) 2002-2023 by 9 | * David Turner, Robert Wilhelm, and Werner Lemberg. 10 | * 11 | * This file is part of the FreeType project, and may only be used, 12 | * modified, and distributed under the terms of the FreeType project 13 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 14 | * this file you indicate that you have read the license and 15 | * understand and accept it fully. 16 | * 17 | */ 18 | 19 | 20 | /************************************************************************** 21 | * 22 | * This file is used to group all `#includes` to the ANSI~C library that 23 | * FreeType normally requires. It also defines macros to rename the 24 | * standard functions within the FreeType source code. 25 | * 26 | * Load a file which defines `FTSTDLIB_H_` before this one to override it. 27 | * 28 | */ 29 | 30 | 31 | #ifndef FTSTDLIB_H_ 32 | #define FTSTDLIB_H_ 33 | 34 | 35 | #include 36 | 37 | #define ft_ptrdiff_t ptrdiff_t 38 | 39 | 40 | /************************************************************************** 41 | * 42 | * integer limits 43 | * 44 | * `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of 45 | * `int` and `long` in bytes at compile-time. So far, this works for all 46 | * platforms the library has been tested on. We also check `ULLONG_MAX` 47 | * to see whether we can use 64-bit `long long` later on. 48 | * 49 | * Note that on the extremely rare platforms that do not provide integer 50 | * types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where 51 | * `int` is 36~bits), we do not make any guarantee about the correct 52 | * behaviour of FreeType~2 with all fonts. 53 | * 54 | * In these cases, `ftconfig.h` will refuse to compile anyway with a 55 | * message like 'couldn't find 32-bit type' or something similar. 56 | * 57 | */ 58 | 59 | 60 | #include 61 | 62 | #define FT_CHAR_BIT CHAR_BIT 63 | #define FT_USHORT_MAX USHRT_MAX 64 | #define FT_INT_MAX INT_MAX 65 | #define FT_INT_MIN INT_MIN 66 | #define FT_UINT_MAX UINT_MAX 67 | #define FT_LONG_MIN LONG_MIN 68 | #define FT_LONG_MAX LONG_MAX 69 | #define FT_ULONG_MAX ULONG_MAX 70 | #ifdef LLONG_MAX 71 | #define FT_LLONG_MAX LLONG_MAX 72 | #endif 73 | #ifdef LLONG_MIN 74 | #define FT_LLONG_MIN LLONG_MIN 75 | #endif 76 | #ifdef ULLONG_MAX 77 | #define FT_ULLONG_MAX ULLONG_MAX 78 | #endif 79 | 80 | 81 | /************************************************************************** 82 | * 83 | * character and string processing 84 | * 85 | */ 86 | 87 | 88 | #include 89 | 90 | #define ft_memchr memchr 91 | #define ft_memcmp memcmp 92 | #define ft_memcpy memcpy 93 | #define ft_memmove memmove 94 | #define ft_memset memset 95 | #define ft_strcat strcat 96 | #define ft_strcmp strcmp 97 | #define ft_strcpy strcpy 98 | #define ft_strlen strlen 99 | #define ft_strncmp strncmp 100 | #define ft_strncpy strncpy 101 | #define ft_strrchr strrchr 102 | #define ft_strstr strstr 103 | 104 | 105 | /************************************************************************** 106 | * 107 | * file handling 108 | * 109 | */ 110 | 111 | 112 | #include 113 | 114 | #define FT_FILE FILE 115 | #define ft_fclose fclose 116 | #define ft_fopen fopen 117 | #define ft_fread fread 118 | #define ft_fseek fseek 119 | #define ft_ftell ftell 120 | #define ft_sprintf sprintf 121 | 122 | 123 | /************************************************************************** 124 | * 125 | * sorting 126 | * 127 | */ 128 | 129 | 130 | #include 131 | 132 | #define ft_qsort qsort 133 | 134 | 135 | /************************************************************************** 136 | * 137 | * memory allocation 138 | * 139 | */ 140 | 141 | 142 | #define ft_scalloc calloc 143 | #define ft_sfree free 144 | #define ft_smalloc malloc 145 | #define ft_srealloc realloc 146 | 147 | 148 | /************************************************************************** 149 | * 150 | * miscellaneous 151 | * 152 | */ 153 | 154 | 155 | #define ft_strtol strtol 156 | #define ft_getenv getenv 157 | 158 | 159 | /************************************************************************** 160 | * 161 | * execution control 162 | * 163 | */ 164 | 165 | 166 | #include 167 | 168 | #define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */ 169 | /* `jmp_buf` is defined as a macro */ 170 | /* on certain platforms */ 171 | 172 | #define ft_longjmp longjmp 173 | #define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */ 174 | 175 | 176 | /* The following is only used for debugging purposes, i.e., if */ 177 | /* `FT_DEBUG_LEVEL_ERROR` or `FT_DEBUG_LEVEL_TRACE` are defined. */ 178 | 179 | #include 180 | 181 | 182 | #endif /* FTSTDLIB_H_ */ 183 | 184 | 185 | /* END */ 186 | -------------------------------------------------------------------------------- /include/freetype/config/integer-types.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * config/integer-types.h 4 | * 5 | * FreeType integer types definitions. 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | #ifndef FREETYPE_CONFIG_INTEGER_TYPES_H_ 18 | #define FREETYPE_CONFIG_INTEGER_TYPES_H_ 19 | 20 | /* There are systems (like the Texas Instruments 'C54x) where a `char` */ 21 | /* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */ 22 | /* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */ 23 | /* is probably unexpected. */ 24 | /* */ 25 | /* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */ 26 | /* `char` type. */ 27 | 28 | #ifndef FT_CHAR_BIT 29 | #define FT_CHAR_BIT CHAR_BIT 30 | #endif 31 | 32 | #ifndef FT_SIZEOF_INT 33 | 34 | /* The size of an `int` type. */ 35 | #if FT_UINT_MAX == 0xFFFFUL 36 | #define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT ) 37 | #elif FT_UINT_MAX == 0xFFFFFFFFUL 38 | #define FT_SIZEOF_INT ( 32 / FT_CHAR_BIT ) 39 | #elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL 40 | #define FT_SIZEOF_INT ( 64 / FT_CHAR_BIT ) 41 | #else 42 | #error "Unsupported size of `int' type!" 43 | #endif 44 | 45 | #endif /* !defined(FT_SIZEOF_INT) */ 46 | 47 | #ifndef FT_SIZEOF_LONG 48 | 49 | /* The size of a `long` type. A five-byte `long` (as used e.g. on the */ 50 | /* DM642) is recognized but avoided. */ 51 | #if FT_ULONG_MAX == 0xFFFFFFFFUL 52 | #define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT ) 53 | #elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL 54 | #define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT ) 55 | #elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL 56 | #define FT_SIZEOF_LONG ( 64 / FT_CHAR_BIT ) 57 | #else 58 | #error "Unsupported size of `long' type!" 59 | #endif 60 | 61 | #endif /* !defined(FT_SIZEOF_LONG) */ 62 | 63 | #ifndef FT_SIZEOF_LONG_LONG 64 | 65 | /* The size of a `long long` type if available */ 66 | #if defined( FT_ULLONG_MAX ) && FT_ULLONG_MAX >= 0xFFFFFFFFFFFFFFFFULL 67 | #define FT_SIZEOF_LONG_LONG ( 64 / FT_CHAR_BIT ) 68 | #else 69 | #define FT_SIZEOF_LONG_LONG 0 70 | #endif 71 | 72 | #endif /* !defined(FT_SIZEOF_LONG_LONG) */ 73 | 74 | 75 | /************************************************************************** 76 | * 77 | * @section: 78 | * basic_types 79 | * 80 | */ 81 | 82 | 83 | /************************************************************************** 84 | * 85 | * @type: 86 | * FT_Int16 87 | * 88 | * @description: 89 | * A typedef for a 16bit signed integer type. 90 | */ 91 | typedef signed short FT_Int16; 92 | 93 | 94 | /************************************************************************** 95 | * 96 | * @type: 97 | * FT_UInt16 98 | * 99 | * @description: 100 | * A typedef for a 16bit unsigned integer type. 101 | */ 102 | typedef unsigned short FT_UInt16; 103 | 104 | /* */ 105 | 106 | 107 | /* this #if 0 ... #endif clause is for documentation purposes */ 108 | #if 0 109 | 110 | /************************************************************************** 111 | * 112 | * @type: 113 | * FT_Int32 114 | * 115 | * @description: 116 | * A typedef for a 32bit signed integer type. The size depends on the 117 | * configuration. 118 | */ 119 | typedef signed XXX FT_Int32; 120 | 121 | 122 | /************************************************************************** 123 | * 124 | * @type: 125 | * FT_UInt32 126 | * 127 | * A typedef for a 32bit unsigned integer type. The size depends on the 128 | * configuration. 129 | */ 130 | typedef unsigned XXX FT_UInt32; 131 | 132 | 133 | /************************************************************************** 134 | * 135 | * @type: 136 | * FT_Int64 137 | * 138 | * A typedef for a 64bit signed integer type. The size depends on the 139 | * configuration. Only defined if there is real 64bit support; 140 | * otherwise, it gets emulated with a structure (if necessary). 141 | */ 142 | typedef signed XXX FT_Int64; 143 | 144 | 145 | /************************************************************************** 146 | * 147 | * @type: 148 | * FT_UInt64 149 | * 150 | * A typedef for a 64bit unsigned integer type. The size depends on the 151 | * configuration. Only defined if there is real 64bit support; 152 | * otherwise, it gets emulated with a structure (if necessary). 153 | */ 154 | typedef unsigned XXX FT_UInt64; 155 | 156 | /* */ 157 | 158 | #endif 159 | 160 | #if FT_SIZEOF_INT == ( 32 / FT_CHAR_BIT ) 161 | 162 | typedef signed int FT_Int32; 163 | typedef unsigned int FT_UInt32; 164 | 165 | #elif FT_SIZEOF_LONG == ( 32 / FT_CHAR_BIT ) 166 | 167 | typedef signed long FT_Int32; 168 | typedef unsigned long FT_UInt32; 169 | 170 | #else 171 | #error "no 32bit type found -- please check your configuration files" 172 | #endif 173 | 174 | 175 | /* look up an integer type that is at least 32~bits */ 176 | #if FT_SIZEOF_INT >= ( 32 / FT_CHAR_BIT ) 177 | 178 | typedef int FT_Fast; 179 | typedef unsigned int FT_UFast; 180 | 181 | #elif FT_SIZEOF_LONG >= ( 32 / FT_CHAR_BIT ) 182 | 183 | typedef long FT_Fast; 184 | typedef unsigned long FT_UFast; 185 | 186 | #endif 187 | 188 | 189 | /* determine whether we have a 64-bit integer type */ 190 | #if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT ) 191 | 192 | #define FT_INT64 long 193 | #define FT_UINT64 unsigned long 194 | 195 | #elif FT_SIZEOF_LONG_LONG >= ( 64 / FT_CHAR_BIT ) 196 | 197 | #define FT_INT64 long long int 198 | #define FT_UINT64 unsigned long long int 199 | 200 | /************************************************************************** 201 | * 202 | * A 64-bit data type may create compilation problems if you compile in 203 | * strict ANSI mode. To avoid them, we disable other 64-bit data types if 204 | * `__STDC__` is defined. You can however ignore this rule by defining the 205 | * `FT_CONFIG_OPTION_FORCE_INT64` configuration macro. 206 | */ 207 | #elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 ) 208 | 209 | #if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ 210 | 211 | /* this compiler provides the `__int64` type */ 212 | #define FT_INT64 __int64 213 | #define FT_UINT64 unsigned __int64 214 | 215 | #elif defined( __BORLANDC__ ) /* Borland C++ */ 216 | 217 | /* XXXX: We should probably check the value of `__BORLANDC__` in order */ 218 | /* to test the compiler version. */ 219 | 220 | /* this compiler provides the `__int64` type */ 221 | #define FT_INT64 __int64 222 | #define FT_UINT64 unsigned __int64 223 | 224 | #elif defined( __WATCOMC__ ) && __WATCOMC__ >= 1100 /* Watcom C++ */ 225 | 226 | #define FT_INT64 long long int 227 | #define FT_UINT64 unsigned long long int 228 | 229 | #elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */ 230 | 231 | #define FT_INT64 long long int 232 | #define FT_UINT64 unsigned long long int 233 | 234 | #elif defined( __GNUC__ ) 235 | 236 | /* GCC provides the `long long` type */ 237 | #define FT_INT64 long long int 238 | #define FT_UINT64 unsigned long long int 239 | 240 | #endif /* !__STDC__ */ 241 | 242 | #endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */ 243 | 244 | #ifdef FT_INT64 245 | typedef FT_INT64 FT_Int64; 246 | typedef FT_UINT64 FT_UInt64; 247 | #endif 248 | 249 | 250 | #endif /* FREETYPE_CONFIG_INTEGER_TYPES_H_ */ 251 | -------------------------------------------------------------------------------- /include/freetype/config/mac-support.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * config/mac-support.h 4 | * 5 | * Mac/OS X support configuration header. 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | #ifndef FREETYPE_CONFIG_MAC_SUPPORT_H_ 18 | #define FREETYPE_CONFIG_MAC_SUPPORT_H_ 19 | 20 | /************************************************************************** 21 | * 22 | * Mac support 23 | * 24 | * This is the only necessary change, so it is defined here instead 25 | * providing a new configuration file. 26 | */ 27 | #if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) ) 28 | /* No Carbon frameworks for 64bit 10.4.x. */ 29 | /* `AvailabilityMacros.h` is available since Mac OS X 10.2, */ 30 | /* so guess the system version by maximum errno before inclusion. */ 31 | #include 32 | #ifdef ECANCELED /* defined since 10.2 */ 33 | #include "AvailabilityMacros.h" 34 | #endif 35 | #if defined( __LP64__ ) && \ 36 | ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) 37 | #undef FT_MACINTOSH 38 | #endif 39 | 40 | #elif defined( __SC__ ) || defined( __MRC__ ) 41 | /* Classic MacOS compilers */ 42 | #include "ConditionalMacros.h" 43 | #if TARGET_OS_MAC 44 | #define FT_MACINTOSH 1 45 | #endif 46 | 47 | #endif /* Mac support */ 48 | 49 | #endif /* FREETYPE_CONFIG_MAC_SUPPORT_H_ */ 50 | -------------------------------------------------------------------------------- /include/freetype/config/public-macros.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * config/public-macros.h 4 | * 5 | * Define a set of compiler macros used in public FreeType headers. 6 | * 7 | * Copyright (C) 2020-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | /* 19 | * The definitions in this file are used by the public FreeType headers 20 | * and thus should be considered part of the public API. 21 | * 22 | * Other compiler-specific macro definitions that are not exposed by the 23 | * FreeType API should go into 24 | * `include/freetype/internal/compiler-macros.h` instead. 25 | */ 26 | #ifndef FREETYPE_CONFIG_PUBLIC_MACROS_H_ 27 | #define FREETYPE_CONFIG_PUBLIC_MACROS_H_ 28 | 29 | /* 30 | * `FT_BEGIN_HEADER` and `FT_END_HEADER` might have already been defined 31 | * by `freetype/config/ftheader.h`, but we don't want to include this 32 | * header here, so redefine the macros here only when needed. Their 33 | * definition is very stable, so keeping them in sync with the ones in the 34 | * header should not be a maintenance issue. 35 | */ 36 | #ifndef FT_BEGIN_HEADER 37 | #ifdef __cplusplus 38 | #define FT_BEGIN_HEADER extern "C" { 39 | #else 40 | #define FT_BEGIN_HEADER /* empty */ 41 | #endif 42 | #endif /* FT_BEGIN_HEADER */ 43 | 44 | #ifndef FT_END_HEADER 45 | #ifdef __cplusplus 46 | #define FT_END_HEADER } 47 | #else 48 | #define FT_END_HEADER /* empty */ 49 | #endif 50 | #endif /* FT_END_HEADER */ 51 | 52 | 53 | FT_BEGIN_HEADER 54 | 55 | /* 56 | * Mark a function declaration as public. This ensures it will be 57 | * properly exported to client code. Place this before a function 58 | * declaration. 59 | * 60 | * NOTE: This macro should be considered an internal implementation 61 | * detail, and not part of the FreeType API. It is only defined here 62 | * because it is needed by `FT_EXPORT`. 63 | */ 64 | 65 | /* Visual C, mingw */ 66 | #if defined( _WIN32 ) 67 | 68 | #if defined( FT2_BUILD_LIBRARY ) && defined( DLL_EXPORT ) 69 | #define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllexport ) 70 | #elif defined( DLL_IMPORT ) 71 | #define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllimport ) 72 | #endif 73 | 74 | /* gcc, clang */ 75 | #elif ( defined( __GNUC__ ) && __GNUC__ >= 4 ) || defined( __clang__ ) 76 | #define FT_PUBLIC_FUNCTION_ATTRIBUTE \ 77 | __attribute__(( visibility( "default" ) )) 78 | 79 | /* Sun */ 80 | #elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550 81 | #define FT_PUBLIC_FUNCTION_ATTRIBUTE __global 82 | #endif 83 | 84 | 85 | #ifndef FT_PUBLIC_FUNCTION_ATTRIBUTE 86 | #define FT_PUBLIC_FUNCTION_ATTRIBUTE /* empty */ 87 | #endif 88 | 89 | 90 | /* 91 | * Define a public FreeType API function. This ensures it is properly 92 | * exported or imported at build time. The macro parameter is the 93 | * function's return type as in: 94 | * 95 | * FT_EXPORT( FT_Bool ) 96 | * FT_Object_Method( FT_Object obj, 97 | * ... ); 98 | * 99 | * NOTE: This requires that all `FT_EXPORT` uses are inside 100 | * `FT_BEGIN_HEADER ... FT_END_HEADER` blocks. This guarantees that the 101 | * functions are exported with C linkage, even when the header is included 102 | * by a C++ source file. 103 | */ 104 | #define FT_EXPORT( x ) FT_PUBLIC_FUNCTION_ATTRIBUTE extern x 105 | 106 | 107 | /* 108 | * `FT_UNUSED` indicates that a given parameter is not used -- this is 109 | * only used to get rid of unpleasant compiler warnings. 110 | * 111 | * Technically, this was not meant to be part of the public API, but some 112 | * third-party code depends on it. 113 | */ 114 | #ifndef FT_UNUSED 115 | #define FT_UNUSED( arg ) ( (arg) = (arg) ) 116 | #endif 117 | 118 | 119 | /* 120 | * Support for casts in both C and C++. 121 | */ 122 | #ifdef __cplusplus 123 | #define FT_STATIC_CAST( type, var ) static_cast(var) 124 | #define FT_REINTERPRET_CAST( type, var ) reinterpret_cast(var) 125 | 126 | #define FT_STATIC_BYTE_CAST( type, var ) \ 127 | static_cast( static_cast( var ) ) 128 | #else 129 | #define FT_STATIC_CAST( type, var ) (type)(var) 130 | #define FT_REINTERPRET_CAST( type, var ) (type)(var) 131 | 132 | #define FT_STATIC_BYTE_CAST( type, var ) (type)(unsigned char)(var) 133 | #endif 134 | 135 | 136 | FT_END_HEADER 137 | 138 | #endif /* FREETYPE_CONFIG_PUBLIC_MACROS_H_ */ 139 | -------------------------------------------------------------------------------- /include/freetype/ftadvanc.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftadvanc.h 4 | * 5 | * Quick computation of advance widths (specification only). 6 | * 7 | * Copyright (C) 2008-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTADVANC_H_ 20 | #define FTADVANC_H_ 21 | 22 | 23 | #include 24 | 25 | #ifdef FREETYPE_H 26 | #error "freetype.h of FreeType 1 has been loaded!" 27 | #error "Please fix the directory search order for header files" 28 | #error "so that freetype.h of FreeType 2 is found first." 29 | #endif 30 | 31 | 32 | FT_BEGIN_HEADER 33 | 34 | 35 | /************************************************************************** 36 | * 37 | * @section: 38 | * quick_advance 39 | * 40 | * @title: 41 | * Quick retrieval of advance values 42 | * 43 | * @abstract: 44 | * Retrieve horizontal and vertical advance values without processing 45 | * glyph outlines, if possible. 46 | * 47 | * @description: 48 | * This section contains functions to quickly extract advance values 49 | * without handling glyph outlines, if possible. 50 | * 51 | * @order: 52 | * FT_Get_Advance 53 | * FT_Get_Advances 54 | * 55 | */ 56 | 57 | 58 | /************************************************************************** 59 | * 60 | * @enum: 61 | * FT_ADVANCE_FLAG_FAST_ONLY 62 | * 63 | * @description: 64 | * A bit-flag to be OR-ed with the `flags` parameter of the 65 | * @FT_Get_Advance and @FT_Get_Advances functions. 66 | * 67 | * If set, it indicates that you want these functions to fail if the 68 | * corresponding hinting mode or font driver doesn't allow for very quick 69 | * advance computation. 70 | * 71 | * Typically, glyphs that are either unscaled, unhinted, bitmapped, or 72 | * light-hinted can have their advance width computed very quickly. 73 | * 74 | * Normal and bytecode hinted modes that require loading, scaling, and 75 | * hinting of the glyph outline, are extremely slow by comparison. 76 | */ 77 | #define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L 78 | 79 | 80 | /************************************************************************** 81 | * 82 | * @function: 83 | * FT_Get_Advance 84 | * 85 | * @description: 86 | * Retrieve the advance value of a given glyph outline in an @FT_Face. 87 | * 88 | * @input: 89 | * face :: 90 | * The source @FT_Face handle. 91 | * 92 | * gindex :: 93 | * The glyph index. 94 | * 95 | * load_flags :: 96 | * A set of bit flags similar to those used when calling 97 | * @FT_Load_Glyph, used to determine what kind of advances you need. 98 | * 99 | * @output: 100 | * padvance :: 101 | * The advance value. If scaling is performed (based on the value of 102 | * `load_flags`), the advance value is in 16.16 format. Otherwise, it 103 | * is in font units. 104 | * 105 | * If @FT_LOAD_VERTICAL_LAYOUT is set, this is the vertical advance 106 | * corresponding to a vertical layout. Otherwise, it is the horizontal 107 | * advance in a horizontal layout. 108 | * 109 | * @return: 110 | * FreeType error code. 0 means success. 111 | * 112 | * @note: 113 | * This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if 114 | * the corresponding font backend doesn't have a quick way to retrieve 115 | * the advances. 116 | * 117 | * A scaled advance is returned in 16.16 format but isn't transformed by 118 | * the affine transformation specified by @FT_Set_Transform. 119 | */ 120 | FT_EXPORT( FT_Error ) 121 | FT_Get_Advance( FT_Face face, 122 | FT_UInt gindex, 123 | FT_Int32 load_flags, 124 | FT_Fixed *padvance ); 125 | 126 | 127 | /************************************************************************** 128 | * 129 | * @function: 130 | * FT_Get_Advances 131 | * 132 | * @description: 133 | * Retrieve the advance values of several glyph outlines in an @FT_Face. 134 | * 135 | * @input: 136 | * face :: 137 | * The source @FT_Face handle. 138 | * 139 | * start :: 140 | * The first glyph index. 141 | * 142 | * count :: 143 | * The number of advance values you want to retrieve. 144 | * 145 | * load_flags :: 146 | * A set of bit flags similar to those used when calling 147 | * @FT_Load_Glyph. 148 | * 149 | * @output: 150 | * padvance :: 151 | * The advance values. This array, to be provided by the caller, must 152 | * contain at least `count` elements. 153 | * 154 | * If scaling is performed (based on the value of `load_flags`), the 155 | * advance values are in 16.16 format. Otherwise, they are in font 156 | * units. 157 | * 158 | * If @FT_LOAD_VERTICAL_LAYOUT is set, these are the vertical advances 159 | * corresponding to a vertical layout. Otherwise, they are the 160 | * horizontal advances in a horizontal layout. 161 | * 162 | * @return: 163 | * FreeType error code. 0 means success. 164 | * 165 | * @note: 166 | * This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if 167 | * the corresponding font backend doesn't have a quick way to retrieve 168 | * the advances. 169 | * 170 | * Scaled advances are returned in 16.16 format but aren't transformed by 171 | * the affine transformation specified by @FT_Set_Transform. 172 | */ 173 | FT_EXPORT( FT_Error ) 174 | FT_Get_Advances( FT_Face face, 175 | FT_UInt start, 176 | FT_UInt count, 177 | FT_Int32 load_flags, 178 | FT_Fixed *padvances ); 179 | 180 | /* */ 181 | 182 | 183 | FT_END_HEADER 184 | 185 | #endif /* FTADVANC_H_ */ 186 | 187 | 188 | /* END */ 189 | -------------------------------------------------------------------------------- /include/freetype/ftbbox.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftbbox.h 4 | * 5 | * FreeType exact bbox computation (specification). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /************************************************************************** 20 | * 21 | * This component has a _single_ role: to compute exact outline bounding 22 | * boxes. 23 | * 24 | * It is separated from the rest of the engine for various technical 25 | * reasons. It may well be integrated in 'ftoutln' later. 26 | * 27 | */ 28 | 29 | 30 | #ifndef FTBBOX_H_ 31 | #define FTBBOX_H_ 32 | 33 | 34 | #include 35 | 36 | #ifdef FREETYPE_H 37 | #error "freetype.h of FreeType 1 has been loaded!" 38 | #error "Please fix the directory search order for header files" 39 | #error "so that freetype.h of FreeType 2 is found first." 40 | #endif 41 | 42 | 43 | FT_BEGIN_HEADER 44 | 45 | 46 | /************************************************************************** 47 | * 48 | * @section: 49 | * outline_processing 50 | * 51 | */ 52 | 53 | 54 | /************************************************************************** 55 | * 56 | * @function: 57 | * FT_Outline_Get_BBox 58 | * 59 | * @description: 60 | * Compute the exact bounding box of an outline. This is slower than 61 | * computing the control box. However, it uses an advanced algorithm 62 | * that returns _very_ quickly when the two boxes coincide. Otherwise, 63 | * the outline Bezier arcs are traversed to extract their extrema. 64 | * 65 | * @input: 66 | * outline :: 67 | * A pointer to the source outline. 68 | * 69 | * @output: 70 | * abbox :: 71 | * The outline's exact bounding box. 72 | * 73 | * @return: 74 | * FreeType error code. 0~means success. 75 | * 76 | * @note: 77 | * If the font is tricky and the glyph has been loaded with 78 | * @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get 79 | * reasonable values for the BBox it is necessary to load the glyph at a 80 | * large ppem value (so that the hinting instructions can properly shift 81 | * and scale the subglyphs), then extracting the BBox, which can be 82 | * eventually converted back to font units. 83 | */ 84 | FT_EXPORT( FT_Error ) 85 | FT_Outline_Get_BBox( FT_Outline* outline, 86 | FT_BBox *abbox ); 87 | 88 | /* */ 89 | 90 | 91 | FT_END_HEADER 92 | 93 | #endif /* FTBBOX_H_ */ 94 | 95 | 96 | /* END */ 97 | 98 | 99 | /* Local Variables: */ 100 | /* coding: utf-8 */ 101 | /* End: */ 102 | -------------------------------------------------------------------------------- /include/freetype/ftbdf.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftbdf.h 4 | * 5 | * FreeType API for accessing BDF-specific strings (specification). 6 | * 7 | * Copyright (C) 2002-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTBDF_H_ 20 | #define FTBDF_H_ 21 | 22 | #include 23 | 24 | #ifdef FREETYPE_H 25 | #error "freetype.h of FreeType 1 has been loaded!" 26 | #error "Please fix the directory search order for header files" 27 | #error "so that freetype.h of FreeType 2 is found first." 28 | #endif 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | 34 | /************************************************************************** 35 | * 36 | * @section: 37 | * bdf_fonts 38 | * 39 | * @title: 40 | * BDF and PCF Files 41 | * 42 | * @abstract: 43 | * BDF and PCF specific API. 44 | * 45 | * @description: 46 | * This section contains the declaration of functions specific to BDF and 47 | * PCF fonts. 48 | * 49 | */ 50 | 51 | 52 | /************************************************************************** 53 | * 54 | * @enum: 55 | * BDF_PropertyType 56 | * 57 | * @description: 58 | * A list of BDF property types. 59 | * 60 | * @values: 61 | * BDF_PROPERTY_TYPE_NONE :: 62 | * Value~0 is used to indicate a missing property. 63 | * 64 | * BDF_PROPERTY_TYPE_ATOM :: 65 | * Property is a string atom. 66 | * 67 | * BDF_PROPERTY_TYPE_INTEGER :: 68 | * Property is a 32-bit signed integer. 69 | * 70 | * BDF_PROPERTY_TYPE_CARDINAL :: 71 | * Property is a 32-bit unsigned integer. 72 | */ 73 | typedef enum BDF_PropertyType_ 74 | { 75 | BDF_PROPERTY_TYPE_NONE = 0, 76 | BDF_PROPERTY_TYPE_ATOM = 1, 77 | BDF_PROPERTY_TYPE_INTEGER = 2, 78 | BDF_PROPERTY_TYPE_CARDINAL = 3 79 | 80 | } BDF_PropertyType; 81 | 82 | 83 | /************************************************************************** 84 | * 85 | * @type: 86 | * BDF_Property 87 | * 88 | * @description: 89 | * A handle to a @BDF_PropertyRec structure to model a given BDF/PCF 90 | * property. 91 | */ 92 | typedef struct BDF_PropertyRec_* BDF_Property; 93 | 94 | 95 | /************************************************************************** 96 | * 97 | * @struct: 98 | * BDF_PropertyRec 99 | * 100 | * @description: 101 | * This structure models a given BDF/PCF property. 102 | * 103 | * @fields: 104 | * type :: 105 | * The property type. 106 | * 107 | * u.atom :: 108 | * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be 109 | * `NULL`, indicating an empty string. 110 | * 111 | * u.integer :: 112 | * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER. 113 | * 114 | * u.cardinal :: 115 | * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL. 116 | */ 117 | typedef struct BDF_PropertyRec_ 118 | { 119 | BDF_PropertyType type; 120 | union { 121 | const char* atom; 122 | FT_Int32 integer; 123 | FT_UInt32 cardinal; 124 | 125 | } u; 126 | 127 | } BDF_PropertyRec; 128 | 129 | 130 | /************************************************************************** 131 | * 132 | * @function: 133 | * FT_Get_BDF_Charset_ID 134 | * 135 | * @description: 136 | * Retrieve a BDF font character set identity, according to the BDF 137 | * specification. 138 | * 139 | * @input: 140 | * face :: 141 | * A handle to the input face. 142 | * 143 | * @output: 144 | * acharset_encoding :: 145 | * Charset encoding, as a C~string, owned by the face. 146 | * 147 | * acharset_registry :: 148 | * Charset registry, as a C~string, owned by the face. 149 | * 150 | * @return: 151 | * FreeType error code. 0~means success. 152 | * 153 | * @note: 154 | * This function only works with BDF faces, returning an error otherwise. 155 | */ 156 | FT_EXPORT( FT_Error ) 157 | FT_Get_BDF_Charset_ID( FT_Face face, 158 | const char* *acharset_encoding, 159 | const char* *acharset_registry ); 160 | 161 | 162 | /************************************************************************** 163 | * 164 | * @function: 165 | * FT_Get_BDF_Property 166 | * 167 | * @description: 168 | * Retrieve a BDF property from a BDF or PCF font file. 169 | * 170 | * @input: 171 | * face :: 172 | * A handle to the input face. 173 | * 174 | * name :: 175 | * The property name. 176 | * 177 | * @output: 178 | * aproperty :: 179 | * The property. 180 | * 181 | * @return: 182 | * FreeType error code. 0~means success. 183 | * 184 | * @note: 185 | * This function works with BDF _and_ PCF fonts. It returns an error 186 | * otherwise. It also returns an error if the property is not in the 187 | * font. 188 | * 189 | * A 'property' is a either key-value pair within the STARTPROPERTIES 190 | * ... ENDPROPERTIES block of a BDF font or a key-value pair from the 191 | * `info->props` array within a `FontRec` structure of a PCF font. 192 | * 193 | * Integer properties are always stored as 'signed' within PCF fonts; 194 | * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value 195 | * for BDF fonts only. 196 | * 197 | * In case of error, `aproperty->type` is always set to 198 | * @BDF_PROPERTY_TYPE_NONE. 199 | */ 200 | FT_EXPORT( FT_Error ) 201 | FT_Get_BDF_Property( FT_Face face, 202 | const char* prop_name, 203 | BDF_PropertyRec *aproperty ); 204 | 205 | /* */ 206 | 207 | FT_END_HEADER 208 | 209 | #endif /* FTBDF_H_ */ 210 | 211 | 212 | /* END */ 213 | -------------------------------------------------------------------------------- /include/freetype/ftbzip2.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftbzip2.h 4 | * 5 | * Bzip2-compressed stream support. 6 | * 7 | * Copyright (C) 2010-2023 by 8 | * Joel Klinghed. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTBZIP2_H_ 20 | #define FTBZIP2_H_ 21 | 22 | #include 23 | 24 | #ifdef FREETYPE_H 25 | #error "freetype.h of FreeType 1 has been loaded!" 26 | #error "Please fix the directory search order for header files" 27 | #error "so that freetype.h of FreeType 2 is found first." 28 | #endif 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | /************************************************************************** 34 | * 35 | * @section: 36 | * bzip2 37 | * 38 | * @title: 39 | * BZIP2 Streams 40 | * 41 | * @abstract: 42 | * Using bzip2-compressed font files. 43 | * 44 | * @description: 45 | * In certain builds of the library, bzip2 compression recognition is 46 | * automatically handled when calling @FT_New_Face or @FT_Open_Face. 47 | * This means that if no font driver is capable of handling the raw 48 | * compressed file, the library will try to open a bzip2 compressed 49 | * stream from it and re-open the face with it. 50 | * 51 | * The stream implementation is very basic and resets the decompression 52 | * process each time seeking backwards is needed within the stream, 53 | * which significantly undermines the performance. 54 | * 55 | * This section contains the declaration of Bzip2-specific functions. 56 | * 57 | */ 58 | 59 | 60 | /************************************************************************** 61 | * 62 | * @function: 63 | * FT_Stream_OpenBzip2 64 | * 65 | * @description: 66 | * Open a new stream to parse bzip2-compressed font files. This is 67 | * mainly used to support the compressed `*.pcf.bz2` fonts that come with 68 | * XFree86. 69 | * 70 | * @input: 71 | * stream :: 72 | * The target embedding stream. 73 | * 74 | * source :: 75 | * The source stream. 76 | * 77 | * @return: 78 | * FreeType error code. 0~means success. 79 | * 80 | * @note: 81 | * The source stream must be opened _before_ calling this function. 82 | * 83 | * Calling the internal function `FT_Stream_Close` on the new stream will 84 | * **not** call `FT_Stream_Close` on the source stream. None of the 85 | * stream objects will be released to the heap. 86 | * 87 | * This function may return `FT_Err_Unimplemented_Feature` if your build 88 | * of FreeType was not compiled with bzip2 support. 89 | */ 90 | FT_EXPORT( FT_Error ) 91 | FT_Stream_OpenBzip2( FT_Stream stream, 92 | FT_Stream source ); 93 | 94 | /* */ 95 | 96 | 97 | FT_END_HEADER 98 | 99 | #endif /* FTBZIP2_H_ */ 100 | 101 | 102 | /* END */ 103 | -------------------------------------------------------------------------------- /include/freetype/ftchapters.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * This file defines the structure of the FreeType reference. 4 | * It is used by the python script that generates the HTML files. 5 | * 6 | */ 7 | 8 | 9 | /************************************************************************** 10 | * 11 | * @chapter: 12 | * general_remarks 13 | * 14 | * @title: 15 | * General Remarks 16 | * 17 | * @sections: 18 | * preamble 19 | * header_inclusion 20 | * user_allocation 21 | * 22 | */ 23 | 24 | 25 | /************************************************************************** 26 | * 27 | * @chapter: 28 | * core_api 29 | * 30 | * @title: 31 | * Core API 32 | * 33 | * @sections: 34 | * version 35 | * basic_types 36 | * base_interface 37 | * glyph_variants 38 | * color_management 39 | * layer_management 40 | * glyph_management 41 | * mac_specific 42 | * sizes_management 43 | * header_file_macros 44 | * 45 | */ 46 | 47 | 48 | /************************************************************************** 49 | * 50 | * @chapter: 51 | * format_specific 52 | * 53 | * @title: 54 | * Format-Specific API 55 | * 56 | * @sections: 57 | * multiple_masters 58 | * truetype_tables 59 | * type1_tables 60 | * sfnt_names 61 | * bdf_fonts 62 | * cid_fonts 63 | * pfr_fonts 64 | * winfnt_fonts 65 | * svg_fonts 66 | * font_formats 67 | * gasp_table 68 | * 69 | */ 70 | 71 | 72 | /************************************************************************** 73 | * 74 | * @chapter: 75 | * module_specific 76 | * 77 | * @title: 78 | * Controlling FreeType Modules 79 | * 80 | * @sections: 81 | * auto_hinter 82 | * cff_driver 83 | * t1_cid_driver 84 | * tt_driver 85 | * pcf_driver 86 | * ot_svg_driver 87 | * properties 88 | * parameter_tags 89 | * lcd_rendering 90 | * 91 | */ 92 | 93 | 94 | /************************************************************************** 95 | * 96 | * @chapter: 97 | * cache_subsystem 98 | * 99 | * @title: 100 | * Cache Sub-System 101 | * 102 | * @sections: 103 | * cache_subsystem 104 | * 105 | */ 106 | 107 | 108 | /************************************************************************** 109 | * 110 | * @chapter: 111 | * support_api 112 | * 113 | * @title: 114 | * Support API 115 | * 116 | * @sections: 117 | * computations 118 | * list_processing 119 | * outline_processing 120 | * quick_advance 121 | * bitmap_handling 122 | * raster 123 | * glyph_stroker 124 | * system_interface 125 | * module_management 126 | * gzip 127 | * lzw 128 | * bzip2 129 | * debugging_apis 130 | * 131 | */ 132 | 133 | 134 | /************************************************************************** 135 | * 136 | * @chapter: 137 | * error_codes 138 | * 139 | * @title: 140 | * Error Codes 141 | * 142 | * @sections: 143 | * error_enumerations 144 | * error_code_values 145 | * 146 | */ 147 | 148 | 149 | /* END */ 150 | -------------------------------------------------------------------------------- /include/freetype/ftcid.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftcid.h 4 | * 5 | * FreeType API for accessing CID font information (specification). 6 | * 7 | * Copyright (C) 2007-2023 by 8 | * Dereg Clegg and Michael Toftdal. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTCID_H_ 20 | #define FTCID_H_ 21 | 22 | #include 23 | 24 | #ifdef FREETYPE_H 25 | #error "freetype.h of FreeType 1 has been loaded!" 26 | #error "Please fix the directory search order for header files" 27 | #error "so that freetype.h of FreeType 2 is found first." 28 | #endif 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | 34 | /************************************************************************** 35 | * 36 | * @section: 37 | * cid_fonts 38 | * 39 | * @title: 40 | * CID Fonts 41 | * 42 | * @abstract: 43 | * CID-keyed font-specific API. 44 | * 45 | * @description: 46 | * This section contains the declaration of CID-keyed font-specific 47 | * functions. 48 | * 49 | */ 50 | 51 | 52 | /************************************************************************** 53 | * 54 | * @function: 55 | * FT_Get_CID_Registry_Ordering_Supplement 56 | * 57 | * @description: 58 | * Retrieve the Registry/Ordering/Supplement triple (also known as the 59 | * "R/O/S") from a CID-keyed font. 60 | * 61 | * @input: 62 | * face :: 63 | * A handle to the input face. 64 | * 65 | * @output: 66 | * registry :: 67 | * The registry, as a C~string, owned by the face. 68 | * 69 | * ordering :: 70 | * The ordering, as a C~string, owned by the face. 71 | * 72 | * supplement :: 73 | * The supplement. 74 | * 75 | * @return: 76 | * FreeType error code. 0~means success. 77 | * 78 | * @note: 79 | * This function only works with CID faces, returning an error 80 | * otherwise. 81 | * 82 | * @since: 83 | * 2.3.6 84 | */ 85 | FT_EXPORT( FT_Error ) 86 | FT_Get_CID_Registry_Ordering_Supplement( FT_Face face, 87 | const char* *registry, 88 | const char* *ordering, 89 | FT_Int *supplement ); 90 | 91 | 92 | /************************************************************************** 93 | * 94 | * @function: 95 | * FT_Get_CID_Is_Internally_CID_Keyed 96 | * 97 | * @description: 98 | * Retrieve the type of the input face, CID keyed or not. In contrast 99 | * to the @FT_IS_CID_KEYED macro this function returns successfully also 100 | * for CID-keyed fonts in an SFNT wrapper. 101 | * 102 | * @input: 103 | * face :: 104 | * A handle to the input face. 105 | * 106 | * @output: 107 | * is_cid :: 108 | * The type of the face as an @FT_Bool. 109 | * 110 | * @return: 111 | * FreeType error code. 0~means success. 112 | * 113 | * @note: 114 | * This function only works with CID faces and OpenType fonts, returning 115 | * an error otherwise. 116 | * 117 | * @since: 118 | * 2.3.9 119 | */ 120 | FT_EXPORT( FT_Error ) 121 | FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face, 122 | FT_Bool *is_cid ); 123 | 124 | 125 | /************************************************************************** 126 | * 127 | * @function: 128 | * FT_Get_CID_From_Glyph_Index 129 | * 130 | * @description: 131 | * Retrieve the CID of the input glyph index. 132 | * 133 | * @input: 134 | * face :: 135 | * A handle to the input face. 136 | * 137 | * glyph_index :: 138 | * The input glyph index. 139 | * 140 | * @output: 141 | * cid :: 142 | * The CID as an @FT_UInt. 143 | * 144 | * @return: 145 | * FreeType error code. 0~means success. 146 | * 147 | * @note: 148 | * This function only works with CID faces and OpenType fonts, returning 149 | * an error otherwise. 150 | * 151 | * @since: 152 | * 2.3.9 153 | */ 154 | FT_EXPORT( FT_Error ) 155 | FT_Get_CID_From_Glyph_Index( FT_Face face, 156 | FT_UInt glyph_index, 157 | FT_UInt *cid ); 158 | 159 | /* */ 160 | 161 | 162 | FT_END_HEADER 163 | 164 | #endif /* FTCID_H_ */ 165 | 166 | 167 | /* END */ 168 | -------------------------------------------------------------------------------- /include/freetype/ftfntfmt.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftfntfmt.h 4 | * 5 | * Support functions for font formats. 6 | * 7 | * Copyright (C) 2002-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTFNTFMT_H_ 20 | #define FTFNTFMT_H_ 21 | 22 | #include 23 | 24 | #ifdef FREETYPE_H 25 | #error "freetype.h of FreeType 1 has been loaded!" 26 | #error "Please fix the directory search order for header files" 27 | #error "so that freetype.h of FreeType 2 is found first." 28 | #endif 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | 34 | /************************************************************************** 35 | * 36 | * @section: 37 | * font_formats 38 | * 39 | * @title: 40 | * Font Formats 41 | * 42 | * @abstract: 43 | * Getting the font format. 44 | * 45 | * @description: 46 | * The single function in this section can be used to get the font format. 47 | * Note that this information is not needed normally; however, there are 48 | * special cases (like in PDF devices) where it is important to 49 | * differentiate, in spite of FreeType's uniform API. 50 | * 51 | */ 52 | 53 | 54 | /************************************************************************** 55 | * 56 | * @function: 57 | * FT_Get_Font_Format 58 | * 59 | * @description: 60 | * Return a string describing the format of a given face. Possible values 61 | * are 'TrueType', 'Type~1', 'BDF', 'PCF', 'Type~42', 'CID~Type~1', 'CFF', 62 | * 'PFR', and 'Windows~FNT'. 63 | * 64 | * The return value is suitable to be used as an X11 FONT_PROPERTY. 65 | * 66 | * @input: 67 | * face :: 68 | * Input face handle. 69 | * 70 | * @return: 71 | * Font format string. `NULL` in case of error. 72 | * 73 | * @note: 74 | * A deprecated name for the same function is `FT_Get_X11_Font_Format`. 75 | */ 76 | FT_EXPORT( const char* ) 77 | FT_Get_Font_Format( FT_Face face ); 78 | 79 | 80 | /* deprecated */ 81 | FT_EXPORT( const char* ) 82 | FT_Get_X11_Font_Format( FT_Face face ); 83 | 84 | 85 | /* */ 86 | 87 | 88 | FT_END_HEADER 89 | 90 | #endif /* FTFNTFMT_H_ */ 91 | 92 | 93 | /* END */ 94 | -------------------------------------------------------------------------------- /include/freetype/ftgasp.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftgasp.h 4 | * 5 | * Access of TrueType's 'gasp' table (specification). 6 | * 7 | * Copyright (C) 2007-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTGASP_H_ 20 | #define FTGASP_H_ 21 | 22 | #include 23 | 24 | #ifdef FREETYPE_H 25 | #error "freetype.h of FreeType 1 has been loaded!" 26 | #error "Please fix the directory search order for header files" 27 | #error "so that freetype.h of FreeType 2 is found first." 28 | #endif 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | 34 | /************************************************************************** 35 | * 36 | * @section: 37 | * gasp_table 38 | * 39 | * @title: 40 | * Gasp Table 41 | * 42 | * @abstract: 43 | * Retrieving TrueType 'gasp' table entries. 44 | * 45 | * @description: 46 | * The function @FT_Get_Gasp can be used to query a TrueType or OpenType 47 | * font for specific entries in its 'gasp' table, if any. This is mainly 48 | * useful when implementing native TrueType hinting with the bytecode 49 | * interpreter to duplicate the Windows text rendering results. 50 | */ 51 | 52 | /************************************************************************** 53 | * 54 | * @enum: 55 | * FT_GASP_XXX 56 | * 57 | * @description: 58 | * A list of values and/or bit-flags returned by the @FT_Get_Gasp 59 | * function. 60 | * 61 | * @values: 62 | * FT_GASP_NO_TABLE :: 63 | * This special value means that there is no GASP table in this face. 64 | * It is up to the client to decide what to do. 65 | * 66 | * FT_GASP_DO_GRIDFIT :: 67 | * Grid-fitting and hinting should be performed at the specified ppem. 68 | * This **really** means TrueType bytecode interpretation. If this bit 69 | * is not set, no hinting gets applied. 70 | * 71 | * FT_GASP_DO_GRAY :: 72 | * Anti-aliased rendering should be performed at the specified ppem. 73 | * If not set, do monochrome rendering. 74 | * 75 | * FT_GASP_SYMMETRIC_SMOOTHING :: 76 | * If set, smoothing along multiple axes must be used with ClearType. 77 | * 78 | * FT_GASP_SYMMETRIC_GRIDFIT :: 79 | * Grid-fitting must be used with ClearType's symmetric smoothing. 80 | * 81 | * @note: 82 | * The bit-flags `FT_GASP_DO_GRIDFIT` and `FT_GASP_DO_GRAY` are to be 83 | * used for standard font rasterization only. Independently of that, 84 | * `FT_GASP_SYMMETRIC_SMOOTHING` and `FT_GASP_SYMMETRIC_GRIDFIT` are to 85 | * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT` and 86 | * `FT_GASP_DO_GRAY` are consequently ignored). 87 | * 88 | * 'ClearType' is Microsoft's implementation of LCD rendering, partly 89 | * protected by patents. 90 | * 91 | * @since: 92 | * 2.3.0 93 | */ 94 | #define FT_GASP_NO_TABLE -1 95 | #define FT_GASP_DO_GRIDFIT 0x01 96 | #define FT_GASP_DO_GRAY 0x02 97 | #define FT_GASP_SYMMETRIC_GRIDFIT 0x04 98 | #define FT_GASP_SYMMETRIC_SMOOTHING 0x08 99 | 100 | 101 | /************************************************************************** 102 | * 103 | * @function: 104 | * FT_Get_Gasp 105 | * 106 | * @description: 107 | * For a TrueType or OpenType font file, return the rasterizer behaviour 108 | * flags from the font's 'gasp' table corresponding to a given character 109 | * pixel size. 110 | * 111 | * @input: 112 | * face :: 113 | * The source face handle. 114 | * 115 | * ppem :: 116 | * The vertical character pixel size. 117 | * 118 | * @return: 119 | * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no 120 | * 'gasp' table in the face. 121 | * 122 | * @note: 123 | * If you want to use the MM functionality of OpenType variation fonts 124 | * (i.e., using @FT_Set_Var_Design_Coordinates and friends), call this 125 | * function **after** setting an instance since the return values can 126 | * change. 127 | * 128 | * @since: 129 | * 2.3.0 130 | */ 131 | FT_EXPORT( FT_Int ) 132 | FT_Get_Gasp( FT_Face face, 133 | FT_UInt ppem ); 134 | 135 | /* */ 136 | 137 | 138 | FT_END_HEADER 139 | 140 | #endif /* FTGASP_H_ */ 141 | 142 | 143 | /* END */ 144 | -------------------------------------------------------------------------------- /include/freetype/ftgzip.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftgzip.h 4 | * 5 | * Gzip-compressed stream support. 6 | * 7 | * Copyright (C) 2002-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTGZIP_H_ 20 | #define FTGZIP_H_ 21 | 22 | #include 23 | 24 | #ifdef FREETYPE_H 25 | #error "freetype.h of FreeType 1 has been loaded!" 26 | #error "Please fix the directory search order for header files" 27 | #error "so that freetype.h of FreeType 2 is found first." 28 | #endif 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | /************************************************************************** 34 | * 35 | * @section: 36 | * gzip 37 | * 38 | * @title: 39 | * GZIP Streams 40 | * 41 | * @abstract: 42 | * Using gzip-compressed font files. 43 | * 44 | * @description: 45 | * In certain builds of the library, gzip compression recognition is 46 | * automatically handled when calling @FT_New_Face or @FT_Open_Face. 47 | * This means that if no font driver is capable of handling the raw 48 | * compressed file, the library will try to open a gzipped stream from it 49 | * and re-open the face with it. 50 | * 51 | * The stream implementation is very basic and resets the decompression 52 | * process each time seeking backwards is needed within the stream, 53 | * which significantly undermines the performance. 54 | * 55 | * This section contains the declaration of Gzip-specific functions. 56 | * 57 | */ 58 | 59 | 60 | /************************************************************************** 61 | * 62 | * @function: 63 | * FT_Stream_OpenGzip 64 | * 65 | * @description: 66 | * Open a new stream to parse gzip-compressed font files. This is mainly 67 | * used to support the compressed `*.pcf.gz` fonts that come with 68 | * XFree86. 69 | * 70 | * @input: 71 | * stream :: 72 | * The target embedding stream. 73 | * 74 | * source :: 75 | * The source stream. 76 | * 77 | * @return: 78 | * FreeType error code. 0~means success. 79 | * 80 | * @note: 81 | * The source stream must be opened _before_ calling this function. 82 | * 83 | * Calling the internal function `FT_Stream_Close` on the new stream will 84 | * **not** call `FT_Stream_Close` on the source stream. None of the 85 | * stream objects will be released to the heap. 86 | * 87 | * This function may return `FT_Err_Unimplemented_Feature` if your build 88 | * of FreeType was not compiled with zlib support. 89 | */ 90 | FT_EXPORT( FT_Error ) 91 | FT_Stream_OpenGzip( FT_Stream stream, 92 | FT_Stream source ); 93 | 94 | 95 | /************************************************************************** 96 | * 97 | * @function: 98 | * FT_Gzip_Uncompress 99 | * 100 | * @description: 101 | * Decompress a zipped input buffer into an output buffer. This function 102 | * is modeled after zlib's `uncompress` function. 103 | * 104 | * @input: 105 | * memory :: 106 | * A FreeType memory handle. 107 | * 108 | * input :: 109 | * The input buffer. 110 | * 111 | * input_len :: 112 | * The length of the input buffer. 113 | * 114 | * @output: 115 | * output :: 116 | * The output buffer. 117 | * 118 | * @inout: 119 | * output_len :: 120 | * Before calling the function, this is the total size of the output 121 | * buffer, which must be large enough to hold the entire uncompressed 122 | * data (so the size of the uncompressed data must be known in 123 | * advance). After calling the function, `output_len` is the size of 124 | * the used data in `output`. 125 | * 126 | * @return: 127 | * FreeType error code. 0~means success. 128 | * 129 | * @note: 130 | * This function may return `FT_Err_Unimplemented_Feature` if your build 131 | * of FreeType was not compiled with zlib support. 132 | * 133 | * @since: 134 | * 2.5.1 135 | */ 136 | FT_EXPORT( FT_Error ) 137 | FT_Gzip_Uncompress( FT_Memory memory, 138 | FT_Byte* output, 139 | FT_ULong* output_len, 140 | const FT_Byte* input, 141 | FT_ULong input_len ); 142 | 143 | /* */ 144 | 145 | 146 | FT_END_HEADER 147 | 148 | #endif /* FTGZIP_H_ */ 149 | 150 | 151 | /* END */ 152 | -------------------------------------------------------------------------------- /include/freetype/ftlist.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftlist.h 4 | * 5 | * Generic list support for FreeType (specification). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /************************************************************************** 20 | * 21 | * This file implements functions relative to list processing. Its data 22 | * structures are defined in `freetype.h`. 23 | * 24 | */ 25 | 26 | 27 | #ifndef FTLIST_H_ 28 | #define FTLIST_H_ 29 | 30 | 31 | #include 32 | 33 | #ifdef FREETYPE_H 34 | #error "freetype.h of FreeType 1 has been loaded!" 35 | #error "Please fix the directory search order for header files" 36 | #error "so that freetype.h of FreeType 2 is found first." 37 | #endif 38 | 39 | 40 | FT_BEGIN_HEADER 41 | 42 | 43 | /************************************************************************** 44 | * 45 | * @section: 46 | * list_processing 47 | * 48 | * @title: 49 | * List Processing 50 | * 51 | * @abstract: 52 | * Simple management of lists. 53 | * 54 | * @description: 55 | * This section contains various definitions related to list processing 56 | * using doubly-linked nodes. 57 | * 58 | * @order: 59 | * FT_List 60 | * FT_ListNode 61 | * FT_ListRec 62 | * FT_ListNodeRec 63 | * 64 | * FT_List_Add 65 | * FT_List_Insert 66 | * FT_List_Find 67 | * FT_List_Remove 68 | * FT_List_Up 69 | * FT_List_Iterate 70 | * FT_List_Iterator 71 | * FT_List_Finalize 72 | * FT_List_Destructor 73 | * 74 | */ 75 | 76 | 77 | /************************************************************************** 78 | * 79 | * @function: 80 | * FT_List_Find 81 | * 82 | * @description: 83 | * Find the list node for a given listed object. 84 | * 85 | * @input: 86 | * list :: 87 | * A pointer to the parent list. 88 | * data :: 89 | * The address of the listed object. 90 | * 91 | * @return: 92 | * List node. `NULL` if it wasn't found. 93 | */ 94 | FT_EXPORT( FT_ListNode ) 95 | FT_List_Find( FT_List list, 96 | void* data ); 97 | 98 | 99 | /************************************************************************** 100 | * 101 | * @function: 102 | * FT_List_Add 103 | * 104 | * @description: 105 | * Append an element to the end of a list. 106 | * 107 | * @inout: 108 | * list :: 109 | * A pointer to the parent list. 110 | * node :: 111 | * The node to append. 112 | */ 113 | FT_EXPORT( void ) 114 | FT_List_Add( FT_List list, 115 | FT_ListNode node ); 116 | 117 | 118 | /************************************************************************** 119 | * 120 | * @function: 121 | * FT_List_Insert 122 | * 123 | * @description: 124 | * Insert an element at the head of a list. 125 | * 126 | * @inout: 127 | * list :: 128 | * A pointer to parent list. 129 | * node :: 130 | * The node to insert. 131 | */ 132 | FT_EXPORT( void ) 133 | FT_List_Insert( FT_List list, 134 | FT_ListNode node ); 135 | 136 | 137 | /************************************************************************** 138 | * 139 | * @function: 140 | * FT_List_Remove 141 | * 142 | * @description: 143 | * Remove a node from a list. This function doesn't check whether the 144 | * node is in the list! 145 | * 146 | * @input: 147 | * node :: 148 | * The node to remove. 149 | * 150 | * @inout: 151 | * list :: 152 | * A pointer to the parent list. 153 | */ 154 | FT_EXPORT( void ) 155 | FT_List_Remove( FT_List list, 156 | FT_ListNode node ); 157 | 158 | 159 | /************************************************************************** 160 | * 161 | * @function: 162 | * FT_List_Up 163 | * 164 | * @description: 165 | * Move a node to the head/top of a list. Used to maintain LRU lists. 166 | * 167 | * @inout: 168 | * list :: 169 | * A pointer to the parent list. 170 | * node :: 171 | * The node to move. 172 | */ 173 | FT_EXPORT( void ) 174 | FT_List_Up( FT_List list, 175 | FT_ListNode node ); 176 | 177 | 178 | /************************************************************************** 179 | * 180 | * @functype: 181 | * FT_List_Iterator 182 | * 183 | * @description: 184 | * An FT_List iterator function that is called during a list parse by 185 | * @FT_List_Iterate. 186 | * 187 | * @input: 188 | * node :: 189 | * The current iteration list node. 190 | * 191 | * user :: 192 | * A typeless pointer passed to @FT_List_Iterate. Can be used to point 193 | * to the iteration's state. 194 | */ 195 | typedef FT_Error 196 | (*FT_List_Iterator)( FT_ListNode node, 197 | void* user ); 198 | 199 | 200 | /************************************************************************** 201 | * 202 | * @function: 203 | * FT_List_Iterate 204 | * 205 | * @description: 206 | * Parse a list and calls a given iterator function on each element. 207 | * Note that parsing is stopped as soon as one of the iterator calls 208 | * returns a non-zero value. 209 | * 210 | * @input: 211 | * list :: 212 | * A handle to the list. 213 | * iterator :: 214 | * An iterator function, called on each node of the list. 215 | * user :: 216 | * A user-supplied field that is passed as the second argument to the 217 | * iterator. 218 | * 219 | * @return: 220 | * The result (a FreeType error code) of the last iterator call. 221 | */ 222 | FT_EXPORT( FT_Error ) 223 | FT_List_Iterate( FT_List list, 224 | FT_List_Iterator iterator, 225 | void* user ); 226 | 227 | 228 | /************************************************************************** 229 | * 230 | * @functype: 231 | * FT_List_Destructor 232 | * 233 | * @description: 234 | * An @FT_List iterator function that is called during a list 235 | * finalization by @FT_List_Finalize to destroy all elements in a given 236 | * list. 237 | * 238 | * @input: 239 | * system :: 240 | * The current system object. 241 | * 242 | * data :: 243 | * The current object to destroy. 244 | * 245 | * user :: 246 | * A typeless pointer passed to @FT_List_Iterate. It can be used to 247 | * point to the iteration's state. 248 | */ 249 | typedef void 250 | (*FT_List_Destructor)( FT_Memory memory, 251 | void* data, 252 | void* user ); 253 | 254 | 255 | /************************************************************************** 256 | * 257 | * @function: 258 | * FT_List_Finalize 259 | * 260 | * @description: 261 | * Destroy all elements in the list as well as the list itself. 262 | * 263 | * @input: 264 | * list :: 265 | * A handle to the list. 266 | * 267 | * destroy :: 268 | * A list destructor that will be applied to each element of the list. 269 | * Set this to `NULL` if not needed. 270 | * 271 | * memory :: 272 | * The current memory object that handles deallocation. 273 | * 274 | * user :: 275 | * A user-supplied field that is passed as the last argument to the 276 | * destructor. 277 | * 278 | * @note: 279 | * This function expects that all nodes added by @FT_List_Add or 280 | * @FT_List_Insert have been dynamically allocated. 281 | */ 282 | FT_EXPORT( void ) 283 | FT_List_Finalize( FT_List list, 284 | FT_List_Destructor destroy, 285 | FT_Memory memory, 286 | void* user ); 287 | 288 | /* */ 289 | 290 | 291 | FT_END_HEADER 292 | 293 | #endif /* FTLIST_H_ */ 294 | 295 | 296 | /* END */ 297 | -------------------------------------------------------------------------------- /include/freetype/ftlogging.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftlogging.h 4 | * 5 | * Additional debugging APIs. 6 | * 7 | * Copyright (C) 2020-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTLOGGING_H_ 20 | #define FTLOGGING_H_ 21 | 22 | 23 | #include 24 | #include FT_CONFIG_CONFIG_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | /************************************************************************** 31 | * 32 | * @section: 33 | * debugging_apis 34 | * 35 | * @title: 36 | * External Debugging APIs 37 | * 38 | * @abstract: 39 | * Public APIs to control the `FT_DEBUG_LOGGING` macro. 40 | * 41 | * @description: 42 | * This section contains the declarations of public functions that 43 | * enables fine control of what the `FT_DEBUG_LOGGING` macro outputs. 44 | * 45 | */ 46 | 47 | 48 | /************************************************************************** 49 | * 50 | * @function: 51 | * FT_Trace_Set_Level 52 | * 53 | * @description: 54 | * Change the levels of tracing components of FreeType at run time. 55 | * 56 | * @input: 57 | * tracing_level :: 58 | * New tracing value. 59 | * 60 | * @example: 61 | * The following call makes FreeType trace everything but the 'memory' 62 | * component. 63 | * 64 | * ``` 65 | * FT_Trace_Set_Level( "any:7 memory:0 ); 66 | * ``` 67 | * 68 | * @note: 69 | * This function does nothing if compilation option `FT_DEBUG_LOGGING` 70 | * isn't set. 71 | * 72 | * @since: 73 | * 2.11 74 | * 75 | */ 76 | FT_EXPORT( void ) 77 | FT_Trace_Set_Level( const char* tracing_level ); 78 | 79 | 80 | /************************************************************************** 81 | * 82 | * @function: 83 | * FT_Trace_Set_Default_Level 84 | * 85 | * @description: 86 | * Reset tracing value of FreeType's components to the default value 87 | * (i.e., to the value of the `FT2_DEBUG` environment value or to NULL 88 | * if `FT2_DEBUG` is not set). 89 | * 90 | * @note: 91 | * This function does nothing if compilation option `FT_DEBUG_LOGGING` 92 | * isn't set. 93 | * 94 | * @since: 95 | * 2.11 96 | * 97 | */ 98 | FT_EXPORT( void ) 99 | FT_Trace_Set_Default_Level( void ); 100 | 101 | 102 | /************************************************************************** 103 | * 104 | * @functype: 105 | * FT_Custom_Log_Handler 106 | * 107 | * @description: 108 | * A function typedef that is used to handle the logging of tracing and 109 | * debug messages on a file system. 110 | * 111 | * @input: 112 | * ft_component :: 113 | * The name of `FT_COMPONENT` from which the current debug or error 114 | * message is produced. 115 | * 116 | * fmt :: 117 | * Actual debug or tracing message. 118 | * 119 | * args:: 120 | * Arguments of debug or tracing messages. 121 | * 122 | * @since: 123 | * 2.11 124 | * 125 | */ 126 | typedef void 127 | (*FT_Custom_Log_Handler)( const char* ft_component, 128 | const char* fmt, 129 | va_list args ); 130 | 131 | 132 | /************************************************************************** 133 | * 134 | * @function: 135 | * FT_Set_Log_Handler 136 | * 137 | * @description: 138 | * A function to set a custom log handler. 139 | * 140 | * @input: 141 | * handler :: 142 | * New logging function. 143 | * 144 | * @note: 145 | * This function does nothing if compilation option `FT_DEBUG_LOGGING` 146 | * isn't set. 147 | * 148 | * @since: 149 | * 2.11 150 | * 151 | */ 152 | FT_EXPORT( void ) 153 | FT_Set_Log_Handler( FT_Custom_Log_Handler handler ); 154 | 155 | 156 | /************************************************************************** 157 | * 158 | * @function: 159 | * FT_Set_Default_Log_Handler 160 | * 161 | * @description: 162 | * A function to undo the effect of @FT_Set_Log_Handler, resetting the 163 | * log handler to FreeType's built-in version. 164 | * 165 | * @note: 166 | * This function does nothing if compilation option `FT_DEBUG_LOGGING` 167 | * isn't set. 168 | * 169 | * @since: 170 | * 2.11 171 | * 172 | */ 173 | FT_EXPORT( void ) 174 | FT_Set_Default_Log_Handler( void ); 175 | 176 | /* */ 177 | 178 | 179 | FT_END_HEADER 180 | 181 | #endif /* FTLOGGING_H_ */ 182 | 183 | 184 | /* END */ 185 | -------------------------------------------------------------------------------- /include/freetype/ftlzw.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftlzw.h 4 | * 5 | * LZW-compressed stream support. 6 | * 7 | * Copyright (C) 2004-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTLZW_H_ 20 | #define FTLZW_H_ 21 | 22 | #include 23 | 24 | #ifdef FREETYPE_H 25 | #error "freetype.h of FreeType 1 has been loaded!" 26 | #error "Please fix the directory search order for header files" 27 | #error "so that freetype.h of FreeType 2 is found first." 28 | #endif 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | /************************************************************************** 34 | * 35 | * @section: 36 | * lzw 37 | * 38 | * @title: 39 | * LZW Streams 40 | * 41 | * @abstract: 42 | * Using LZW-compressed font files. 43 | * 44 | * @description: 45 | * In certain builds of the library, LZW compression recognition is 46 | * automatically handled when calling @FT_New_Face or @FT_Open_Face. 47 | * This means that if no font driver is capable of handling the raw 48 | * compressed file, the library will try to open a LZW stream from it and 49 | * re-open the face with it. 50 | * 51 | * The stream implementation is very basic and resets the decompression 52 | * process each time seeking backwards is needed within the stream, 53 | * which significantly undermines the performance. 54 | * 55 | * This section contains the declaration of LZW-specific functions. 56 | * 57 | */ 58 | 59 | /************************************************************************** 60 | * 61 | * @function: 62 | * FT_Stream_OpenLZW 63 | * 64 | * @description: 65 | * Open a new stream to parse LZW-compressed font files. This is mainly 66 | * used to support the compressed `*.pcf.Z` fonts that come with XFree86. 67 | * 68 | * @input: 69 | * stream :: 70 | * The target embedding stream. 71 | * 72 | * source :: 73 | * The source stream. 74 | * 75 | * @return: 76 | * FreeType error code. 0~means success. 77 | * 78 | * @note: 79 | * The source stream must be opened _before_ calling this function. 80 | * 81 | * Calling the internal function `FT_Stream_Close` on the new stream will 82 | * **not** call `FT_Stream_Close` on the source stream. None of the 83 | * stream objects will be released to the heap. 84 | * 85 | * This function may return `FT_Err_Unimplemented_Feature` if your build 86 | * of FreeType was not compiled with LZW support. 87 | */ 88 | FT_EXPORT( FT_Error ) 89 | FT_Stream_OpenLZW( FT_Stream stream, 90 | FT_Stream source ); 91 | 92 | /* */ 93 | 94 | 95 | FT_END_HEADER 96 | 97 | #endif /* FTLZW_H_ */ 98 | 99 | 100 | /* END */ 101 | -------------------------------------------------------------------------------- /include/freetype/ftmoderr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftmoderr.h 4 | * 5 | * FreeType module error offsets (specification). 6 | * 7 | * Copyright (C) 2001-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /************************************************************************** 20 | * 21 | * This file is used to define the FreeType module error codes. 22 | * 23 | * If the macro `FT_CONFIG_OPTION_USE_MODULE_ERRORS` in `ftoption.h` is 24 | * set, the lower byte of an error value identifies the error code as 25 | * usual. In addition, the higher byte identifies the module. For 26 | * example, the error `FT_Err_Invalid_File_Format` has value 0x0003, the 27 | * error `TT_Err_Invalid_File_Format` has value 0x1303, the error 28 | * `T1_Err_Invalid_File_Format` has value 0x1403, etc. 29 | * 30 | * Note that `FT_Err_Ok`, `TT_Err_Ok`, etc. are always equal to zero, 31 | * including the high byte. 32 | * 33 | * If `FT_CONFIG_OPTION_USE_MODULE_ERRORS` isn't set, the higher byte of an 34 | * error value is set to zero. 35 | * 36 | * To hide the various `XXX_Err_` prefixes in the source code, FreeType 37 | * provides some macros in `fttypes.h`. 38 | * 39 | * FT_ERR( err ) 40 | * 41 | * Add current error module prefix (as defined with the `FT_ERR_PREFIX` 42 | * macro) to `err`. For example, in the BDF module the line 43 | * 44 | * ``` 45 | * error = FT_ERR( Invalid_Outline ); 46 | * ``` 47 | * 48 | * expands to 49 | * 50 | * ``` 51 | * error = BDF_Err_Invalid_Outline; 52 | * ``` 53 | * 54 | * For simplicity, you can always use `FT_Err_Ok` directly instead of 55 | * `FT_ERR( Ok )`. 56 | * 57 | * FT_ERR_EQ( errcode, err ) 58 | * FT_ERR_NEQ( errcode, err ) 59 | * 60 | * Compare error code `errcode` with the error `err` for equality and 61 | * inequality, respectively. Example: 62 | * 63 | * ``` 64 | * if ( FT_ERR_EQ( error, Invalid_Outline ) ) 65 | * ... 66 | * ``` 67 | * 68 | * Using this macro you don't have to think about error prefixes. Of 69 | * course, if module errors are not active, the above example is the 70 | * same as 71 | * 72 | * ``` 73 | * if ( error == FT_Err_Invalid_Outline ) 74 | * ... 75 | * ``` 76 | * 77 | * FT_ERROR_BASE( errcode ) 78 | * FT_ERROR_MODULE( errcode ) 79 | * 80 | * Get base error and module error code, respectively. 81 | * 82 | * It can also be used to create a module error message table easily with 83 | * something like 84 | * 85 | * ``` 86 | * #undef FTMODERR_H_ 87 | * #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, 88 | * #define FT_MODERR_START_LIST { 89 | * #define FT_MODERR_END_LIST { 0, 0 } }; 90 | * 91 | * const struct 92 | * { 93 | * int mod_err_offset; 94 | * const char* mod_err_msg 95 | * } ft_mod_errors[] = 96 | * 97 | * #include 98 | * ``` 99 | * 100 | */ 101 | 102 | 103 | #ifndef FTMODERR_H_ 104 | #define FTMODERR_H_ 105 | 106 | 107 | /*******************************************************************/ 108 | /*******************************************************************/ 109 | /***** *****/ 110 | /***** SETUP MACROS *****/ 111 | /***** *****/ 112 | /*******************************************************************/ 113 | /*******************************************************************/ 114 | 115 | 116 | #undef FT_NEED_EXTERN_C 117 | 118 | #ifndef FT_MODERRDEF 119 | 120 | #ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS 121 | #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v, 122 | #else 123 | #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0, 124 | #endif 125 | 126 | #define FT_MODERR_START_LIST enum { 127 | #define FT_MODERR_END_LIST FT_Mod_Err_Max }; 128 | 129 | #ifdef __cplusplus 130 | #define FT_NEED_EXTERN_C 131 | extern "C" { 132 | #endif 133 | 134 | #endif /* !FT_MODERRDEF */ 135 | 136 | 137 | /*******************************************************************/ 138 | /*******************************************************************/ 139 | /***** *****/ 140 | /***** LIST MODULE ERROR BASES *****/ 141 | /***** *****/ 142 | /*******************************************************************/ 143 | /*******************************************************************/ 144 | 145 | 146 | #ifdef FT_MODERR_START_LIST 147 | FT_MODERR_START_LIST 148 | #endif 149 | 150 | 151 | FT_MODERRDEF( Base, 0x000, "base module" ) 152 | FT_MODERRDEF( Autofit, 0x100, "autofitter module" ) 153 | FT_MODERRDEF( BDF, 0x200, "BDF module" ) 154 | FT_MODERRDEF( Bzip2, 0x300, "Bzip2 module" ) 155 | FT_MODERRDEF( Cache, 0x400, "cache module" ) 156 | FT_MODERRDEF( CFF, 0x500, "CFF module" ) 157 | FT_MODERRDEF( CID, 0x600, "CID module" ) 158 | FT_MODERRDEF( Gzip, 0x700, "Gzip module" ) 159 | FT_MODERRDEF( LZW, 0x800, "LZW module" ) 160 | FT_MODERRDEF( OTvalid, 0x900, "OpenType validation module" ) 161 | FT_MODERRDEF( PCF, 0xA00, "PCF module" ) 162 | FT_MODERRDEF( PFR, 0xB00, "PFR module" ) 163 | FT_MODERRDEF( PSaux, 0xC00, "PS auxiliary module" ) 164 | FT_MODERRDEF( PShinter, 0xD00, "PS hinter module" ) 165 | FT_MODERRDEF( PSnames, 0xE00, "PS names module" ) 166 | FT_MODERRDEF( Raster, 0xF00, "raster module" ) 167 | FT_MODERRDEF( SFNT, 0x1000, "SFNT module" ) 168 | FT_MODERRDEF( Smooth, 0x1100, "smooth raster module" ) 169 | FT_MODERRDEF( TrueType, 0x1200, "TrueType module" ) 170 | FT_MODERRDEF( Type1, 0x1300, "Type 1 module" ) 171 | FT_MODERRDEF( Type42, 0x1400, "Type 42 module" ) 172 | FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" ) 173 | FT_MODERRDEF( GXvalid, 0x1600, "GX validation module" ) 174 | FT_MODERRDEF( Sdf, 0x1700, "Signed distance field raster module" ) 175 | 176 | 177 | #ifdef FT_MODERR_END_LIST 178 | FT_MODERR_END_LIST 179 | #endif 180 | 181 | 182 | /*******************************************************************/ 183 | /*******************************************************************/ 184 | /***** *****/ 185 | /***** CLEANUP *****/ 186 | /***** *****/ 187 | /*******************************************************************/ 188 | /*******************************************************************/ 189 | 190 | 191 | #ifdef FT_NEED_EXTERN_C 192 | } 193 | #endif 194 | 195 | #undef FT_MODERR_START_LIST 196 | #undef FT_MODERR_END_LIST 197 | #undef FT_MODERRDEF 198 | #undef FT_NEED_EXTERN_C 199 | 200 | 201 | #endif /* FTMODERR_H_ */ 202 | 203 | 204 | /* END */ 205 | -------------------------------------------------------------------------------- /include/freetype/ftotval.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftotval.h 4 | * 5 | * FreeType API for validating OpenType tables (specification). 6 | * 7 | * Copyright (C) 2004-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /**************************************************************************** 20 | * 21 | * 22 | * Warning: This module might be moved to a different library in the 23 | * future to avoid a tight dependency between FreeType and the 24 | * OpenType specification. 25 | * 26 | * 27 | */ 28 | 29 | 30 | #ifndef FTOTVAL_H_ 31 | #define FTOTVAL_H_ 32 | 33 | #include 34 | 35 | #ifdef FREETYPE_H 36 | #error "freetype.h of FreeType 1 has been loaded!" 37 | #error "Please fix the directory search order for header files" 38 | #error "so that freetype.h of FreeType 2 is found first." 39 | #endif 40 | 41 | 42 | FT_BEGIN_HEADER 43 | 44 | 45 | /************************************************************************** 46 | * 47 | * @section: 48 | * ot_validation 49 | * 50 | * @title: 51 | * OpenType Validation 52 | * 53 | * @abstract: 54 | * An API to validate OpenType tables. 55 | * 56 | * @description: 57 | * This section contains the declaration of functions to validate some 58 | * OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). 59 | * 60 | * @order: 61 | * FT_OpenType_Validate 62 | * FT_OpenType_Free 63 | * 64 | * FT_VALIDATE_OTXXX 65 | * 66 | */ 67 | 68 | 69 | /************************************************************************** 70 | * 71 | * @enum: 72 | * FT_VALIDATE_OTXXX 73 | * 74 | * @description: 75 | * A list of bit-field constants used with @FT_OpenType_Validate to 76 | * indicate which OpenType tables should be validated. 77 | * 78 | * @values: 79 | * FT_VALIDATE_BASE :: 80 | * Validate BASE table. 81 | * 82 | * FT_VALIDATE_GDEF :: 83 | * Validate GDEF table. 84 | * 85 | * FT_VALIDATE_GPOS :: 86 | * Validate GPOS table. 87 | * 88 | * FT_VALIDATE_GSUB :: 89 | * Validate GSUB table. 90 | * 91 | * FT_VALIDATE_JSTF :: 92 | * Validate JSTF table. 93 | * 94 | * FT_VALIDATE_MATH :: 95 | * Validate MATH table. 96 | * 97 | * FT_VALIDATE_OT :: 98 | * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). 99 | * 100 | */ 101 | #define FT_VALIDATE_BASE 0x0100 102 | #define FT_VALIDATE_GDEF 0x0200 103 | #define FT_VALIDATE_GPOS 0x0400 104 | #define FT_VALIDATE_GSUB 0x0800 105 | #define FT_VALIDATE_JSTF 0x1000 106 | #define FT_VALIDATE_MATH 0x2000 107 | 108 | #define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \ 109 | FT_VALIDATE_GDEF | \ 110 | FT_VALIDATE_GPOS | \ 111 | FT_VALIDATE_GSUB | \ 112 | FT_VALIDATE_JSTF | \ 113 | FT_VALIDATE_MATH ) 114 | 115 | 116 | /************************************************************************** 117 | * 118 | * @function: 119 | * FT_OpenType_Validate 120 | * 121 | * @description: 122 | * Validate various OpenType tables to assure that all offsets and 123 | * indices are valid. The idea is that a higher-level library that 124 | * actually does the text layout can access those tables without error 125 | * checking (which can be quite time consuming). 126 | * 127 | * @input: 128 | * face :: 129 | * A handle to the input face. 130 | * 131 | * validation_flags :: 132 | * A bit field that specifies the tables to be validated. See 133 | * @FT_VALIDATE_OTXXX for possible values. 134 | * 135 | * @output: 136 | * BASE_table :: 137 | * A pointer to the BASE table. 138 | * 139 | * GDEF_table :: 140 | * A pointer to the GDEF table. 141 | * 142 | * GPOS_table :: 143 | * A pointer to the GPOS table. 144 | * 145 | * GSUB_table :: 146 | * A pointer to the GSUB table. 147 | * 148 | * JSTF_table :: 149 | * A pointer to the JSTF table. 150 | * 151 | * @return: 152 | * FreeType error code. 0~means success. 153 | * 154 | * @note: 155 | * This function only works with OpenType fonts, returning an error 156 | * otherwise. 157 | * 158 | * After use, the application should deallocate the five tables with 159 | * @FT_OpenType_Free. A `NULL` value indicates that the table either 160 | * doesn't exist in the font, or the application hasn't asked for 161 | * validation. 162 | */ 163 | FT_EXPORT( FT_Error ) 164 | FT_OpenType_Validate( FT_Face face, 165 | FT_UInt validation_flags, 166 | FT_Bytes *BASE_table, 167 | FT_Bytes *GDEF_table, 168 | FT_Bytes *GPOS_table, 169 | FT_Bytes *GSUB_table, 170 | FT_Bytes *JSTF_table ); 171 | 172 | 173 | /************************************************************************** 174 | * 175 | * @function: 176 | * FT_OpenType_Free 177 | * 178 | * @description: 179 | * Free the buffer allocated by OpenType validator. 180 | * 181 | * @input: 182 | * face :: 183 | * A handle to the input face. 184 | * 185 | * table :: 186 | * The pointer to the buffer that is allocated by 187 | * @FT_OpenType_Validate. 188 | * 189 | * @note: 190 | * This function must be used to free the buffer allocated by 191 | * @FT_OpenType_Validate only. 192 | */ 193 | FT_EXPORT( void ) 194 | FT_OpenType_Free( FT_Face face, 195 | FT_Bytes table ); 196 | 197 | 198 | /* */ 199 | 200 | 201 | FT_END_HEADER 202 | 203 | #endif /* FTOTVAL_H_ */ 204 | 205 | 206 | /* END */ 207 | -------------------------------------------------------------------------------- /include/freetype/ftparams.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftparams.h 4 | * 5 | * FreeType API for possible FT_Parameter tags (specification only). 6 | * 7 | * Copyright (C) 2017-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTPARAMS_H_ 20 | #define FTPARAMS_H_ 21 | 22 | #include 23 | 24 | #ifdef FREETYPE_H 25 | #error "freetype.h of FreeType 1 has been loaded!" 26 | #error "Please fix the directory search order for header files" 27 | #error "so that freetype.h of FreeType 2 is found first." 28 | #endif 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | 34 | /************************************************************************** 35 | * 36 | * @section: 37 | * parameter_tags 38 | * 39 | * @title: 40 | * Parameter Tags 41 | * 42 | * @abstract: 43 | * Macros for driver property and font loading parameter tags. 44 | * 45 | * @description: 46 | * This section contains macros for the @FT_Parameter structure that are 47 | * used with various functions to activate some special functionality or 48 | * different behaviour of various components of FreeType. 49 | * 50 | */ 51 | 52 | 53 | /************************************************************************** 54 | * 55 | * @enum: 56 | * FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY 57 | * 58 | * @description: 59 | * A tag for @FT_Parameter to make @FT_Open_Face ignore typographic 60 | * family names in the 'name' table (introduced in OpenType version 1.4). 61 | * Use this for backward compatibility with legacy systems that have a 62 | * four-faces-per-family restriction. 63 | * 64 | * @since: 65 | * 2.8 66 | * 67 | */ 68 | #define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \ 69 | FT_MAKE_TAG( 'i', 'g', 'p', 'f' ) 70 | 71 | 72 | /* this constant is deprecated */ 73 | #define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY \ 74 | FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY 75 | 76 | 77 | /************************************************************************** 78 | * 79 | * @enum: 80 | * FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY 81 | * 82 | * @description: 83 | * A tag for @FT_Parameter to make @FT_Open_Face ignore typographic 84 | * subfamily names in the 'name' table (introduced in OpenType version 85 | * 1.4). Use this for backward compatibility with legacy systems that 86 | * have a four-faces-per-family restriction. 87 | * 88 | * @since: 89 | * 2.8 90 | * 91 | */ 92 | #define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \ 93 | FT_MAKE_TAG( 'i', 'g', 'p', 's' ) 94 | 95 | 96 | /* this constant is deprecated */ 97 | #define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY \ 98 | FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY 99 | 100 | 101 | /************************************************************************** 102 | * 103 | * @enum: 104 | * FT_PARAM_TAG_INCREMENTAL 105 | * 106 | * @description: 107 | * An @FT_Parameter tag to be used with @FT_Open_Face to indicate 108 | * incremental glyph loading. 109 | * 110 | */ 111 | #define FT_PARAM_TAG_INCREMENTAL \ 112 | FT_MAKE_TAG( 'i', 'n', 'c', 'r' ) 113 | 114 | 115 | /************************************************************************** 116 | * 117 | * @enum: 118 | * FT_PARAM_TAG_IGNORE_SBIX 119 | * 120 | * @description: 121 | * A tag for @FT_Parameter to make @FT_Open_Face ignore an 'sbix' table 122 | * while loading a font. Use this if @FT_FACE_FLAG_SBIX is set and you 123 | * want to access the outline glyphs in the font. 124 | * 125 | */ 126 | #define FT_PARAM_TAG_IGNORE_SBIX \ 127 | FT_MAKE_TAG( 'i', 's', 'b', 'x' ) 128 | 129 | 130 | /************************************************************************** 131 | * 132 | * @enum: 133 | * FT_PARAM_TAG_LCD_FILTER_WEIGHTS 134 | * 135 | * @description: 136 | * An @FT_Parameter tag to be used with @FT_Face_Properties. The 137 | * corresponding argument specifies the five LCD filter weights for a 138 | * given face (if using @FT_LOAD_TARGET_LCD, for example), overriding the 139 | * global default values or the values set up with 140 | * @FT_Library_SetLcdFilterWeights. 141 | * 142 | * @since: 143 | * 2.8 144 | * 145 | */ 146 | #define FT_PARAM_TAG_LCD_FILTER_WEIGHTS \ 147 | FT_MAKE_TAG( 'l', 'c', 'd', 'f' ) 148 | 149 | 150 | /************************************************************************** 151 | * 152 | * @enum: 153 | * FT_PARAM_TAG_RANDOM_SEED 154 | * 155 | * @description: 156 | * An @FT_Parameter tag to be used with @FT_Face_Properties. The 157 | * corresponding 32bit signed integer argument overrides the font 158 | * driver's random seed value with a face-specific one; see @random-seed. 159 | * 160 | * @since: 161 | * 2.8 162 | * 163 | */ 164 | #define FT_PARAM_TAG_RANDOM_SEED \ 165 | FT_MAKE_TAG( 's', 'e', 'e', 'd' ) 166 | 167 | 168 | /************************************************************************** 169 | * 170 | * @enum: 171 | * FT_PARAM_TAG_STEM_DARKENING 172 | * 173 | * @description: 174 | * An @FT_Parameter tag to be used with @FT_Face_Properties. The 175 | * corresponding Boolean argument specifies whether to apply stem 176 | * darkening, overriding the global default values or the values set up 177 | * with @FT_Property_Set (see @no-stem-darkening). 178 | * 179 | * This is a passive setting that only takes effect if the font driver or 180 | * autohinter honors it, which the CFF, Type~1, and CID drivers always 181 | * do, but the autohinter only in 'light' hinting mode (as of version 182 | * 2.9). 183 | * 184 | * @since: 185 | * 2.8 186 | * 187 | */ 188 | #define FT_PARAM_TAG_STEM_DARKENING \ 189 | FT_MAKE_TAG( 'd', 'a', 'r', 'k' ) 190 | 191 | 192 | /************************************************************************** 193 | * 194 | * @enum: 195 | * FT_PARAM_TAG_UNPATENTED_HINTING 196 | * 197 | * @description: 198 | * Deprecated, no effect. 199 | * 200 | * Previously: A constant used as the tag of an @FT_Parameter structure 201 | * to indicate that unpatented methods only should be used by the 202 | * TrueType bytecode interpreter for a typeface opened by @FT_Open_Face. 203 | * 204 | */ 205 | #define FT_PARAM_TAG_UNPATENTED_HINTING \ 206 | FT_MAKE_TAG( 'u', 'n', 'p', 'a' ) 207 | 208 | 209 | /* */ 210 | 211 | 212 | FT_END_HEADER 213 | 214 | 215 | #endif /* FTPARAMS_H_ */ 216 | 217 | 218 | /* END */ 219 | -------------------------------------------------------------------------------- /include/freetype/ftpfr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftpfr.h 4 | * 5 | * FreeType API for accessing PFR-specific data (specification only). 6 | * 7 | * Copyright (C) 2002-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTPFR_H_ 20 | #define FTPFR_H_ 21 | 22 | #include 23 | 24 | #ifdef FREETYPE_H 25 | #error "freetype.h of FreeType 1 has been loaded!" 26 | #error "Please fix the directory search order for header files" 27 | #error "so that freetype.h of FreeType 2 is found first." 28 | #endif 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | 34 | /************************************************************************** 35 | * 36 | * @section: 37 | * pfr_fonts 38 | * 39 | * @title: 40 | * PFR Fonts 41 | * 42 | * @abstract: 43 | * PFR/TrueDoc-specific API. 44 | * 45 | * @description: 46 | * This section contains the declaration of PFR-specific functions. 47 | * 48 | */ 49 | 50 | 51 | /************************************************************************** 52 | * 53 | * @function: 54 | * FT_Get_PFR_Metrics 55 | * 56 | * @description: 57 | * Return the outline and metrics resolutions of a given PFR face. 58 | * 59 | * @input: 60 | * face :: 61 | * Handle to the input face. It can be a non-PFR face. 62 | * 63 | * @output: 64 | * aoutline_resolution :: 65 | * Outline resolution. This is equivalent to `face->units_per_EM` for 66 | * non-PFR fonts. Optional (parameter can be `NULL`). 67 | * 68 | * ametrics_resolution :: 69 | * Metrics resolution. This is equivalent to `outline_resolution` for 70 | * non-PFR fonts. Optional (parameter can be `NULL`). 71 | * 72 | * ametrics_x_scale :: 73 | * A 16.16 fixed-point number used to scale distance expressed in 74 | * metrics units to device subpixels. This is equivalent to 75 | * `face->size->x_scale`, but for metrics only. Optional (parameter 76 | * can be `NULL`). 77 | * 78 | * ametrics_y_scale :: 79 | * Same as `ametrics_x_scale` but for the vertical direction. 80 | * optional (parameter can be `NULL`). 81 | * 82 | * @return: 83 | * FreeType error code. 0~means success. 84 | * 85 | * @note: 86 | * If the input face is not a PFR, this function will return an error. 87 | * However, in all cases, it will return valid values. 88 | */ 89 | FT_EXPORT( FT_Error ) 90 | FT_Get_PFR_Metrics( FT_Face face, 91 | FT_UInt *aoutline_resolution, 92 | FT_UInt *ametrics_resolution, 93 | FT_Fixed *ametrics_x_scale, 94 | FT_Fixed *ametrics_y_scale ); 95 | 96 | 97 | /************************************************************************** 98 | * 99 | * @function: 100 | * FT_Get_PFR_Kerning 101 | * 102 | * @description: 103 | * Return the kerning pair corresponding to two glyphs in a PFR face. 104 | * The distance is expressed in metrics units, unlike the result of 105 | * @FT_Get_Kerning. 106 | * 107 | * @input: 108 | * face :: 109 | * A handle to the input face. 110 | * 111 | * left :: 112 | * Index of the left glyph. 113 | * 114 | * right :: 115 | * Index of the right glyph. 116 | * 117 | * @output: 118 | * avector :: 119 | * A kerning vector. 120 | * 121 | * @return: 122 | * FreeType error code. 0~means success. 123 | * 124 | * @note: 125 | * This function always return distances in original PFR metrics units. 126 | * This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED mode, 127 | * which always returns distances converted to outline units. 128 | * 129 | * You can use the value of the `x_scale` and `y_scale` parameters 130 | * returned by @FT_Get_PFR_Metrics to scale these to device subpixels. 131 | */ 132 | FT_EXPORT( FT_Error ) 133 | FT_Get_PFR_Kerning( FT_Face face, 134 | FT_UInt left, 135 | FT_UInt right, 136 | FT_Vector *avector ); 137 | 138 | 139 | /************************************************************************** 140 | * 141 | * @function: 142 | * FT_Get_PFR_Advance 143 | * 144 | * @description: 145 | * Return a given glyph advance, expressed in original metrics units, 146 | * from a PFR font. 147 | * 148 | * @input: 149 | * face :: 150 | * A handle to the input face. 151 | * 152 | * gindex :: 153 | * The glyph index. 154 | * 155 | * @output: 156 | * aadvance :: 157 | * The glyph advance in metrics units. 158 | * 159 | * @return: 160 | * FreeType error code. 0~means success. 161 | * 162 | * @note: 163 | * You can use the `x_scale` or `y_scale` results of @FT_Get_PFR_Metrics 164 | * to convert the advance to device subpixels (i.e., 1/64 of pixels). 165 | */ 166 | FT_EXPORT( FT_Error ) 167 | FT_Get_PFR_Advance( FT_Face face, 168 | FT_UInt gindex, 169 | FT_Pos *aadvance ); 170 | 171 | /* */ 172 | 173 | 174 | FT_END_HEADER 175 | 176 | #endif /* FTPFR_H_ */ 177 | 178 | 179 | /* END */ 180 | -------------------------------------------------------------------------------- /include/freetype/ftrender.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftrender.h 4 | * 5 | * FreeType renderer modules public interface (specification). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTRENDER_H_ 20 | #define FTRENDER_H_ 21 | 22 | 23 | #include 24 | #include 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | /************************************************************************** 31 | * 32 | * @section: 33 | * module_management 34 | * 35 | */ 36 | 37 | 38 | /* create a new glyph object */ 39 | typedef FT_Error 40 | (*FT_Glyph_InitFunc)( FT_Glyph glyph, 41 | FT_GlyphSlot slot ); 42 | 43 | /* destroys a given glyph object */ 44 | typedef void 45 | (*FT_Glyph_DoneFunc)( FT_Glyph glyph ); 46 | 47 | typedef void 48 | (*FT_Glyph_TransformFunc)( FT_Glyph glyph, 49 | const FT_Matrix* matrix, 50 | const FT_Vector* delta ); 51 | 52 | typedef void 53 | (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph, 54 | FT_BBox* abbox ); 55 | 56 | typedef FT_Error 57 | (*FT_Glyph_CopyFunc)( FT_Glyph source, 58 | FT_Glyph target ); 59 | 60 | typedef FT_Error 61 | (*FT_Glyph_PrepareFunc)( FT_Glyph glyph, 62 | FT_GlyphSlot slot ); 63 | 64 | /* deprecated */ 65 | #define FT_Glyph_Init_Func FT_Glyph_InitFunc 66 | #define FT_Glyph_Done_Func FT_Glyph_DoneFunc 67 | #define FT_Glyph_Transform_Func FT_Glyph_TransformFunc 68 | #define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc 69 | #define FT_Glyph_Copy_Func FT_Glyph_CopyFunc 70 | #define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc 71 | 72 | 73 | struct FT_Glyph_Class_ 74 | { 75 | FT_Long glyph_size; 76 | FT_Glyph_Format glyph_format; 77 | 78 | FT_Glyph_InitFunc glyph_init; 79 | FT_Glyph_DoneFunc glyph_done; 80 | FT_Glyph_CopyFunc glyph_copy; 81 | FT_Glyph_TransformFunc glyph_transform; 82 | FT_Glyph_GetBBoxFunc glyph_bbox; 83 | FT_Glyph_PrepareFunc glyph_prepare; 84 | }; 85 | 86 | 87 | typedef FT_Error 88 | (*FT_Renderer_RenderFunc)( FT_Renderer renderer, 89 | FT_GlyphSlot slot, 90 | FT_Render_Mode mode, 91 | const FT_Vector* origin ); 92 | 93 | typedef FT_Error 94 | (*FT_Renderer_TransformFunc)( FT_Renderer renderer, 95 | FT_GlyphSlot slot, 96 | const FT_Matrix* matrix, 97 | const FT_Vector* delta ); 98 | 99 | 100 | typedef void 101 | (*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer, 102 | FT_GlyphSlot slot, 103 | FT_BBox* cbox ); 104 | 105 | 106 | typedef FT_Error 107 | (*FT_Renderer_SetModeFunc)( FT_Renderer renderer, 108 | FT_ULong mode_tag, 109 | FT_Pointer mode_ptr ); 110 | 111 | /* deprecated identifiers */ 112 | #define FTRenderer_render FT_Renderer_RenderFunc 113 | #define FTRenderer_transform FT_Renderer_TransformFunc 114 | #define FTRenderer_getCBox FT_Renderer_GetCBoxFunc 115 | #define FTRenderer_setMode FT_Renderer_SetModeFunc 116 | 117 | 118 | /************************************************************************** 119 | * 120 | * @struct: 121 | * FT_Renderer_Class 122 | * 123 | * @description: 124 | * The renderer module class descriptor. 125 | * 126 | * @fields: 127 | * root :: 128 | * The root @FT_Module_Class fields. 129 | * 130 | * glyph_format :: 131 | * The glyph image format this renderer handles. 132 | * 133 | * render_glyph :: 134 | * A method used to render the image that is in a given glyph slot into 135 | * a bitmap. 136 | * 137 | * transform_glyph :: 138 | * A method used to transform the image that is in a given glyph slot. 139 | * 140 | * get_glyph_cbox :: 141 | * A method used to access the glyph's cbox. 142 | * 143 | * set_mode :: 144 | * A method used to pass additional parameters. 145 | * 146 | * raster_class :: 147 | * For @FT_GLYPH_FORMAT_OUTLINE renderers only. This is a pointer to 148 | * its raster's class. 149 | */ 150 | typedef struct FT_Renderer_Class_ 151 | { 152 | FT_Module_Class root; 153 | 154 | FT_Glyph_Format glyph_format; 155 | 156 | FT_Renderer_RenderFunc render_glyph; 157 | FT_Renderer_TransformFunc transform_glyph; 158 | FT_Renderer_GetCBoxFunc get_glyph_cbox; 159 | FT_Renderer_SetModeFunc set_mode; 160 | 161 | FT_Raster_Funcs* raster_class; 162 | 163 | } FT_Renderer_Class; 164 | 165 | 166 | /************************************************************************** 167 | * 168 | * @function: 169 | * FT_Get_Renderer 170 | * 171 | * @description: 172 | * Retrieve the current renderer for a given glyph format. 173 | * 174 | * @input: 175 | * library :: 176 | * A handle to the library object. 177 | * 178 | * format :: 179 | * The glyph format. 180 | * 181 | * @return: 182 | * A renderer handle. 0~if none found. 183 | * 184 | * @note: 185 | * An error will be returned if a module already exists by that name, or 186 | * if the module requires a version of FreeType that is too great. 187 | * 188 | * To add a new renderer, simply use @FT_Add_Module. To retrieve a 189 | * renderer by its name, use @FT_Get_Module. 190 | */ 191 | FT_EXPORT( FT_Renderer ) 192 | FT_Get_Renderer( FT_Library library, 193 | FT_Glyph_Format format ); 194 | 195 | 196 | /************************************************************************** 197 | * 198 | * @function: 199 | * FT_Set_Renderer 200 | * 201 | * @description: 202 | * Set the current renderer to use, and set additional mode. 203 | * 204 | * @inout: 205 | * library :: 206 | * A handle to the library object. 207 | * 208 | * @input: 209 | * renderer :: 210 | * A handle to the renderer object. 211 | * 212 | * num_params :: 213 | * The number of additional parameters. 214 | * 215 | * parameters :: 216 | * Additional parameters. 217 | * 218 | * @return: 219 | * FreeType error code. 0~means success. 220 | * 221 | * @note: 222 | * In case of success, the renderer will be used to convert glyph images 223 | * in the renderer's known format into bitmaps. 224 | * 225 | * This doesn't change the current renderer for other formats. 226 | * 227 | * Currently, no FreeType renderer module uses `parameters`; you should 228 | * thus always pass `NULL` as the value. 229 | */ 230 | FT_EXPORT( FT_Error ) 231 | FT_Set_Renderer( FT_Library library, 232 | FT_Renderer renderer, 233 | FT_UInt num_params, 234 | FT_Parameter* parameters ); 235 | 236 | /* */ 237 | 238 | 239 | FT_END_HEADER 240 | 241 | #endif /* FTRENDER_H_ */ 242 | 243 | 244 | /* END */ 245 | -------------------------------------------------------------------------------- /include/freetype/ftsizes.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftsizes.h 4 | * 5 | * FreeType size objects management (specification). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /************************************************************************** 20 | * 21 | * Typical application would normally not need to use these functions. 22 | * However, they have been placed in a public API for the rare cases where 23 | * they are needed. 24 | * 25 | */ 26 | 27 | 28 | #ifndef FTSIZES_H_ 29 | #define FTSIZES_H_ 30 | 31 | 32 | #include 33 | 34 | #ifdef FREETYPE_H 35 | #error "freetype.h of FreeType 1 has been loaded!" 36 | #error "Please fix the directory search order for header files" 37 | #error "so that freetype.h of FreeType 2 is found first." 38 | #endif 39 | 40 | 41 | FT_BEGIN_HEADER 42 | 43 | 44 | /************************************************************************** 45 | * 46 | * @section: 47 | * sizes_management 48 | * 49 | * @title: 50 | * Size Management 51 | * 52 | * @abstract: 53 | * Managing multiple sizes per face. 54 | * 55 | * @description: 56 | * When creating a new face object (e.g., with @FT_New_Face), an @FT_Size 57 | * object is automatically created and used to store all pixel-size 58 | * dependent information, available in the `face->size` field. 59 | * 60 | * It is however possible to create more sizes for a given face, mostly 61 | * in order to manage several character pixel sizes of the same font 62 | * family and style. See @FT_New_Size and @FT_Done_Size. 63 | * 64 | * Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only modify the 65 | * contents of the current 'active' size; you thus need to use 66 | * @FT_Activate_Size to change it. 67 | * 68 | * 99% of applications won't need the functions provided here, especially 69 | * if they use the caching sub-system, so be cautious when using these. 70 | * 71 | */ 72 | 73 | 74 | /************************************************************************** 75 | * 76 | * @function: 77 | * FT_New_Size 78 | * 79 | * @description: 80 | * Create a new size object from a given face object. 81 | * 82 | * @input: 83 | * face :: 84 | * A handle to a parent face object. 85 | * 86 | * @output: 87 | * asize :: 88 | * A handle to a new size object. 89 | * 90 | * @return: 91 | * FreeType error code. 0~means success. 92 | * 93 | * @note: 94 | * You need to call @FT_Activate_Size in order to select the new size for 95 | * upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, 96 | * @FT_Load_Glyph, @FT_Load_Char, etc. 97 | */ 98 | FT_EXPORT( FT_Error ) 99 | FT_New_Size( FT_Face face, 100 | FT_Size* size ); 101 | 102 | 103 | /************************************************************************** 104 | * 105 | * @function: 106 | * FT_Done_Size 107 | * 108 | * @description: 109 | * Discard a given size object. Note that @FT_Done_Face automatically 110 | * discards all size objects allocated with @FT_New_Size. 111 | * 112 | * @input: 113 | * size :: 114 | * A handle to a target size object. 115 | * 116 | * @return: 117 | * FreeType error code. 0~means success. 118 | */ 119 | FT_EXPORT( FT_Error ) 120 | FT_Done_Size( FT_Size size ); 121 | 122 | 123 | /************************************************************************** 124 | * 125 | * @function: 126 | * FT_Activate_Size 127 | * 128 | * @description: 129 | * Even though it is possible to create several size objects for a given 130 | * face (see @FT_New_Size for details), functions like @FT_Load_Glyph or 131 | * @FT_Load_Char only use the one that has been activated last to 132 | * determine the 'current character pixel size'. 133 | * 134 | * This function can be used to 'activate' a previously created size 135 | * object. 136 | * 137 | * @input: 138 | * size :: 139 | * A handle to a target size object. 140 | * 141 | * @return: 142 | * FreeType error code. 0~means success. 143 | * 144 | * @note: 145 | * If `face` is the size's parent face object, this function changes the 146 | * value of `face->size` to the input size handle. 147 | */ 148 | FT_EXPORT( FT_Error ) 149 | FT_Activate_Size( FT_Size size ); 150 | 151 | /* */ 152 | 153 | 154 | FT_END_HEADER 155 | 156 | #endif /* FTSIZES_H_ */ 157 | 158 | 159 | /* END */ 160 | -------------------------------------------------------------------------------- /include/freetype/ftsynth.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftsynth.h 4 | * 5 | * FreeType synthesizing code for emboldening and slanting 6 | * (specification). 7 | * 8 | * Copyright (C) 2000-2023 by 9 | * David Turner, Robert Wilhelm, and Werner Lemberg. 10 | * 11 | * This file is part of the FreeType project, and may only be used, 12 | * modified, and distributed under the terms of the FreeType project 13 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 14 | * this file you indicate that you have read the license and 15 | * understand and accept it fully. 16 | * 17 | */ 18 | 19 | 20 | /*************************************************************************/ 21 | /*************************************************************************/ 22 | /*************************************************************************/ 23 | /*************************************************************************/ 24 | /*************************************************************************/ 25 | /********* *********/ 26 | /********* WARNING, THIS IS ALPHA CODE! THIS API *********/ 27 | /********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/ 28 | /********* FREETYPE DEVELOPMENT TEAM *********/ 29 | /********* *********/ 30 | /*************************************************************************/ 31 | /*************************************************************************/ 32 | /*************************************************************************/ 33 | /*************************************************************************/ 34 | /*************************************************************************/ 35 | 36 | 37 | /* Main reason for not lifting the functions in this module to a */ 38 | /* 'standard' API is that the used parameters for emboldening and */ 39 | /* slanting are not configurable. Consider the functions as a */ 40 | /* code resource that should be copied into the application and */ 41 | /* adapted to the particular needs. */ 42 | 43 | 44 | #ifndef FTSYNTH_H_ 45 | #define FTSYNTH_H_ 46 | 47 | 48 | #include 49 | 50 | #ifdef FREETYPE_H 51 | #error "freetype.h of FreeType 1 has been loaded!" 52 | #error "Please fix the directory search order for header files" 53 | #error "so that freetype.h of FreeType 2 is found first." 54 | #endif 55 | 56 | 57 | FT_BEGIN_HEADER 58 | 59 | /* Embolden a glyph by a 'reasonable' value (which is highly a matter of */ 60 | /* taste). This function is actually a convenience function, providing */ 61 | /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */ 62 | /* */ 63 | /* For emboldened outlines the height, width, and advance metrics are */ 64 | /* increased by the strength of the emboldening -- this even affects */ 65 | /* mono-width fonts! */ 66 | /* */ 67 | /* You can also call @FT_Outline_Get_CBox to get precise values. */ 68 | FT_EXPORT( void ) 69 | FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); 70 | 71 | /* Slant an outline glyph to the right by about 12 degrees. */ 72 | FT_EXPORT( void ) 73 | FT_GlyphSlot_Oblique( FT_GlyphSlot slot ); 74 | 75 | /* Slant an outline glyph by a given sine of an angle. You can apply */ 76 | /* slant along either x- or y-axis by choosing a corresponding non-zero */ 77 | /* argument. If both slants are non-zero, some affine transformation */ 78 | /* will result. */ 79 | FT_EXPORT( void ) 80 | FT_GlyphSlot_Slant( FT_GlyphSlot slot, 81 | FT_Fixed xslant, 82 | FT_Fixed yslant ); 83 | 84 | /* */ 85 | 86 | 87 | FT_END_HEADER 88 | 89 | #endif /* FTSYNTH_H_ */ 90 | 91 | 92 | /* END */ 93 | -------------------------------------------------------------------------------- /include/freetype/internal/autohint.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * autohint.h 4 | * 5 | * High-level 'autohint' module-specific interface (specification). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /************************************************************************** 20 | * 21 | * The auto-hinter is used to load and automatically hint glyphs if a 22 | * format-specific hinter isn't available. 23 | * 24 | */ 25 | 26 | 27 | #ifndef AUTOHINT_H_ 28 | #define AUTOHINT_H_ 29 | 30 | 31 | /************************************************************************** 32 | * 33 | * A small technical note regarding automatic hinting in order to clarify 34 | * this module interface. 35 | * 36 | * An automatic hinter might compute two kinds of data for a given face: 37 | * 38 | * - global hints: Usually some metrics that describe global properties 39 | * of the face. It is computed by scanning more or less 40 | * aggressively the glyphs in the face, and thus can be 41 | * very slow to compute (even if the size of global hints 42 | * is really small). 43 | * 44 | * - glyph hints: These describe some important features of the glyph 45 | * outline, as well as how to align them. They are 46 | * generally much faster to compute than global hints. 47 | * 48 | * The current FreeType auto-hinter does a pretty good job while performing 49 | * fast computations for both global and glyph hints. However, we might be 50 | * interested in introducing more complex and powerful algorithms in the 51 | * future, like the one described in the John D. Hobby paper, which 52 | * unfortunately requires a lot more horsepower. 53 | * 54 | * Because a sufficiently sophisticated font management system would 55 | * typically implement an LRU cache of opened face objects to reduce memory 56 | * usage, it is a good idea to be able to avoid recomputing global hints 57 | * every time the same face is re-opened. 58 | * 59 | * We thus provide the ability to cache global hints outside of the face 60 | * object, in order to speed up font re-opening time. Of course, this 61 | * feature is purely optional, so most client programs won't even notice 62 | * it. 63 | * 64 | * I initially thought that it would be a good idea to cache the glyph 65 | * hints too. However, my general idea now is that if you really need to 66 | * cache these too, you are simply in need of a new font format, where all 67 | * this information could be stored within the font file and decoded on the 68 | * fly. 69 | * 70 | */ 71 | 72 | 73 | #include 74 | 75 | 76 | FT_BEGIN_HEADER 77 | 78 | 79 | typedef struct FT_AutoHinterRec_ *FT_AutoHinter; 80 | 81 | 82 | /************************************************************************** 83 | * 84 | * @functype: 85 | * FT_AutoHinter_GlobalGetFunc 86 | * 87 | * @description: 88 | * Retrieve the global hints computed for a given face object. The 89 | * resulting data is dissociated from the face and will survive a call to 90 | * FT_Done_Face(). It must be discarded through the API 91 | * FT_AutoHinter_GlobalDoneFunc(). 92 | * 93 | * @input: 94 | * hinter :: 95 | * A handle to the source auto-hinter. 96 | * 97 | * face :: 98 | * A handle to the source face object. 99 | * 100 | * @output: 101 | * global_hints :: 102 | * A typeless pointer to the global hints. 103 | * 104 | * global_len :: 105 | * The size in bytes of the global hints. 106 | */ 107 | typedef void 108 | (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter hinter, 109 | FT_Face face, 110 | void** global_hints, 111 | long* global_len ); 112 | 113 | 114 | /************************************************************************** 115 | * 116 | * @functype: 117 | * FT_AutoHinter_GlobalDoneFunc 118 | * 119 | * @description: 120 | * Discard the global hints retrieved through 121 | * FT_AutoHinter_GlobalGetFunc(). This is the only way these hints are 122 | * freed from memory. 123 | * 124 | * @input: 125 | * hinter :: 126 | * A handle to the auto-hinter module. 127 | * 128 | * global :: 129 | * A pointer to retrieved global hints to discard. 130 | */ 131 | typedef void 132 | (*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter hinter, 133 | void* global ); 134 | 135 | 136 | /************************************************************************** 137 | * 138 | * @functype: 139 | * FT_AutoHinter_GlobalResetFunc 140 | * 141 | * @description: 142 | * This function is used to recompute the global metrics in a given font. 143 | * This is useful when global font data changes (e.g. Multiple Masters 144 | * fonts where blend coordinates change). 145 | * 146 | * @input: 147 | * hinter :: 148 | * A handle to the source auto-hinter. 149 | * 150 | * face :: 151 | * A handle to the face. 152 | */ 153 | typedef void 154 | (*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter hinter, 155 | FT_Face face ); 156 | 157 | 158 | /************************************************************************** 159 | * 160 | * @functype: 161 | * FT_AutoHinter_GlyphLoadFunc 162 | * 163 | * @description: 164 | * This function is used to load, scale, and automatically hint a glyph 165 | * from a given face. 166 | * 167 | * @input: 168 | * face :: 169 | * A handle to the face. 170 | * 171 | * glyph_index :: 172 | * The glyph index. 173 | * 174 | * load_flags :: 175 | * The load flags. 176 | * 177 | * @note: 178 | * This function is capable of loading composite glyphs by hinting each 179 | * sub-glyph independently (which improves quality). 180 | * 181 | * It will call the font driver with @FT_Load_Glyph, with 182 | * @FT_LOAD_NO_SCALE set. 183 | */ 184 | typedef FT_Error 185 | (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter hinter, 186 | FT_GlyphSlot slot, 187 | FT_Size size, 188 | FT_UInt glyph_index, 189 | FT_Int32 load_flags ); 190 | 191 | 192 | /************************************************************************** 193 | * 194 | * @struct: 195 | * FT_AutoHinter_InterfaceRec 196 | * 197 | * @description: 198 | * The auto-hinter module's interface. 199 | */ 200 | typedef struct FT_AutoHinter_InterfaceRec_ 201 | { 202 | FT_AutoHinter_GlobalResetFunc reset_face; 203 | FT_AutoHinter_GlobalGetFunc get_global_hints; 204 | FT_AutoHinter_GlobalDoneFunc done_global_hints; 205 | FT_AutoHinter_GlyphLoadFunc load_glyph; 206 | 207 | } FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface; 208 | 209 | 210 | #define FT_DECLARE_AUTOHINTER_INTERFACE( class_ ) \ 211 | FT_CALLBACK_TABLE const FT_AutoHinter_InterfaceRec class_; 212 | 213 | #define FT_DEFINE_AUTOHINTER_INTERFACE( \ 214 | class_, \ 215 | reset_face_, \ 216 | get_global_hints_, \ 217 | done_global_hints_, \ 218 | load_glyph_ ) \ 219 | FT_CALLBACK_TABLE_DEF \ 220 | const FT_AutoHinter_InterfaceRec class_ = \ 221 | { \ 222 | reset_face_, \ 223 | get_global_hints_, \ 224 | done_global_hints_, \ 225 | load_glyph_ \ 226 | }; 227 | 228 | 229 | FT_END_HEADER 230 | 231 | #endif /* AUTOHINT_H_ */ 232 | 233 | 234 | /* END */ 235 | -------------------------------------------------------------------------------- /include/freetype/internal/cffotypes.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * cffotypes.h 4 | * 5 | * Basic OpenType/CFF object type definitions (specification). 6 | * 7 | * Copyright (C) 2017-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef CFFOTYPES_H_ 20 | #define CFFOTYPES_H_ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | 29 | FT_BEGIN_HEADER 30 | 31 | 32 | typedef TT_Face CFF_Face; 33 | 34 | 35 | /************************************************************************** 36 | * 37 | * @type: 38 | * CFF_Size 39 | * 40 | * @description: 41 | * A handle to an OpenType size object. 42 | */ 43 | typedef struct CFF_SizeRec_ 44 | { 45 | FT_SizeRec root; 46 | FT_ULong strike_index; /* 0xFFFFFFFF to indicate invalid */ 47 | 48 | } CFF_SizeRec, *CFF_Size; 49 | 50 | 51 | /************************************************************************** 52 | * 53 | * @type: 54 | * CFF_GlyphSlot 55 | * 56 | * @description: 57 | * A handle to an OpenType glyph slot object. 58 | */ 59 | typedef struct CFF_GlyphSlotRec_ 60 | { 61 | FT_GlyphSlotRec root; 62 | 63 | FT_Bool hint; 64 | FT_Bool scaled; 65 | 66 | FT_Fixed x_scale; 67 | FT_Fixed y_scale; 68 | 69 | } CFF_GlyphSlotRec, *CFF_GlyphSlot; 70 | 71 | 72 | /************************************************************************** 73 | * 74 | * @type: 75 | * CFF_Internal 76 | * 77 | * @description: 78 | * The interface to the 'internal' field of `FT_Size`. 79 | */ 80 | typedef struct CFF_InternalRec_ 81 | { 82 | PSH_Globals topfont; 83 | PSH_Globals subfonts[CFF_MAX_CID_FONTS]; 84 | 85 | } CFF_InternalRec, *CFF_Internal; 86 | 87 | 88 | /************************************************************************** 89 | * 90 | * Subglyph transformation record. 91 | */ 92 | typedef struct CFF_Transform_ 93 | { 94 | FT_Fixed xx, xy; /* transformation matrix coefficients */ 95 | FT_Fixed yx, yy; 96 | FT_F26Dot6 ox, oy; /* offsets */ 97 | 98 | } CFF_Transform; 99 | 100 | 101 | FT_END_HEADER 102 | 103 | 104 | #endif /* CFFOTYPES_H_ */ 105 | 106 | 107 | /* END */ 108 | -------------------------------------------------------------------------------- /include/freetype/internal/ftgloadr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftgloadr.h 4 | * 5 | * The FreeType glyph loader (specification). 6 | * 7 | * Copyright (C) 2002-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTGLOADR_H_ 20 | #define FTGLOADR_H_ 21 | 22 | 23 | #include 24 | 25 | #include "compiler-macros.h" 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | /************************************************************************** 31 | * 32 | * @struct: 33 | * FT_GlyphLoader 34 | * 35 | * @description: 36 | * The glyph loader is an internal object used to load several glyphs 37 | * together (for example, in the case of composites). 38 | */ 39 | typedef struct FT_SubGlyphRec_ 40 | { 41 | FT_Int index; 42 | FT_UShort flags; 43 | FT_Int arg1; 44 | FT_Int arg2; 45 | FT_Matrix transform; 46 | 47 | } FT_SubGlyphRec; 48 | 49 | 50 | typedef struct FT_GlyphLoadRec_ 51 | { 52 | FT_Outline outline; /* outline */ 53 | FT_Vector* extra_points; /* extra points table */ 54 | FT_Vector* extra_points2; /* second extra points table */ 55 | FT_UInt num_subglyphs; /* number of subglyphs */ 56 | FT_SubGlyph subglyphs; /* subglyphs */ 57 | 58 | } FT_GlyphLoadRec, *FT_GlyphLoad; 59 | 60 | 61 | typedef struct FT_GlyphLoaderRec_ 62 | { 63 | FT_Memory memory; 64 | FT_UInt max_points; 65 | FT_UInt max_contours; 66 | FT_UInt max_subglyphs; 67 | FT_Bool use_extra; 68 | 69 | FT_GlyphLoadRec base; 70 | FT_GlyphLoadRec current; 71 | 72 | void* other; /* for possible future extension? */ 73 | 74 | } FT_GlyphLoaderRec, *FT_GlyphLoader; 75 | 76 | 77 | /* create new empty glyph loader */ 78 | FT_BASE( FT_Error ) 79 | FT_GlyphLoader_New( FT_Memory memory, 80 | FT_GlyphLoader *aloader ); 81 | 82 | /* add an extra points table to a glyph loader */ 83 | FT_BASE( FT_Error ) 84 | FT_GlyphLoader_CreateExtra( FT_GlyphLoader loader ); 85 | 86 | /* destroy a glyph loader */ 87 | FT_BASE( void ) 88 | FT_GlyphLoader_Done( FT_GlyphLoader loader ); 89 | 90 | /* reset a glyph loader (frees everything int it) */ 91 | FT_BASE( void ) 92 | FT_GlyphLoader_Reset( FT_GlyphLoader loader ); 93 | 94 | /* rewind a glyph loader */ 95 | FT_BASE( void ) 96 | FT_GlyphLoader_Rewind( FT_GlyphLoader loader ); 97 | 98 | /* check that there is enough space to add `n_points' and `n_contours' */ 99 | /* to the glyph loader */ 100 | FT_BASE( FT_Error ) 101 | FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader, 102 | FT_UInt n_points, 103 | FT_UInt n_contours ); 104 | 105 | 106 | #define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \ 107 | ( (_count) == 0 || \ 108 | ( (FT_UInt)(_loader)->base.outline.n_points + \ 109 | (FT_UInt)(_loader)->current.outline.n_points + \ 110 | (FT_UInt)(_count) ) <= (_loader)->max_points ) 111 | 112 | #define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \ 113 | ( (_count) == 0 || \ 114 | ( (FT_UInt)(_loader)->base.outline.n_contours + \ 115 | (FT_UInt)(_loader)->current.outline.n_contours + \ 116 | (FT_UInt)(_count) ) <= (_loader)->max_contours ) 117 | 118 | #define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points, _contours ) \ 119 | ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \ 120 | FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \ 121 | ? 0 \ 122 | : FT_GlyphLoader_CheckPoints( (_loader), \ 123 | (FT_UInt)(_points), \ 124 | (FT_UInt)(_contours) ) ) 125 | 126 | 127 | /* check that there is enough space to add `n_subs' sub-glyphs to */ 128 | /* a glyph loader */ 129 | FT_BASE( FT_Error ) 130 | FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader, 131 | FT_UInt n_subs ); 132 | 133 | /* prepare a glyph loader, i.e. empty the current glyph */ 134 | FT_BASE( void ) 135 | FT_GlyphLoader_Prepare( FT_GlyphLoader loader ); 136 | 137 | /* add the current glyph to the base glyph */ 138 | FT_BASE( void ) 139 | FT_GlyphLoader_Add( FT_GlyphLoader loader ); 140 | 141 | 142 | FT_END_HEADER 143 | 144 | #endif /* FTGLOADR_H_ */ 145 | 146 | 147 | /* END */ 148 | -------------------------------------------------------------------------------- /include/freetype/internal/fthash.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * fthash.h 4 | * 5 | * Hashing functions (specification). 6 | * 7 | */ 8 | 9 | /* 10 | * Copyright 2000 Computing Research Labs, New Mexico State University 11 | * Copyright 2001-2015 12 | * Francesco Zappa Nardelli 13 | * 14 | * Permission is hereby granted, free of charge, to any person obtaining a 15 | * copy of this software and associated documentation files (the "Software"), 16 | * to deal in the Software without restriction, including without limitation 17 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | * and/or sell copies of the Software, and to permit persons to whom the 19 | * Software is furnished to do so, subject to the following conditions: 20 | * 21 | * The above copyright notice and this permission notice shall be included in 22 | * all copies or substantial portions of the Software. 23 | * 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 27 | * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY 28 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 29 | * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR 30 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | */ 32 | 33 | /************************************************************************** 34 | * 35 | * This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50 36 | * 37 | * taken from Mark Leisher's xmbdfed package 38 | * 39 | */ 40 | 41 | 42 | #ifndef FTHASH_H_ 43 | #define FTHASH_H_ 44 | 45 | 46 | #include 47 | 48 | 49 | FT_BEGIN_HEADER 50 | 51 | 52 | typedef union FT_Hashkey_ 53 | { 54 | FT_Int num; 55 | const char* str; 56 | 57 | } FT_Hashkey; 58 | 59 | 60 | typedef struct FT_HashnodeRec_ 61 | { 62 | FT_Hashkey key; 63 | size_t data; 64 | 65 | } FT_HashnodeRec; 66 | 67 | typedef struct FT_HashnodeRec_ *FT_Hashnode; 68 | 69 | 70 | typedef FT_ULong 71 | (*FT_Hash_LookupFunc)( FT_Hashkey* key ); 72 | 73 | typedef FT_Bool 74 | (*FT_Hash_CompareFunc)( FT_Hashkey* a, 75 | FT_Hashkey* b ); 76 | 77 | 78 | typedef struct FT_HashRec_ 79 | { 80 | FT_UInt limit; 81 | FT_UInt size; 82 | FT_UInt used; 83 | 84 | FT_Hash_LookupFunc lookup; 85 | FT_Hash_CompareFunc compare; 86 | 87 | FT_Hashnode* table; 88 | 89 | } FT_HashRec; 90 | 91 | typedef struct FT_HashRec_ *FT_Hash; 92 | 93 | 94 | FT_Error 95 | ft_hash_str_init( FT_Hash hash, 96 | FT_Memory memory ); 97 | 98 | FT_Error 99 | ft_hash_num_init( FT_Hash hash, 100 | FT_Memory memory ); 101 | 102 | void 103 | ft_hash_str_free( FT_Hash hash, 104 | FT_Memory memory ); 105 | 106 | #define ft_hash_num_free ft_hash_str_free 107 | 108 | FT_Error 109 | ft_hash_str_insert( const char* key, 110 | size_t data, 111 | FT_Hash hash, 112 | FT_Memory memory ); 113 | 114 | FT_Error 115 | ft_hash_num_insert( FT_Int num, 116 | size_t data, 117 | FT_Hash hash, 118 | FT_Memory memory ); 119 | 120 | size_t* 121 | ft_hash_str_lookup( const char* key, 122 | FT_Hash hash ); 123 | 124 | size_t* 125 | ft_hash_num_lookup( FT_Int num, 126 | FT_Hash hash ); 127 | 128 | 129 | FT_END_HEADER 130 | 131 | 132 | #endif /* FTHASH_H_ */ 133 | 134 | 135 | /* END */ 136 | -------------------------------------------------------------------------------- /include/freetype/internal/ftmmtypes.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftmmtypes.h 4 | * 5 | * OpenType Variations type definitions for internal use 6 | * with the multi-masters service (specification). 7 | * 8 | * Copyright (C) 2022-2023 by 9 | * David Turner, Robert Wilhelm, Werner Lemberg, George Williams, and 10 | * Dominik Röttsches. 11 | * 12 | * This file is part of the FreeType project, and may only be used, 13 | * modified, and distributed under the terms of the FreeType project 14 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 15 | * this file you indicate that you have read the license and 16 | * understand and accept it fully. 17 | * 18 | */ 19 | 20 | 21 | #ifndef FTMMTYPES_H_ 22 | #define FTMMTYPES_H_ 23 | 24 | FT_BEGIN_HEADER 25 | 26 | 27 | typedef FT_Int32 FT_ItemVarDelta; 28 | 29 | typedef struct GX_ItemVarDataRec_ 30 | { 31 | FT_UInt itemCount; /* number of delta sets per item */ 32 | FT_UInt regionIdxCount; /* number of region indices */ 33 | FT_UInt* regionIndices; /* array of `regionCount' indices; */ 34 | /* these index `varRegionList' */ 35 | FT_ItemVarDelta* deltaSet; /* array of `itemCount' deltas */ 36 | /* use `innerIndex' for this array */ 37 | 38 | } GX_ItemVarDataRec, *GX_ItemVarData; 39 | 40 | 41 | /* contribution of one axis to a region */ 42 | typedef struct GX_AxisCoordsRec_ 43 | { 44 | FT_Fixed startCoord; 45 | FT_Fixed peakCoord; /* zero means no effect (factor = 1) */ 46 | FT_Fixed endCoord; 47 | 48 | } GX_AxisCoordsRec, *GX_AxisCoords; 49 | 50 | 51 | typedef struct GX_VarRegionRec_ 52 | { 53 | GX_AxisCoords axisList; /* array of axisCount records */ 54 | 55 | } GX_VarRegionRec, *GX_VarRegion; 56 | 57 | 58 | /* item variation store */ 59 | typedef struct GX_ItemVarStoreRec_ 60 | { 61 | FT_UInt dataCount; 62 | GX_ItemVarData varData; /* array of dataCount records; */ 63 | /* use `outerIndex' for this array */ 64 | FT_UShort axisCount; 65 | FT_UInt regionCount; /* total number of regions defined */ 66 | GX_VarRegion varRegionList; 67 | 68 | } GX_ItemVarStoreRec, *GX_ItemVarStore; 69 | 70 | 71 | typedef struct GX_DeltaSetIdxMapRec_ 72 | { 73 | FT_ULong mapCount; 74 | FT_UInt* outerIndex; /* indices to item var data */ 75 | FT_UInt* innerIndex; /* indices to delta set */ 76 | 77 | } GX_DeltaSetIdxMapRec, *GX_DeltaSetIdxMap; 78 | 79 | 80 | FT_END_HEADER 81 | 82 | #endif /* FTMMTYPES_H_ */ 83 | 84 | 85 | /* END */ 86 | -------------------------------------------------------------------------------- /include/freetype/internal/ftpsprop.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftpsprop.h 4 | * 5 | * Get and set properties of PostScript drivers (specification). 6 | * 7 | * Copyright (C) 2017-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTPSPROP_H_ 20 | #define FTPSPROP_H_ 21 | 22 | 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | FT_BASE_CALLBACK( FT_Error ) 30 | ps_property_set( FT_Module module, /* PS_Driver */ 31 | const char* property_name, 32 | const void* value, 33 | FT_Bool value_is_string ); 34 | 35 | FT_BASE_CALLBACK( FT_Error ) 36 | ps_property_get( FT_Module module, /* PS_Driver */ 37 | const char* property_name, 38 | void* value ); 39 | 40 | 41 | FT_END_HEADER 42 | 43 | 44 | #endif /* FTPSPROP_H_ */ 45 | 46 | 47 | /* END */ 48 | -------------------------------------------------------------------------------- /include/freetype/internal/fttrace.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * fttrace.h 4 | * 5 | * Tracing handling (specification only). 6 | * 7 | * Copyright (C) 2002-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /* definitions of trace levels for FreeType 2 */ 20 | 21 | /* the maximum string length (if the argument to `FT_TRACE_DEF` */ 22 | /* gets used as a string) plus one charachter for ':' plus */ 23 | /* another one for the trace level */ 24 | #define FT_MAX_TRACE_LEVEL_LENGTH (9 + 1 + 1) 25 | 26 | /* the first level must always be `trace_any' */ 27 | FT_TRACE_DEF( any ) 28 | 29 | /* base components */ 30 | FT_TRACE_DEF( calc ) /* calculations (ftcalc.c) */ 31 | FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.c) */ 32 | FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */ 33 | FT_TRACE_DEF( memory ) /* memory manager (ftobjs.c) */ 34 | FT_TRACE_DEF( init ) /* initialization (ftinit.c) */ 35 | FT_TRACE_DEF( io ) /* i/o interface (ftsystem.c) */ 36 | FT_TRACE_DEF( list ) /* list management (ftlist.c) */ 37 | FT_TRACE_DEF( objs ) /* base objects (ftobjs.c) */ 38 | FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */ 39 | FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */ 40 | 41 | FT_TRACE_DEF( bitmap ) /* bitmap manipulation (ftbitmap.c) */ 42 | FT_TRACE_DEF( checksum ) /* bitmap checksum (ftobjs.c) */ 43 | FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */ 44 | FT_TRACE_DEF( psprops ) /* PS driver properties (ftpsprop.c) */ 45 | FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */ 46 | FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */ 47 | 48 | /* rasterizers */ 49 | FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */ 50 | FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */ 51 | 52 | /* ot-svg module */ 53 | FT_TRACE_DEF( otsvg ) /* OT-SVG renderer (ftsvg.c) */ 54 | 55 | /* cache sub-system */ 56 | FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */ 57 | 58 | /* SFNT driver components */ 59 | FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */ 60 | FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */ 61 | FT_TRACE_DEF( sfwoff ) /* WOFF format handler (sfwoff.c) */ 62 | FT_TRACE_DEF( sfwoff2 ) /* WOFF2 format handler (sfwoff2.c) */ 63 | FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */ 64 | FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */ 65 | FT_TRACE_DEF( ttcolr ) /* glyph layer table (ttcolr.c) */ 66 | FT_TRACE_DEF( ttcpal ) /* color palette table (ttcpal.c) */ 67 | FT_TRACE_DEF( ttsvg ) /* OpenType SVG table (ttsvg.c) */ 68 | FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */ 69 | FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */ 70 | FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */ 71 | FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */ 72 | FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */ 73 | 74 | /* TrueType driver components */ 75 | FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */ 76 | FT_TRACE_DEF( ttgload ) /* TT glyph loader (ttgload.c) */ 77 | FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */ 78 | FT_TRACE_DEF( ttinterp ) /* bytecode interpreter (ttinterp.c) */ 79 | FT_TRACE_DEF( ttobjs ) /* TT objects manager (ttobjs.c) */ 80 | FT_TRACE_DEF( ttpload ) /* TT data/program loader (ttpload.c) */ 81 | 82 | /* Type 1 driver components */ 83 | FT_TRACE_DEF( t1afm ) 84 | FT_TRACE_DEF( t1driver ) 85 | FT_TRACE_DEF( t1gload ) 86 | FT_TRACE_DEF( t1load ) 87 | FT_TRACE_DEF( t1objs ) 88 | FT_TRACE_DEF( t1parse ) 89 | 90 | /* PostScript helper module `psaux' */ 91 | FT_TRACE_DEF( afmparse ) 92 | FT_TRACE_DEF( cffdecode ) 93 | FT_TRACE_DEF( psconv ) 94 | FT_TRACE_DEF( psobjs ) 95 | FT_TRACE_DEF( t1decode ) 96 | 97 | /* PostScript hinting module `pshinter' */ 98 | FT_TRACE_DEF( pshalgo ) 99 | FT_TRACE_DEF( pshrec ) 100 | 101 | /* Type 2 driver components */ 102 | FT_TRACE_DEF( cffdriver ) 103 | FT_TRACE_DEF( cffgload ) 104 | FT_TRACE_DEF( cffload ) 105 | FT_TRACE_DEF( cffobjs ) 106 | FT_TRACE_DEF( cffparse ) 107 | 108 | FT_TRACE_DEF( cf2blues ) 109 | FT_TRACE_DEF( cf2hints ) 110 | FT_TRACE_DEF( cf2interp ) 111 | 112 | /* Type 42 driver component */ 113 | FT_TRACE_DEF( t42 ) 114 | 115 | /* CID driver components */ 116 | FT_TRACE_DEF( ciddriver ) 117 | FT_TRACE_DEF( cidgload ) 118 | FT_TRACE_DEF( cidload ) 119 | FT_TRACE_DEF( cidobjs ) 120 | FT_TRACE_DEF( cidparse ) 121 | 122 | /* Windows font component */ 123 | FT_TRACE_DEF( winfnt ) 124 | 125 | /* PCF font components */ 126 | FT_TRACE_DEF( pcfdriver ) 127 | FT_TRACE_DEF( pcfread ) 128 | 129 | /* BDF font components */ 130 | FT_TRACE_DEF( bdfdriver ) 131 | FT_TRACE_DEF( bdflib ) 132 | 133 | /* PFR font component */ 134 | FT_TRACE_DEF( pfr ) 135 | 136 | /* OpenType validation components */ 137 | FT_TRACE_DEF( otvcommon ) 138 | FT_TRACE_DEF( otvbase ) 139 | FT_TRACE_DEF( otvgdef ) 140 | FT_TRACE_DEF( otvgpos ) 141 | FT_TRACE_DEF( otvgsub ) 142 | FT_TRACE_DEF( otvjstf ) 143 | FT_TRACE_DEF( otvmath ) 144 | FT_TRACE_DEF( otvmodule ) 145 | 146 | /* TrueTypeGX/AAT validation components */ 147 | FT_TRACE_DEF( gxvbsln ) 148 | FT_TRACE_DEF( gxvcommon ) 149 | FT_TRACE_DEF( gxvfeat ) 150 | FT_TRACE_DEF( gxvjust ) 151 | FT_TRACE_DEF( gxvkern ) 152 | FT_TRACE_DEF( gxvmodule ) 153 | FT_TRACE_DEF( gxvmort ) 154 | FT_TRACE_DEF( gxvmorx ) 155 | FT_TRACE_DEF( gxvlcar ) 156 | FT_TRACE_DEF( gxvopbd ) 157 | FT_TRACE_DEF( gxvprop ) 158 | FT_TRACE_DEF( gxvtrak ) 159 | 160 | /* autofit components */ 161 | FT_TRACE_DEF( afcjk ) 162 | FT_TRACE_DEF( afglobal ) 163 | FT_TRACE_DEF( afhints ) 164 | FT_TRACE_DEF( afmodule ) 165 | FT_TRACE_DEF( aflatin ) 166 | FT_TRACE_DEF( afshaper ) 167 | 168 | /* SDF components */ 169 | FT_TRACE_DEF( sdf ) /* signed distance raster for outlines (ftsdf.c) */ 170 | FT_TRACE_DEF( bsdf ) /* signed distance raster for bitmaps (ftbsdf.c) */ 171 | 172 | /* END */ 173 | -------------------------------------------------------------------------------- /include/freetype/internal/ftvalid.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ftvalid.h 4 | * 5 | * FreeType validation support (specification). 6 | * 7 | * Copyright (C) 2004-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef FTVALID_H_ 20 | #define FTVALID_H_ 21 | 22 | #include 23 | #include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_jmpbuf */ 24 | 25 | #include "compiler-macros.h" 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | /*************************************************************************/ 31 | /*************************************************************************/ 32 | /*************************************************************************/ 33 | /**** ****/ 34 | /**** ****/ 35 | /**** V A L I D A T I O N ****/ 36 | /**** ****/ 37 | /**** ****/ 38 | /*************************************************************************/ 39 | /*************************************************************************/ 40 | /*************************************************************************/ 41 | 42 | /* handle to a validation object */ 43 | typedef struct FT_ValidatorRec_ volatile* FT_Validator; 44 | 45 | 46 | /************************************************************************** 47 | * 48 | * There are three distinct validation levels defined here: 49 | * 50 | * FT_VALIDATE_DEFAULT :: 51 | * A table that passes this validation level can be used reliably by 52 | * FreeType. It generally means that all offsets have been checked to 53 | * prevent out-of-bound reads, that array counts are correct, etc. 54 | * 55 | * FT_VALIDATE_TIGHT :: 56 | * A table that passes this validation level can be used reliably and 57 | * doesn't contain invalid data. For example, a charmap table that 58 | * returns invalid glyph indices will not pass, even though it can be 59 | * used with FreeType in default mode (the library will simply return an 60 | * error later when trying to load the glyph). 61 | * 62 | * It also checks that fields which must be a multiple of 2, 4, or 8, 63 | * don't have incorrect values, etc. 64 | * 65 | * FT_VALIDATE_PARANOID :: 66 | * Only for font debugging. Checks that a table follows the 67 | * specification by 100%. Very few fonts will be able to pass this level 68 | * anyway but it can be useful for certain tools like font 69 | * editors/converters. 70 | */ 71 | typedef enum FT_ValidationLevel_ 72 | { 73 | FT_VALIDATE_DEFAULT = 0, 74 | FT_VALIDATE_TIGHT, 75 | FT_VALIDATE_PARANOID 76 | 77 | } FT_ValidationLevel; 78 | 79 | 80 | #if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */ 81 | /* We disable the warning `structure was padded due to */ 82 | /* __declspec(align())' in order to compile cleanly with */ 83 | /* the maximum level of warnings. */ 84 | #pragma warning( push ) 85 | #pragma warning( disable : 4324 ) 86 | #endif /* _MSC_VER */ 87 | 88 | /* validator structure */ 89 | typedef struct FT_ValidatorRec_ 90 | { 91 | ft_jmp_buf jump_buffer; /* used for exception handling */ 92 | 93 | const FT_Byte* base; /* address of table in memory */ 94 | const FT_Byte* limit; /* `base' + sizeof(table) in memory */ 95 | FT_ValidationLevel level; /* validation level */ 96 | FT_Error error; /* error returned. 0 means success */ 97 | 98 | } FT_ValidatorRec; 99 | 100 | #if defined( _MSC_VER ) 101 | #pragma warning( pop ) 102 | #endif 103 | 104 | #define FT_VALIDATOR( x ) ( (FT_Validator)( x ) ) 105 | 106 | 107 | FT_BASE( void ) 108 | ft_validator_init( FT_Validator valid, 109 | const FT_Byte* base, 110 | const FT_Byte* limit, 111 | FT_ValidationLevel level ); 112 | 113 | /* Do not use this. It's broken and will cause your validator to crash */ 114 | /* if you run it on an invalid font. */ 115 | FT_BASE( FT_Int ) 116 | ft_validator_run( FT_Validator valid ); 117 | 118 | /* Sets the error field in a validator, then calls `longjmp' to return */ 119 | /* to high-level caller. Using `setjmp/longjmp' avoids many stupid */ 120 | /* error checks within the validation routines. */ 121 | /* */ 122 | FT_BASE( void ) 123 | ft_validator_error( FT_Validator valid, 124 | FT_Error error ); 125 | 126 | 127 | /* Calls ft_validate_error. Assumes that the `valid' local variable */ 128 | /* holds a pointer to the current validator object. */ 129 | /* */ 130 | #define FT_INVALID( _error ) FT_INVALID_( _error ) 131 | #define FT_INVALID_( _error ) \ 132 | ft_validator_error( valid, FT_THROW( _error ) ) 133 | 134 | /* called when a broken table is detected */ 135 | #define FT_INVALID_TOO_SHORT \ 136 | FT_INVALID( Invalid_Table ) 137 | 138 | /* called when an invalid offset is detected */ 139 | #define FT_INVALID_OFFSET \ 140 | FT_INVALID( Invalid_Offset ) 141 | 142 | /* called when an invalid format/value is detected */ 143 | #define FT_INVALID_FORMAT \ 144 | FT_INVALID( Invalid_Table ) 145 | 146 | /* called when an invalid glyph index is detected */ 147 | #define FT_INVALID_GLYPH_ID \ 148 | FT_INVALID( Invalid_Glyph_Index ) 149 | 150 | /* called when an invalid field value is detected */ 151 | #define FT_INVALID_DATA \ 152 | FT_INVALID( Invalid_Table ) 153 | 154 | 155 | FT_END_HEADER 156 | 157 | #endif /* FTVALID_H_ */ 158 | 159 | 160 | /* END */ 161 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svbdf.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svbdf.h 4 | * 5 | * The FreeType BDF services (specification). 6 | * 7 | * Copyright (C) 2003-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVBDF_H_ 20 | #define SVBDF_H_ 21 | 22 | #include 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | #define FT_SERVICE_ID_BDF "bdf" 30 | 31 | typedef FT_Error 32 | (*FT_BDF_GetCharsetIdFunc)( FT_Face face, 33 | const char* *acharset_encoding, 34 | const char* *acharset_registry ); 35 | 36 | typedef FT_Error 37 | (*FT_BDF_GetPropertyFunc)( FT_Face face, 38 | const char* prop_name, 39 | BDF_PropertyRec *aproperty ); 40 | 41 | 42 | FT_DEFINE_SERVICE( BDF ) 43 | { 44 | FT_BDF_GetCharsetIdFunc get_charset_id; 45 | FT_BDF_GetPropertyFunc get_property; 46 | }; 47 | 48 | 49 | #define FT_DEFINE_SERVICE_BDFRec( class_, \ 50 | get_charset_id_, \ 51 | get_property_ ) \ 52 | static const FT_Service_BDFRec class_ = \ 53 | { \ 54 | get_charset_id_, get_property_ \ 55 | }; 56 | 57 | /* */ 58 | 59 | 60 | FT_END_HEADER 61 | 62 | 63 | #endif /* SVBDF_H_ */ 64 | 65 | 66 | /* END */ 67 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svcfftl.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svcfftl.h 4 | * 5 | * The FreeType CFF tables loader service (specification). 6 | * 7 | * Copyright (C) 2017-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVCFFTL_H_ 20 | #define SVCFFTL_H_ 21 | 22 | #include 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | #define FT_SERVICE_ID_CFF_LOAD "cff-load" 30 | 31 | 32 | typedef FT_UShort 33 | (*FT_Get_Standard_Encoding_Func)( FT_UInt charcode ); 34 | 35 | typedef FT_Error 36 | (*FT_Load_Private_Dict_Func)( CFF_Font font, 37 | CFF_SubFont subfont, 38 | FT_UInt lenNDV, 39 | FT_Fixed* NDV ); 40 | 41 | typedef FT_Byte 42 | (*FT_FD_Select_Get_Func)( CFF_FDSelect fdselect, 43 | FT_UInt glyph_index ); 44 | 45 | typedef FT_Bool 46 | (*FT_Blend_Check_Vector_Func)( CFF_Blend blend, 47 | FT_UInt vsindex, 48 | FT_UInt lenNDV, 49 | FT_Fixed* NDV ); 50 | 51 | typedef FT_Error 52 | (*FT_Blend_Build_Vector_Func)( CFF_Blend blend, 53 | FT_UInt vsindex, 54 | FT_UInt lenNDV, 55 | FT_Fixed* NDV ); 56 | 57 | 58 | FT_DEFINE_SERVICE( CFFLoad ) 59 | { 60 | FT_Get_Standard_Encoding_Func get_standard_encoding; 61 | FT_Load_Private_Dict_Func load_private_dict; 62 | FT_FD_Select_Get_Func fd_select_get; 63 | FT_Blend_Check_Vector_Func blend_check_vector; 64 | FT_Blend_Build_Vector_Func blend_build_vector; 65 | }; 66 | 67 | 68 | #define FT_DEFINE_SERVICE_CFFLOADREC( class_, \ 69 | get_standard_encoding_, \ 70 | load_private_dict_, \ 71 | fd_select_get_, \ 72 | blend_check_vector_, \ 73 | blend_build_vector_ ) \ 74 | static const FT_Service_CFFLoadRec class_ = \ 75 | { \ 76 | get_standard_encoding_, \ 77 | load_private_dict_, \ 78 | fd_select_get_, \ 79 | blend_check_vector_, \ 80 | blend_build_vector_ \ 81 | }; 82 | 83 | 84 | FT_END_HEADER 85 | 86 | 87 | #endif 88 | 89 | 90 | /* END */ 91 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svcid.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svcid.h 4 | * 5 | * The FreeType CID font services (specification). 6 | * 7 | * Copyright (C) 2007-2023 by 8 | * Derek Clegg and Michael Toftdal. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVCID_H_ 20 | #define SVCID_H_ 21 | 22 | #include 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | #define FT_SERVICE_ID_CID "CID" 29 | 30 | typedef FT_Error 31 | (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face face, 32 | const char* *registry, 33 | const char* *ordering, 34 | FT_Int *supplement ); 35 | typedef FT_Error 36 | (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face face, 37 | FT_Bool *is_cid ); 38 | typedef FT_Error 39 | (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face face, 40 | FT_UInt glyph_index, 41 | FT_UInt *cid ); 42 | 43 | FT_DEFINE_SERVICE( CID ) 44 | { 45 | FT_CID_GetRegistryOrderingSupplementFunc get_ros; 46 | FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid; 47 | FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index; 48 | }; 49 | 50 | 51 | #define FT_DEFINE_SERVICE_CIDREC( class_, \ 52 | get_ros_, \ 53 | get_is_cid_, \ 54 | get_cid_from_glyph_index_ ) \ 55 | static const FT_Service_CIDRec class_ = \ 56 | { \ 57 | get_ros_, get_is_cid_, get_cid_from_glyph_index_ \ 58 | }; 59 | 60 | /* */ 61 | 62 | 63 | FT_END_HEADER 64 | 65 | 66 | #endif /* SVCID_H_ */ 67 | 68 | 69 | /* END */ 70 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svfntfmt.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svfntfmt.h 4 | * 5 | * The FreeType font format service (specification only). 6 | * 7 | * Copyright (C) 2003-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVFNTFMT_H_ 20 | #define SVFNTFMT_H_ 21 | 22 | #include 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | /* 29 | * A trivial service used to return the name of a face's font driver, 30 | * according to the XFree86 nomenclature. Note that the service data is a 31 | * simple constant string pointer. 32 | */ 33 | 34 | #define FT_SERVICE_ID_FONT_FORMAT "font-format" 35 | 36 | #define FT_FONT_FORMAT_TRUETYPE "TrueType" 37 | #define FT_FONT_FORMAT_TYPE_1 "Type 1" 38 | #define FT_FONT_FORMAT_BDF "BDF" 39 | #define FT_FONT_FORMAT_PCF "PCF" 40 | #define FT_FONT_FORMAT_TYPE_42 "Type 42" 41 | #define FT_FONT_FORMAT_CID "CID Type 1" 42 | #define FT_FONT_FORMAT_CFF "CFF" 43 | #define FT_FONT_FORMAT_PFR "PFR" 44 | #define FT_FONT_FORMAT_WINFNT "Windows FNT" 45 | 46 | /* */ 47 | 48 | 49 | FT_END_HEADER 50 | 51 | 52 | #endif /* SVFNTFMT_H_ */ 53 | 54 | 55 | /* END */ 56 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svgldict.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svgldict.h 4 | * 5 | * The FreeType glyph dictionary services (specification). 6 | * 7 | * Copyright (C) 2003-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVGLDICT_H_ 20 | #define SVGLDICT_H_ 21 | 22 | #include 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | /* 29 | * A service used to retrieve glyph names, as well as to find the index of 30 | * a given glyph name in a font. 31 | * 32 | */ 33 | 34 | #define FT_SERVICE_ID_GLYPH_DICT "glyph-dict" 35 | 36 | 37 | typedef FT_Error 38 | (*FT_GlyphDict_GetNameFunc)( FT_Face face, 39 | FT_UInt glyph_index, 40 | FT_Pointer buffer, 41 | FT_UInt buffer_max ); 42 | 43 | typedef FT_UInt 44 | (*FT_GlyphDict_NameIndexFunc)( FT_Face face, 45 | const FT_String* glyph_name ); 46 | 47 | 48 | FT_DEFINE_SERVICE( GlyphDict ) 49 | { 50 | FT_GlyphDict_GetNameFunc get_name; 51 | FT_GlyphDict_NameIndexFunc name_index; /* optional */ 52 | }; 53 | 54 | 55 | #define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \ 56 | get_name_, \ 57 | name_index_ ) \ 58 | static const FT_Service_GlyphDictRec class_ = \ 59 | { \ 60 | get_name_, name_index_ \ 61 | }; 62 | 63 | /* */ 64 | 65 | 66 | FT_END_HEADER 67 | 68 | 69 | #endif /* SVGLDICT_H_ */ 70 | 71 | 72 | /* END */ 73 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svgxval.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svgxval.h 4 | * 5 | * FreeType API for validating TrueTypeGX/AAT tables (specification). 6 | * 7 | * Copyright (C) 2004-2023 by 8 | * Masatake YAMATO, Red Hat K.K., 9 | * David Turner, Robert Wilhelm, and Werner Lemberg. 10 | * 11 | * This file is part of the FreeType project, and may only be used, 12 | * modified, and distributed under the terms of the FreeType project 13 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 14 | * this file you indicate that you have read the license and 15 | * understand and accept it fully. 16 | * 17 | */ 18 | 19 | /**************************************************************************** 20 | * 21 | * gxvalid is derived from both gxlayout module and otvalid module. 22 | * Development of gxlayout is supported by the Information-technology 23 | * Promotion Agency(IPA), Japan. 24 | * 25 | */ 26 | 27 | 28 | #ifndef SVGXVAL_H_ 29 | #define SVGXVAL_H_ 30 | 31 | #include 32 | #include 33 | 34 | FT_BEGIN_HEADER 35 | 36 | 37 | #define FT_SERVICE_ID_GX_VALIDATE "truetypegx-validate" 38 | #define FT_SERVICE_ID_CLASSICKERN_VALIDATE "classickern-validate" 39 | 40 | typedef FT_Error 41 | (*gxv_validate_func)( FT_Face face, 42 | FT_UInt gx_flags, 43 | FT_Bytes tables[FT_VALIDATE_GX_LENGTH], 44 | FT_UInt table_length ); 45 | 46 | 47 | typedef FT_Error 48 | (*ckern_validate_func)( FT_Face face, 49 | FT_UInt ckern_flags, 50 | FT_Bytes *ckern_table ); 51 | 52 | 53 | FT_DEFINE_SERVICE( GXvalidate ) 54 | { 55 | gxv_validate_func validate; 56 | }; 57 | 58 | FT_DEFINE_SERVICE( CKERNvalidate ) 59 | { 60 | ckern_validate_func validate; 61 | }; 62 | 63 | /* */ 64 | 65 | 66 | FT_END_HEADER 67 | 68 | 69 | #endif /* SVGXVAL_H_ */ 70 | 71 | 72 | /* END */ 73 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svkern.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svkern.h 4 | * 5 | * The FreeType Kerning service (specification). 6 | * 7 | * Copyright (C) 2006-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVKERN_H_ 20 | #define SVKERN_H_ 21 | 22 | #include 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | #define FT_SERVICE_ID_KERNING "kerning" 29 | 30 | 31 | typedef FT_Error 32 | (*FT_Kerning_TrackGetFunc)( FT_Face face, 33 | FT_Fixed point_size, 34 | FT_Int degree, 35 | FT_Fixed* akerning ); 36 | 37 | FT_DEFINE_SERVICE( Kerning ) 38 | { 39 | FT_Kerning_TrackGetFunc get_track; 40 | }; 41 | 42 | /* */ 43 | 44 | 45 | FT_END_HEADER 46 | 47 | 48 | #endif /* SVKERN_H_ */ 49 | 50 | 51 | /* END */ 52 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svmetric.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svmetric.h 4 | * 5 | * The FreeType services for metrics variations (specification). 6 | * 7 | * Copyright (C) 2016-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVMETRIC_H_ 20 | #define SVMETRIC_H_ 21 | 22 | #include 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | /* 29 | * A service to manage the `HVAR, `MVAR', and `VVAR' OpenType tables. 30 | * 31 | */ 32 | 33 | #define FT_SERVICE_ID_METRICS_VARIATIONS "metrics-variations" 34 | 35 | 36 | /* HVAR */ 37 | 38 | typedef FT_Error 39 | (*FT_HAdvance_Adjust_Func)( FT_Face face, 40 | FT_UInt gindex, 41 | FT_Int *avalue ); 42 | 43 | typedef FT_Error 44 | (*FT_LSB_Adjust_Func)( FT_Face face, 45 | FT_UInt gindex, 46 | FT_Int *avalue ); 47 | 48 | typedef FT_Error 49 | (*FT_RSB_Adjust_Func)( FT_Face face, 50 | FT_UInt gindex, 51 | FT_Int *avalue ); 52 | 53 | /* VVAR */ 54 | 55 | typedef FT_Error 56 | (*FT_VAdvance_Adjust_Func)( FT_Face face, 57 | FT_UInt gindex, 58 | FT_Int *avalue ); 59 | 60 | typedef FT_Error 61 | (*FT_TSB_Adjust_Func)( FT_Face face, 62 | FT_UInt gindex, 63 | FT_Int *avalue ); 64 | 65 | typedef FT_Error 66 | (*FT_BSB_Adjust_Func)( FT_Face face, 67 | FT_UInt gindex, 68 | FT_Int *avalue ); 69 | 70 | typedef FT_Error 71 | (*FT_VOrg_Adjust_Func)( FT_Face face, 72 | FT_UInt gindex, 73 | FT_Int *avalue ); 74 | 75 | /* MVAR */ 76 | 77 | typedef void 78 | (*FT_Metrics_Adjust_Func)( FT_Face face ); 79 | 80 | 81 | FT_DEFINE_SERVICE( MetricsVariations ) 82 | { 83 | FT_HAdvance_Adjust_Func hadvance_adjust; 84 | FT_LSB_Adjust_Func lsb_adjust; 85 | FT_RSB_Adjust_Func rsb_adjust; 86 | 87 | FT_VAdvance_Adjust_Func vadvance_adjust; 88 | FT_TSB_Adjust_Func tsb_adjust; 89 | FT_BSB_Adjust_Func bsb_adjust; 90 | FT_VOrg_Adjust_Func vorg_adjust; 91 | 92 | FT_Metrics_Adjust_Func metrics_adjust; 93 | }; 94 | 95 | 96 | #define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \ 97 | hadvance_adjust_, \ 98 | lsb_adjust_, \ 99 | rsb_adjust_, \ 100 | vadvance_adjust_, \ 101 | tsb_adjust_, \ 102 | bsb_adjust_, \ 103 | vorg_adjust_, \ 104 | metrics_adjust_ ) \ 105 | static const FT_Service_MetricsVariationsRec class_ = \ 106 | { \ 107 | hadvance_adjust_, \ 108 | lsb_adjust_, \ 109 | rsb_adjust_, \ 110 | vadvance_adjust_, \ 111 | tsb_adjust_, \ 112 | bsb_adjust_, \ 113 | vorg_adjust_, \ 114 | metrics_adjust_ \ 115 | }; 116 | 117 | /* */ 118 | 119 | 120 | FT_END_HEADER 121 | 122 | #endif /* SVMETRIC_H_ */ 123 | 124 | 125 | /* END */ 126 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svotval.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svotval.h 4 | * 5 | * The FreeType OpenType validation service (specification). 6 | * 7 | * Copyright (C) 2004-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVOTVAL_H_ 20 | #define SVOTVAL_H_ 21 | 22 | #include 23 | #include 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | #define FT_SERVICE_ID_OPENTYPE_VALIDATE "opentype-validate" 29 | 30 | 31 | typedef FT_Error 32 | (*otv_validate_func)( FT_Face volatile face, 33 | FT_UInt ot_flags, 34 | FT_Bytes *base, 35 | FT_Bytes *gdef, 36 | FT_Bytes *gpos, 37 | FT_Bytes *gsub, 38 | FT_Bytes *jstf ); 39 | 40 | 41 | FT_DEFINE_SERVICE( OTvalidate ) 42 | { 43 | otv_validate_func validate; 44 | }; 45 | 46 | /* */ 47 | 48 | 49 | FT_END_HEADER 50 | 51 | 52 | #endif /* SVOTVAL_H_ */ 53 | 54 | 55 | /* END */ 56 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svpfr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svpfr.h 4 | * 5 | * Internal PFR service functions (specification). 6 | * 7 | * Copyright (C) 2003-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVPFR_H_ 20 | #define SVPFR_H_ 21 | 22 | #include 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | #define FT_SERVICE_ID_PFR_METRICS "pfr-metrics" 30 | 31 | 32 | typedef FT_Error 33 | (*FT_PFR_GetMetricsFunc)( FT_Face face, 34 | FT_UInt *aoutline, 35 | FT_UInt *ametrics, 36 | FT_Fixed *ax_scale, 37 | FT_Fixed *ay_scale ); 38 | 39 | typedef FT_Error 40 | (*FT_PFR_GetKerningFunc)( FT_Face face, 41 | FT_UInt left, 42 | FT_UInt right, 43 | FT_Vector *avector ); 44 | 45 | typedef FT_Error 46 | (*FT_PFR_GetAdvanceFunc)( FT_Face face, 47 | FT_UInt gindex, 48 | FT_Pos *aadvance ); 49 | 50 | 51 | FT_DEFINE_SERVICE( PfrMetrics ) 52 | { 53 | FT_PFR_GetMetricsFunc get_metrics; 54 | FT_PFR_GetKerningFunc get_kerning; 55 | FT_PFR_GetAdvanceFunc get_advance; 56 | 57 | }; 58 | 59 | 60 | FT_END_HEADER 61 | 62 | #endif /* SVPFR_H_ */ 63 | 64 | 65 | /* END */ 66 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svpostnm.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svpostnm.h 4 | * 5 | * The FreeType PostScript name services (specification). 6 | * 7 | * Copyright (C) 2003-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVPOSTNM_H_ 20 | #define SVPOSTNM_H_ 21 | 22 | #include 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | /* 28 | * A trivial service used to retrieve the PostScript name of a given font 29 | * when available. The `get_name' field should never be `NULL`. 30 | * 31 | * The corresponding function can return `NULL` to indicate that the 32 | * PostScript name is not available. 33 | * 34 | * The name is owned by the face and will be destroyed with it. 35 | */ 36 | 37 | #define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME "postscript-font-name" 38 | 39 | 40 | typedef const char* 41 | (*FT_PsName_GetFunc)( FT_Face face ); 42 | 43 | 44 | FT_DEFINE_SERVICE( PsFontName ) 45 | { 46 | FT_PsName_GetFunc get_ps_font_name; 47 | }; 48 | 49 | 50 | #define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \ 51 | static const FT_Service_PsFontNameRec class_ = \ 52 | { \ 53 | get_ps_font_name_ \ 54 | }; 55 | 56 | /* */ 57 | 58 | 59 | FT_END_HEADER 60 | 61 | 62 | #endif /* SVPOSTNM_H_ */ 63 | 64 | 65 | /* END */ 66 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svprop.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svprop.h 4 | * 5 | * The FreeType property service (specification). 6 | * 7 | * Copyright (C) 2012-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVPROP_H_ 20 | #define SVPROP_H_ 21 | 22 | 23 | FT_BEGIN_HEADER 24 | 25 | 26 | #define FT_SERVICE_ID_PROPERTIES "properties" 27 | 28 | 29 | typedef FT_Error 30 | (*FT_Properties_SetFunc)( FT_Module module, 31 | const char* property_name, 32 | const void* value, 33 | FT_Bool value_is_string ); 34 | 35 | typedef FT_Error 36 | (*FT_Properties_GetFunc)( FT_Module module, 37 | const char* property_name, 38 | void* value ); 39 | 40 | 41 | FT_DEFINE_SERVICE( Properties ) 42 | { 43 | FT_Properties_SetFunc set_property; 44 | FT_Properties_GetFunc get_property; 45 | }; 46 | 47 | 48 | #define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \ 49 | set_property_, \ 50 | get_property_ ) \ 51 | static const FT_Service_PropertiesRec class_ = \ 52 | { \ 53 | set_property_, \ 54 | get_property_ \ 55 | }; 56 | 57 | /* */ 58 | 59 | 60 | FT_END_HEADER 61 | 62 | 63 | #endif /* SVPROP_H_ */ 64 | 65 | 66 | /* END */ 67 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svpscmap.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svpscmap.h 4 | * 5 | * The FreeType PostScript charmap service (specification). 6 | * 7 | * Copyright (C) 2003-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVPSCMAP_H_ 20 | #define SVPSCMAP_H_ 21 | 22 | #include 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | #define FT_SERVICE_ID_POSTSCRIPT_CMAPS "postscript-cmaps" 29 | 30 | 31 | /* 32 | * Adobe glyph name to unicode value. 33 | */ 34 | typedef FT_UInt32 35 | (*PS_Unicode_ValueFunc)( const char* glyph_name ); 36 | 37 | /* 38 | * Macintosh name id to glyph name. `NULL` if invalid index. 39 | */ 40 | typedef const char* 41 | (*PS_Macintosh_NameFunc)( FT_UInt name_index ); 42 | 43 | /* 44 | * Adobe standard string ID to glyph name. `NULL` if invalid index. 45 | */ 46 | typedef const char* 47 | (*PS_Adobe_Std_StringsFunc)( FT_UInt string_index ); 48 | 49 | 50 | /* 51 | * Simple unicode -> glyph index charmap built from font glyph names table. 52 | */ 53 | typedef struct PS_UniMap_ 54 | { 55 | FT_UInt32 unicode; /* bit 31 set: is glyph variant */ 56 | FT_UInt glyph_index; 57 | 58 | } PS_UniMap; 59 | 60 | 61 | typedef struct PS_UnicodesRec_* PS_Unicodes; 62 | 63 | typedef struct PS_UnicodesRec_ 64 | { 65 | FT_CMapRec cmap; 66 | FT_UInt num_maps; 67 | PS_UniMap* maps; 68 | 69 | } PS_UnicodesRec; 70 | 71 | 72 | /* 73 | * A function which returns a glyph name for a given index. Returns 74 | * `NULL` if invalid index. 75 | */ 76 | typedef const char* 77 | (*PS_GetGlyphNameFunc)( FT_Pointer data, 78 | FT_UInt string_index ); 79 | 80 | /* 81 | * A function used to release the glyph name returned by 82 | * PS_GetGlyphNameFunc, when needed 83 | */ 84 | typedef void 85 | (*PS_FreeGlyphNameFunc)( FT_Pointer data, 86 | const char* name ); 87 | 88 | typedef FT_Error 89 | (*PS_Unicodes_InitFunc)( FT_Memory memory, 90 | PS_Unicodes unicodes, 91 | FT_UInt num_glyphs, 92 | PS_GetGlyphNameFunc get_glyph_name, 93 | PS_FreeGlyphNameFunc free_glyph_name, 94 | FT_Pointer glyph_data ); 95 | 96 | typedef FT_UInt 97 | (*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes, 98 | FT_UInt32 unicode ); 99 | 100 | typedef FT_UInt32 101 | (*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes, 102 | FT_UInt32 *unicode ); 103 | 104 | 105 | FT_DEFINE_SERVICE( PsCMaps ) 106 | { 107 | PS_Unicode_ValueFunc unicode_value; 108 | 109 | PS_Unicodes_InitFunc unicodes_init; 110 | PS_Unicodes_CharIndexFunc unicodes_char_index; 111 | PS_Unicodes_CharNextFunc unicodes_char_next; 112 | 113 | PS_Macintosh_NameFunc macintosh_name; 114 | PS_Adobe_Std_StringsFunc adobe_std_strings; 115 | const unsigned short* adobe_std_encoding; 116 | const unsigned short* adobe_expert_encoding; 117 | }; 118 | 119 | 120 | #define FT_DEFINE_SERVICE_PSCMAPSREC( class_, \ 121 | unicode_value_, \ 122 | unicodes_init_, \ 123 | unicodes_char_index_, \ 124 | unicodes_char_next_, \ 125 | macintosh_name_, \ 126 | adobe_std_strings_, \ 127 | adobe_std_encoding_, \ 128 | adobe_expert_encoding_ ) \ 129 | static const FT_Service_PsCMapsRec class_ = \ 130 | { \ 131 | unicode_value_, unicodes_init_, \ 132 | unicodes_char_index_, unicodes_char_next_, macintosh_name_, \ 133 | adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \ 134 | }; 135 | 136 | /* */ 137 | 138 | 139 | FT_END_HEADER 140 | 141 | 142 | #endif /* SVPSCMAP_H_ */ 143 | 144 | 145 | /* END */ 146 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svpsinfo.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svpsinfo.h 4 | * 5 | * The FreeType PostScript info service (specification). 6 | * 7 | * Copyright (C) 2003-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVPSINFO_H_ 20 | #define SVPSINFO_H_ 21 | 22 | #include 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | #define FT_SERVICE_ID_POSTSCRIPT_INFO "postscript-info" 30 | 31 | 32 | typedef FT_Error 33 | (*PS_GetFontInfoFunc)( FT_Face face, 34 | PS_FontInfoRec* afont_info ); 35 | 36 | typedef FT_Error 37 | (*PS_GetFontExtraFunc)( FT_Face face, 38 | PS_FontExtraRec* afont_extra ); 39 | 40 | typedef FT_Int 41 | (*PS_HasGlyphNamesFunc)( FT_Face face ); 42 | 43 | typedef FT_Error 44 | (*PS_GetFontPrivateFunc)( FT_Face face, 45 | PS_PrivateRec* afont_private ); 46 | 47 | typedef FT_Long 48 | (*PS_GetFontValueFunc)( FT_Face face, 49 | PS_Dict_Keys key, 50 | FT_UInt idx, 51 | void *value, 52 | FT_Long value_len ); 53 | 54 | 55 | FT_DEFINE_SERVICE( PsInfo ) 56 | { 57 | PS_GetFontInfoFunc ps_get_font_info; 58 | PS_GetFontExtraFunc ps_get_font_extra; 59 | PS_HasGlyphNamesFunc ps_has_glyph_names; 60 | PS_GetFontPrivateFunc ps_get_font_private; 61 | PS_GetFontValueFunc ps_get_font_value; 62 | }; 63 | 64 | 65 | #define FT_DEFINE_SERVICE_PSINFOREC( class_, \ 66 | get_font_info_, \ 67 | ps_get_font_extra_, \ 68 | has_glyph_names_, \ 69 | get_font_private_, \ 70 | get_font_value_ ) \ 71 | static const FT_Service_PsInfoRec class_ = \ 72 | { \ 73 | get_font_info_, ps_get_font_extra_, has_glyph_names_, \ 74 | get_font_private_, get_font_value_ \ 75 | }; 76 | 77 | /* */ 78 | 79 | 80 | FT_END_HEADER 81 | 82 | 83 | #endif /* SVPSINFO_H_ */ 84 | 85 | 86 | /* END */ 87 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svsfnt.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svsfnt.h 4 | * 5 | * The FreeType SFNT table loading service (specification). 6 | * 7 | * Copyright (C) 2003-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVSFNT_H_ 20 | #define SVSFNT_H_ 21 | 22 | #include 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | /* 30 | * SFNT table loading service. 31 | */ 32 | 33 | #define FT_SERVICE_ID_SFNT_TABLE "sfnt-table" 34 | 35 | 36 | /* 37 | * Used to implement FT_Load_Sfnt_Table(). 38 | */ 39 | typedef FT_Error 40 | (*FT_SFNT_TableLoadFunc)( FT_Face face, 41 | FT_ULong tag, 42 | FT_Long offset, 43 | FT_Byte* buffer, 44 | FT_ULong* length ); 45 | 46 | /* 47 | * Used to implement FT_Get_Sfnt_Table(). 48 | */ 49 | typedef void* 50 | (*FT_SFNT_TableGetFunc)( FT_Face face, 51 | FT_Sfnt_Tag tag ); 52 | 53 | 54 | /* 55 | * Used to implement FT_Sfnt_Table_Info(). 56 | */ 57 | typedef FT_Error 58 | (*FT_SFNT_TableInfoFunc)( FT_Face face, 59 | FT_UInt idx, 60 | FT_ULong *tag, 61 | FT_ULong *offset, 62 | FT_ULong *length ); 63 | 64 | 65 | FT_DEFINE_SERVICE( SFNT_Table ) 66 | { 67 | FT_SFNT_TableLoadFunc load_table; 68 | FT_SFNT_TableGetFunc get_table; 69 | FT_SFNT_TableInfoFunc table_info; 70 | }; 71 | 72 | 73 | #define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \ 74 | static const FT_Service_SFNT_TableRec class_ = \ 75 | { \ 76 | load_, get_, info_ \ 77 | }; 78 | 79 | /* */ 80 | 81 | 82 | FT_END_HEADER 83 | 84 | 85 | #endif /* SVSFNT_H_ */ 86 | 87 | 88 | /* END */ 89 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svttcmap.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svttcmap.h 4 | * 5 | * The FreeType TrueType/sfnt cmap extra information service. 6 | * 7 | * Copyright (C) 2003-2023 by 8 | * Masatake YAMATO, Redhat K.K., 9 | * David Turner, Robert Wilhelm, and Werner Lemberg. 10 | * 11 | * This file is part of the FreeType project, and may only be used, 12 | * modified, and distributed under the terms of the FreeType project 13 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 14 | * this file you indicate that you have read the license and 15 | * understand and accept it fully. 16 | * 17 | */ 18 | 19 | /* Development of this service is support of 20 | Information-technology Promotion Agency, Japan. */ 21 | 22 | #ifndef SVTTCMAP_H_ 23 | #define SVTTCMAP_H_ 24 | 25 | #include 26 | #include 27 | 28 | 29 | FT_BEGIN_HEADER 30 | 31 | 32 | #define FT_SERVICE_ID_TT_CMAP "tt-cmaps" 33 | 34 | 35 | /************************************************************************** 36 | * 37 | * @struct: 38 | * TT_CMapInfo 39 | * 40 | * @description: 41 | * A structure used to store TrueType/sfnt specific cmap information 42 | * which is not covered by the generic @FT_CharMap structure. This 43 | * structure can be accessed with the @FT_Get_TT_CMap_Info function. 44 | * 45 | * @fields: 46 | * language :: 47 | * The language ID used in Mac fonts. Definitions of values are in 48 | * `ttnameid.h`. 49 | * 50 | * format :: 51 | * The cmap format. OpenType 1.6 defines the formats 0 (byte encoding 52 | * table), 2~(high-byte mapping through table), 4~(segment mapping to 53 | * delta values), 6~(trimmed table mapping), 8~(mixed 16-bit and 32-bit 54 | * coverage), 10~(trimmed array), 12~(segmented coverage), 13~(last 55 | * resort font), and 14 (Unicode Variation Sequences). 56 | */ 57 | typedef struct TT_CMapInfo_ 58 | { 59 | FT_ULong language; 60 | FT_Long format; 61 | 62 | } TT_CMapInfo; 63 | 64 | 65 | typedef FT_Error 66 | (*TT_CMap_Info_GetFunc)( FT_CharMap charmap, 67 | TT_CMapInfo *cmap_info ); 68 | 69 | 70 | FT_DEFINE_SERVICE( TTCMaps ) 71 | { 72 | TT_CMap_Info_GetFunc get_cmap_info; 73 | }; 74 | 75 | 76 | #define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ ) \ 77 | static const FT_Service_TTCMapsRec class_ = \ 78 | { \ 79 | get_cmap_info_ \ 80 | }; 81 | 82 | /* */ 83 | 84 | 85 | FT_END_HEADER 86 | 87 | #endif /* SVTTCMAP_H_ */ 88 | 89 | 90 | /* END */ 91 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svtteng.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svtteng.h 4 | * 5 | * The FreeType TrueType engine query service (specification). 6 | * 7 | * Copyright (C) 2006-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVTTENG_H_ 20 | #define SVTTENG_H_ 21 | 22 | #include 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | /* 30 | * SFNT table loading service. 31 | */ 32 | 33 | #define FT_SERVICE_ID_TRUETYPE_ENGINE "truetype-engine" 34 | 35 | /* 36 | * Used to implement FT_Get_TrueType_Engine_Type 37 | */ 38 | 39 | FT_DEFINE_SERVICE( TrueTypeEngine ) 40 | { 41 | FT_TrueTypeEngineType engine_type; 42 | }; 43 | 44 | /* */ 45 | 46 | 47 | FT_END_HEADER 48 | 49 | 50 | #endif /* SVTTENG_H_ */ 51 | 52 | 53 | /* END */ 54 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svttglyf.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svttglyf.h 4 | * 5 | * The FreeType TrueType glyph service. 6 | * 7 | * Copyright (C) 2007-2023 by 8 | * David Turner. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | #ifndef SVTTGLYF_H_ 19 | #define SVTTGLYF_H_ 20 | 21 | #include 22 | #include 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | #define FT_SERVICE_ID_TT_GLYF "tt-glyf" 29 | 30 | 31 | typedef FT_ULong 32 | (*TT_Glyf_GetLocationFunc)( FT_Face face, 33 | FT_UInt gindex, 34 | FT_ULong *psize ); 35 | 36 | FT_DEFINE_SERVICE( TTGlyf ) 37 | { 38 | TT_Glyf_GetLocationFunc get_location; 39 | }; 40 | 41 | 42 | #define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \ 43 | static const FT_Service_TTGlyfRec class_ = \ 44 | { \ 45 | get_location_ \ 46 | }; 47 | 48 | /* */ 49 | 50 | 51 | FT_END_HEADER 52 | 53 | #endif /* SVTTGLYF_H_ */ 54 | 55 | 56 | /* END */ 57 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svwinfnt.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svwinfnt.h 4 | * 5 | * The FreeType Windows FNT/FONT service (specification). 6 | * 7 | * Copyright (C) 2003-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVWINFNT_H_ 20 | #define SVWINFNT_H_ 21 | 22 | #include 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | #define FT_SERVICE_ID_WINFNT "winfonts" 30 | 31 | typedef FT_Error 32 | (*FT_WinFnt_GetHeaderFunc)( FT_Face face, 33 | FT_WinFNT_HeaderRec *aheader ); 34 | 35 | 36 | FT_DEFINE_SERVICE( WinFnt ) 37 | { 38 | FT_WinFnt_GetHeaderFunc get_header; 39 | }; 40 | 41 | /* */ 42 | 43 | 44 | FT_END_HEADER 45 | 46 | 47 | #endif /* SVWINFNT_H_ */ 48 | 49 | 50 | /* END */ 51 | -------------------------------------------------------------------------------- /include/freetype/internal/svginterface.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * svginterface.h 4 | * 5 | * Interface of ot-svg module (specification only). 6 | * 7 | * Copyright (C) 2022-2023 by 8 | * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef SVGINTERFACE_H_ 20 | #define SVGINTERFACE_H_ 21 | 22 | #include 23 | #include 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | typedef FT_Error 29 | (*Preset_Bitmap_Func)( FT_Module module, 30 | FT_GlyphSlot slot, 31 | FT_Bool cache ); 32 | 33 | typedef struct SVG_Interface_ 34 | { 35 | Preset_Bitmap_Func preset_slot; 36 | 37 | } SVG_Interface; 38 | 39 | typedef SVG_Interface* SVG_Service; 40 | 41 | FT_END_HEADER 42 | 43 | #endif /* SVGINTERFACE_H_ */ 44 | 45 | 46 | /* END */ 47 | -------------------------------------------------------------------------------- /include/freetype/tttags.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * tttags.h 4 | * 5 | * Tags for TrueType and OpenType tables (specification only). 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | #ifndef TTAGS_H_ 20 | #define TTAGS_H_ 21 | 22 | 23 | #include 24 | 25 | #ifdef FREETYPE_H 26 | #error "freetype.h of FreeType 1 has been loaded!" 27 | #error "Please fix the directory search order for header files" 28 | #error "so that freetype.h of FreeType 2 is found first." 29 | #endif 30 | 31 | 32 | FT_BEGIN_HEADER 33 | 34 | 35 | #define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' ) 36 | #define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' ) 37 | #define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' ) 38 | #define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' ) 39 | #define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' ) 40 | #define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' ) 41 | #define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' ) 42 | #define TTAG_CBDT FT_MAKE_TAG( 'C', 'B', 'D', 'T' ) 43 | #define TTAG_CBLC FT_MAKE_TAG( 'C', 'B', 'L', 'C' ) 44 | #define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' ) 45 | #define TTAG_CFF2 FT_MAKE_TAG( 'C', 'F', 'F', '2' ) 46 | #define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' ) 47 | #define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' ) 48 | #define TTAG_COLR FT_MAKE_TAG( 'C', 'O', 'L', 'R' ) 49 | #define TTAG_CPAL FT_MAKE_TAG( 'C', 'P', 'A', 'L' ) 50 | #define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' ) 51 | #define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' ) 52 | #define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' ) 53 | #define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' ) 54 | #define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' ) 55 | #define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' ) 56 | #define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' ) 57 | #define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' ) 58 | #define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' ) 59 | #define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' ) 60 | #define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' ) 61 | #define TTAG_GDEF FT_MAKE_TAG( 'G', 'D', 'E', 'F' ) 62 | #define TTAG_glyf FT_MAKE_TAG( 'g', 'l', 'y', 'f' ) 63 | #define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' ) 64 | #define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' ) 65 | #define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' ) 66 | #define TTAG_HVAR FT_MAKE_TAG( 'H', 'V', 'A', 'R' ) 67 | #define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' ) 68 | #define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' ) 69 | #define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' ) 70 | #define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' ) 71 | #define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' ) 72 | #define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' ) 73 | #define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' ) 74 | #define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' ) 75 | #define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' ) 76 | #define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' ) 77 | #define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' ) 78 | #define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' ) 79 | #define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' ) 80 | #define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' ) 81 | #define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' ) 82 | #define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' ) 83 | #define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' ) 84 | #define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' ) 85 | #define TTAG_MVAR FT_MAKE_TAG( 'M', 'V', 'A', 'R' ) 86 | #define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' ) 87 | #define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' ) 88 | #define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' ) 89 | #define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) 90 | #define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' ) 91 | #define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' ) 92 | #define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' ) 93 | #define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' ) 94 | #define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' ) 95 | #define TTAG_sbix FT_MAKE_TAG( 's', 'b', 'i', 'x' ) 96 | #define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' ) 97 | #define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' ) 98 | #define TTAG_SVG FT_MAKE_TAG( 'S', 'V', 'G', ' ' ) 99 | #define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' ) 100 | #define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' ) 101 | #define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' ) 102 | #define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' ) 103 | #define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' ) 104 | #define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' ) 105 | #define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' ) 106 | #define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' ) 107 | #define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' ) 108 | #define TTAG_VVAR FT_MAKE_TAG( 'V', 'V', 'A', 'R' ) 109 | #define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' ) 110 | #define TTAG_wOF2 FT_MAKE_TAG( 'w', 'O', 'F', '2' ) 111 | 112 | /* used by "Keyboard.dfont" on legacy Mac OS X */ 113 | #define TTAG_0xA5kbd FT_MAKE_TAG( 0xA5, 'k', 'b', 'd' ) 114 | 115 | /* used by "LastResort.dfont" on legacy Mac OS X */ 116 | #define TTAG_0xA5lst FT_MAKE_TAG( 0xA5, 'l', 's', 't' ) 117 | 118 | 119 | FT_END_HEADER 120 | 121 | #endif /* TTAGS_H_ */ 122 | 123 | 124 | /* END */ 125 | -------------------------------------------------------------------------------- /include/ft2build.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * ft2build.h 4 | * 5 | * FreeType 2 build and setup macros. 6 | * 7 | * Copyright (C) 1996-2023 by 8 | * David Turner, Robert Wilhelm, and Werner Lemberg. 9 | * 10 | * This file is part of the FreeType project, and may only be used, 11 | * modified, and distributed under the terms of the FreeType project 12 | * license, LICENSE.TXT. By continuing to use, modify, or distribute 13 | * this file you indicate that you have read the license and 14 | * understand and accept it fully. 15 | * 16 | */ 17 | 18 | 19 | /************************************************************************** 20 | * 21 | * This is the 'entry point' for FreeType header file inclusions, to be 22 | * loaded before all other header files. 23 | * 24 | * A typical example is 25 | * 26 | * ``` 27 | * #include 28 | * #include 29 | * ``` 30 | * 31 | */ 32 | 33 | 34 | #ifndef FT2BUILD_H_ 35 | #define FT2BUILD_H_ 36 | 37 | #include 38 | 39 | #endif /* FT2BUILD_H_ */ 40 | 41 | 42 | /* END */ 43 | -------------------------------------------------------------------------------- /lib/esp32/libfreetype.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/esp_freetype/108d674ae9b7b6f10a8cd67cf5113c55d9ef2288/lib/esp32/libfreetype.a -------------------------------------------------------------------------------- /lib/esp32s2/libfreetype.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/esp_freetype/108d674ae9b7b6f10a8cd67cf5113c55d9ef2288/lib/esp32s2/libfreetype.a -------------------------------------------------------------------------------- /lib/esp32s3/libfreetype.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/esp_freetype/108d674ae9b7b6f10a8cd67cf5113c55d9ef2288/lib/esp32s3/libfreetype.a --------------------------------------------------------------------------------