├── Plugin ├── src │ ├── freetype │ │ ├── src │ │ │ ├── .DS_Store │ │ │ ├── autofit │ │ │ │ ├── afangles.h │ │ │ │ ├── afblue.cin │ │ │ │ ├── afindic.h │ │ │ │ ├── afdummy.h │ │ │ │ ├── autofit.c │ │ │ │ ├── afranges.h │ │ │ │ ├── aflatin2.h │ │ │ │ ├── aferrors.h │ │ │ │ ├── afmodule.h │ │ │ │ ├── afwrtsys.h │ │ │ │ ├── afwarp.h │ │ │ │ ├── afshaper.h │ │ │ │ ├── afdummy.c │ │ │ │ └── afloader.h │ │ │ ├── psnames │ │ │ │ ├── psnames.c │ │ │ │ ├── psmodule.h │ │ │ │ ├── psnamerr.h │ │ │ │ └── pspic.h │ │ │ ├── raster │ │ │ │ ├── raster.c │ │ │ │ ├── ftrend1.h │ │ │ │ ├── ftraster.h │ │ │ │ ├── rasterrs.h │ │ │ │ ├── rastpic.h │ │ │ │ └── rastpic.c │ │ │ ├── smooth │ │ │ │ ├── smooth.c │ │ │ │ ├── ftsmooth.h │ │ │ │ ├── ftsmerrs.h │ │ │ │ ├── ftgrays.h │ │ │ │ └── ftspic.h │ │ │ ├── pshinter │ │ │ │ ├── pshinter.c │ │ │ │ ├── pshmod.h │ │ │ │ ├── pshnterr.h │ │ │ │ ├── pshpic.h │ │ │ │ └── pshpic.c │ │ │ ├── base │ │ │ │ ├── md5.h │ │ │ │ ├── ftbase.c │ │ │ │ ├── ftfntfmt.c │ │ │ │ ├── ftpatent.c │ │ │ │ ├── ftwinfnt.c │ │ │ │ ├── ftpic.c │ │ │ │ ├── ftgasp.c │ │ │ │ ├── ftfstype.c │ │ │ │ ├── ftbdf.c │ │ │ │ ├── ftotval.c │ │ │ │ ├── basepic.h │ │ │ │ └── ftbase.h │ │ │ ├── sfnt │ │ │ │ ├── sfdriver.h │ │ │ │ ├── sfnt.c │ │ │ │ ├── ttbdf.h │ │ │ │ ├── ttpost.h │ │ │ │ ├── sferrors.h │ │ │ │ ├── ttkern.h │ │ │ │ ├── ttcmapc.h │ │ │ │ ├── pngshim.h │ │ │ │ ├── ttmtx.h │ │ │ │ ├── sfobjs.h │ │ │ │ └── ttsbit.h │ │ │ ├── cff │ │ │ │ ├── cffdrivr.h │ │ │ │ ├── cff.c │ │ │ │ ├── cfferrs.h │ │ │ │ ├── cffcmap.h │ │ │ │ ├── cf2error.c │ │ │ │ └── cf2read.h │ │ │ └── truetype │ │ │ │ ├── ttdriver.h │ │ │ │ ├── truetype.c │ │ │ │ ├── tterrors.h │ │ │ │ ├── ttgload.h │ │ │ │ └── ttpload.h │ │ └── include │ │ │ ├── freetype │ │ │ ├── config │ │ │ │ └── ftmodule.h │ │ │ ├── internal │ │ │ │ ├── services │ │ │ │ │ ├── svtteng.h │ │ │ │ │ ├── svwinfnt.h │ │ │ │ │ ├── svkern.h │ │ │ │ │ ├── svotval.h │ │ │ │ │ ├── svfntfmt.h │ │ │ │ │ ├── svpfr.h │ │ │ │ │ ├── svttglyf.h │ │ │ │ │ ├── svgxval.h │ │ │ │ │ ├── svpostnm.h │ │ │ │ │ ├── svprop.h │ │ │ │ │ └── svbdf.h │ │ │ │ └── ftpic.h │ │ │ └── ttunpat.h │ │ │ └── ft2build.h │ └── unity-freetype │ │ ├── interface.h │ │ ├── interface.cpp │ │ └── font.h ├── Plugins │ ├── iOS │ │ └── Release │ │ │ └── libunity-freetype.a │ ├── Android │ │ └── libs │ │ │ ├── x86 │ │ │ └── libunity-freetype.so │ │ │ └── armeabi-v7a │ │ │ └── libunity-freetype.so │ ├── Windows │ │ ├── x86 │ │ │ └── Release │ │ │ │ └── unity-freetype.dll │ │ └── x86_64 │ │ │ └── Release │ │ │ └── unity-freetype.dll │ └── macOS │ │ └── unity-freetype.bundle │ │ └── Contents │ │ ├── MacOS │ │ └── unity-freetype │ │ └── Info.plist ├── make_ios.sh ├── make_macos.sh ├── make_windows.bat ├── make_android.sh └── CMakeLists.txt ├── Shaders ├── Unlit - FreeType Text.cginc ├── Unlit - FreeType Text.shader ├── Unlit - FreeType Text 1.shader ├── Unlit - FreeType Text 2.shader └── Unlit - FreeType Text 3.shader ├── FreeTypeFont ├── FreeTypeFontUpdater.cs └── FreeTypeFontApi.cs └── README.md /Plugin/src/freetype/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jayatubi/unity-freetype/HEAD/Plugin/src/freetype/src/.DS_Store -------------------------------------------------------------------------------- /Plugin/Plugins/iOS/Release/libunity-freetype.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jayatubi/unity-freetype/HEAD/Plugin/Plugins/iOS/Release/libunity-freetype.a -------------------------------------------------------------------------------- /Plugin/Plugins/Android/libs/x86/libunity-freetype.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jayatubi/unity-freetype/HEAD/Plugin/Plugins/Android/libs/x86/libunity-freetype.so -------------------------------------------------------------------------------- /Plugin/Plugins/Windows/x86/Release/unity-freetype.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jayatubi/unity-freetype/HEAD/Plugin/Plugins/Windows/x86/Release/unity-freetype.dll -------------------------------------------------------------------------------- /Plugin/Plugins/Windows/x86_64/Release/unity-freetype.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jayatubi/unity-freetype/HEAD/Plugin/Plugins/Windows/x86_64/Release/unity-freetype.dll -------------------------------------------------------------------------------- /Plugin/Plugins/Android/libs/armeabi-v7a/libunity-freetype.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jayatubi/unity-freetype/HEAD/Plugin/Plugins/Android/libs/armeabi-v7a/libunity-freetype.so -------------------------------------------------------------------------------- /Plugin/Plugins/macOS/unity-freetype.bundle/Contents/MacOS/unity-freetype: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jayatubi/unity-freetype/HEAD/Plugin/Plugins/macOS/unity-freetype.bundle/Contents/MacOS/unity-freetype -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/afangles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * afangles.h 3 | * 4 | * This is a dummy file, used to please the build system. It is never 5 | * included by the auto-fitter sources. 6 | * 7 | */ 8 | -------------------------------------------------------------------------------- /Plugin/make_ios.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | proj=$(pwd) 4 | rm -rf build_ios 5 | 6 | mkdir -p build_ios && cd build_ios 7 | cmake -DTARGET_PLATFORM=iOS -GXcode $proj 8 | cd - 9 | 10 | cmake --build build_ios --config Release 11 | 12 | -------------------------------------------------------------------------------- /Plugin/make_macos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | proj=$(pwd) 4 | rm -rf build_macos 5 | 6 | mkdir -p build_macos && cd build_macos 7 | cmake -DTARGET_PLATFORM=macOS $proj 8 | cd - 9 | 10 | cmake --build build_macos --config Release -- -j -------------------------------------------------------------------------------- /Plugin/make_windows.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set proj=%cd% 4 | rd build_windows /s /q 5 | 6 | md build_windows\32 & pushd build_windows\32 7 | cmake -DTARGET_PLATFORM=Windows -G "Visual Studio 14 2015" %proj% 8 | popd 9 | 10 | md build_windows\64 & pushd build_windows\64 11 | cmake -DTARGET_PLATFORM=Windows -G "Visual Studio 14 2015 Win64" %proj% 12 | popd 13 | 14 | cmake --build build_windows\32 --config Release 15 | cmake --build build_windows\64 --config Release -------------------------------------------------------------------------------- /Plugin/make_android.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | proj=$(pwd) 4 | rm -rf build_android 5 | 6 | mkdir -p build_android/arm && cd build_android/arm 7 | cmake -DTARGET_PLATFORM=Android -DCMAKE_BUILD_TYPE=Release -DANDROID_ABI="armeabi-v7a" $proj 8 | cd - 9 | 10 | mkdir -p build_android/x86 && cd build_android/x86 11 | cmake -DTARGET_PLATFORM=Android -DCMAKE_BUILD_TYPE=Release -DANDROID_ABI="x86" $proj 12 | cd - 13 | 14 | cmake --build build_android/arm --config Release -- -j 15 | cmake --build build_android/x86 --config Release -- -j -------------------------------------------------------------------------------- /Shaders/Unlit - FreeType Text.cginc: -------------------------------------------------------------------------------- 1 | #include "UnityCG.cginc" 2 | 3 | void decodeColor(float4 value, out float4 color1, out float4 color2) 4 | { 5 | int4 compose = value * 0xFF; 6 | #if !SHADER_API_D3D9 7 | int4 high = (compose >> 4) & 0xF; 8 | int4 low = compose & 0xF; 9 | #else 10 | int4 high = compose / int(0x10); 11 | int4 low = compose - high * int(0x10); 12 | #endif 13 | color1 = float4(high) / 0xF; 14 | color2 = float4(low) / 0xF; 15 | } 16 | 17 | float2 decodeAlpha(float4 value) 18 | { 19 | return float2(value.b + value.a * 0.0625, value.r + value.g * 0.0625); 20 | } -------------------------------------------------------------------------------- /Plugin/src/unity-freetype/interface.h: -------------------------------------------------------------------------------- 1 | #ifndef INTERFACE_H 2 | #define INTERFACE_H 3 | 4 | #include "font.h" 5 | 6 | #ifdef _MSC_VER 7 | #define EXPORT __declspec(dllexport) 8 | #else 9 | #define EXPORT __attribute__ ((visibility ("default"))) 10 | #endif 11 | 12 | extern "C" 13 | { 14 | EXPORT FontContext* UFT_CreateFontContextByFile(const char* pPath); 15 | EXPORT FontContext* UFT_CreateFontContextByData(const FT_Byte* pData, unsigned int length); 16 | EXPORT void UFT_DeleteFontContext(FontContext* pDefine); 17 | EXPORT const FT_Byte* UFT_GetGlyph(FontContext* pDefine, int code, FreeTypeGlyph* glyph, int fontSize, int outlineSize, bool bold); 18 | EXPORT void UFT_MemoryCopy(unsigned int* pDst, unsigned int* pSrc, int size); 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /FreeTypeFont/FreeTypeFontUpdater.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using UnityEngine; 3 | 4 | [ExecuteInEditMode] 5 | public class FreeTypeFontUpdater : MonoBehaviour 6 | { 7 | 8 | public static void ScheduleUpdate(System.Action handler) 9 | { 10 | var name = "FreeTypeFontUpdater"; 11 | var go = GameObject.Find(name); 12 | if (go == null) 13 | { 14 | go = new GameObject(name); 15 | go.hideFlags = HideFlags.HideAndDontSave; 16 | } 17 | var updater = go.GetComponent(); 18 | if (updater == null) 19 | { 20 | updater = go.AddComponent(); 21 | } 22 | updater.StartCoroutine(UpdateImpl(handler)); 23 | } 24 | 25 | private static IEnumerator UpdateImpl(System.Action handler) 26 | { 27 | yield return 0; 28 | handler(); 29 | } 30 | } -------------------------------------------------------------------------------- /Plugin/src/unity-freetype/interface.cpp: -------------------------------------------------------------------------------- 1 | #include "interface.h" 2 | 3 | FontContext* UFT_CreateFontContextByFile(const char* pPath) 4 | { 5 | return new FontContext(pPath); 6 | } 7 | 8 | FontContext* UFT_CreateFontContextByData(const FT_Byte* pData, unsigned int length) 9 | { 10 | return new FontContext(pData, length); 11 | } 12 | 13 | void UFT_DeleteFontContext(FontContext* pContext) 14 | { 15 | if (pContext != nullptr) 16 | { 17 | delete pContext; 18 | } 19 | } 20 | 21 | const FT_Byte* UFT_GetGlyph(FontContext* pContext, int code, FreeTypeGlyph* glyph, int fontSize, int outlineSize, bool bold) 22 | { 23 | const FT_Byte* pResult = nullptr; 24 | 25 | if (pContext != nullptr && glyph != nullptr) 26 | { 27 | pResult = pContext->GetGlyph(code, *glyph, fontSize, outlineSize, bold); 28 | } 29 | 30 | return pResult; 31 | } 32 | 33 | void UFT_MemoryCopy(unsigned int* pDst, unsigned int* pSrc, int size) 34 | { 35 | memcpy(pDst, pSrc, size); 36 | } 37 | -------------------------------------------------------------------------------- /Plugin/Plugins/macOS/unity-freetype.bundle/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | unity-freetype 9 | CFBundleGetInfoString 10 | 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | 19 | CFBundleName 20 | 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | 29 | CSResourcesFileMapped 30 | 31 | NSHumanReadableCopyright 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/psnames/psnames.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* psnames.c */ 4 | /* */ 5 | /* FreeType PSNames module component (body only). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | #include "pspic.c" 23 | #include "psmodule.c" 24 | 25 | 26 | /* END */ 27 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/raster/raster.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* raster.c */ 4 | /* */ 5 | /* FreeType monochrome rasterer module component (body only). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | #include "rastpic.c" 23 | #include "ftraster.c" 24 | #include "ftrend1.c" 25 | 26 | 27 | /* END */ 28 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/smooth/smooth.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* smooth.c */ 4 | /* */ 5 | /* FreeType anti-aliasing rasterer module component (body only). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | #include "ftspic.c" 23 | #include "ftgrays.c" 24 | #include "ftsmooth.c" 25 | 26 | 27 | /* END */ 28 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/pshinter/pshinter.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pshinter.c */ 4 | /* */ 5 | /* FreeType PostScript Hinting module */ 6 | /* */ 7 | /* Copyright 2001-2016 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 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | #include "pshpic.c" 23 | #include "pshrec.c" 24 | #include "pshglob.c" 25 | #include "pshalgo.c" 26 | #include "pshmod.c" 27 | 28 | 29 | /* END */ 30 | -------------------------------------------------------------------------------- /Plugin/src/freetype/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_Module_Class, psaux_module_class ) 23 | FT_USE_MODULE( FT_Module_Class, psnames_module_class ) 24 | FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) 25 | FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_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_smooth_lcd_renderer_class ) 29 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) 30 | // FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) 31 | 32 | /* EOF */ 33 | -------------------------------------------------------------------------------- /Shaders/Unlit - FreeType Text.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/FreeType Text" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Alpha (A)", 2D) = "white" {} 6 | } 7 | 8 | SubShader 9 | { 10 | LOD 200 11 | 12 | Tags 13 | { 14 | "Queue" = "Transparent" 15 | "IgnoreProjector" = "True" 16 | "RenderType" = "Transparent" 17 | } 18 | 19 | Cull Off 20 | Lighting Off 21 | ZWrite Off 22 | Offset -1, -1 23 | Fog { Mode Off } 24 | Blend One OneMinusSrcAlpha 25 | 26 | Pass 27 | { 28 | CGPROGRAM 29 | #pragma vertex vert 30 | #pragma fragment frag 31 | #include "Unlit - FreeType Text.cginc" 32 | 33 | struct appdata_t 34 | { 35 | float4 vertex : POSITION; 36 | float4 color : COLOR; 37 | float2 texcoord : TEXCOORD0; 38 | }; 39 | 40 | struct v2f 41 | { 42 | float4 vertex : POSITION; 43 | float4 color1 : COLOR; 44 | float4 color2 : COLOR2; 45 | float2 texcoord : TEXCOORD0; 46 | }; 47 | 48 | sampler2D _MainTex; 49 | float4 _MainTex_ST; 50 | 51 | v2f vert (appdata_t v) 52 | { 53 | v2f o; 54 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 55 | decodeColor(v.color, o.color1, o.color2); 56 | o.texcoord = v.texcoord; 57 | 58 | return o; 59 | } 60 | 61 | float4 frag (v2f i) : COLOR 62 | { 63 | float2 alpha = decodeAlpha(tex2D(_MainTex, i.texcoord)) * float2(i.color1.a, i.color2.a * i.color1.a); 64 | float4 col; 65 | col.rgb = i.color1.rgb * alpha.x + i.color2.rgb * alpha.y * (1 - alpha.x); 66 | col.a = max(alpha.x, alpha.y); 67 | 68 | return col; 69 | } 70 | ENDCG 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/base/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. 3 | * MD5 Message-Digest Algorithm (RFC 1321). 4 | * 5 | * Homepage: 6 | * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 7 | * 8 | * Author: 9 | * Alexander Peslyak, better known as Solar Designer 10 | * 11 | * This software was written by Alexander Peslyak in 2001. No copyright is 12 | * claimed, and the software is hereby placed in the public domain. 13 | * In case this attempt to disclaim copyright and place the software in the 14 | * public domain is deemed null and void, then the software is 15 | * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the 16 | * general public under the following terms: 17 | * 18 | * Redistribution and use in source and binary forms, with or without 19 | * modification, are permitted. 20 | * 21 | * There's ABSOLUTELY NO WARRANTY, express or implied. 22 | * 23 | * See md5.c for more information. 24 | */ 25 | 26 | #ifdef HAVE_OPENSSL 27 | #include 28 | #elif !defined(_MD5_H) 29 | #define _MD5_H 30 | 31 | /* Any 32-bit or wider unsigned integer data type will do */ 32 | typedef unsigned int MD5_u32plus; 33 | 34 | typedef struct { 35 | MD5_u32plus lo, hi; 36 | MD5_u32plus a, b, c, d; 37 | unsigned char buffer[64]; 38 | MD5_u32plus block[16]; 39 | } MD5_CTX; 40 | 41 | extern void MD5_Init(MD5_CTX *ctx); 42 | extern void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size); 43 | extern void MD5_Final(unsigned char *result, MD5_CTX *ctx); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/sfnt/sfdriver.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* sfdriver.h */ 4 | /* */ 5 | /* High-level SFNT driver interface (specification). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 SFDRIVER_H_ 20 | #define SFDRIVER_H_ 21 | 22 | 23 | #include 24 | #include FT_MODULE_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_DECLARE_MODULE( sfnt_module_class ) 31 | 32 | 33 | FT_END_HEADER 34 | 35 | #endif /* SFDRIVER_H_ */ 36 | 37 | 38 | /* END */ 39 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/cff/cffdrivr.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* cffdrivr.h */ 4 | /* */ 5 | /* High-level OpenType driver interface (specification). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 CFFDRIVER_H_ 20 | #define CFFDRIVER_H_ 21 | 22 | 23 | #include 24 | #include FT_INTERNAL_DRIVER_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_DECLARE_DRIVER( cff_driver_class ) 31 | 32 | 33 | FT_END_HEADER 34 | 35 | #endif /* CFFDRIVER_H_ */ 36 | 37 | 38 | /* END */ 39 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/pshinter/pshmod.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pshmod.h */ 4 | /* */ 5 | /* PostScript hinter module interface (specification). */ 6 | /* */ 7 | /* Copyright 2001-2016 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 PSHMOD_H_ 20 | #define PSHMOD_H_ 21 | 22 | 23 | #include 24 | #include FT_MODULE_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_DECLARE_MODULE( pshinter_module_class ) 31 | 32 | 33 | FT_END_HEADER 34 | 35 | 36 | #endif /* PSHMOD_H_ */ 37 | 38 | 39 | /* END */ 40 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/psnames/psmodule.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* psmodule.h */ 4 | /* */ 5 | /* High-level PSNames module interface (specification). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 PSMODULE_H_ 20 | #define PSMODULE_H_ 21 | 22 | 23 | #include 24 | #include FT_MODULE_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_DECLARE_MODULE( psnames_module_class ) 31 | 32 | 33 | FT_END_HEADER 34 | 35 | #endif /* PSMODULE_H_ */ 36 | 37 | 38 | /* END */ 39 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/raster/ftrend1.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftrend1.h */ 4 | /* */ 5 | /* The FreeType glyph rasterizer interface (specification). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 FTREND1_H_ 20 | #define FTREND1_H_ 21 | 22 | 23 | #include 24 | #include FT_RENDER_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_DECLARE_RENDERER( ft_raster1_renderer_class ) 31 | 32 | 33 | FT_END_HEADER 34 | 35 | #endif /* FTREND1_H_ */ 36 | 37 | 38 | /* END */ 39 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/truetype/ttdriver.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttdriver.h */ 4 | /* */ 5 | /* High-level TrueType driver interface (specification). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 TTDRIVER_H_ 20 | #define TTDRIVER_H_ 21 | 22 | 23 | #include 24 | #include FT_INTERNAL_DRIVER_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_DECLARE_DRIVER( tt_driver_class ) 31 | 32 | 33 | FT_END_HEADER 34 | 35 | #endif /* TTDRIVER_H_ */ 36 | 37 | 38 | /* END */ 39 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/afblue.cin: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afblue.c */ 4 | /* */ 5 | /* Auto-fitter data for blue strings (body). */ 6 | /* */ 7 | /* Copyright 2013-2016 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 | #include "aftypes.h" 20 | 21 | 22 | FT_LOCAL_ARRAY_DEF( char ) 23 | af_blue_strings[] = 24 | { 25 | /* */ 26 | @AF_BLUE_STRINGS_ARRAY@ 27 | }; 28 | 29 | 30 | /* stringsets are specific to styles */ 31 | FT_LOCAL_ARRAY_DEF( AF_Blue_StringRec ) 32 | af_blue_stringsets[] = 33 | { 34 | /* */ 35 | @AF_BLUE_STRINGSETS_ARRAY@ 36 | }; 37 | 38 | 39 | /* END */ 40 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/afindic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afindic.h */ 4 | /* */ 5 | /* Auto-fitter hinting routines for Indic writing system */ 6 | /* (specification). */ 7 | /* */ 8 | /* Copyright 2007-2016 by */ 9 | /* Rahul Bhalerao , . */ 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 | #ifndef AFINDIC_H_ 21 | #define AFINDIC_H_ 22 | 23 | #include "afhints.h" 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | /* the `indic' writing system */ 30 | 31 | AF_DECLARE_WRITING_SYSTEM_CLASS( af_indic_writing_system_class ) 32 | 33 | 34 | /* */ 35 | 36 | FT_END_HEADER 37 | 38 | #endif /* AFINDIC_H_ */ 39 | 40 | 41 | /* END */ 42 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/afdummy.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afdummy.h */ 4 | /* */ 5 | /* Auto-fitter dummy routines to be used if no hinting should be */ 6 | /* performed (specification). */ 7 | /* */ 8 | /* Copyright 2003-2016 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 | #ifndef AFDUMMY_H_ 21 | #define AFDUMMY_H_ 22 | 23 | #include "aftypes.h" 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | /* A dummy writing system used when no hinting should be performed. */ 29 | 30 | AF_DECLARE_WRITING_SYSTEM_CLASS( af_dummy_writing_system_class ) 31 | 32 | /* */ 33 | 34 | FT_END_HEADER 35 | 36 | 37 | #endif /* AFDUMMY_H_ */ 38 | 39 | 40 | /* END */ 41 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/cff/cff.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* cff.c */ 4 | /* */ 5 | /* FreeType OpenType driver component (body only). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | 23 | #include "cffpic.c" 24 | #include "cffdrivr.c" 25 | #include "cffparse.c" 26 | #include "cffload.c" 27 | #include "cffobjs.c" 28 | #include "cffgload.c" 29 | #include "cffcmap.c" 30 | 31 | #include "cf2arrst.c" 32 | #include "cf2blues.c" 33 | #include "cf2error.c" 34 | #include "cf2font.c" 35 | #include "cf2ft.c" 36 | #include "cf2hints.c" 37 | #include "cf2intrp.c" 38 | #include "cf2read.c" 39 | #include "cf2stack.c" 40 | 41 | /* END */ 42 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/base/ftbase.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftbase.c */ 4 | /* */ 5 | /* Single object library component (body only). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 | #include 20 | 21 | #define FT_MAKE_OPTION_SINGLE_OBJECT 22 | 23 | #include "ftpic.c" 24 | #include "basepic.c" 25 | #include "ftadvanc.c" 26 | #include "ftcalc.c" 27 | #include "ftdbgmem.c" 28 | #include "ftgloadr.c" 29 | #include "fthash.c" 30 | #include "ftobjs.c" 31 | #include "ftoutln.c" 32 | #include "ftrfork.c" 33 | #include "ftsnames.c" 34 | #include "ftstream.c" 35 | #include "fttrigon.c" 36 | #include "ftutil.c" 37 | 38 | #ifdef FT_MACINTOSH 39 | #include "ftmac.c" 40 | #endif 41 | 42 | /* END */ 43 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/sfnt/sfnt.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* sfnt.c */ 4 | /* */ 5 | /* Single object library component. */ 6 | /* */ 7 | /* Copyright 1996-2016 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 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | #include "sfntpic.c" 23 | #include "ttload.c" 24 | #include "ttmtx.c" 25 | #include "ttcmap.c" 26 | #include "ttkern.c" 27 | #include "sfobjs.c" 28 | #include "sfdriver.c" 29 | 30 | #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS 31 | #include "pngshim.c" 32 | #include "ttsbit.c" 33 | #endif 34 | 35 | #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES 36 | #include "ttpost.c" 37 | #endif 38 | 39 | #ifdef TT_CONFIG_OPTION_BDF 40 | #include "ttbdf.c" 41 | #endif 42 | 43 | /* END */ 44 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/sfnt/ttbdf.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttbdf.h */ 4 | /* */ 5 | /* TrueType and OpenType embedded BDF properties (specification). */ 6 | /* */ 7 | /* Copyright 2005-2016 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 TTBDF_H_ 20 | #define TTBDF_H_ 21 | 22 | 23 | #include 24 | #include "ttload.h" 25 | #include FT_BDF_H 26 | 27 | 28 | FT_BEGIN_HEADER 29 | 30 | 31 | FT_LOCAL( void ) 32 | tt_face_free_bdf_props( TT_Face face ); 33 | 34 | 35 | FT_LOCAL( FT_Error ) 36 | tt_face_find_bdf_prop( TT_Face face, 37 | const char* property_name, 38 | BDF_PropertyRec *aprop ); 39 | 40 | 41 | FT_END_HEADER 42 | 43 | #endif /* TTBDF_H_ */ 44 | 45 | 46 | /* END */ 47 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/truetype/truetype.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* truetype.c */ 4 | /* */ 5 | /* FreeType TrueType driver component (body only). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | #include "ttpic.c" 23 | #include "ttdriver.c" /* driver interface */ 24 | #include "ttpload.c" /* tables loader */ 25 | #include "ttgload.c" /* glyph loader */ 26 | #include "ttobjs.c" /* object manager */ 27 | 28 | #ifdef TT_USE_BYTECODE_INTERPRETER 29 | #include "ttinterp.c" 30 | #include "ttsubpix.c" 31 | #endif 32 | 33 | #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT 34 | #include "ttgxvar.c" /* gx distortable font */ 35 | #endif 36 | 37 | 38 | /* END */ 39 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/autofit.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* autofit.c */ 4 | /* */ 5 | /* Auto-fitter module (body). */ 6 | /* */ 7 | /* Copyright 2003-2016 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 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | #include 21 | #include "afpic.c" 22 | #include "afangles.c" 23 | #include "afblue.c" 24 | #include "afglobal.c" 25 | #include "afhints.c" 26 | 27 | #include "afranges.c" 28 | 29 | #include "afdummy.c" 30 | #include "aflatin.c" 31 | #ifdef FT_OPTION_AUTOFIT2 32 | #include "aflatin2.c" 33 | #endif 34 | #include "afcjk.c" 35 | #include "afindic.c" 36 | 37 | #include "afshaper.c" 38 | 39 | #include "afloader.c" 40 | #include "afmodule.c" 41 | 42 | #ifdef AF_CONFIG_OPTION_USE_WARPER 43 | #include "afwarp.c" 44 | #endif 45 | 46 | /* END */ 47 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/smooth/ftsmooth.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftsmooth.h */ 4 | /* */ 5 | /* Anti-aliasing renderer interface (specification). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 FTSMOOTH_H_ 20 | #define FTSMOOTH_H_ 21 | 22 | 23 | #include 24 | #include FT_RENDER_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | #ifndef FT_CONFIG_OPTION_NO_STD_RASTER 31 | FT_DECLARE_RENDERER( ft_std_renderer_class ) 32 | #endif 33 | 34 | #ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER 35 | FT_DECLARE_RENDERER( ft_smooth_renderer_class ) 36 | 37 | FT_DECLARE_RENDERER( ft_smooth_lcd_renderer_class ) 38 | 39 | FT_DECLARE_RENDERER( ft_smooth_lcd_v_renderer_class ) 40 | #endif 41 | 42 | 43 | 44 | FT_END_HEADER 45 | 46 | #endif /* FTSMOOTH_H_ */ 47 | 48 | 49 | /* END */ 50 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/sfnt/ttpost.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttpost.h */ 4 | /* */ 5 | /* PostScript name table processing for TrueType and OpenType fonts */ 6 | /* (specification). */ 7 | /* */ 8 | /* Copyright 1996-2016 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 | #ifndef TTPOST_H_ 21 | #define TTPOST_H_ 22 | 23 | 24 | #include 25 | #include FT_CONFIG_CONFIG_H 26 | #include FT_INTERNAL_TRUETYPE_TYPES_H 27 | 28 | 29 | FT_BEGIN_HEADER 30 | 31 | 32 | FT_LOCAL( FT_Error ) 33 | tt_face_get_ps_name( TT_Face face, 34 | FT_UInt idx, 35 | FT_String** PSname ); 36 | 37 | FT_LOCAL( void ) 38 | tt_face_free_ps_names( TT_Face face ); 39 | 40 | 41 | FT_END_HEADER 42 | 43 | #endif /* TTPOST_H_ */ 44 | 45 | 46 | /* END */ 47 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/freetype/internal/services/svtteng.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svtteng.h */ 4 | /* */ 5 | /* The FreeType TrueType engine query service (specification). */ 6 | /* */ 7 | /* Copyright 2006-2016 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 FT_INTERNAL_SERVICE_H 23 | #include FT_MODULE_H 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 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/freetype/internal/services/svwinfnt.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svwinfnt.h */ 4 | /* */ 5 | /* The FreeType Windows FNT/FONT service (specification). */ 6 | /* */ 7 | /* Copyright 2003-2016 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 FT_INTERNAL_SERVICE_H 23 | #include FT_WINFONTS_H 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 | -------------------------------------------------------------------------------- /Shaders/Unlit - FreeType Text 1.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/FreeType Text 1" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Alpha (A)", 2D) = "white" {} 6 | } 7 | 8 | SubShader 9 | { 10 | LOD 200 11 | 12 | Tags 13 | { 14 | "Queue" = "Transparent" 15 | "IgnoreProjector" = "True" 16 | "RenderType" = "Transparent" 17 | } 18 | 19 | Cull Off 20 | Lighting Off 21 | ZWrite Off 22 | Offset -1, -1 23 | Fog { Mode Off } 24 | Blend One OneMinusSrcAlpha 25 | 26 | Pass 27 | { 28 | CGPROGRAM 29 | #pragma vertex vert 30 | #pragma fragment frag 31 | #include "Unlit - FreeType Text.cginc" 32 | 33 | struct appdata_t 34 | { 35 | float4 vertex : POSITION; 36 | float4 color : COLOR; 37 | float2 texcoord : TEXCOORD0; 38 | }; 39 | 40 | struct v2f 41 | { 42 | float4 vertex : POSITION; 43 | float4 color1 : COLOR; 44 | float4 color2 : COLOR2; 45 | float2 texcoord : TEXCOORD0; 46 | float2 worldPos : TEXCOORD1; 47 | }; 48 | 49 | sampler2D _MainTex; 50 | float4 _MainTex_ST; 51 | float4 _ClipRange0 = float4(0.0, 0.0, 1.0, 1.0); 52 | float2 _ClipArgs0 = float2(1000.0, 1000.0); 53 | 54 | v2f vert (appdata_t v) 55 | { 56 | v2f o; 57 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 58 | decodeColor(v.color, o.color1, o.color2); 59 | o.texcoord = v.texcoord; 60 | o.worldPos = v.vertex.xy * _ClipRange0.zw + _ClipRange0.xy; 61 | 62 | return o; 63 | } 64 | 65 | float4 frag (v2f i) : COLOR 66 | { 67 | float2 alpha = decodeAlpha(tex2D(_MainTex, i.texcoord)) * float2(i.color1.a, i.color2.a * i.color1.a); 68 | float4 col; 69 | col.rgb = i.color1.rgb * alpha.x + i.color2.rgb * alpha.y * (1 - alpha.x); 70 | col.a = max(alpha.x, alpha.y); 71 | 72 | float2 factor = (float2(1.0, 1.0) - abs(i.worldPos)) * _ClipArgs0; 73 | 74 | col.a *= clamp( min(factor.x, factor.y), 0.0, 1.0); 75 | 76 | return col; 77 | } 78 | ENDCG 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/afranges.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afranges.h */ 4 | /* */ 5 | /* Auto-fitter Unicode script ranges (specification). */ 6 | /* */ 7 | /* Copyright 2013-2016 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 AFRANGES_H_ 20 | #define AFRANGES_H_ 21 | 22 | 23 | #include "aftypes.h" 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | #undef SCRIPT 29 | #define SCRIPT( s, S, d, h, H, ss ) \ 30 | extern const AF_Script_UniRangeRec af_ ## s ## _uniranges[]; 31 | 32 | #include "afscript.h" 33 | 34 | #undef SCRIPT 35 | #define SCRIPT( s, S, d, h, H, ss ) \ 36 | extern const AF_Script_UniRangeRec af_ ## s ## _nonbase_uniranges[]; 37 | 38 | #include "afscript.h" 39 | 40 | /* */ 41 | 42 | FT_END_HEADER 43 | 44 | #endif /* AFRANGES_H_ */ 45 | 46 | 47 | /* END */ 48 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/aflatin2.h: -------------------------------------------------------------------------------- 1 | /* ATTENTION: This file doesn't compile. It is only here as a reference */ 2 | /* of an alternative latin hinting algorithm that was always */ 3 | /* marked as experimental. */ 4 | 5 | 6 | /***************************************************************************/ 7 | /* */ 8 | /* aflatin2.h */ 9 | /* */ 10 | /* Auto-fitter hinting routines for latin writing system */ 11 | /* (specification). */ 12 | /* */ 13 | /* Copyright 2003-2016 by */ 14 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 15 | /* */ 16 | /* This file is part of the FreeType project, and may only be used, */ 17 | /* modified, and distributed under the terms of the FreeType project */ 18 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 19 | /* this file you indicate that you have read the license and */ 20 | /* understand and accept it fully. */ 21 | /* */ 22 | /***************************************************************************/ 23 | 24 | 25 | #ifndef AFLATIN2_H_ 26 | #define AFLATIN2_H_ 27 | 28 | #include "afhints.h" 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | 34 | /* the `latin' writing system */ 35 | 36 | AF_DECLARE_WRITING_SYSTEM_CLASS( af_latin2_writing_system_class ) 37 | 38 | 39 | /* */ 40 | 41 | FT_END_HEADER 42 | 43 | #endif /* AFLATIN_H_ */ 44 | 45 | 46 | /* END */ 47 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/freetype/internal/services/svkern.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svkern.h */ 4 | /* */ 5 | /* The FreeType Kerning service (specification). */ 6 | /* */ 7 | /* Copyright 2006-2016 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 FT_INTERNAL_SERVICE_H 23 | #include FT_TRUETYPE_TABLES_H 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 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/cff/cfferrs.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* cfferrs.h */ 4 | /* */ 5 | /* CFF error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2001-2016 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 CFF error enumeration constants. */ 22 | /* */ 23 | /*************************************************************************/ 24 | 25 | #ifndef CFFERRS_H_ 26 | #define CFFERRS_H_ 27 | 28 | #include FT_MODULE_ERRORS_H 29 | 30 | #undef FTERRORS_H_ 31 | 32 | #undef FT_ERR_PREFIX 33 | #define FT_ERR_PREFIX CFF_Err_ 34 | #define FT_ERR_BASE FT_Mod_Err_CFF 35 | 36 | 37 | #include FT_ERRORS_H 38 | 39 | #endif /* CFFERRS_H_ */ 40 | 41 | 42 | /* END */ 43 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/sfnt/sferrors.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* sferrors.h */ 4 | /* */ 5 | /* SFNT error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2001-2016 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 SFNT error enumeration constants. */ 22 | /* */ 23 | /*************************************************************************/ 24 | 25 | #ifndef SFERRORS_H_ 26 | #define SFERRORS_H_ 27 | 28 | #include FT_MODULE_ERRORS_H 29 | 30 | #undef FTERRORS_H_ 31 | 32 | #undef FT_ERR_PREFIX 33 | #define FT_ERR_PREFIX SFNT_Err_ 34 | #define FT_ERR_BASE FT_Mod_Err_SFNT 35 | 36 | #include FT_ERRORS_H 37 | 38 | #endif /* SFERRORS_H_ */ 39 | 40 | 41 | /* END */ 42 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/pshinter/pshnterr.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pshnterr.h */ 4 | /* */ 5 | /* PS Hinter error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2003-2016 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 PSHinter error enumeration constants. */ 22 | /* */ 23 | /*************************************************************************/ 24 | 25 | #ifndef PSHNTERR_H_ 26 | #define PSHNTERR_H_ 27 | 28 | #include FT_MODULE_ERRORS_H 29 | 30 | #undef FTERRORS_H_ 31 | 32 | #undef FT_ERR_PREFIX 33 | #define FT_ERR_PREFIX PSH_Err_ 34 | #define FT_ERR_BASE FT_Mod_Err_PShinter 35 | 36 | #include FT_ERRORS_H 37 | 38 | #endif /* PSHNTERR_H_ */ 39 | 40 | 41 | /* END */ 42 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/raster/ftraster.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftraster.h */ 4 | /* */ 5 | /* The FreeType glyph rasterizer (specification). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 FTRASTER_H_ 20 | #define FTRASTER_H_ 21 | 22 | 23 | #include 24 | #include FT_CONFIG_CONFIG_H 25 | #include FT_IMAGE_H 26 | 27 | 28 | FT_BEGIN_HEADER 29 | 30 | 31 | /*************************************************************************/ 32 | /* */ 33 | /* Uncomment the following line if you are using ftraster.c as a */ 34 | /* standalone module, fully independent of FreeType. */ 35 | /* */ 36 | /* #define STANDALONE_ */ 37 | 38 | FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_standard_raster; 39 | 40 | 41 | FT_END_HEADER 42 | 43 | #endif /* FTRASTER_H_ */ 44 | 45 | 46 | /* END */ 47 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/aferrors.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* aferrors.h */ 4 | /* */ 5 | /* Autofitter error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2005-2016 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 Autofitter error enumeration */ 22 | /* constants. */ 23 | /* */ 24 | /*************************************************************************/ 25 | 26 | #ifndef AFERRORS_H_ 27 | #define AFERRORS_H_ 28 | 29 | #include FT_MODULE_ERRORS_H 30 | 31 | #undef FTERRORS_H_ 32 | 33 | #undef FT_ERR_PREFIX 34 | #define FT_ERR_PREFIX AF_Err_ 35 | #define FT_ERR_BASE FT_Mod_Err_Autofit 36 | 37 | #include FT_ERRORS_H 38 | 39 | #endif /* AFERRORS_H_ */ 40 | 41 | 42 | /* END */ 43 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/raster/rasterrs.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* rasterrs.h */ 4 | /* */ 5 | /* monochrome renderer error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2001-2016 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 monochrome renderer error enumeration */ 22 | /* constants. */ 23 | /* */ 24 | /*************************************************************************/ 25 | 26 | #ifndef RASTERRS_H_ 27 | #define RASTERRS_H_ 28 | 29 | #include FT_MODULE_ERRORS_H 30 | 31 | #undef FTERRORS_H_ 32 | 33 | #undef FT_ERR_PREFIX 34 | #define FT_ERR_PREFIX Raster_Err_ 35 | #define FT_ERR_BASE FT_Mod_Err_Raster 36 | 37 | #include FT_ERRORS_H 38 | 39 | #endif /* RASTERRS_H_ */ 40 | 41 | 42 | /* END */ 43 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/smooth/ftsmerrs.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftsmerrs.h */ 4 | /* */ 5 | /* smooth renderer error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2001-2016 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 smooth renderer error enumeration */ 22 | /* constants. */ 23 | /* */ 24 | /*************************************************************************/ 25 | 26 | #ifndef FTSMERRS_H_ 27 | #define FTSMERRS_H_ 28 | 29 | #include FT_MODULE_ERRORS_H 30 | 31 | #undef FTERRORS_H_ 32 | 33 | #undef FT_ERR_PREFIX 34 | #define FT_ERR_PREFIX Smooth_Err_ 35 | #define FT_ERR_BASE FT_Mod_Err_Smooth 36 | 37 | #include FT_ERRORS_H 38 | 39 | #endif /* FTSMERRS_H_ */ 40 | 41 | 42 | /* END */ 43 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/truetype/tterrors.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* tterrors.h */ 4 | /* */ 5 | /* TrueType error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2001-2016 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 TrueType error enumeration */ 22 | /* constants. */ 23 | /* */ 24 | /*************************************************************************/ 25 | 26 | #ifndef TTERRORS_H_ 27 | #define TTERRORS_H_ 28 | 29 | #include FT_MODULE_ERRORS_H 30 | 31 | #undef FTERRORS_H_ 32 | 33 | #undef FT_ERR_PREFIX 34 | #define FT_ERR_PREFIX TT_Err_ 35 | #define FT_ERR_BASE FT_Mod_Err_TrueType 36 | 37 | #include FT_ERRORS_H 38 | 39 | #endif /* TTERRORS_H_ */ 40 | 41 | 42 | /* END */ 43 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/base/ftfntfmt.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftfntfmt.c */ 4 | /* */ 5 | /* FreeType utility file for font formats (body). */ 6 | /* */ 7 | /* Copyright 2002-2016 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 | #include 20 | #include FT_FONT_FORMATS_H 21 | #include FT_INTERNAL_OBJECTS_H 22 | #include FT_SERVICE_FONT_FORMAT_H 23 | 24 | 25 | /* documentation is in ftfntfmt.h */ 26 | 27 | FT_EXPORT_DEF( const char* ) 28 | FT_Get_Font_Format( FT_Face face ) 29 | { 30 | const char* result = NULL; 31 | 32 | 33 | if ( face ) 34 | FT_FACE_FIND_SERVICE( face, result, FONT_FORMAT ); 35 | 36 | return result; 37 | } 38 | 39 | 40 | /* deprecated function name; retained for ABI compatibility */ 41 | 42 | FT_EXPORT_DEF( const char* ) 43 | FT_Get_X11_Font_Format( FT_Face face ) 44 | { 45 | const char* result = NULL; 46 | 47 | 48 | if ( face ) 49 | FT_FACE_FIND_SERVICE( face, result, FONT_FORMAT ); 50 | 51 | return result; 52 | } 53 | 54 | 55 | /* END */ 56 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/psnames/psnamerr.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* psnamerr.h */ 4 | /* */ 5 | /* PS names module error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2001-2016 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 PS names module error enumeration */ 22 | /* constants. */ 23 | /* */ 24 | /*************************************************************************/ 25 | 26 | #ifndef PSNAMERR_H_ 27 | #define PSNAMERR_H_ 28 | 29 | #include FT_MODULE_ERRORS_H 30 | 31 | #undef FTERRORS_H_ 32 | 33 | #undef FT_ERR_PREFIX 34 | #define FT_ERR_PREFIX PSnames_Err_ 35 | #define FT_ERR_BASE FT_Mod_Err_PSnames 36 | 37 | #include FT_ERRORS_H 38 | 39 | #endif /* PSNAMERR_H_ */ 40 | 41 | 42 | /* END */ 43 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/sfnt/ttkern.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttkern.h */ 4 | /* */ 5 | /* Load the basic TrueType kerning table. This doesn't handle */ 6 | /* kerning data within the GPOS table at the moment. */ 7 | /* */ 8 | /* Copyright 1996-2016 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 | #ifndef TTKERN_H_ 21 | #define TTKERN_H_ 22 | 23 | 24 | #include 25 | #include FT_INTERNAL_STREAM_H 26 | #include FT_INTERNAL_TRUETYPE_TYPES_H 27 | 28 | 29 | FT_BEGIN_HEADER 30 | 31 | 32 | FT_LOCAL( FT_Error ) 33 | tt_face_load_kern( TT_Face face, 34 | FT_Stream stream ); 35 | 36 | FT_LOCAL( void ) 37 | tt_face_done_kern( TT_Face face ); 38 | 39 | FT_LOCAL( FT_Int ) 40 | tt_face_get_kerning( TT_Face face, 41 | FT_UInt left_glyph, 42 | FT_UInt right_glyph ); 43 | 44 | #define TT_FACE_HAS_KERNING( face ) ( (face)->kern_avail_bits != 0 ) 45 | 46 | 47 | FT_END_HEADER 48 | 49 | #endif /* TTKERN_H_ */ 50 | 51 | 52 | /* END */ 53 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/afmodule.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afmodule.h */ 4 | /* */ 5 | /* Auto-fitter module implementation (specification). */ 6 | /* */ 7 | /* Copyright 2003-2016 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 AFMODULE_H_ 20 | #define AFMODULE_H_ 21 | 22 | #include 23 | #include FT_INTERNAL_OBJECTS_H 24 | #include FT_MODULE_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | /* 31 | * This is the `extended' FT_Module structure that holds the 32 | * autofitter's global data. 33 | */ 34 | 35 | typedef struct AF_ModuleRec_ 36 | { 37 | FT_ModuleRec root; 38 | 39 | FT_UInt fallback_style; 40 | FT_UInt default_script; 41 | #ifdef AF_CONFIG_OPTION_USE_WARPER 42 | FT_Bool warping; 43 | #endif 44 | FT_Bool no_stem_darkening; 45 | FT_Int darken_params[8]; 46 | 47 | } AF_ModuleRec, *AF_Module; 48 | 49 | 50 | FT_DECLARE_MODULE( autofit_module_class ) 51 | 52 | 53 | FT_END_HEADER 54 | 55 | #endif /* AFMODULE_H_ */ 56 | 57 | 58 | /* END */ 59 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/base/ftpatent.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftpatent.c */ 4 | /* */ 5 | /* FreeType API for checking patented TrueType bytecode instructions */ 6 | /* (body). Obsolete, retained for backwards compatibility. */ 7 | /* */ 8 | /* Copyright 2007-2016 by */ 9 | /* David Turner. */ 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 | #include 20 | #include FT_FREETYPE_H 21 | #include FT_TRUETYPE_TAGS_H 22 | #include FT_INTERNAL_OBJECTS_H 23 | #include FT_INTERNAL_STREAM_H 24 | #include FT_SERVICE_SFNT_H 25 | #include FT_SERVICE_TRUETYPE_GLYF_H 26 | 27 | 28 | /* documentation is in freetype.h */ 29 | 30 | FT_EXPORT_DEF( FT_Bool ) 31 | FT_Face_CheckTrueTypePatents( FT_Face face ) 32 | { 33 | FT_UNUSED( face ); 34 | 35 | return FALSE; 36 | } 37 | 38 | 39 | /* documentation is in freetype.h */ 40 | 41 | FT_EXPORT_DEF( FT_Bool ) 42 | FT_Face_SetUnpatentedHinting( FT_Face face, 43 | FT_Bool value ) 44 | { 45 | FT_UNUSED( face ); 46 | FT_UNUSED( value ); 47 | 48 | return FALSE; 49 | } 50 | 51 | /* END */ 52 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/sfnt/ttcmapc.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttcmapc.h */ 4 | /* */ 5 | /* TT CMAP classes definitions (specification only). */ 6 | /* */ 7 | /* Copyright 2009-2016 by */ 8 | /* Oran Agra and Mickey Gabel. */ 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 | #ifdef TT_CONFIG_CMAP_FORMAT_0 20 | TTCMAPCITEM( tt_cmap0_class_rec ) 21 | #endif 22 | 23 | #ifdef TT_CONFIG_CMAP_FORMAT_2 24 | TTCMAPCITEM( tt_cmap2_class_rec ) 25 | #endif 26 | 27 | #ifdef TT_CONFIG_CMAP_FORMAT_4 28 | TTCMAPCITEM( tt_cmap4_class_rec ) 29 | #endif 30 | 31 | #ifdef TT_CONFIG_CMAP_FORMAT_6 32 | TTCMAPCITEM( tt_cmap6_class_rec ) 33 | #endif 34 | 35 | #ifdef TT_CONFIG_CMAP_FORMAT_8 36 | TTCMAPCITEM( tt_cmap8_class_rec ) 37 | #endif 38 | 39 | #ifdef TT_CONFIG_CMAP_FORMAT_10 40 | TTCMAPCITEM( tt_cmap10_class_rec ) 41 | #endif 42 | 43 | #ifdef TT_CONFIG_CMAP_FORMAT_12 44 | TTCMAPCITEM( tt_cmap12_class_rec ) 45 | #endif 46 | 47 | #ifdef TT_CONFIG_CMAP_FORMAT_13 48 | TTCMAPCITEM( tt_cmap13_class_rec ) 49 | #endif 50 | 51 | #ifdef TT_CONFIG_CMAP_FORMAT_14 52 | TTCMAPCITEM( tt_cmap14_class_rec ) 53 | #endif 54 | 55 | 56 | /* END */ 57 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/base/ftwinfnt.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftwinfnt.c */ 4 | /* */ 5 | /* FreeType API for accessing Windows FNT specific info (body). */ 6 | /* */ 7 | /* Copyright 2003-2016 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 | #include 20 | #include FT_INTERNAL_DEBUG_H 21 | #include FT_WINFONTS_H 22 | #include FT_INTERNAL_OBJECTS_H 23 | #include FT_SERVICE_WINFNT_H 24 | 25 | 26 | /* documentation is in ftwinfnt.h */ 27 | 28 | FT_EXPORT_DEF( FT_Error ) 29 | FT_Get_WinFNT_Header( FT_Face face, 30 | FT_WinFNT_HeaderRec *header ) 31 | { 32 | FT_Service_WinFnt service; 33 | FT_Error error; 34 | 35 | 36 | if ( !face ) 37 | return FT_THROW( Invalid_Face_Handle ); 38 | 39 | if ( !header ) 40 | return FT_THROW( Invalid_Argument ); 41 | 42 | FT_FACE_LOOKUP_SERVICE( face, service, WINFNT ); 43 | 44 | if ( service ) 45 | error = service->get_header( face, header ); 46 | else 47 | error = FT_THROW( Invalid_Argument ); 48 | 49 | return error; 50 | } 51 | 52 | 53 | /* END */ 54 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/freetype/internal/services/svotval.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svotval.h */ 4 | /* */ 5 | /* The FreeType OpenType validation service (specification). */ 6 | /* */ 7 | /* Copyright 2004-2016 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 FT_OPENTYPE_VALIDATE_H 23 | #include FT_INTERNAL_VALIDATE_H 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 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/base/ftpic.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftpic.c */ 4 | /* */ 5 | /* The FreeType position independent code services (body). */ 6 | /* */ 7 | /* Copyright 2009-2016 by */ 8 | /* Oran Agra and Mickey Gabel. */ 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 | #include 20 | #include FT_FREETYPE_H 21 | #include FT_INTERNAL_OBJECTS_H 22 | #include "basepic.h" 23 | 24 | #ifdef FT_CONFIG_OPTION_PIC 25 | 26 | /* documentation is in ftpic.h */ 27 | 28 | FT_BASE_DEF( FT_Error ) 29 | ft_pic_container_init( FT_Library library ) 30 | { 31 | FT_PIC_Container* pic_container = &library->pic_container; 32 | FT_Error error; 33 | 34 | 35 | FT_MEM_SET( pic_container, 0, sizeof ( *pic_container ) ); 36 | 37 | error = ft_base_pic_init( library ); 38 | if ( error ) 39 | return error; 40 | 41 | return FT_Err_Ok; 42 | } 43 | 44 | 45 | /* Destroy the contents of the container. */ 46 | FT_BASE_DEF( void ) 47 | ft_pic_container_destroy( FT_Library library ) 48 | { 49 | ft_base_pic_free( library ); 50 | } 51 | 52 | #endif /* FT_CONFIG_OPTION_PIC */ 53 | 54 | 55 | /* END */ 56 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/sfnt/pngshim.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pngshim.h */ 4 | /* */ 5 | /* PNG Bitmap glyph support. */ 6 | /* */ 7 | /* Copyright 2013-2016 by */ 8 | /* Google, Inc. */ 9 | /* Written by Stuart Gill and Behdad Esfahbod. */ 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 | #ifndef PNGSHIM_H_ 21 | #define PNGSHIM_H_ 22 | 23 | 24 | #include 25 | #include "ttload.h" 26 | 27 | 28 | FT_BEGIN_HEADER 29 | 30 | #ifdef FT_CONFIG_OPTION_USE_PNG 31 | 32 | FT_LOCAL( FT_Error ) 33 | Load_SBit_Png( FT_GlyphSlot slot, 34 | FT_Int x_offset, 35 | FT_Int y_offset, 36 | FT_Int pix_bits, 37 | TT_SBit_Metrics metrics, 38 | FT_Memory memory, 39 | FT_Byte* data, 40 | FT_UInt png_len, 41 | FT_Bool populate_map_and_metrics, 42 | FT_Bool metrics_only ); 43 | 44 | #endif 45 | 46 | FT_END_HEADER 47 | 48 | #endif /* PNGSHIM_H_ */ 49 | 50 | 51 | /* END */ 52 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/sfnt/ttmtx.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttmtx.h */ 4 | /* */ 5 | /* Load the metrics tables common to TTF and OTF fonts (specification). */ 6 | /* */ 7 | /* Copyright 2006-2016 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 TTMTX_H_ 20 | #define TTMTX_H_ 21 | 22 | 23 | #include 24 | #include FT_INTERNAL_STREAM_H 25 | #include FT_INTERNAL_TRUETYPE_TYPES_H 26 | 27 | 28 | FT_BEGIN_HEADER 29 | 30 | 31 | FT_LOCAL( FT_Error ) 32 | tt_face_load_hhea( TT_Face face, 33 | FT_Stream stream, 34 | FT_Bool vertical ); 35 | 36 | 37 | FT_LOCAL( FT_Error ) 38 | tt_face_load_hmtx( TT_Face face, 39 | FT_Stream stream, 40 | FT_Bool vertical ); 41 | 42 | 43 | FT_LOCAL( void ) 44 | tt_face_get_metrics( TT_Face face, 45 | FT_Bool vertical, 46 | FT_UInt gindex, 47 | FT_Short* abearing, 48 | FT_UShort* aadvance ); 49 | 50 | FT_END_HEADER 51 | 52 | #endif /* TTMTX_H_ */ 53 | 54 | 55 | /* END */ 56 | -------------------------------------------------------------------------------- /Plugin/src/unity-freetype/font.h: -------------------------------------------------------------------------------- 1 | #ifndef FONT_H 2 | #define FONT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | struct Rect 13 | { 14 | int minX; 15 | int maxX; 16 | int minY; 17 | int maxY; 18 | 19 | void Include(int x, int y) 20 | { 21 | #define min(a, b) (a < b ? a : b) 22 | #define max(a, b) (a > b ? a : b) 23 | minX = min(minX, x); 24 | maxX = max(maxX, x); 25 | minY = min(minY, y); 26 | maxY = max(maxY, y); 27 | #undef min 28 | #undef max 29 | } 30 | 31 | int width() { return maxX - minX + 1; } 32 | int height() { return maxY - minY + 1; } 33 | }; 34 | 35 | struct Span 36 | { 37 | int x; 38 | int y; 39 | int width; 40 | int coverage; 41 | }; 42 | typedef std::vector Spans; 43 | 44 | struct FreeTypeGlyph 45 | { 46 | int code; 47 | int bearing; 48 | int advance; 49 | int minX; 50 | int maxX; 51 | int minY; 52 | int maxY; 53 | 54 | int width; 55 | int height; 56 | int bpp; 57 | }; 58 | 59 | struct FreeTypeContext 60 | { 61 | FreeTypeContext() 62 | : m_face(nullptr) 63 | , m_stroker(nullptr) 64 | , lastSize(0) 65 | , lastStrokeSize(0) 66 | {} 67 | 68 | FreeTypeContext(const char* pPath); 69 | FreeTypeContext(const FT_Byte* pData, unsigned int length); 70 | ~FreeTypeContext(); 71 | 72 | void SetSize(int _size); 73 | void SetStroker(int _size); 74 | 75 | public: 76 | FT_Face m_face; 77 | FT_Stroker m_stroker; 78 | FT_Library m_FTlibrary; 79 | 80 | private: 81 | int lastSize; 82 | int lastStrokeSize; 83 | FT_Byte* m_pData; 84 | }; 85 | 86 | class FontContext 87 | { 88 | public: 89 | FontContext(const char* pPath); 90 | FontContext(const FT_Byte* pData, unsigned int length); 91 | 92 | const FT_Byte* GetGlyph(int code, FreeTypeGlyph& glyph, int fontSize, int outlineSize = 0, bool bold = false); 93 | private: 94 | void RenderSpans(FT_Outline* pOutline, Spans* spans); 95 | 96 | private: 97 | FreeTypeContext m_context; 98 | }; 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/freetype/internal/services/svfntfmt.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svfntfmt.h */ 4 | /* */ 5 | /* The FreeType font format service (specification only). */ 6 | /* */ 7 | /* Copyright 2003-2016 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 FT_INTERNAL_SERVICE_H 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 31 | * is a 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 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/pshinter/pshpic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pshpic.h */ 4 | /* */ 5 | /* The FreeType position independent code services for pshinter module. */ 6 | /* */ 7 | /* Copyright 2009-2016 by */ 8 | /* Oran Agra and Mickey Gabel. */ 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 PSHPIC_H_ 20 | #define PSHPIC_H_ 21 | 22 | 23 | #include FT_INTERNAL_PIC_H 24 | 25 | 26 | #ifndef FT_CONFIG_OPTION_PIC 27 | 28 | #define PSHINTER_INTERFACE_GET pshinter_interface 29 | 30 | #else /* FT_CONFIG_OPTION_PIC */ 31 | 32 | #include FT_INTERNAL_POSTSCRIPT_HINTS_H 33 | 34 | FT_BEGIN_HEADER 35 | 36 | typedef struct PSHinterPIC_ 37 | { 38 | PSHinter_Interface pshinter_interface; 39 | 40 | } PSHinterPIC; 41 | 42 | 43 | #define GET_PIC( lib ) ( (PSHinterPIC*)( (lib)->pic_container.pshinter ) ) 44 | 45 | #define PSHINTER_INTERFACE_GET ( GET_PIC( library )->pshinter_interface ) 46 | 47 | /* see pshpic.c for the implementation */ 48 | void 49 | pshinter_module_class_pic_free( FT_Library library ); 50 | 51 | FT_Error 52 | pshinter_module_class_pic_init( FT_Library library ); 53 | 54 | FT_END_HEADER 55 | 56 | #endif /* FT_CONFIG_OPTION_PIC */ 57 | 58 | /* */ 59 | 60 | #endif /* PSHPIC_H_ */ 61 | 62 | 63 | /* END */ 64 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/afwrtsys.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afwrtsys.h */ 4 | /* */ 5 | /* Auto-fitter writing systems (specification only). */ 6 | /* */ 7 | /* Copyright 2013-2016 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 AFWRTSYS_H_ 20 | #define AFWRTSYS_H_ 21 | 22 | /* Since preprocessor directives can't create other preprocessor */ 23 | /* directives, we have to include the header files manually. */ 24 | 25 | #include "afdummy.h" 26 | #include "aflatin.h" 27 | #include "afcjk.h" 28 | #include "afindic.h" 29 | #ifdef FT_OPTION_AUTOFIT2 30 | #include "aflatin2.h" 31 | #endif 32 | 33 | #endif /* AFWRTSYS_H_ */ 34 | 35 | 36 | /* The following part can be included multiple times. */ 37 | /* Define `WRITING_SYSTEM' as needed. */ 38 | 39 | 40 | /* Add new writing systems here. The arguments are the writing system */ 41 | /* name in lowercase and uppercase, respectively. */ 42 | 43 | WRITING_SYSTEM( dummy, DUMMY ) 44 | WRITING_SYSTEM( latin, LATIN ) 45 | WRITING_SYSTEM( cjk, CJK ) 46 | WRITING_SYSTEM( indic, INDIC ) 47 | #ifdef FT_OPTION_AUTOFIT2 48 | WRITING_SYSTEM( latin2, LATIN2 ) 49 | #endif 50 | 51 | 52 | /* END */ 53 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/raster/rastpic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* rastpic.h */ 4 | /* */ 5 | /* The FreeType position independent code services for raster module. */ 6 | /* */ 7 | /* Copyright 2009-2016 by */ 8 | /* Oran Agra and Mickey Gabel. */ 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 RASTPIC_H_ 20 | #define RASTPIC_H_ 21 | 22 | 23 | #include FT_INTERNAL_PIC_H 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | #ifndef FT_CONFIG_OPTION_PIC 29 | 30 | #define FT_STANDARD_RASTER_GET ft_standard_raster 31 | 32 | #else /* FT_CONFIG_OPTION_PIC */ 33 | 34 | typedef struct RasterPIC_ 35 | { 36 | int ref_count; 37 | FT_Raster_Funcs ft_standard_raster; 38 | 39 | } RasterPIC; 40 | 41 | 42 | #define GET_PIC( lib ) \ 43 | ( (RasterPIC*)( (lib)->pic_container.raster ) ) 44 | #define FT_STANDARD_RASTER_GET ( GET_PIC( library )->ft_standard_raster ) 45 | 46 | 47 | /* see rastpic.c for the implementation */ 48 | void 49 | ft_raster1_renderer_class_pic_free( FT_Library library ); 50 | 51 | FT_Error 52 | ft_raster1_renderer_class_pic_init( FT_Library library ); 53 | 54 | #endif /* FT_CONFIG_OPTION_PIC */ 55 | 56 | /* */ 57 | 58 | FT_END_HEADER 59 | 60 | #endif /* RASTPIC_H_ */ 61 | 62 | 63 | /* END */ 64 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/base/ftgasp.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftgasp.c */ 4 | /* */ 5 | /* Access of TrueType's `gasp' table (body). */ 6 | /* */ 7 | /* Copyright 2007-2016 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 | #include 20 | #include FT_GASP_H 21 | #include FT_INTERNAL_TRUETYPE_TYPES_H 22 | 23 | 24 | FT_EXPORT_DEF( FT_Int ) 25 | FT_Get_Gasp( FT_Face face, 26 | FT_UInt ppem ) 27 | { 28 | FT_Int result = FT_GASP_NO_TABLE; 29 | 30 | 31 | if ( face && FT_IS_SFNT( face ) ) 32 | { 33 | TT_Face ttface = (TT_Face)face; 34 | 35 | 36 | if ( ttface->gasp.numRanges > 0 ) 37 | { 38 | TT_GaspRange range = ttface->gasp.gaspRanges; 39 | TT_GaspRange range_end = range + ttface->gasp.numRanges; 40 | 41 | 42 | while ( ppem > range->maxPPEM ) 43 | { 44 | range++; 45 | if ( range >= range_end ) 46 | goto Exit; 47 | } 48 | 49 | result = range->gaspFlag; 50 | 51 | /* ensure that we don't have spurious bits */ 52 | if ( ttface->gasp.version == 0 ) 53 | result &= 3; 54 | } 55 | } 56 | Exit: 57 | return result; 58 | } 59 | 60 | 61 | /* END */ 62 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/truetype/ttgload.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttgload.h */ 4 | /* */ 5 | /* TrueType Glyph Loader (specification). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 TTGLOAD_H_ 20 | #define TTGLOAD_H_ 21 | 22 | 23 | #include 24 | #include "ttobjs.h" 25 | 26 | #ifdef TT_USE_BYTECODE_INTERPRETER 27 | #include "ttinterp.h" 28 | #endif 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | 34 | FT_LOCAL( void ) 35 | TT_Init_Glyph_Loading( TT_Face face ); 36 | 37 | FT_LOCAL( void ) 38 | TT_Get_HMetrics( TT_Face face, 39 | FT_UInt idx, 40 | FT_Short* lsb, 41 | FT_UShort* aw ); 42 | 43 | FT_LOCAL( void ) 44 | TT_Get_VMetrics( TT_Face face, 45 | FT_UInt idx, 46 | FT_Pos yMax, 47 | FT_Short* tsb, 48 | FT_UShort* ah ); 49 | 50 | FT_LOCAL( FT_Error ) 51 | TT_Load_Glyph( TT_Size size, 52 | TT_GlyphSlot glyph, 53 | FT_UInt glyph_index, 54 | FT_Int32 load_flags ); 55 | 56 | 57 | FT_END_HEADER 58 | 59 | #endif /* TTGLOAD_H_ */ 60 | 61 | 62 | /* END */ 63 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/sfnt/sfobjs.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* sfobjs.h */ 4 | /* */ 5 | /* SFNT object management (specification). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 SFOBJS_H_ 20 | #define SFOBJS_H_ 21 | 22 | 23 | #include 24 | #include FT_INTERNAL_SFNT_H 25 | #include FT_INTERNAL_OBJECTS_H 26 | 27 | 28 | FT_BEGIN_HEADER 29 | 30 | 31 | FT_LOCAL( FT_Error ) 32 | sfnt_init_face( FT_Stream stream, 33 | TT_Face face, 34 | FT_Int face_instance_index, 35 | FT_Int num_params, 36 | FT_Parameter* params ); 37 | 38 | FT_LOCAL( FT_Error ) 39 | sfnt_load_face( FT_Stream stream, 40 | TT_Face face, 41 | FT_Int face_instance_index, 42 | FT_Int num_params, 43 | FT_Parameter* params ); 44 | 45 | FT_LOCAL( void ) 46 | sfnt_done_face( TT_Face face ); 47 | 48 | FT_LOCAL( FT_Error ) 49 | tt_face_get_name( TT_Face face, 50 | FT_UShort nameid, 51 | FT_String** name ); 52 | 53 | 54 | FT_END_HEADER 55 | 56 | #endif /* SFDRIVER_H_ */ 57 | 58 | 59 | /* END */ 60 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/afwarp.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afwarp.h */ 4 | /* */ 5 | /* Auto-fitter warping algorithm (specification). */ 6 | /* */ 7 | /* Copyright 2006-2016 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 AFWARP_H_ 20 | #define AFWARP_H_ 21 | 22 | #include "afhints.h" 23 | 24 | FT_BEGIN_HEADER 25 | 26 | #define AF_WARPER_SCALE 27 | 28 | #define AF_WARPER_FLOOR( x ) ( (x) & ~FT_TYPEOF( x )63 ) 29 | #define AF_WARPER_CEIL( x ) AF_WARPER_FLOOR( (x) + 63 ) 30 | 31 | 32 | typedef FT_Int32 AF_WarpScore; 33 | 34 | typedef struct AF_WarperRec_ 35 | { 36 | FT_Pos x1, x2; 37 | FT_Pos t1, t2; 38 | FT_Pos x1min, x1max; 39 | FT_Pos x2min, x2max; 40 | FT_Pos w0, wmin, wmax; 41 | 42 | FT_Fixed best_scale; 43 | FT_Pos best_delta; 44 | AF_WarpScore best_score; 45 | AF_WarpScore best_distort; 46 | 47 | } AF_WarperRec, *AF_Warper; 48 | 49 | 50 | FT_LOCAL( void ) 51 | af_warper_compute( AF_Warper warper, 52 | AF_GlyphHints hints, 53 | AF_Dimension dim, 54 | FT_Fixed *a_scale, 55 | FT_Fixed *a_delta ); 56 | 57 | 58 | FT_END_HEADER 59 | 60 | 61 | #endif /* AFWARP_H_ */ 62 | 63 | 64 | /* END */ 65 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/base/ftfstype.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftfstype.c */ 4 | /* */ 5 | /* FreeType utility file to access FSType data (body). */ 6 | /* */ 7 | /* Copyright 2008-2016 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 | #include 19 | #include FT_TYPE1_TABLES_H 20 | #include FT_TRUETYPE_TABLES_H 21 | #include FT_INTERNAL_SERVICE_H 22 | #include FT_SERVICE_POSTSCRIPT_INFO_H 23 | 24 | 25 | /* documentation is in freetype.h */ 26 | 27 | FT_EXPORT_DEF( FT_UShort ) 28 | FT_Get_FSType_Flags( FT_Face face ) 29 | { 30 | TT_OS2* os2; 31 | 32 | 33 | /* first, try to get the fs_type directly from the font */ 34 | if ( face ) 35 | { 36 | FT_Service_PsInfo service = NULL; 37 | 38 | 39 | FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO ); 40 | 41 | if ( service && service->ps_get_font_extra ) 42 | { 43 | PS_FontExtraRec extra; 44 | 45 | 46 | if ( !service->ps_get_font_extra( face, &extra ) && 47 | extra.fs_type != 0 ) 48 | return extra.fs_type; 49 | } 50 | } 51 | 52 | /* look at FSType before fsType for Type42 */ 53 | 54 | if ( ( os2 = (TT_OS2*)FT_Get_Sfnt_Table( face, FT_SFNT_OS2 ) ) != NULL && 55 | os2->version != 0xFFFFU ) 56 | return os2->fsType; 57 | 58 | return 0; 59 | } 60 | 61 | 62 | /* END */ 63 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/psnames/pspic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pspic.h */ 4 | /* */ 5 | /* The FreeType position independent code services for psnames module. */ 6 | /* */ 7 | /* Copyright 2009-2016 by */ 8 | /* Oran Agra and Mickey Gabel. */ 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 PSPIC_H_ 20 | #define PSPIC_H_ 21 | 22 | 23 | #include FT_INTERNAL_PIC_H 24 | 25 | 26 | #ifndef FT_CONFIG_OPTION_PIC 27 | 28 | #define PSCMAPS_SERVICES_GET pscmaps_services 29 | #define PSCMAPS_INTERFACE_GET pscmaps_interface 30 | 31 | #else /* FT_CONFIG_OPTION_PIC */ 32 | 33 | #include FT_SERVICE_POSTSCRIPT_CMAPS_H 34 | 35 | 36 | FT_BEGIN_HEADER 37 | 38 | typedef struct PSModulePIC_ 39 | { 40 | FT_ServiceDescRec* pscmaps_services; 41 | FT_Service_PsCMapsRec pscmaps_interface; 42 | 43 | } PSModulePIC; 44 | 45 | 46 | #define GET_PIC( lib ) \ 47 | ( (PSModulePIC*)((lib)->pic_container.psnames) ) 48 | #define PSCMAPS_SERVICES_GET ( GET_PIC( library )->pscmaps_services ) 49 | #define PSCMAPS_INTERFACE_GET ( GET_PIC( library )->pscmaps_interface ) 50 | 51 | 52 | /* see pspic.c for the implementation */ 53 | void 54 | psnames_module_class_pic_free( FT_Library library ); 55 | 56 | FT_Error 57 | psnames_module_class_pic_init( FT_Library library ); 58 | 59 | FT_END_HEADER 60 | 61 | #endif /* FT_CONFIG_OPTION_PIC */ 62 | 63 | /* */ 64 | 65 | #endif /* PSPIC_H_ */ 66 | 67 | 68 | /* END */ 69 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/ft2build.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ft2build.h */ 4 | /* */ 5 | /* FreeType 2 build and setup macros. */ 6 | /* */ 7 | /* Copyright 1996-2016 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. It is */ 22 | /* the only header file which should be included directly; all other */ 23 | /* FreeType header files should be accessed with macro names (after */ 24 | /* including `ft2build.h'). */ 25 | /* */ 26 | /* A typical example is */ 27 | /* */ 28 | /* #include */ 29 | /* #include FT_FREETYPE_H */ 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 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/smooth/ftgrays.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftgrays.h */ 4 | /* */ 5 | /* FreeType smooth renderer declaration */ 6 | /* */ 7 | /* Copyright 1996-2016 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 FTGRAYS_H_ 20 | #define FTGRAYS_H_ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | 27 | #ifdef STANDALONE_ 28 | #include "ftimage.h" 29 | #else 30 | #include 31 | #include FT_CONFIG_CONFIG_H /* for FT_CONFIG_OPTION_PIC */ 32 | #include FT_IMAGE_H 33 | #endif 34 | 35 | 36 | /*************************************************************************/ 37 | /* */ 38 | /* To make ftgrays.h independent from configuration files we check */ 39 | /* whether FT_EXPORT_VAR has been defined already. */ 40 | /* */ 41 | /* On some systems and compilers (Win32 mostly), an extra keyword is */ 42 | /* necessary to compile the library as a DLL. */ 43 | /* */ 44 | #ifndef FT_EXPORT_VAR 45 | #define FT_EXPORT_VAR( x ) extern x 46 | #endif 47 | 48 | FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_grays_raster; 49 | 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* FTGRAYS_H_ */ 56 | 57 | 58 | /* END */ 59 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/freetype/internal/services/svpfr.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svpfr.h */ 4 | /* */ 5 | /* Internal PFR service functions (specification). */ 6 | /* */ 7 | /* Copyright 2003-2016 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 FT_PFR_H 23 | #include FT_INTERNAL_SERVICE_H 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 | 61 | FT_END_HEADER 62 | 63 | #endif /* SVPFR_H_ */ 64 | 65 | 66 | /* END */ 67 | -------------------------------------------------------------------------------- /FreeTypeFont/FreeTypeFontApi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | public static class FreeTypeFontApi 7 | { 8 | #region Dll import 9 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 10 | public struct FreeTypeGlyph 11 | { 12 | public int code; 13 | public int bearing; 14 | public int advance; 15 | public int minX; 16 | public int maxX; 17 | public int minY; 18 | public int maxY; 19 | 20 | public int width; 21 | public int height; 22 | public int bpp; 23 | } 24 | 25 | #if !UNITY_EDITOR && UNITY_IOS 26 | private const string s_library = "__Internal"; 27 | #else 28 | private const string s_library = "unity-freetype"; 29 | #endif 30 | [DllImport(s_library)] 31 | public static extern IntPtr UFT_CreateFontContextByFile(string path); 32 | 33 | [DllImport(s_library)] 34 | public static extern IntPtr UFT_CreateFontContextByData(IntPtr data, int length); 35 | 36 | [DllImport(s_library)] 37 | public static extern void UFT_DeleteFontContext(IntPtr pContext); 38 | 39 | [DllImport(s_library)] 40 | public static extern IntPtr UFT_GetGlyph(IntPtr pContext, int code, ref FreeTypeGlyph glyph, int fontsize, int outlinesize, bool bold); 41 | 42 | [DllImport(s_library)] 43 | public static extern IntPtr UFT_MemoryCopy(IntPtr pDst, IntPtr pSrc, int size); 44 | #endregion 45 | 46 | unsafe public static IntPtr CreateFontContext(byte[] bytes) 47 | { 48 | IntPtr result = IntPtr.Zero; 49 | if (bytes != null) 50 | { 51 | fixed (byte* pData = bytes) 52 | { 53 | result = UFT_CreateFontContextByData((IntPtr)pData, bytes.Length); 54 | } 55 | } 56 | return result; 57 | } 58 | 59 | public static IntPtr CreateFontContext(string path) 60 | { 61 | return UFT_CreateFontContextByFile(path); 62 | } 63 | 64 | public static void DeleteFontContext(IntPtr pContext) 65 | { 66 | if (pContext != IntPtr.Zero) 67 | { 68 | UFT_DeleteFontContext(pContext); 69 | } 70 | } 71 | 72 | public static IntPtr GetGlyph(IntPtr fontContext, int charCode, out FreeTypeGlyph glyph, int fontsize, int outlinesize, bool bold) 73 | { 74 | IntPtr result = IntPtr.Zero; 75 | glyph = new FreeTypeGlyph(); 76 | 77 | if (fontContext != IntPtr.Zero) 78 | { 79 | result = UFT_GetGlyph(fontContext, charCode, ref glyph, fontsize, outlinesize, bold); 80 | } 81 | return result; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/freetype/ttunpat.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttunpat.h */ 4 | /* */ 5 | /* Definitions for the unpatented TrueType hinting system. */ 6 | /* Obsolete, retained for backwards compatibility. */ 7 | /* */ 8 | /* Copyright 2003-2016 by */ 9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 10 | /* */ 11 | /* Written by Graham Asher */ 12 | /* */ 13 | /* This file is part of the FreeType project, and may only be used, */ 14 | /* modified, and distributed under the terms of the FreeType project */ 15 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 16 | /* this file you indicate that you have read the license and */ 17 | /* understand and accept it fully. */ 18 | /* */ 19 | /***************************************************************************/ 20 | 21 | 22 | #ifndef TTUNPAT_H_ 23 | #define TTUNPAT_H_ 24 | 25 | 26 | #include 27 | #include FT_FREETYPE_H 28 | 29 | #ifdef FREETYPE_H 30 | #error "freetype.h of FreeType 1 has been loaded!" 31 | #error "Please fix the directory search order for header files" 32 | #error "so that freetype.h of FreeType 2 is found first." 33 | #endif 34 | 35 | 36 | FT_BEGIN_HEADER 37 | 38 | 39 | /*************************************************************************** 40 | * 41 | * @constant: 42 | * FT_PARAM_TAG_UNPATENTED_HINTING 43 | * 44 | * @description: 45 | * Deprecated. 46 | * 47 | * Previously: A constant used as the tag of an @FT_Parameter structure to 48 | * indicate that unpatented methods only should be used by the TrueType 49 | * bytecode interpreter for a typeface opened by @FT_Open_Face. 50 | * 51 | */ 52 | #define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' ) 53 | 54 | /* */ 55 | 56 | 57 | FT_END_HEADER 58 | 59 | 60 | #endif /* TTUNPAT_H_ */ 61 | 62 | 63 | /* END */ 64 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/smooth/ftspic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftspic.h */ 4 | /* */ 5 | /* The FreeType position independent code services for smooth module. */ 6 | /* */ 7 | /* Copyright 2009-2016 by */ 8 | /* Oran Agra and Mickey Gabel. */ 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 FTSPIC_H_ 20 | #define FTSPIC_H_ 21 | 22 | 23 | #include FT_INTERNAL_PIC_H 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | #ifndef FT_CONFIG_OPTION_PIC 29 | 30 | #define FT_GRAYS_RASTER_GET ft_grays_raster 31 | 32 | #else /* FT_CONFIG_OPTION_PIC */ 33 | 34 | typedef struct SmoothPIC_ 35 | { 36 | int ref_count; 37 | FT_Raster_Funcs ft_grays_raster; 38 | 39 | } SmoothPIC; 40 | 41 | 42 | #define GET_PIC( lib ) \ 43 | ( (SmoothPIC*)( (lib)->pic_container.smooth ) ) 44 | #define FT_GRAYS_RASTER_GET ( GET_PIC( library )->ft_grays_raster ) 45 | 46 | 47 | /* see ftspic.c for the implementation */ 48 | void 49 | ft_smooth_renderer_class_pic_free( FT_Library library ); 50 | 51 | void 52 | ft_smooth_lcd_renderer_class_pic_free( FT_Library library ); 53 | 54 | void 55 | ft_smooth_lcdv_renderer_class_pic_free( FT_Library library ); 56 | 57 | FT_Error 58 | ft_smooth_renderer_class_pic_init( FT_Library library ); 59 | 60 | FT_Error 61 | ft_smooth_lcd_renderer_class_pic_init( FT_Library library ); 62 | 63 | FT_Error 64 | ft_smooth_lcdv_renderer_class_pic_init( FT_Library library ); 65 | 66 | #endif /* FT_CONFIG_OPTION_PIC */ 67 | 68 | /* */ 69 | 70 | FT_END_HEADER 71 | 72 | #endif /* FTSPIC_H_ */ 73 | 74 | 75 | /* END */ 76 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/sfnt/ttsbit.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttsbit.h */ 4 | /* */ 5 | /* TrueType and OpenType embedded bitmap support (specification). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 TTSBIT_H_ 20 | #define TTSBIT_H_ 21 | 22 | 23 | #include 24 | #include "ttload.h" 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_LOCAL( FT_Error ) 31 | tt_face_load_sbit( TT_Face face, 32 | FT_Stream stream ); 33 | 34 | FT_LOCAL( void ) 35 | tt_face_free_sbit( TT_Face face ); 36 | 37 | 38 | FT_LOCAL( FT_Error ) 39 | tt_face_set_sbit_strike( TT_Face face, 40 | FT_Size_Request req, 41 | FT_ULong* astrike_index ); 42 | 43 | FT_LOCAL( FT_Error ) 44 | tt_face_load_strike_metrics( TT_Face face, 45 | FT_ULong strike_index, 46 | FT_Size_Metrics* metrics ); 47 | 48 | FT_LOCAL( FT_Error ) 49 | tt_face_load_sbit_image( TT_Face face, 50 | FT_ULong strike_index, 51 | FT_UInt glyph_index, 52 | FT_UInt load_flags, 53 | FT_Stream stream, 54 | FT_Bitmap *map, 55 | TT_SBit_MetricsRec *metrics ); 56 | 57 | 58 | FT_END_HEADER 59 | 60 | #endif /* TTSBIT_H_ */ 61 | 62 | 63 | /* END */ 64 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/afshaper.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afshaper.h */ 4 | /* */ 5 | /* HarfBuzz interface for accessing OpenType features (specification). */ 6 | /* */ 7 | /* Copyright 2013-2016 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 AFSHAPER_H_ 20 | #define AFSHAPER_H_ 21 | 22 | 23 | #include 24 | #include FT_FREETYPE_H 25 | 26 | 27 | #ifdef FT_CONFIG_OPTION_USE_HARFBUZZ 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #endif 34 | 35 | 36 | FT_BEGIN_HEADER 37 | 38 | FT_Error 39 | af_shaper_get_coverage( AF_FaceGlobals globals, 40 | AF_StyleClass style_class, 41 | FT_UShort* gstyles, 42 | FT_Bool default_script ); 43 | 44 | 45 | void* 46 | af_shaper_buf_create( FT_Face face ); 47 | 48 | void 49 | af_shaper_buf_destroy( FT_Face face, 50 | void* buf ); 51 | 52 | const char* 53 | af_shaper_get_cluster( const char* p, 54 | AF_StyleMetrics metrics, 55 | void* buf_, 56 | unsigned int* count ); 57 | 58 | FT_ULong 59 | af_shaper_get_elem( AF_StyleMetrics metrics, 60 | void* buf_, 61 | unsigned int idx, 62 | FT_Long* x_advance, 63 | FT_Long* y_offset ); 64 | 65 | /* */ 66 | 67 | FT_END_HEADER 68 | 69 | #endif /* AFSHAPER_H_ */ 70 | 71 | 72 | /* END */ 73 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/truetype/ttpload.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttpload.h */ 4 | /* */ 5 | /* TrueType-specific tables loader (specification). */ 6 | /* */ 7 | /* Copyright 1996-2016 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 TTPLOAD_H_ 20 | #define TTPLOAD_H_ 21 | 22 | 23 | #include 24 | #include FT_INTERNAL_TRUETYPE_TYPES_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_LOCAL( FT_Error ) 31 | tt_face_load_loca( TT_Face face, 32 | FT_Stream stream ); 33 | 34 | FT_LOCAL( FT_ULong ) 35 | tt_face_get_location( TT_Face face, 36 | FT_UInt gindex, 37 | FT_UInt *asize ); 38 | 39 | FT_LOCAL( void ) 40 | tt_face_done_loca( TT_Face face ); 41 | 42 | FT_LOCAL( FT_Error ) 43 | tt_face_load_cvt( TT_Face face, 44 | FT_Stream stream ); 45 | 46 | FT_LOCAL( FT_Error ) 47 | tt_face_load_fpgm( TT_Face face, 48 | FT_Stream stream ); 49 | 50 | 51 | FT_LOCAL( FT_Error ) 52 | tt_face_load_prep( TT_Face face, 53 | FT_Stream stream ); 54 | 55 | 56 | FT_LOCAL( FT_Error ) 57 | tt_face_load_hdmx( TT_Face face, 58 | FT_Stream stream ); 59 | 60 | 61 | FT_LOCAL( void ) 62 | tt_face_free_hdmx( TT_Face face ); 63 | 64 | 65 | FT_LOCAL( FT_Byte* ) 66 | tt_face_get_device_metrics( TT_Face face, 67 | FT_UInt ppem, 68 | FT_UInt gindex ); 69 | 70 | FT_END_HEADER 71 | 72 | #endif /* TTPLOAD_H_ */ 73 | 74 | 75 | /* END */ 76 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/freetype/internal/services/svttglyf.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svttglyf.h */ 4 | /* */ 5 | /* The FreeType TrueType glyph service. */ 6 | /* */ 7 | /* Copyright 2007-2016 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 FT_INTERNAL_SERVICE_H 22 | #include FT_TRUETYPE_TABLES_H 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 | #ifndef FT_CONFIG_OPTION_PIC 43 | 44 | #define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \ 45 | static const FT_Service_TTGlyfRec class_ = \ 46 | { \ 47 | get_location_ \ 48 | }; 49 | 50 | #else /* FT_CONFIG_OPTION_PIC */ 51 | 52 | #define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ ) \ 53 | void \ 54 | FT_Init_Class_ ## class_( FT_Service_TTGlyfRec* clazz ) \ 55 | { \ 56 | clazz->get_location = get_location_; \ 57 | } 58 | 59 | #endif /* FT_CONFIG_OPTION_PIC */ 60 | 61 | /* */ 62 | 63 | 64 | FT_END_HEADER 65 | 66 | #endif /* SVTTGLYF_H_ */ 67 | 68 | 69 | /* END */ 70 | -------------------------------------------------------------------------------- /Plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.7) 2 | 3 | if(${TARGET_PLATFORM} STREQUAL iOS) 4 | set(CMAKE_TOOLCHAIN_FILE cmake/iOS.cmake) 5 | endif() 6 | 7 | if(${TARGET_PLATFORM} STREQUAL Android) 8 | set(ANDROID_NDK $ENV{ANDROID_NDK_ROOT}) 9 | set(CMAKE_TOOLCHAIN_FILE cmake/android.toolchain.cmake) 10 | endif() 11 | 12 | set(PROJ unity-freetype) 13 | project(${PROJ}) 14 | 15 | include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src/freetype/include) 16 | 17 | add_definitions(-DFT2_BUILD_LIBRARY) 18 | 19 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fvisibility=hidden") 20 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -Wno-shorten-64-to-32") 21 | 22 | if(${TARGET_PLATFORM} STREQUAL Android) 23 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") 24 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s") 25 | endif() 26 | 27 | set(FREETYPE_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/freetype/src) 28 | set(freetype_sources 29 | ${FREETYPE_SOURCE}/autofit/autofit.c 30 | ${FREETYPE_SOURCE}/base/ftbase.c 31 | ${FREETYPE_SOURCE}/base/ftbitmap.c 32 | ${FREETYPE_SOURCE}/base/ftglyph.c 33 | ${FREETYPE_SOURCE}/base/ftinit.c 34 | ${FREETYPE_SOURCE}/base/ftstroke.c 35 | ${FREETYPE_SOURCE}/base/ftsystem.c 36 | ${FREETYPE_SOURCE}/sfnt/sfnt.c 37 | ${FREETYPE_SOURCE}/smooth/smooth.c 38 | ${FREETYPE_SOURCE}/truetype/truetype.c 39 | ${FREETYPE_SOURCE}/psnames/psnames.c 40 | ${FREETYPE_SOURCE}/raster/raster.c 41 | ${FREETYPE_SOURCE}/cff/cff.c 42 | ${FREETYPE_SOURCE}/pshinter/pshinter.c 43 | ) 44 | 45 | file(GLOB_RECURSE unity-freetype_sources ${CMAKE_CURRENT_SOURCE_DIR}/src/unity-freetype/*.cpp) 46 | 47 | set(sources ${freetype_sources} ${unity-freetype_sources}) 48 | 49 | set(OUTPUT_BASE ${CMAKE_CURRENT_SOURCE_DIR}/Plugins) 50 | 51 | if(${TARGET_PLATFORM} STREQUAL macOS) 52 | set(CMAKE_OSX_ARCHITECTURES x86_64;i386) 53 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BASE}/${TARGET_PLATFORM}) 54 | add_library(${PROJ} MODULE ${sources}) 55 | set_target_properties(${PROJ} PROPERTIES BUNDLE TRUE) 56 | endif() 57 | 58 | if(${TARGET_PLATFORM} STREQUAL Windows) 59 | if (${CMAKE_SIZEOF_VOID_P} EQUAL 4) 60 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BASE}/${TARGET_PLATFORM}/x86) 61 | else() 62 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BASE}/${TARGET_PLATFORM}/x86_64) 63 | endif() 64 | add_library(${PROJ} SHARED ${sources}) 65 | endif() 66 | 67 | if(${TARGET_PLATFORM} STREQUAL iOS) 68 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_BASE}/${TARGET_PLATFORM}) 69 | add_library(${PROJ} STATIC ${sources}) 70 | endif() 71 | 72 | if(${TARGET_PLATFORM} STREQUAL Android) 73 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BASE}/${TARGET_PLATFORM}/libs/${ANDROID_ABI}) 74 | add_library(${PROJ} SHARED ${sources}) 75 | endif() -------------------------------------------------------------------------------- /Shaders/Unlit - FreeType Text 2.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/FreeType Text 2" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Alpha (A)", 2D) = "white" {} 6 | } 7 | 8 | SubShader 9 | { 10 | LOD 200 11 | 12 | Tags 13 | { 14 | "Queue" = "Transparent" 15 | "IgnoreProjector" = "True" 16 | "RenderType" = "Transparent" 17 | } 18 | 19 | Cull Off 20 | Lighting Off 21 | ZWrite Off 22 | Offset -1, -1 23 | Fog { Mode Off } 24 | Blend One OneMinusSrcAlpha 25 | 26 | Pass 27 | { 28 | CGPROGRAM 29 | #pragma vertex vert 30 | #pragma fragment frag 31 | #include "Unlit - FreeType Text.cginc" 32 | 33 | struct appdata_t 34 | { 35 | float4 vertex : POSITION; 36 | float4 color : COLOR; 37 | float2 texcoord : TEXCOORD0; 38 | }; 39 | 40 | struct v2f 41 | { 42 | float4 vertex : POSITION; 43 | float4 color1 : COLOR; 44 | float4 color2 : COLOR2; 45 | float2 texcoord : TEXCOORD0; 46 | float4 worldPos : TEXCOORD1; 47 | }; 48 | 49 | sampler2D _MainTex; 50 | float4 _MainTex_ST; 51 | float4 _ClipRange0 = float4(0.0, 0.0, 1.0, 1.0); 52 | float2 _ClipArgs0 = float2(1000.0, 1000.0); 53 | float4 _ClipRange1 = float4(0.0, 0.0, 1.0, 1.0); 54 | float4 _ClipArgs1 = float4(1000.0, 1000.0, 0.0, 1.0); 55 | 56 | float2 Rotate (float2 v, float2 rot) 57 | { 58 | float2 ret; 59 | ret.x = v.x * rot.y - v.y * rot.x; 60 | ret.y = v.x * rot.x + v.y * rot.y; 61 | return ret; 62 | } 63 | 64 | v2f vert (appdata_t v) 65 | { 66 | v2f o; 67 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 68 | decodeColor(v.color, o.color1, o.color2); 69 | o.texcoord = v.texcoord; 70 | o.worldPos.xy = v.vertex.xy * _ClipRange0.zw + _ClipRange0.xy; 71 | o.worldPos.zw = Rotate(v.vertex.xy, _ClipArgs1.zw) * _ClipRange1.zw + _ClipRange1.xy; 72 | 73 | return o; 74 | } 75 | 76 | float4 frag (v2f i) : COLOR 77 | { 78 | float2 alpha = decodeAlpha(tex2D(_MainTex, i.texcoord)) * float2(i.color1.a, i.color2.a * i.color1.a); 79 | float4 col; 80 | col.rgb = i.color1.rgb * alpha.x + i.color2.rgb * alpha.y * (1 - alpha.x); 81 | col.a = max(alpha.x, alpha.y); 82 | 83 | // First clip region 84 | float2 factor = (float2(1.0, 1.0) - abs(i.worldPos.xy)) * _ClipArgs0.xy; 85 | float f = min(factor.x, factor.y); 86 | 87 | // Second clip region 88 | factor = (float2(1.0, 1.0) - abs(i.worldPos.zw)) * _ClipArgs1.xy; 89 | f = min(f, min(factor.x, factor.y)); 90 | 91 | col.a *= clamp( f, 0.0, 1.0); 92 | 93 | return col; 94 | } 95 | ENDCG 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # unity-freetype 2 | Yet another Unity font provider with freetype 3 | 4 | # Why? 5 | 6 | There is a built-in FreeType based dynamic [font provider](https://docs.unity3d.com/ScriptReference/Font.html) has been involved since Unity 4.x. However, this font provider is not extensible for advanced usage, such as it is hard for you to make a perfect stroke by FreeType APIs. 7 | 8 | This project is a mock font provider implemention by getting and rendering glyphs from the FreeType source. And with this source you will be able to change anything you want in the FreeType level. 9 | 10 | # How to use? 11 | 12 | ## Build the plugin 13 | 14 | To build the native plugins you should have [cmake](https://cmake.org/) installed. Then under the `Plugin` folder you will find such scripts: 15 | 16 | make_android.sh 17 | make_ios.sh 18 | make_macos.sh 19 | make_windows.bat 20 | 21 | > You may also need the NDK/Xcode/Visual Studio installed for each platform. 22 | 23 | After the building finish put the output binaries into the right place in your Unity project. 24 | 25 | ## Integrate the code 26 | 27 | 1. Copy the folder *FreeTypeFont* into you Unity project. 28 | 2. Add *-unsafe* to the file *smcs.rsp* and *gmcs.rsp*. If you don't have them just create a new one. 29 | > This `-unsafe` option is used to enable direct memory operation for performance purpose. If you don't like it you could change those parts of code to `Marshal`s. 30 | 3. To use this font provide with NGUI: 31 | 1. Seach all the *Font* in the NGUI source code and replace it with *FreeTypeFont*. Backup is strongly recommanded. 32 | 2. Copy all the files under *Shaders* into the NGUI shader folder. 33 | 3. Create a prefab with two components: *UIFont*(From NGUI) and *FreeTypeFont*(From this project). 34 | 4. Change the extension of the TTF font file to *.bytes*, or any other TextAsset extensions, and drag it to the *Font Asset* field of the FreeTypeFont. 35 | 5. Change the *Font Type* of UIFont to *Dynamic* and drag this FreeTypeFont component to its *TTF Font* field. 36 | 37 | ## Know issues 38 | 39 | This project (might) isn't so good as the Unity built-in one because: 40 | 41 | 1. It uses a poor, but quick, algorithm to packing glyphs. A little more space wasting than the built-in one. 42 | 2. It uses a 16 bit texture in order to render the glyph stroke. It needs an extra 8 bit channels for the stroke alpha. 43 | 3. It need to two vertex color channels for the glyph face and stroke. However, the Unity Mesh component only has one Colors property so it compose these two color chanels into one. Which means the each channel will have only 16 bit colors. 44 | 45 | ## Do I need it? 46 | 47 | If you think the text apperance in your project is good enough don't look into this. 48 | If you want to tweak the text in the FreeType level, clone this repo and make any changes you like. 49 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/freetype/internal/ftpic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftpic.h */ 4 | /* */ 5 | /* The FreeType position independent code services (declaration). */ 6 | /* */ 7 | /* Copyright 2009-2016 by */ 8 | /* Oran Agra and Mickey Gabel. */ 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 | /* Modules that ordinarily have const global data that need address */ 21 | /* can instead define pointers here. */ 22 | /* */ 23 | /*************************************************************************/ 24 | 25 | 26 | #ifndef FTPIC_H_ 27 | #define FTPIC_H_ 28 | 29 | 30 | FT_BEGIN_HEADER 31 | 32 | #ifdef FT_CONFIG_OPTION_PIC 33 | 34 | typedef struct FT_PIC_Container_ 35 | { 36 | /* pic containers for base */ 37 | void* base; 38 | 39 | /* pic containers for modules */ 40 | void* autofit; 41 | void* cff; 42 | void* pshinter; 43 | void* psnames; 44 | void* raster; 45 | void* sfnt; 46 | void* smooth; 47 | void* truetype; 48 | 49 | } FT_PIC_Container; 50 | 51 | 52 | /* Initialize the various function tables, structs, etc. */ 53 | /* stored in the container. */ 54 | FT_BASE( FT_Error ) 55 | ft_pic_container_init( FT_Library library ); 56 | 57 | 58 | /* Destroy the contents of the container. */ 59 | FT_BASE( void ) 60 | ft_pic_container_destroy( FT_Library library ); 61 | 62 | #endif /* FT_CONFIG_OPTION_PIC */ 63 | 64 | /* */ 65 | 66 | FT_END_HEADER 67 | 68 | #endif /* FTPIC_H_ */ 69 | 70 | 71 | /* END */ 72 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/freetype/internal/services/svgxval.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svgxval.h */ 4 | /* */ 5 | /* FreeType API for validating TrueTypeGX/AAT tables (specification). */ 6 | /* */ 7 | /* Copyright 2004-2016 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 FT_GX_VALIDATE_H 32 | #include FT_INTERNAL_VALIDATE_H 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 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/pshinter/pshpic.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pshpic.c */ 4 | /* */ 5 | /* The FreeType position independent code services for pshinter module. */ 6 | /* */ 7 | /* Copyright 2009-2016 by */ 8 | /* Oran Agra and Mickey Gabel. */ 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 | #include 20 | #include FT_FREETYPE_H 21 | #include FT_INTERNAL_OBJECTS_H 22 | #include "pshpic.h" 23 | #include "pshnterr.h" 24 | 25 | 26 | #ifdef FT_CONFIG_OPTION_PIC 27 | 28 | /* forward declaration of PIC init functions from pshmod.c */ 29 | void 30 | FT_Init_Class_pshinter_interface( FT_Library library, 31 | PSHinter_Interface* clazz ); 32 | 33 | void 34 | pshinter_module_class_pic_free( FT_Library library ) 35 | { 36 | FT_PIC_Container* pic_container = &library->pic_container; 37 | FT_Memory memory = library->memory; 38 | 39 | 40 | if ( pic_container->pshinter ) 41 | { 42 | FT_FREE( pic_container->pshinter ); 43 | pic_container->pshinter = NULL; 44 | } 45 | } 46 | 47 | 48 | FT_Error 49 | pshinter_module_class_pic_init( FT_Library library ) 50 | { 51 | FT_PIC_Container* pic_container = &library->pic_container; 52 | FT_Error error = FT_Err_Ok; 53 | PSHinterPIC* container = NULL; 54 | FT_Memory memory = library->memory; 55 | 56 | 57 | /* allocate pointer, clear and set global container pointer */ 58 | if ( FT_ALLOC( container, sizeof ( *container ) ) ) 59 | return error; 60 | FT_MEM_SET( container, 0, sizeof ( *container ) ); 61 | pic_container->pshinter = container; 62 | 63 | /* add call to initialization function when you add new scripts */ 64 | FT_Init_Class_pshinter_interface( 65 | library, &container->pshinter_interface ); 66 | 67 | if ( error ) 68 | pshinter_module_class_pic_free( library ); 69 | 70 | return error; 71 | } 72 | 73 | #endif /* FT_CONFIG_OPTION_PIC */ 74 | 75 | 76 | /* END */ 77 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/cff/cffcmap.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* cffcmap.h */ 4 | /* */ 5 | /* CFF character mapping table (cmap) support (specification). */ 6 | /* */ 7 | /* Copyright 2002-2016 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 CFFCMAP_H_ 20 | #define CFFCMAP_H_ 21 | 22 | #include "cffobjs.h" 23 | 24 | FT_BEGIN_HEADER 25 | 26 | 27 | /*************************************************************************/ 28 | /*************************************************************************/ 29 | /***** *****/ 30 | /***** TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS *****/ 31 | /***** *****/ 32 | /*************************************************************************/ 33 | /*************************************************************************/ 34 | 35 | /* standard (and expert) encoding cmaps */ 36 | typedef struct CFF_CMapStdRec_* CFF_CMapStd; 37 | 38 | typedef struct CFF_CMapStdRec_ 39 | { 40 | FT_CMapRec cmap; 41 | FT_UShort* gids; /* up to 256 elements */ 42 | 43 | } CFF_CMapStdRec; 44 | 45 | 46 | FT_DECLARE_CMAP_CLASS(cff_cmap_encoding_class_rec) 47 | 48 | 49 | /*************************************************************************/ 50 | /*************************************************************************/ 51 | /***** *****/ 52 | /***** CFF SYNTHETIC UNICODE ENCODING CMAP *****/ 53 | /***** *****/ 54 | /*************************************************************************/ 55 | /*************************************************************************/ 56 | 57 | /* unicode (synthetic) cmaps */ 58 | 59 | FT_DECLARE_CMAP_CLASS(cff_cmap_unicode_class_rec) 60 | 61 | 62 | FT_END_HEADER 63 | 64 | #endif /* CFFCMAP_H_ */ 65 | 66 | 67 | /* END */ 68 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/afdummy.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afdummy.c */ 4 | /* */ 5 | /* Auto-fitter dummy routines to be used if no hinting should be */ 6 | /* performed (body). */ 7 | /* */ 8 | /* Copyright 2003-2016 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 | #include "afdummy.h" 21 | #include "afhints.h" 22 | #include "aferrors.h" 23 | 24 | 25 | static FT_Error 26 | af_dummy_hints_init( AF_GlyphHints hints, 27 | AF_StyleMetrics metrics ) 28 | { 29 | af_glyph_hints_rescale( hints, metrics ); 30 | 31 | hints->x_scale = metrics->scaler.x_scale; 32 | hints->y_scale = metrics->scaler.y_scale; 33 | hints->x_delta = metrics->scaler.x_delta; 34 | hints->y_delta = metrics->scaler.y_delta; 35 | 36 | return FT_Err_Ok; 37 | } 38 | 39 | 40 | static FT_Error 41 | af_dummy_hints_apply( FT_UInt glyph_index, 42 | AF_GlyphHints hints, 43 | FT_Outline* outline ) 44 | { 45 | FT_Error error; 46 | 47 | FT_UNUSED( glyph_index ); 48 | 49 | 50 | error = af_glyph_hints_reload( hints, outline ); 51 | if ( !error ) 52 | af_glyph_hints_save( hints, outline ); 53 | 54 | return error; 55 | } 56 | 57 | 58 | AF_DEFINE_WRITING_SYSTEM_CLASS( 59 | af_dummy_writing_system_class, 60 | 61 | AF_WRITING_SYSTEM_DUMMY, 62 | 63 | sizeof ( AF_StyleMetricsRec ), 64 | 65 | (AF_WritingSystem_InitMetricsFunc) NULL, /* style_metrics_init */ 66 | (AF_WritingSystem_ScaleMetricsFunc)NULL, /* style_metrics_scale */ 67 | (AF_WritingSystem_DoneMetricsFunc) NULL, /* style_metrics_done */ 68 | (AF_WritingSystem_GetStdWidthsFunc)NULL, /* style_metrics_getstdw */ 69 | 70 | (AF_WritingSystem_InitHintsFunc) af_dummy_hints_init, /* style_hints_init */ 71 | (AF_WritingSystem_ApplyHintsFunc) af_dummy_hints_apply /* style_hints_apply */ 72 | ) 73 | 74 | 75 | /* END */ 76 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/cff/cf2error.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* cf2error.c */ 4 | /* */ 5 | /* Adobe's code for error handling (body). */ 6 | /* */ 7 | /* Copyright 2006-2013 Adobe Systems Incorporated. */ 8 | /* */ 9 | /* This software, and all works of authorship, whether in source or */ 10 | /* object code form as indicated by the copyright notice(s) included */ 11 | /* herein (collectively, the "Work") is made available, and may only be */ 12 | /* used, modified, and distributed under the FreeType Project License, */ 13 | /* LICENSE.TXT. Additionally, subject to the terms and conditions of the */ 14 | /* FreeType Project License, each contributor to the Work hereby grants */ 15 | /* to any individual or legal entity exercising permissions granted by */ 16 | /* the FreeType Project License and this section (hereafter, "You" or */ 17 | /* "Your") a perpetual, worldwide, non-exclusive, no-charge, */ 18 | /* royalty-free, irrevocable (except as stated in this section) patent */ 19 | /* license to make, have made, use, offer to sell, sell, import, and */ 20 | /* otherwise transfer the Work, where such license applies only to those */ 21 | /* patent claims licensable by such contributor that are necessarily */ 22 | /* infringed by their contribution(s) alone or by combination of their */ 23 | /* contribution(s) with the Work to which such contribution(s) was */ 24 | /* submitted. If You institute patent litigation against any entity */ 25 | /* (including a cross-claim or counterclaim in a lawsuit) alleging that */ 26 | /* the Work or a contribution incorporated within the Work constitutes */ 27 | /* direct or contributory patent infringement, then any patent licenses */ 28 | /* granted to You under this License for that Work shall terminate as of */ 29 | /* the date such litigation is filed. */ 30 | /* */ 31 | /* By using, modifying, or distributing the Work you indicate that you */ 32 | /* have read and understood the terms and conditions of the */ 33 | /* FreeType Project License as well as those provided in this section, */ 34 | /* and you accept them fully. */ 35 | /* */ 36 | /***************************************************************************/ 37 | 38 | 39 | #include "cf2ft.h" 40 | #include "cf2error.h" 41 | 42 | 43 | FT_LOCAL_DEF( void ) 44 | cf2_setError( FT_Error* error, 45 | FT_Error value ) 46 | { 47 | if ( error && !*error ) 48 | *error = value; 49 | } 50 | 51 | 52 | /* END */ 53 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/base/ftbdf.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftbdf.c */ 4 | /* */ 5 | /* FreeType API for accessing BDF-specific strings (body). */ 6 | /* */ 7 | /* Copyright 2002-2016 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 | #include 20 | #include FT_INTERNAL_DEBUG_H 21 | 22 | #include FT_INTERNAL_OBJECTS_H 23 | #include FT_SERVICE_BDF_H 24 | 25 | 26 | /* documentation is in ftbdf.h */ 27 | 28 | FT_EXPORT_DEF( FT_Error ) 29 | FT_Get_BDF_Charset_ID( FT_Face face, 30 | const char* *acharset_encoding, 31 | const char* *acharset_registry ) 32 | { 33 | FT_Error error; 34 | const char* encoding = NULL; 35 | const char* registry = NULL; 36 | 37 | FT_Service_BDF service; 38 | 39 | 40 | if ( !face ) 41 | return FT_THROW( Invalid_Face_Handle ); 42 | 43 | FT_FACE_FIND_SERVICE( face, service, BDF ); 44 | 45 | if ( service && service->get_charset_id ) 46 | error = service->get_charset_id( face, &encoding, ®istry ); 47 | else 48 | error = FT_THROW( Invalid_Argument ); 49 | 50 | if ( acharset_encoding ) 51 | *acharset_encoding = encoding; 52 | 53 | if ( acharset_registry ) 54 | *acharset_registry = registry; 55 | 56 | return error; 57 | } 58 | 59 | 60 | /* documentation is in ftbdf.h */ 61 | 62 | FT_EXPORT_DEF( FT_Error ) 63 | FT_Get_BDF_Property( FT_Face face, 64 | const char* prop_name, 65 | BDF_PropertyRec *aproperty ) 66 | { 67 | FT_Error error; 68 | 69 | FT_Service_BDF service; 70 | 71 | 72 | if ( !face ) 73 | return FT_THROW( Invalid_Face_Handle ); 74 | 75 | if ( !aproperty ) 76 | return FT_THROW( Invalid_Argument ); 77 | 78 | aproperty->type = BDF_PROPERTY_TYPE_NONE; 79 | 80 | FT_FACE_FIND_SERVICE( face, service, BDF ); 81 | 82 | if ( service && service->get_property ) 83 | error = service->get_property( face, prop_name, aproperty ); 84 | else 85 | error = FT_THROW( Invalid_Argument ); 86 | 87 | return error; 88 | } 89 | 90 | 91 | /* END */ 92 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/freetype/internal/services/svpostnm.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svpostnm.h */ 4 | /* */ 5 | /* The FreeType PostScript name services (specification). */ 6 | /* */ 7 | /* Copyright 2003-2016 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 FT_INTERNAL_SERVICE_H 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | /* 28 | * A trivial service used to retrieve the PostScript name of a given 29 | * font 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 | #ifndef FT_CONFIG_OPTION_PIC 51 | 52 | #define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \ 53 | static const FT_Service_PsFontNameRec class_ = \ 54 | { \ 55 | get_ps_font_name_ \ 56 | }; 57 | 58 | #else /* FT_CONFIG_OPTION_PIC */ 59 | 60 | #define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \ 61 | void \ 62 | FT_Init_Class_ ## class_( FT_Library library, \ 63 | FT_Service_PsFontNameRec* clazz ) \ 64 | { \ 65 | FT_UNUSED( library ); \ 66 | \ 67 | clazz->get_ps_font_name = get_ps_font_name_; \ 68 | } 69 | 70 | #endif /* FT_CONFIG_OPTION_PIC */ 71 | 72 | /* */ 73 | 74 | 75 | FT_END_HEADER 76 | 77 | 78 | #endif /* SVPOSTNM_H_ */ 79 | 80 | 81 | /* END */ 82 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/base/ftotval.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftotval.c */ 4 | /* */ 5 | /* FreeType API for validating OpenType tables (body). */ 6 | /* */ 7 | /* Copyright 2004-2016 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 | #include 19 | #include FT_INTERNAL_DEBUG_H 20 | 21 | #include FT_INTERNAL_OBJECTS_H 22 | #include FT_SERVICE_OPENTYPE_VALIDATE_H 23 | #include FT_OPENTYPE_VALIDATE_H 24 | 25 | 26 | /* documentation is in ftotval.h */ 27 | 28 | FT_EXPORT_DEF( FT_Error ) 29 | FT_OpenType_Validate( FT_Face face, 30 | FT_UInt validation_flags, 31 | FT_Bytes *BASE_table, 32 | FT_Bytes *GDEF_table, 33 | FT_Bytes *GPOS_table, 34 | FT_Bytes *GSUB_table, 35 | FT_Bytes *JSTF_table ) 36 | { 37 | FT_Service_OTvalidate service; 38 | FT_Error error; 39 | 40 | 41 | if ( !face ) 42 | { 43 | error = FT_THROW( Invalid_Face_Handle ); 44 | goto Exit; 45 | } 46 | 47 | if ( !( BASE_table && 48 | GDEF_table && 49 | GPOS_table && 50 | GSUB_table && 51 | JSTF_table ) ) 52 | { 53 | error = FT_THROW( Invalid_Argument ); 54 | goto Exit; 55 | } 56 | 57 | FT_FACE_FIND_GLOBAL_SERVICE( face, service, OPENTYPE_VALIDATE ); 58 | 59 | if ( service ) 60 | error = service->validate( face, 61 | validation_flags, 62 | BASE_table, 63 | GDEF_table, 64 | GPOS_table, 65 | GSUB_table, 66 | JSTF_table ); 67 | else 68 | error = FT_THROW( Unimplemented_Feature ); 69 | 70 | Exit: 71 | return error; 72 | } 73 | 74 | 75 | FT_EXPORT_DEF( void ) 76 | FT_OpenType_Free( FT_Face face, 77 | FT_Bytes table ) 78 | { 79 | FT_Memory memory; 80 | 81 | 82 | if ( !face ) 83 | return; 84 | 85 | memory = FT_FACE_MEMORY( face ); 86 | 87 | FT_FREE( table ); 88 | } 89 | 90 | 91 | /* END */ 92 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/base/basepic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* basepic.h */ 4 | /* */ 5 | /* The FreeType position independent code services for base. */ 6 | /* */ 7 | /* Copyright 2009-2016 by */ 8 | /* Oran Agra and Mickey Gabel. */ 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 BASEPIC_H_ 20 | #define BASEPIC_H_ 21 | 22 | 23 | #include FT_INTERNAL_PIC_H 24 | 25 | 26 | #ifndef FT_CONFIG_OPTION_PIC 27 | 28 | #define FT_OUTLINE_GLYPH_CLASS_GET &ft_outline_glyph_class 29 | #define FT_BITMAP_GLYPH_CLASS_GET &ft_bitmap_glyph_class 30 | #define FT_DEFAULT_MODULES_GET ft_default_modules 31 | 32 | #ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK 33 | #define FT_RACCESS_GUESS_TABLE_GET ft_raccess_guess_table 34 | #endif 35 | 36 | #else /* FT_CONFIG_OPTION_PIC */ 37 | 38 | #include FT_GLYPH_H 39 | 40 | #ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK 41 | #include FT_INTERNAL_RFORK_H 42 | #endif 43 | 44 | 45 | FT_BEGIN_HEADER 46 | 47 | typedef struct BasePIC_ 48 | { 49 | FT_Module_Class** default_module_classes; 50 | FT_Glyph_Class ft_outline_glyph_class; 51 | FT_Glyph_Class ft_bitmap_glyph_class; 52 | 53 | #ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK 54 | ft_raccess_guess_rec ft_raccess_guess_table[FT_RACCESS_N_RULES]; 55 | #endif 56 | 57 | } BasePIC; 58 | 59 | 60 | #define GET_PIC( lib ) ( (BasePIC*)( (lib)->pic_container.base ) ) 61 | 62 | #define FT_OUTLINE_GLYPH_CLASS_GET \ 63 | ( &GET_PIC( library )->ft_outline_glyph_class ) 64 | #define FT_BITMAP_GLYPH_CLASS_GET \ 65 | ( &GET_PIC( library )->ft_bitmap_glyph_class ) 66 | #define FT_DEFAULT_MODULES_GET \ 67 | ( GET_PIC( library )->default_module_classes ) 68 | 69 | #ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK 70 | #define FT_RACCESS_GUESS_TABLE_GET \ 71 | ( GET_PIC( library )->ft_raccess_guess_table ) 72 | #endif 73 | 74 | 75 | /* see basepic.c for the implementation */ 76 | void 77 | ft_base_pic_free( FT_Library library ); 78 | 79 | FT_Error 80 | ft_base_pic_init( FT_Library library ); 81 | 82 | FT_END_HEADER 83 | 84 | #endif /* FT_CONFIG_OPTION_PIC */ 85 | 86 | /* */ 87 | 88 | #endif /* BASEPIC_H_ */ 89 | 90 | 91 | /* END */ 92 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/autofit/afloader.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afloader.h */ 4 | /* */ 5 | /* Auto-fitter glyph loading routines (specification). */ 6 | /* */ 7 | /* Copyright 2003-2016 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 AFLOADER_H_ 20 | #define AFLOADER_H_ 21 | 22 | #include "afhints.h" 23 | #include "afmodule.h" 24 | #include "afglobal.h" 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | /* 30 | * The autofitter module's (global) data structure to communicate with 31 | * actual fonts. If necessary, `local' data like the current face, the 32 | * current face's auto-hint data, or the current glyph's parameters 33 | * relevant to auto-hinting are `swapped in'. Cf. functions like 34 | * `af_loader_reset' and `af_loader_load_g'. 35 | */ 36 | 37 | typedef struct AF_LoaderRec_ 38 | { 39 | /* current face data */ 40 | FT_Face face; 41 | AF_FaceGlobals globals; 42 | 43 | /* current glyph data */ 44 | AF_GlyphHints hints; 45 | AF_StyleMetrics metrics; 46 | FT_Bool transformed; 47 | FT_Matrix trans_matrix; 48 | FT_Vector trans_delta; 49 | FT_Vector pp1; 50 | FT_Vector pp2; 51 | /* we don't handle vertical phantom points */ 52 | 53 | } AF_LoaderRec, *AF_Loader; 54 | 55 | 56 | FT_LOCAL( void ) 57 | af_loader_init( AF_Loader loader, 58 | AF_GlyphHints hints ); 59 | 60 | 61 | FT_LOCAL( FT_Error ) 62 | af_loader_reset( AF_Loader loader, 63 | AF_Module module, 64 | FT_Face face ); 65 | 66 | 67 | FT_LOCAL( void ) 68 | af_loader_done( AF_Loader loader ); 69 | 70 | 71 | FT_LOCAL( FT_Error ) 72 | af_loader_load_glyph( AF_Loader loader, 73 | AF_Module module, 74 | FT_Face face, 75 | FT_UInt gindex, 76 | FT_Int32 load_flags ); 77 | 78 | FT_LOCAL_DEF( FT_Int32 ) 79 | af_loader_compute_darkening( AF_Loader loader, 80 | FT_Face face, 81 | FT_Pos standard_width ); 82 | 83 | /* */ 84 | 85 | 86 | FT_END_HEADER 87 | 88 | #endif /* AFLOADER_H_ */ 89 | 90 | 91 | /* END */ 92 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/freetype/internal/services/svprop.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svprop.h */ 4 | /* */ 5 | /* The FreeType property service (specification). */ 6 | /* */ 7 | /* Copyright 2012-2016 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 | #ifndef FT_CONFIG_OPTION_PIC 49 | 50 | #define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \ 51 | set_property_, \ 52 | get_property_ ) \ 53 | static const FT_Service_PropertiesRec class_ = \ 54 | { \ 55 | set_property_, \ 56 | get_property_ \ 57 | }; 58 | 59 | #else /* FT_CONFIG_OPTION_PIC */ 60 | 61 | #define FT_DEFINE_SERVICE_PROPERTIESREC( class_, \ 62 | set_property_, \ 63 | get_property_ ) \ 64 | void \ 65 | FT_Init_Class_ ## class_( FT_Service_PropertiesRec* clazz ) \ 66 | { \ 67 | clazz->set_property = set_property_; \ 68 | clazz->get_property = get_property_; \ 69 | } 70 | 71 | #endif /* FT_CONFIG_OPTION_PIC */ 72 | 73 | /* */ 74 | 75 | 76 | FT_END_HEADER 77 | 78 | 79 | #endif /* SVPROP_H_ */ 80 | 81 | 82 | /* END */ 83 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/base/ftbase.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftbase.h */ 4 | /* */ 5 | /* The FreeType private functions used in base module (specification). */ 6 | /* */ 7 | /* Copyright 2008-2016 by */ 8 | /* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. */ 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 FTBASE_H_ 20 | #define FTBASE_H_ 21 | 22 | 23 | #include 24 | #include FT_INTERNAL_OBJECTS_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | /* MacOS resource fork cannot exceed 16MB at least for Carbon code; */ 31 | /* see https://support.microsoft.com/en-us/kb/130437 */ 32 | #define FT_MAC_RFORK_MAX_LEN 0x00FFFFFFUL 33 | 34 | 35 | /* Assume the stream is sfnt-wrapped PS Type1 or sfnt-wrapped CID-keyed */ 36 | /* font, and try to load a face specified by the face_index. */ 37 | FT_LOCAL( FT_Error ) 38 | open_face_PS_from_sfnt_stream( FT_Library library, 39 | FT_Stream stream, 40 | FT_Long face_index, 41 | FT_Int num_params, 42 | FT_Parameter *params, 43 | FT_Face *aface ); 44 | 45 | 46 | /* Create a new FT_Face given a buffer and a driver name. */ 47 | /* From ftmac.c. */ 48 | FT_LOCAL( FT_Error ) 49 | open_face_from_buffer( FT_Library library, 50 | FT_Byte* base, 51 | FT_ULong size, 52 | FT_Long face_index, 53 | const char* driver_name, 54 | FT_Face *aface ); 55 | 56 | 57 | #if defined( FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK ) && \ 58 | !defined( FT_MACINTOSH ) 59 | /* Mac OS X/Darwin kernel often changes recommended method to access */ 60 | /* the resource fork and older methods makes the kernel issue the */ 61 | /* warning of deprecated method. To calm it down, the methods based */ 62 | /* on Darwin VFS should be grouped and skip the rest methods after */ 63 | /* the case the resource is opened but found to lack a font in it. */ 64 | FT_LOCAL( FT_Bool ) 65 | ft_raccess_rule_by_darwin_vfs( FT_Library library, FT_UInt rule_index ); 66 | #endif 67 | 68 | 69 | FT_END_HEADER 70 | 71 | #endif /* FTBASE_H_ */ 72 | 73 | 74 | /* END */ 75 | -------------------------------------------------------------------------------- /Shaders/Unlit - FreeType Text 3.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/FreeType Text 3" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Alpha (A)", 2D) = "white" {} 6 | } 7 | 8 | SubShader 9 | { 10 | LOD 200 11 | 12 | Tags 13 | { 14 | "Queue" = "Transparent" 15 | "IgnoreProjector" = "True" 16 | "RenderType" = "Transparent" 17 | } 18 | 19 | Cull Off 20 | Lighting Off 21 | ZWrite Off 22 | Offset -1, -1 23 | Fog { Mode Off } 24 | Blend One OneMinusSrcAlpha 25 | 26 | Pass 27 | { 28 | CGPROGRAM 29 | #pragma vertex vert 30 | #pragma fragment frag 31 | #include "Unlit - FreeType Text.cginc" 32 | 33 | struct appdata_t 34 | { 35 | float4 vertex : POSITION; 36 | float4 color : COLOR; 37 | float2 texcoord : TEXCOORD0; 38 | }; 39 | 40 | struct v2f 41 | { 42 | float4 vertex : POSITION; 43 | float4 color1 : COLOR; 44 | float4 color2 : COLOR2; 45 | float2 texcoord : TEXCOORD0; 46 | float4 worldPos : TEXCOORD1; 47 | float2 worldPos2 : TEXCOORD2; 48 | }; 49 | 50 | sampler2D _MainTex; 51 | float4 _MainTex_ST; 52 | float4 _ClipRange0 = float4(0.0, 0.0, 1.0, 1.0); 53 | float4 _ClipArgs0 = float4(1000.0, 1000.0, 0.0, 1.0); 54 | float4 _ClipRange1 = float4(0.0, 0.0, 1.0, 1.0); 55 | float4 _ClipArgs1 = float4(1000.0, 1000.0, 0.0, 1.0); 56 | float4 _ClipRange2 = float4(0.0, 0.0, 1.0, 1.0); 57 | float4 _ClipArgs2 = float4(1000.0, 1000.0, 0.0, 1.0); 58 | 59 | float2 Rotate (float2 v, float2 rot) 60 | { 61 | float2 ret; 62 | ret.x = v.x * rot.y - v.y * rot.x; 63 | ret.y = v.x * rot.x + v.y * rot.y; 64 | return ret; 65 | } 66 | 67 | v2f vert (appdata_t v) 68 | { 69 | v2f o; 70 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 71 | decodeColor(v.color, o.color1, o.color2); 72 | o.texcoord = v.texcoord; 73 | o.worldPos.xy = v.vertex.xy * _ClipRange0.zw + _ClipRange0.xy; 74 | o.worldPos.zw = Rotate(v.vertex.xy, _ClipArgs1.zw) * _ClipRange1.zw + _ClipRange1.xy; 75 | o.worldPos2 = Rotate(v.vertex.xy, _ClipArgs2.zw) * _ClipRange2.zw + _ClipRange2.xy; 76 | 77 | return o; 78 | } 79 | 80 | float4 frag (v2f i) : COLOR 81 | { 82 | float2 alpha = decodeAlpha(tex2D(_MainTex, i.texcoord)) * float2(i.color1.a, i.color2.a * i.color1.a); 83 | float4 col; 84 | col.rgb = i.color1.rgb * alpha.x + i.color2.rgb * alpha.y * (1 - alpha.x); 85 | col.a = max(alpha.x, alpha.y); 86 | 87 | // First clip region 88 | float2 factor = (float2(1.0, 1.0) - abs(i.worldPos.xy)) * _ClipArgs0.xy; 89 | float f = min(factor.x, factor.y); 90 | 91 | // Second clip region 92 | factor = (float2(1.0, 1.0) - abs(i.worldPos.zw)) * _ClipArgs1.xy; 93 | f = min(f, min(factor.x, factor.y)); 94 | 95 | // Third clip region 96 | factor = (float2(1.0, 1.0) - abs(i.worldPos2)) * _ClipArgs2.xy; 97 | f = min(f, min(factor.x, factor.y)); 98 | 99 | col.a *= clamp( f, 0.0, 1.0); 100 | 101 | return col; 102 | } 103 | ENDCG 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/cff/cf2read.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* cf2read.h */ 4 | /* */ 5 | /* Adobe's code for stream handling (specification). */ 6 | /* */ 7 | /* Copyright 2007-2013 Adobe Systems Incorporated. */ 8 | /* */ 9 | /* This software, and all works of authorship, whether in source or */ 10 | /* object code form as indicated by the copyright notice(s) included */ 11 | /* herein (collectively, the "Work") is made available, and may only be */ 12 | /* used, modified, and distributed under the FreeType Project License, */ 13 | /* LICENSE.TXT. Additionally, subject to the terms and conditions of the */ 14 | /* FreeType Project License, each contributor to the Work hereby grants */ 15 | /* to any individual or legal entity exercising permissions granted by */ 16 | /* the FreeType Project License and this section (hereafter, "You" or */ 17 | /* "Your") a perpetual, worldwide, non-exclusive, no-charge, */ 18 | /* royalty-free, irrevocable (except as stated in this section) patent */ 19 | /* license to make, have made, use, offer to sell, sell, import, and */ 20 | /* otherwise transfer the Work, where such license applies only to those */ 21 | /* patent claims licensable by such contributor that are necessarily */ 22 | /* infringed by their contribution(s) alone or by combination of their */ 23 | /* contribution(s) with the Work to which such contribution(s) was */ 24 | /* submitted. If You institute patent litigation against any entity */ 25 | /* (including a cross-claim or counterclaim in a lawsuit) alleging that */ 26 | /* the Work or a contribution incorporated within the Work constitutes */ 27 | /* direct or contributory patent infringement, then any patent licenses */ 28 | /* granted to You under this License for that Work shall terminate as of */ 29 | /* the date such litigation is filed. */ 30 | /* */ 31 | /* By using, modifying, or distributing the Work you indicate that you */ 32 | /* have read and understood the terms and conditions of the */ 33 | /* FreeType Project License as well as those provided in this section, */ 34 | /* and you accept them fully. */ 35 | /* */ 36 | /***************************************************************************/ 37 | 38 | 39 | #ifndef CF2READ_H_ 40 | #define CF2READ_H_ 41 | 42 | 43 | FT_BEGIN_HEADER 44 | 45 | 46 | typedef struct CF2_BufferRec_ 47 | { 48 | FT_Error* error; 49 | const FT_Byte* start; 50 | const FT_Byte* end; 51 | const FT_Byte* ptr; 52 | 53 | } CF2_BufferRec, *CF2_Buffer; 54 | 55 | 56 | FT_LOCAL( CF2_Int ) 57 | cf2_buf_readByte( CF2_Buffer buf ); 58 | FT_LOCAL( FT_Bool ) 59 | cf2_buf_isEnd( CF2_Buffer buf ); 60 | 61 | 62 | FT_END_HEADER 63 | 64 | 65 | #endif /* CF2READ_H_ */ 66 | 67 | 68 | /* END */ 69 | -------------------------------------------------------------------------------- /Plugin/src/freetype/include/freetype/internal/services/svbdf.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svbdf.h */ 4 | /* */ 5 | /* The FreeType BDF services (specification). */ 6 | /* */ 7 | /* Copyright 2003-2016 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 FT_BDF_H 23 | #include FT_INTERNAL_SERVICE_H 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 | #ifndef FT_CONFIG_OPTION_PIC 50 | 51 | #define FT_DEFINE_SERVICE_BDFRec( class_, \ 52 | get_charset_id_, \ 53 | get_property_ ) \ 54 | static const FT_Service_BDFRec class_ = \ 55 | { \ 56 | get_charset_id_, get_property_ \ 57 | }; 58 | 59 | #else /* FT_CONFIG_OPTION_PIC */ 60 | 61 | #define FT_DEFINE_SERVICE_BDFRec( class_, \ 62 | get_charset_id_, \ 63 | get_property_ ) \ 64 | void \ 65 | FT_Init_Class_ ## class_( FT_Service_BDFRec* clazz ) \ 66 | { \ 67 | clazz->get_charset_id = get_charset_id_; \ 68 | clazz->get_property = get_property_; \ 69 | } 70 | 71 | #endif /* FT_CONFIG_OPTION_PIC */ 72 | 73 | /* */ 74 | 75 | 76 | FT_END_HEADER 77 | 78 | 79 | #endif /* SVBDF_H_ */ 80 | 81 | 82 | /* END */ 83 | -------------------------------------------------------------------------------- /Plugin/src/freetype/src/raster/rastpic.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* rastpic.c */ 4 | /* */ 5 | /* The FreeType position independent code services for raster module. */ 6 | /* */ 7 | /* Copyright 2009-2016 by */ 8 | /* Oran Agra and Mickey Gabel. */ 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 | #include 20 | #include FT_FREETYPE_H 21 | #include FT_INTERNAL_OBJECTS_H 22 | #include "rastpic.h" 23 | #include "rasterrs.h" 24 | 25 | 26 | #ifdef FT_CONFIG_OPTION_PIC 27 | 28 | /* forward declaration of PIC init functions from ftraster.c */ 29 | void 30 | FT_Init_Class_ft_standard_raster( FT_Raster_Funcs* funcs ); 31 | 32 | 33 | void 34 | ft_raster1_renderer_class_pic_free( FT_Library library ) 35 | { 36 | FT_PIC_Container* pic_container = &library->pic_container; 37 | FT_Memory memory = library->memory; 38 | 39 | 40 | if ( pic_container->raster ) 41 | { 42 | RasterPIC* container = (RasterPIC*)pic_container->raster; 43 | 44 | 45 | if ( --container->ref_count ) 46 | return; 47 | FT_FREE( container ); 48 | pic_container->raster = NULL; 49 | } 50 | } 51 | 52 | 53 | FT_Error 54 | ft_raster1_renderer_class_pic_init( FT_Library library ) 55 | { 56 | FT_PIC_Container* pic_container = &library->pic_container; 57 | FT_Error error = FT_Err_Ok; 58 | RasterPIC* container = NULL; 59 | FT_Memory memory = library->memory; 60 | 61 | 62 | /* XXX: since this function also served the no longer available */ 63 | /* raster5 renderer it uses reference counting, which could */ 64 | /* be removed now */ 65 | if ( pic_container->raster ) 66 | { 67 | ((RasterPIC*)pic_container->raster)->ref_count++; 68 | return error; 69 | } 70 | 71 | /* allocate pointer, clear and set global container pointer */ 72 | if ( FT_ALLOC( container, sizeof ( *container ) ) ) 73 | return error; 74 | FT_MEM_SET( container, 0, sizeof ( *container ) ); 75 | pic_container->raster = container; 76 | 77 | container->ref_count = 1; 78 | 79 | /* initialize pointer table - */ 80 | /* this is how the module usually expects this data */ 81 | FT_Init_Class_ft_standard_raster( &container->ft_standard_raster ); 82 | 83 | return error; 84 | } 85 | 86 | #endif /* FT_CONFIG_OPTION_PIC */ 87 | 88 | 89 | /* END */ 90 | --------------------------------------------------------------------------------