├── .gitignore ├── LICENSE.txt ├── README.md ├── examples ├── glfw │ ├── CMakeLists.txt │ ├── colors.cpp │ ├── main.cpp │ └── particles.cpp └── ios │ ├── FontstashiOS.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── FontstashiOS │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── Main_iPhone.storyboard │ ├── ViewController.h │ ├── ViewController.mm │ ├── main.m │ └── resources │ ├── DejaVuSerif.ttf │ ├── Sanskrit2003.ttf │ ├── amiri-regular.ttf │ └── fireflysung.ttf ├── fontstash ├── fontstash.h ├── glfontstash.h ├── lib │ ├── include │ │ ├── freetype2 │ │ │ ├── freetype │ │ │ │ ├── config │ │ │ │ │ ├── ftconfig.h │ │ │ │ │ ├── ftheader.h │ │ │ │ │ ├── ftmodule.h │ │ │ │ │ ├── ftoption.h │ │ │ │ │ └── ftstdlib.h │ │ │ │ ├── freetype.h │ │ │ │ ├── ftadvanc.h │ │ │ │ ├── ftbbox.h │ │ │ │ ├── ftbdf.h │ │ │ │ ├── ftbitmap.h │ │ │ │ ├── ftcache.h │ │ │ │ ├── ftchapters.h │ │ │ │ ├── ftcid.h │ │ │ │ ├── fterrdef.h │ │ │ │ ├── fterrors.h │ │ │ │ ├── ftgasp.h │ │ │ │ ├── ftglyph.h │ │ │ │ ├── ftgxval.h │ │ │ │ ├── ftgzip.h │ │ │ │ ├── ftimage.h │ │ │ │ ├── ftincrem.h │ │ │ │ ├── ftlcdfil.h │ │ │ │ ├── ftlist.h │ │ │ │ ├── ftlzw.h │ │ │ │ ├── ftmac.h │ │ │ │ ├── ftmm.h │ │ │ │ ├── ftmodapi.h │ │ │ │ ├── ftmoderr.h │ │ │ │ ├── ftotval.h │ │ │ │ ├── ftoutln.h │ │ │ │ ├── ftpfr.h │ │ │ │ ├── ftrender.h │ │ │ │ ├── ftsizes.h │ │ │ │ ├── ftsnames.h │ │ │ │ ├── ftstroke.h │ │ │ │ ├── ftsynth.h │ │ │ │ ├── ftsystem.h │ │ │ │ ├── fttrigon.h │ │ │ │ ├── fttypes.h │ │ │ │ ├── ftwinfnt.h │ │ │ │ ├── ftxf86.h │ │ │ │ ├── internal │ │ │ │ │ ├── autohint.h │ │ │ │ │ ├── ftcalc.h │ │ │ │ │ ├── ftdebug.h │ │ │ │ │ ├── ftdriver.h │ │ │ │ │ ├── ftgloadr.h │ │ │ │ │ ├── ftmemory.h │ │ │ │ │ ├── ftobjs.h │ │ │ │ │ ├── ftpic.h │ │ │ │ │ ├── ftrfork.h │ │ │ │ │ ├── ftserv.h │ │ │ │ │ ├── ftstream.h │ │ │ │ │ ├── fttrace.h │ │ │ │ │ ├── ftvalid.h │ │ │ │ │ ├── internal.h │ │ │ │ │ ├── pcftypes.h │ │ │ │ │ ├── psaux.h │ │ │ │ │ ├── pshints.h │ │ │ │ │ ├── services │ │ │ │ │ │ ├── svbdf.h │ │ │ │ │ │ ├── svcid.h │ │ │ │ │ │ ├── svgldict.h │ │ │ │ │ │ ├── svgxval.h │ │ │ │ │ │ ├── svkern.h │ │ │ │ │ │ ├── svmm.h │ │ │ │ │ │ ├── svotval.h │ │ │ │ │ │ ├── svpfr.h │ │ │ │ │ │ ├── svpostnm.h │ │ │ │ │ │ ├── svpscmap.h │ │ │ │ │ │ ├── svpsinfo.h │ │ │ │ │ │ ├── svsfnt.h │ │ │ │ │ │ ├── svttcmap.h │ │ │ │ │ │ ├── svtteng.h │ │ │ │ │ │ ├── svttglyf.h │ │ │ │ │ │ ├── svwinfnt.h │ │ │ │ │ │ └── svxf86nm.h │ │ │ │ │ ├── sfnt.h │ │ │ │ │ ├── t1types.h │ │ │ │ │ └── tttypes.h │ │ │ │ ├── t1tables.h │ │ │ │ ├── ttnameid.h │ │ │ │ ├── tttables.h │ │ │ │ ├── tttags.h │ │ │ │ └── ttunpat.h │ │ │ └── ft2build.h │ │ └── harfbuzz │ │ │ ├── hb-blob.h │ │ │ ├── hb-buffer.h │ │ │ ├── hb-common.h │ │ │ ├── hb-deprecated.h │ │ │ ├── hb-face.h │ │ │ ├── hb-font.h │ │ │ ├── hb-ft.h │ │ │ ├── hb-glib.h │ │ │ ├── hb-gobject.h │ │ │ ├── hb-icu.h │ │ │ ├── hb-ot-font.h │ │ │ ├── hb-ot-layout.h │ │ │ ├── hb-ot-shape.h │ │ │ ├── hb-ot-tag.h │ │ │ ├── hb-ot.h │ │ │ ├── hb-set.h │ │ │ ├── hb-shape-plan.h │ │ │ ├── hb-shape.h │ │ │ ├── hb-unicode.h │ │ │ ├── hb-version.h │ │ │ └── hb.h │ └── precompiled │ │ ├── freetype2 │ │ └── libfreetype2-sim.a │ │ └── harfbuzz │ │ ├── libharfbuzz-sim.a │ │ └── libucdn-sim.a ├── sdf.h ├── shaders.h └── stb_truetype.h └── img ├── capture.png └── particles.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | *.xccheckout 3 | *.moved-aside 4 | xcuserdata 5 | !default.pbxuser 6 | !default.mode1v3 7 | !default.mode2v3 8 | !default.perspectivev3 9 | *.perspectivev3 10 | *.mode2v3 11 | *.mode1v3 12 | *.pbxuser 13 | build/ 14 | DerivedData/ 15 | *~.nib 16 | *.lock 17 | 18 | # vim 19 | *.swp 20 | 21 | # OS X 22 | .Trashes 23 | .DS_Store 24 | 25 | # Compiled Object files 26 | *.slo 27 | *.lo 28 | *.o 29 | *.obj 30 | 31 | # Precompiled Headers 32 | *.gch 33 | *.pch 34 | 35 | # Compiled Dynamic libraries 36 | *.so 37 | *.dylib 38 | *.dll 39 | 40 | # Fortran module files 41 | *.mod 42 | 43 | # Compiled Static libraries 44 | *.lai 45 | *.la 46 | #*.a 47 | *.lib 48 | 49 | # Executables 50 | *.exe 51 | *.out 52 | *.app 53 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Mikko Mononen memon@inside.org 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | 19 | -------------------------------------------------------------------------------- 20 | 21 | The MIT License (MIT) 22 | 23 | Copyright (c) 2014 Tangram 24 | 25 | Permission is hereby granted, free of charge, to any person obtaining a copy 26 | of this software and associated documentation files (the "Software"), to deal 27 | in the Software without restriction, including without limitation the rights 28 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 29 | copies of the Software, and to permit persons to whom the Software is 30 | furnished to do so, subject to the following conditions: 31 | 32 | The above copyright notice and this permission notice shall be included in all 33 | copies or substantial portions of the Software. 34 | 35 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 36 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 37 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 38 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 39 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 40 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 41 | SOFTWARE. 42 | 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | fontstash-es 2 | ============ 3 | 4 | ![00](img/particles.gif) 5 | 6 | This project is based on [fontstash](https://github.com/memononen/fontstash), it is using OpenGL ES 2.0 in order to be used on mobile devices. 7 | 8 | You can use the following features: 9 | 10 | + Text-shaping using the [Harfbuzz](https://github.com/behdad/harfbuzz) text-shaping engine: this lets you render text in several directions (left-to-right, top-to-bottom...), compatible only by using the FreeType rasterizer. 11 | + Signed distance field rendering: for high quality anti-aliased text rendering. 12 | + Gl-backend: if you're not familiar with OpenGL, simply use the provided rendering system. 13 | 14 | Activating features 15 | ------------------- 16 | 17 | Enabling text-shaping using the freetype rasterizer: 18 | ```c++ 19 | #define FONS_USE_FREETYPE 20 | #define GLFONTSTASH_IMPLEMENTATION 21 | #define FONS_USE_HARFBUZZ 22 | #import "glfontstash.h" 23 | ``` 24 | 25 | Adding fontstash-es to your project 26 | ----------------------------------- 27 | 28 | The text-shaping feature creates a lot of dependencies and uses some static libraries in order to be used. 29 | 30 | If you're not planning to use the text-shaping engine, simply add the fontstash-es/include headers in your project. 31 | 32 | If you want to use the text-shaping engine you would need the header files from harfbuzz, freetype2 and the static libraries for these two + [ucdn](https://github.com/grigorig/ucdn) for unicode database and normalization; this for each of the different architectures you would be targetting. This project has these static libraries only for the iPhone simulator architecture (i386, x86_64). 33 | 34 | Building examples 35 | ----------------- 36 | 37 | For iOS, simply use the provided X-code project. 38 | 39 | If you want to build the GLFW examples, you will need to install _GLFW_ and _CMake_, you can download it [here](http://www.cmake.org/download/) or use [homebrew](http://brew.sh/) to download everything. 40 | 41 | ```bash 42 | brew install cmake 43 | brew tap homebrew/versions 44 | brew install glfw3 pkg-config 45 | ``` 46 | 47 | Then build and run the examples: 48 | ``` 49 | cd examples/glfw 50 | cmake . && make 51 | ./glfw.out 52 | ./particles.out 53 | ``` 54 | -------------------------------------------------------------------------------- /examples/glfw/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(fontstash_es) 3 | 4 | if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x -stdlib=libc++ -g -O0") 6 | else() 7 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x -g -O0") 8 | endif() 9 | 10 | find_package(PkgConfig REQUIRED) 11 | pkg_search_module(GLFW REQUIRED glfw3) 12 | 13 | if(NOT GLFW_FOUND) 14 | message(SEND_ERROR "GLFW not found") 15 | return() 16 | else() 17 | include_directories(${GLFW_INCLUDE_DIRS}) 18 | message(STATUS "Found GLFW ${GLFW_PREFIX}") 19 | endif() 20 | 21 | IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 22 | list(APPEND GLFW_LDFLAGS 23 | "-framework OpenGL" 24 | "-framework Cocoa" 25 | "-framework IOKit" 26 | "-framework CoreFoundation" 27 | "-framework CoreVideo") 28 | else() 29 | find_package(OpenGL REQUIRED) 30 | endif() 31 | 32 | include_directories(../../fontstash) 33 | 34 | add_executable(glfw.out main.cpp) 35 | add_executable(particles.out particles.cpp) 36 | add_executable(colors.out colors.cpp) 37 | 38 | target_link_libraries(glfw.out ${GLFW_LDFLAGS} ${OPENGL_LIBRARIES}) 39 | target_link_libraries(particles.out ${GLFW_LDFLAGS} ${OPENGL_LIBRARIES}) 40 | target_link_libraries(colors.out ${GLFW_LDFLAGS} ${OPENGL_LIBRARIES}) 41 | 42 | add_custom_target(copy_resources 43 | COMMAND ${CMAKE_COMMAND} -E copy_directory 44 | ${CMAKE_CURRENT_SOURCE_DIR}/../ios/FontstashiOS/resources 45 | ${CMAKE_BINARY_DIR} 46 | # Make resources show up in IDE, at least this should do it 47 | SOURCES ${RESOURCE_FILES}) 48 | 49 | add_dependencies(glfw.out copy_resources) 50 | -------------------------------------------------------------------------------- /examples/glfw/colors.cpp: -------------------------------------------------------------------------------- 1 | #define GLFW_INCLUDE_ES2 2 | #include 3 | #include 4 | 5 | #define GLFONS_DEBUG 6 | #define GLFONTSTASH_IMPLEMENTATION 7 | #include "glfontstash.h" 8 | #include 9 | #include 10 | 11 | GLFWwindow* window; 12 | float width = 800, height = 600, dpiRatio = 1; 13 | 14 | #define NB_TEXT 3500 15 | #define NB_BUFFER 5 16 | 17 | FONScontext* ftCtx; 18 | fsuint textBuffers[NB_BUFFER]; 19 | 20 | int main() { 21 | std::default_random_engine generator; 22 | int fbWidth, fbHeight; 23 | 24 | // GL context init 25 | glfwInit(); 26 | glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); 27 | glfwWindowHint(GLFW_SAMPLES, 2); 28 | window = glfwCreateWindow(width, height, "fontstash-es", NULL, NULL); 29 | glfwGetFramebufferSize(window, &fbWidth, &fbHeight); 30 | dpiRatio = fbWidth / width; 31 | glfwMakeContextCurrent(window); 32 | glClearColor(1.0, 1.0, 1.0, 1.0); 33 | 34 | // init font context 35 | GLFONSparams params; 36 | params.useGLBackend = true; // if not set to true, you must provide your own gl backend 37 | ftCtx = glfonsCreate(512, 512, FONS_ZERO_TOPLEFT | FONS_NORMALIZE_TEX_COORDS, params, nullptr); 38 | //fonsAddFont(ftCtx, "Arial", "/Library/Fonts/Arial.ttf"); 39 | //fonsAddFont(ftCtx, "Arial", "/usr/share/fonts/TTF/DejaVuSans.ttf"); 40 | fonsAddFont(ftCtx, "Arial", "amiri-regular.ttf"); 41 | 42 | // set the screen size for font context transformations 43 | glfonsScreenSize(ftCtx, width * dpiRatio, height * dpiRatio); 44 | 45 | std::uniform_int_distribution colors(0, 255); 46 | 47 | // create and bind buffer 48 | for (int i = 0; i < NB_BUFFER; ++i) { 49 | glfonsBufferCreate(ftCtx, &textBuffers[i]); 50 | int col = glfonsRGBA(colors(generator), colors(generator), colors(generator), 255); 51 | glfonsSetColor(ftCtx, col); 52 | } 53 | 54 | // generate text ids for the currently bound text buffer 55 | struct Text { 56 | fsuint id[NB_TEXT]; 57 | float x[NB_TEXT]; 58 | float y[NB_TEXT]; 59 | } texts; 60 | 61 | glfonsGenText(ftCtx, NB_TEXT, texts.id); 62 | 63 | // rasterize some text 64 | fonsSetBlur(ftCtx, 2.5); 65 | fonsSetBlurType(ftCtx, FONS_EFFECT_DISTANCE_FIELD); 66 | fonsSetSize(ftCtx, 20.0 * dpiRatio); 67 | 68 | std::uniform_real_distribution xDistribution(30.0 * dpiRatio, width * dpiRatio - 30.0 * dpiRatio); 69 | std::uniform_real_distribution yDistribution(30.0 * dpiRatio, height * dpiRatio - 30.0 * dpiRatio); 70 | std::uniform_int_distribution alphabet('!', '~'); 71 | 72 | for (int i = 0; i < NB_TEXT; ++i) { 73 | fsuint buffer = floor(i / (NB_TEXT / NB_BUFFER)) + 1; 74 | glfonsBindBuffer(ftCtx, buffer); 75 | std::string str = std::string("") + (char)alphabet(generator); 76 | glfonsRasterize(ftCtx, texts.id[i], str.c_str()); 77 | texts.x[i] = xDistribution(generator); 78 | texts.y[i] = yDistribution(generator); 79 | glfonsTransform(ftCtx, texts.id[i], texts.x[i], texts.y[i], 0.0, 0.0); 80 | } 81 | 82 | while (!glfwWindowShouldClose(window)) { 83 | double t = glfwGetTime(); 84 | glViewport(0, 0, width * dpiRatio, height * dpiRatio); 85 | glfonsScreenSize(ftCtx, width * dpiRatio, height * dpiRatio); 86 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 87 | 88 | 89 | clock_t begin = clock(); 90 | for (int i = 0; i < NB_TEXT; ++i) { 91 | fsuint buffer = floor(i / (NB_TEXT / NB_BUFFER)) + 1; 92 | glfonsBindBuffer(ftCtx, buffer); 93 | glfonsTransform(ftCtx, texts.id[i], texts.x[i], texts.y[i] + cos(t + i), cos(t + i), cos(t + i) * 0.5 + 0.5); 94 | } 95 | 96 | for (int i = 0; i < NB_BUFFER; ++i) { 97 | glfonsBindBuffer(ftCtx, textBuffers[i]); 98 | glfonsUpdateBuffer(ftCtx); 99 | } 100 | 101 | // render the text 102 | glfonsDraw(ftCtx); 103 | clock_t end = clock(); 104 | glFinish(); 105 | std::cout << "Frame time: " << float(end - begin) / CLOCKS_PER_SEC * 1000 << "ms" << std::endl; 106 | 107 | 108 | glfwSwapBuffers(window); 109 | glfwPollEvents(); 110 | } 111 | 112 | // release font resources 113 | glfonsDelete(ftCtx); 114 | 115 | return 0; 116 | } 117 | -------------------------------------------------------------------------------- /examples/glfw/main.cpp: -------------------------------------------------------------------------------- 1 | #define GLFW_INCLUDE_ES2 2 | #include 3 | #include 4 | #include 5 | 6 | #define GLFONS_DEBUG 7 | #define GLFONTSTASH_IMPLEMENTATION 8 | #include "glfontstash.h" 9 | 10 | GLFWwindow* window; 11 | float width = 800, height = 600, dpiRatio = 1; 12 | 13 | #define NB_TEXT 4 14 | 15 | FONScontext* ftCtx; 16 | fsuint textBuffer, textIds[NB_TEXT]; 17 | 18 | int main() { 19 | int fbWidth, fbHeight; 20 | 21 | // GL context init 22 | glfwInit(); 23 | glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); 24 | glfwWindowHint(GLFW_SAMPLES, 2); 25 | window = glfwCreateWindow(width, height, "fontstash-es", NULL, NULL); 26 | glfwGetFramebufferSize(window, &fbWidth, &fbHeight); 27 | dpiRatio = fbWidth / width; 28 | glfwMakeContextCurrent(window); 29 | glClearColor(1.0, 1.0, 1.0, 1.0); 30 | 31 | // init font context 32 | GLFONSparams params; 33 | params.useGLBackend = true; // if not set to true, you must provide your own gl backend 34 | ftCtx = glfonsCreate(512, 512, FONS_ZERO_TOPLEFT | FONS_NORMALIZE_TEX_COORDS, params, nullptr); 35 | if (fonsAddFont(ftCtx, "Arial", "amiri-regular.ttf") == FONS_INVALID) { 36 | printf("Can't load font\n"); 37 | return 0; 38 | } 39 | 40 | // set the screen size for font context transformations 41 | glfonsScreenSize(ftCtx, width * dpiRatio, height * dpiRatio); 42 | 43 | // create and bind buffer 44 | glfonsBufferCreate(ftCtx, &textBuffer); 45 | 46 | // generate text ids for the currently bound text buffer 47 | glfonsGenText(ftCtx, NB_TEXT, textIds); 48 | 49 | // rasterize some text 50 | fonsSetBlur(ftCtx, 2.5); 51 | fonsSetBlurType(ftCtx, FONS_EFFECT_DISTANCE_FIELD); 52 | fonsSetSize(ftCtx, 20.0 * dpiRatio); 53 | glfonsRasterize(ftCtx, textIds[0], "the quick brown fox"); 54 | fonsSetSize(ftCtx, 40.0 * dpiRatio); 55 | glfonsRasterize(ftCtx, textIds[1], "jumps over the lazy dog"); 56 | fonsSetSize(ftCtx, 60.0 * dpiRatio); 57 | glfonsRasterize(ftCtx, textIds[2], "the quick brown fox jumps over the lazy dog"); 58 | glfonsRasterize(ftCtx, textIds[3], "fontstash-es"); 59 | 60 | for(int i = 0; i < NB_TEXT; ++i) { 61 | glfonsTransform(ftCtx, textIds[i], -(100.0 + i * 10.0) * dpiRatio, (100.0 + i * 50.0) * dpiRatio, 0.0, 1.0); 62 | } 63 | 64 | // upload rasterized data of currently bound buffer to gpu 65 | glfonsUpdateBuffer(ftCtx); 66 | 67 | while (!glfwWindowShouldClose(window)) { 68 | double t = glfwGetTime(); 69 | glViewport(0, 0, width * dpiRatio, height * dpiRatio); 70 | glfonsScreenSize(ftCtx, width * dpiRatio, height * dpiRatio); 71 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 72 | 73 | glfonsTransform(ftCtx, textIds[0], (width / 2.0) * dpiRatio, (height / 2.0) * dpiRatio, cos(t) * 0.5, cos(t) * 0.5 + 0.5); 74 | glfonsTransform(ftCtx, textIds[3], (width / 2.0) * dpiRatio, (height / 2.0 - 200.0 + cos(t) * 20.0) * dpiRatio, 0.0, 1.0); 75 | 76 | glfonsSetColor(ftCtx, 0x000000); 77 | 78 | glfonsUpdateBuffer(ftCtx); 79 | glfonsDraw(ftCtx); 80 | 81 | glfwSwapBuffers(window); 82 | glfwPollEvents(); 83 | } 84 | 85 | // release font resources 86 | glfonsDelete(ftCtx); 87 | 88 | return 0; 89 | } 90 | -------------------------------------------------------------------------------- /examples/glfw/particles.cpp: -------------------------------------------------------------------------------- 1 | #define GLFW_INCLUDE_ES2 2 | #include 3 | #include 4 | 5 | #define GLFONS_DEBUG 6 | #define GLFONTSTASH_IMPLEMENTATION 7 | #include "glfontstash.h" 8 | #include 9 | #include 10 | 11 | GLFWwindow* window; 12 | float width = 800, height = 600, dpiRatio = 1; 13 | 14 | #define NB_TEXT 3500 15 | 16 | FONScontext* ftCtx; 17 | fsuint textBuffer; 18 | 19 | int main() { 20 | int fbWidth, fbHeight; 21 | 22 | // GL context init 23 | glfwInit(); 24 | glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); 25 | glfwWindowHint(GLFW_SAMPLES, 2); 26 | window = glfwCreateWindow(width, height, "fontstash-es", NULL, NULL); 27 | glfwGetFramebufferSize(window, &fbWidth, &fbHeight); 28 | dpiRatio = fbWidth / width; 29 | glfwMakeContextCurrent(window); 30 | glClearColor(1.0, 1.0, 1.0, 1.0); 31 | 32 | // init font context 33 | GLFONSparams params; 34 | params.useGLBackend = true; // if not set to true, you must provide your own gl backend 35 | ftCtx = glfonsCreate(512, 512, FONS_ZERO_TOPLEFT | FONS_NORMALIZE_TEX_COORDS, params, nullptr); 36 | //fonsAddFont(ftCtx, "Arial", "/Library/Fonts/Arial.ttf"); 37 | //fonsAddFont(ftCtx, "Arial", "/usr/share/fonts/TTF/DejaVuSans.ttf"); 38 | fonsAddFont(ftCtx, "Arial", "amiri-regular.ttf"); 39 | 40 | // set the screen size for font context transformations 41 | glfonsScreenSize(ftCtx, width * dpiRatio, height * dpiRatio); 42 | 43 | // create and bind buffer 44 | glfonsBufferCreate(ftCtx, &textBuffer); 45 | 46 | // generate text ids for the currently bound text buffer 47 | 48 | struct Text { 49 | fsuint id[NB_TEXT]; 50 | float x[NB_TEXT]; 51 | float y[NB_TEXT]; 52 | } texts; 53 | 54 | glfonsGenText(ftCtx, NB_TEXT, texts.id); 55 | 56 | // rasterize some text 57 | fonsSetBlur(ftCtx, 2.5); 58 | fonsSetBlurType(ftCtx, FONS_EFFECT_DISTANCE_FIELD); 59 | fonsSetSize(ftCtx, 20.0 * dpiRatio); 60 | 61 | std::default_random_engine generator; 62 | std::uniform_real_distribution xDistribution(30.0 * dpiRatio, width * dpiRatio - 30.0 * dpiRatio); 63 | std::uniform_real_distribution yDistribution(30.0 * dpiRatio, height * dpiRatio - 30.0 * dpiRatio); 64 | std::uniform_int_distribution alphabet('!', '~'); 65 | 66 | for (int i = 0; i < NB_TEXT; ++i) { 67 | std::string str = std::string("") + (char)alphabet(generator); 68 | glfonsRasterize(ftCtx, texts.id[i], str.c_str()); 69 | texts.x[i] = xDistribution(generator); 70 | texts.y[i] = yDistribution(generator); 71 | glfonsTransform(ftCtx, texts.id[i], texts.x[i], texts.y[i], 0.0, 0.0); 72 | } 73 | 74 | // upload rasterized data of currently bound buffer to gpu 75 | glfonsUpdateBuffer(ftCtx); 76 | 77 | while (!glfwWindowShouldClose(window)) { 78 | double t = glfwGetTime(); 79 | glViewport(0, 0, width * dpiRatio, height * dpiRatio); 80 | glfonsScreenSize(ftCtx, width * dpiRatio, height * dpiRatio); 81 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 82 | 83 | 84 | clock_t begin = clock(); 85 | for (int i = 0; i < NB_TEXT; ++i) { 86 | glfonsTransform(ftCtx, texts.id[i], texts.x[i], texts.y[i] + cos(t + i), cos(t + i), cos(t + i) * 0.5 + 0.5); 87 | } 88 | 89 | // set rendering color for current buffer 90 | glfonsSetColor(ftCtx, 0x000000); 91 | 92 | glfonsUpdateBuffer(ftCtx); 93 | 94 | // render the text 95 | glfonsDraw(ftCtx); 96 | clock_t end = clock(); 97 | glFinish(); 98 | std::cout << "Frame time: " << float(end - begin) / CLOCKS_PER_SEC * 1000 << "ms" << std::endl; 99 | 100 | 101 | glfwSwapBuffers(window); 102 | glfwPollEvents(); 103 | } 104 | 105 | // release font resources 106 | glfonsDelete(ftCtx); 107 | 108 | return 0; 109 | } 110 | -------------------------------------------------------------------------------- /examples/ios/FontstashiOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/ios/FontstashiOS/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // FontstashiOS 4 | // 5 | // Created by Karim Naaji on 07/10/2014. 6 | // Copyright (c) 2014 Karim Naaji. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /examples/ios/FontstashiOS/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // FontstashiOS 4 | // 5 | // Created by Karim Naaji on 07/10/2014. 6 | // Copyright (c) 2014 Mapzen. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 14 | return YES; 15 | } 16 | 17 | - (void)applicationWillResignActive:(UIApplication *)application {} 18 | 19 | - (void)applicationDidEnterBackground:(UIApplication *)application {} 20 | 21 | - (void)applicationWillEnterForeground:(UIApplication *)application {} 22 | 23 | - (void)applicationDidBecomeActive:(UIApplication *)application {} 24 | 25 | - (void)applicationWillTerminate:(UIApplication *)application {} 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /examples/ios/FontstashiOS/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /examples/ios/FontstashiOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | Karim.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main_iPhone 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarTintParameters 34 | 35 | UINavigationBar 36 | 37 | Style 38 | UIBarStyleDefault 39 | Translucent 40 | 41 | 42 | 43 | UISupportedInterfaceOrientations 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UISupportedInterfaceOrientations~ipad 50 | 51 | UIInterfaceOrientationPortrait 52 | UIInterfaceOrientationPortraitUpsideDown 53 | UIInterfaceOrientationLandscapeLeft 54 | UIInterfaceOrientationLandscapeRight 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /examples/ios/FontstashiOS/Main_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/ios/FontstashiOS/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // FontstashiOS 4 | // 5 | // Created by Karim Naaji on 07/10/2014. 6 | // Copyright (c) 2014 Mapzen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import 13 | #import 14 | 15 | #define GLFONS_DEBUG 16 | #define GLFONTSTASH_IMPLEMENTATION 17 | #import "glfontstash.h" 18 | 19 | #define NB_TEXT 5 20 | 21 | @interface ViewController : GLKViewController { 22 | FONScontext* fs; 23 | 24 | int amiri; 25 | int dejavu; 26 | int han; 27 | int hindi; 28 | 29 | int width; 30 | int height; 31 | float dpiRatio; 32 | 33 | fsuint textBuffer, textIds[NB_TEXT]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /examples/ios/FontstashiOS/ViewController.mm: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // FontstashiOS 4 | // 5 | // Created by Karim Naaji on 07/10/2014. 6 | // Copyright (c) 2014 Mapzen. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @property (strong, nonatomic) EAGLContext *context; 14 | 15 | - (void)setupGL; 16 | - (void)tearDownGL; 17 | - (void)deleteFontContext; 18 | 19 | @end 20 | 21 | @implementation ViewController 22 | 23 | - (void)viewDidLoad 24 | { 25 | [super viewDidLoad]; 26 | 27 | self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; 28 | 29 | if (!self.context) { 30 | NSLog(@"Failed to create ES context"); 31 | } 32 | 33 | GLKView *view = (GLKView *)self.view; 34 | view.context = self.context; 35 | view.drawableDepthFormat = GLKViewDrawableDepthFormat24; 36 | 37 | [self setupGL]; 38 | } 39 | 40 | - (void)dealloc 41 | { 42 | [self tearDownGL]; 43 | 44 | if ([EAGLContext currentContext] == self.context) { 45 | [EAGLContext setCurrentContext:nil]; 46 | } 47 | } 48 | 49 | - (void)didReceiveMemoryWarning 50 | { 51 | [super didReceiveMemoryWarning]; 52 | 53 | if ([self isViewLoaded] && ([[self view] window] == nil)) { 54 | self.view = nil; 55 | 56 | [self tearDownGL]; 57 | 58 | if ([EAGLContext currentContext] == self.context) { 59 | [EAGLContext setCurrentContext:nil]; 60 | } 61 | self.context = nil; 62 | } 63 | } 64 | 65 | - (void)setupGL 66 | { 67 | [EAGLContext setCurrentContext:self.context]; 68 | 69 | CGSize screen = [UIScreen mainScreen].bounds.size; 70 | dpiRatio = [[UIScreen mainScreen] scale]; 71 | width = self.view.bounds.size.width * dpiRatio; 72 | height = self.view.bounds.size.height * dpiRatio; 73 | 74 | glViewport(0, 0, screen.width, screen.height); 75 | glClearColor(1.f, 1.f, 1.f, 1.f); 76 | 77 | [self createFontContext]; 78 | } 79 | 80 | - (void)tearDownGL 81 | { 82 | [EAGLContext setCurrentContext:self.context]; 83 | 84 | [self deleteFontContext]; 85 | } 86 | 87 | #pragma mark - GLKView and GLKViewController delegate methods 88 | 89 | - (void)update 90 | { 91 | } 92 | 93 | - (void)glkView:(GLKView *)view drawInRect:(CGRect)rect 94 | { 95 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 96 | 97 | glViewport(0, 0, width, height); 98 | static double t; 99 | t += 0.1; 100 | 101 | glfonsBindBuffer(fs, textBuffer); 102 | glfonsTransform(fs, textIds[0], width / 2.0, height / 2.0, cos(t) * 0.5, cos(t) * 0.5 + 0.5); 103 | glfonsTransform(fs, textIds[4], width / 2.0, height / 2.0 - 200.0 + cos(t) * 20.0, 0.0, 1.0); 104 | // push transforms to gpu 105 | glfonsUpdateBuffer(fs); 106 | glfonsBindBuffer(fs, textBuffer); 107 | 108 | glfonsSetColor(fs, glfonsRGBA(0.0, 0.0, 100.0 * (cos(t) * 0.5 + 0.5), 255.0)); 109 | 110 | // render the text for all buffers 111 | glfonsDraw(fs); 112 | } 113 | 114 | #pragma mark - Fontstash 115 | 116 | - (void)loadFonts 117 | { 118 | NSBundle* bundle = [NSBundle mainBundle]; 119 | char* resourcePath; 120 | 121 | resourcePath = (char*)[[bundle pathForResource:@"amiri-regular" 122 | ofType:@"ttf"] UTF8String]; 123 | 124 | amiri = fonsAddFont(fs, "amiri", resourcePath); 125 | 126 | if (amiri == FONS_INVALID) { 127 | NSLog(@"Could not add font normal"); 128 | } 129 | } 130 | 131 | - (void)createFontContext 132 | { 133 | GLFONSparams params; 134 | params.useGLBackend = true; // if not set to true, you must provide your own gl backend 135 | fs = glfonsCreate(512, 512, FONS_ZERO_TOPLEFT, params, nullptr); 136 | 137 | if (fs == NULL) { 138 | NSLog(@"Could not create font context"); 139 | } 140 | 141 | [self loadFonts]; 142 | 143 | fonsSetFont(fs, amiri); 144 | 145 | // set the screen size for font context transformations 146 | glfonsScreenSize(fs, width, height); 147 | 148 | // create and bind buffer 149 | glfonsBufferCreate(fs, &textBuffer); 150 | 151 | // generate text ids for the currently bound text buffer 152 | glfonsGenText(fs, NB_TEXT, textIds); 153 | 154 | // rasterize some text 155 | fonsSetBlur(fs, 2.5); 156 | fonsSetBlurType(fs, FONS_EFFECT_DISTANCE_FIELD); 157 | fonsSetSize(fs, 40.0 * dpiRatio); 158 | 159 | glfonsRasterize(fs, textIds[0], "the quick brown fox"); 160 | fonsSetSize(fs, 50.0 * dpiRatio); 161 | glfonsRasterize(fs, textIds[1], "jumps over the lazy dog"); 162 | fonsSetSize(fs, 60.0 * dpiRatio); 163 | glfonsRasterize(fs, textIds[2], "the quick brown fox jumps over the lazy dog"); 164 | glfonsRasterize(fs, textIds[3], "0123456789"); 165 | glfonsRasterize(fs, textIds[4], "fontstash-es"); 166 | 167 | for(int i = 0; i < NB_TEXT; ++i) { 168 | glfonsTransform(fs, textIds[i], 100.0 + i * 10.0, 100.0 + i * 50.0, 0.0, 1.0); 169 | } 170 | 171 | // upload rasterized data of currently bound buffer to gpu 172 | glfonsUpdateBuffer(fs); 173 | } 174 | 175 | - (void)deleteFontContext 176 | { 177 | glfonsDelete(fs); 178 | } 179 | 180 | @end 181 | -------------------------------------------------------------------------------- /examples/ios/FontstashiOS/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // FontstashiOS 4 | // 5 | // Created by Karim Naaji on 07/10/2014. 6 | // Copyright (c) 2014 Karim Naaji. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/ios/FontstashiOS/resources/DejaVuSerif.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangrams/fontstash-es/d027b921e03910193105c68691a42ae44ca7bd0a/examples/ios/FontstashiOS/resources/DejaVuSerif.ttf -------------------------------------------------------------------------------- /examples/ios/FontstashiOS/resources/Sanskrit2003.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangrams/fontstash-es/d027b921e03910193105c68691a42ae44ca7bd0a/examples/ios/FontstashiOS/resources/Sanskrit2003.ttf -------------------------------------------------------------------------------- /examples/ios/FontstashiOS/resources/amiri-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangrams/fontstash-es/d027b921e03910193105c68691a42ae44ca7bd0a/examples/ios/FontstashiOS/resources/amiri-regular.ttf -------------------------------------------------------------------------------- /examples/ios/FontstashiOS/resources/fireflysung.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangrams/fontstash-es/d027b921e03910193105c68691a42ae44ca7bd0a/examples/ios/FontstashiOS/resources/fireflysung.ttf -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/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 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/ftbbox.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftbbox.h */ 4 | /* */ 5 | /* FreeType exact bbox computation (specification). */ 6 | /* */ 7 | /* Copyright 1996-2001, 2003, 2007 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | /*************************************************************************/ 20 | /* */ 21 | /* This component has a _single_ role: to compute exact outline bounding */ 22 | /* boxes. */ 23 | /* */ 24 | /* It is separated from the rest of the engine for various technical */ 25 | /* reasons. It may well be integrated in `ftoutln' later. */ 26 | /* */ 27 | /*************************************************************************/ 28 | 29 | 30 | #ifndef __FTBBOX_H__ 31 | #define __FTBBOX_H__ 32 | 33 | 34 | #include 35 | #include FT_FREETYPE_H 36 | 37 | #ifdef FREETYPE_H 38 | #error "freetype.h of FreeType 1 has been loaded!" 39 | #error "Please fix the directory search order for header files" 40 | #error "so that freetype.h of FreeType 2 is found first." 41 | #endif 42 | 43 | 44 | FT_BEGIN_HEADER 45 | 46 | 47 | /*************************************************************************/ 48 | /* */ 49 | /*
*/ 50 | /* outline_processing */ 51 | /* */ 52 | /*************************************************************************/ 53 | 54 | 55 | /*************************************************************************/ 56 | /* */ 57 | /* */ 58 | /* FT_Outline_Get_BBox */ 59 | /* */ 60 | /* */ 61 | /* Compute the exact bounding box of an outline. This is slower */ 62 | /* than computing the control box. However, it uses an advanced */ 63 | /* algorithm which returns _very_ quickly when the two boxes */ 64 | /* coincide. Otherwise, the outline Bézier arcs are traversed to */ 65 | /* extract their extrema. */ 66 | /* */ 67 | /* */ 68 | /* outline :: A pointer to the source outline. */ 69 | /* */ 70 | /* */ 71 | /* abbox :: The outline's exact bounding box. */ 72 | /* */ 73 | /* */ 74 | /* FreeType error code. 0~means success. */ 75 | /* */ 76 | FT_EXPORT( FT_Error ) 77 | FT_Outline_Get_BBox( FT_Outline* outline, 78 | FT_BBox *abbox ); 79 | 80 | 81 | /* */ 82 | 83 | 84 | FT_END_HEADER 85 | 86 | #endif /* __FTBBOX_H__ */ 87 | 88 | 89 | /* END */ 90 | 91 | 92 | /* Local Variables: */ 93 | /* coding: utf-8 */ 94 | /* End: */ 95 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/ftbdf.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftbdf.h */ 4 | /* */ 5 | /* FreeType API for accessing BDF-specific strings (specification). */ 6 | /* */ 7 | /* Copyright 2002, 2003, 2004, 2006, 2009 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __FTBDF_H__ 20 | #define __FTBDF_H__ 21 | 22 | #include 23 | #include FT_FREETYPE_H 24 | 25 | #ifdef FREETYPE_H 26 | #error "freetype.h of FreeType 1 has been loaded!" 27 | #error "Please fix the directory search order for header files" 28 | #error "so that freetype.h of FreeType 2 is found first." 29 | #endif 30 | 31 | 32 | FT_BEGIN_HEADER 33 | 34 | 35 | /*************************************************************************/ 36 | /* */ 37 | /*
*/ 38 | /* bdf_fonts */ 39 | /* */ 40 | /* */ 41 | /* BDF and PCF Files */ 42 | /* */ 43 | /* <Abstract> */ 44 | /* BDF and PCF specific API. */ 45 | /* */ 46 | /* <Description> */ 47 | /* This section contains the declaration of functions specific to BDF */ 48 | /* and PCF fonts. */ 49 | /* */ 50 | /*************************************************************************/ 51 | 52 | 53 | /********************************************************************** 54 | * 55 | * @enum: 56 | * FT_PropertyType 57 | * 58 | * @description: 59 | * A list of BDF property types. 60 | * 61 | * @values: 62 | * BDF_PROPERTY_TYPE_NONE :: 63 | * Value~0 is used to indicate a missing property. 64 | * 65 | * BDF_PROPERTY_TYPE_ATOM :: 66 | * Property is a string atom. 67 | * 68 | * BDF_PROPERTY_TYPE_INTEGER :: 69 | * Property is a 32-bit signed integer. 70 | * 71 | * BDF_PROPERTY_TYPE_CARDINAL :: 72 | * Property is a 32-bit unsigned integer. 73 | */ 74 | typedef enum BDF_PropertyType_ 75 | { 76 | BDF_PROPERTY_TYPE_NONE = 0, 77 | BDF_PROPERTY_TYPE_ATOM = 1, 78 | BDF_PROPERTY_TYPE_INTEGER = 2, 79 | BDF_PROPERTY_TYPE_CARDINAL = 3 80 | 81 | } BDF_PropertyType; 82 | 83 | 84 | /********************************************************************** 85 | * 86 | * @type: 87 | * BDF_Property 88 | * 89 | * @description: 90 | * A handle to a @BDF_PropertyRec structure to model a given 91 | * BDF/PCF property. 92 | */ 93 | typedef struct BDF_PropertyRec_* BDF_Property; 94 | 95 | 96 | /********************************************************************** 97 | * 98 | * @struct: 99 | * BDF_PropertyRec 100 | * 101 | * @description: 102 | * This structure models a given BDF/PCF property. 103 | * 104 | * @fields: 105 | * type :: 106 | * The property type. 107 | * 108 | * u.atom :: 109 | * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. 110 | * 111 | * u.integer :: 112 | * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER. 113 | * 114 | * u.cardinal :: 115 | * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL. 116 | */ 117 | typedef struct BDF_PropertyRec_ 118 | { 119 | BDF_PropertyType type; 120 | union { 121 | const char* atom; 122 | FT_Int32 integer; 123 | FT_UInt32 cardinal; 124 | 125 | } u; 126 | 127 | } BDF_PropertyRec; 128 | 129 | 130 | /********************************************************************** 131 | * 132 | * @function: 133 | * FT_Get_BDF_Charset_ID 134 | * 135 | * @description: 136 | * Retrieve a BDF font character set identity, according to 137 | * the BDF specification. 138 | * 139 | * @input: 140 | * face :: 141 | * A handle to the input face. 142 | * 143 | * @output: 144 | * acharset_encoding :: 145 | * Charset encoding, as a C~string, owned by the face. 146 | * 147 | * acharset_registry :: 148 | * Charset registry, as a C~string, owned by the face. 149 | * 150 | * @return: 151 | * FreeType error code. 0~means success. 152 | * 153 | * @note: 154 | * This function only works with BDF faces, returning an error otherwise. 155 | */ 156 | FT_EXPORT( FT_Error ) 157 | FT_Get_BDF_Charset_ID( FT_Face face, 158 | const char* *acharset_encoding, 159 | const char* *acharset_registry ); 160 | 161 | 162 | /********************************************************************** 163 | * 164 | * @function: 165 | * FT_Get_BDF_Property 166 | * 167 | * @description: 168 | * Retrieve a BDF property from a BDF or PCF font file. 169 | * 170 | * @input: 171 | * face :: A handle to the input face. 172 | * 173 | * name :: The property name. 174 | * 175 | * @output: 176 | * aproperty :: The property. 177 | * 178 | * @return: 179 | * FreeType error code. 0~means success. 180 | * 181 | * @note: 182 | * This function works with BDF _and_ PCF fonts. It returns an error 183 | * otherwise. It also returns an error if the property is not in the 184 | * font. 185 | * 186 | * A `property' is a either key-value pair within the STARTPROPERTIES 187 | * ... ENDPROPERTIES block of a BDF font or a key-value pair from the 188 | * `info->props' array within a `FontRec' structure of a PCF font. 189 | * 190 | * Integer properties are always stored as `signed' within PCF fonts; 191 | * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value 192 | * for BDF fonts only. 193 | * 194 | * In case of error, `aproperty->type' is always set to 195 | * @BDF_PROPERTY_TYPE_NONE. 196 | */ 197 | FT_EXPORT( FT_Error ) 198 | FT_Get_BDF_Property( FT_Face face, 199 | const char* prop_name, 200 | BDF_PropertyRec *aproperty ); 201 | 202 | /* */ 203 | 204 | FT_END_HEADER 205 | 206 | #endif /* __FTBDF_H__ */ 207 | 208 | 209 | /* END */ 210 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/ftchapters.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* This file defines the structure of the FreeType reference. */ 4 | /* It is used by the python script which generates the HTML files. */ 5 | /* */ 6 | /***************************************************************************/ 7 | 8 | 9 | /***************************************************************************/ 10 | /* */ 11 | /* <Chapter> */ 12 | /* general_remarks */ 13 | /* */ 14 | /* <Title> */ 15 | /* General Remarks */ 16 | /* */ 17 | /* <Sections> */ 18 | /* user_allocation */ 19 | /* */ 20 | /***************************************************************************/ 21 | 22 | 23 | /***************************************************************************/ 24 | /* */ 25 | /* <Chapter> */ 26 | /* core_api */ 27 | /* */ 28 | /* <Title> */ 29 | /* Core API */ 30 | /* */ 31 | /* <Sections> */ 32 | /* version */ 33 | /* basic_types */ 34 | /* base_interface */ 35 | /* glyph_variants */ 36 | /* glyph_management */ 37 | /* mac_specific */ 38 | /* sizes_management */ 39 | /* header_file_macros */ 40 | /* */ 41 | /***************************************************************************/ 42 | 43 | 44 | /***************************************************************************/ 45 | /* */ 46 | /* <Chapter> */ 47 | /* format_specific */ 48 | /* */ 49 | /* <Title> */ 50 | /* Format-Specific API */ 51 | /* */ 52 | /* <Sections> */ 53 | /* multiple_masters */ 54 | /* truetype_tables */ 55 | /* type1_tables */ 56 | /* sfnt_names */ 57 | /* bdf_fonts */ 58 | /* cid_fonts */ 59 | /* pfr_fonts */ 60 | /* winfnt_fonts */ 61 | /* font_formats */ 62 | /* gasp_table */ 63 | /* */ 64 | /***************************************************************************/ 65 | 66 | 67 | /***************************************************************************/ 68 | /* */ 69 | /* <Chapter> */ 70 | /* cache_subsystem */ 71 | /* */ 72 | /* <Title> */ 73 | /* Cache Sub-System */ 74 | /* */ 75 | /* <Sections> */ 76 | /* cache_subsystem */ 77 | /* */ 78 | /***************************************************************************/ 79 | 80 | 81 | /***************************************************************************/ 82 | /* */ 83 | /* <Chapter> */ 84 | /* support_api */ 85 | /* */ 86 | /* <Title> */ 87 | /* Support API */ 88 | /* */ 89 | /* <Sections> */ 90 | /* computations */ 91 | /* list_processing */ 92 | /* outline_processing */ 93 | /* quick_advance */ 94 | /* bitmap_handling */ 95 | /* raster */ 96 | /* glyph_stroker */ 97 | /* system_interface */ 98 | /* module_management */ 99 | /* gzip */ 100 | /* lzw */ 101 | /* lcd_filtering */ 102 | /* */ 103 | /***************************************************************************/ 104 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/ftcid.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftcid.h */ 4 | /* */ 5 | /* FreeType API for accessing CID font information (specification). */ 6 | /* */ 7 | /* Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal. */ 8 | /* */ 9 | /* This file is part of the FreeType project, and may only be used, */ 10 | /* modified, and distributed under the terms of the FreeType project */ 11 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 12 | /* this file you indicate that you have read the license and */ 13 | /* understand and accept it fully. */ 14 | /* */ 15 | /***************************************************************************/ 16 | 17 | 18 | #ifndef __FTCID_H__ 19 | #define __FTCID_H__ 20 | 21 | #include <ft2build.h> 22 | #include FT_FREETYPE_H 23 | 24 | #ifdef FREETYPE_H 25 | #error "freetype.h of FreeType 1 has been loaded!" 26 | #error "Please fix the directory search order for header files" 27 | #error "so that freetype.h of FreeType 2 is found first." 28 | #endif 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | 34 | /*************************************************************************/ 35 | /* */ 36 | /* <Section> */ 37 | /* cid_fonts */ 38 | /* */ 39 | /* <Title> */ 40 | /* CID Fonts */ 41 | /* */ 42 | /* <Abstract> */ 43 | /* CID-keyed font specific API. */ 44 | /* */ 45 | /* <Description> */ 46 | /* This section contains the declaration of CID-keyed font specific */ 47 | /* functions. */ 48 | /* */ 49 | /*************************************************************************/ 50 | 51 | 52 | /********************************************************************** 53 | * 54 | * @function: 55 | * FT_Get_CID_Registry_Ordering_Supplement 56 | * 57 | * @description: 58 | * Retrieve the Registry/Ordering/Supplement triple (also known as the 59 | * "R/O/S") from a CID-keyed font. 60 | * 61 | * @input: 62 | * face :: 63 | * A handle to the input face. 64 | * 65 | * @output: 66 | * registry :: 67 | * The registry, as a C~string, owned by the face. 68 | * 69 | * ordering :: 70 | * The ordering, as a C~string, owned by the face. 71 | * 72 | * supplement :: 73 | * The supplement. 74 | * 75 | * @return: 76 | * FreeType error code. 0~means success. 77 | * 78 | * @note: 79 | * This function only works with CID faces, returning an error 80 | * otherwise. 81 | * 82 | * @since: 83 | * 2.3.6 84 | */ 85 | FT_EXPORT( FT_Error ) 86 | FT_Get_CID_Registry_Ordering_Supplement( FT_Face face, 87 | const char* *registry, 88 | const char* *ordering, 89 | FT_Int *supplement); 90 | 91 | 92 | /********************************************************************** 93 | * 94 | * @function: 95 | * FT_Get_CID_Is_Internally_CID_Keyed 96 | * 97 | * @description: 98 | * Retrieve the type of the input face, CID keyed or not. In 99 | * constrast to the @FT_IS_CID_KEYED macro this function returns 100 | * successfully also for CID-keyed fonts in an SNFT wrapper. 101 | * 102 | * @input: 103 | * face :: 104 | * A handle to the input face. 105 | * 106 | * @output: 107 | * is_cid :: 108 | * The type of the face as an @FT_Bool. 109 | * 110 | * @return: 111 | * FreeType error code. 0~means success. 112 | * 113 | * @note: 114 | * This function only works with CID faces and OpenType fonts, 115 | * returning an error otherwise. 116 | * 117 | * @since: 118 | * 2.3.9 119 | */ 120 | FT_EXPORT( FT_Error ) 121 | FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face, 122 | FT_Bool *is_cid ); 123 | 124 | 125 | /********************************************************************** 126 | * 127 | * @function: 128 | * FT_Get_CID_From_Glyph_Index 129 | * 130 | * @description: 131 | * Retrieve the CID of the input glyph index. 132 | * 133 | * @input: 134 | * face :: 135 | * A handle to the input face. 136 | * 137 | * glyph_index :: 138 | * The input glyph index. 139 | * 140 | * @output: 141 | * cid :: 142 | * The CID as an @FT_UInt. 143 | * 144 | * @return: 145 | * FreeType error code. 0~means success. 146 | * 147 | * @note: 148 | * This function only works with CID faces and OpenType fonts, 149 | * returning an error otherwise. 150 | * 151 | * @since: 152 | * 2.3.9 153 | */ 154 | FT_EXPORT( FT_Error ) 155 | FT_Get_CID_From_Glyph_Index( FT_Face face, 156 | FT_UInt glyph_index, 157 | FT_UInt *cid ); 158 | 159 | /* */ 160 | 161 | FT_END_HEADER 162 | 163 | #endif /* __FTCID_H__ */ 164 | 165 | 166 | /* END */ 167 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/ftgasp.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftgasp.h */ 4 | /* */ 5 | /* Access of TrueType's `gasp' table (specification). */ 6 | /* */ 7 | /* Copyright 2007, 2008 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 _FT_GASP_H_ 20 | #define _FT_GASP_H_ 21 | 22 | #include <ft2build.h> 23 | #include FT_FREETYPE_H 24 | 25 | #ifdef FREETYPE_H 26 | #error "freetype.h of FreeType 1 has been loaded!" 27 | #error "Please fix the directory search order for header files" 28 | #error "so that freetype.h of FreeType 2 is found first." 29 | #endif 30 | 31 | 32 | /*************************************************************************** 33 | * 34 | * @section: 35 | * gasp_table 36 | * 37 | * @title: 38 | * Gasp Table 39 | * 40 | * @abstract: 41 | * Retrieving TrueType `gasp' table entries. 42 | * 43 | * @description: 44 | * The function @FT_Get_Gasp can be used to query a TrueType or OpenType 45 | * font for specific entries in its `gasp' table, if any. This is 46 | * mainly useful when implementing native TrueType hinting with the 47 | * bytecode interpreter to duplicate the Windows text rendering results. 48 | */ 49 | 50 | /************************************************************************* 51 | * 52 | * @enum: 53 | * FT_GASP_XXX 54 | * 55 | * @description: 56 | * A list of values and/or bit-flags returned by the @FT_Get_Gasp 57 | * function. 58 | * 59 | * @values: 60 | * FT_GASP_NO_TABLE :: 61 | * This special value means that there is no GASP table in this face. 62 | * It is up to the client to decide what to do. 63 | * 64 | * FT_GASP_DO_GRIDFIT :: 65 | * Grid-fitting and hinting should be performed at the specified ppem. 66 | * This *really* means TrueType bytecode interpretation. 67 | * 68 | * FT_GASP_DO_GRAY :: 69 | * Anti-aliased rendering should be performed at the specified ppem. 70 | * 71 | * FT_GASP_SYMMETRIC_SMOOTHING :: 72 | * Smoothing along multiple axes must be used with ClearType. 73 | * 74 | * FT_GASP_SYMMETRIC_GRIDFIT :: 75 | * Grid-fitting must be used with ClearType's symmetric smoothing. 76 | * 77 | * @note: 78 | * `ClearType' is Microsoft's implementation of LCD rendering, partly 79 | * protected by patents. 80 | * 81 | * @since: 82 | * 2.3.0 83 | */ 84 | #define FT_GASP_NO_TABLE -1 85 | #define FT_GASP_DO_GRIDFIT 0x01 86 | #define FT_GASP_DO_GRAY 0x02 87 | #define FT_GASP_SYMMETRIC_SMOOTHING 0x08 88 | #define FT_GASP_SYMMETRIC_GRIDFIT 0x10 89 | 90 | 91 | /************************************************************************* 92 | * 93 | * @func: 94 | * FT_Get_Gasp 95 | * 96 | * @description: 97 | * Read the `gasp' table from a TrueType or OpenType font file and 98 | * return the entry corresponding to a given character pixel size. 99 | * 100 | * @input: 101 | * face :: The source face handle. 102 | * ppem :: The vertical character pixel size. 103 | * 104 | * @return: 105 | * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no 106 | * `gasp' table in the face. 107 | * 108 | * @since: 109 | * 2.3.0 110 | */ 111 | FT_EXPORT( FT_Int ) 112 | FT_Get_Gasp( FT_Face face, 113 | FT_UInt ppem ); 114 | 115 | /* */ 116 | 117 | #endif /* _FT_GASP_H_ */ 118 | 119 | 120 | /* END */ 121 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/ftgzip.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftgzip.h */ 4 | /* */ 5 | /* Gzip-compressed stream support. */ 6 | /* */ 7 | /* Copyright 2002, 2003, 2004, 2006 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __FTGZIP_H__ 20 | #define __FTGZIP_H__ 21 | 22 | #include <ft2build.h> 23 | #include FT_FREETYPE_H 24 | 25 | #ifdef FREETYPE_H 26 | #error "freetype.h of FreeType 1 has been loaded!" 27 | #error "Please fix the directory search order for header files" 28 | #error "so that freetype.h of FreeType 2 is found first." 29 | #endif 30 | 31 | 32 | FT_BEGIN_HEADER 33 | 34 | /*************************************************************************/ 35 | /* */ 36 | /* <Section> */ 37 | /* gzip */ 38 | /* */ 39 | /* <Title> */ 40 | /* GZIP Streams */ 41 | /* */ 42 | /* <Abstract> */ 43 | /* Using gzip-compressed font files. */ 44 | /* */ 45 | /* <Description> */ 46 | /* This section contains the declaration of Gzip-specific functions. */ 47 | /* */ 48 | /*************************************************************************/ 49 | 50 | 51 | /************************************************************************ 52 | * 53 | * @function: 54 | * FT_Stream_OpenGzip 55 | * 56 | * @description: 57 | * Open a new stream to parse gzip-compressed font files. This is 58 | * mainly used to support the compressed `*.pcf.gz' fonts that come 59 | * with XFree86. 60 | * 61 | * @input: 62 | * stream :: 63 | * The target embedding stream. 64 | * 65 | * source :: 66 | * The source stream. 67 | * 68 | * @return: 69 | * FreeType error code. 0~means success. 70 | * 71 | * @note: 72 | * The source stream must be opened _before_ calling this function. 73 | * 74 | * Calling the internal function `FT_Stream_Close' on the new stream will 75 | * *not* call `FT_Stream_Close' on the source stream. None of the stream 76 | * objects will be released to the heap. 77 | * 78 | * The stream implementation is very basic and resets the decompression 79 | * process each time seeking backwards is needed within the stream. 80 | * 81 | * In certain builds of the library, gzip compression recognition is 82 | * automatically handled when calling @FT_New_Face or @FT_Open_Face. 83 | * This means that if no font driver is capable of handling the raw 84 | * compressed file, the library will try to open a gzipped stream from 85 | * it and re-open the face with it. 86 | * 87 | * This function may return `FT_Err_Unimplemented_Feature' if your build 88 | * of FreeType was not compiled with zlib support. 89 | */ 90 | FT_EXPORT( FT_Error ) 91 | FT_Stream_OpenGzip( FT_Stream stream, 92 | FT_Stream source ); 93 | 94 | /* */ 95 | 96 | 97 | FT_END_HEADER 98 | 99 | #endif /* __FTGZIP_H__ */ 100 | 101 | 102 | /* END */ 103 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/ftlzw.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftlzw.h */ 4 | /* */ 5 | /* LZW-compressed stream support. */ 6 | /* */ 7 | /* Copyright 2004, 2006 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __FTLZW_H__ 20 | #define __FTLZW_H__ 21 | 22 | #include <ft2build.h> 23 | #include FT_FREETYPE_H 24 | 25 | #ifdef FREETYPE_H 26 | #error "freetype.h of FreeType 1 has been loaded!" 27 | #error "Please fix the directory search order for header files" 28 | #error "so that freetype.h of FreeType 2 is found first." 29 | #endif 30 | 31 | 32 | FT_BEGIN_HEADER 33 | 34 | /*************************************************************************/ 35 | /* */ 36 | /* <Section> */ 37 | /* lzw */ 38 | /* */ 39 | /* <Title> */ 40 | /* LZW Streams */ 41 | /* */ 42 | /* <Abstract> */ 43 | /* Using LZW-compressed font files. */ 44 | /* */ 45 | /* <Description> */ 46 | /* This section contains the declaration of LZW-specific functions. */ 47 | /* */ 48 | /*************************************************************************/ 49 | 50 | /************************************************************************ 51 | * 52 | * @function: 53 | * FT_Stream_OpenLZW 54 | * 55 | * @description: 56 | * Open a new stream to parse LZW-compressed font files. This is 57 | * mainly used to support the compressed `*.pcf.Z' fonts that come 58 | * with XFree86. 59 | * 60 | * @input: 61 | * stream :: The target embedding stream. 62 | * 63 | * source :: The source stream. 64 | * 65 | * @return: 66 | * FreeType error code. 0~means success. 67 | * 68 | * @note: 69 | * The source stream must be opened _before_ calling this function. 70 | * 71 | * Calling the internal function `FT_Stream_Close' on the new stream will 72 | * *not* call `FT_Stream_Close' on the source stream. None of the stream 73 | * objects will be released to the heap. 74 | * 75 | * The stream implementation is very basic and resets the decompression 76 | * process each time seeking backwards is needed within the stream 77 | * 78 | * In certain builds of the library, LZW compression recognition is 79 | * automatically handled when calling @FT_New_Face or @FT_Open_Face. 80 | * This means that if no font driver is capable of handling the raw 81 | * compressed file, the library will try to open a LZW stream from it 82 | * and re-open the face with it. 83 | * 84 | * This function may return `FT_Err_Unimplemented_Feature' if your build 85 | * of FreeType was not compiled with LZW support. 86 | */ 87 | FT_EXPORT( FT_Error ) 88 | FT_Stream_OpenLZW( FT_Stream stream, 89 | FT_Stream source ); 90 | 91 | /* */ 92 | 93 | 94 | FT_END_HEADER 95 | 96 | #endif /* __FTLZW_H__ */ 97 | 98 | 99 | /* END */ 100 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/ftpfr.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftpfr.h */ 4 | /* */ 5 | /* FreeType API for accessing PFR-specific data (specification only). */ 6 | /* */ 7 | /* Copyright 2002, 2003, 2004, 2006, 2008, 2009 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __FTPFR_H__ 20 | #define __FTPFR_H__ 21 | 22 | #include <ft2build.h> 23 | #include FT_FREETYPE_H 24 | 25 | #ifdef FREETYPE_H 26 | #error "freetype.h of FreeType 1 has been loaded!" 27 | #error "Please fix the directory search order for header files" 28 | #error "so that freetype.h of FreeType 2 is found first." 29 | #endif 30 | 31 | 32 | FT_BEGIN_HEADER 33 | 34 | 35 | /*************************************************************************/ 36 | /* */ 37 | /* <Section> */ 38 | /* pfr_fonts */ 39 | /* */ 40 | /* <Title> */ 41 | /* PFR Fonts */ 42 | /* */ 43 | /* <Abstract> */ 44 | /* PFR/TrueDoc specific API. */ 45 | /* */ 46 | /* <Description> */ 47 | /* This section contains the declaration of PFR-specific functions. */ 48 | /* */ 49 | /*************************************************************************/ 50 | 51 | 52 | /********************************************************************** 53 | * 54 | * @function: 55 | * FT_Get_PFR_Metrics 56 | * 57 | * @description: 58 | * Return the outline and metrics resolutions of a given PFR face. 59 | * 60 | * @input: 61 | * face :: Handle to the input face. It can be a non-PFR face. 62 | * 63 | * @output: 64 | * aoutline_resolution :: 65 | * Outline resolution. This is equivalent to `face->units_per_EM' 66 | * for non-PFR fonts. Optional (parameter can be NULL). 67 | * 68 | * ametrics_resolution :: 69 | * Metrics resolution. This is equivalent to `outline_resolution' 70 | * for non-PFR fonts. Optional (parameter can be NULL). 71 | * 72 | * ametrics_x_scale :: 73 | * A 16.16 fixed-point number used to scale distance expressed 74 | * in metrics units to device sub-pixels. This is equivalent to 75 | * `face->size->x_scale', but for metrics only. Optional (parameter 76 | * can be NULL). 77 | * 78 | * ametrics_y_scale :: 79 | * Same as `ametrics_x_scale' but for the vertical direction. 80 | * optional (parameter can be NULL). 81 | * 82 | * @return: 83 | * FreeType error code. 0~means success. 84 | * 85 | * @note: 86 | * If the input face is not a PFR, this function will return an error. 87 | * However, in all cases, it will return valid values. 88 | */ 89 | FT_EXPORT( FT_Error ) 90 | FT_Get_PFR_Metrics( FT_Face face, 91 | FT_UInt *aoutline_resolution, 92 | FT_UInt *ametrics_resolution, 93 | FT_Fixed *ametrics_x_scale, 94 | FT_Fixed *ametrics_y_scale ); 95 | 96 | 97 | /********************************************************************** 98 | * 99 | * @function: 100 | * FT_Get_PFR_Kerning 101 | * 102 | * @description: 103 | * Return the kerning pair corresponding to two glyphs in a PFR face. 104 | * The distance is expressed in metrics units, unlike the result of 105 | * @FT_Get_Kerning. 106 | * 107 | * @input: 108 | * face :: A handle to the input face. 109 | * 110 | * left :: Index of the left glyph. 111 | * 112 | * right :: Index of the right glyph. 113 | * 114 | * @output: 115 | * avector :: A kerning vector. 116 | * 117 | * @return: 118 | * FreeType error code. 0~means success. 119 | * 120 | * @note: 121 | * This function always return distances in original PFR metrics 122 | * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED 123 | * mode, which always returns distances converted to outline units. 124 | * 125 | * You can use the value of the `x_scale' and `y_scale' parameters 126 | * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels. 127 | */ 128 | FT_EXPORT( FT_Error ) 129 | FT_Get_PFR_Kerning( FT_Face face, 130 | FT_UInt left, 131 | FT_UInt right, 132 | FT_Vector *avector ); 133 | 134 | 135 | /********************************************************************** 136 | * 137 | * @function: 138 | * FT_Get_PFR_Advance 139 | * 140 | * @description: 141 | * Return a given glyph advance, expressed in original metrics units, 142 | * from a PFR font. 143 | * 144 | * @input: 145 | * face :: A handle to the input face. 146 | * 147 | * gindex :: The glyph index. 148 | * 149 | * @output: 150 | * aadvance :: The glyph advance in metrics units. 151 | * 152 | * @return: 153 | * FreeType error code. 0~means success. 154 | * 155 | * @note: 156 | * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics 157 | * to convert the advance to device sub-pixels (i.e., 1/64th of pixels). 158 | */ 159 | FT_EXPORT( FT_Error ) 160 | FT_Get_PFR_Advance( FT_Face face, 161 | FT_UInt gindex, 162 | FT_Pos *aadvance ); 163 | 164 | /* */ 165 | 166 | 167 | FT_END_HEADER 168 | 169 | #endif /* __FTPFR_H__ */ 170 | 171 | 172 | /* END */ 173 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/ftsynth.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftsynth.h */ 4 | /* */ 5 | /* FreeType synthesizing code for emboldening and slanting */ 6 | /* (specification). */ 7 | /* */ 8 | /* Copyright 2000-2001, 2003, 2006, 2008 by */ 9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 10 | /* */ 11 | /* This file is part of the FreeType project, and may only be used, */ 12 | /* modified, and distributed under the terms of the FreeType project */ 13 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 14 | /* this file you indicate that you have read the license and */ 15 | /* understand and accept it fully. */ 16 | /* */ 17 | /***************************************************************************/ 18 | 19 | 20 | /*************************************************************************/ 21 | /*************************************************************************/ 22 | /*************************************************************************/ 23 | /*************************************************************************/ 24 | /*************************************************************************/ 25 | /********* *********/ 26 | /********* WARNING, THIS IS ALPHA CODE! THIS API *********/ 27 | /********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/ 28 | /********* FREETYPE DEVELOPMENT TEAM *********/ 29 | /********* *********/ 30 | /*************************************************************************/ 31 | /*************************************************************************/ 32 | /*************************************************************************/ 33 | /*************************************************************************/ 34 | /*************************************************************************/ 35 | 36 | 37 | /* Main reason for not lifting the functions in this module to a */ 38 | /* `standard' API is that the used parameters for emboldening and */ 39 | /* slanting are not configurable. Consider the functions as a */ 40 | /* code resource which should be copied into the application and */ 41 | /* adapted to the particular needs. */ 42 | 43 | 44 | #ifndef __FTSYNTH_H__ 45 | #define __FTSYNTH_H__ 46 | 47 | 48 | #include <ft2build.h> 49 | #include FT_FREETYPE_H 50 | 51 | #ifdef FREETYPE_H 52 | #error "freetype.h of FreeType 1 has been loaded!" 53 | #error "Please fix the directory search order for header files" 54 | #error "so that freetype.h of FreeType 2 is found first." 55 | #endif 56 | 57 | 58 | FT_BEGIN_HEADER 59 | 60 | /* Embolden a glyph by a `reasonable' value (which is highly a matter of */ 61 | /* taste). This function is actually a convenience function, providing */ 62 | /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */ 63 | /* */ 64 | /* For emboldened outlines the metrics are estimates only; if you need */ 65 | /* precise values you should call @FT_Outline_Get_CBox. */ 66 | FT_EXPORT( void ) 67 | FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); 68 | 69 | /* Slant an outline glyph to the right by about 12 degrees. */ 70 | FT_EXPORT( void ) 71 | FT_GlyphSlot_Oblique( FT_GlyphSlot slot ); 72 | 73 | /* */ 74 | 75 | FT_END_HEADER 76 | 77 | #endif /* __FTSYNTH_H__ */ 78 | 79 | 80 | /* END */ 81 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/ftxf86.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftxf86.h */ 4 | /* */ 5 | /* Support functions for X11. */ 6 | /* */ 7 | /* Copyright 2002, 2003, 2004, 2006, 2007 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 __FTXF86_H__ 20 | #define __FTXF86_H__ 21 | 22 | #include <ft2build.h> 23 | #include FT_FREETYPE_H 24 | 25 | #ifdef FREETYPE_H 26 | #error "freetype.h of FreeType 1 has been loaded!" 27 | #error "Please fix the directory search order for header files" 28 | #error "so that freetype.h of FreeType 2 is found first." 29 | #endif 30 | 31 | 32 | FT_BEGIN_HEADER 33 | 34 | 35 | /*************************************************************************/ 36 | /* */ 37 | /* <Section> */ 38 | /* font_formats */ 39 | /* */ 40 | /* <Title> */ 41 | /* Font Formats */ 42 | /* */ 43 | /* <Abstract> */ 44 | /* Getting the font format. */ 45 | /* */ 46 | /* <Description> */ 47 | /* The single function in this section can be used to get the font */ 48 | /* format. Note that this information is not needed normally; */ 49 | /* however, there are special cases (like in PDF devices) where it is */ 50 | /* important to differentiate, in spite of FreeType's uniform API. */ 51 | /* */ 52 | /* This function is in the X11/xf86 namespace for historical reasons */ 53 | /* and in no way depends on that windowing system. */ 54 | /* */ 55 | /*************************************************************************/ 56 | 57 | 58 | /*************************************************************************/ 59 | /* */ 60 | /* <Function> */ 61 | /* FT_Get_X11_Font_Format */ 62 | /* */ 63 | /* <Description> */ 64 | /* Return a string describing the format of a given face, using values */ 65 | /* which can be used as an X11 FONT_PROPERTY. Possible values are */ 66 | /* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */ 67 | /* `PFR', and `Windows~FNT'. */ 68 | /* */ 69 | /* <Input> */ 70 | /* face :: */ 71 | /* Input face handle. */ 72 | /* */ 73 | /* <Return> */ 74 | /* Font format string. NULL in case of error. */ 75 | /* */ 76 | FT_EXPORT( const char* ) 77 | FT_Get_X11_Font_Format( FT_Face face ); 78 | 79 | /* */ 80 | 81 | FT_END_HEADER 82 | 83 | #endif /* __FTXF86_H__ */ 84 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/ftgloadr.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftgloadr.h */ 4 | /* */ 5 | /* The FreeType glyph loader (specification). */ 6 | /* */ 7 | /* Copyright 2002, 2003, 2005, 2006 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __FTGLOADR_H__ 20 | #define __FTGLOADR_H__ 21 | 22 | 23 | #include <ft2build.h> 24 | #include FT_FREETYPE_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | /*************************************************************************/ 31 | /* */ 32 | /* <Struct> */ 33 | /* FT_GlyphLoader */ 34 | /* */ 35 | /* <Description> */ 36 | /* The glyph loader is an internal object used to load several glyphs */ 37 | /* together (for example, in the case of composites). */ 38 | /* */ 39 | /* <Note> */ 40 | /* The glyph loader implementation is not part of the high-level API, */ 41 | /* hence the forward structure declaration. */ 42 | /* */ 43 | typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ; 44 | 45 | 46 | #if 0 /* moved to freetype.h in version 2.2 */ 47 | #define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1 48 | #define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2 49 | #define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4 50 | #define FT_SUBGLYPH_FLAG_SCALE 8 51 | #define FT_SUBGLYPH_FLAG_XY_SCALE 0x40 52 | #define FT_SUBGLYPH_FLAG_2X2 0x80 53 | #define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200 54 | #endif 55 | 56 | 57 | typedef struct FT_SubGlyphRec_ 58 | { 59 | FT_Int index; 60 | FT_UShort flags; 61 | FT_Int arg1; 62 | FT_Int arg2; 63 | FT_Matrix transform; 64 | 65 | } FT_SubGlyphRec; 66 | 67 | 68 | typedef struct FT_GlyphLoadRec_ 69 | { 70 | FT_Outline outline; /* outline */ 71 | FT_Vector* extra_points; /* extra points table */ 72 | FT_Vector* extra_points2; /* second extra points table */ 73 | FT_UInt num_subglyphs; /* number of subglyphs */ 74 | FT_SubGlyph subglyphs; /* subglyphs */ 75 | 76 | } FT_GlyphLoadRec, *FT_GlyphLoad; 77 | 78 | 79 | typedef struct FT_GlyphLoaderRec_ 80 | { 81 | FT_Memory memory; 82 | FT_UInt max_points; 83 | FT_UInt max_contours; 84 | FT_UInt max_subglyphs; 85 | FT_Bool use_extra; 86 | 87 | FT_GlyphLoadRec base; 88 | FT_GlyphLoadRec current; 89 | 90 | void* other; /* for possible future extension? */ 91 | 92 | } FT_GlyphLoaderRec; 93 | 94 | 95 | /* create new empty glyph loader */ 96 | FT_BASE( FT_Error ) 97 | FT_GlyphLoader_New( FT_Memory memory, 98 | FT_GlyphLoader *aloader ); 99 | 100 | /* add an extra points table to a glyph loader */ 101 | FT_BASE( FT_Error ) 102 | FT_GlyphLoader_CreateExtra( FT_GlyphLoader loader ); 103 | 104 | /* destroy a glyph loader */ 105 | FT_BASE( void ) 106 | FT_GlyphLoader_Done( FT_GlyphLoader loader ); 107 | 108 | /* reset a glyph loader (frees everything int it) */ 109 | FT_BASE( void ) 110 | FT_GlyphLoader_Reset( FT_GlyphLoader loader ); 111 | 112 | /* rewind a glyph loader */ 113 | FT_BASE( void ) 114 | FT_GlyphLoader_Rewind( FT_GlyphLoader loader ); 115 | 116 | /* check that there is enough space to add `n_points' and `n_contours' */ 117 | /* to the glyph loader */ 118 | FT_BASE( FT_Error ) 119 | FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader, 120 | FT_UInt n_points, 121 | FT_UInt n_contours ); 122 | 123 | 124 | #define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \ 125 | ( (_count) == 0 || ((_loader)->base.outline.n_points + \ 126 | (_loader)->current.outline.n_points + \ 127 | (unsigned long)(_count)) <= (_loader)->max_points ) 128 | 129 | #define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \ 130 | ( (_count) == 0 || ((_loader)->base.outline.n_contours + \ 131 | (_loader)->current.outline.n_contours + \ 132 | (unsigned long)(_count)) <= (_loader)->max_contours ) 133 | 134 | #define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours ) \ 135 | ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \ 136 | FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \ 137 | ? 0 \ 138 | : FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) ) 139 | 140 | 141 | /* check that there is enough space to add `n_subs' sub-glyphs to */ 142 | /* a glyph loader */ 143 | FT_BASE( FT_Error ) 144 | FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader, 145 | FT_UInt n_subs ); 146 | 147 | /* prepare a glyph loader, i.e. empty the current glyph */ 148 | FT_BASE( void ) 149 | FT_GlyphLoader_Prepare( FT_GlyphLoader loader ); 150 | 151 | /* add the current glyph to the base glyph */ 152 | FT_BASE( void ) 153 | FT_GlyphLoader_Add( FT_GlyphLoader loader ); 154 | 155 | /* copy points from one glyph loader to another */ 156 | FT_BASE( FT_Error ) 157 | FT_GlyphLoader_CopyPoints( FT_GlyphLoader target, 158 | FT_GlyphLoader source ); 159 | 160 | /* */ 161 | 162 | 163 | FT_END_HEADER 164 | 165 | #endif /* __FTGLOADR_H__ */ 166 | 167 | 168 | /* END */ 169 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/ftpic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftpic.h */ 4 | /* */ 5 | /* The FreeType position independent code services (declaration). */ 6 | /* */ 7 | /* Copyright 2009 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 | /* pic containers for modules */ 39 | void* autofit; 40 | void* cff; 41 | void* pshinter; 42 | void* psnames; 43 | void* raster; 44 | void* sfnt; 45 | void* smooth; 46 | void* truetype; 47 | } FT_PIC_Container; 48 | 49 | /* Initialize the various function tables, structs, etc. stored in the container. */ 50 | FT_BASE( FT_Error ) 51 | ft_pic_container_init( FT_Library library ); 52 | 53 | 54 | /* Destroy the contents of the container. */ 55 | FT_BASE( void ) 56 | ft_pic_container_destroy( FT_Library library ); 57 | 58 | #endif /* FT_CONFIG_OPTION_PIC */ 59 | 60 | /* */ 61 | 62 | FT_END_HEADER 63 | 64 | #endif /* __FTPIC_H__ */ 65 | 66 | 67 | /* END */ 68 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/fttrace.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* fttrace.h */ 4 | /* */ 5 | /* Tracing handling (specification only). */ 6 | /* */ 7 | /* Copyright 2002, 2004, 2005, 2006, 2007 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | /* definitions of trace levels for FreeType 2 */ 20 | 21 | /* the first level must always be `trace_any' */ 22 | FT_TRACE_DEF( any ) 23 | 24 | /* base components */ 25 | FT_TRACE_DEF( calc ) /* calculations (ftcalc.c) */ 26 | FT_TRACE_DEF( memory ) /* memory manager (ftobjs.c) */ 27 | FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */ 28 | FT_TRACE_DEF( io ) /* i/o interface (ftsystem.c) */ 29 | FT_TRACE_DEF( list ) /* list management (ftlist.c) */ 30 | FT_TRACE_DEF( init ) /* initialization (ftinit.c) */ 31 | FT_TRACE_DEF( objs ) /* base objects (ftobjs.c) */ 32 | FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */ 33 | FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */ 34 | FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.c) */ 35 | 36 | FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */ 37 | FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */ 38 | FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */ 39 | FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */ 40 | FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */ 41 | 42 | /* Cache sub-system */ 43 | FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */ 44 | 45 | /* SFNT driver components */ 46 | FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */ 47 | FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */ 48 | FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */ 49 | FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */ 50 | FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */ 51 | FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */ 52 | FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */ 53 | FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */ 54 | FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */ 55 | 56 | /* TrueType driver components */ 57 | FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */ 58 | FT_TRACE_DEF( ttgload ) /* TT glyph loader (ttgload.c) */ 59 | FT_TRACE_DEF( ttinterp ) /* bytecode interpreter (ttinterp.c) */ 60 | FT_TRACE_DEF( ttobjs ) /* TT objects manager (ttobjs.c) */ 61 | FT_TRACE_DEF( ttpload ) /* TT data/program loader (ttpload.c) */ 62 | FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */ 63 | 64 | /* Type 1 driver components */ 65 | FT_TRACE_DEF( t1afm ) 66 | FT_TRACE_DEF( t1driver ) 67 | FT_TRACE_DEF( t1gload ) 68 | FT_TRACE_DEF( t1hint ) 69 | FT_TRACE_DEF( t1load ) 70 | FT_TRACE_DEF( t1objs ) 71 | FT_TRACE_DEF( t1parse ) 72 | 73 | /* PostScript helper module `psaux' */ 74 | FT_TRACE_DEF( t1decode ) 75 | FT_TRACE_DEF( psobjs ) 76 | 77 | /* PostScript hinting module `pshinter' */ 78 | FT_TRACE_DEF( pshrec ) 79 | FT_TRACE_DEF( pshalgo1 ) 80 | FT_TRACE_DEF( pshalgo2 ) 81 | 82 | /* Type 2 driver components */ 83 | FT_TRACE_DEF( cffdriver ) 84 | FT_TRACE_DEF( cffgload ) 85 | FT_TRACE_DEF( cffload ) 86 | FT_TRACE_DEF( cffobjs ) 87 | FT_TRACE_DEF( cffparse ) 88 | 89 | /* Type 42 driver component */ 90 | FT_TRACE_DEF( t42 ) 91 | 92 | /* CID driver components */ 93 | FT_TRACE_DEF( cidafm ) 94 | FT_TRACE_DEF( ciddriver ) 95 | FT_TRACE_DEF( cidgload ) 96 | FT_TRACE_DEF( cidload ) 97 | FT_TRACE_DEF( cidobjs ) 98 | FT_TRACE_DEF( cidparse ) 99 | 100 | /* Windows font component */ 101 | FT_TRACE_DEF( winfnt ) 102 | 103 | /* PCF font components */ 104 | FT_TRACE_DEF( pcfdriver ) 105 | FT_TRACE_DEF( pcfread ) 106 | 107 | /* BDF font components */ 108 | FT_TRACE_DEF( bdfdriver ) 109 | FT_TRACE_DEF( bdflib ) 110 | 111 | /* PFR font component */ 112 | FT_TRACE_DEF( pfr ) 113 | 114 | /* OpenType validation components */ 115 | FT_TRACE_DEF( otvmodule ) 116 | FT_TRACE_DEF( otvcommon ) 117 | FT_TRACE_DEF( otvbase ) 118 | FT_TRACE_DEF( otvgdef ) 119 | FT_TRACE_DEF( otvgpos ) 120 | FT_TRACE_DEF( otvgsub ) 121 | FT_TRACE_DEF( otvjstf ) 122 | FT_TRACE_DEF( otvmath ) 123 | 124 | /* TrueTypeGX/AAT validation components */ 125 | FT_TRACE_DEF( gxvmodule ) 126 | FT_TRACE_DEF( gxvcommon ) 127 | FT_TRACE_DEF( gxvfeat ) 128 | FT_TRACE_DEF( gxvmort ) 129 | FT_TRACE_DEF( gxvmorx ) 130 | FT_TRACE_DEF( gxvbsln ) 131 | FT_TRACE_DEF( gxvjust ) 132 | FT_TRACE_DEF( gxvkern ) 133 | FT_TRACE_DEF( gxvopbd ) 134 | FT_TRACE_DEF( gxvtrak ) 135 | FT_TRACE_DEF( gxvprop ) 136 | FT_TRACE_DEF( gxvlcar ) 137 | 138 | 139 | /* END */ 140 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/internal.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* internal.h */ 4 | /* */ 5 | /* Internal header files (specification only). */ 6 | /* */ 7 | /* Copyright 1996-2001, 2002, 2003, 2004 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 automatically included by `ft2build.h'. */ 22 | /* Do not include it manually! */ 23 | /* */ 24 | /*************************************************************************/ 25 | 26 | 27 | #define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h> 28 | #define FT_INTERNAL_PIC_H <freetype/internal/ftpic.h> 29 | #define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h> 30 | #define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h> 31 | #define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h> 32 | #define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h> 33 | #define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h> 34 | #define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h> 35 | #define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h> 36 | #define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h> 37 | #define FT_INTERNAL_SERVICE_H <freetype/internal/ftserv.h> 38 | #define FT_INTERNAL_RFORK_H <freetype/internal/ftrfork.h> 39 | #define FT_INTERNAL_VALIDATE_H <freetype/internal/ftvalid.h> 40 | 41 | #define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h> 42 | #define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h> 43 | 44 | #define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h> 45 | #define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h> 46 | #define FT_INTERNAL_POSTSCRIPT_GLOBALS_H <freetype/internal/psglobal.h> 47 | 48 | #define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h> 49 | 50 | 51 | /* END */ 52 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/pcftypes.h: -------------------------------------------------------------------------------- 1 | /* pcftypes.h 2 | 3 | FreeType font driver for pcf fonts 4 | 5 | Copyright (C) 2000, 2001, 2002 by 6 | Francesco Zappa Nardelli 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | */ 26 | 27 | 28 | #ifndef __PCFTYPES_H__ 29 | #define __PCFTYPES_H__ 30 | 31 | 32 | #include <ft2build.h> 33 | #include FT_FREETYPE_H 34 | 35 | 36 | FT_BEGIN_HEADER 37 | 38 | 39 | typedef struct PCF_Public_FaceRec_ 40 | { 41 | FT_FaceRec root; 42 | FT_StreamRec gzip_stream; 43 | FT_Stream gzip_source; 44 | 45 | char* charset_encoding; 46 | char* charset_registry; 47 | 48 | } PCF_Public_FaceRec, *PCF_Public_Face; 49 | 50 | 51 | FT_END_HEADER 52 | 53 | #endif /* __PCFTYPES_H__ */ 54 | 55 | 56 | /* END */ 57 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svbdf.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svbdf.h */ 4 | /* */ 5 | /* The FreeType BDF services (specification). */ 6 | /* */ 7 | /* Copyright 2003 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 | #ifndef FT_CONFIG_OPTION_PIC 49 | 50 | #define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \ 51 | static const FT_Service_BDFRec class_ = \ 52 | { \ 53 | get_charset_id_, get_property_ \ 54 | }; 55 | 56 | #else /* FT_CONFIG_OPTION_PIC */ 57 | 58 | #define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \ 59 | void \ 60 | FT_Init_Class_##class_( FT_Service_BDFRec* clazz ) \ 61 | { \ 62 | clazz->get_charset_id = get_charset_id_; \ 63 | clazz->get_property = get_property_; \ 64 | } 65 | 66 | #endif /* FT_CONFIG_OPTION_PIC */ 67 | 68 | /* */ 69 | 70 | 71 | FT_END_HEADER 72 | 73 | 74 | #endif /* __SVBDF_H__ */ 75 | 76 | 77 | /* END */ 78 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svcid.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svcid.h */ 4 | /* */ 5 | /* The FreeType CID font services (specification). */ 6 | /* */ 7 | /* Copyright 2007, 2009 by Derek Clegg, Michael Toftdal. */ 8 | /* */ 9 | /* This file is part of the FreeType project, and may only be used, */ 10 | /* modified, and distributed under the terms of the FreeType project */ 11 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 12 | /* this file you indicate that you have read the license and */ 13 | /* understand and accept it fully. */ 14 | /* */ 15 | /***************************************************************************/ 16 | 17 | 18 | #ifndef __SVCID_H__ 19 | #define __SVCID_H__ 20 | 21 | #include FT_INTERNAL_SERVICE_H 22 | 23 | 24 | FT_BEGIN_HEADER 25 | 26 | 27 | #define FT_SERVICE_ID_CID "CID" 28 | 29 | typedef FT_Error 30 | (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face face, 31 | const char* *registry, 32 | const char* *ordering, 33 | FT_Int *supplement ); 34 | typedef FT_Error 35 | (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face face, 36 | FT_Bool *is_cid ); 37 | typedef FT_Error 38 | (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face face, 39 | FT_UInt glyph_index, 40 | FT_UInt *cid ); 41 | 42 | FT_DEFINE_SERVICE( CID ) 43 | { 44 | FT_CID_GetRegistryOrderingSupplementFunc get_ros; 45 | FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid; 46 | FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index; 47 | }; 48 | 49 | #ifndef FT_CONFIG_OPTION_PIC 50 | 51 | #define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_, \ 52 | get_is_cid_, get_cid_from_glyph_index_ ) \ 53 | static const FT_Service_CIDRec class_ = \ 54 | { \ 55 | get_ros_, get_is_cid_, get_cid_from_glyph_index_ \ 56 | }; 57 | 58 | #else /* FT_CONFIG_OPTION_PIC */ 59 | 60 | #define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_, \ 61 | get_is_cid_, get_cid_from_glyph_index_ ) \ 62 | void \ 63 | FT_Init_Class_##class_( FT_Library library, \ 64 | FT_Service_CIDRec* clazz) \ 65 | { \ 66 | FT_UNUSED(library); \ 67 | clazz->get_ros = get_ros_; \ 68 | clazz->get_is_cid = get_is_cid_; \ 69 | clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_; \ 70 | } 71 | 72 | #endif /* FT_CONFIG_OPTION_PIC */ 73 | 74 | /* */ 75 | 76 | 77 | FT_END_HEADER 78 | 79 | 80 | #endif /* __SVCID_H__ */ 81 | 82 | 83 | /* END */ 84 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svgldict.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svgldict.h */ 4 | /* */ 5 | /* The FreeType glyph dictionary services (specification). */ 6 | /* */ 7 | /* Copyright 2003 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __SVGLDICT_H__ 20 | #define __SVGLDICT_H__ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | /* 29 | * A service used to retrieve glyph names, as well as to find the 30 | * index of a given glyph name in a font. 31 | * 32 | */ 33 | 34 | #define FT_SERVICE_ID_GLYPH_DICT "glyph-dict" 35 | 36 | 37 | typedef FT_Error 38 | (*FT_GlyphDict_GetNameFunc)( FT_Face face, 39 | FT_UInt glyph_index, 40 | FT_Pointer buffer, 41 | FT_UInt buffer_max ); 42 | 43 | typedef FT_UInt 44 | (*FT_GlyphDict_NameIndexFunc)( FT_Face face, 45 | FT_String* glyph_name ); 46 | 47 | 48 | FT_DEFINE_SERVICE( GlyphDict ) 49 | { 50 | FT_GlyphDict_GetNameFunc get_name; 51 | FT_GlyphDict_NameIndexFunc name_index; /* optional */ 52 | }; 53 | 54 | #ifndef FT_CONFIG_OPTION_PIC 55 | 56 | #define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \ 57 | static const FT_Service_GlyphDictRec class_ = \ 58 | { \ 59 | get_name_, name_index_ \ 60 | }; 61 | 62 | #else /* FT_CONFIG_OPTION_PIC */ 63 | 64 | #define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \ 65 | void \ 66 | FT_Init_Class_##class_( FT_Library library, \ 67 | FT_Service_GlyphDictRec* clazz) \ 68 | { \ 69 | FT_UNUSED(library); \ 70 | clazz->get_name = get_name_; \ 71 | clazz->name_index = name_index_; \ 72 | } 73 | 74 | #endif /* FT_CONFIG_OPTION_PIC */ 75 | 76 | /* */ 77 | 78 | 79 | FT_END_HEADER 80 | 81 | 82 | #endif /* __SVGLDICT_H__ */ 83 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svgxval.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svgxval.h */ 4 | /* */ 5 | /* FreeType API for validating TrueTypeGX/AAT tables (specification). */ 6 | /* */ 7 | /* Copyright 2004, 2005 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 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svkern.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svkern.h */ 4 | /* */ 5 | /* The FreeType Kerning service (specification). */ 6 | /* */ 7 | /* Copyright 2006 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 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svmm.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svmm.h */ 4 | /* */ 5 | /* The FreeType Multiple Masters and GX var services (specification). */ 6 | /* */ 7 | /* Copyright 2003, 2004 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 __SVMM_H__ 20 | #define __SVMM_H__ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | /* 29 | * A service used to manage multiple-masters data in a given face. 30 | * 31 | * See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H). 32 | * 33 | */ 34 | 35 | #define FT_SERVICE_ID_MULTI_MASTERS "multi-masters" 36 | 37 | 38 | typedef FT_Error 39 | (*FT_Get_MM_Func)( FT_Face face, 40 | FT_Multi_Master* master ); 41 | 42 | typedef FT_Error 43 | (*FT_Get_MM_Var_Func)( FT_Face face, 44 | FT_MM_Var* *master ); 45 | 46 | typedef FT_Error 47 | (*FT_Set_MM_Design_Func)( FT_Face face, 48 | FT_UInt num_coords, 49 | FT_Long* coords ); 50 | 51 | typedef FT_Error 52 | (*FT_Set_Var_Design_Func)( FT_Face face, 53 | FT_UInt num_coords, 54 | FT_Fixed* coords ); 55 | 56 | typedef FT_Error 57 | (*FT_Set_MM_Blend_Func)( FT_Face face, 58 | FT_UInt num_coords, 59 | FT_Long* coords ); 60 | 61 | 62 | FT_DEFINE_SERVICE( MultiMasters ) 63 | { 64 | FT_Get_MM_Func get_mm; 65 | FT_Set_MM_Design_Func set_mm_design; 66 | FT_Set_MM_Blend_Func set_mm_blend; 67 | FT_Get_MM_Var_Func get_mm_var; 68 | FT_Set_Var_Design_Func set_var_design; 69 | }; 70 | 71 | #ifndef FT_CONFIG_OPTION_PIC 72 | 73 | #define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_, \ 74 | set_mm_blend_, get_mm_var_, set_var_design_) \ 75 | static const FT_Service_MultiMastersRec class_ = \ 76 | { \ 77 | get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_ \ 78 | }; 79 | 80 | #else /* FT_CONFIG_OPTION_PIC */ 81 | 82 | #define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_, \ 83 | set_mm_blend_, get_mm_var_, set_var_design_) \ 84 | void \ 85 | FT_Init_Class_##class_( FT_Service_MultiMastersRec* clazz ) \ 86 | { \ 87 | clazz->get_mm = get_mm_; \ 88 | clazz->set_mm_design = set_mm_design_; \ 89 | clazz->set_mm_blend = set_mm_blend_; \ 90 | clazz->get_mm_var = get_mm_var_; \ 91 | clazz->set_var_design = set_var_design_; \ 92 | } 93 | 94 | #endif /* FT_CONFIG_OPTION_PIC */ 95 | 96 | /* */ 97 | 98 | 99 | FT_END_HEADER 100 | 101 | #endif /* __SVMM_H__ */ 102 | 103 | 104 | /* END */ 105 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svotval.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svotval.h */ 4 | /* */ 5 | /* The FreeType OpenType validation service (specification). */ 6 | /* */ 7 | /* Copyright 2004, 2006 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 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svpfr.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svpfr.h */ 4 | /* */ 5 | /* Internal PFR service functions (specification). */ 6 | /* */ 7 | /* Copyright 2003, 2006 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 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svpostnm.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svpostnm.h */ 4 | /* */ 5 | /* The FreeType PostScript name services (specification). */ 6 | /* */ 7 | /* Copyright 2003, 2007 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 | #ifndef FT_CONFIG_OPTION_PIC 50 | 51 | #define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \ 52 | static const FT_Service_PsFontNameRec class_ = \ 53 | { \ 54 | get_ps_font_name_ \ 55 | }; 56 | 57 | #else /* FT_CONFIG_OPTION_PIC */ 58 | 59 | #define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \ 60 | void \ 61 | FT_Init_Class_##class_( FT_Library library, \ 62 | FT_Service_PsFontNameRec* clazz) \ 63 | { \ 64 | FT_UNUSED(library); \ 65 | clazz->get_ps_font_name = get_ps_font_name_; \ 66 | } 67 | 68 | #endif /* FT_CONFIG_OPTION_PIC */ 69 | 70 | /* */ 71 | 72 | 73 | FT_END_HEADER 74 | 75 | 76 | #endif /* __SVPOSTNM_H__ */ 77 | 78 | 79 | /* END */ 80 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svpscmap.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svpscmap.h */ 4 | /* */ 5 | /* The FreeType PostScript charmap service (specification). */ 6 | /* */ 7 | /* Copyright 2003, 2006 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __SVPSCMAP_H__ 20 | #define __SVPSCMAP_H__ 21 | 22 | #include FT_INTERNAL_OBJECTS_H 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | #define FT_SERVICE_ID_POSTSCRIPT_CMAPS "postscript-cmaps" 29 | 30 | 31 | /* 32 | * Adobe glyph name to unicode value. 33 | */ 34 | typedef FT_UInt32 35 | (*PS_Unicode_ValueFunc)( const char* glyph_name ); 36 | 37 | /* 38 | * Macintosh name id to glyph name. NULL if invalid index. 39 | */ 40 | typedef const char* 41 | (*PS_Macintosh_NameFunc)( FT_UInt name_index ); 42 | 43 | /* 44 | * Adobe standard string ID to glyph name. NULL if invalid index. 45 | */ 46 | typedef const char* 47 | (*PS_Adobe_Std_StringsFunc)( FT_UInt string_index ); 48 | 49 | 50 | /* 51 | * Simple unicode -> glyph index charmap built from font glyph names 52 | * table. 53 | */ 54 | typedef struct PS_UniMap_ 55 | { 56 | FT_UInt32 unicode; /* bit 31 set: is glyph variant */ 57 | FT_UInt glyph_index; 58 | 59 | } PS_UniMap; 60 | 61 | 62 | typedef struct PS_UnicodesRec_* PS_Unicodes; 63 | 64 | typedef struct PS_UnicodesRec_ 65 | { 66 | FT_CMapRec cmap; 67 | FT_UInt num_maps; 68 | PS_UniMap* maps; 69 | 70 | } PS_UnicodesRec; 71 | 72 | 73 | /* 74 | * A function which returns a glyph name for a given index. Returns 75 | * NULL if invalid index. 76 | */ 77 | typedef const char* 78 | (*PS_GetGlyphNameFunc)( FT_Pointer data, 79 | FT_UInt string_index ); 80 | 81 | /* 82 | * A function used to release the glyph name returned by 83 | * PS_GetGlyphNameFunc, when needed 84 | */ 85 | typedef void 86 | (*PS_FreeGlyphNameFunc)( FT_Pointer data, 87 | const char* name ); 88 | 89 | typedef FT_Error 90 | (*PS_Unicodes_InitFunc)( FT_Memory memory, 91 | PS_Unicodes unicodes, 92 | FT_UInt num_glyphs, 93 | PS_GetGlyphNameFunc get_glyph_name, 94 | PS_FreeGlyphNameFunc free_glyph_name, 95 | FT_Pointer glyph_data ); 96 | 97 | typedef FT_UInt 98 | (*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes, 99 | FT_UInt32 unicode ); 100 | 101 | typedef FT_UInt32 102 | (*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes, 103 | FT_UInt32 *unicode ); 104 | 105 | 106 | FT_DEFINE_SERVICE( PsCMaps ) 107 | { 108 | PS_Unicode_ValueFunc unicode_value; 109 | 110 | PS_Unicodes_InitFunc unicodes_init; 111 | PS_Unicodes_CharIndexFunc unicodes_char_index; 112 | PS_Unicodes_CharNextFunc unicodes_char_next; 113 | 114 | PS_Macintosh_NameFunc macintosh_name; 115 | PS_Adobe_Std_StringsFunc adobe_std_strings; 116 | const unsigned short* adobe_std_encoding; 117 | const unsigned short* adobe_expert_encoding; 118 | }; 119 | 120 | 121 | #ifndef FT_CONFIG_OPTION_PIC 122 | 123 | #define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \ 124 | unicodes_char_index_, unicodes_char_next_, macintosh_name_, \ 125 | adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_) \ 126 | static const FT_Service_PsCMapsRec class_ = \ 127 | { \ 128 | unicode_value_, unicodes_init_, \ 129 | unicodes_char_index_, unicodes_char_next_, macintosh_name_, \ 130 | adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \ 131 | }; 132 | 133 | #else /* FT_CONFIG_OPTION_PIC */ 134 | 135 | #define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \ 136 | unicodes_char_index_, unicodes_char_next_, macintosh_name_, \ 137 | adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_) \ 138 | void \ 139 | FT_Init_Class_##class_( FT_Library library, \ 140 | FT_Service_PsCMapsRec* clazz) \ 141 | { \ 142 | FT_UNUSED(library); \ 143 | clazz->unicode_value = unicode_value_; \ 144 | clazz->unicodes_init = unicodes_init_; \ 145 | clazz->unicodes_char_index = unicodes_char_index_; \ 146 | clazz->unicodes_char_next = unicodes_char_next_; \ 147 | clazz->macintosh_name = macintosh_name_; \ 148 | clazz->adobe_std_strings = adobe_std_strings_; \ 149 | clazz->adobe_std_encoding = adobe_std_encoding_; \ 150 | clazz->adobe_expert_encoding = adobe_expert_encoding_; \ 151 | } 152 | 153 | #endif /* FT_CONFIG_OPTION_PIC */ 154 | 155 | /* */ 156 | 157 | 158 | FT_END_HEADER 159 | 160 | 161 | #endif /* __SVPSCMAP_H__ */ 162 | 163 | 164 | /* END */ 165 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svpsinfo.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svpsinfo.h */ 4 | /* */ 5 | /* The FreeType PostScript info service (specification). */ 6 | /* */ 7 | /* Copyright 2003, 2004, 2009 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __SVPSINFO_H__ 20 | #define __SVPSINFO_H__ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | #include FT_INTERNAL_TYPE1_TYPES_H 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | #define FT_SERVICE_ID_POSTSCRIPT_INFO "postscript-info" 30 | 31 | 32 | typedef FT_Error 33 | (*PS_GetFontInfoFunc)( FT_Face face, 34 | PS_FontInfoRec* afont_info ); 35 | 36 | typedef FT_Error 37 | (*PS_GetFontExtraFunc)( FT_Face face, 38 | PS_FontExtraRec* afont_extra ); 39 | 40 | typedef FT_Int 41 | (*PS_HasGlyphNamesFunc)( FT_Face face ); 42 | 43 | typedef FT_Error 44 | (*PS_GetFontPrivateFunc)( FT_Face face, 45 | PS_PrivateRec* afont_private ); 46 | 47 | 48 | FT_DEFINE_SERVICE( PsInfo ) 49 | { 50 | PS_GetFontInfoFunc ps_get_font_info; 51 | PS_GetFontExtraFunc ps_get_font_extra; 52 | PS_HasGlyphNamesFunc ps_has_glyph_names; 53 | PS_GetFontPrivateFunc ps_get_font_private; 54 | }; 55 | 56 | #ifndef FT_CONFIG_OPTION_PIC 57 | 58 | #define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_, \ 59 | ps_get_font_extra_, has_glyph_names_, get_font_private_) \ 60 | static const FT_Service_PsInfoRec class_ = \ 61 | { \ 62 | get_font_info_, ps_get_font_extra_, has_glyph_names_, \ 63 | get_font_private_ \ 64 | }; 65 | 66 | #else /* FT_CONFIG_OPTION_PIC */ 67 | 68 | #define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_, \ 69 | ps_get_font_extra_, has_glyph_names_, get_font_private_) \ 70 | void \ 71 | FT_Init_Class_##class_( FT_Library library, \ 72 | FT_Service_PsInfoRec* clazz) \ 73 | { \ 74 | FT_UNUSED(library); \ 75 | clazz->ps_get_font_info = get_font_info_; \ 76 | clazz->ps_get_font_extra = ps_get_font_extra_; \ 77 | clazz->ps_has_glyph_names = has_glyph_names_; \ 78 | clazz->ps_get_font_private = get_font_private_; \ 79 | } 80 | 81 | #endif /* FT_CONFIG_OPTION_PIC */ 82 | 83 | /* */ 84 | 85 | 86 | FT_END_HEADER 87 | 88 | 89 | #endif /* __SVPSINFO_H__ */ 90 | 91 | 92 | /* END */ 93 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svsfnt.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svsfnt.h */ 4 | /* */ 5 | /* The FreeType SFNT table loading service (specification). */ 6 | /* */ 7 | /* Copyright 2003, 2004 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __SVSFNT_H__ 20 | #define __SVSFNT_H__ 21 | 22 | #include FT_INTERNAL_SERVICE_H 23 | #include FT_TRUETYPE_TABLES_H 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | 29 | /* 30 | * SFNT table loading service. 31 | */ 32 | 33 | #define FT_SERVICE_ID_SFNT_TABLE "sfnt-table" 34 | 35 | 36 | /* 37 | * Used to implement FT_Load_Sfnt_Table(). 38 | */ 39 | typedef FT_Error 40 | (*FT_SFNT_TableLoadFunc)( FT_Face face, 41 | FT_ULong tag, 42 | FT_Long offset, 43 | FT_Byte* buffer, 44 | FT_ULong* length ); 45 | 46 | /* 47 | * Used to implement FT_Get_Sfnt_Table(). 48 | */ 49 | typedef void* 50 | (*FT_SFNT_TableGetFunc)( FT_Face face, 51 | FT_Sfnt_Tag tag ); 52 | 53 | 54 | /* 55 | * Used to implement FT_Sfnt_Table_Info(). 56 | */ 57 | typedef FT_Error 58 | (*FT_SFNT_TableInfoFunc)( FT_Face face, 59 | FT_UInt idx, 60 | FT_ULong *tag, 61 | FT_ULong *offset, 62 | FT_ULong *length ); 63 | 64 | 65 | FT_DEFINE_SERVICE( SFNT_Table ) 66 | { 67 | FT_SFNT_TableLoadFunc load_table; 68 | FT_SFNT_TableGetFunc get_table; 69 | FT_SFNT_TableInfoFunc table_info; 70 | }; 71 | 72 | #ifndef FT_CONFIG_OPTION_PIC 73 | 74 | #define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_) \ 75 | static const FT_Service_SFNT_TableRec class_ = \ 76 | { \ 77 | load_, get_, info_ \ 78 | }; 79 | 80 | #else /* FT_CONFIG_OPTION_PIC */ 81 | 82 | #define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_) \ 83 | void \ 84 | FT_Init_Class_##class_( FT_Service_SFNT_TableRec* clazz ) \ 85 | { \ 86 | clazz->load_table = load_; \ 87 | clazz->get_table = get_; \ 88 | clazz->table_info = info_; \ 89 | } 90 | 91 | #endif /* FT_CONFIG_OPTION_PIC */ 92 | 93 | /* */ 94 | 95 | 96 | FT_END_HEADER 97 | 98 | 99 | #endif /* __SVSFNT_H__ */ 100 | 101 | 102 | /* END */ 103 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svttcmap.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svttcmap.h */ 4 | /* */ 5 | /* The FreeType TrueType/sfnt cmap extra information service. */ 6 | /* */ 7 | /* Copyright 2003 by */ 8 | /* Masatake YAMATO, Redhat K.K. */ 9 | /* */ 10 | /* Copyright 2003, 2008 by */ 11 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 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 | /* Development of this service is support of 22 | Information-technology Promotion Agency, Japan. */ 23 | 24 | #ifndef __SVTTCMAP_H__ 25 | #define __SVTTCMAP_H__ 26 | 27 | #include FT_INTERNAL_SERVICE_H 28 | #include FT_TRUETYPE_TABLES_H 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | 34 | #define FT_SERVICE_ID_TT_CMAP "tt-cmaps" 35 | 36 | 37 | /*************************************************************************/ 38 | /* */ 39 | /* <Struct> */ 40 | /* TT_CMapInfo */ 41 | /* */ 42 | /* <Description> */ 43 | /* A structure used to store TrueType/sfnt specific cmap information */ 44 | /* which is not covered by the generic @FT_CharMap structure. This */ 45 | /* structure can be accessed with the @FT_Get_TT_CMap_Info function. */ 46 | /* */ 47 | /* <Fields> */ 48 | /* language :: */ 49 | /* The language ID used in Mac fonts. Definitions of values are in */ 50 | /* freetype/ttnameid.h. */ 51 | /* */ 52 | /* format :: */ 53 | /* The cmap format. OpenType 1.5 defines the formats 0 (byte */ 54 | /* encoding table), 2~(high-byte mapping through table), 4~(segment */ 55 | /* mapping to delta values), 6~(trimmed table mapping), 8~(mixed */ 56 | /* 16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented */ 57 | /* coverage), and 14 (Unicode Variation Sequences). */ 58 | /* */ 59 | typedef struct TT_CMapInfo_ 60 | { 61 | FT_ULong language; 62 | FT_Long format; 63 | 64 | } TT_CMapInfo; 65 | 66 | 67 | typedef FT_Error 68 | (*TT_CMap_Info_GetFunc)( FT_CharMap charmap, 69 | TT_CMapInfo *cmap_info ); 70 | 71 | 72 | FT_DEFINE_SERVICE( TTCMaps ) 73 | { 74 | TT_CMap_Info_GetFunc get_cmap_info; 75 | }; 76 | 77 | #ifndef FT_CONFIG_OPTION_PIC 78 | 79 | #define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_) \ 80 | static const FT_Service_TTCMapsRec class_ = \ 81 | { \ 82 | get_cmap_info_ \ 83 | }; 84 | 85 | #else /* FT_CONFIG_OPTION_PIC */ 86 | 87 | #define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_) \ 88 | void \ 89 | FT_Init_Class_##class_( FT_Library library, \ 90 | FT_Service_TTCMapsRec* clazz) \ 91 | { \ 92 | FT_UNUSED(library); \ 93 | clazz->get_cmap_info = get_cmap_info_; \ 94 | } 95 | 96 | #endif /* FT_CONFIG_OPTION_PIC */ 97 | 98 | /* */ 99 | 100 | 101 | FT_END_HEADER 102 | 103 | #endif /* __SVTTCMAP_H__ */ 104 | 105 | 106 | /* END */ 107 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svtteng.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svtteng.h */ 4 | /* */ 5 | /* The FreeType TrueType engine query service (specification). */ 6 | /* */ 7 | /* Copyright 2006 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 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svttglyf.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svttglyf.h */ 4 | /* */ 5 | /* The FreeType TrueType glyph service. */ 6 | /* */ 7 | /* Copyright 2007 by David Turner. */ 8 | /* */ 9 | /* This file is part of the FreeType project, and may only be used, */ 10 | /* modified, and distributed under the terms of the FreeType project */ 11 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 12 | /* this file you indicate that you have read the license and */ 13 | /* understand and accept it fully. */ 14 | /* */ 15 | /***************************************************************************/ 16 | 17 | #ifndef __SVTTGLYF_H__ 18 | #define __SVTTGLYF_H__ 19 | 20 | #include FT_INTERNAL_SERVICE_H 21 | #include FT_TRUETYPE_TABLES_H 22 | 23 | 24 | FT_BEGIN_HEADER 25 | 26 | 27 | #define FT_SERVICE_ID_TT_GLYF "tt-glyf" 28 | 29 | 30 | typedef FT_ULong 31 | (*TT_Glyf_GetLocationFunc)( FT_Face face, 32 | FT_UInt gindex, 33 | FT_ULong *psize ); 34 | 35 | FT_DEFINE_SERVICE( TTGlyf ) 36 | { 37 | TT_Glyf_GetLocationFunc get_location; 38 | }; 39 | 40 | #ifndef FT_CONFIG_OPTION_PIC 41 | 42 | #define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ ) \ 43 | static const FT_Service_TTGlyfRec class_ = \ 44 | { \ 45 | get_location_ \ 46 | }; 47 | 48 | #else /* FT_CONFIG_OPTION_PIC */ 49 | 50 | #define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ ) \ 51 | void \ 52 | FT_Init_Class_##class_( FT_Service_TTGlyfRec* clazz ) \ 53 | { \ 54 | clazz->get_location = get_location_; \ 55 | } 56 | 57 | #endif /* FT_CONFIG_OPTION_PIC */ 58 | 59 | /* */ 60 | 61 | 62 | FT_END_HEADER 63 | 64 | #endif /* __SVTTGLYF_H__ */ 65 | 66 | 67 | /* END */ 68 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svwinfnt.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svwinfnt.h */ 4 | /* */ 5 | /* The FreeType Windows FNT/FONT service (specification). */ 6 | /* */ 7 | /* Copyright 2003 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 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/internal/services/svxf86nm.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svxf86nm.h */ 4 | /* */ 5 | /* The FreeType XFree86 services (specification only). */ 6 | /* */ 7 | /* Copyright 2003 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 __SVXF86NM_H__ 20 | #define __SVXF86NM_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_XF86_NAME "xf86-driver-name" 35 | 36 | #define FT_XF86_FORMAT_TRUETYPE "TrueType" 37 | #define FT_XF86_FORMAT_TYPE_1 "Type 1" 38 | #define FT_XF86_FORMAT_BDF "BDF" 39 | #define FT_XF86_FORMAT_PCF "PCF" 40 | #define FT_XF86_FORMAT_TYPE_42 "Type 42" 41 | #define FT_XF86_FORMAT_CID "CID Type 1" 42 | #define FT_XF86_FORMAT_CFF "CFF" 43 | #define FT_XF86_FORMAT_PFR "PFR" 44 | #define FT_XF86_FORMAT_WINFNT "Windows FNT" 45 | 46 | /* */ 47 | 48 | 49 | FT_END_HEADER 50 | 51 | 52 | #endif /* __SVXF86NM_H__ */ 53 | 54 | 55 | /* END */ 56 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/tttags.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* tttags.h */ 4 | /* */ 5 | /* Tags for TrueType and OpenType tables (specification only). */ 6 | /* */ 7 | /* Copyright 1996-2001, 2004, 2005, 2007, 2008 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __TTAGS_H__ 20 | #define __TTAGS_H__ 21 | 22 | 23 | #include <ft2build.h> 24 | #include FT_FREETYPE_H 25 | 26 | #ifdef FREETYPE_H 27 | #error "freetype.h of FreeType 1 has been loaded!" 28 | #error "Please fix the directory search order for header files" 29 | #error "so that freetype.h of FreeType 2 is found first." 30 | #endif 31 | 32 | 33 | FT_BEGIN_HEADER 34 | 35 | 36 | #define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' ) 37 | #define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' ) 38 | #define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' ) 39 | #define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' ) 40 | #define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' ) 41 | #define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' ) 42 | #define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' ) 43 | #define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' ) 44 | #define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' ) 45 | #define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' ) 46 | #define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' ) 47 | #define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' ) 48 | #define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' ) 49 | #define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' ) 50 | #define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' ) 51 | #define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' ) 52 | #define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' ) 53 | #define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' ) 54 | #define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' ) 55 | #define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' ) 56 | #define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' ) 57 | #define TTAG_GDEF FT_MAKE_TAG( 'G', 'D', 'E', 'F' ) 58 | #define TTAG_glyf FT_MAKE_TAG( 'g', 'l', 'y', 'f' ) 59 | #define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' ) 60 | #define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' ) 61 | #define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' ) 62 | #define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' ) 63 | #define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' ) 64 | #define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' ) 65 | #define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' ) 66 | #define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' ) 67 | #define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' ) 68 | #define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' ) 69 | #define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' ) 70 | #define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' ) 71 | #define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' ) 72 | #define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' ) 73 | #define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' ) 74 | #define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' ) 75 | #define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' ) 76 | #define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' ) 77 | #define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' ) 78 | #define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' ) 79 | #define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' ) 80 | #define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' ) 81 | #define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' ) 82 | #define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' ) 83 | #define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) 84 | #define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' ) 85 | #define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' ) 86 | #define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' ) 87 | #define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' ) 88 | #define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' ) 89 | #define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' ) 90 | #define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' ) 91 | #define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' ) 92 | #define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' ) 93 | #define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' ) 94 | #define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' ) 95 | #define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' ) 96 | #define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' ) 97 | #define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' ) 98 | #define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' ) 99 | #define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' ) 100 | 101 | 102 | FT_END_HEADER 103 | 104 | #endif /* __TTAGS_H__ */ 105 | 106 | 107 | /* END */ 108 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/freetype/ttunpat.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttunpat.h */ 4 | /* */ 5 | /* Definitions for the unpatented TrueType hinting system */ 6 | /* */ 7 | /* Copyright 2003, 2006 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* Written by Graham Asher <graham.asher@btinternet.com> */ 11 | /* */ 12 | /* This file is part of the FreeType project, and may only be used, */ 13 | /* modified, and distributed under the terms of the FreeType project */ 14 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 15 | /* this file you indicate that you have read the license and */ 16 | /* understand and accept it fully. */ 17 | /* */ 18 | /***************************************************************************/ 19 | 20 | 21 | #ifndef __TTUNPAT_H__ 22 | #define __TTUNPAT_H__ 23 | 24 | 25 | #include <ft2build.h> 26 | #include FT_FREETYPE_H 27 | 28 | #ifdef FREETYPE_H 29 | #error "freetype.h of FreeType 1 has been loaded!" 30 | #error "Please fix the directory search order for header files" 31 | #error "so that freetype.h of FreeType 2 is found first." 32 | #endif 33 | 34 | 35 | FT_BEGIN_HEADER 36 | 37 | 38 | /*************************************************************************** 39 | * 40 | * @constant: 41 | * FT_PARAM_TAG_UNPATENTED_HINTING 42 | * 43 | * @description: 44 | * A constant used as the tag of an @FT_Parameter structure to indicate 45 | * that unpatented methods only should be used by the TrueType bytecode 46 | * interpreter for a typeface opened by @FT_Open_Face. 47 | * 48 | */ 49 | #define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' ) 50 | 51 | /* */ 52 | 53 | FT_END_HEADER 54 | 55 | 56 | #endif /* __TTUNPAT_H__ */ 57 | 58 | 59 | /* END */ 60 | -------------------------------------------------------------------------------- /fontstash/lib/include/freetype2/ft2build.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ft2build.h */ 4 | /* */ 5 | /* FreeType 2 build and setup macros. */ 6 | /* (Generic version) */ 7 | /* */ 8 | /* Copyright 1996-2001, 2006 by */ 9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 10 | /* */ 11 | /* This file is part of the FreeType project, and may only be used, */ 12 | /* modified, and distributed under the terms of the FreeType project */ 13 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 14 | /* this file you indicate that you have read the license and */ 15 | /* understand and accept it fully. */ 16 | /* */ 17 | /***************************************************************************/ 18 | 19 | 20 | /*************************************************************************/ 21 | /* */ 22 | /* This file corresponds to the default `ft2build.h' file for */ 23 | /* FreeType 2. It uses the `freetype' include root. */ 24 | /* */ 25 | /* Note that specific platforms might use a different configuration. */ 26 | /* See builds/unix/ft2unix.h for an example. */ 27 | /* */ 28 | /*************************************************************************/ 29 | 30 | 31 | #ifndef __FT2_BUILD_GENERIC_H__ 32 | #define __FT2_BUILD_GENERIC_H__ 33 | 34 | #include <freetype/config/ftheader.h> 35 | 36 | #endif /* __FT2_BUILD_GENERIC_H__ */ 37 | 38 | 39 | /* END */ 40 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-blob.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2009 Red Hat, Inc. 3 | * 4 | * This is part of HarfBuzz, a text shaping library. 5 | * 6 | * Permission is hereby granted, without written agreement and without 7 | * license or royalty fees, to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose, provided that the 9 | * above copyright notice and the following two paragraphs appear in 10 | * all copies of this software. 11 | * 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 | * DAMAGE. 17 | * 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 | * 24 | * Red Hat Author(s): Behdad Esfahbod 25 | */ 26 | 27 | #ifndef HB_H_IN 28 | #error "Include <hb.h> instead." 29 | #endif 30 | 31 | #ifndef HB_BLOB_H 32 | #define HB_BLOB_H 33 | 34 | #include "hb-common.h" 35 | 36 | HB_BEGIN_DECLS 37 | 38 | 39 | /* 40 | * Note re various memory-modes: 41 | * 42 | * - In no case shall the HarfBuzz client modify memory 43 | * that is passed to HarfBuzz in a blob. If there is 44 | * any such possibility, MODE_DUPLICATE should be used 45 | * such that HarfBuzz makes a copy immediately, 46 | * 47 | * - Use MODE_READONLY otherse, unless you really really 48 | * really know what you are doing, 49 | * 50 | * - MODE_WRITABLE is appropriate if you really made a 51 | * copy of data solely for the purpose of passing to 52 | * HarfBuzz and doing that just once (no reuse!), 53 | * 54 | * - If the font is mmap()ed, it's ok to use 55 | * READONLY_MAY_MAKE_WRITABLE, however, using that mode 56 | * correctly is very tricky. Use MODE_READONLY instead. 57 | */ 58 | typedef enum { 59 | HB_MEMORY_MODE_DUPLICATE, 60 | HB_MEMORY_MODE_READONLY, 61 | HB_MEMORY_MODE_WRITABLE, 62 | HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE 63 | } hb_memory_mode_t; 64 | 65 | typedef struct hb_blob_t hb_blob_t; 66 | 67 | hb_blob_t * 68 | hb_blob_create (const char *data, 69 | unsigned int length, 70 | hb_memory_mode_t mode, 71 | void *user_data, 72 | hb_destroy_func_t destroy); 73 | 74 | /* Always creates with MEMORY_MODE_READONLY. 75 | * Even if the parent blob is writable, we don't 76 | * want the user of the sub-blob to be able to 77 | * modify the parent data as that data may be 78 | * shared among multiple sub-blobs. 79 | */ 80 | hb_blob_t * 81 | hb_blob_create_sub_blob (hb_blob_t *parent, 82 | unsigned int offset, 83 | unsigned int length); 84 | 85 | hb_blob_t * 86 | hb_blob_get_empty (void); 87 | 88 | hb_blob_t * 89 | hb_blob_reference (hb_blob_t *blob); 90 | 91 | void 92 | hb_blob_destroy (hb_blob_t *blob); 93 | 94 | hb_bool_t 95 | hb_blob_set_user_data (hb_blob_t *blob, 96 | hb_user_data_key_t *key, 97 | void * data, 98 | hb_destroy_func_t destroy, 99 | hb_bool_t replace); 100 | 101 | 102 | void * 103 | hb_blob_get_user_data (hb_blob_t *blob, 104 | hb_user_data_key_t *key); 105 | 106 | 107 | void 108 | hb_blob_make_immutable (hb_blob_t *blob); 109 | 110 | hb_bool_t 111 | hb_blob_is_immutable (hb_blob_t *blob); 112 | 113 | 114 | unsigned int 115 | hb_blob_get_length (hb_blob_t *blob); 116 | 117 | const char * 118 | hb_blob_get_data (hb_blob_t *blob, unsigned int *length); 119 | 120 | char * 121 | hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length); 122 | 123 | 124 | HB_END_DECLS 125 | 126 | #endif /* HB_BLOB_H */ 127 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-deprecated.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Google, Inc. 3 | * 4 | * This is part of HarfBuzz, a text shaping library. 5 | * 6 | * Permission is hereby granted, without written agreement and without 7 | * license or royalty fees, to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose, provided that the 9 | * above copyright notice and the following two paragraphs appear in 10 | * all copies of this software. 11 | * 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 | * DAMAGE. 17 | * 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 | * 24 | * Google Author(s): Behdad Esfahbod 25 | */ 26 | 27 | #ifndef HB_H_IN 28 | #error "Include <hb.h> instead." 29 | #endif 30 | 31 | #ifndef HB_DEPRECATED_H 32 | #define HB_DEPRECATED_H 33 | 34 | #include "hb-common.h" 35 | #include "hb-unicode.h" 36 | #include "hb-font.h" 37 | 38 | HB_BEGIN_DECLS 39 | 40 | #ifndef HB_DISABLE_DEPRECATED 41 | 42 | #define HB_SCRIPT_CANADIAN_ABORIGINAL HB_SCRIPT_CANADIAN_SYLLABICS 43 | 44 | #define HB_BUFFER_FLAGS_DEFAULT HB_BUFFER_FLAG_DEFAULT 45 | #define HB_BUFFER_SERIALIZE_FLAGS_DEFAULT HB_BUFFER_SERIALIZE_FLAG_DEFAULT 46 | 47 | #endif 48 | 49 | HB_END_DECLS 50 | 51 | #endif /* HB_DEPRECATED_H */ 52 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-face.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2009 Red Hat, Inc. 3 | * 4 | * This is part of HarfBuzz, a text shaping library. 5 | * 6 | * Permission is hereby granted, without written agreement and without 7 | * license or royalty fees, to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose, provided that the 9 | * above copyright notice and the following two paragraphs appear in 10 | * all copies of this software. 11 | * 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 | * DAMAGE. 17 | * 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 | * 24 | * Red Hat Author(s): Behdad Esfahbod 25 | */ 26 | 27 | #ifndef HB_H_IN 28 | #error "Include <hb.h> instead." 29 | #endif 30 | 31 | #ifndef HB_FACE_H 32 | #define HB_FACE_H 33 | 34 | #include "hb-common.h" 35 | #include "hb-blob.h" 36 | 37 | HB_BEGIN_DECLS 38 | 39 | 40 | /* 41 | * hb_face_t 42 | */ 43 | 44 | typedef struct hb_face_t hb_face_t; 45 | 46 | hb_face_t * 47 | hb_face_create (hb_blob_t *blob, 48 | unsigned int index); 49 | 50 | typedef hb_blob_t * (*hb_reference_table_func_t) (hb_face_t *face, hb_tag_t tag, void *user_data); 51 | 52 | /* calls destroy() when not needing user_data anymore */ 53 | hb_face_t * 54 | hb_face_create_for_tables (hb_reference_table_func_t reference_table_func, 55 | void *user_data, 56 | hb_destroy_func_t destroy); 57 | 58 | hb_face_t * 59 | hb_face_get_empty (void); 60 | 61 | hb_face_t * 62 | hb_face_reference (hb_face_t *face); 63 | 64 | void 65 | hb_face_destroy (hb_face_t *face); 66 | 67 | hb_bool_t 68 | hb_face_set_user_data (hb_face_t *face, 69 | hb_user_data_key_t *key, 70 | void * data, 71 | hb_destroy_func_t destroy, 72 | hb_bool_t replace); 73 | 74 | 75 | void * 76 | hb_face_get_user_data (hb_face_t *face, 77 | hb_user_data_key_t *key); 78 | 79 | void 80 | hb_face_make_immutable (hb_face_t *face); 81 | 82 | hb_bool_t 83 | hb_face_is_immutable (hb_face_t *face); 84 | 85 | 86 | hb_blob_t * 87 | hb_face_reference_table (hb_face_t *face, 88 | hb_tag_t tag); 89 | 90 | hb_blob_t * 91 | hb_face_reference_blob (hb_face_t *face); 92 | 93 | void 94 | hb_face_set_index (hb_face_t *face, 95 | unsigned int index); 96 | 97 | unsigned int 98 | hb_face_get_index (hb_face_t *face); 99 | 100 | void 101 | hb_face_set_upem (hb_face_t *face, 102 | unsigned int upem); 103 | 104 | unsigned int 105 | hb_face_get_upem (hb_face_t *face); 106 | 107 | void 108 | hb_face_set_glyph_count (hb_face_t *face, 109 | unsigned int glyph_count); 110 | 111 | unsigned int 112 | hb_face_get_glyph_count (hb_face_t *face); 113 | 114 | 115 | HB_END_DECLS 116 | 117 | #endif /* HB_FACE_H */ 118 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-ft.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2009 Red Hat, Inc. 3 | * 4 | * This is part of HarfBuzz, a text shaping library. 5 | * 6 | * Permission is hereby granted, without written agreement and without 7 | * license or royalty fees, to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose, provided that the 9 | * above copyright notice and the following two paragraphs appear in 10 | * all copies of this software. 11 | * 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 | * DAMAGE. 17 | * 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 | * 24 | * Red Hat Author(s): Behdad Esfahbod 25 | */ 26 | 27 | #ifndef HB_FT_H 28 | #define HB_FT_H 29 | 30 | #include "hb.h" 31 | 32 | #include <ft2build.h> 33 | #include FT_FREETYPE_H 34 | 35 | HB_BEGIN_DECLS 36 | 37 | /* Note: FreeType is not thread-safe. Hence, these functions are not either. */ 38 | 39 | hb_face_t * 40 | hb_ft_face_create (FT_Face ft_face, 41 | hb_destroy_func_t destroy); 42 | 43 | hb_face_t * 44 | hb_ft_face_create_cached (FT_Face ft_face); 45 | 46 | hb_font_t * 47 | hb_ft_font_create (FT_Face ft_face, 48 | hb_destroy_func_t destroy); 49 | 50 | 51 | 52 | /* Makes an hb_font_t use FreeType internally to implement font functions. */ 53 | void 54 | hb_ft_font_set_funcs (hb_font_t *font); 55 | 56 | FT_Face 57 | hb_ft_font_get_face (hb_font_t *font); 58 | 59 | 60 | HB_END_DECLS 61 | 62 | #endif /* HB_FT_H */ 63 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-glib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2009 Red Hat, Inc. 3 | * Copyright © 2011 Google, Inc. 4 | * 5 | * This is part of HarfBuzz, a text shaping library. 6 | * 7 | * Permission is hereby granted, without written agreement and without 8 | * license or royalty fees, to use, copy, modify, and distribute this 9 | * software and its documentation for any purpose, provided that the 10 | * above copyright notice and the following two paragraphs appear in 11 | * all copies of this software. 12 | * 13 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 14 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 15 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 16 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 17 | * DAMAGE. 18 | * 19 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 20 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 21 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 22 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 23 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 24 | * 25 | * Red Hat Author(s): Behdad Esfahbod 26 | * Google Author(s): Behdad Esfahbod 27 | */ 28 | 29 | #ifndef HB_GLIB_H 30 | #define HB_GLIB_H 31 | 32 | #include "hb.h" 33 | 34 | #include <glib.h> 35 | 36 | HB_BEGIN_DECLS 37 | 38 | 39 | hb_script_t 40 | hb_glib_script_to_script (GUnicodeScript script); 41 | 42 | GUnicodeScript 43 | hb_glib_script_from_script (hb_script_t script); 44 | 45 | 46 | hb_unicode_funcs_t * 47 | hb_glib_get_unicode_funcs (void); 48 | 49 | 50 | HB_END_DECLS 51 | 52 | #endif /* HB_GLIB_H */ 53 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-gobject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2011 Google, Inc. 3 | * 4 | * This is part of HarfBuzz, a text shaping library. 5 | * 6 | * Permission is hereby granted, without written agreement and without 7 | * license or royalty fees, to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose, provided that the 9 | * above copyright notice and the following two paragraphs appear in 10 | * all copies of this software. 11 | * 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 | * DAMAGE. 17 | * 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 | * 24 | * Google Author(s): Behdad Esfahbod 25 | */ 26 | 27 | #ifndef HB_GOBJECT_H 28 | #define HB_GOBJECT_H 29 | 30 | #include "hb.h" 31 | 32 | #include <glib-object.h> 33 | 34 | HB_BEGIN_DECLS 35 | 36 | 37 | /* Objects */ 38 | 39 | #define HB_GOBJECT_TYPE_BLOB hb_gobject_blob_get_type () 40 | GType 41 | hb_gobject_blob_get_type (void); 42 | 43 | #define HB_GOBJECT_TYPE_BUFFER hb_gobject_buffer_get_type () 44 | GType 45 | hb_gobject_buffer_get_type (void); 46 | 47 | #define HB_GOBJECT_TYPE_FACE hb_gobject_face_get_type () 48 | GType 49 | hb_gobject_face_get_type (void); 50 | 51 | #define HB_GOBJECT_TYPE_FONT hb_gobject_font_get_type () 52 | GType 53 | hb_gobject_font_get_type (void); 54 | 55 | #define HB_GOBJECT_TYPE_FONT_FUNCS hb_gobject_font_funcs_get_type () 56 | GType 57 | hb_gobject_font_funcs_get_type (void); 58 | 59 | #define HB_GOBJECT_TYPE_UNICODE_FUNCS hb_gobject_unicode_funcs_get_type () 60 | GType 61 | hb_gobject_unicode_funcs_get_type (void); 62 | 63 | 64 | /* Enums */ 65 | 66 | 67 | HB_END_DECLS 68 | 69 | #endif /* HB_GOBJECT_H */ 70 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-icu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2009 Red Hat, Inc. 3 | * Copyright © 2011 Google, Inc. 4 | * 5 | * This is part of HarfBuzz, a text shaping library. 6 | * 7 | * Permission is hereby granted, without written agreement and without 8 | * license or royalty fees, to use, copy, modify, and distribute this 9 | * software and its documentation for any purpose, provided that the 10 | * above copyright notice and the following two paragraphs appear in 11 | * all copies of this software. 12 | * 13 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 14 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 15 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 16 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 17 | * DAMAGE. 18 | * 19 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 20 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 21 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 22 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 23 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 24 | * 25 | * Red Hat Author(s): Behdad Esfahbod 26 | * Google Author(s): Behdad Esfahbod 27 | */ 28 | 29 | #ifndef HB_ICU_H 30 | #define HB_ICU_H 31 | 32 | #include "hb.h" 33 | 34 | #include <unicode/uscript.h> 35 | 36 | HB_BEGIN_DECLS 37 | 38 | 39 | hb_script_t 40 | hb_icu_script_to_script (UScriptCode script); 41 | 42 | UScriptCode 43 | hb_icu_script_from_script (hb_script_t script); 44 | 45 | 46 | hb_unicode_funcs_t * 47 | hb_icu_get_unicode_funcs (void); 48 | 49 | 50 | HB_END_DECLS 51 | 52 | #endif /* HB_ICU_H */ 53 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-ot-font.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2014 Google, Inc. 3 | * 4 | * This is part of HarfBuzz, a text shaping library. 5 | * 6 | * Permission is hereby granted, without written agreement and without 7 | * license or royalty fees, to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose, provided that the 9 | * above copyright notice and the following two paragraphs appear in 10 | * all copies of this software. 11 | * 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 | * DAMAGE. 17 | * 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 | * 24 | * Google Author(s): Behdad Esfahbod, Roozbeh Pournader 25 | */ 26 | 27 | #ifndef HB_OT_FONT_H 28 | #define HB_OT_FONT_H 29 | 30 | #include "hb.h" 31 | 32 | HB_BEGIN_DECLS 33 | 34 | 35 | void 36 | hb_ot_font_set_funcs (hb_font_t *font); 37 | 38 | 39 | HB_END_DECLS 40 | 41 | #endif /* HB_OT_FONT_H */ 42 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-ot-shape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Red Hat, Inc. 3 | * 4 | * This is part of HarfBuzz, a text shaping library. 5 | * 6 | * Permission is hereby granted, without written agreement and without 7 | * license or royalty fees, to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose, provided that the 9 | * above copyright notice and the following two paragraphs appear in 10 | * all copies of this software. 11 | * 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 | * DAMAGE. 17 | * 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 | * 24 | * Red Hat Author(s): Behdad Esfahbod 25 | */ 26 | 27 | #ifndef HB_OT_H_IN 28 | #error "Include <hb-ot.h> instead." 29 | #endif 30 | 31 | #ifndef HB_OT_SHAPE_H 32 | #define HB_OT_SHAPE_H 33 | 34 | #include "hb.h" 35 | 36 | HB_BEGIN_DECLS 37 | 38 | /* TODO port to shape-plan / set. */ 39 | void 40 | hb_ot_shape_glyphs_closure (hb_font_t *font, 41 | hb_buffer_t *buffer, 42 | const hb_feature_t *features, 43 | unsigned int num_features, 44 | hb_set_t *glyphs); 45 | 46 | void 47 | hb_ot_shape_plan_collect_lookups (hb_shape_plan_t *shape_plan, 48 | hb_tag_t table_tag, 49 | hb_set_t *lookup_indexes /* OUT */); 50 | 51 | HB_END_DECLS 52 | 53 | #endif /* HB_OT_SHAPE_H */ 54 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-ot-tag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2009 Red Hat, Inc. 3 | * 4 | * This is part of HarfBuzz, a text shaping library. 5 | * 6 | * Permission is hereby granted, without written agreement and without 7 | * license or royalty fees, to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose, provided that the 9 | * above copyright notice and the following two paragraphs appear in 10 | * all copies of this software. 11 | * 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 | * DAMAGE. 17 | * 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 | * 24 | * Red Hat Author(s): Behdad Esfahbod 25 | */ 26 | 27 | #ifndef HB_OT_H_IN 28 | #error "Include <hb-ot.h> instead." 29 | #endif 30 | 31 | #ifndef HB_OT_TAG_H 32 | #define HB_OT_TAG_H 33 | 34 | #include "hb.h" 35 | 36 | HB_BEGIN_DECLS 37 | 38 | 39 | #define HB_OT_TAG_DEFAULT_SCRIPT HB_TAG ('D', 'F', 'L', 'T') 40 | #define HB_OT_TAG_DEFAULT_LANGUAGE HB_TAG ('d', 'f', 'l', 't') 41 | 42 | void 43 | hb_ot_tags_from_script (hb_script_t script, 44 | hb_tag_t *script_tag_1, 45 | hb_tag_t *script_tag_2); 46 | 47 | hb_script_t 48 | hb_ot_tag_to_script (hb_tag_t tag); 49 | 50 | hb_tag_t 51 | hb_ot_tag_from_language (hb_language_t language); 52 | 53 | hb_language_t 54 | hb_ot_tag_to_language (hb_tag_t tag); 55 | 56 | 57 | HB_END_DECLS 58 | 59 | #endif /* HB_OT_TAG_H */ 60 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-ot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2009 Red Hat, Inc. 3 | * 4 | * This is part of HarfBuzz, a text shaping library. 5 | * 6 | * Permission is hereby granted, without written agreement and without 7 | * license or royalty fees, to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose, provided that the 9 | * above copyright notice and the following two paragraphs appear in 10 | * all copies of this software. 11 | * 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 | * DAMAGE. 17 | * 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 | * 24 | * Red Hat Author(s): Behdad Esfahbod 25 | */ 26 | 27 | #ifndef HB_OT_H 28 | #define HB_OT_H 29 | #define HB_OT_H_IN 30 | 31 | #include "hb.h" 32 | 33 | #include "hb-ot-font.h" 34 | #include "hb-ot-layout.h" 35 | #include "hb-ot-tag.h" 36 | #include "hb-ot-shape.h" 37 | 38 | HB_BEGIN_DECLS 39 | 40 | HB_END_DECLS 41 | 42 | #undef HB_OT_H_IN 43 | #endif /* HB_OT_H */ 44 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-set.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2012 Google, Inc. 3 | * 4 | * This is part of HarfBuzz, a text shaping library. 5 | * 6 | * Permission is hereby granted, without written agreement and without 7 | * license or royalty fees, to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose, provided that the 9 | * above copyright notice and the following two paragraphs appear in 10 | * all copies of this software. 11 | * 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 | * DAMAGE. 17 | * 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 | * 24 | * Google Author(s): Behdad Esfahbod 25 | */ 26 | 27 | #ifndef HB_H_IN 28 | #error "Include <hb.h> instead." 29 | #endif 30 | 31 | #ifndef HB_SET_H 32 | #define HB_SET_H 33 | 34 | #include "hb-common.h" 35 | 36 | HB_BEGIN_DECLS 37 | 38 | 39 | #define HB_SET_VALUE_INVALID ((hb_codepoint_t) -1) 40 | 41 | typedef struct hb_set_t hb_set_t; 42 | 43 | 44 | hb_set_t * 45 | hb_set_create (void); 46 | 47 | hb_set_t * 48 | hb_set_get_empty (void); 49 | 50 | hb_set_t * 51 | hb_set_reference (hb_set_t *set); 52 | 53 | void 54 | hb_set_destroy (hb_set_t *set); 55 | 56 | hb_bool_t 57 | hb_set_set_user_data (hb_set_t *set, 58 | hb_user_data_key_t *key, 59 | void * data, 60 | hb_destroy_func_t destroy, 61 | hb_bool_t replace); 62 | 63 | void * 64 | hb_set_get_user_data (hb_set_t *set, 65 | hb_user_data_key_t *key); 66 | 67 | 68 | /* Returns false if allocation has failed before */ 69 | hb_bool_t 70 | hb_set_allocation_successful (const hb_set_t *set); 71 | 72 | void 73 | hb_set_clear (hb_set_t *set); 74 | 75 | hb_bool_t 76 | hb_set_is_empty (const hb_set_t *set); 77 | 78 | hb_bool_t 79 | hb_set_has (const hb_set_t *set, 80 | hb_codepoint_t codepoint); 81 | 82 | /* Right now limited to 16-bit integers. Eventually will do full codepoint range, sans -1 83 | * which we will use as a sentinel. */ 84 | void 85 | hb_set_add (hb_set_t *set, 86 | hb_codepoint_t codepoint); 87 | 88 | void 89 | hb_set_add_range (hb_set_t *set, 90 | hb_codepoint_t first, 91 | hb_codepoint_t last); 92 | 93 | void 94 | hb_set_del (hb_set_t *set, 95 | hb_codepoint_t codepoint); 96 | 97 | void 98 | hb_set_del_range (hb_set_t *set, 99 | hb_codepoint_t first, 100 | hb_codepoint_t last); 101 | 102 | hb_bool_t 103 | hb_set_is_equal (const hb_set_t *set, 104 | const hb_set_t *other); 105 | 106 | void 107 | hb_set_set (hb_set_t *set, 108 | const hb_set_t *other); 109 | 110 | void 111 | hb_set_union (hb_set_t *set, 112 | const hb_set_t *other); 113 | 114 | void 115 | hb_set_intersect (hb_set_t *set, 116 | const hb_set_t *other); 117 | 118 | void 119 | hb_set_subtract (hb_set_t *set, 120 | const hb_set_t *other); 121 | 122 | void 123 | hb_set_symmetric_difference (hb_set_t *set, 124 | const hb_set_t *other); 125 | 126 | void 127 | hb_set_invert (hb_set_t *set); 128 | 129 | unsigned int 130 | hb_set_get_population (const hb_set_t *set); 131 | 132 | /* Returns -1 if set empty. */ 133 | hb_codepoint_t 134 | hb_set_get_min (const hb_set_t *set); 135 | 136 | /* Returns -1 if set empty. */ 137 | hb_codepoint_t 138 | hb_set_get_max (const hb_set_t *set); 139 | 140 | /* Pass -1 in to get started. */ 141 | hb_bool_t 142 | hb_set_next (const hb_set_t *set, 143 | hb_codepoint_t *codepoint); 144 | 145 | /* Pass -1 for first and last to get started. */ 146 | hb_bool_t 147 | hb_set_next_range (const hb_set_t *set, 148 | hb_codepoint_t *first, 149 | hb_codepoint_t *last); 150 | 151 | 152 | HB_END_DECLS 153 | 154 | #endif /* HB_SET_H */ 155 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-shape-plan.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2012 Google, Inc. 3 | * 4 | * This is part of HarfBuzz, a text shaping library. 5 | * 6 | * Permission is hereby granted, without written agreement and without 7 | * license or royalty fees, to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose, provided that the 9 | * above copyright notice and the following two paragraphs appear in 10 | * all copies of this software. 11 | * 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 | * DAMAGE. 17 | * 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 | * 24 | * Google Author(s): Behdad Esfahbod 25 | */ 26 | 27 | #ifndef HB_H_IN 28 | #error "Include <hb.h> instead." 29 | #endif 30 | 31 | #ifndef HB_SHAPE_PLAN_H 32 | #define HB_SHAPE_PLAN_H 33 | 34 | #include "hb-common.h" 35 | #include "hb-font.h" 36 | 37 | HB_BEGIN_DECLS 38 | 39 | typedef struct hb_shape_plan_t hb_shape_plan_t; 40 | 41 | hb_shape_plan_t * 42 | hb_shape_plan_create (hb_face_t *face, 43 | const hb_segment_properties_t *props, 44 | const hb_feature_t *user_features, 45 | unsigned int num_user_features, 46 | const char * const *shaper_list); 47 | 48 | hb_shape_plan_t * 49 | hb_shape_plan_create_cached (hb_face_t *face, 50 | const hb_segment_properties_t *props, 51 | const hb_feature_t *user_features, 52 | unsigned int num_user_features, 53 | const char * const *shaper_list); 54 | 55 | hb_shape_plan_t * 56 | hb_shape_plan_get_empty (void); 57 | 58 | hb_shape_plan_t * 59 | hb_shape_plan_reference (hb_shape_plan_t *shape_plan); 60 | 61 | void 62 | hb_shape_plan_destroy (hb_shape_plan_t *shape_plan); 63 | 64 | hb_bool_t 65 | hb_shape_plan_set_user_data (hb_shape_plan_t *shape_plan, 66 | hb_user_data_key_t *key, 67 | void * data, 68 | hb_destroy_func_t destroy, 69 | hb_bool_t replace); 70 | 71 | void * 72 | hb_shape_plan_get_user_data (hb_shape_plan_t *shape_plan, 73 | hb_user_data_key_t *key); 74 | 75 | 76 | hb_bool_t 77 | hb_shape_plan_execute (hb_shape_plan_t *shape_plan, 78 | hb_font_t *font, 79 | hb_buffer_t *buffer, 80 | const hb_feature_t *features, 81 | unsigned int num_features); 82 | 83 | const char * 84 | hb_shape_plan_get_shaper (hb_shape_plan_t *shape_plan); 85 | 86 | 87 | HB_END_DECLS 88 | 89 | #endif /* HB_SHAPE_PLAN_H */ 90 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-shape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2009 Red Hat, Inc. 3 | * Copyright © 2012 Google, Inc. 4 | * 5 | * This is part of HarfBuzz, a text shaping library. 6 | * 7 | * Permission is hereby granted, without written agreement and without 8 | * license or royalty fees, to use, copy, modify, and distribute this 9 | * software and its documentation for any purpose, provided that the 10 | * above copyright notice and the following two paragraphs appear in 11 | * all copies of this software. 12 | * 13 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 14 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 15 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 16 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 17 | * DAMAGE. 18 | * 19 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 20 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 21 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 22 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 23 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 24 | * 25 | * Red Hat Author(s): Behdad Esfahbod 26 | * Google Author(s): Behdad Esfahbod 27 | */ 28 | 29 | #ifndef HB_H_IN 30 | #error "Include <hb.h> instead." 31 | #endif 32 | 33 | #ifndef HB_SHAPE_H 34 | #define HB_SHAPE_H 35 | 36 | #include "hb-common.h" 37 | #include "hb-buffer.h" 38 | #include "hb-font.h" 39 | 40 | HB_BEGIN_DECLS 41 | 42 | 43 | typedef struct hb_feature_t { 44 | hb_tag_t tag; 45 | uint32_t value; 46 | unsigned int start; 47 | unsigned int end; 48 | } hb_feature_t; 49 | 50 | /* len=-1 means str is NUL-terminated */ 51 | hb_bool_t 52 | hb_feature_from_string (const char *str, int len, 53 | hb_feature_t *feature); 54 | 55 | /* Something like 128 bytes is more than enough. 56 | * nul-terminates. */ 57 | void 58 | hb_feature_to_string (hb_feature_t *feature, 59 | char *buf, unsigned int size); 60 | 61 | 62 | void 63 | hb_shape (hb_font_t *font, 64 | hb_buffer_t *buffer, 65 | const hb_feature_t *features, 66 | unsigned int num_features); 67 | 68 | hb_bool_t 69 | hb_shape_full (hb_font_t *font, 70 | hb_buffer_t *buffer, 71 | const hb_feature_t *features, 72 | unsigned int num_features, 73 | const char * const *shaper_list); 74 | 75 | const char ** 76 | hb_shape_list_shapers (void); 77 | 78 | 79 | HB_END_DECLS 80 | 81 | #endif /* HB_SHAPE_H */ 82 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb-version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2011 Google, Inc. 3 | * 4 | * This is part of HarfBuzz, a text shaping library. 5 | * 6 | * Permission is hereby granted, without written agreement and without 7 | * license or royalty fees, to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose, provided that the 9 | * above copyright notice and the following two paragraphs appear in 10 | * all copies of this software. 11 | * 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 | * DAMAGE. 17 | * 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 | * 24 | * Google Author(s): Behdad Esfahbod 25 | */ 26 | 27 | #ifndef HB_H_IN 28 | #error "Include <hb.h> instead." 29 | #endif 30 | 31 | #ifndef HB_VERSION_H 32 | #define HB_VERSION_H 33 | 34 | #include "hb-common.h" 35 | 36 | HB_BEGIN_DECLS 37 | 38 | 39 | #define HB_VERSION_MAJOR 0 40 | #define HB_VERSION_MINOR 9 41 | #define HB_VERSION_MICRO 35 42 | 43 | #define HB_VERSION_STRING "0.9.35" 44 | 45 | #define HB_VERSION_ATLEAST(major,minor,micro) \ 46 | ((major)*10000+(minor)*100+(micro) <= \ 47 | HB_VERSION_MAJOR*10000+HB_VERSION_MINOR*100+HB_VERSION_MICRO) 48 | 49 | 50 | void 51 | hb_version (unsigned int *major, 52 | unsigned int *minor, 53 | unsigned int *micro); 54 | 55 | const char * 56 | hb_version_string (void); 57 | 58 | hb_bool_t 59 | hb_version_atleast (unsigned int major, 60 | unsigned int minor, 61 | unsigned int micro); 62 | 63 | 64 | HB_END_DECLS 65 | 66 | #endif /* HB_VERSION_H */ 67 | -------------------------------------------------------------------------------- /fontstash/lib/include/harfbuzz/hb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2009 Red Hat, Inc. 3 | * 4 | * This is part of HarfBuzz, a text shaping library. 5 | * 6 | * Permission is hereby granted, without written agreement and without 7 | * license or royalty fees, to use, copy, modify, and distribute this 8 | * software and its documentation for any purpose, provided that the 9 | * above copyright notice and the following two paragraphs appear in 10 | * all copies of this software. 11 | * 12 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16 | * DAMAGE. 17 | * 18 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23 | * 24 | * Red Hat Author(s): Behdad Esfahbod 25 | */ 26 | 27 | #ifndef HB_H 28 | #define HB_H 29 | #define HB_H_IN 30 | 31 | #include "hb-blob.h" 32 | #include "hb-buffer.h" 33 | #include "hb-common.h" 34 | #include "hb-deprecated.h" 35 | #include "hb-face.h" 36 | #include "hb-font.h" 37 | #include "hb-set.h" 38 | #include "hb-shape.h" 39 | #include "hb-shape-plan.h" 40 | #include "hb-unicode.h" 41 | #include "hb-version.h" 42 | 43 | HB_BEGIN_DECLS 44 | HB_END_DECLS 45 | 46 | #undef HB_H_IN 47 | #endif /* HB_H */ 48 | -------------------------------------------------------------------------------- /fontstash/lib/precompiled/freetype2/libfreetype2-sim.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangrams/fontstash-es/d027b921e03910193105c68691a42ae44ca7bd0a/fontstash/lib/precompiled/freetype2/libfreetype2-sim.a -------------------------------------------------------------------------------- /fontstash/lib/precompiled/harfbuzz/libharfbuzz-sim.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangrams/fontstash-es/d027b921e03910193105c68691a42ae44ca7bd0a/fontstash/lib/precompiled/harfbuzz/libharfbuzz-sim.a -------------------------------------------------------------------------------- /fontstash/lib/precompiled/harfbuzz/libucdn-sim.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangrams/fontstash-es/d027b921e03910193105c68691a42ae44ca7bd0a/fontstash/lib/precompiled/harfbuzz/libucdn-sim.a -------------------------------------------------------------------------------- /fontstash/shaders.h: -------------------------------------------------------------------------------- 1 | // 2 | // shaders.h 3 | // FontstashiOS 4 | // 5 | // Created by Karim Naaji on 12/16/14. 6 | // Copyright (c) 2014 Mapzen. All rights reserved. 7 | // 8 | 9 | #ifndef SHADERS_H 10 | #define SHADERS_H 11 | 12 | #define USE_VARIABLE __attribute__((used)) 13 | 14 | namespace glfs { 15 | 16 | USE_VARIABLE static const GLchar* vertexShaderSrc = R"END( 17 | #ifdef GL_ES 18 | precision mediump float; 19 | #define LOWP lowp 20 | #else 21 | #define LOWP 22 | #endif 23 | 24 | attribute vec2 a_position; 25 | attribute vec2 a_screenPosition; 26 | attribute vec2 a_uvs; 27 | attribute float a_alpha; 28 | attribute float a_rotation; 29 | 30 | uniform mat4 u_proj; 31 | 32 | varying vec2 v_uv; 33 | varying float v_alpha; 34 | 35 | void main() { 36 | if (a_alpha != 0.0) { 37 | float st = sin(a_rotation); 38 | float ct = cos(a_rotation); 39 | 40 | // rotates first around +z-axis (0,0,1) and then translates by (tx,ty,0) 41 | vec4 p = vec4( 42 | a_position.x * ct - a_position.y * st + a_screenPosition.x, 43 | a_position.x * st + a_position.y * ct + a_screenPosition.y, 44 | 0.0, 1.0 45 | ); 46 | 47 | gl_Position = u_proj * p; 48 | } else { 49 | gl_Position = vec4(0.0); 50 | } 51 | 52 | v_uv = a_uvs; 53 | v_alpha = a_alpha; 54 | } 55 | 56 | )END"; 57 | 58 | USE_VARIABLE static const GLchar* sdfFragShaderSrc = R"END( 59 | #extension GL_OES_standard_derivatives : enable 60 | 61 | #ifdef GL_ES 62 | precision mediump float; 63 | #define LOWP lowp 64 | #else 65 | #define LOWP 66 | #endif 67 | 68 | uniform sampler2D u_tex; 69 | uniform LOWP vec3 u_color; 70 | 71 | varying vec2 v_uv; 72 | varying float v_alpha; 73 | 74 | const float gamma = 2.2; 75 | const float tint = 1.8; 76 | const float sdf = 0.8; 77 | 78 | float contour(in float d, in float w, in float off) { 79 | return smoothstep(off - w, off + w, d); 80 | } 81 | 82 | float sample(in vec2 uv, float w, in float off) { 83 | return contour(texture2D(u_tex, uv).a, w, off); 84 | } 85 | 86 | float sampleAlpha(in vec2 uv, float distance, in float off) { 87 | float alpha = contour(distance, distance, off); 88 | 89 | float dscale = 0.354; // 1 / sqrt(2) 90 | vec2 duv = dscale * (dFdx(uv) + dFdy(uv)); 91 | vec4 box = vec4(uv - duv, uv + duv); 92 | 93 | #ifdef GL_OES_standard_derivatives 94 | float asum = sample(box.xy, distance, off) 95 | + sample(box.zw, distance, off) 96 | + sample(box.xw, distance, off) 97 | + sample(box.zy, distance, off); 98 | 99 | alpha = (alpha + 0.5 * asum) / 2.0; 100 | #endif 101 | 102 | return alpha; 103 | } 104 | 105 | void main(void) { 106 | if (v_alpha == 0.0) { 107 | discard; 108 | } 109 | 110 | float distance = texture2D(u_tex, v_uv).a; 111 | float alpha = sampleAlpha(v_uv, distance, sdf) * tint; 112 | alpha = pow(alpha, 1.0 / gamma); 113 | 114 | gl_FragColor = vec4(u_color, v_alpha * alpha); 115 | } 116 | 117 | )END"; 118 | 119 | USE_VARIABLE static const GLchar* defaultFragShaderSrc = R"END( 120 | 121 | #ifdef GL_ES 122 | precision mediump float; 123 | #define LOWP lowp 124 | #else 125 | #define LOWP 126 | #endif 127 | 128 | uniform sampler2D u_tex; 129 | uniform LOWP vec3 u_color; 130 | 131 | varying vec2 v_uv; 132 | varying float v_alpha; 133 | 134 | void main(void) { 135 | if (v_alpha == 0.0) { 136 | discard; 137 | } 138 | 139 | vec4 texColor = texture2D(u_tex, v_uv); 140 | gl_FragColor = vec4(u_color.rgb, texColor.a * v_alpha); 141 | } 142 | 143 | )END"; 144 | 145 | } 146 | 147 | #endif 148 | -------------------------------------------------------------------------------- /img/capture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangrams/fontstash-es/d027b921e03910193105c68691a42ae44ca7bd0a/img/capture.png -------------------------------------------------------------------------------- /img/particles.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangrams/fontstash-es/d027b921e03910193105c68691a42ae44ca7bd0a/img/particles.gif --------------------------------------------------------------------------------