├── .gitignore ├── Android └── jni │ ├── Android.mk │ ├── Application.mk │ └── module.mk ├── FTL.txt ├── README.md ├── include ├── 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 └── src ├── autofit ├── Jamfile ├── afangles.c ├── afangles.h ├── afcjk.c ├── afcjk.h ├── afdummy.c ├── afdummy.h ├── aferrors.h ├── afglobal.c ├── afglobal.h ├── afhints.c ├── afhints.h ├── afindic.c ├── afindic.h ├── aflatin.c ├── aflatin.h ├── aflatin2.c ├── aflatin2.h ├── afloader.c ├── afloader.h ├── afmodule.c ├── afmodule.h ├── afpic.c ├── afpic.h ├── aftypes.h ├── afwarp.c ├── afwarp.h ├── autofit.c ├── module.mk └── rules.mk ├── base ├── basepic.c ├── basepic.h ├── ftadvanc.c ├── ftapi.c ├── ftbase.c ├── ftbase.h ├── ftbbox.c ├── ftbitmap.c ├── ftcalc.c ├── ftdbgmem.c ├── ftdebug.c ├── ftgloadr.c ├── ftglyph.c ├── ftinit.c ├── ftobjs.c ├── ftoutln.c ├── ftpic.c ├── ftrfork.c ├── ftsnames.c ├── ftstream.c ├── ftstroke.c ├── ftsynth.c ├── ftsystem.c ├── fttrigon.c └── ftutil.c ├── cff ├── Jamfile ├── cff.c ├── cffcmap.c ├── cffcmap.h ├── cffdrivr.c ├── cffdrivr.h ├── cfferrs.h ├── cffgload.c ├── cffgload.h ├── cffload.c ├── cffload.h ├── cffobjs.c ├── cffobjs.h ├── cffparse.c ├── cffparse.h ├── cffpic.c ├── cffpic.h ├── cfftoken.h ├── cfftypes.h ├── module.mk └── rules.mk ├── pshinter ├── Jamfile ├── module.mk ├── pshalgo.c ├── pshalgo.h ├── pshglob.c ├── pshglob.h ├── pshinter.c ├── pshmod.c ├── pshmod.h ├── pshnterr.h ├── pshpic.c ├── pshpic.h ├── pshrec.c ├── pshrec.h └── rules.mk ├── psnames ├── Jamfile ├── module.mk ├── psmodule.c ├── psmodule.h ├── psnamerr.h ├── psnames.c ├── pspic.c ├── pspic.h ├── pstables.h └── rules.mk ├── raster ├── Jamfile ├── ftmisc.h ├── ftraster.c ├── ftraster.h ├── ftrend1.c ├── ftrend1.h ├── module.mk ├── raster.c ├── rasterrs.h ├── rastpic.c ├── rastpic.h └── rules.mk ├── sfnt ├── Jamfile ├── module.mk ├── rules.mk ├── sfdriver.c ├── sfdriver.h ├── sferrors.h ├── sfnt.c ├── sfntpic.c ├── sfntpic.h ├── sfobjs.c ├── sfobjs.h ├── ttbdf.c ├── ttbdf.h ├── ttcmap.c ├── ttcmap.h ├── ttcmapc.h ├── ttkern.c ├── ttkern.h ├── ttload.c ├── ttload.h ├── ttmtx.c ├── ttmtx.h ├── ttpost.c ├── ttpost.h ├── ttsbit.c ├── ttsbit.h └── ttsbit0.c ├── smooth ├── Jamfile ├── ftgrays.c ├── ftgrays.h ├── ftsmerrs.h ├── ftsmooth.c ├── ftsmooth.h ├── ftspic.c ├── ftspic.h ├── module.mk ├── rules.mk └── smooth.c └── truetype ├── Jamfile ├── module.mk ├── rules.mk ├── truetype.c ├── ttdriver.c ├── ttdriver.h ├── tterrors.h ├── ttgload.c ├── ttgload.h ├── ttgxvar.c ├── ttgxvar.h ├── ttinterp.c ├── ttinterp.h ├── ttobjs.c ├── ttobjs.h ├── ttpic.c ├── ttpic.h ├── ttpload.c └── ttpload.h /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | # built application files 3 | *.apk 4 | *.ap_ 5 | 6 | # files for the dex VM 7 | *.dex 8 | 9 | # Java class files 10 | *.class 11 | 12 | # generated files 13 | bin/ 14 | gen/ 15 | obj/ 16 | 17 | # Local configuration file (sdk path, etc) 18 | local.properties 19 | # Compiled Object files 20 | *.slo 21 | *.lo 22 | *.o 23 | 24 | # Compiled Dynamic libraries 25 | *.so 26 | 27 | # Compiled Static libraries 28 | *.lai 29 | *.la 30 | *.a 31 | -------------------------------------------------------------------------------- /Android/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | FREETYPE_SRC_PATH := ../../ 6 | 7 | LOCAL_MODULE := freetype2-static 8 | 9 | LOCAL_CFLAGS := -DANDROID_NDK \ 10 | -DFT2_BUILD_LIBRARY=1 11 | 12 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include_all \ 13 | $(FREETYPE_SRC_PATH)include \ 14 | $(FREETYPE_SRC_PATH)src 15 | 16 | LOCAL_SRC_FILES := \ 17 | $(FREETYPE_SRC_PATH)src/autofit/autofit.c \ 18 | $(FREETYPE_SRC_PATH)src/base/basepic.c \ 19 | $(FREETYPE_SRC_PATH)src/base/ftapi.c \ 20 | $(FREETYPE_SRC_PATH)src/base/ftbase.c \ 21 | $(FREETYPE_SRC_PATH)src/base/ftbbox.c \ 22 | $(FREETYPE_SRC_PATH)src/base/ftbitmap.c \ 23 | $(FREETYPE_SRC_PATH)src/base/ftdbgmem.c \ 24 | $(FREETYPE_SRC_PATH)src/base/ftdebug.c \ 25 | $(FREETYPE_SRC_PATH)src/base/ftglyph.c \ 26 | $(FREETYPE_SRC_PATH)src/base/ftinit.c \ 27 | $(FREETYPE_SRC_PATH)src/base/ftpic.c \ 28 | $(FREETYPE_SRC_PATH)src/base/ftstroke.c \ 29 | $(FREETYPE_SRC_PATH)src/base/ftsynth.c \ 30 | $(FREETYPE_SRC_PATH)src/base/ftsystem.c \ 31 | $(FREETYPE_SRC_PATH)src/cff/cff.c \ 32 | $(FREETYPE_SRC_PATH)src/pshinter/pshinter.c \ 33 | $(FREETYPE_SRC_PATH)src/psnames/psnames.c \ 34 | $(FREETYPE_SRC_PATH)src/raster/raster.c \ 35 | $(FREETYPE_SRC_PATH)src/sfnt/sfnt.c \ 36 | $(FREETYPE_SRC_PATH)src/smooth/smooth.c \ 37 | $(FREETYPE_SRC_PATH)src/truetype/truetype.c 38 | 39 | LOCAL_LDLIBS := -ldl -llog 40 | 41 | include $(BUILD_STATIC_LIBRARY) 42 | 43 | -------------------------------------------------------------------------------- /Android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := armeabi armeabi-v7a 2 | APP_PLATFORM := android-8 -------------------------------------------------------------------------------- /Android/jni/module.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_MODULE := freetype2-prebuilt 5 | LOCAL_SRC_FILES := ../obj/local/$(TARGET_ARCH_ABI)/libfreetype2-static.a 6 | include $(PREBUILT_STATIC_LIBRARY) -------------------------------------------------------------------------------- /FTL.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cdave1/freetype2-android/006e528f3df3102e4dc26efd0bc6bc7b6d2f2df4/FTL.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Freetype 2 Android 2 | 3 | This is simply a distribution of the Freetype 2 library, that includes Android make files ready to build the Freetype 2 library into a static and shared binaries for version 2.2 of the Android operating system. This distribution requires release 5 of the Android Native Development Kit. 4 | 5 | The project only includes the Freetype modules for processing TrueType and OpenType fonts. Other font modules have been disabled. If you want to re-enable these modules, you will need to download the Freetype 2 source code, and then copy the module source files to the appropriate location in either the "include/" or "src/" folders of this distribution. The Freetype source code is [available here](http://download.savannah.gnu.org/releases/freetype/). The instructions for including these new modules in the Android makefile is left as an exercise, but if you follow the pattern of the truetype module in the Android makefile, your module should compile correctly. 6 | 7 | The code in this distribution comes from version 2.4.4 of the Freetype library. 8 | 9 | There is an analogous library for Xcode and iOS [here](https://github.com/cdave1/freetype2-ios). 10 | 11 | 12 | # Install 13 | 14 | This distribution requires release 5 of the Android Native Development Kit. 15 | 16 | To build, cd to the Android/jni/ directory and type ndk-build. 17 | 18 | The file Android/jni/Application.mk contains the target and platform settings used by ndk-build. The current settings are: 19 | 20 | APP_ABI := armeabi armeabi-v7a 21 | APP_PLATFORM := android-8 22 | 23 | To use the library in another ndk library, you will need to include the Android/jni/module.mk file in the Android.mk of the library you want to use freetype with. 24 | 25 | 26 | # License 27 | 28 | This code is distributed under the terms of the [Freetype License](http://www.freetype.org/FTL.TXT). The Freetype License is also included in this distribution. If you are going to use code in this project, please make sure you follow the instructions in the Freetype License. -------------------------------------------------------------------------------- /include/freetype/config/ftmodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file registers the FreeType modules compiled into the library. 3 | * 4 | * If you use GNU make, this file IS NOT USED! Instead, it is created in 5 | * the objects directory (normally `/objs/') based on information 6 | * from `/modules.cfg'. 7 | * 8 | * Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile 9 | * FreeType without GNU make. 10 | * 11 | */ 12 | 13 | //FT_USE_MODULE( FT_Module_Class, autofit_module_class ) 14 | FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) 15 | //FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) 16 | FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) 17 | //FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) 18 | //FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) 19 | //FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) 20 | //FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) 21 | //FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) 22 | //FT_USE_MODULE( FT_Module_Class, psaux_module_class ) 23 | FT_USE_MODULE( FT_Module_Class, psnames_module_class ) 24 | FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) 25 | FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) 26 | FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) 27 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) 28 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) 29 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) 30 | //FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) 31 | 32 | /* EOF */ 33 | -------------------------------------------------------------------------------- /include/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 | -------------------------------------------------------------------------------- /include/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 28 | #define FT_INTERNAL_PIC_H 29 | #define FT_INTERNAL_STREAM_H 30 | #define FT_INTERNAL_MEMORY_H 31 | #define FT_INTERNAL_DEBUG_H 32 | #define FT_INTERNAL_CALC_H 33 | #define FT_INTERNAL_DRIVER_H 34 | #define FT_INTERNAL_TRACE_H 35 | #define FT_INTERNAL_GLYPH_LOADER_H 36 | #define FT_INTERNAL_SFNT_H 37 | #define FT_INTERNAL_SERVICE_H 38 | #define FT_INTERNAL_RFORK_H 39 | #define FT_INTERNAL_VALIDATE_H 40 | 41 | #define FT_INTERNAL_TRUETYPE_TYPES_H 42 | #define FT_INTERNAL_TYPE1_TYPES_H 43 | 44 | #define FT_INTERNAL_POSTSCRIPT_AUX_H 45 | #define FT_INTERNAL_POSTSCRIPT_HINTS_H 46 | #define FT_INTERNAL_POSTSCRIPT_GLOBALS_H 47 | 48 | #define FT_INTERNAL_AUTOHINT_H 49 | 50 | 51 | /* END */ 52 | -------------------------------------------------------------------------------- /include/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 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 | -------------------------------------------------------------------------------- /include/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 | -------------------------------------------------------------------------------- /include/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 | -------------------------------------------------------------------------------- /include/freetype/internal/services/svgxval.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* svgxval.h */ 4 | /* */ 5 | /* FreeType API for validating TrueTypeGX/AAT tables (specification). */ 6 | /* */ 7 | /* Copyright 2004, 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 | -------------------------------------------------------------------------------- /include/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 | -------------------------------------------------------------------------------- /include/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 | -------------------------------------------------------------------------------- /include/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 | -------------------------------------------------------------------------------- /include/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 | -------------------------------------------------------------------------------- /include/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 | -------------------------------------------------------------------------------- /include/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 | -------------------------------------------------------------------------------- /include/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 | -------------------------------------------------------------------------------- /include/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 | -------------------------------------------------------------------------------- /include/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 */ 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 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 | -------------------------------------------------------------------------------- /include/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 35 | 36 | #endif /* __FT2_BUILD_GENERIC_H__ */ 37 | 38 | 39 | /* END */ 40 | -------------------------------------------------------------------------------- /src/autofit/Jamfile: -------------------------------------------------------------------------------- 1 | # FreeType 2 src/autofit Jamfile 2 | # 3 | # Copyright 2003, 2004, 2005, 2006, 2007, 2009 by 4 | # David Turner, Robert Wilhelm, and Werner Lemberg. 5 | # 6 | # This file is part of the FreeType project, and may only be used, modified, 7 | # and distributed under the terms of the FreeType project license, 8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 9 | # indicate that you have read the license and understand and accept it 10 | # fully. 11 | 12 | SubDir FT2_TOP src autofit ; 13 | 14 | { 15 | local _sources ; 16 | 17 | # define FT2_AUTOFIT2 to enable experimental latin hinter replacement 18 | if $(FT2_AUTOFIT2) 19 | { 20 | DEFINES += FT_OPTION_AUTOFIT2 ; 21 | } 22 | if $(FT2_MULTI) 23 | { 24 | _sources = afangles afglobal afhints aflatin afcjk afindic afloader afmodule afdummy afwarp afpic ; 25 | 26 | if $(FT2_AUTOFIT2) 27 | { 28 | _sources += aflatin2 ; 29 | } 30 | } 31 | else 32 | { 33 | _sources = autofit ; 34 | } 35 | 36 | Library $(FT2_LIB) : $(_sources).c ; 37 | } 38 | 39 | # end of src/autofit Jamfile 40 | -------------------------------------------------------------------------------- /src/autofit/afangles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * afangles.h 3 | * 4 | * This is a dummy file, used to please the build system. It is never 5 | * included by the auto-fitter sources. 6 | * 7 | */ 8 | -------------------------------------------------------------------------------- /src/autofit/afcjk.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afcjk.h */ 4 | /* */ 5 | /* Auto-fitter hinting routines for CJK script (specification). */ 6 | /* */ 7 | /* Copyright 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 __AFCJK_H__ 20 | #define __AFCJK_H__ 21 | 22 | #include "afhints.h" 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | /* the CJK-specific script class */ 29 | 30 | AF_DECLARE_SCRIPT_CLASS(af_cjk_script_class) 31 | 32 | 33 | FT_LOCAL( FT_Error ) 34 | af_cjk_metrics_init( AF_LatinMetrics metrics, 35 | FT_Face face ); 36 | 37 | FT_LOCAL( void ) 38 | af_cjk_metrics_scale( AF_LatinMetrics metrics, 39 | AF_Scaler scaler ); 40 | 41 | FT_LOCAL( FT_Error ) 42 | af_cjk_hints_init( AF_GlyphHints hints, 43 | AF_LatinMetrics metrics ); 44 | 45 | FT_LOCAL( FT_Error ) 46 | af_cjk_hints_apply( AF_GlyphHints hints, 47 | FT_Outline* outline, 48 | AF_LatinMetrics metrics ); 49 | 50 | /* */ 51 | 52 | FT_END_HEADER 53 | 54 | #endif /* __AFCJK_H__ */ 55 | 56 | 57 | /* END */ 58 | -------------------------------------------------------------------------------- /src/autofit/afdummy.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afdummy.c */ 4 | /* */ 5 | /* Auto-fitter dummy routines to be used if no hinting should be */ 6 | /* performed (body). */ 7 | /* */ 8 | /* Copyright 2003, 2004, 2005 by */ 9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 10 | /* */ 11 | /* This file is part of the FreeType project, and may only be used, */ 12 | /* modified, and distributed under the terms of the FreeType project */ 13 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 14 | /* this file you indicate that you have read the license and */ 15 | /* understand and accept it fully. */ 16 | /* */ 17 | /***************************************************************************/ 18 | 19 | 20 | #include "afdummy.h" 21 | #include "afhints.h" 22 | 23 | 24 | static FT_Error 25 | af_dummy_hints_init( AF_GlyphHints hints, 26 | AF_ScriptMetrics metrics ) 27 | { 28 | af_glyph_hints_rescale( hints, 29 | metrics ); 30 | return 0; 31 | } 32 | 33 | 34 | static FT_Error 35 | af_dummy_hints_apply( AF_GlyphHints hints, 36 | FT_Outline* outline ) 37 | { 38 | FT_UNUSED( hints ); 39 | FT_UNUSED( outline ); 40 | 41 | return 0; 42 | } 43 | 44 | 45 | AF_DEFINE_SCRIPT_CLASS(af_dummy_script_class, 46 | AF_SCRIPT_NONE, 47 | NULL, 48 | 49 | sizeof( AF_ScriptMetricsRec ), 50 | 51 | (AF_Script_InitMetricsFunc) NULL, 52 | (AF_Script_ScaleMetricsFunc)NULL, 53 | (AF_Script_DoneMetricsFunc) NULL, 54 | 55 | (AF_Script_InitHintsFunc) af_dummy_hints_init, 56 | (AF_Script_ApplyHintsFunc) af_dummy_hints_apply 57 | ) 58 | 59 | 60 | /* END */ 61 | -------------------------------------------------------------------------------- /src/autofit/afdummy.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afdummy.h */ 4 | /* */ 5 | /* Auto-fitter dummy routines to be used if no hinting should be */ 6 | /* performed (specification). */ 7 | /* */ 8 | /* Copyright 2003, 2004, 2005 by */ 9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 10 | /* */ 11 | /* This file is part of the FreeType project, and may only be used, */ 12 | /* modified, and distributed under the terms of the FreeType project */ 13 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 14 | /* this file you indicate that you have read the license and */ 15 | /* understand and accept it fully. */ 16 | /* */ 17 | /***************************************************************************/ 18 | 19 | 20 | #ifndef __AFDUMMY_H__ 21 | #define __AFDUMMY_H__ 22 | 23 | #include "aftypes.h" 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | /* A dummy script metrics class used when no hinting should 29 | * be performed. This is the default for non-latin glyphs! 30 | */ 31 | 32 | AF_DECLARE_SCRIPT_CLASS(af_dummy_script_class) 33 | 34 | /* */ 35 | 36 | FT_END_HEADER 37 | 38 | 39 | #endif /* __AFDUMMY_H__ */ 40 | 41 | 42 | /* END */ 43 | -------------------------------------------------------------------------------- /src/autofit/aferrors.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* aferrors.h */ 4 | /* */ 5 | /* Autofitter error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2005 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | /*************************************************************************/ 20 | /* */ 21 | /* This file is used to define the Autofitter error enumeration */ 22 | /* constants. */ 23 | /* */ 24 | /*************************************************************************/ 25 | 26 | #ifndef __AFERRORS_H__ 27 | #define __AFERRORS_H__ 28 | 29 | #include FT_MODULE_ERRORS_H 30 | 31 | #undef __FTERRORS_H__ 32 | 33 | #define FT_ERR_PREFIX AF_Err_ 34 | #define FT_ERR_BASE FT_Mod_Err_Autofit 35 | 36 | #include FT_ERRORS_H 37 | 38 | #endif /* __AFERRORS_H__ */ 39 | 40 | /* END */ 41 | -------------------------------------------------------------------------------- /src/autofit/afglobal.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afglobal.h */ 4 | /* */ 5 | /* Auto-fitter routines to compute global hinting values */ 6 | /* (specification). */ 7 | /* */ 8 | /* Copyright 2003, 2004, 2005, 2007, 2009 by */ 9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 10 | /* */ 11 | /* This file is part of the FreeType project, and may only be used, */ 12 | /* modified, and distributed under the terms of the FreeType project */ 13 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 14 | /* this file you indicate that you have read the license and */ 15 | /* understand and accept it fully. */ 16 | /* */ 17 | /***************************************************************************/ 18 | 19 | 20 | #ifndef __AF_GLOBAL_H__ 21 | #define __AF_GLOBAL_H__ 22 | 23 | 24 | #include "aftypes.h" 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | /************************************************************************/ 31 | /************************************************************************/ 32 | /***** *****/ 33 | /***** F A C E G L O B A L S *****/ 34 | /***** *****/ 35 | /************************************************************************/ 36 | /************************************************************************/ 37 | 38 | 39 | /* 40 | * model the global hints data for a given face, decomposed into 41 | * script-specific items 42 | */ 43 | typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals; 44 | 45 | 46 | FT_LOCAL( FT_Error ) 47 | af_face_globals_new( FT_Face face, 48 | AF_FaceGlobals *aglobals ); 49 | 50 | FT_LOCAL( FT_Error ) 51 | af_face_globals_get_metrics( AF_FaceGlobals globals, 52 | FT_UInt gindex, 53 | FT_UInt options, 54 | AF_ScriptMetrics *ametrics ); 55 | 56 | FT_LOCAL( void ) 57 | af_face_globals_free( AF_FaceGlobals globals ); 58 | 59 | FT_LOCAL_DEF( FT_Bool ) 60 | af_face_globals_is_digit( AF_FaceGlobals globals, 61 | FT_UInt gindex ); 62 | 63 | /* */ 64 | 65 | 66 | FT_END_HEADER 67 | 68 | #endif /* __AF_GLOBALS_H__ */ 69 | 70 | 71 | /* END */ 72 | -------------------------------------------------------------------------------- /src/autofit/afindic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afindic.h */ 4 | /* */ 5 | /* Auto-fitter hinting routines for Indic scripts (specification). */ 6 | /* */ 7 | /* Copyright 2007 by */ 8 | /* Rahul Bhalerao , . */ 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 __AFINDIC_H__ 20 | #define __AFINDIC_H__ 21 | 22 | #include "afhints.h" 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | /* the Indic-specific script class */ 29 | 30 | AF_DECLARE_SCRIPT_CLASS(af_indic_script_class) 31 | 32 | 33 | /* */ 34 | 35 | FT_END_HEADER 36 | 37 | #endif /* __AFINDIC_H__ */ 38 | 39 | 40 | /* END */ 41 | -------------------------------------------------------------------------------- /src/autofit/aflatin2.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* aflatin2.h */ 4 | /* */ 5 | /* Auto-fitter hinting routines for latin script (specification). */ 6 | /* */ 7 | /* Copyright 2003, 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 | #ifndef __AFLATIN2_H__ 20 | #define __AFLATIN2_H__ 21 | 22 | #include "afhints.h" 23 | 24 | 25 | FT_BEGIN_HEADER 26 | 27 | 28 | /* the latin-specific script class */ 29 | 30 | AF_DECLARE_SCRIPT_CLASS(af_latin2_script_class) 31 | 32 | /* */ 33 | 34 | FT_END_HEADER 35 | 36 | #endif /* __AFLATIN_H__ */ 37 | 38 | 39 | /* END */ 40 | -------------------------------------------------------------------------------- /src/autofit/afloader.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afloader.h */ 4 | /* */ 5 | /* Auto-fitter glyph loading routines (specification). */ 6 | /* */ 7 | /* Copyright 2003, 2004, 2005 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 __AF_LOADER_H__ 20 | #define __AF_LOADER_H__ 21 | 22 | #include "afhints.h" 23 | #include "afglobal.h" 24 | 25 | 26 | FT_BEGIN_HEADER 27 | 28 | typedef struct AF_LoaderRec_ 29 | { 30 | FT_Face face; /* current face */ 31 | AF_FaceGlobals globals; /* current face globals */ 32 | FT_GlyphLoader gloader; /* glyph loader */ 33 | AF_GlyphHintsRec hints; 34 | AF_ScriptMetrics metrics; 35 | FT_Bool transformed; 36 | FT_Matrix trans_matrix; 37 | FT_Vector trans_delta; 38 | FT_Vector pp1; 39 | FT_Vector pp2; 40 | /* we don't handle vertical phantom points */ 41 | 42 | } AF_LoaderRec, *AF_Loader; 43 | 44 | 45 | FT_LOCAL( FT_Error ) 46 | af_loader_init( AF_Loader loader, 47 | FT_Memory memory ); 48 | 49 | 50 | FT_LOCAL( FT_Error ) 51 | af_loader_reset( AF_Loader loader, 52 | FT_Face face ); 53 | 54 | 55 | FT_LOCAL( void ) 56 | af_loader_done( AF_Loader loader ); 57 | 58 | 59 | FT_LOCAL( FT_Error ) 60 | af_loader_load_glyph( AF_Loader loader, 61 | FT_Face face, 62 | FT_UInt gindex, 63 | FT_UInt32 load_flags ); 64 | 65 | /* */ 66 | 67 | 68 | FT_END_HEADER 69 | 70 | #endif /* __AF_LOADER_H__ */ 71 | 72 | 73 | /* END */ 74 | -------------------------------------------------------------------------------- /src/autofit/afmodule.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afmodule.c */ 4 | /* */ 5 | /* Auto-fitter module implementation (body). */ 6 | /* */ 7 | /* Copyright 2003, 2004, 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 | #include "afmodule.h" 20 | #include "afloader.h" 21 | #include "afpic.h" 22 | 23 | #ifdef AF_DEBUG 24 | int _af_debug; 25 | int _af_debug_disable_horz_hints; 26 | int _af_debug_disable_vert_hints; 27 | int _af_debug_disable_blue_hints; 28 | void* _af_debug_hints; 29 | #endif 30 | 31 | #include FT_INTERNAL_OBJECTS_H 32 | 33 | 34 | typedef struct FT_AutofitterRec_ 35 | { 36 | FT_ModuleRec root; 37 | AF_LoaderRec loader[1]; 38 | 39 | } FT_AutofitterRec, *FT_Autofitter; 40 | 41 | 42 | FT_CALLBACK_DEF( FT_Error ) 43 | af_autofitter_init( FT_Autofitter module ) 44 | { 45 | return af_loader_init( module->loader, module->root.library->memory ); 46 | } 47 | 48 | 49 | FT_CALLBACK_DEF( void ) 50 | af_autofitter_done( FT_Autofitter module ) 51 | { 52 | af_loader_done( module->loader ); 53 | } 54 | 55 | 56 | FT_CALLBACK_DEF( FT_Error ) 57 | af_autofitter_load_glyph( FT_Autofitter module, 58 | FT_GlyphSlot slot, 59 | FT_Size size, 60 | FT_UInt glyph_index, 61 | FT_Int32 load_flags ) 62 | { 63 | FT_UNUSED( size ); 64 | 65 | return af_loader_load_glyph( module->loader, slot->face, 66 | glyph_index, load_flags ); 67 | } 68 | 69 | 70 | FT_DEFINE_AUTOHINTER_SERVICE(af_autofitter_service, 71 | NULL, 72 | NULL, 73 | NULL, 74 | (FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph 75 | ) 76 | 77 | FT_DEFINE_MODULE(autofit_module_class, 78 | 79 | FT_MODULE_HINTER, 80 | sizeof ( FT_AutofitterRec ), 81 | 82 | "autofitter", 83 | 0x10000L, /* version 1.0 of the autofitter */ 84 | 0x20000L, /* requires FreeType 2.0 or above */ 85 | 86 | (const void*)&AF_AF_AUTOFITTER_SERVICE_GET, 87 | 88 | (FT_Module_Constructor)af_autofitter_init, 89 | (FT_Module_Destructor) af_autofitter_done, 90 | (FT_Module_Requester) NULL 91 | ) 92 | 93 | 94 | /* END */ 95 | -------------------------------------------------------------------------------- /src/autofit/afmodule.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afmodule.h */ 4 | /* */ 5 | /* Auto-fitter module implementation (specification). */ 6 | /* */ 7 | /* Copyright 2003, 2004, 2005 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __AFMODULE_H__ 20 | #define __AFMODULE_H__ 21 | 22 | #include 23 | #include FT_INTERNAL_OBJECTS_H 24 | #include FT_MODULE_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | FT_DECLARE_MODULE(autofit_module_class) 30 | 31 | 32 | FT_END_HEADER 33 | 34 | #endif /* __AFMODULE_H__ */ 35 | 36 | 37 | /* END */ 38 | -------------------------------------------------------------------------------- /src/autofit/afpic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afpic.h */ 4 | /* */ 5 | /* The FreeType position independent code services for autofit module. */ 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 | #ifndef __AFPIC_H__ 20 | #define __AFPIC_H__ 21 | 22 | 23 | FT_BEGIN_HEADER 24 | 25 | #include FT_INTERNAL_PIC_H 26 | 27 | #ifndef FT_CONFIG_OPTION_PIC 28 | 29 | #define AF_SCRIPT_CLASSES_GET af_script_classes 30 | #define AF_AF_AUTOFITTER_SERVICE_GET af_autofitter_service 31 | 32 | #else /* FT_CONFIG_OPTION_PIC */ 33 | 34 | #include "aftypes.h" 35 | 36 | /* increase these when you add new scripts, and update autofit_module_class_pic_init */ 37 | #ifdef FT_OPTION_AUTOFIT2 38 | #define AF_SCRIPT_CLASSES_COUNT 6 39 | #else 40 | #define AF_SCRIPT_CLASSES_COUNT 5 41 | #endif 42 | #define AF_SCRIPT_CLASSES_REC_COUNT (AF_SCRIPT_CLASSES_COUNT-1) 43 | 44 | typedef struct AFModulePIC_ 45 | { 46 | AF_ScriptClass af_script_classes[AF_SCRIPT_CLASSES_COUNT]; 47 | AF_ScriptClassRec af_script_classes_rec[AF_SCRIPT_CLASSES_REC_COUNT]; 48 | FT_AutoHinter_ServiceRec af_autofitter_service; 49 | } AFModulePIC; 50 | 51 | #define GET_PIC(lib) ((AFModulePIC*)((lib)->pic_container.autofit)) 52 | #define AF_SCRIPT_CLASSES_GET (GET_PIC(FT_FACE_LIBRARY(globals->face))->af_script_classes) 53 | #define AF_AF_AUTOFITTER_SERVICE_GET (GET_PIC(library)->af_autofitter_service) 54 | 55 | #endif /* FT_CONFIG_OPTION_PIC */ 56 | 57 | /* */ 58 | 59 | FT_END_HEADER 60 | 61 | #endif /* __AFPIC_H__ */ 62 | 63 | 64 | /* END */ 65 | -------------------------------------------------------------------------------- /src/autofit/afwarp.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* afwarp.h */ 4 | /* */ 5 | /* Auto-fitter warping algorithm (specification). */ 6 | /* */ 7 | /* Copyright 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 __AFWARP_H__ 20 | #define __AFWARP_H__ 21 | 22 | #include "afhints.h" 23 | 24 | FT_BEGIN_HEADER 25 | 26 | #define AF_WARPER_SCALE 27 | 28 | #define AF_WARPER_FLOOR( x ) ( (x) & ~63 ) 29 | #define AF_WARPER_CEIL( x ) AF_WARPER_FLOOR( (x) + 63 ) 30 | 31 | 32 | typedef FT_Int32 AF_WarpScore; 33 | 34 | typedef struct AF_WarperRec_ 35 | { 36 | FT_Pos x1, x2; 37 | FT_Pos t1, t2; 38 | FT_Pos x1min, x1max; 39 | FT_Pos x2min, x2max; 40 | FT_Pos w0, wmin, wmax; 41 | 42 | FT_Fixed best_scale; 43 | FT_Pos best_delta; 44 | AF_WarpScore best_score; 45 | AF_WarpScore best_distort; 46 | 47 | } AF_WarperRec, *AF_Warper; 48 | 49 | 50 | FT_LOCAL( void ) 51 | af_warper_compute( AF_Warper warper, 52 | AF_GlyphHints hints, 53 | AF_Dimension dim, 54 | FT_Fixed *a_scale, 55 | FT_Fixed *a_delta ); 56 | 57 | 58 | FT_END_HEADER 59 | 60 | 61 | #endif /* __AFWARP_H__ */ 62 | 63 | 64 | /* END */ 65 | -------------------------------------------------------------------------------- /src/autofit/autofit.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* autofit.c */ 4 | /* */ 5 | /* Auto-fitter module (body). */ 6 | /* */ 7 | /* Copyright 2003, 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 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | #include 21 | #include "afpic.c" 22 | #include "afangles.c" 23 | #include "afglobal.c" 24 | #include "afhints.c" 25 | 26 | #include "afdummy.c" 27 | #include "aflatin.c" 28 | #ifdef FT_OPTION_AUTOFIT2 29 | #include "aflatin2.c" 30 | #endif 31 | #include "afcjk.c" 32 | #include "afindic.c" 33 | 34 | #include "afloader.c" 35 | #include "afmodule.c" 36 | 37 | #ifdef AF_USE_WARPER 38 | #include "afwarp.c" 39 | #endif 40 | 41 | /* END */ 42 | -------------------------------------------------------------------------------- /src/autofit/module.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 auto-fitter module definition 3 | # 4 | 5 | 6 | # Copyright 2003, 2004, 2005, 2006 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | FTMODULE_H_COMMANDS += AUTOFIT_MODULE 17 | 18 | define AUTOFIT_MODULE 19 | $(OPEN_DRIVER) FT_Module_Class, autofit_module_class $(CLOSE_DRIVER) 20 | $(ECHO_DRIVER)autofit $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE) 21 | endef 22 | 23 | # EOF 24 | -------------------------------------------------------------------------------- /src/autofit/rules.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 auto-fitter module configuration rules 3 | # 4 | 5 | 6 | # Copyright 2003, 2004, 2005, 2006, 2007 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | # AUTOF driver directory 17 | # 18 | AUTOF_DIR := $(SRC_DIR)/autofit 19 | 20 | 21 | # compilation flags for the driver 22 | # 23 | AUTOF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(AUTOF_DIR)) 24 | 25 | 26 | # AUTOF driver sources (i.e., C files) 27 | # 28 | AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \ 29 | $(AUTOF_DIR)/afcjk.c \ 30 | $(AUTOF_DIR)/afdummy.c \ 31 | $(AUTOF_DIR)/afglobal.c \ 32 | $(AUTOF_DIR)/afhints.c \ 33 | $(AUTOF_DIR)/afindic.c \ 34 | $(AUTOF_DIR)/aflatin.c \ 35 | $(AUTOF_DIR)/afloader.c \ 36 | $(AUTOF_DIR)/afmodule.c \ 37 | $(AUTOF_DIR)/afwarp.c 38 | 39 | # AUTOF driver headers 40 | # 41 | AUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h) \ 42 | $(AUTOF_DIR)/aftypes.h \ 43 | $(AUTOF_DIR)/aferrors.h 44 | 45 | 46 | # AUTOF driver object(s) 47 | # 48 | # AUTOF_DRV_OBJ_M is used during `multi' builds. 49 | # AUTOF_DRV_OBJ_S is used during `single' builds. 50 | # 51 | AUTOF_DRV_OBJ_M := $(AUTOF_DRV_SRC:$(AUTOF_DIR)/%.c=$(OBJ_DIR)/%.$O) 52 | AUTOF_DRV_OBJ_S := $(OBJ_DIR)/autofit.$O 53 | 54 | # AUTOF driver source file for single build 55 | # 56 | AUTOF_DRV_SRC_S := $(AUTOF_DIR)/autofit.c 57 | 58 | 59 | # AUTOF driver - single object 60 | # 61 | $(AUTOF_DRV_OBJ_S): $(AUTOF_DRV_SRC_S) $(AUTOF_DRV_SRC) \ 62 | $(FREETYPE_H) $(AUTOF_DRV_H) 63 | $(AUTOF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(AUTOF_DRV_SRC_S)) 64 | 65 | 66 | # AUTOF driver - multiple objects 67 | # 68 | $(OBJ_DIR)/%.$O: $(AUTOF_DIR)/%.c $(FREETYPE_H) $(AUTOF_DRV_H) 69 | $(AUTOF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) 70 | 71 | 72 | # update main driver object lists 73 | # 74 | DRV_OBJS_S += $(AUTOF_DRV_OBJ_S) 75 | DRV_OBJS_M += $(AUTOF_DRV_OBJ_M) 76 | 77 | 78 | # EOF 79 | -------------------------------------------------------------------------------- /src/base/basepic.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* basepic.c */ 4 | /* */ 5 | /* The FreeType position independent code services for base. */ 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 | #include 20 | #include FT_FREETYPE_H 21 | #include FT_INTERNAL_OBJECTS_H 22 | #include "basepic.h" 23 | 24 | #ifdef FT_CONFIG_OPTION_PIC 25 | 26 | /* forward declaration of PIC init functions from ftglyph.c */ 27 | void FT_Init_Class_ft_outline_glyph_class(FT_Glyph_Class*); 28 | void FT_Init_Class_ft_bitmap_glyph_class(FT_Glyph_Class*); 29 | 30 | /* forward declaration of PIC init functions from ftinit.c */ 31 | FT_Error ft_create_default_module_classes(FT_Library); 32 | void ft_destroy_default_module_classes(FT_Library); 33 | 34 | void 35 | ft_base_pic_free( FT_Library library ) 36 | { 37 | FT_PIC_Container* pic_container = &library->pic_container; 38 | FT_Memory memory = library->memory; 39 | if ( pic_container->base ) 40 | { 41 | /* Destroy default module classes (in case FT_Add_Default_Modules was used) */ 42 | ft_destroy_default_module_classes( library ); 43 | 44 | FT_FREE( pic_container->base ); 45 | pic_container->base = NULL; 46 | } 47 | } 48 | 49 | 50 | FT_Error 51 | ft_base_pic_init( FT_Library library ) 52 | { 53 | FT_PIC_Container* pic_container = &library->pic_container; 54 | FT_Error error = FT_Err_Ok; 55 | BasePIC* container; 56 | FT_Memory memory = library->memory; 57 | 58 | /* allocate pointer, clear and set global container pointer */ 59 | if ( FT_ALLOC ( container, sizeof ( *container ) ) ) 60 | return error; 61 | FT_MEM_SET( container, 0, sizeof(*container) ); 62 | pic_container->base = container; 63 | 64 | /* initialize default modules list and pointers */ 65 | error = ft_create_default_module_classes( library ); 66 | if ( error ) 67 | goto Exit; 68 | 69 | /* initialize pointer table - this is how the module usually expects this data */ 70 | FT_Init_Class_ft_outline_glyph_class(&container->ft_outline_glyph_class); 71 | FT_Init_Class_ft_bitmap_glyph_class(&container->ft_bitmap_glyph_class); 72 | 73 | Exit: 74 | if(error) 75 | ft_base_pic_free(library); 76 | return error; 77 | } 78 | 79 | 80 | #endif /* FT_CONFIG_OPTION_PIC */ 81 | 82 | 83 | /* END */ 84 | -------------------------------------------------------------------------------- /src/base/basepic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* basepic.h */ 4 | /* */ 5 | /* The FreeType position independent code services for base. */ 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 | #ifndef __BASEPIC_H__ 20 | #define __BASEPIC_H__ 21 | 22 | 23 | FT_BEGIN_HEADER 24 | 25 | #include FT_INTERNAL_PIC_H 26 | 27 | #ifndef FT_CONFIG_OPTION_PIC 28 | #define FT_OUTLINE_GLYPH_CLASS_GET &ft_outline_glyph_class 29 | #define FT_BITMAP_GLYPH_CLASS_GET &ft_bitmap_glyph_class 30 | #define FT_DEFAULT_MODULES_GET ft_default_modules 31 | 32 | #else /* FT_CONFIG_OPTION_PIC */ 33 | 34 | #include FT_GLYPH_H 35 | 36 | typedef struct BasePIC_ 37 | { 38 | FT_Module_Class** default_module_classes; 39 | FT_Glyph_Class ft_outline_glyph_class; 40 | FT_Glyph_Class ft_bitmap_glyph_class; 41 | } BasePIC; 42 | 43 | #define GET_PIC(lib) ((BasePIC*)((lib)->pic_container.base)) 44 | #define FT_OUTLINE_GLYPH_CLASS_GET (&GET_PIC(library)->ft_outline_glyph_class) 45 | #define FT_BITMAP_GLYPH_CLASS_GET (&GET_PIC(library)->ft_bitmap_glyph_class) 46 | #define FT_DEFAULT_MODULES_GET (GET_PIC(library)->default_module_classes) 47 | 48 | void 49 | ft_base_pic_free( FT_Library library ); 50 | 51 | FT_Error 52 | ft_base_pic_init( FT_Library library ); 53 | 54 | #endif /* FT_CONFIG_OPTION_PIC */ 55 | /* */ 56 | 57 | FT_END_HEADER 58 | 59 | #endif /* __BASEPIC_H__ */ 60 | 61 | 62 | /* END */ 63 | -------------------------------------------------------------------------------- /src/base/ftbase.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftbase.c */ 4 | /* */ 5 | /* Single object library component (body only). */ 6 | /* */ 7 | /* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 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 | #include 20 | 21 | #define FT_MAKE_OPTION_SINGLE_OBJECT 22 | 23 | #include "ftpic.c" 24 | #include "basepic.c" 25 | #include "ftadvanc.c" 26 | #include "ftcalc.c" 27 | #include "ftdbgmem.c" 28 | #include "ftgloadr.c" 29 | #include "ftobjs.c" 30 | #include "ftoutln.c" 31 | #include "ftrfork.c" 32 | #include "ftsnames.c" 33 | #include "ftstream.c" 34 | #include "fttrigon.c" 35 | #include "ftutil.c" 36 | 37 | #if defined( FT_MACINTOSH ) && !defined ( DARWIN_NO_CARBON ) 38 | #include "ftmac.c" 39 | #endif 40 | 41 | /* END */ 42 | -------------------------------------------------------------------------------- /src/base/ftbase.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftbase.h */ 4 | /* */ 5 | /* The FreeType private functions used in base module (specification). */ 6 | /* */ 7 | /* Copyright 2008, 2010 by */ 8 | /* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __FTBASE_H__ 20 | #define __FTBASE_H__ 21 | 22 | 23 | #include 24 | #include FT_INTERNAL_OBJECTS_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | /* Assume the stream is sfnt-wrapped PS Type1 or sfnt-wrapped CID-keyed */ 31 | /* font, and try to load a face specified by the face_index. */ 32 | FT_LOCAL( FT_Error ) 33 | open_face_PS_from_sfnt_stream( FT_Library library, 34 | FT_Stream stream, 35 | FT_Long face_index, 36 | FT_Int num_params, 37 | FT_Parameter *params, 38 | FT_Face *aface ); 39 | 40 | 41 | /* Create a new FT_Face given a buffer and a driver name. */ 42 | /* From ftmac.c. */ 43 | FT_LOCAL( FT_Error ) 44 | open_face_from_buffer( FT_Library library, 45 | FT_Byte* base, 46 | FT_ULong size, 47 | FT_Long face_index, 48 | const char* driver_name, 49 | FT_Face *aface ); 50 | 51 | 52 | #ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK 53 | /* Mac OS X/Darwin kernel often changes recommended method to access */ 54 | /* the resource fork and older methods makes the kernel issue the */ 55 | /* warning of deprecated method. To calm it down, the methods based */ 56 | /* on Darwin VFS should be grouped and skip the rest methods after */ 57 | /* the case the resource is opened but found to lack a font in it. */ 58 | FT_LOCAL( FT_Bool ) 59 | raccess_rule_by_darwin_vfs( FT_UInt rule_index ); 60 | #endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */ 61 | 62 | 63 | FT_END_HEADER 64 | 65 | #endif /* __FTBASE_H__ */ 66 | 67 | 68 | /* END */ 69 | -------------------------------------------------------------------------------- /src/base/ftpic.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftpic.c */ 4 | /* */ 5 | /* The FreeType position independent code services (body). */ 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 | #include 20 | #include FT_FREETYPE_H 21 | #include FT_INTERNAL_OBJECTS_H 22 | #include "basepic.h" 23 | 24 | #ifdef FT_CONFIG_OPTION_PIC 25 | 26 | /* documentation is in ftpic.h */ 27 | 28 | FT_BASE_DEF( FT_Error ) 29 | ft_pic_container_init( FT_Library library ) 30 | { 31 | FT_PIC_Container* pic_container = &library->pic_container; 32 | FT_Error error = FT_Err_Ok; 33 | 34 | FT_MEM_SET( pic_container, 0, sizeof(*pic_container) ); 35 | 36 | error = ft_base_pic_init( library ); 37 | if(error) 38 | return error; 39 | 40 | return FT_Err_Ok; 41 | } 42 | 43 | 44 | /* Destroy the contents of the container. */ 45 | FT_BASE_DEF( void ) 46 | ft_pic_container_destroy( FT_Library library ) 47 | { 48 | ft_base_pic_free( library ); 49 | } 50 | 51 | #endif /* FT_CONFIG_OPTION_PIC */ 52 | 53 | 54 | /* END */ 55 | -------------------------------------------------------------------------------- /src/base/ftsnames.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftsnames.c */ 4 | /* */ 5 | /* Simple interface to access SFNT name tables (which are used */ 6 | /* to hold font names, copyright info, notices, etc.) (body). */ 7 | /* */ 8 | /* This is _not_ used to retrieve glyph names! */ 9 | /* */ 10 | /* Copyright 1996-2001, 2002, 2009 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 | 22 | #include 23 | #include FT_SFNT_NAMES_H 24 | #include FT_INTERNAL_TRUETYPE_TYPES_H 25 | #include FT_INTERNAL_STREAM_H 26 | 27 | 28 | #ifdef TT_CONFIG_OPTION_SFNT_NAMES 29 | 30 | 31 | /* documentation is in ftsnames.h */ 32 | 33 | FT_EXPORT_DEF( FT_UInt ) 34 | FT_Get_Sfnt_Name_Count( FT_Face face ) 35 | { 36 | return ( face && FT_IS_SFNT( face ) ) ? ((TT_Face)face)->num_names : 0; 37 | } 38 | 39 | 40 | /* documentation is in ftsnames.h */ 41 | 42 | FT_EXPORT_DEF( FT_Error ) 43 | FT_Get_Sfnt_Name( FT_Face face, 44 | FT_UInt idx, 45 | FT_SfntName *aname ) 46 | { 47 | FT_Error error = FT_Err_Invalid_Argument; 48 | 49 | 50 | if ( aname && face && FT_IS_SFNT( face ) ) 51 | { 52 | TT_Face ttface = (TT_Face)face; 53 | 54 | 55 | if ( idx < (FT_UInt)ttface->num_names ) 56 | { 57 | TT_NameEntryRec* entry = ttface->name_table.names + idx; 58 | 59 | 60 | /* load name on demand */ 61 | if ( entry->stringLength > 0 && entry->string == NULL ) 62 | { 63 | FT_Memory memory = face->memory; 64 | FT_Stream stream = face->stream; 65 | 66 | 67 | if ( FT_NEW_ARRAY ( entry->string, entry->stringLength ) || 68 | FT_STREAM_SEEK( entry->stringOffset ) || 69 | FT_STREAM_READ( entry->string, entry->stringLength ) ) 70 | { 71 | FT_FREE( entry->string ); 72 | entry->stringLength = 0; 73 | } 74 | } 75 | 76 | aname->platform_id = entry->platformID; 77 | aname->encoding_id = entry->encodingID; 78 | aname->language_id = entry->languageID; 79 | aname->name_id = entry->nameID; 80 | aname->string = (FT_Byte*)entry->string; 81 | aname->string_len = entry->stringLength; 82 | 83 | error = FT_Err_Ok; 84 | } 85 | } 86 | 87 | return error; 88 | } 89 | 90 | 91 | #endif /* TT_CONFIG_OPTION_SFNT_NAMES */ 92 | 93 | 94 | /* END */ 95 | -------------------------------------------------------------------------------- /src/cff/Jamfile: -------------------------------------------------------------------------------- 1 | # FreeType 2 src/cff Jamfile 2 | # 3 | # Copyright 2001, 2002 by 4 | # David Turner, Robert Wilhelm, and Werner Lemberg. 5 | # 6 | # This file is part of the FreeType project, and may only be used, modified, 7 | # and distributed under the terms of the FreeType project license, 8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 9 | # indicate that you have read the license and understand and accept it 10 | # fully. 11 | 12 | SubDir FT2_TOP $(FT2_SRC_DIR) cff ; 13 | 14 | { 15 | local _sources ; 16 | 17 | if $(FT2_MULTI) 18 | { 19 | _sources = cffdrivr cffgload cffload cffobjs cffparse cffcmap cffpic ; 20 | } 21 | else 22 | { 23 | _sources = cff ; 24 | } 25 | 26 | Library $(FT2_LIB) : $(_sources).c ; 27 | } 28 | 29 | # end of src/cff Jamfile 30 | -------------------------------------------------------------------------------- /src/cff/cff.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* cff.c */ 4 | /* */ 5 | /* FreeType OpenType driver component (body only). */ 6 | /* */ 7 | /* Copyright 1996-2001, 2002 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | #include "cffpic.c" 23 | #include "cffdrivr.c" 24 | #include "cffparse.c" 25 | #include "cffload.c" 26 | #include "cffobjs.c" 27 | #include "cffgload.c" 28 | #include "cffcmap.c" 29 | 30 | /* END */ 31 | -------------------------------------------------------------------------------- /src/cff/cffcmap.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* cffcmap.h */ 4 | /* */ 5 | /* CFF character mapping table (cmap) support (specification). */ 6 | /* */ 7 | /* Copyright 2002, 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 __CFFCMAP_H__ 20 | #define __CFFCMAP_H__ 21 | 22 | #include "cffobjs.h" 23 | 24 | FT_BEGIN_HEADER 25 | 26 | 27 | /*************************************************************************/ 28 | /*************************************************************************/ 29 | /***** *****/ 30 | /***** TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS *****/ 31 | /***** *****/ 32 | /*************************************************************************/ 33 | /*************************************************************************/ 34 | 35 | /* standard (and expert) encoding cmaps */ 36 | typedef struct CFF_CMapStdRec_* CFF_CMapStd; 37 | 38 | typedef struct CFF_CMapStdRec_ 39 | { 40 | FT_CMapRec cmap; 41 | FT_UShort* gids; /* up to 256 elements */ 42 | 43 | } CFF_CMapStdRec; 44 | 45 | 46 | FT_DECLARE_CMAP_CLASS(cff_cmap_encoding_class_rec) 47 | 48 | 49 | /*************************************************************************/ 50 | /*************************************************************************/ 51 | /***** *****/ 52 | /***** CFF SYNTHETIC UNICODE ENCODING CMAP *****/ 53 | /***** *****/ 54 | /*************************************************************************/ 55 | /*************************************************************************/ 56 | 57 | /* unicode (synthetic) cmaps */ 58 | 59 | FT_DECLARE_CMAP_CLASS(cff_cmap_unicode_class_rec) 60 | 61 | 62 | FT_END_HEADER 63 | 64 | #endif /* __CFFCMAP_H__ */ 65 | 66 | 67 | /* END */ 68 | -------------------------------------------------------------------------------- /src/cff/cffdrivr.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* cffdrivr.h */ 4 | /* */ 5 | /* High-level OpenType driver interface (specification). */ 6 | /* */ 7 | /* Copyright 1996-2001, 2002 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __CFFDRIVER_H__ 20 | #define __CFFDRIVER_H__ 21 | 22 | 23 | #include 24 | #include FT_INTERNAL_DRIVER_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_DECLARE_DRIVER( cff_driver_class ) 31 | 32 | 33 | FT_END_HEADER 34 | 35 | #endif /* __CFFDRIVER_H__ */ 36 | 37 | 38 | /* END */ 39 | -------------------------------------------------------------------------------- /src/cff/cfferrs.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* cfferrs.h */ 4 | /* */ 5 | /* CFF error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | /*************************************************************************/ 20 | /* */ 21 | /* This file is used to define the CFF error enumeration constants. */ 22 | /* */ 23 | /*************************************************************************/ 24 | 25 | #ifndef __CFFERRS_H__ 26 | #define __CFFERRS_H__ 27 | 28 | #include FT_MODULE_ERRORS_H 29 | 30 | #undef __FTERRORS_H__ 31 | 32 | #define FT_ERR_PREFIX CFF_Err_ 33 | #define FT_ERR_BASE FT_Mod_Err_CFF 34 | 35 | 36 | #include FT_ERRORS_H 37 | 38 | #endif /* __CFFERRS_H__ */ 39 | 40 | 41 | /* END */ 42 | -------------------------------------------------------------------------------- /src/cff/cffload.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* cffload.h */ 4 | /* */ 5 | /* OpenType & CFF data/program tables loader (specification). */ 6 | /* */ 7 | /* Copyright 1996-2001, 2002, 2003, 2007, 2008, 2010 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 __CFFLOAD_H__ 20 | #define __CFFLOAD_H__ 21 | 22 | 23 | #include 24 | #include "cfftypes.h" 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | FT_LOCAL( FT_UShort ) 30 | cff_get_standard_encoding( FT_UInt charcode ); 31 | 32 | 33 | FT_LOCAL( FT_String* ) 34 | cff_index_get_string( CFF_Font font, 35 | FT_UInt element ); 36 | 37 | FT_LOCAL( FT_String* ) 38 | cff_index_get_sid_string( CFF_Font font, 39 | FT_UInt sid ); 40 | 41 | 42 | FT_LOCAL( FT_Error ) 43 | cff_index_access_element( CFF_Index idx, 44 | FT_UInt element, 45 | FT_Byte** pbytes, 46 | FT_ULong* pbyte_len ); 47 | 48 | FT_LOCAL( void ) 49 | cff_index_forget_element( CFF_Index idx, 50 | FT_Byte** pbytes ); 51 | 52 | FT_LOCAL( FT_String* ) 53 | cff_index_get_name( CFF_Font font, 54 | FT_UInt element ); 55 | 56 | 57 | FT_LOCAL( FT_UInt ) 58 | cff_charset_cid_to_gindex( CFF_Charset charset, 59 | FT_UInt cid ); 60 | 61 | 62 | FT_LOCAL( FT_Error ) 63 | cff_font_load( FT_Library library, 64 | FT_Stream stream, 65 | FT_Int face_index, 66 | CFF_Font font, 67 | FT_Bool pure_cff ); 68 | 69 | FT_LOCAL( void ) 70 | cff_font_done( CFF_Font font ); 71 | 72 | 73 | FT_LOCAL( FT_Byte ) 74 | cff_fd_select_get( CFF_FDSelect fdselect, 75 | FT_UInt glyph_index ); 76 | 77 | 78 | FT_END_HEADER 79 | 80 | #endif /* __CFFLOAD_H__ */ 81 | 82 | 83 | /* END */ 84 | -------------------------------------------------------------------------------- /src/cff/cffparse.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* cffparse.h */ 4 | /* */ 5 | /* CFF token stream parser (specification) */ 6 | /* */ 7 | /* Copyright 1996-2001, 2002, 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 __CFF_PARSE_H__ 20 | #define __CFF_PARSE_H__ 21 | 22 | 23 | #include 24 | #include "cfftypes.h" 25 | #include FT_INTERNAL_OBJECTS_H 26 | 27 | 28 | FT_BEGIN_HEADER 29 | 30 | 31 | #define CFF_MAX_STACK_DEPTH 96 32 | 33 | #define CFF_CODE_TOPDICT 0x1000 34 | #define CFF_CODE_PRIVATE 0x2000 35 | 36 | 37 | typedef struct CFF_ParserRec_ 38 | { 39 | FT_Library library; 40 | FT_Byte* start; 41 | FT_Byte* limit; 42 | FT_Byte* cursor; 43 | 44 | FT_Byte* stack[CFF_MAX_STACK_DEPTH + 1]; 45 | FT_Byte** top; 46 | 47 | FT_UInt object_code; 48 | void* object; 49 | 50 | } CFF_ParserRec, *CFF_Parser; 51 | 52 | 53 | FT_LOCAL( void ) 54 | cff_parser_init( CFF_Parser parser, 55 | FT_UInt code, 56 | void* object, 57 | FT_Library library); 58 | 59 | FT_LOCAL( FT_Error ) 60 | cff_parser_run( CFF_Parser parser, 61 | FT_Byte* start, 62 | FT_Byte* limit ); 63 | 64 | 65 | enum 66 | { 67 | cff_kind_none = 0, 68 | cff_kind_num, 69 | cff_kind_fixed, 70 | cff_kind_fixed_thousand, 71 | cff_kind_string, 72 | cff_kind_bool, 73 | cff_kind_delta, 74 | cff_kind_callback, 75 | 76 | cff_kind_max /* do not remove */ 77 | }; 78 | 79 | 80 | /* now generate handlers for the most simple fields */ 81 | typedef FT_Error (*CFF_Field_Reader)( CFF_Parser parser ); 82 | 83 | typedef struct CFF_Field_Handler_ 84 | { 85 | int kind; 86 | int code; 87 | FT_UInt offset; 88 | FT_Byte size; 89 | CFF_Field_Reader reader; 90 | FT_UInt array_max; 91 | FT_UInt count_offset; 92 | 93 | } CFF_Field_Handler; 94 | 95 | 96 | FT_END_HEADER 97 | 98 | 99 | #endif /* __CFF_PARSE_H__ */ 100 | 101 | 102 | /* END */ 103 | -------------------------------------------------------------------------------- /src/cff/module.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 CFF module definition 3 | # 4 | 5 | 6 | # Copyright 1996-2000, 2006 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | FTMODULE_H_COMMANDS += CFF_DRIVER 17 | 18 | define CFF_DRIVER 19 | $(OPEN_DRIVER) FT_Driver_ClassRec, cff_driver_class $(CLOSE_DRIVER) 20 | $(ECHO_DRIVER)cff $(ECHO_DRIVER_DESC)OpenType fonts with extension *.otf$(ECHO_DRIVER_DONE) 21 | endef 22 | 23 | # EOF 24 | -------------------------------------------------------------------------------- /src/cff/rules.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 OpenType/CFF driver configuration rules 3 | # 4 | 5 | 6 | # Copyright 1996-2000, 2001, 2003 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | # OpenType driver directory 17 | # 18 | CFF_DIR := $(SRC_DIR)/cff 19 | 20 | 21 | CFF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CFF_DIR)) 22 | 23 | 24 | # CFF driver sources (i.e., C files) 25 | # 26 | CFF_DRV_SRC := $(CFF_DIR)/cffobjs.c \ 27 | $(CFF_DIR)/cffload.c \ 28 | $(CFF_DIR)/cffgload.c \ 29 | $(CFF_DIR)/cffparse.c \ 30 | $(CFF_DIR)/cffcmap.c \ 31 | $(CFF_DIR)/cffdrivr.c 32 | 33 | # CFF driver headers 34 | # 35 | CFF_DRV_H := $(CFF_DRV_SRC:%.c=%.h) \ 36 | $(CFF_DIR)/cfftoken.h \ 37 | $(CFF_DIR)/cfftypes.h \ 38 | $(CFF_DIR)/cfferrs.h 39 | 40 | 41 | # CFF driver object(s) 42 | # 43 | # CFF_DRV_OBJ_M is used during `multi' builds 44 | # CFF_DRV_OBJ_S is used during `single' builds 45 | # 46 | CFF_DRV_OBJ_M := $(CFF_DRV_SRC:$(CFF_DIR)/%.c=$(OBJ_DIR)/%.$O) 47 | CFF_DRV_OBJ_S := $(OBJ_DIR)/cff.$O 48 | 49 | # CFF driver source file for single build 50 | # 51 | CFF_DRV_SRC_S := $(CFF_DIR)/cff.c 52 | 53 | 54 | # CFF driver - single object 55 | # 56 | $(CFF_DRV_OBJ_S): $(CFF_DRV_SRC_S) $(CFF_DRV_SRC) $(FREETYPE_H) $(CFF_DRV_H) 57 | $(CFF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(CFF_DRV_SRC_S)) 58 | 59 | 60 | # CFF driver - multiple objects 61 | # 62 | $(OBJ_DIR)/%.$O: $(CFF_DIR)/%.c $(FREETYPE_H) $(CFF_DRV_H) 63 | $(CFF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) 64 | 65 | 66 | # update main driver object lists 67 | # 68 | DRV_OBJS_S += $(CFF_DRV_OBJ_S) 69 | DRV_OBJS_M += $(CFF_DRV_OBJ_M) 70 | 71 | 72 | # EOF 73 | -------------------------------------------------------------------------------- /src/pshinter/Jamfile: -------------------------------------------------------------------------------- 1 | # FreeType 2 src/pshinter Jamfile 2 | # 3 | # Copyright 2001, 2003 by 4 | # David Turner, Robert Wilhelm, and Werner Lemberg. 5 | # 6 | # This file is part of the FreeType project, and may only be used, modified, 7 | # and distributed under the terms of the FreeType project license, 8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 9 | # indicate that you have read the license and understand and accept it 10 | # fully. 11 | 12 | SubDir FT2_TOP $(FT2_SRC_DIR) pshinter ; 13 | 14 | { 15 | local _sources ; 16 | 17 | if $(FT2_MULTI) 18 | { 19 | _sources = pshrec pshglob pshalgo pshmod pshpic ; 20 | } 21 | else 22 | { 23 | _sources = pshinter ; 24 | } 25 | 26 | Library $(FT2_LIB) : $(_sources).c ; 27 | } 28 | 29 | # end of src/pshinter Jamfile 30 | -------------------------------------------------------------------------------- /src/pshinter/module.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 PSHinter module definition 3 | # 4 | 5 | 6 | # Copyright 1996-2001, 2006 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | FTMODULE_H_COMMANDS += PSHINTER_MODULE 17 | 18 | define PSHINTER_MODULE 19 | $(OPEN_DRIVER) FT_Module_Class, pshinter_module_class $(CLOSE_DRIVER) 20 | $(ECHO_DRIVER)pshinter $(ECHO_DRIVER_DESC)Postscript hinter module$(ECHO_DRIVER_DONE) 21 | endef 22 | 23 | # EOF 24 | -------------------------------------------------------------------------------- /src/pshinter/pshinter.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pshinter.c */ 4 | /* */ 5 | /* FreeType PostScript Hinting module */ 6 | /* */ 7 | /* Copyright 2001, 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 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | #include "pshpic.c" 23 | #include "pshrec.c" 24 | #include "pshglob.c" 25 | #include "pshalgo.c" 26 | #include "pshmod.c" 27 | 28 | 29 | /* END */ 30 | -------------------------------------------------------------------------------- /src/pshinter/pshmod.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pshmod.h */ 4 | /* */ 5 | /* PostScript hinter module interface (specification). */ 6 | /* */ 7 | /* Copyright 2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __PSHMOD_H__ 20 | #define __PSHMOD_H__ 21 | 22 | 23 | #include 24 | #include FT_MODULE_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_DECLARE_MODULE( pshinter_module_class ) 31 | 32 | 33 | FT_END_HEADER 34 | 35 | 36 | #endif /* __PSHMOD_H__ */ 37 | 38 | 39 | /* END */ 40 | -------------------------------------------------------------------------------- /src/pshinter/pshnterr.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pshnterr.h */ 4 | /* */ 5 | /* PS Hinter error codes (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 | /*************************************************************************/ 20 | /* */ 21 | /* This file is used to define the PSHinter error enumeration constants. */ 22 | /* */ 23 | /*************************************************************************/ 24 | 25 | #ifndef __PSHNTERR_H__ 26 | #define __PSHNTERR_H__ 27 | 28 | #include FT_MODULE_ERRORS_H 29 | 30 | #undef __FTERRORS_H__ 31 | 32 | #define FT_ERR_PREFIX PSH_Err_ 33 | #define FT_ERR_BASE FT_Mod_Err_PShinter 34 | 35 | #include FT_ERRORS_H 36 | 37 | #endif /* __PSHNTERR_H__ */ 38 | 39 | 40 | /* END */ 41 | -------------------------------------------------------------------------------- /src/pshinter/pshpic.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pshpic.c */ 4 | /* */ 5 | /* The FreeType position independent code services for pshinter module. */ 6 | /* */ 7 | /* Copyright 2009, 2010 by */ 8 | /* Oran Agra and Mickey Gabel. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #include 20 | #include FT_FREETYPE_H 21 | #include FT_INTERNAL_OBJECTS_H 22 | #include "pshpic.h" 23 | 24 | #ifdef FT_CONFIG_OPTION_PIC 25 | 26 | /* forward declaration of PIC init functions from pshmod.c */ 27 | void FT_Init_Class_pshinter_interface( FT_Library, PSHinter_Interface*); 28 | 29 | void 30 | pshinter_module_class_pic_free( FT_Library library ) 31 | { 32 | FT_PIC_Container* pic_container = &library->pic_container; 33 | FT_Memory memory = library->memory; 34 | if ( pic_container->pshinter ) 35 | { 36 | FT_FREE( pic_container->pshinter ); 37 | pic_container->pshinter = NULL; 38 | } 39 | } 40 | 41 | 42 | FT_Error 43 | pshinter_module_class_pic_init( FT_Library library ) 44 | { 45 | FT_PIC_Container* pic_container = &library->pic_container; 46 | FT_Error error = PSH_Err_Ok; 47 | PSHinterPIC* container; 48 | FT_Memory memory = library->memory; 49 | 50 | 51 | /* allocate pointer, clear and set global container pointer */ 52 | if ( FT_ALLOC ( container, sizeof ( *container ) ) ) 53 | return error; 54 | FT_MEM_SET( container, 0, sizeof ( *container ) ); 55 | pic_container->pshinter = container; 56 | 57 | /* add call to initialization function when you add new scripts */ 58 | FT_Init_Class_pshinter_interface(library, &container->pshinter_interface); 59 | 60 | /*Exit:*/ 61 | if(error) 62 | pshinter_module_class_pic_free(library); 63 | return error; 64 | } 65 | 66 | 67 | #endif /* FT_CONFIG_OPTION_PIC */ 68 | 69 | /* END */ 70 | -------------------------------------------------------------------------------- /src/pshinter/pshpic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pshpic.h */ 4 | /* */ 5 | /* The FreeType position independent code services for pshinter module. */ 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 | #ifndef __PSHPIC_H__ 20 | #define __PSHPIC_H__ 21 | 22 | 23 | FT_BEGIN_HEADER 24 | 25 | #include FT_INTERNAL_PIC_H 26 | 27 | #ifndef FT_CONFIG_OPTION_PIC 28 | 29 | #define FTPSHINTER_INTERFACE_GET pshinter_interface 30 | 31 | #else /* FT_CONFIG_OPTION_PIC */ 32 | 33 | #include FT_INTERNAL_POSTSCRIPT_HINTS_H 34 | 35 | typedef struct PSHinterPIC_ 36 | { 37 | PSHinter_Interface pshinter_interface; 38 | } PSHinterPIC; 39 | 40 | #define GET_PIC(lib) ((PSHinterPIC*)((lib)->pic_container.autofit)) 41 | #define FTPSHINTER_INTERFACE_GET (GET_PIC(library)->pshinter_interface) 42 | 43 | 44 | #endif /* FT_CONFIG_OPTION_PIC */ 45 | 46 | /* */ 47 | 48 | FT_END_HEADER 49 | 50 | #endif /* __PSHPIC_H__ */ 51 | 52 | 53 | /* END */ 54 | -------------------------------------------------------------------------------- /src/pshinter/rules.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 PSHinter driver configuration rules 3 | # 4 | 5 | 6 | # Copyright 2001, 2003 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | # PSHINTER driver directory 17 | # 18 | PSHINTER_DIR := $(SRC_DIR)/pshinter 19 | 20 | 21 | # compilation flags for the driver 22 | # 23 | PSHINTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSHINTER_DIR)) 24 | 25 | 26 | # PSHINTER driver sources (i.e., C files) 27 | # 28 | PSHINTER_DRV_SRC := $(PSHINTER_DIR)/pshrec.c \ 29 | $(PSHINTER_DIR)/pshglob.c \ 30 | $(PSHINTER_DIR)/pshmod.c \ 31 | $(PSHINTER_DIR)/pshalgo.c 32 | 33 | 34 | # PSHINTER driver headers 35 | # 36 | PSHINTER_DRV_H := $(PSHINTER_DRV_SRC:%c=%h) \ 37 | $(PSHINTER_DIR)/pshnterr.h 38 | 39 | 40 | # PSHINTER driver object(s) 41 | # 42 | # PSHINTER_DRV_OBJ_M is used during `multi' builds. 43 | # PSHINTER_DRV_OBJ_S is used during `single' builds. 44 | # 45 | PSHINTER_DRV_OBJ_M := $(PSHINTER_DRV_SRC:$(PSHINTER_DIR)/%.c=$(OBJ_DIR)/%.$O) 46 | PSHINTER_DRV_OBJ_S := $(OBJ_DIR)/pshinter.$O 47 | 48 | # PSHINTER driver source file for single build 49 | # 50 | PSHINTER_DRV_SRC_S := $(PSHINTER_DIR)/pshinter.c 51 | 52 | 53 | # PSHINTER driver - single object 54 | # 55 | $(PSHINTER_DRV_OBJ_S): $(PSHINTER_DRV_SRC_S) $(PSHINTER_DRV_SRC) \ 56 | $(FREETYPE_H) $(PSHINTER_DRV_H) 57 | $(PSHINTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSHINTER_DRV_SRC_S)) 58 | 59 | 60 | # PSHINTER driver - multiple objects 61 | # 62 | $(OBJ_DIR)/%.$O: $(PSHINTER_DIR)/%.c $(FREETYPE_H) $(PSHINTER_DRV_H) 63 | $(PSHINTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) 64 | 65 | 66 | # update main driver object lists 67 | # 68 | DRV_OBJS_S += $(PSHINTER_DRV_OBJ_S) 69 | DRV_OBJS_M += $(PSHINTER_DRV_OBJ_M) 70 | 71 | 72 | # EOF 73 | -------------------------------------------------------------------------------- /src/psnames/Jamfile: -------------------------------------------------------------------------------- 1 | # FreeType 2 src/psnames Jamfile 2 | # 3 | # Copyright 2001 by 4 | # David Turner, Robert Wilhelm, and Werner Lemberg. 5 | # 6 | # This file is part of the FreeType project, and may only be used, modified, 7 | # and distributed under the terms of the FreeType project license, 8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 9 | # indicate that you have read the license and understand and accept it 10 | # fully. 11 | 12 | SubDir FT2_TOP $(FT2_SRC_DIR) psnames ; 13 | 14 | { 15 | local _sources ; 16 | 17 | if $(FT2_MULTI) 18 | { 19 | _sources = psmodule pspic ; 20 | } 21 | else 22 | { 23 | _sources = psnames ; 24 | } 25 | 26 | Library $(FT2_LIB) : $(_sources).c ; 27 | } 28 | 29 | # end of src/psnames Jamfile 30 | -------------------------------------------------------------------------------- /src/psnames/module.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 PSnames module definition 3 | # 4 | 5 | 6 | # Copyright 1996-2000, 2006 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | FTMODULE_H_COMMANDS += PSNAMES_MODULE 17 | 18 | define PSNAMES_MODULE 19 | $(OPEN_DRIVER) FT_Module_Class, psnames_module_class $(CLOSE_DRIVER) 20 | $(ECHO_DRIVER)psnames $(ECHO_DRIVER_DESC)Postscript & Unicode Glyph name handling$(ECHO_DRIVER_DONE) 21 | endef 22 | 23 | # EOF 24 | -------------------------------------------------------------------------------- /src/psnames/psmodule.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* psmodule.h */ 4 | /* */ 5 | /* High-level PSNames module interface (specification). */ 6 | /* */ 7 | /* Copyright 1996-2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __PSMODULE_H__ 20 | #define __PSMODULE_H__ 21 | 22 | 23 | #include 24 | #include FT_MODULE_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_DECLARE_MODULE( psnames_module_class ) 31 | 32 | 33 | FT_END_HEADER 34 | 35 | #endif /* __PSMODULE_H__ */ 36 | 37 | 38 | /* END */ 39 | -------------------------------------------------------------------------------- /src/psnames/psnamerr.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* psnamerr.h */ 4 | /* */ 5 | /* PS names module error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | /*************************************************************************/ 20 | /* */ 21 | /* This file is used to define the PS names module error enumeration */ 22 | /* constants. */ 23 | /* */ 24 | /*************************************************************************/ 25 | 26 | #ifndef __PSNAMERR_H__ 27 | #define __PSNAMERR_H__ 28 | 29 | #include FT_MODULE_ERRORS_H 30 | 31 | #undef __FTERRORS_H__ 32 | 33 | #define FT_ERR_PREFIX PSnames_Err_ 34 | #define FT_ERR_BASE FT_Mod_Err_PSnames 35 | 36 | #include FT_ERRORS_H 37 | 38 | #endif /* __PSNAMERR_H__ */ 39 | 40 | 41 | /* END */ 42 | -------------------------------------------------------------------------------- /src/psnames/psnames.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* psnames.c */ 4 | /* */ 5 | /* FreeType PSNames module component (body only). */ 6 | /* */ 7 | /* Copyright 1996-2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | #include "pspic.c" 23 | #include "psmodule.c" 24 | 25 | 26 | /* END */ 27 | -------------------------------------------------------------------------------- /src/psnames/pspic.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pspic.c */ 4 | /* */ 5 | /* The FreeType position independent code services for psnames module. */ 6 | /* */ 7 | /* Copyright 2009, 2010 by */ 8 | /* Oran Agra and Mickey Gabel. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #include 20 | #include FT_FREETYPE_H 21 | #include FT_INTERNAL_OBJECTS_H 22 | #include "pspic.h" 23 | 24 | #ifdef FT_CONFIG_OPTION_PIC 25 | 26 | /* forward declaration of PIC init functions from psmodule.c */ 27 | FT_Error FT_Create_Class_pscmaps_services( FT_Library, FT_ServiceDescRec**); 28 | void FT_Destroy_Class_pscmaps_services( FT_Library, FT_ServiceDescRec*); 29 | void FT_Init_Class_pscmaps_interface( FT_Library, FT_Service_PsCMapsRec*); 30 | 31 | void 32 | psnames_module_class_pic_free( FT_Library library ) 33 | { 34 | FT_PIC_Container* pic_container = &library->pic_container; 35 | FT_Memory memory = library->memory; 36 | if ( pic_container->psnames ) 37 | { 38 | PSModulePIC* container = (PSModulePIC*)pic_container->psnames; 39 | if(container->pscmaps_services) 40 | FT_Destroy_Class_pscmaps_services(library, container->pscmaps_services); 41 | container->pscmaps_services = NULL; 42 | FT_FREE( container ); 43 | pic_container->psnames = NULL; 44 | } 45 | } 46 | 47 | 48 | FT_Error 49 | psnames_module_class_pic_init( FT_Library library ) 50 | { 51 | FT_PIC_Container* pic_container = &library->pic_container; 52 | FT_Error error = PSnames_Err_Ok; 53 | PSModulePIC* container; 54 | FT_Memory memory = library->memory; 55 | 56 | 57 | /* allocate pointer, clear and set global container pointer */ 58 | if ( FT_ALLOC ( container, sizeof ( *container ) ) ) 59 | return error; 60 | FT_MEM_SET( container, 0, sizeof(*container) ); 61 | pic_container->psnames = container; 62 | 63 | /* initialize pointer table - this is how the module usually expects this data */ 64 | error = FT_Create_Class_pscmaps_services(library, &container->pscmaps_services); 65 | if(error) 66 | goto Exit; 67 | FT_Init_Class_pscmaps_interface(library, &container->pscmaps_interface); 68 | 69 | Exit: 70 | if(error) 71 | psnames_module_class_pic_free(library); 72 | return error; 73 | } 74 | 75 | 76 | #endif /* FT_CONFIG_OPTION_PIC */ 77 | 78 | 79 | /* END */ 80 | -------------------------------------------------------------------------------- /src/psnames/pspic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* pspic.h */ 4 | /* */ 5 | /* The FreeType position independent code services for psnames module. */ 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 | #ifndef __PSPIC_H__ 20 | #define __PSPIC_H__ 21 | 22 | 23 | FT_BEGIN_HEADER 24 | 25 | #include FT_INTERNAL_PIC_H 26 | 27 | #ifndef FT_CONFIG_OPTION_PIC 28 | #define FT_PSCMAPS_SERVICES_GET pscmaps_services 29 | #define FT_PSCMAPS_INTERFACE_GET pscmaps_interface 30 | 31 | #else /* FT_CONFIG_OPTION_PIC */ 32 | 33 | #include FT_SERVICE_POSTSCRIPT_CMAPS_H 34 | 35 | typedef struct PSModulePIC_ 36 | { 37 | FT_ServiceDescRec* pscmaps_services; 38 | FT_Service_PsCMapsRec pscmaps_interface; 39 | } PSModulePIC; 40 | 41 | #define GET_PIC(lib) ((PSModulePIC*)((lib)->pic_container.psnames)) 42 | #define FT_PSCMAPS_SERVICES_GET (GET_PIC(library)->pscmaps_services) 43 | #define FT_PSCMAPS_INTERFACE_GET (GET_PIC(library)->pscmaps_interface) 44 | 45 | #endif /* FT_CONFIG_OPTION_PIC */ 46 | 47 | /* */ 48 | 49 | FT_END_HEADER 50 | 51 | #endif /* __PSPIC_H__ */ 52 | 53 | 54 | /* END */ 55 | -------------------------------------------------------------------------------- /src/psnames/rules.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 PSNames driver configuration rules 3 | # 4 | 5 | 6 | # Copyright 1996-2000, 2001, 2003 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | # PSNames driver directory 17 | # 18 | PSNAMES_DIR := $(SRC_DIR)/psnames 19 | 20 | 21 | # compilation flags for the driver 22 | # 23 | PSNAMES_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR)) 24 | 25 | 26 | # PSNames driver sources (i.e., C files) 27 | # 28 | PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c 29 | 30 | 31 | # PSNames driver headers 32 | # 33 | PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \ 34 | $(PSNAMES_DIR)/pstables.h \ 35 | $(PSNAMES_DIR)/psnamerr.h 36 | 37 | 38 | # PSNames driver object(s) 39 | # 40 | # PSNAMES_DRV_OBJ_M is used during `multi' builds 41 | # PSNAMES_DRV_OBJ_S is used during `single' builds 42 | # 43 | PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR)/%.c=$(OBJ_DIR)/%.$O) 44 | PSNAMES_DRV_OBJ_S := $(OBJ_DIR)/psnames.$O 45 | 46 | # PSNames driver source file for single build 47 | # 48 | PSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psmodule.c 49 | 50 | 51 | # PSNames driver - single object 52 | # 53 | $(PSNAMES_DRV_OBJ_S): $(PSNAMES_DRV_SRC_S) $(PSNAMES_DRV_SRC) \ 54 | $(FREETYPE_H) $(PSNAMES_DRV_H) 55 | $(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSNAMES_DRV_SRC_S)) 56 | 57 | 58 | # PSNames driver - multiple objects 59 | # 60 | $(OBJ_DIR)/%.$O: $(PSNAMES_DIR)/%.c $(FREETYPE_H) $(PSNAMES_DRV_H) 61 | $(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) 62 | 63 | 64 | # update main driver object lists 65 | # 66 | DRV_OBJS_S += $(PSNAMES_DRV_OBJ_S) 67 | DRV_OBJS_M += $(PSNAMES_DRV_OBJ_M) 68 | 69 | 70 | # EOF 71 | -------------------------------------------------------------------------------- /src/raster/Jamfile: -------------------------------------------------------------------------------- 1 | # FreeType 2 src/raster Jamfile 2 | # 3 | # Copyright 2001 by 4 | # David Turner, Robert Wilhelm, and Werner Lemberg. 5 | # 6 | # This file is part of the FreeType project, and may only be used, modified, 7 | # and distributed under the terms of the FreeType project license, 8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 9 | # indicate that you have read the license and understand and accept it 10 | # fully. 11 | 12 | SubDir FT2_TOP $(FT2_SRC_DIR) raster ; 13 | 14 | { 15 | local _sources ; 16 | 17 | if $(FT2_MULTI) 18 | { 19 | _sources = ftraster ftrend1 rastpic ; 20 | } 21 | else 22 | { 23 | _sources = raster ; 24 | } 25 | 26 | Library $(FT2_LIB) : $(_sources).c ; 27 | } 28 | 29 | # end of src/raster Jamfile 30 | -------------------------------------------------------------------------------- /src/raster/ftraster.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftraster.h */ 4 | /* */ 5 | /* The FreeType glyph rasterizer (specification). */ 6 | /* */ 7 | /* Copyright 1996-2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used */ 11 | /* modified and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __FTRASTER_H__ 20 | #define __FTRASTER_H__ 21 | 22 | 23 | #include 24 | #include FT_CONFIG_CONFIG_H 25 | #include FT_IMAGE_H 26 | 27 | 28 | FT_BEGIN_HEADER 29 | 30 | 31 | /*************************************************************************/ 32 | /* */ 33 | /* Uncomment the following line if you are using ftraster.c as a */ 34 | /* standalone module, fully independent of FreeType. */ 35 | /* */ 36 | /* #define _STANDALONE_ */ 37 | 38 | FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_standard_raster; 39 | 40 | 41 | FT_END_HEADER 42 | 43 | #endif /* __FTRASTER_H__ */ 44 | 45 | 46 | /* END */ 47 | -------------------------------------------------------------------------------- /src/raster/ftrend1.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftrend1.h */ 4 | /* */ 5 | /* The FreeType glyph rasterizer interface (specification). */ 6 | /* */ 7 | /* Copyright 1996-2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __FTREND1_H__ 20 | #define __FTREND1_H__ 21 | 22 | 23 | #include 24 | #include FT_RENDER_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_DECLARE_RENDERER( ft_raster1_renderer_class ) 31 | 32 | /* this renderer is _NOT_ part of the default modules, you'll need */ 33 | /* to register it by hand in your application. It should only be */ 34 | /* used for backwards-compatibility with FT 1.x anyway. */ 35 | /* */ 36 | FT_DECLARE_RENDERER( ft_raster5_renderer_class ) 37 | 38 | 39 | FT_END_HEADER 40 | 41 | #endif /* __FTREND1_H__ */ 42 | 43 | 44 | /* END */ 45 | -------------------------------------------------------------------------------- /src/raster/module.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 renderer module definition 3 | # 4 | 5 | 6 | # Copyright 1996-2000, 2006 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | FTMODULE_H_COMMANDS += RASTER_MODULE 17 | 18 | define RASTER_MODULE 19 | $(OPEN_DRIVER) FT_Renderer_Class, ft_raster1_renderer_class $(CLOSE_DRIVER) 20 | $(ECHO_DRIVER)raster $(ECHO_DRIVER_DESC)monochrome bitmap renderer$(ECHO_DRIVER_DONE) 21 | endef 22 | 23 | # EOF 24 | -------------------------------------------------------------------------------- /src/raster/raster.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* raster.c */ 4 | /* */ 5 | /* FreeType monochrome rasterer module component (body only). */ 6 | /* */ 7 | /* Copyright 1996-2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | #include "rastpic.c" 23 | #include "ftraster.c" 24 | #include "ftrend1.c" 25 | 26 | 27 | /* END */ 28 | -------------------------------------------------------------------------------- /src/raster/rasterrs.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* rasterrs.h */ 4 | /* */ 5 | /* monochrome renderer error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | /*************************************************************************/ 20 | /* */ 21 | /* This file is used to define the monochrome renderer error enumeration */ 22 | /* constants. */ 23 | /* */ 24 | /*************************************************************************/ 25 | 26 | #ifndef __RASTERRS_H__ 27 | #define __RASTERRS_H__ 28 | 29 | #include FT_MODULE_ERRORS_H 30 | 31 | #undef __FTERRORS_H__ 32 | 33 | #define FT_ERR_PREFIX Raster_Err_ 34 | #define FT_ERR_BASE FT_Mod_Err_Raster 35 | 36 | #include FT_ERRORS_H 37 | 38 | #endif /* __RASTERRS_H__ */ 39 | 40 | 41 | /* END */ 42 | -------------------------------------------------------------------------------- /src/raster/rastpic.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* rastpic.c */ 4 | /* */ 5 | /* The FreeType position independent code services for raster module. */ 6 | /* */ 7 | /* Copyright 2009, 2010 by */ 8 | /* Oran Agra and Mickey Gabel. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #include 20 | #include FT_FREETYPE_H 21 | #include FT_INTERNAL_OBJECTS_H 22 | #include "rastpic.h" 23 | 24 | #ifdef FT_CONFIG_OPTION_PIC 25 | 26 | /* forward declaration of PIC init functions from ftraster.c */ 27 | void FT_Init_Class_ft_standard_raster(FT_Raster_Funcs*); 28 | 29 | void 30 | ft_raster1_renderer_class_pic_free( FT_Library library ) 31 | { 32 | FT_PIC_Container* pic_container = &library->pic_container; 33 | FT_Memory memory = library->memory; 34 | if ( pic_container->raster ) 35 | { 36 | RasterPIC* container = (RasterPIC*)pic_container->raster; 37 | if(--container->ref_count) 38 | return; 39 | FT_FREE( container ); 40 | pic_container->raster = NULL; 41 | } 42 | } 43 | 44 | 45 | FT_Error 46 | ft_raster1_renderer_class_pic_init( FT_Library library ) 47 | { 48 | FT_PIC_Container* pic_container = &library->pic_container; 49 | FT_Error error = Raster_Err_Ok; 50 | RasterPIC* container; 51 | FT_Memory memory = library->memory; 52 | 53 | 54 | /* since this function also serve raster5 renderer, 55 | it implements reference counting */ 56 | if ( pic_container->raster ) 57 | { 58 | ((RasterPIC*)pic_container->raster)->ref_count++; 59 | return error; 60 | } 61 | 62 | /* allocate pointer, clear and set global container pointer */ 63 | if ( FT_ALLOC ( container, sizeof ( *container ) ) ) 64 | return error; 65 | FT_MEM_SET( container, 0, sizeof(*container) ); 66 | pic_container->raster = container; 67 | container->ref_count = 1; 68 | 69 | /* initialize pointer table - this is how the module usually expects this data */ 70 | FT_Init_Class_ft_standard_raster(&container->ft_standard_raster); 71 | /*Exit:*/ 72 | if(error) 73 | ft_raster1_renderer_class_pic_free(library); 74 | return error; 75 | } 76 | 77 | /* re-route these init and free functions to the above functions */ 78 | FT_Error ft_raster5_renderer_class_pic_init(FT_Library library) 79 | { 80 | return ft_raster1_renderer_class_pic_init(library); 81 | } 82 | void ft_raster5_renderer_class_pic_free(FT_Library library) 83 | { 84 | ft_raster1_renderer_class_pic_free(library); 85 | } 86 | 87 | #endif /* FT_CONFIG_OPTION_PIC */ 88 | 89 | 90 | /* END */ 91 | -------------------------------------------------------------------------------- /src/raster/rastpic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* rastpic.h */ 4 | /* */ 5 | /* The FreeType position independent code services for raster module. */ 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 | #ifndef __RASTPIC_H__ 20 | #define __RASTPIC_H__ 21 | 22 | 23 | FT_BEGIN_HEADER 24 | 25 | #include FT_INTERNAL_PIC_H 26 | 27 | #ifndef FT_CONFIG_OPTION_PIC 28 | #define FT_STANDARD_RASTER_GET ft_standard_raster 29 | 30 | #else /* FT_CONFIG_OPTION_PIC */ 31 | 32 | typedef struct RasterPIC_ 33 | { 34 | int ref_count; 35 | FT_Raster_Funcs ft_standard_raster; 36 | } RasterPIC; 37 | 38 | #define GET_PIC(lib) ((RasterPIC*)((lib)->pic_container.raster)) 39 | #define FT_STANDARD_RASTER_GET (GET_PIC(library)->ft_standard_raster) 40 | 41 | #endif /* FT_CONFIG_OPTION_PIC */ 42 | 43 | /* */ 44 | 45 | FT_END_HEADER 46 | 47 | #endif /* __RASTPIC_H__ */ 48 | 49 | 50 | /* END */ 51 | -------------------------------------------------------------------------------- /src/raster/rules.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 renderer module build rules 3 | # 4 | 5 | 6 | # Copyright 1996-2000, 2001, 2003, 2008, 2009 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | # raster driver directory 17 | # 18 | RASTER_DIR := $(SRC_DIR)/raster 19 | 20 | # compilation flags for the driver 21 | # 22 | RASTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(RASTER_DIR)) 23 | 24 | 25 | # raster driver sources (i.e., C files) 26 | # 27 | RASTER_DRV_SRC := $(RASTER_DIR)/ftraster.c \ 28 | $(RASTER_DIR)/ftrend1.c 29 | 30 | 31 | # raster driver headers 32 | # 33 | RASTER_DRV_H := $(RASTER_DRV_SRC:%.c=%.h) \ 34 | $(RASTER_DIR)/rasterrs.h 35 | 36 | 37 | # raster driver object(s) 38 | # 39 | # RASTER_DRV_OBJ_M is used during `multi' builds. 40 | # RASTER_DRV_OBJ_S is used during `single' builds. 41 | # 42 | RASTER_DRV_OBJ_M := $(RASTER_DRV_SRC:$(RASTER_DIR)/%.c=$(OBJ_DIR)/%.$O) 43 | RASTER_DRV_OBJ_S := $(OBJ_DIR)/raster.$O 44 | 45 | # raster driver source file for single build 46 | # 47 | RASTER_DRV_SRC_S := $(RASTER_DIR)/raster.c 48 | 49 | 50 | # raster driver - single object 51 | # 52 | $(RASTER_DRV_OBJ_S): $(RASTER_DRV_SRC_S) $(RASTER_DRV_SRC) \ 53 | $(FREETYPE_H) $(RASTER_DRV_H) 54 | $(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(RASTER_DRV_SRC_S)) 55 | 56 | 57 | # raster driver - multiple objects 58 | # 59 | $(OBJ_DIR)/%.$O: $(RASTER_DIR)/%.c $(FREETYPE_H) $(RASTER_DRV_H) 60 | $(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) 61 | 62 | 63 | # update main driver object lists 64 | # 65 | DRV_OBJS_S += $(RASTER_DRV_OBJ_S) 66 | DRV_OBJS_M += $(RASTER_DRV_OBJ_M) 67 | 68 | 69 | # EOF 70 | -------------------------------------------------------------------------------- /src/sfnt/Jamfile: -------------------------------------------------------------------------------- 1 | # FreeType 2 src/sfnt Jamfile 2 | # 3 | # Copyright 2001, 2002, 2004, 2005 by 4 | # David Turner, Robert Wilhelm, and Werner Lemberg. 5 | # 6 | # This file is part of the FreeType project, and may only be used, modified, 7 | # and distributed under the terms of the FreeType project license, 8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 9 | # indicate that you have read the license and understand and accept it 10 | # fully. 11 | 12 | SubDir FT2_TOP $(FT2_SRC_DIR) sfnt ; 13 | 14 | { 15 | local _sources ; 16 | 17 | if $(FT2_MULTI) 18 | { 19 | _sources = sfobjs sfdriver ttcmap ttmtx ttpost ttload ttsbit ttkern ttbdf sfntpic ; 20 | } 21 | else 22 | { 23 | _sources = sfnt ; 24 | } 25 | 26 | Library $(FT2_LIB) : $(_sources).c ; 27 | } 28 | 29 | # end of src/sfnt Jamfile 30 | -------------------------------------------------------------------------------- /src/sfnt/module.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 SFNT module definition 3 | # 4 | 5 | 6 | # Copyright 1996-2000, 2006 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | FTMODULE_H_COMMANDS += SFNT_MODULE 17 | 18 | define SFNT_MODULE 19 | $(OPEN_DRIVER) FT_Module_Class, sfnt_module_class $(CLOSE_DRIVER) 20 | $(ECHO_DRIVER)sfnt $(ECHO_DRIVER_DESC)helper module for TrueType & OpenType formats$(ECHO_DRIVER_DONE) 21 | endef 22 | 23 | # EOF 24 | -------------------------------------------------------------------------------- /src/sfnt/rules.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 SFNT driver configuration rules 3 | # 4 | 5 | 6 | # Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | # SFNT driver directory 17 | # 18 | SFNT_DIR := $(SRC_DIR)/sfnt 19 | 20 | 21 | # compilation flags for the driver 22 | # 23 | SFNT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SFNT_DIR)) 24 | 25 | 26 | # SFNT driver sources (i.e., C files) 27 | # 28 | SFNT_DRV_SRC := $(SFNT_DIR)/ttload.c \ 29 | $(SFNT_DIR)/ttmtx.c \ 30 | $(SFNT_DIR)/ttcmap.c \ 31 | $(SFNT_DIR)/ttsbit.c \ 32 | $(SFNT_DIR)/ttpost.c \ 33 | $(SFNT_DIR)/ttkern.c \ 34 | $(SFNT_DIR)/ttbdf.c \ 35 | $(SFNT_DIR)/sfobjs.c \ 36 | $(SFNT_DIR)/sfdriver.c 37 | 38 | # SFNT driver headers 39 | # 40 | # Note that ttsbit0.c gets #included by ttsbit.c. 41 | # 42 | SFNT_DRV_H := $(SFNT_DRV_SRC:%c=%h) \ 43 | $(SFNT_DIR)/sferrors.h \ 44 | $(SFNT_DIR)/ttsbit0.c 45 | 46 | 47 | # SFNT driver object(s) 48 | # 49 | # SFNT_DRV_OBJ_M is used during `multi' builds. 50 | # SFNT_DRV_OBJ_S is used during `single' builds. 51 | # 52 | SFNT_DRV_OBJ_M := $(SFNT_DRV_SRC:$(SFNT_DIR)/%.c=$(OBJ_DIR)/%.$O) 53 | SFNT_DRV_OBJ_S := $(OBJ_DIR)/sfnt.$O 54 | 55 | # SFNT driver source file for single build 56 | # 57 | SFNT_DRV_SRC_S := $(SFNT_DIR)/sfnt.c 58 | 59 | 60 | # SFNT driver - single object 61 | # 62 | $(SFNT_DRV_OBJ_S): $(SFNT_DRV_SRC_S) $(SFNT_DRV_SRC) \ 63 | $(FREETYPE_H) $(SFNT_DRV_H) 64 | $(SFNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(SFNT_DRV_SRC_S)) 65 | 66 | 67 | # SFNT driver - multiple objects 68 | # 69 | $(OBJ_DIR)/%.$O: $(SFNT_DIR)/%.c $(FREETYPE_H) $(SFNT_DRV_H) 70 | $(SFNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) 71 | 72 | 73 | # update main driver object lists 74 | # 75 | DRV_OBJS_S += $(SFNT_DRV_OBJ_S) 76 | DRV_OBJS_M += $(SFNT_DRV_OBJ_M) 77 | 78 | 79 | # EOF 80 | -------------------------------------------------------------------------------- /src/sfnt/sfdriver.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* sfdriver.h */ 4 | /* */ 5 | /* High-level SFNT driver interface (specification). */ 6 | /* */ 7 | /* Copyright 1996-2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __SFDRIVER_H__ 20 | #define __SFDRIVER_H__ 21 | 22 | 23 | #include 24 | #include FT_MODULE_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_DECLARE_MODULE( sfnt_module_class ) 31 | 32 | 33 | FT_END_HEADER 34 | 35 | #endif /* __SFDRIVER_H__ */ 36 | 37 | 38 | /* END */ 39 | -------------------------------------------------------------------------------- /src/sfnt/sferrors.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* sferrors.h */ 4 | /* */ 5 | /* SFNT error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2001, 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 used to define the SFNT error enumeration constants. */ 22 | /* */ 23 | /*************************************************************************/ 24 | 25 | #ifndef __SFERRORS_H__ 26 | #define __SFERRORS_H__ 27 | 28 | #include FT_MODULE_ERRORS_H 29 | 30 | #undef __FTERRORS_H__ 31 | 32 | #define FT_ERR_PREFIX SFNT_Err_ 33 | #define FT_ERR_BASE FT_Mod_Err_SFNT 34 | 35 | #define FT_KEEP_ERR_PREFIX 36 | 37 | #include FT_ERRORS_H 38 | 39 | #endif /* __SFERRORS_H__ */ 40 | 41 | /* END */ 42 | -------------------------------------------------------------------------------- /src/sfnt/sfnt.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* sfnt.c */ 4 | /* */ 5 | /* Single object library component. */ 6 | /* */ 7 | /* Copyright 1996-2001, 2002, 2003, 2004, 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 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | #include "sfntpic.c" 23 | #include "ttload.c" 24 | #include "ttmtx.c" 25 | #include "ttcmap.c" 26 | #include "ttkern.c" 27 | #include "sfobjs.c" 28 | #include "sfdriver.c" 29 | 30 | #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS 31 | #include "ttsbit.c" 32 | #endif 33 | 34 | #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES 35 | #include "ttpost.c" 36 | #endif 37 | 38 | #ifdef TT_CONFIG_OPTION_BDF 39 | #include "ttbdf.c" 40 | #endif 41 | 42 | /* END */ 43 | -------------------------------------------------------------------------------- /src/sfnt/sfobjs.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* sfobjs.h */ 4 | /* */ 5 | /* SFNT object management (specification). */ 6 | /* */ 7 | /* Copyright 1996-2001, 2002 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __SFOBJS_H__ 20 | #define __SFOBJS_H__ 21 | 22 | 23 | #include 24 | #include FT_INTERNAL_SFNT_H 25 | #include FT_INTERNAL_OBJECTS_H 26 | 27 | 28 | FT_BEGIN_HEADER 29 | 30 | 31 | FT_LOCAL( FT_Error ) 32 | sfnt_init_face( FT_Stream stream, 33 | TT_Face face, 34 | FT_Int face_index, 35 | FT_Int num_params, 36 | FT_Parameter* params ); 37 | 38 | FT_LOCAL( FT_Error ) 39 | sfnt_load_face( FT_Stream stream, 40 | TT_Face face, 41 | FT_Int face_index, 42 | FT_Int num_params, 43 | FT_Parameter* params ); 44 | 45 | FT_LOCAL( void ) 46 | sfnt_done_face( TT_Face face ); 47 | 48 | 49 | FT_END_HEADER 50 | 51 | #endif /* __SFDRIVER_H__ */ 52 | 53 | 54 | /* END */ 55 | -------------------------------------------------------------------------------- /src/sfnt/ttbdf.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttbdf.h */ 4 | /* */ 5 | /* TrueType and OpenType embedded BDF properties (specification). */ 6 | /* */ 7 | /* Copyright 2005 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __TTBDF_H__ 20 | #define __TTBDF_H__ 21 | 22 | 23 | #include 24 | #include "ttload.h" 25 | #include FT_BDF_H 26 | 27 | 28 | FT_BEGIN_HEADER 29 | 30 | 31 | FT_LOCAL( void ) 32 | tt_face_free_bdf_props( TT_Face face ); 33 | 34 | 35 | FT_LOCAL( FT_Error ) 36 | tt_face_find_bdf_prop( TT_Face face, 37 | const char* property_name, 38 | BDF_PropertyRec *aprop ); 39 | 40 | 41 | FT_END_HEADER 42 | 43 | #endif /* __TTBDF_H__ */ 44 | 45 | 46 | /* END */ 47 | -------------------------------------------------------------------------------- /src/sfnt/ttcmapc.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttcmapc.h */ 4 | /* */ 5 | /* TT CMAP classes definitions (specification only). */ 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 | #ifdef TT_CONFIG_CMAP_FORMAT_0 20 | TTCMAPCITEM(tt_cmap0_class_rec) 21 | #endif 22 | 23 | #ifdef TT_CONFIG_CMAP_FORMAT_2 24 | TTCMAPCITEM(tt_cmap2_class_rec) 25 | #endif 26 | 27 | #ifdef TT_CONFIG_CMAP_FORMAT_4 28 | TTCMAPCITEM(tt_cmap4_class_rec) 29 | #endif 30 | 31 | #ifdef TT_CONFIG_CMAP_FORMAT_6 32 | TTCMAPCITEM(tt_cmap6_class_rec) 33 | #endif 34 | 35 | #ifdef TT_CONFIG_CMAP_FORMAT_8 36 | TTCMAPCITEM(tt_cmap8_class_rec) 37 | #endif 38 | 39 | #ifdef TT_CONFIG_CMAP_FORMAT_10 40 | TTCMAPCITEM(tt_cmap10_class_rec) 41 | #endif 42 | 43 | #ifdef TT_CONFIG_CMAP_FORMAT_12 44 | TTCMAPCITEM(tt_cmap12_class_rec) 45 | #endif 46 | 47 | #ifdef TT_CONFIG_CMAP_FORMAT_13 48 | TTCMAPCITEM(tt_cmap13_class_rec) 49 | #endif 50 | 51 | #ifdef TT_CONFIG_CMAP_FORMAT_14 52 | TTCMAPCITEM(tt_cmap14_class_rec) 53 | #endif 54 | 55 | /* END */ 56 | -------------------------------------------------------------------------------- /src/sfnt/ttkern.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttkern.h */ 4 | /* */ 5 | /* Load the basic TrueType kerning table. This doesn't handle */ 6 | /* kerning data within the GPOS table at the moment. */ 7 | /* */ 8 | /* Copyright 1996-2001, 2002, 2005, 2007 by */ 9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 10 | /* */ 11 | /* This file is part of the FreeType project, and may only be used, */ 12 | /* modified, and distributed under the terms of the FreeType project */ 13 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 14 | /* this file you indicate that you have read the license and */ 15 | /* understand and accept it fully. */ 16 | /* */ 17 | /***************************************************************************/ 18 | 19 | 20 | #ifndef __TTKERN_H__ 21 | #define __TTKERN_H__ 22 | 23 | 24 | #include 25 | #include FT_INTERNAL_STREAM_H 26 | #include FT_INTERNAL_TRUETYPE_TYPES_H 27 | 28 | 29 | FT_BEGIN_HEADER 30 | 31 | 32 | FT_LOCAL( FT_Error ) 33 | tt_face_load_kern( TT_Face face, 34 | FT_Stream stream ); 35 | 36 | FT_LOCAL( void ) 37 | tt_face_done_kern( TT_Face face ); 38 | 39 | FT_LOCAL( FT_Int ) 40 | tt_face_get_kerning( TT_Face face, 41 | FT_UInt left_glyph, 42 | FT_UInt right_glyph ); 43 | 44 | #define TT_FACE_HAS_KERNING( face ) ( (face)->kern_avail_bits != 0 ) 45 | 46 | 47 | FT_END_HEADER 48 | 49 | #endif /* __TTKERN_H__ */ 50 | 51 | 52 | /* END */ 53 | -------------------------------------------------------------------------------- /src/sfnt/ttmtx.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttmtx.h */ 4 | /* */ 5 | /* Load the metrics tables common to TTF and OTF fonts (specification). */ 6 | /* */ 7 | /* Copyright 2006 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __TTMTX_H__ 20 | #define __TTMTX_H__ 21 | 22 | 23 | #include 24 | #include FT_INTERNAL_STREAM_H 25 | #include FT_INTERNAL_TRUETYPE_TYPES_H 26 | 27 | 28 | FT_BEGIN_HEADER 29 | 30 | 31 | FT_LOCAL( FT_Error ) 32 | tt_face_load_hhea( TT_Face face, 33 | FT_Stream stream, 34 | FT_Bool vertical ); 35 | 36 | 37 | FT_LOCAL( FT_Error ) 38 | tt_face_load_hmtx( TT_Face face, 39 | FT_Stream stream, 40 | FT_Bool vertical ); 41 | 42 | 43 | FT_LOCAL( FT_Error ) 44 | tt_face_get_metrics( TT_Face face, 45 | FT_Bool vertical, 46 | FT_UInt gindex, 47 | FT_Short* abearing, 48 | FT_UShort* aadvance ); 49 | 50 | FT_END_HEADER 51 | 52 | #endif /* __TTMTX_H__ */ 53 | 54 | 55 | /* END */ 56 | -------------------------------------------------------------------------------- /src/sfnt/ttpost.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttpost.h */ 4 | /* */ 5 | /* Postcript name table processing for TrueType and OpenType fonts */ 6 | /* (specification). */ 7 | /* */ 8 | /* Copyright 1996-2001, 2002 by */ 9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 10 | /* */ 11 | /* This file is part of the FreeType project, and may only be used, */ 12 | /* modified, and distributed under the terms of the FreeType project */ 13 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 14 | /* this file you indicate that you have read the license and */ 15 | /* understand and accept it fully. */ 16 | /* */ 17 | /***************************************************************************/ 18 | 19 | 20 | #ifndef __TTPOST_H__ 21 | #define __TTPOST_H__ 22 | 23 | 24 | #include 25 | #include FT_CONFIG_CONFIG_H 26 | #include FT_INTERNAL_TRUETYPE_TYPES_H 27 | 28 | 29 | FT_BEGIN_HEADER 30 | 31 | 32 | FT_LOCAL( FT_Error ) 33 | tt_face_get_ps_name( TT_Face face, 34 | FT_UInt idx, 35 | FT_String** PSname ); 36 | 37 | FT_LOCAL( void ) 38 | tt_face_free_ps_names( TT_Face face ); 39 | 40 | 41 | FT_END_HEADER 42 | 43 | #endif /* __TTPOST_H__ */ 44 | 45 | 46 | /* END */ 47 | -------------------------------------------------------------------------------- /src/sfnt/ttsbit.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttsbit.h */ 4 | /* */ 5 | /* TrueType and OpenType embedded bitmap support (specification). */ 6 | /* */ 7 | /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 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 __TTSBIT_H__ 20 | #define __TTSBIT_H__ 21 | 22 | 23 | #include 24 | #include "ttload.h" 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_LOCAL( FT_Error ) 31 | tt_face_load_eblc( TT_Face face, 32 | FT_Stream stream ); 33 | 34 | FT_LOCAL( void ) 35 | tt_face_free_eblc( TT_Face face ); 36 | 37 | 38 | FT_LOCAL( FT_Error ) 39 | tt_face_set_sbit_strike( TT_Face face, 40 | FT_Size_Request req, 41 | FT_ULong* astrike_index ); 42 | 43 | FT_LOCAL( FT_Error ) 44 | tt_face_load_strike_metrics( TT_Face face, 45 | FT_ULong strike_index, 46 | FT_Size_Metrics* metrics ); 47 | 48 | #ifdef FT_CONFIG_OPTION_OLD_INTERNALS 49 | FT_LOCAL( FT_Error ) 50 | tt_find_sbit_image( TT_Face face, 51 | FT_UInt glyph_index, 52 | FT_ULong strike_index, 53 | TT_SBit_Range *arange, 54 | TT_SBit_Strike *astrike, 55 | FT_ULong *aglyph_offset ); 56 | 57 | FT_LOCAL( FT_Error ) 58 | tt_load_sbit_metrics( FT_Stream stream, 59 | TT_SBit_Range range, 60 | TT_SBit_Metrics metrics ); 61 | 62 | #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ 63 | 64 | FT_LOCAL( FT_Error ) 65 | tt_face_load_sbit_image( TT_Face face, 66 | FT_ULong strike_index, 67 | FT_UInt glyph_index, 68 | FT_UInt load_flags, 69 | FT_Stream stream, 70 | FT_Bitmap *map, 71 | TT_SBit_MetricsRec *metrics ); 72 | 73 | 74 | FT_END_HEADER 75 | 76 | #endif /* __TTSBIT_H__ */ 77 | 78 | 79 | /* END */ 80 | -------------------------------------------------------------------------------- /src/smooth/Jamfile: -------------------------------------------------------------------------------- 1 | # FreeType 2 src/smooth Jamfile 2 | # 3 | # Copyright 2001 by 4 | # David Turner, Robert Wilhelm, and Werner Lemberg. 5 | # 6 | # This file is part of the FreeType project, and may only be used, modified, 7 | # and distributed under the terms of the FreeType project license, 8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 9 | # indicate that you have read the license and understand and accept it 10 | # fully. 11 | 12 | SubDir FT2_TOP $(FT2_SRC_DIR) smooth ; 13 | 14 | { 15 | local _sources ; 16 | 17 | if $(FT2_MULTI) 18 | { 19 | _sources = ftgrays ftsmooth ftspic ; 20 | } 21 | else 22 | { 23 | _sources = smooth ; 24 | } 25 | 26 | Library $(FT2_LIB) : $(_sources).c ; 27 | } 28 | 29 | # end of src/smooth Jamfile 30 | -------------------------------------------------------------------------------- /src/smooth/ftgrays.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftgrays.h */ 4 | /* */ 5 | /* FreeType smooth renderer declaration */ 6 | /* */ 7 | /* Copyright 1996-2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __FTGRAYS_H__ 20 | #define __FTGRAYS_H__ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | 27 | #ifdef _STANDALONE_ 28 | #include "ftimage.h" 29 | #else 30 | #include 31 | #include FT_CONFIG_CONFIG_H /* for FT_CONFIG_OPTION_PIC */ 32 | #include FT_IMAGE_H 33 | #endif 34 | 35 | 36 | /*************************************************************************/ 37 | /* */ 38 | /* To make ftgrays.h independent from configuration files we check */ 39 | /* whether FT_EXPORT_VAR has been defined already. */ 40 | /* */ 41 | /* On some systems and compilers (Win32 mostly), an extra keyword is */ 42 | /* necessary to compile the library as a DLL. */ 43 | /* */ 44 | #ifndef FT_EXPORT_VAR 45 | #define FT_EXPORT_VAR( x ) extern x 46 | #endif 47 | 48 | FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_grays_raster; 49 | 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* __FTGRAYS_H__ */ 56 | 57 | 58 | /* END */ 59 | -------------------------------------------------------------------------------- /src/smooth/ftsmerrs.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftsmerrs.h */ 4 | /* */ 5 | /* smooth renderer error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | /*************************************************************************/ 20 | /* */ 21 | /* This file is used to define the smooth renderer error enumeration */ 22 | /* constants. */ 23 | /* */ 24 | /*************************************************************************/ 25 | 26 | #ifndef __FTSMERRS_H__ 27 | #define __FTSMERRS_H__ 28 | 29 | #include FT_MODULE_ERRORS_H 30 | 31 | #undef __FTERRORS_H__ 32 | 33 | #define FT_ERR_PREFIX Smooth_Err_ 34 | #define FT_ERR_BASE FT_Mod_Err_Smooth 35 | 36 | #include FT_ERRORS_H 37 | 38 | #endif /* __FTSMERRS_H__ */ 39 | 40 | 41 | /* END */ 42 | -------------------------------------------------------------------------------- /src/smooth/ftsmooth.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftsmooth.h */ 4 | /* */ 5 | /* Anti-aliasing renderer interface (specification). */ 6 | /* */ 7 | /* Copyright 1996-2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __FTSMOOTH_H__ 20 | #define __FTSMOOTH_H__ 21 | 22 | 23 | #include 24 | #include FT_RENDER_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | #ifndef FT_CONFIG_OPTION_NO_STD_RASTER 31 | FT_DECLARE_RENDERER( ft_std_renderer_class ) 32 | #endif 33 | 34 | #ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER 35 | FT_DECLARE_RENDERER( ft_smooth_renderer_class ) 36 | 37 | FT_DECLARE_RENDERER( ft_smooth_lcd_renderer_class ) 38 | 39 | FT_DECLARE_RENDERER( ft_smooth_lcd_v_renderer_class ) 40 | #endif 41 | 42 | 43 | 44 | FT_END_HEADER 45 | 46 | #endif /* __FTSMOOTH_H__ */ 47 | 48 | 49 | /* END */ 50 | -------------------------------------------------------------------------------- /src/smooth/ftspic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ftspic.h */ 4 | /* */ 5 | /* The FreeType position independent code services for smooth module. */ 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 | #ifndef __FTSPIC_H__ 20 | #define __FTSPIC_H__ 21 | 22 | 23 | FT_BEGIN_HEADER 24 | 25 | #include FT_INTERNAL_PIC_H 26 | 27 | #ifndef FT_CONFIG_OPTION_PIC 28 | #define FT_GRAYS_RASTER_GET ft_grays_raster 29 | 30 | #else /* FT_CONFIG_OPTION_PIC */ 31 | 32 | typedef struct SmoothPIC_ 33 | { 34 | int ref_count; 35 | FT_Raster_Funcs ft_grays_raster; 36 | } SmoothPIC; 37 | 38 | #define GET_PIC(lib) ((SmoothPIC*)((lib)->pic_container.smooth)) 39 | #define FT_GRAYS_RASTER_GET (GET_PIC(library)->ft_grays_raster) 40 | 41 | #endif /* FT_CONFIG_OPTION_PIC */ 42 | 43 | /* */ 44 | 45 | FT_END_HEADER 46 | 47 | #endif /* __FTSPIC_H__ */ 48 | 49 | 50 | /* END */ 51 | -------------------------------------------------------------------------------- /src/smooth/module.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 smooth renderer module definition 3 | # 4 | 5 | 6 | # Copyright 1996-2000, 2006 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | FTMODULE_H_COMMANDS += SMOOTH_RENDERER 17 | 18 | define SMOOTH_RENDERER 19 | $(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_renderer_class $(CLOSE_DRIVER) 20 | $(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer$(ECHO_DRIVER_DONE) 21 | $(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_lcd_renderer_class $(CLOSE_DRIVER) 22 | $(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for LCDs$(ECHO_DRIVER_DONE) 23 | $(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_lcdv_renderer_class $(CLOSE_DRIVER) 24 | $(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for vertical LCDs$(ECHO_DRIVER_DONE) 25 | endef 26 | 27 | # EOF 28 | -------------------------------------------------------------------------------- /src/smooth/rules.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 smooth renderer module build rules 3 | # 4 | 5 | 6 | # Copyright 1996-2000, 2001, 2003 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | # smooth driver directory 17 | # 18 | SMOOTH_DIR := $(SRC_DIR)/smooth 19 | 20 | # compilation flags for the driver 21 | # 22 | SMOOTH_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SMOOTH_DIR)) 23 | 24 | 25 | # smooth driver sources (i.e., C files) 26 | # 27 | SMOOTH_DRV_SRC := $(SMOOTH_DIR)/ftgrays.c \ 28 | $(SMOOTH_DIR)/ftsmooth.c 29 | 30 | 31 | # smooth driver headers 32 | # 33 | SMOOTH_DRV_H := $(SMOOTH_DRV_SRC:%c=%h) \ 34 | $(SMOOTH_DIR)/ftsmerrs.h 35 | 36 | 37 | # smooth driver object(s) 38 | # 39 | # SMOOTH_DRV_OBJ_M is used during `multi' builds. 40 | # SMOOTH_DRV_OBJ_S is used during `single' builds. 41 | # 42 | SMOOTH_DRV_OBJ_M := $(SMOOTH_DRV_SRC:$(SMOOTH_DIR)/%.c=$(OBJ_DIR)/%.$O) 43 | SMOOTH_DRV_OBJ_S := $(OBJ_DIR)/smooth.$O 44 | 45 | # smooth driver source file for single build 46 | # 47 | SMOOTH_DRV_SRC_S := $(SMOOTH_DIR)/smooth.c 48 | 49 | 50 | # smooth driver - single object 51 | # 52 | $(SMOOTH_DRV_OBJ_S): $(SMOOTH_DRV_SRC_S) $(SMOOTH_DRV_SRC) \ 53 | $(FREETYPE_H) $(SMOOTH_DRV_H) 54 | $(SMOOTH_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(SMOOTH_DRV_SRC_S)) 55 | 56 | 57 | # smooth driver - multiple objects 58 | # 59 | $(OBJ_DIR)/%.$O: $(SMOOTH_DIR)/%.c $(FREETYPE_H) $(SMOOTH_DRV_H) 60 | $(SMOOTH_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) 61 | 62 | 63 | # update main driver object lists 64 | # 65 | DRV_OBJS_S += $(SMOOTH_DRV_OBJ_S) 66 | DRV_OBJS_M += $(SMOOTH_DRV_OBJ_M) 67 | 68 | 69 | # EOF 70 | -------------------------------------------------------------------------------- /src/smooth/smooth.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* smooth.c */ 4 | /* */ 5 | /* FreeType anti-aliasing rasterer module component (body only). */ 6 | /* */ 7 | /* Copyright 1996-2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | #include "ftspic.c" 23 | #include "ftgrays.c" 24 | #include "ftsmooth.c" 25 | 26 | 27 | /* END */ 28 | -------------------------------------------------------------------------------- /src/truetype/Jamfile: -------------------------------------------------------------------------------- 1 | # FreeType 2 src/truetype Jamfile 2 | # 3 | # Copyright 2001, 2004 by 4 | # David Turner, Robert Wilhelm, and Werner Lemberg. 5 | # 6 | # This file is part of the FreeType project, and may only be used, modified, 7 | # and distributed under the terms of the FreeType project license, 8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 9 | # indicate that you have read the license and understand and accept it 10 | # fully. 11 | 12 | SubDir FT2_TOP $(FT2_SRC_DIR) truetype ; 13 | 14 | { 15 | local _sources ; 16 | 17 | if $(FT2_MULTI) 18 | { 19 | _sources = ttdriver ttobjs ttpload ttgload ttinterp ttgxvar ttpic ; 20 | } 21 | else 22 | { 23 | _sources = truetype ; 24 | } 25 | 26 | Library $(FT2_LIB) : $(_sources).c ; 27 | } 28 | 29 | # end of src/truetype Jamfile 30 | -------------------------------------------------------------------------------- /src/truetype/module.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 TrueType module definition 3 | # 4 | 5 | 6 | # Copyright 1996-2000, 2006 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | FTMODULE_H_COMMANDS += TRUETYPE_DRIVER 17 | 18 | define TRUETYPE_DRIVER 19 | $(OPEN_DRIVER) FT_Driver_ClassRec, tt_driver_class $(CLOSE_DRIVER) 20 | $(ECHO_DRIVER)truetype $(ECHO_DRIVER_DESC)Windows/Mac font files with extension *.ttf or *.ttc$(ECHO_DRIVER_DONE) 21 | endef 22 | 23 | # EOF 24 | -------------------------------------------------------------------------------- /src/truetype/rules.mk: -------------------------------------------------------------------------------- 1 | # 2 | # FreeType 2 TrueType driver configuration rules 3 | # 4 | 5 | 6 | # Copyright 1996-2000, 2001, 2003, 2004 by 7 | # David Turner, Robert Wilhelm, and Werner Lemberg. 8 | # 9 | # This file is part of the FreeType project, and may only be used, modified, 10 | # and distributed under the terms of the FreeType project license, 11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you 12 | # indicate that you have read the license and understand and accept it 13 | # fully. 14 | 15 | 16 | # TrueType driver directory 17 | # 18 | TT_DIR := $(SRC_DIR)/truetype 19 | 20 | 21 | # compilation flags for the driver 22 | # 23 | TT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(TT_DIR)) 24 | 25 | 26 | # TrueType driver sources (i.e., C files) 27 | # 28 | TT_DRV_SRC := $(TT_DIR)/ttobjs.c \ 29 | $(TT_DIR)/ttpload.c \ 30 | $(TT_DIR)/ttgload.c \ 31 | $(TT_DIR)/ttinterp.c \ 32 | $(TT_DIR)/ttgxvar.c \ 33 | $(TT_DIR)/ttdriver.c 34 | 35 | # TrueType driver headers 36 | # 37 | TT_DRV_H := $(TT_DRV_SRC:%.c=%.h) \ 38 | $(TT_DIR)/tterrors.h 39 | 40 | 41 | # TrueType driver object(s) 42 | # 43 | # TT_DRV_OBJ_M is used during `multi' builds 44 | # TT_DRV_OBJ_S is used during `single' builds 45 | # 46 | TT_DRV_OBJ_M := $(TT_DRV_SRC:$(TT_DIR)/%.c=$(OBJ_DIR)/%.$O) 47 | TT_DRV_OBJ_S := $(OBJ_DIR)/truetype.$O 48 | 49 | # TrueType driver source file for single build 50 | # 51 | TT_DRV_SRC_S := $(TT_DIR)/truetype.c 52 | 53 | 54 | # TrueType driver - single object 55 | # 56 | $(TT_DRV_OBJ_S): $(TT_DRV_SRC_S) $(TT_DRV_SRC) $(FREETYPE_H) $(TT_DRV_H) 57 | $(TT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(TT_DRV_SRC_S)) 58 | 59 | 60 | # driver - multiple objects 61 | # 62 | $(OBJ_DIR)/%.$O: $(TT_DIR)/%.c $(FREETYPE_H) $(TT_DRV_H) 63 | $(TT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) 64 | 65 | 66 | # update main driver object lists 67 | # 68 | DRV_OBJS_S += $(TT_DRV_OBJ_S) 69 | DRV_OBJS_M += $(TT_DRV_OBJ_M) 70 | 71 | 72 | # EOF 73 | -------------------------------------------------------------------------------- /src/truetype/truetype.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* truetype.c */ 4 | /* */ 5 | /* FreeType TrueType driver component (body only). */ 6 | /* */ 7 | /* Copyright 1996-2001, 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 | #define FT_MAKE_OPTION_SINGLE_OBJECT 20 | 21 | #include 22 | #include "ttpic.c" 23 | #include "ttdriver.c" /* driver interface */ 24 | #include "ttpload.c" /* tables loader */ 25 | #include "ttgload.c" /* glyph loader */ 26 | #include "ttobjs.c" /* object manager */ 27 | 28 | #ifdef TT_USE_BYTECODE_INTERPRETER 29 | #include "ttinterp.c" 30 | #endif 31 | 32 | #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT 33 | #include "ttgxvar.c" /* gx distortable font */ 34 | #endif 35 | 36 | 37 | /* END */ 38 | -------------------------------------------------------------------------------- /src/truetype/ttdriver.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttdriver.h */ 4 | /* */ 5 | /* High-level TrueType driver interface (specification). */ 6 | /* */ 7 | /* Copyright 1996-2001, 2002 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #ifndef __TTDRIVER_H__ 20 | #define __TTDRIVER_H__ 21 | 22 | 23 | #include 24 | #include FT_INTERNAL_DRIVER_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_DECLARE_DRIVER( tt_driver_class ) 31 | 32 | 33 | FT_END_HEADER 34 | 35 | #endif /* __TTDRIVER_H__ */ 36 | 37 | 38 | /* END */ 39 | -------------------------------------------------------------------------------- /src/truetype/tterrors.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* tterrors.h */ 4 | /* */ 5 | /* TrueType error codes (specification only). */ 6 | /* */ 7 | /* Copyright 2001 by */ 8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | /*************************************************************************/ 20 | /* */ 21 | /* This file is used to define the TrueType error enumeration */ 22 | /* constants. */ 23 | /* */ 24 | /*************************************************************************/ 25 | 26 | #ifndef __TTERRORS_H__ 27 | #define __TTERRORS_H__ 28 | 29 | #include FT_MODULE_ERRORS_H 30 | 31 | #undef __FTERRORS_H__ 32 | 33 | #define FT_ERR_PREFIX TT_Err_ 34 | #define FT_ERR_BASE FT_Mod_Err_TrueType 35 | 36 | #include FT_ERRORS_H 37 | 38 | #endif /* __TTERRORS_H__ */ 39 | 40 | /* END */ 41 | -------------------------------------------------------------------------------- /src/truetype/ttgload.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttgload.h */ 4 | /* */ 5 | /* TrueType Glyph Loader (specification). */ 6 | /* */ 7 | /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 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 __TTGLOAD_H__ 20 | #define __TTGLOAD_H__ 21 | 22 | 23 | #include 24 | #include "ttobjs.h" 25 | 26 | #ifdef TT_USE_BYTECODE_INTERPRETER 27 | #include "ttinterp.h" 28 | #endif 29 | 30 | 31 | FT_BEGIN_HEADER 32 | 33 | 34 | FT_LOCAL( void ) 35 | TT_Init_Glyph_Loading( TT_Face face ); 36 | 37 | FT_LOCAL( void ) 38 | TT_Get_HMetrics( TT_Face face, 39 | FT_UInt idx, 40 | FT_Bool check, 41 | FT_Short* lsb, 42 | FT_UShort* aw ); 43 | 44 | FT_LOCAL( void ) 45 | TT_Get_VMetrics( TT_Face face, 46 | FT_UInt idx, 47 | FT_Bool check, 48 | FT_Short* tsb, 49 | FT_UShort* ah ); 50 | 51 | FT_LOCAL( FT_Error ) 52 | TT_Load_Glyph( TT_Size size, 53 | TT_GlyphSlot glyph, 54 | FT_UInt glyph_index, 55 | FT_Int32 load_flags ); 56 | 57 | 58 | FT_END_HEADER 59 | 60 | #endif /* __TTGLOAD_H__ */ 61 | 62 | 63 | /* END */ 64 | -------------------------------------------------------------------------------- /src/truetype/ttpic.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttpic.c */ 4 | /* */ 5 | /* The FreeType position independent code services for truetype module. */ 6 | /* */ 7 | /* Copyright 2009, 2010 by */ 8 | /* Oran Agra and Mickey Gabel. */ 9 | /* */ 10 | /* This file is part of the FreeType project, and may only be used, */ 11 | /* modified, and distributed under the terms of the FreeType project */ 12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 13 | /* this file you indicate that you have read the license and */ 14 | /* understand and accept it fully. */ 15 | /* */ 16 | /***************************************************************************/ 17 | 18 | 19 | #include 20 | #include FT_FREETYPE_H 21 | #include FT_INTERNAL_OBJECTS_H 22 | #include "ttpic.h" 23 | 24 | #ifdef FT_CONFIG_OPTION_PIC 25 | 26 | /* forward declaration of PIC init functions from ttdriver.c */ 27 | FT_Error FT_Create_Class_tt_services( FT_Library, FT_ServiceDescRec**); 28 | void FT_Destroy_Class_tt_services( FT_Library, FT_ServiceDescRec*); 29 | void FT_Init_Class_tt_service_gx_multi_masters(FT_Service_MultiMastersRec*); 30 | void FT_Init_Class_tt_service_truetype_glyf(FT_Service_TTGlyfRec*); 31 | 32 | void 33 | tt_driver_class_pic_free( FT_Library library ) 34 | { 35 | FT_PIC_Container* pic_container = &library->pic_container; 36 | FT_Memory memory = library->memory; 37 | if ( pic_container->truetype ) 38 | { 39 | TTModulePIC* container = (TTModulePIC*)pic_container->truetype; 40 | if(container->tt_services) 41 | FT_Destroy_Class_tt_services(library, container->tt_services); 42 | container->tt_services = NULL; 43 | FT_FREE( container ); 44 | pic_container->truetype = NULL; 45 | } 46 | } 47 | 48 | 49 | FT_Error 50 | tt_driver_class_pic_init( FT_Library library ) 51 | { 52 | FT_PIC_Container* pic_container = &library->pic_container; 53 | FT_Error error = TT_Err_Ok; 54 | TTModulePIC* container; 55 | FT_Memory memory = library->memory; 56 | 57 | 58 | /* allocate pointer, clear and set global container pointer */ 59 | if ( FT_ALLOC ( container, sizeof ( *container ) ) ) 60 | return error; 61 | FT_MEM_SET( container, 0, sizeof(*container) ); 62 | pic_container->truetype = container; 63 | 64 | /* initialize pointer table - this is how the module usually expects this data */ 65 | error = FT_Create_Class_tt_services(library, &container->tt_services); 66 | if(error) 67 | goto Exit; 68 | #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT 69 | FT_Init_Class_tt_service_gx_multi_masters(&container->tt_service_gx_multi_masters); 70 | #endif 71 | FT_Init_Class_tt_service_truetype_glyf(&container->tt_service_truetype_glyf); 72 | Exit: 73 | if(error) 74 | tt_driver_class_pic_free(library); 75 | return error; 76 | } 77 | 78 | #endif /* FT_CONFIG_OPTION_PIC */ 79 | 80 | 81 | /* END */ 82 | -------------------------------------------------------------------------------- /src/truetype/ttpic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttpic.h */ 4 | /* */ 5 | /* The FreeType position independent code services for truetype module. */ 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 | #ifndef __TTPIC_H__ 20 | #define __TTPIC_H__ 21 | 22 | 23 | FT_BEGIN_HEADER 24 | 25 | #ifndef FT_CONFIG_OPTION_PIC 26 | #define FT_TT_SERVICES_GET tt_services 27 | #define FT_TT_SERVICE_GX_MULTI_MASTERS_GET tt_service_gx_multi_masters 28 | #define FT_TT_SERVICE_TRUETYPE_GLYF_GET tt_service_truetype_glyf 29 | 30 | #else /* FT_CONFIG_OPTION_PIC */ 31 | 32 | #include FT_MULTIPLE_MASTERS_H 33 | #include FT_SERVICE_MULTIPLE_MASTERS_H 34 | #include FT_SERVICE_TRUETYPE_GLYF_H 35 | 36 | typedef struct TTModulePIC_ 37 | { 38 | FT_ServiceDescRec* tt_services; 39 | #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT 40 | FT_Service_MultiMastersRec tt_service_gx_multi_masters; 41 | #endif 42 | FT_Service_TTGlyfRec tt_service_truetype_glyf; 43 | } TTModulePIC; 44 | 45 | #define GET_PIC(lib) ((TTModulePIC*)((lib)->pic_container.truetype)) 46 | #define FT_TT_SERVICES_GET (GET_PIC(library)->tt_services) 47 | #define FT_TT_SERVICE_GX_MULTI_MASTERS_GET (GET_PIC(library)->tt_service_gx_multi_masters) 48 | #define FT_TT_SERVICE_TRUETYPE_GLYF_GET (GET_PIC(library)->tt_service_truetype_glyf) 49 | 50 | #endif /* FT_CONFIG_OPTION_PIC */ 51 | 52 | /* */ 53 | 54 | FT_END_HEADER 55 | 56 | #endif /* __TTPIC_H__ */ 57 | 58 | 59 | /* END */ 60 | -------------------------------------------------------------------------------- /src/truetype/ttpload.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************/ 2 | /* */ 3 | /* ttpload.h */ 4 | /* */ 5 | /* TrueType-specific tables loader (specification). */ 6 | /* */ 7 | /* Copyright 1996-2001, 2002, 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 __TTPLOAD_H__ 20 | #define __TTPLOAD_H__ 21 | 22 | 23 | #include 24 | #include FT_INTERNAL_TRUETYPE_TYPES_H 25 | 26 | 27 | FT_BEGIN_HEADER 28 | 29 | 30 | FT_LOCAL( FT_Error ) 31 | tt_face_load_loca( TT_Face face, 32 | FT_Stream stream ); 33 | 34 | FT_LOCAL( FT_ULong ) 35 | tt_face_get_location( TT_Face face, 36 | FT_UInt gindex, 37 | FT_UInt *asize ); 38 | 39 | FT_LOCAL( void ) 40 | tt_face_done_loca( TT_Face face ); 41 | 42 | FT_LOCAL( FT_Error ) 43 | tt_face_load_cvt( TT_Face face, 44 | FT_Stream stream ); 45 | 46 | FT_LOCAL( FT_Error ) 47 | tt_face_load_fpgm( TT_Face face, 48 | FT_Stream stream ); 49 | 50 | 51 | FT_LOCAL( FT_Error ) 52 | tt_face_load_prep( TT_Face face, 53 | FT_Stream stream ); 54 | 55 | 56 | FT_LOCAL( FT_Error ) 57 | tt_face_load_hdmx( TT_Face face, 58 | FT_Stream stream ); 59 | 60 | 61 | FT_LOCAL( void ) 62 | tt_face_free_hdmx( TT_Face face ); 63 | 64 | 65 | FT_LOCAL( FT_Byte* ) 66 | tt_face_get_device_metrics( TT_Face face, 67 | FT_UInt ppem, 68 | FT_UInt gindex ); 69 | 70 | FT_END_HEADER 71 | 72 | #endif /* __TTPLOAD_H__ */ 73 | 74 | 75 | /* END */ 76 | --------------------------------------------------------------------------------