From 7785694244cdfc5939ca4754cab4e08bd6980f99 Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 22 Feb 2015 14:47:01 +0100 Subject: Upgraded to freetype 2.5.5 --- freetype/CMakeLists.txt | 110 +- freetype/ChangeLog | 1959 +++++++- freetype/ChangeLog.21 | 2 +- freetype/Jamfile | 2 +- freetype/README | 20 +- freetype/builds/atari/deflinejoiner.awk | 6 +- freetype/builds/cmake/iOS.cmake | 275 ++ freetype/builds/compiler/bcc-dev.mk | 2 +- freetype/builds/detect.mk | 6 +- freetype/builds/freetype.mk | 19 +- freetype/builds/mac/freetype-Info.plist | 36 + freetype/builds/mac/ftmac.c | 14 +- freetype/builds/toplevel.mk | 4 +- freetype/builds/unix/config.guess | 19 +- freetype/builds/unix/config.sub | 32 +- freetype/builds/unix/configure | 45 +- freetype/builds/unix/configure.ac | 28 +- freetype/builds/unix/configure.raw | 26 +- freetype/builds/unix/freetype-config.in | 2 +- freetype/builds/unix/freetype2.in | 8 +- freetype/builds/unix/freetype2.m4 | 6 +- freetype/builds/unix/ftconfig.in | 249 +- freetype/builds/unix/unix-def.in | 25 +- freetype/builds/vms/ftconfig.h | 244 +- freetype/builds/wince/vc2005-ce/freetype.vcproj | 76 +- freetype/builds/wince/vc2005-ce/index.html | 10 +- freetype/builds/wince/vc2008-ce/freetype.vcproj | 76 +- freetype/builds/wince/vc2008-ce/index.html | 10 +- freetype/builds/windows/vc2005/freetype.vcproj | 12 +- freetype/builds/windows/vc2005/index.html | 10 +- freetype/builds/windows/vc2008/freetype.vcproj | 12 +- freetype/builds/windows/vc2008/index.html | 10 +- freetype/builds/windows/vc2010/freetype.sln | 24 +- freetype/builds/windows/vc2010/freetype.user.props | 68 + freetype/builds/windows/vc2010/freetype.vcxproj | 511 ++- freetype/builds/windows/vc2010/index.html | 30 +- freetype/builds/windows/visualc/freetype.dsp | 34 +- freetype/builds/windows/visualc/freetype.vcproj | 12 +- freetype/builds/windows/visualc/index.html | 10 +- freetype/builds/windows/visualce/freetype.dsp | 34 +- freetype/builds/windows/visualce/freetype.vcproj | 84 +- freetype/builds/windows/visualce/index.html | 10 +- freetype/devel/ftoption.h | 65 +- freetype/docs/CHANGES | 90 +- freetype/docs/VERSION.DLL | 2 + freetype/docs/formats.txt | 2 +- freetype/docs/freetype-config.1 | 2 +- freetype/docs/reference/ft2-auto_hinter.html | 329 +- freetype/docs/reference/ft2-base_interface.html | 4814 +++++++++----------- freetype/docs/reference/ft2-basic_types.html | 1525 +++---- freetype/docs/reference/ft2-bdf_fonts.html | 336 +- freetype/docs/reference/ft2-bitmap_handling.html | 383 +- freetype/docs/reference/ft2-bzip2.html | 151 +- freetype/docs/reference/ft2-cache_subsystem.html | 1500 +++--- freetype/docs/reference/ft2-cff_driver.html | 231 +- freetype/docs/reference/ft2-cid_fonts.html | 278 +- freetype/docs/reference/ft2-computations.html | 1002 ++-- freetype/docs/reference/ft2-font_formats.html | 145 +- freetype/docs/reference/ft2-gasp_table.html | 215 +- freetype/docs/reference/ft2-glyph_management.html | 687 ++- freetype/docs/reference/ft2-glyph_stroker.html | 1161 +++-- freetype/docs/reference/ft2-glyph_variants.html | 347 +- freetype/docs/reference/ft2-gx_validation.html | 534 +-- freetype/docs/reference/ft2-gzip.html | 213 +- .../docs/reference/ft2-header_file_macros.html | 1011 ++-- freetype/docs/reference/ft2-header_inclusion.html | 105 +- freetype/docs/reference/ft2-incremental.html | 450 +- freetype/docs/reference/ft2-index.html | 632 +-- freetype/docs/reference/ft2-lcd_filtering.html | 255 +- freetype/docs/reference/ft2-list_processing.html | 630 ++- freetype/docs/reference/ft2-lzw.html | 151 +- freetype/docs/reference/ft2-mac_specific.html | 436 +- freetype/docs/reference/ft2-module_management.html | 974 ++-- freetype/docs/reference/ft2-multiple_masters.html | 563 ++- freetype/docs/reference/ft2-ot_validation.html | 313 +- .../docs/reference/ft2-outline_processing.html | 1485 +++--- freetype/docs/reference/ft2-pfr_fonts.html | 268 +- freetype/docs/reference/ft2-quick_advance.html | 256 +- freetype/docs/reference/ft2-raster.html | 732 ++- freetype/docs/reference/ft2-sfnt_names.html | 298 +- freetype/docs/reference/ft2-sizes_management.html | 234 +- freetype/docs/reference/ft2-system_interface.html | 474 +- freetype/docs/reference/ft2-toc.html | 279 +- freetype/docs/reference/ft2-truetype_engine.html | 198 +- freetype/docs/reference/ft2-truetype_tables.html | 1477 +++--- freetype/docs/reference/ft2-tt_driver.html | 178 +- freetype/docs/reference/ft2-type1_tables.html | 1087 +++-- freetype/docs/reference/ft2-user_allocation.html | 105 +- freetype/docs/reference/ft2-version.html | 321 +- freetype/docs/reference/ft2-winfnt_fonts.html | 306 +- freetype/docs/release | 5 +- freetype/include/config/ftconfig.h | 246 +- freetype/include/config/ftoption.h | 65 +- freetype/include/freetype.h | 252 +- freetype/include/ftadvanc.h | 9 +- freetype/include/ftautoh.h | 22 +- freetype/include/ftbbox.h | 1 - freetype/include/ftbdf.h | 4 +- freetype/include/ftbitmap.h | 9 +- freetype/include/ftbzip2.h | 2 +- freetype/include/ftcache.h | 8 +- freetype/include/ftcffdrv.h | 18 +- freetype/include/ftcid.h | 3 +- freetype/include/fterrdef.h | 182 +- freetype/include/ftgasp.h | 3 +- freetype/include/ftglyph.h | 21 +- freetype/include/ftgxval.h | 25 +- freetype/include/ftgzip.h | 3 +- freetype/include/ftimage.h | 204 +- freetype/include/ftincrem.h | 5 +- freetype/include/ftlcdfil.h | 4 +- freetype/include/ftlist.h | 5 +- freetype/include/ftlzw.h | 2 +- freetype/include/ftmm.h | 4 - freetype/include/ftmodapi.h | 30 +- freetype/include/ftotval.h | 15 +- freetype/include/ftoutln.h | 18 +- freetype/include/ftpfr.h | 2 +- freetype/include/ftrender.h | 1 - freetype/include/ftstroke.h | 44 +- freetype/include/ftsynth.h | 1 + freetype/include/ftsystem.h | 12 +- freetype/include/fttrigon.h | 4 +- freetype/include/ftttdrv.h | 2 +- freetype/include/fttypes.h | 8 +- freetype/include/ftwinfnt.h | 2 +- freetype/include/ftxf86.h | 3 +- freetype/include/internal/ftcalc.h | 289 +- freetype/include/internal/ftgloadr.h | 30 +- freetype/include/internal/ftobjs.h | 18 +- freetype/include/internal/ftvalid.h | 24 +- freetype/include/internal/pshints.h | 4 +- freetype/include/internal/sfnt.h | 16 +- freetype/include/t1tables.h | 120 +- freetype/include/ttnameid.h | 230 +- freetype/include/tttables.h | 64 +- freetype/include/ttunpat.h | 3 +- freetype/src/autofit/afangles.c | 60 - freetype/src/autofit/afblue.c | 109 +- freetype/src/autofit/afblue.dat | 257 +- freetype/src/autofit/afblue.h | 88 +- freetype/src/autofit/afblue.hin | 14 +- freetype/src/autofit/afcjk.c | 89 +- freetype/src/autofit/afcjk.h | 4 +- freetype/src/autofit/afglobal.c | 9 +- freetype/src/autofit/afglobal.h | 8 +- freetype/src/autofit/afhints.c | 267 +- freetype/src/autofit/afhints.h | 55 +- freetype/src/autofit/aflatin.c | 221 +- freetype/src/autofit/aflatin.h | 17 +- freetype/src/autofit/aflatin2.c | 16 +- freetype/src/autofit/afloader.c | 6 +- freetype/src/autofit/afmodule.c | 8 +- freetype/src/autofit/afranges.c | 84 +- freetype/src/autofit/afscript.h | 21 +- freetype/src/autofit/afstyles.h | 18 +- freetype/src/autofit/hbshim.c | 16 +- freetype/src/base/ftadvanc.c | 8 +- freetype/src/base/ftbbox.c | 223 +- freetype/src/base/ftbdf.c | 43 +- freetype/src/base/ftbitmap.c | 224 +- freetype/src/base/ftcalc.c | 475 +- freetype/src/base/ftfstype.c | 4 +- freetype/src/base/ftglyph.c | 10 +- freetype/src/base/ftgxval.c | 6 +- freetype/src/base/ftinit.c | 22 +- freetype/src/base/ftlcdfil.c | 46 +- freetype/src/base/ftmac.c | 25 +- freetype/src/base/ftmm.c | 32 +- freetype/src/base/ftobjs.c | 263 +- freetype/src/base/ftoutln.c | 55 +- freetype/src/base/ftpfr.c | 15 +- freetype/src/base/ftrfork.c | 8 +- freetype/src/base/ftstream.c | 5 +- freetype/src/base/ftstroke.c | 87 +- freetype/src/base/ftsynth.c | 25 +- freetype/src/base/fttrigon.c | 100 +- freetype/src/base/fttype1.c | 45 +- freetype/src/base/ftutil.c | 63 +- freetype/src/base/ftwinfnt.c | 22 +- freetype/src/bdf/bdfdrivr.c | 12 +- freetype/src/bdf/bdflib.c | 86 +- freetype/src/bzip2/ftbzip2.c | 14 +- freetype/src/cache/ftcbasic.c | 81 +- freetype/src/cache/ftccmap.c | 13 +- freetype/src/cache/ftcmanag.c | 31 +- freetype/src/cache/ftcsbits.c | 8 +- freetype/src/cff/cf2font.c | 39 +- freetype/src/cff/cf2ft.c | 48 +- freetype/src/cff/cf2hints.c | 17 +- freetype/src/cff/cf2intrp.c | 21 +- freetype/src/cff/cffcmap.c | 10 +- freetype/src/cff/cffdrivr.c | 4 +- freetype/src/cff/cffgload.c | 41 +- freetype/src/cff/cffobjs.c | 44 +- freetype/src/cff/cffparse.c | 2 +- freetype/src/gxvalid/gxvbsln.c | 56 +- freetype/src/gxvalid/gxvcommn.c | 274 +- freetype/src/gxvalid/gxvcommn.h | 80 +- freetype/src/gxvalid/gxvfeat.c | 38 +- freetype/src/gxvalid/gxvjust.c | 188 +- freetype/src/gxvalid/gxvkern.c | 152 +- freetype/src/gxvalid/gxvlcar.c | 36 +- freetype/src/gxvalid/gxvmort.c | 44 +- freetype/src/gxvalid/gxvmort.h | 14 +- freetype/src/gxvalid/gxvmort0.c | 16 +- freetype/src/gxvalid/gxvmort1.c | 54 +- freetype/src/gxvalid/gxvmort2.c | 46 +- freetype/src/gxvalid/gxvmort4.c | 18 +- freetype/src/gxvalid/gxvmort5.c | 30 +- freetype/src/gxvalid/gxvmorx.c | 30 +- freetype/src/gxvalid/gxvmorx.h | 10 +- freetype/src/gxvalid/gxvmorx0.c | 16 +- freetype/src/gxvalid/gxvmorx1.c | 50 +- freetype/src/gxvalid/gxvmorx2.c | 48 +- freetype/src/gxvalid/gxvmorx4.c | 4 +- freetype/src/gxvalid/gxvmorx5.c | 34 +- freetype/src/gxvalid/gxvopbd.c | 32 +- freetype/src/gxvalid/gxvprop.c | 38 +- freetype/src/gxvalid/gxvtrak.c | 46 +- freetype/src/gzip/ftgzip.c | 21 +- freetype/src/gzip/inftrees.c | 10 +- freetype/src/lzw/ftlzw.c | 16 +- freetype/src/lzw/ftzopen.h | 2 +- freetype/src/otvalid/otvbase.c | 50 +- freetype/src/otvalid/otvcommn.c | 170 +- freetype/src/otvalid/otvcommn.h | 158 +- freetype/src/otvalid/otvgdef.c | 36 +- freetype/src/otvalid/otvgpos.c | 186 +- freetype/src/otvalid/otvgsub.c | 108 +- freetype/src/otvalid/otvjstf.c | 83 +- freetype/src/otvalid/otvmath.c | 72 +- freetype/src/pcf/README | 2 +- freetype/src/pcf/pcfdrivr.c | 12 +- freetype/src/pcf/pcfread.c | 108 +- freetype/src/pfr/pfrcmap.c | 5 +- freetype/src/pfr/pfrdrivr.c | 6 +- freetype/src/pfr/pfrgload.c | 2 +- freetype/src/pfr/pfrload.c | 2 +- freetype/src/pfr/pfrobjs.c | 5 +- freetype/src/pfr/pfrsbit.c | 6 +- freetype/src/psaux/psconv.c | 9 +- freetype/src/psaux/psobjs.c | 10 +- freetype/src/psaux/t1cmap.c | 22 +- freetype/src/psaux/t1decode.c | 12 +- freetype/src/pshinter/pshglob.c | 6 +- freetype/src/pshinter/pshglob.h | 4 +- freetype/src/pshinter/pshrec.c | 5 +- freetype/src/pshinter/pshrec.h | 4 +- freetype/src/psnames/psmodule.c | 4 +- freetype/src/raster/ftraster.c | 21 +- freetype/src/sfnt/pngshim.c | 22 +- freetype/src/sfnt/sfdriver.c | 24 +- freetype/src/sfnt/sfntpic.h | 22 +- freetype/src/sfnt/sfobjs.c | 54 +- freetype/src/sfnt/ttcmap.c | 56 +- freetype/src/sfnt/ttkern.c | 2 +- freetype/src/sfnt/ttload.c | 12 +- freetype/src/sfnt/ttmtx.c | 6 +- freetype/src/sfnt/ttmtx.h | 4 +- freetype/src/sfnt/ttpost.c | 12 +- freetype/src/sfnt/ttsbit.c | 60 +- freetype/src/smooth/ftgrays.c | 63 +- freetype/src/smooth/ftsmooth.c | 147 +- freetype/src/tools/afblue.pl | 7 +- freetype/src/tools/docmaker/content.py | 216 +- freetype/src/tools/docmaker/docmaker.py | 39 +- freetype/src/tools/docmaker/formatter.py | 73 +- freetype/src/tools/docmaker/sources.py | 200 +- freetype/src/tools/docmaker/tohtml.py | 445 +- freetype/src/tools/docmaker/utils.py | 81 +- freetype/src/tools/ftrandom/README | 2 +- freetype/src/tools/ftrandom/ftrandom.c | 4 +- freetype/src/tools/test_trig.c | 16 +- freetype/src/truetype/ttdriver.c | 8 +- freetype/src/truetype/ttgload.c | 69 +- freetype/src/truetype/ttgxvar.c | 6 +- freetype/src/truetype/ttinterp.c | 216 +- freetype/src/truetype/ttinterp.h | 23 +- freetype/src/truetype/ttobjs.c | 172 +- freetype/src/truetype/ttobjs.h | 12 +- freetype/src/truetype/ttpload.c | 12 +- freetype/src/truetype/ttsubpix.c | 6 +- freetype/src/type1/t1driver.c | 5 +- freetype/src/type1/t1load.c | 9 +- freetype/src/type42/t42objs.c | 10 +- freetype/src/type42/t42parse.c | 48 +- freetype/src/winfonts/winfnt.c | 17 +- packages.txt | 2 +- 289 files changed, 22109 insertions(+), 19672 deletions(-) create mode 100755 freetype/builds/cmake/iOS.cmake create mode 100755 freetype/builds/mac/freetype-Info.plist create mode 100755 freetype/builds/windows/vc2010/freetype.user.props diff --git a/freetype/CMakeLists.txt b/freetype/CMakeLists.txt index a4e583d33..8b859a57e 100644 --- a/freetype/CMakeLists.txt +++ b/freetype/CMakeLists.txt @@ -16,13 +16,28 @@ # # cmake CMakeLists.txt # -# to create a Makefile that builds a static version of the library. For a -# dynamic library, use +# to create a Makefile that builds a static version of the library. +# +# For a dynamic library, use # # cmake CMakeLists.txt -DBUILD_SHARED_LIBS:BOOL=true # -# instead. Please refer to the cmake manual for further options, in -# particular, how to modify compilation and linking parameters. +# For a framework on OS X, use +# +# cmake CMakeLists.txt -DBUILD_FRAMEWORK:BOOL=true -G Xcode +# +# instead. +# +# For an iOS static library, use +# +# cmake CMakeLists.txt -DIOS_PLATFORM=OS -G Xcode +# +# or +# +# cmake CMakeLists.txt -DIOS_PLATFORM=SIMULATOR -G Xcode +# +# Please refer to the cmake manual for further options, in particular, how +# to modify compilation and linking parameters. # # Some notes. # @@ -37,11 +52,54 @@ cmake_minimum_required(VERSION 2.6) +# CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which +# configures the base build environment and references the toolchain file +if (APPLE) + if (DEFINED IOS_PLATFORM) + if (NOT "${IOS_PLATFORM}" STREQUAL "OS" + AND NOT "${IOS_PLATFORM}" STREQUAL "SIMULATOR") + message(FATAL_ERROR + "IOS_PLATFORM must be set to either OS or SIMULATOR") + endif () + if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode") + message(AUTHOR_WARNING + "You should use Xcode generator with IOS_PLATFORM enabled to get Universal builds.") + endif () + if (BUILD_SHARED_LIBS) + message(FATAL_ERROR + "BUILD_SHARED_LIBS can not be on with IOS_PLATFORM enabled") + endif () + if (BUILD_FRAMEWORK) + message(FATAL_ERROR + "BUILD_FRAMEWORK can not be on with IOS_PLATFORM enabled") + endif () + + # iOS only uses static libraries + set(BUILD_SHARED_LIBS OFF) + + set(CMAKE_TOOLCHAIN_FILE + ${PROJECT_SOURCE_DIR}/builds/cmake/iOS.cmake) + endif () +else () + if (DEFINED IOS_PLATFORM) + message(FATAL_ERROR "IOS_PLATFORM is not supported on this platform") + endif () +endif () + project(freetype) +if (BUILD_FRAMEWORK) + if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode") + message(FATAL_ERROR + "You should use Xcode generator with BUILD_FRAMEWORK enabled") + endif () + set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)") + set(BUILD_SHARED_LIBS ON) +endif () + set(VERSION_MAJOR "2") set(VERSION_MINOR "5") -set(VERSION_PATCH "3") +set(VERSION_PATCH "5") set(PROJECT_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) # Compiler definitions for building the library @@ -51,22 +109,27 @@ add_definitions(-DFT2_BUILD_LIBRARY) include_directories("${PROJECT_SOURCE_DIR}/include") # Create the configuration file -message(STATUS "Creating directory, ${PROJECT_BINARY_DIR}/include.") -file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include) +message(STATUS "Creating directory, ${PROJECT_BINARY_DIR}/include/freetype2.") +file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/freetype2) # For the auto-generated ftconfig.h file -include_directories("${PROJECT_BINARY_DIR}/include") -message(STATUS "Creating ${PROJECT_BINARY_DIR}/include/ftconfig.h.") +include_directories(BEFORE "${PROJECT_BINARY_DIR}/include/freetype2") +message(STATUS "Creating ${PROJECT_BINARY_DIR}/include/freetype2/ftconfig.h.") execute_process( COMMAND sed -e "s/FT_CONFIG_OPTIONS_H//" -e "s/FT_CONFIG_STANDARD_LIBRARY_H//" -e "s?/undef ?#undef ?" INPUT_FILE ${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in - OUTPUT_FILE ${PROJECT_BINARY_DIR}/include/ftconfig.h + OUTPUT_FILE ${PROJECT_BINARY_DIR}/include/freetype2/ftconfig.h ) +file(GLOB PUBLIC_HEADERS "include/*.h") +file(GLOB PUBLIC_CONFIG_HEADERS "include/config/*.h") +file(GLOB PRIVATE_HEADERS "include/internal/*.h") + set(BASE_SRCS src/autofit/autofit.c src/base/ftadvanc.c src/base/ftbbox.c + src/base/ftbdf.c src/base/ftbitmap.c src/base/ftcalc.c src/base/ftcid.c @@ -125,7 +188,31 @@ include_directories("src/raster") include_directories("src/psaux") include_directories("src/psnames") -add_library(freetype ${BASE_SRCS}) +if (BUILD_FRAMEWORK) + set(BASE_SRCS + ${BASE_SRCS} + builds/mac/freetype-Info.plist + ) +endif () + +add_library(freetype + ${PUBLIC_HEADERS} + ${PUBLIC_CONFIG_HEADERS} + ${PRIVATE_HEADERS} + ${BASE_SRCS} +) + +if (BUILD_FRAMEWORK) + set_property(SOURCE ${PUBLIC_CONFIG_HEADERS} + PROPERTY MACOSX_PACKAGE_LOCATION Headers/config + ) + set_target_properties(freetype PROPERTIES + FRAMEWORK TRUE + MACOSX_FRAMEWORK_INFO_PLIST builds/mac/freetype-Info.plist + PUBLIC_HEADER "${PUBLIC_HEADERS}" + XCODE_ATTRIBUTE_INSTALL_PATH "@rpath" + ) +endif () # Installations # Note the trailing slash in the argument to the `DIRECTORY' directive @@ -137,6 +224,7 @@ install(TARGETS freetype RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib + FRAMEWORK DESTINATION Library/Frameworks ) # Packaging diff --git a/freetype/ChangeLog b/freetype/ChangeLog index ea1eb4acb..809b475f0 100644 --- a/freetype/ChangeLog +++ b/freetype/ChangeLog @@ -1,3 +1,1960 @@ +2014-12-30 Werner Lemberg + + * Version 2.5.5 released. + ========================= + + + Tag sources with `VER-2-5-5'. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.5.5. + + * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, + builds/windows/vc2005/index.html, + builds/windows/vc2008/freetype.vcproj, + builds/windows/vc2008/index.html, + builds/windows/vc2010/freetype.vcxproj, + builds/windows/vc2010/index.html, + builds/windows/visualc/freetype.dsp, + builds/windows/visualc/freetype.vcproj, + builds/windows/visualc/index.html, + builds/windows/visualce/freetype.dsp, + builds/windows/visualce/freetype.vcproj, + builds/windows/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.5.4/2.5.5/, s/254/255/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5. + + * builds/unix/configure.raw (version_info): Set to 17:4:11. + * CMakeLists.txt (VERSION_PATCH): Set to 5. + * docs/CHANGES: Updated. + +2014-12-24 Alexei Podtelezhnikov + + [base] Formatting and nanooptimizations. + + * src/base/ftcalc.c, + * src/base/fttrigon.c: Revise sign restoration. + +2014-12-13 Werner Lemberg + + * src/pcf/pcfread.c (pcf_read_TOC): Improve fix from 2014-12-08. + +2014-12-11 Werner Lemberg + + * builds/toplevel.mk (dist): Use older POSIX standard for `tar'. + + Apparently, BSD tar isn't capable yet of handling POSIX-1.2001 + (contrary to GNU tar), so force the POSIX-1.1988 format. + + Problem reported by Stephen Fisher . + +2014-12-11 Werner Lemberg + + * src/type42/t42parse.c (t42_parse_sfnts): Reject invalid TTF size. + +2014-12-11 Werner Lemberg + + * src/base/ftobjs.c (FT_Get_Glyph_Name): Fix off-by-one check. + + Problem reported by Dennis Felsing . + +2014-12-11 Werner Lemberg + + * src/type42/t42parse.c (t42_parse_sfnts): Check `string_size'. + + Problem reported by Dennis Felsing . + +2014-12-09 suzuki toshiya + + [gxvalid] Fix a naming convention conflicting with ftvalid. + + See previous changeset for otvalid. + + * src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace + `valid' by `gxvalid'. + * src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c, + gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c, + gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c, + gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c, + gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if + it is typed as GXV_Validator. + +2014-12-09 suzuki toshiya + + [otvalid] Fix a naming convention conflicting with ftvalid. + + Some prototypes in ftvalid.h use `valid' for the variables + typed as FT_Validator. Their implementations in src/base/ + ftobjs.c and utilizations in src/sfnt/ttcmap.c do similar. + + Some macros in otvcommn.h assume the exist of the variable + `valid' typed as OTV_Validator in the caller. + + Mixing these two conventions cause invalid pointer conversion + and unexpected SEGV in longjmp. To prevent it, all variables + typed as OTV_Validator are renamed to `otvalid'. + + * src/otvalid/otvcommn.h: Replace `valid' by `otvalid'. + * src/otvalid/{otvcommn.c, otvbase.c, otvgdef.c, otvgpos.c, + otvgsub.c, otvjstf.c, otvmath.c}: Replace `valid' by `otvalid' + if it is typed as OTV_Validator. + +2014-12-09 suzuki toshiya + + [ftvalid] Introduce FT_THROW() in FT_INVALID_XXX macros. + + Original patch is designed by Werner Lemberg. Extra part + for otvalid and gxvalid are added by suzuki toshiya, see + discussion: + http://lists.nongnu.org/archive/html/freetype-devel/2014-12/msg00002.html + http://lists.nongnu.org/archive/html/freetype-devel/2014-12/msg00007.html + + * include/internal/ftvalid.h: Introduce FT_THROW() in FT_INVALID_(). + * src/gxvalid/gxvcommn.h: Ditto. + * src/otvalid/otvcommn.h: Ditto. + +2014-12-08 Werner Lemberg + + [pcf] Fix Savannah bug #43774. + + Work around `features' of X11's `pcfWriteFont' and `pcfReadFont' + functions. Since the PCF format doesn't have an official + specification, we have to exactly follow these functions' behaviour. + + The problem was unveiled with a patch from 2014-11-06, fixing issue + #43547. + + * src/pcf/pcfread.c (pcf_read_TOC): Don't check table size for last + element. Instead, assign real size. + +2014-12-07 Werner Lemberg + + Work around a bug in Borland's C++ compiler. + + See + + http://qc.embarcadero.com/wc/qcmain.aspx?d=118998 + + for Borland's bug tracker entry. + + Reported by Yuliana Zigangirova , + http://lists.gnu.org/archive/html/freetype-devel/2014-04/msg00001.html. + + * include/internal/ftvalid.h (FT_ValidatorRec), src/smooth/ftgrays.c + (gray_TWorker_): Move `ft_jmp_buf' field to be the first element. + +2014-12-07 Werner Lemberg + + */*: Decorate hex constants with `U' and `L' where appropriate. + +2014-12-07 Werner Lemberg + + [truetype] Prevent memory leak for buggy fonts. + + * src/truetype/ttobjs.c (tt_size_done): Unconditionally call + `tt_size_done_bytecode'. + +2014-12-06 Werner Lemberg + + * Version 2.5.4 released. + ========================= + + + Tag sources with `VER-2-5-4'. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.5.4. + + * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, + builds/windows/vc2005/index.html, + builds/windows/vc2008/freetype.vcproj, + builds/windows/vc2008/index.html, + builds/windows/vc2010/freetype.vcxproj, + builds/windows/vc2010/index.html, + builds/windows/visualc/freetype.dsp, + builds/windows/visualc/freetype.vcproj, + builds/windows/visualc/index.html, + builds/windows/visualce/freetype.dsp, + builds/windows/visualce/freetype.vcproj, + builds/windows/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.5.3/2.5.4/, s/253/254/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4. + + * builds/unix/configure.raw (version_info): Set to 17:3:11. + * CMakeLists.txt (VERSION_PATCH): Set to 4. + * docs/CHANGES: Updated. + +2014-12-04 Werner Lemberg + + docs/CHANGES: Updated, formatted. + +2014-12-04 Dave Arnold + + [cff] Modify an FT_ASSERT. + + * src/cff/cf2hints.c (cf2_hintmap_map): After the fix for Savannah + bug #43661, the test font `...aspartam.otf' still triggers an + FT_ASSERT. Since hintmap still works with count==0, ... + (cf2_glyphpath_lineTo, cf2_glyphpath_curveTo): ... add that term to + suppress the assert. + +2014-12-04 Dave Arnold + + [cff] Fix Savannah bug #43661. + + * src/cff/cf2intrp.c (cf2_interpT2CharString) : Don't append to stem arrays after + hintmask is constructed. + + * src/cff/cf2hints.c (cf2_hintmap_build): Add defensive code to + avoid reading past end of hintmask. + +2014-12-03 Werner Lemberg + + docs/CHANGES: Updated. + +2014-12-03 Werner Lemberg + + [autofit] Better fix for conversion specifiers in debug messages. + + Using `%ld' for pointer differences causes warnings on 32bit + platforms. The correct type would be (the relatively new) `%td', + however, this is missing on some important platforms. + + This patch improves the change from 2014-11-28. + + * src/autofit/afhints.c (AF_INDEX_NUM): Use `int' typecast. Our + pointer differences are always sufficiently small. + (af_glyph_hints_dump_points, af_glyph_hints_dump_segments, + af_glyph_hints_dump_edge): Revert to `%d' and use `AF_INDEX_NUM'. + +2014-12-03 Werner Lemberg + + FT_Sfnt_Tag: s/ft_sfnt_xxx/FT_SFNT_XXX/ for orthogonality. + + All public FreeType enumeration and flag values are uppercase... + + * include/tttables.h (FT_Sfnt_Tag): Implement it. For backwards + compatilibity, retain the old values as macros. + + * src/base/ftfstype.c (FT_Get_FSType_Flags), src/sfnt/sfdriver.c + (get_sfnt_table): Updated. + +2014-12-02 Werner Lemberg + + * include/*: Improve structure of documentation. + + . Add and update many `' tags. + . Apply various documentation fixes. + . Remove details to deprecated (or never implemented) data. + +2014-12-02 Werner Lemberg + + [docmaker] Always handle `' section elements. + + Previously, those elements were handled only for sections present in + a `' chapter element. + + * src/tools/docmaker/content.py (ContentProcessor::finish): + Implement it. + +2014-12-02 Werner Lemberg + + [docmaker] Properly handle empty rows in Synopsis. + + * src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Emit + ` ' for empty fields. + +2014-12-02 Werner Lemberg + + [docmaker] Thinko. + + * src/tools/docmaker/content.py (DocBlock::get_markup_words_all): + Emit `/empty/' string for first element also. + +2014-12-02 Werner Lemberg + + [docmaker] Honour empty lines in `' section element. + + This greatly improves the readability of the `Synopsis' links. + + * src/tools/docmaker/content.py (DocBlock::get_markup_words_all): + Insert string `/empty/' between items. + + * src/tools/docmaker/formatter.py (Formatter::section_dump): Make it + robust against nonexistent keys. + + * src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Emit + empty elements for `/empty/'. + +2014-12-02 Werner Lemberg + + [docmaker] Ensure Python 3 compatibility. + + * src/tools/docmaker/content.py (ContentProcessor::set_section, + ContentProcessor::finish): Replace `has_key' function with `in' + keyword. + + * src/tools/docmaker/formatter.py (Formatter::__init__): Replace + sorting function with a key generator. + (Formatter::add_identifier): Replace `has_key' function with `in' + keyword. + + * src/tools/docmaker/tohtml.py (HtmlFormatter::html_source_quote): + Replace `has_key' function with `in' keyword. + (HtmlFormatter::index_exit, HtmlFormatter::section_enter): Use + integer division. + s/<>/>/. + + * src/tools/docmaker/utils.py: Import `itertools'. + (index_sort): Replaced by... + (index_key): ... this new key generator (doing exactly the same). + +2014-11-29 Werner Lemberg + + [docmaker] Don't output a block multiple times. + + This bug was hidden by not processing all lines of `' blocks. + + * src/tools/docmaker/formatter.py (Formatter::section_dump): Filter + out field names. + +2014-11-29 Werner Lemberg + + [docmaker] Use field values as HTML link targets where possible. + + * src/tools/docmaker/tohtml.py (HtmlFormatter::make_block_url): + Accept second, optional argument to specify a name. + (HtmlFormatter::html_source_quote): Link to field ID if possible. + (HtmlFormatter::print_html_field_list): Emit `id' attribute. + +2014-11-29 Werner Lemberg + + [docmaker] Allow empty lines in `' blocks. + + Before this patch, the suggested order of entries stopped at the + first empty line. + + Obviously, nobody noticed that this problem caused a much reduced + set of links in the `Synopsis' sections; in particular, the + `' blocks contain a lot of entries that wouldn't be listed + otherwise... + + * src/tools/docmaker/content.py (DocBlock::get_markup_words_all): + New function to iterate over all items. + (DocSection::process): Use it. + +2014-11-29 Werner Lemberg + + * src/tools/docmaker/sources.py (column) [Format 2]: Fix regexp. + + After the single asterisk there must be no other immediately following + asterisk. + +2014-11-29 Werner Lemberg + + * src/tools/docmaker/tohtml.py: Improve CSS for vertical spacing. + +2014-11-29 Werner Lemberg + + [docmaker] Improve HTML code for table of contents. + + * src/tools/docmaker/tohtml.py: Introduce a new table class `toc', + together with proper CSS. + +2014-11-29 Werner Lemberg + + [docmaker] Provide higher-level markup and simplify HTML. + + * src/tools/docmaker/tohtml.py: Instead of using extraneous `
' + elements, use CSS descendants (of class `section') to format the + data. + + Also remove reduntant

and
elements, replacing them with + proper CSS. + + Globally reduce page width to 75%. + + (block_header): Rename

class to `section'. + +2014-11-29 Werner Lemberg + + [docmaker] Add `top' links after blocks. + + * src/tools/docmaker/tohtml.py (block_footer_middle): Implement it. + +2014-11-29 Werner Lemberg + + * src/tools/docmaker/tohtml.py: Improve CSS for fields. + + Make fields align horizontally relative to full line width. + +2014-11-29 Werner Lemberg + + * src/tools/docmaker/tohtml.py: Fix index and TOC templates. + + This thinko was introduced 2014-11-27. + +2014-11-28 Werner Lemberg + + [docmaker] Format field lists with CSS. + + This also simplifies the inserted HTML code. + + * src/tools/docmaker/tohtml.py + (HtmlFormatter::print_html_field_list): Do it. + +2014-11-28 suzuki toshiya + + Fix compiler warning to the comparison between signed and + unsigned variable. + + * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Fix the comparison + between `ypos + ysize' and FT_INT_{MAX,MIN}. + +2014-11-28 Werner Lemberg + + [docmaker] Replace empty `' with CSS. + + * src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Do + it. + +2014-11-28 Werner Lemberg + + [docmaker] Replace some `' tags with `

' and `
'. + + * src/tools/docmaker/tohtml.py (marker_*): Use `

'. + (source_*): Use `
'. + (HtmlFormatter::block_enter): s/

/

/. + +2014-11-28 suzuki toshiya + + Fix compiler warning to conversion specifiers in debug messages. + + * src/autofit/afhints.c (af_glyph_hints_dump_points): Add length + modifier to dump long integers. + (af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Ditto. + +2014-11-27 Werner Lemberg + + * src/tools/docmaker/tohtml.py: Use more CSS for index. + +2014-11-27 Werner Lemberg + + [docmaker] Replace `name' attribute of `' with `id'. + + * src/tools/docmaker/tohtml.py (HtmlFormatter::block_enter): Do it. + +2014-11-27 Werner Lemberg + + * src/tools/docmaker/tohtml.py: Remove remaining `width' attributes. + + For `Index' and `TOC' links, we now simply use the `text-align' CSS + property of `

' to enforce flush-left and flush-right, + eliminating the hack with an empty, full-width `' element + inbetween. + + The change also enforces the same (smaller) size for all index and + TOC links. + +2014-11-27 suzuki toshiya + + * src/cff/cf2font.c: Include `ftcalc.h' to use FT_MSB(), + cf2font.c could not find it under `make multi' build. + +2014-11-27 suzuki toshiya + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove + unrequired negative value check for `width' and `height'. + +2014-11-27 Werner Lemberg + + * src/tools/docmaker/tohtml.py: More HTML table refactoring. + + Replace some `' tags with `
' to simplify structure. + + Move `bgcolor' attribute to CSS. + + Replace most `width' attributes with CSS. The remaining instances + (providing a similar effect as LaTeX's `\hfill' command) are removed + in a later patch. + +2014-11-27 Werner Lemberg + + * src/tools/docmaker/tohtml.py: Replace with CSS. + +2014-11-27 Werner Lemberg + + * src/tools/docmaker/tohtml.py: Center
with CSS. + +2014-11-27 Werner Lemberg + + * src/tools/docmaker/tohtml.py: Replace `
' with `
'. + +2014-11-27 Werner Lemberg + + * src/tools/docmaker/tohtml.py: Remove redundant `
' tags. + + This starts a series of commits into the direction of generating + valid HTML 5 code, especially using much more CSS. + +2014-11-27 suzuki toshiya + + Prevent too negative values (< FT_INT_MIN) in bitmap metrics, + suggested by Alexei. + + * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Prevent too + negative values in `xpos' and `ypos + ysize'. + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Prevent + too negative values in `x_left' and `y_top'. Either negative + values in `width' and `height' are checked. + +2014-11-27 Werner Lemberg + + [docmaker] Produce better HTML code. + + * src/tools/docmaker/tohtml.py: Always use double quotes for + attribute values. + (source_footer): Close `td' and `tr' groups. + +2014-11-27 Werner Lemberg + + Use better way to disable creation of .pyc files for `make refdoc'. + + Python 2.6 was released in 2008... + + * builds/freetype.mk (refdoc): Use python's `-B' option. + + * builds/detect.mk (std_setup, dos_setup): Mention required python + version for `refdoc' target. + +2014-11-27 Werner Lemberg + + * src/tools/docmaker/sources.py (re_bold, re_italic): Use + non-grouping parentheses. + * src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_word): + Updated. + +2014-11-27 Werner Lemberg + + * src/base/ftobjs.c (FT_Get_Glyph_Name): Fix compiler warning. + + Introdruced in previous change. Reported by Alexei. + +2014-11-26 Werner Lemberg + + * src/*: Add checks for parameters of API functions where missing. + + `API functions' are functions tagged with `FT_EXPORT_DEF'. + + Besides trivial fixes, the following changes are included, too. + + * src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Set + error code if no service is available. + + * src/base/ftinit.c (FT_Done_FreeType): Change return value for + invalid `library' parameter to `Invalid_Library_Handle'. + + * src/base/ftobjs.c (FT_New_Size): Change return value for invalid + `asize' parameter to `Invalid_Argument'. + + * src/base/ftoutln.c (FT_Outline_Copy): Change return value for + invalid `source' and `target' parameters to `Invalid_Outline'. + (FT_Outline_Done_Internal): Change return value for invalid + `outline' parameter to `Invalid_Outline'. + +2014-11-26 Werner Lemberg + + * src/cache/ftcbasic.c: Use single calls to `FT_TRACE'. + +2014-11-26 suzuki toshiya + + * src/base/ftobj.c (Mac_Read_POST_Resource): Additional + overflow check in the summation of POST fragment lengths, + suggested by Mateusz Jurczyk . + +2014-11-26 suzuki toshiya + + * src/base/ftobjs.c (Mac_Read_POST_Resource): Insert comments + and fold too long tracing messages. + +2014-11-26 suzuki toshiya + + Fix Savannah bug #43540. + + * src/base/ftmac.c (parse_fond): Prevent a buffer overrun + caused by a font including too many (> 63) strings to store + names[] table. + +2014-11-26 suzuki toshiya + + * src/base/ftobjs.c (Mac_Read_POST_Resource): Use unsigned long + variables to read the lengths in POST fragments. Suggested by + Mateusz Jurczyk . + +2014-11-26 suzuki toshiya + + Fix Savannah bug #43539. + + * src/base/ftobjs.c (Mac_Read_POST_Resource): Fix integer overflow + by a broken POST table in resource-fork. + +2014-11-26 suzuki toshiya + + Fix Savannah bug #43538. + + * src/base/ftobjs.c (Mac_Read_POST_Resource): Fix integer overflow + by a broken POST table in resource-fork. + +2014-11-26 suzuki toshiya + + * src/base/ftobjs.c (Mac_Read_POST_Resource): Avoid memory leak + by a broken POST table in resource-fork. Return after freeing + the buffered POST table when it is found to be broken. + +2014-11-25 Werner Lemberg + + */*: s/Invalid_Argument/Invalid_Size_Handle/ where appropriate. + +2014-11-25 Werner Lemberg + + */*: s/Invalid_Argument/Invalid_Stream_Handle/ where appropriate. + +2014-11-25 Werner Lemberg + + */*: s/Invalid_Argument/Invalid_Library_Handle/ where appropriate. + +2014-11-25 Werner Lemberg + + */*: s/Invalid_Argument/Invalid_Outline/ where appropriate. + +2014-11-25 Werner Lemberg + + */*: s/Invalid_Argument/Invalid_Face_Handle/ where appropriate. + +2014-11-24 Werner Lemberg + + [Savannah bug #43682] Adjust some renderer callbacks. + + * src/raster/ftraster.c (ft_black_set_mode): Change return type to + `int' to stay in sync with `FT_Renderer_SetModeFunc' prototype. + + * src/smooth/ftgrays.c (gray_raster_set_mode): New dummy function + for orthogonality. + (ft_grays_raster): Use it. + +2014-11-25 Werner Lemberg + + [Savannah bug #43682] Properly handle missing return errors. + + The functions in this patch *do* return non-trivial errors that must + be taken care of. + + * src/autofit/afloader.c (af_loader_load_g), src/base/ftobjs.c + (FT_Render_Glyph_Internal), src/base/ftoutln.c (FT_Outline_Render), + src/cff/cffgload.c (cff_decoder_parse_charstrings) , + src/psaux/psobjs.c (ps_parser_load_field_table), src/psaux/t1decode + (t1_decoder_parse_charstrings) , src/truetype/ttgload.c + (load_truetype_glyph , tt_loader_init, + TT_Load_Glyph), src/truetype/ttgxvar.c (TT_Set_MM_Blend), + src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Do it. + +2014-11-25 Werner Lemberg + + [Savannah bug #43682] Add/remove `void' casts to some functions. + + We use a cast to indicate that we intentionally ignore a function's + return value. However, this doesn't apply to API functions where + errors can only happen for trivially invalid input. + + * src/base/ftstroke.c (FT_Glyph_Stroke, FT_Glyph_StrokeBorder), + src/base/ftsynth.c (FT_GlyphSlot_Embolden), src/cff/cffgload.c + (cff_slot_load), src/pfr/pfrdrivr.c (pfr_get_kerning), + src/type1/t1load.c (parse_encoding), src/type42/t42parse.c + (t42_parse_encoding): Do it. + +2014-11-25 Werner Lemberg + + [Savannah bug #43682] Change some signatures to `void' return type. + + * include/internal/pshints.h (PSH_Globals_SetScaleFunc), + include/internal/sfnt.h (TT_Get_Metrics_Func), + src/pshinter/pshglob.c (psh_globals_set_scale), + src/pshinter/pshrec.c (ps_hints_init), src/sfnt/ttmtx.c + (tt_face_get_metrics), src/truetype/ttinterp.c (TT_Goto_CodeRange, + TT_Set_CodeRange, TT_Clear_CodeRange, TT_Done_Context, + TT_Save_Context): Do it. + + * src/pshinter/pshglob.h, src/pshinter/pshrec.h, src/sfnt/ttmtx.h, + src/truetype/ttgload.c (TT_Hint_Glyph), src/truetype/ttinterp.c + (TT_Run_Context), src/truetype/ttinterp.h, src/truetype/ttobjs.c + (tt_size_run_fpgm, tt_size_run_prep): Updated. + +2014-11-24 Werner Lemberg + + Remove all code related to FT_MAX_CHARMAP_CACHEABLE. + + This is no longer used. + + * src/base/ftobjs.c, src/cache/ftccmap.c, src/cff/cffobjs.c, + src/sfnt/ttcmap.c: Do it. + +2014-11-24 Werner Lemberg + + [sfnt] Fix Savannah bug #43680. + + This adds an additional constraint to make the fix from 2013-01-25 + really work. + + * src/sfnt/ttsbit.c (tt_sbit_decoder_load_image) : + Check `p' before `num_glyphs'. + +2014-11-24 Werner Lemberg + + [truetype] Fix Savannah bug #43679. + + * src/truetype/ttpload.c (tt_face_load_hdmx): Check minimum size of + `record_size'. + +2014-11-24 Jarkko Pöyry + + [cff, pfr, psaux, winfonts] Fix Savannah bug #43676. + + Don't cast cmap init function pointers to an incompatible type. + + Without this patch, the number of parameters between declaration and + the real signature differs. Calling such a function results in + undefined behavior. + + ISO/IEC 9899:TC3 (Committee Draft September 7, 2007) + 6.5.2.2 Function calls + 9 If the function is defined with a type that is not + compatible with the type (of the expression) pointed to by + the expression that denotes the called function, the + behavior is undefined. + + On certain platforms (c -> js with emscripten) this causes + termination of execution or invalid calls because in the emscripten + implementation, function pointers of different types are stored in + different pointer arrays. Incorrect pointer type here results in + indexing of an incorrect array. + + * src/cff/cffcmap.c (cff_cmap_encoding_init, cff_cmap_unicode_init), + src/pfr/pfrcmap.c (pfr_cmap_init), src/psaux/t1cmap.c + t1_cmap_standard_init, t1_cmap_expert_init, t1_cmap_custom_init, + t1_cmap_unicode_init), src/winfonts/winfnt.c (fnt_cmap_init): Fix + signature. + +2014-11-24 Werner Lemberg + + [sfnt] Fix Savannah bug #43672. + + * src/sfnt/ttkern.c (tt_face_load_kern): Use correct value for + minimum table length test. + +2014-11-24 Werner Lemberg + + [type1, type42] Another fix for Savannah bug #43655. + + * src/type1/t1load.c (parse_charstrings), src/type42/t42parse.c + (t42_parse_charstrings): Add another boundary testing. + +2014-11-24 Werner Lemberg + + [docmaker] Formatting, copyright, improved documentation. + + * src/tools/docmaker/*: No code changes besides trivial + modifications. + +2014-11-22 Werner Lemberg + + [bdf] Fix Savannah bug #43660. + + * src/bdf/bdflib.c (_bdf_parse_glyphs) <"ENDFONT">: Check + `_BDF_GLYPH_BITS'. + +2014-11-22 Werner Lemberg + + [type42] Allow only embedded TrueType fonts. + + This is a follow-up to Savannah bug #43659. + + * src/type42/t42objs.c (T42_Face_Init): Exclusively use the + `truetype' font driver for loading the font contained in the `sfnts' + array. + +2014-11-22 Werner Lemberg + + [type42] Fix Savannah bug #43659. + + * src/type42/t42objs.c (T42_Open_Face): Initialize `face->ttf_size'. + + * src/type42/t42parse.c (t42_parse_sfnts): Always set + `face->ttf_size' directly. This ensures a correct stream size in + the call to `FT_Open_Face', which follows after parsing, even for + buggy input data. + Fix error messages. + +2014-11-22 Werner Lemberg + + [cff] Fix Savannah bug #43658. + + * src/cff/cf2ft.c (cf2_builder_lineTo, cf2_builder_cubeTo): Handle + return values of point allocation routines. + +2014-11-22 Werner Lemberg + + [sfnt] Fix Savannah bug #43656. + + * src/sfnt/ttcmap.c (tt_cmap4_validate): Fix order of validity + tests. + +2014-11-21 Werner Lemberg + + [type1, type42] Fix Savannah bug #43655. + + * src/type1/t1load.c (parse_charstrings), src/type42/t42parse.c + (t42_parse_charstrings): Fix boundary testing. + +2014-11-21 Werner Lemberg + + * src/pcf/pcfread.c (pcf_get_metrics): Sanitize invalid metrics. + +2014-11-21 Werner Lemberg + + [ftlcdfil] Obey flow direction. + + * src/base/ftlcdfil.c (_ft_lcd_filter_fir, _ft_lcd_filter_legacy): + Handle `up' flow. + +2014-11-21 Werner Lemberg + + * src/base/ftbitmap.c (FT_Bitmap_Convert): Improve. + + This commit completes argument checks and adds support for different + flow directions. + +2014-11-21 Werner Lemberg + + * src/base/ftbitmap.c (FT_Bitmap_Copy): Improve. + + This commit adds argument checks and support for different flow + directions. + +2014-11-20 Werner Lemberg + + * src/base/ftbitmap.c (FT_Bitmap_New): Check argument. + +2014-11-19 Werner Lemberg + + Change some fields in `FT_Bitmap' to unsigned type. + + This doesn't break ABI. + + * include/ftimage.h (FT_Bitmap): Make `rows', `width', `num_grays', + `pixel_mode', and `palette_mode' unsigned types. + + * src/base/ftbitmap.c: Updated. + (FT_Bitmap_Copy): Fix casts. + + * src/cache/ftcsbits.c, src/raster/ftraster.c, src/sfnt/pngshim.c: + Updated. + +2014-11-19 Werner Lemberg + + Make `FT_Bitmap_Convert' correctly handle negative `pitch' values. + + * src/base/ftbitmap.c (FT_Bitmap_Convert): Always use positive value + for the pitch while copying data. + Correctly set pitch sign in target bitmap. + +2014-11-19 Werner Lemberg + + Minor code improvement in `FT_Bitmap_Embolden'. + + * src/base/ftbitmap.c (FT_Bitmap_Embolden) : + Fix thinko. + +2014-11-19 Alexei Podtelezhnikov + + * src/base/fttrigon.c: Use dedicated `FT_Angle' for arctan table. + +2014-11-19 Behdad Esfahbod + + Avoid compiler warnings on x86-64 for `FT_MulFix'. + + `FT_MulFix' takes `FT_Long' parameters as defined in `freetype.h', + but several inline implementations of it in `ftcalc.h' take + `FT_Int32' arguments. This is causing compiler warnings on x86-64: + If parameters of type `FT_Fixed' (= `FT_Long') are passed to the + inline implementation of this function, integer values are truncated + from 64bit to 32bit. + + * include/internal/ftcalc.h (FT_MulFix) [FT_MULFIX_ASSEMBLER]: Add + casts. + +2014-11-15 Werner Lemberg + + [sfnt] Fix Savannah bug #43597. + + * src/sfnt/pngshim.c (Load_SBit_Png): Protect against too large + bitmaps. + +2014-11-12 Werner Lemberg + + [sfnt] Fix Savannah bug #43591. + + * src/sfnt/ttsbit.c (tt_sbit_decoder_init): Protect against addition + and multiplication overflow. + +2014-11-12 Werner Lemberg + + [sfnt] Fix Savannah bug #43590. + + * src/sfnt/ttload.c (check_table_dir, tt_face_load_font_dir): + Protect against addition overflow. + +2014-11-12 Werner Lemberg + + [sfnt] Fix Savannah bug #43589. + + * src/sfnt/sfobjs.c (woff_open_font): Protect against addition + overflow. + +2014-11-12 Werner Lemberg + + [sfnt] Fix Savannah bug #43588. + + * src/sfnt/ttcmap.c (tt_cmap8_validate, tt_cmap10_validate, + tt_cmap12_validate, tt_cmap13_validate, tt_cmap14_validate): Protect + against overflow in additions and multiplications. + +2014-11-10 Alexei Podtelezhnikov + + [base] CORDIC improvements. + + The scaling between the hypotenuse and its CORDIC approximation is + based on regression analysis. The smaller padding for `theta' is + justifed by its maximum error of less than 6. + + * src/base/fttrigon.c (ft_trig_downscale): Borrow code from + ./ftcalc.c (ft_multo64), change linear intercept. + (ft_trig_pseudo_polarize): Decrease `theta' padding. + +2014-11-09 Werner Lemberg + + * src/base/ftstroke.c (ft_stroker_inside): Fix border intersections. + + One more place to check whether `radius' is zero. + + Problem reported by Marco Wertz . + +2014-11-07 Werner Lemberg + + [bdf] Fix Savannah bug #43535. + + * src/bdf/bdflib.c (_bdf_strncmp): New macro that checks one + character more than `strncmp'. + s/ft_strncmp/_bdf_strncmp/ everywhere. + +2014-11-06 Werner Lemberg + + [pcf] Fix Savannah bug #43548. + + * src/pcf/pcfread.c (pcf_get_encodings): Add sanity checks for row + and column values. + +2014-11-06 Werner Lemberg + + [pcf] Fix Savannah bug #43547. + + * src/pcf/pcfread.c (pcf_read_TOC): Check `size' and `offset' + values. + +2014-11-06 Werner Lemberg + + * src/pcf/pcfread.c (pcf_read_TOC): Avoid memory leak. + +2014-11-03 Infinality + + * src/truetype/ttsubpix.c (COMPATIBILITY_MODE_Rules): Updated. + + The previous commit deteriorates rendering of DejaVu and similar + fonts; this gets compensated with this rule. + +2014-11-03 Werner Lemberg + + * src/truetype/ttinterp.c (Ins_DELTAP): Fix subpixel hinting. + + Before this patch, it was impossible to ever call DELTAP[123] in + subpixel hinting mode as described in the ClearType whitepaper; it + only worked if in `compatibility mode'. However, compatibility mode + essentially disables SHPIX, completely ruining hinting of + ttfautohint output, for example. + + We now follow the whitepaper more closely so that DELTAP[123] + instructions for touched points in the non-subpixel direction are + executed. + +2014-10-31 Alexei Podtelezhnikov + + [smooth] Improve code readability. + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code. + +2014-10-31 Alexei Podtelezhnikov + + [smooth] Reduce outline translations during rendering. + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Translate origin + virtually by modifying cbox, actually translate outline if cumulative + shift is not zero. + +2014-10-30 Alexei Podtelezhnikov + + [smooth] Fix Savannah bug #35604 (cont'd). + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove checks and + casts that became unnecessary after the variable type upgrades. + +2014-10-29 Alexei Podtelezhnikov + + [smooth] Improve code readability. + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code. + +2014-10-29 Alexei Podtelezhnikov + + Unify hypotenuse approximations. + + * include/internal/ftcalc.h (FT_HYPOT): Move macro from here... + * include/internal/ftobjs.h: ... to here, next to required `FT_ABS'. + * src/smooth/ftgrays.c (gray_render_cubic): Use it here. + +2014-10-25 Werner Lemberg + + [cff] Test valid darkening parameter macros in `ftoption.h'. + + We no longer need an otherwise unused typedef that can cause a gcc + warning. + Problem reported by Alexei. + + * src/cff/cffobjs.c (cff_driver_init): Use + `CFF_CONFIG_OPTION_DARKENING_PARAMETER_XXX' macros directly. + (SET_DARKENING_PARAMETERS): Removed. + Compile time tests are now ... + + * devel/ftoption.h, include/config/ftoption.h: ... here. + +2014-10-25 Alexei Podtelezhnikov + + Improve flat corner definition. + + * include/internal/ftcalc.h (FT_HYPOT): Macro to approximate Euclidean + distance with the alpha max plus beta min algorithm. + * src/base/ftcalc.c (ft_corner_is_flat): Use it instead of Taxicab + metric. + +2014-10-23 David Weiß + + [build] Improve property file for vc2010. + + User-defined properties should be empty by default to prevent linker + failures. + + * builds/windows/vc2010/freetype.user.props, + builds/windows/vc2010/freetype.vcxproj: + s/OptionsDirectory/UserOptionDirectory/. + Comment out all user options. + +2014-10-23 Werner Lemberg + + [cff] Work around bug in preprocessor of MSVC 2010. + + We have been hit by + + https://connect.microsoft.com/VisualStudio/feedback/details/718976/msvc-pr + + * devel/ftoption.h, include/config/ftoption.h: Replace + `CFF_CONFIG_OPTION_DARKENING_PARAMETERS' with eight macros + `CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4}'. + + * src/cff/cffobjs.c (SET_DARKENING_PARAMETERS): Removed. We no + longer need double expansion. + (SET_DARKENING_PARAMETERS_0): Renamed to ... + (SET_DARKENING_PARAMETERS): ... this. + Update call. + +2014-10-20 Werner Lemberg + + [sbit] Minor fixes. + + * src/sfnt/ttsbit.c (tt_face_load_sbit) [TT_SBIT_TABLE_TYPE_SBIX]: + Accept overlay format also, but emit warning message in that case. + (tt_sbit_decoder_load_metrics): Add missing newline to error + message. + (tt_sbit_load_sbix_image): Add `rgbl' graphic type (as used on iOS + 7.1) to the list of unsupported formats. + +2014-10-19 Alexei Podtelezhnikov + + [truetype] Clean up bytecode rounding. + + Zero distance does not have to be treated specially if you follow + specifications and check the sign as the very last step of rounding. + + * src/truetype/ttinterp.c (Round_None, Round_To_Grid, + Round_Down_To_Grid, Round_Up_To_Grid, Round_To_Double_Grid): Use + macros when available, do not check for non-zero distance. + (Round_To_Half_Grid, Round_Super, Round_Super_45): Ditto, return phase + if sign changed. + +2014-10-18 Alexei Podtelezhnikov + + [truetype] Unwrap engine compensation settings. + + * src/truetype/ttobjs.c (tt_size_init_bytecode): Updated. + +2014-10-18 David Weiß + + [build] Add property file to vc2010 project. + + This simplifies custom build configurations, especially for + automated build environments. + + * builds/windows/vc2010/freetype.user.props: New configuration file. + + * builds/windows/vc2010/freetype.vcxproj: Include + `freetype.user.props' and use its data fields. + + * builds/windows/vc2010/index.html: Updated. + +2014-10-18 Werner Lemberg + + [autofit] Add blue-zone support for Telugu. + + This essentially moves the Telugu script from the `Indic' hinter to + the `Latin' hinter. + + Note that this is a first shot and quite certainly needs + refinements. + + * src/autofit/afblue.dat: Add blue zone data for Telugu. + + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + + * src/autofit/afscript.h: Add Telugu standard characters and move + data out of AF_CONFIG_OPTION_INDIC block. + + * src/autofit/afranges.c: Move Telugu data out of + AF_CONFIG_OPTION_INDIC block. + + * src/autofit/afstyles.h: Update Telugu data; in particular, use + AF_WRITING_SYSTEM_LATIN. + +2014-10-18 David Wimsey + + [cmake] Add iOS build support. + From Savannah patch #8497. + + * builds/cmake/iOS.cmake: New file. Universal binaries are built + with both 32 and 64 bit arm architectures. + + * CMakeLists.txt (IOS_PLATFORM): New variable for running the iOS + toolchain. Possible values are `OS' to build on iOS, or + `SIMULATOR' to build on APPLE. + +2014-10-16 Behdad Esfahbod + Werner Lemberg + + [cff] Add `CFF_CONFIG_OPTION_DARKENING_PARAMETERS' config macro. + + * devel/ftoption.h, include/config/ftoption.h + (CFF_CONFIG_OPTION_DARKENING_PARAMETERS): New macro. + + * src/cff/cffobjs.c (SET_DARKENING_PARAMETERS, + SET_DARKENING_PARAMETERS_0): New macros. + (cff_driver_init): Use new macros. + +2014-10-14 Alexei Podtelezhnikov + + [truetype] Limit delta shift range. + + The valid range for delta shift is zero through six. Negative values + are invalid according to + + https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#delta%20shift + + * src/truetype/ttobjs.h (delta_shift, delta_base): Make unsigned. + * src/truetype/ttinterp.h (DO_SDS): Throw an error if `delta_shift' + is out of range. + (Ins_DELTAP, Ins_DELTAC): Optimize for valid `delta_shift'. + +2014-10-16 Werner Lemberg + + A better fix for Savannah bug #43392. + Suggested by Doug Felt . + + * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Set + `vertAdvance' to zero... + + * src/truetype/ttgload.c (TT_Load_Glyph): ... and set here a default + value for `vertAdvance' based on `linearVertAdvance' in case + `vertAdvance' is zero. Note that the previous computed ad-hoc value + for `linearVertAdvance' was apparently not tested in a real-life + situation. + +2014-10-14 David Weiß + + [build] Better optimization settings for vc2010 solution file. + + * builds/windows/vc2010/freetype.sln, + builds/windows/vc2010/freetype.vcxproj: Updated. + +2014-10-14 Werner Lemberg + + [autofit] Adjust Devenagari character range. + + * src/autofit/afranges.c (af_deva_uniranges): Omit characters that + are common to all other Indic scripts. + +2014-10-12 Werner Lemberg + + [sfnt] Fix Savannah bug #43392. + + * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Don't let + vertical metrics uninitialized. + +2014-10-11 Alexei Podtelezhnikov + + [base] Small bbox correction. + + * src/base/ftbbox.c (FT_Outline_Get_BBox): Start from nonsense bbox + instead of initial point that could be `off' in conic outlines. + +2014-10-08 Alexei Podtelezhnikov + + [base] Fix Savannah bug #43356. + + * src/base/ftbbox.c (BBox_Move_To, BBox_Conic_To): Update bbox in case + of implicit `to'. + (BBox_Line_To): New emitter that does not update bbox. + +2014-10-08 Alexei Podtelezhnikov + + [base] Introduce and use new macro `FT_UPDATE_BBOX' + + * src/base/ftbbox.c (FT_UPDATE_BBOX): New macro. + (FT_Outline_Get_BBox): Use it here. + +2014-10-02 Alexei Podtelezhnikov + + [base] Significant optimization of `ft_div64by32' + + We shift as many bits as we can into the high register, perform + 32-bit division with modulo there, then work through the remaining + bits with long division. This optimization is especially noticeable + for smaller dividends that barely use the high register. + + * src/base/ftcalc.c (ft_div64by32): Updated. + +2014-10-02 Dave Arnold + + [cff] Fix Savannah bug #43271. + + * src/cff/cf2font.c (cf2_computeDarkening): Change overflow + detection to use logarithms and clamp `scaledStem'. + +2014-10-01 Alexei Podtelezhnikov + + * src/base/ftcalc.c: Remove miscellaneous type casts. + +2014-10-01 Alexei Podtelezhnikov + + [base] Use more common `FT_MSB' implementation with masks. + + * src/base/ftcalc.c (FT_MSB): Updated. + +2014-09-30 Alexei Podtelezhnikov + + [base] Clean up. + + * src/base/ftcalc.c (FT_MOVE_SIGN): New macro for frequently used + code. + +2014-09-25 Alexei Podtelezhnikov + + [base] Avoid unnecessary long division. + + This applies to `FT_MulDiv' but not to `FT_DivFix', where overflows or + lack thereof are predicted accurately. + + * src/base/ftcalc.c (ft_div64by32): Improve readability. + (FT_MulDiv, FT_MulDiv_No_Round) [!FT_LONG64]: Use straight division + when multiplication stayed within 32 bits. + +2014-09-24 Werner Lemberg + + [autofit] Minor clean-ups. + + * src/autofit/afhints.c (AF_FLAGS): Remove obsolete values. + + * src/autofit/afhints.c (af_glyph_hints_dump_points, + af_glyph_hints_align_strong_points): Updated. + + * src/autofit/aflatin.c (af_latin_hints_link_segments, + af_latin_hints_compute_segments), src/autofit/afcjk.c + (af_cjk_hints_link_segments), src/autofit/aflatin2.c + (af_latin2_hints_link_segments, af_latin2_hints_compute_segments): + There are no longer fake segments since more than 10 years... + +2014-09-22 Werner Lemberg + + [autofit] Minor code streamlining. + + * src/autofit/afhints.c (af_axis_hints_new_edge): Remove redundant + initialization. + +2014-09-19 Alexei Podtelezhnikov + + * src/base/ftcalc.c: Harmonize code. + +2014-09-15 Alexei Podtelezhnikov + + [base] Tighten the overflow check in `FT_MulDiv'. + + * src/base/ftcalc.c (FT_MulDiv) [!FT_LONG64]: Updated. + +2014-09-08 Alexei Podtelezhnikov + + Fix Savannah bug #43153. + + * src/psaux/psconv.c (PS_Conv_ToFixed): Add protection against + overflow in `divider'. + +2014-09-03 Alexei Podtelezhnikov + + [base] Tighten the overflow check in `FT_DivFix'. + + This fixes a 13-year old bug. The original overflow check should have + been updated when rounding was introduced into this function + (c2cd00443b). + + * src/base/ftcalc.c (FT_DivFix) [!FT_LONG64]: Updated. + * include/freetype.h (FT_DivFix): Updated documentation. + +2014-09-03 Alexei Podtelezhnikov + + [base] Tighten the overflow check in `FT_MulFix'. + + * src/base/ftcalc.c (FT_MulFix) [!FT_LONG64]: Updated. + +2014-09-02 Alexei Podtelezhnikov + + [truetype] Shortcut ppem calculations for square pixels. + + * src/truetype/ttinterp.h (TT_ExecContextRec): New field + `cur_ppem_func' with a function pointer. + * src/truetype/ttinterp.c (TT_RunIns): Initialize `cur_ppem_func' + depending on the pixel geometry to either... + (Current_Ppem_Stretched): ... this for stretched pixels. + (Current_Ppem): ... or this for square pixels. + (DO_MPPEM, DO_MPS, Ins_DELTAP, Ins_DELTAC): Use `cur_ppem_func'. + +2014-08-31 Behdad Esfahbod + + Don't use `register' keyword. Fixes compiler warnings. + + * src/base/ftcalc.c (FT_Add64) [!FT_LONG64]: Do it. + * src/gzip/inftrees.c (huft_build): Ditto. + * src/truetype/ttinterp.c (TT_MulFix14_arm): Ditto. + +2014-08-24 Alexei Podtelezhnikov + + [truetype] Optimize DELTAP and DELTAC. + + * src/truetype/ttinterp.c (Ins_DELTAP, Ins_DELTAC): Move ppem + calculations outside of the loop. + +2014-08-21 Alexei Podtelezhnikov + + Fix Savannah bug #43033. + + * include/config/ftconfig.h, builds/unix/ftconfig.in, + builds/vms/ftconfig.h [FT_LONG64]: Do not disable the macro when + 64-bit type is `long'. + +2014-08-20 Alexei Podtelezhnikov + + [base] Small optimization of `FT_MulFix'. + + * src/base/ftcalc.c (FT_MulFix): Loosen up the condition for direct + 32-bit calculations. + +2014-08-19 Alexei Podtelezhnikov + + [base] Use unsigned calculation in `FT_MulDiv'. + + * src/base/ftcalc.c (FT_MulDiv): Updated to expand 32-bit range. + +2014-08-18 Alexei Podtelezhnikov + + [base] Remove truncation in `FT_DivFix'. + + * src/base/ftcalc.c (FT_DivFix): Updated. + +2014-08-14 Alexei Podtelezhnikov + + Minor refactoring. + + * src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round): Updated. + +2014-08-14 Alexei Podtelezhnikov + + Turn FT_MSB into a macro when using gcc builtins. + + * src/base/ftcalc.c, include/internal/ftcalc.h: Updated. + +2014-08-12 Alexei Podtelezhnikov + + [base] Avoid undefined FT_MSB in `BBox_Cubic_Check'. + + * src/base/ftbbox.c (BBox_Cubic_Check): Update. + (update_cubic_max): Repalce with... + (cubic_peak): ... this, which now handles upscaling. + +2014-08-11 Alexei Podtelezhnikov + + [base] Handle collapsed outlines to avoid undefined FT_MSB. + + * src/base/ftoutln.c (FT_Outline_Get_Orientation): Update. + +2014-08-11 Alexei Podtelezhnikov + + [base] Restore FT_MulFix inlining. + + * include/freetype.h (FT_MulFix): Unconditionally defined. + + * src/base/ftcalc.c [FT_MULFIX_ASSEMBLER]: Move code from here... + + * include/internal/ftcalc.h [FT_MULFIX_ASSEMBLER]: ... to here, + which conditionally replaces the function with an inline version + through the macro. + +2014-08-08 Alexei Podtelezhnikov + + * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Refactor. + +2014-07-26 Werner Lemberg + + [cff] Fix typo. + + * src/cff/cf2hints.c (cf2_glyphpath_computeOffset): Use correct + offsets in third quadrant. + + Reported by maks . + +2014-07-17 Werner Lemberg + + Fix Savannah bug #42788. + + * src/pfr/pfrobjs.c: Include `ftcalc.h'. + +2014-07-16 Alexei Podtelezhnikov + + Replace `ft_highpow2' function. + + * src/pfr/pfrobjs.c (pfr_face_get_kerning): Use `FT_MSB' instead of + `ft_highpow2'. + + * src/base/ftutil.c, include/internal/ftobjs.h (ft_highpow2): Remove + it. + +2014-07-15 Alexei Podtelezhnikov + + * src/base/ftcalc.c (FT_MSB): Utilize gcc builtins. + +2014-07-15 Alexei Podtelezhnikov + + [base] Move assembler code back in the source file. + + FT_MulFix assembler used to reside in ftcalc.c before f47d263f1b. + + * include/config/ftconfig.h, builds/unix/ftconfig.in, + builds/vms/ftconfig.h [FT_MULFIX_ASSEMBLER]: Move code from here... + + * src/base/ftcalc.c [FT_MULFIX_ASSEMBLER]: ... to here. + +2014-07-14 Alexei Podtelezhnikov + + [base] Further clean up color bitmap conversion. + + * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Stop + using FT_MulFix and FT_DivFix since all calculations fit into 32 bits. + +2014-07-13 Werner Lemberg + + [truetype] Improve handling of buggy `prep' tables. + + In case of an error in the `prep' table, no longer try to execute it + again and again. This makes FreeType handle endless loops in buggy + fonts much faster. + + * src/truetype/ttobjs.h (TT_SizeRec): The fields `bytecode_ready' + and `cvt_ready' are now negative if not initialized yet, otherwise + they indicate the error code of the last run. + + * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep, + tt_size_done_bytecode, tt_size_init_bytecode, + tt_size_ready_bytecode, tt_size_init, tt_size_done, tt_size_reset): + Updated. + + * src/truetype/ttgload.c (tt_loader_init): Updated. + * src/truetype/ttinterp.c (TT_RunIns): Force reexecution of `fpgm' + and `prep' only if we are in the `glyf' table. + +2014-07-12 Werner Lemberg + + * builds/vms/ftconfig.h: Synchronize. + Problem reported by Alexei. + +2014-07-11 Alexei Podtelezhnikov + + [base] Clean up bitmap conversion. + + * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use + appropriate FT_DivFix and remove superfluous upscaling. + +2014-07-04 Alexei Podtelezhnikov + + [base] Small optimization of the ancient code. + + * src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round): Loosen up the + condition for direct 32-bit calculations. + +2014-06-27 Werner Lemberg + + Fix Apple standard glyph names. + + * src/sfnt/ttpost.c (tt_post_default_names): Synchronize with + `tools/glnames.py' + + Problem reported by Adam Twardoch . + +2014-06-17 Werner Lemberg + + Partially revert commit from 2014-06-13. + + * src/autofit/aflatin.c (af_latin_metrics_init_blues): Move + declaration of `p_first' and `p_last' out of the loop. + +2014-06-17 Werner Lemberg + + * builds/unix/freetype2.m4: s/AC_PATH_PROG/AC_PATH_TOOL/. + + This simplifies cross-compiling. + +2014-06-13 Werner Lemberg + + Fix more compiler warnings. + Reported by Wojciech Mamrak . + + * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): + Make integer constant unsigned. + + * src/sfnt/ttsbit.c (tt_face_load_strike_metrics) + : Fix types. + (tt_sbit_decoder_load_compound, tt_face_load_sbix_image): Add proper + casts. + +2014-06-13 Werner Lemberg + + Fix compiler warnings. + Reported by Wojciech Mamrak . + + * src/autofit/afglobal.c (af_face_globals_compute_style_coverage), + src/autofit/afmodule.c (af_property_set): Fix `signed' vs. + `unsigned' issues. + + * src/autofit/aflatin.c (af_latin_metrics_init_blues): Make compiler + happy. + + * src/base/ftlcdfil.c (_ft_lcd_filter_fir): Use only four elements + for `fir'. + Fix `signed' vs. `unsigned' issues. + + * src/sfnt/sfobjs.c (WRITE_BYTE): Removed, unused. + (WRITE_USHORT, WRITE_ULONG): Add proper casts. + + * src/truetype/ttgload.c (TT_Get_VMetrics): Add proper casts. + + * src/truetype/ttinterp.c (Ins_DELTAP): Add proper casts for `B1' + and `B2'. + +2014-05-16 Alexey Petruchik + + [cmake] Add option to build OS X framework. + + * CMakeLists.txt: Update accordingly. + + * builds/mac/freetype-Info.plist: New file. + +2014-05-13 Pavel Koshevoy + + * CMakeLists.txt (BASE_SRCS): Add missing `ftbdf.c'. + +2014-05-11 Werner Lemberg + + [autofit] Fix variable initializations. + + * src/autofit/afhints.c (af_glyph_hints_reload): Assign default + values to `in_dir' and `out_dir' for all points. + +2014-05-11 Werner Lemberg + + [autofit] Fix crash with font `CabinSketch-Bold.ttf'. + + Problem reported by Ralf S. Engelschall . + + * src/autofit/afhints.c (af_glyph_hints_reload): Fix threshold for + finding first non-near point. + Properly initialize non-near point deltas. + +2014-05-01 Werner Lemberg + + [autofit] Add blue-zone support for Devanagari. + + This essentially moves the Devanagari script from the `Indic' hinter + to the `Latin' hinter. Thanks to Girish Dalvi + for guidance with blue zone characters! + + * src/autofit/afblue.dat: Add blue zone data for Devanagari. + + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + + * src/autofit/afscript.h: Add Devanagari standard characters and + move data out of AF_CONFIG_OPTION_INDIC block. + + * src/autofit/afranges.c: Move Devanagari data out of + AF_CONFIG_OPTION_INDIC block. + Move U+20B9, (new) Rupee sign, from Latin to Devanagari. + + * src/autofit/afstyles.h: Update Devanagari data; in particular, use + AF_WRITING_SYSTEM_LATIN. + +2014-05-01 Werner Lemberg + + [autofit] Fix handling of neutral blue zones in stems. + + * src/autofit/afhints.h (AF_Edge_Flags): New value + `AF_EDGE_NEUTRAL'. + + * src/autofit/aflatin.c (af_latin_hints_compute_blue_edges): Trace + neutral blue zones with AF_EDGE_NEUTRAL. + (af_latin_hint_edges): Skip neutral blue zones if necessary. + +2014-04-28 Werner Lemberg + + [autofit] Introduce neutral blue zones to the latin module. + + Such blue zones match either the top or the bottom of a contour. We + need them for scripts where accent-like elements directly touch the + base character (for example, some vowel signs in Devanagari, cf. + U+0913 or U+0914). + + * src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_NEUTRAL): New + property. + + * src/autofit/afblue.h: Regenerated. + + * src/autofit/aflatin.h (AF_LATIN_IS_NEUTRAL_BLUE): New macro. + (AF_LATIN_BLUE_NEUTRAL): New enumeration value. + + * src/autofit/aflatin.c (af_latin_metrics_init_blues, + af_latin_hints_compute_blue_edges): Handle neutral blue zones. + +2014-04-25 Werner Lemberg + + * src/autofit/hbshim.c: Partially revert commit from 2014-04-17. + + Using input glyph coverage data is simply wrong. + + Problem reported by Nikolaus Waxweiler and + Mantas Mikulėnas . + +2014-04-23 Werner Lemberg + + * src/raster/ftraster.c (Vertical_Sweep_Span): Use drop-out mode. + + This spot has been missed while introducing support for various + drop-out modes years ago (including no drop-out mode, which this + commit fixes). + + Problem reported by Patrick Thomas . + +2014-04-22 Werner Lemberg + + * src/sfnt/pngshim.c (error_callback): s/longjmp/ft_longjmp/. + +2014-04-20 Werner Lemberg + + [autofit] Fix Savannah bug #42148. + + The adaptation of the cjk auto-hinter module to blue stringsets in + 2013-08-25 had three severe bugs. Mea culpa. + + 1. Contrary to the latin auto-hinter, characters for reference and + overshoot values of a blue zone are specified separately. Due to + the screwed-up change it didn't work at all. + + 2. A boolean comparison was erroneously replaced with a cast, + causing invalid results with the `^' operator later on. The + visual artifact caused by this problem is the topic of the bug + report. + + 3. Two flag values were inverted, causing incorrect assignment of + reference and overshoot values. + + * src/autofit/afblue.dat: Fix CJK bluestrings, introducing a new + syntax to have both reference and overshoot characters in a single + string. This is error #1. + Add extensive comments. + + * src/autofit/afblue.hin (AF_BLUE_PROPERTY_CJK_FILL): Removed, no + longer used. + (AF_BLUE_PROPERTY_CJK_TOP, AF_BLUE_PROPERTY_CJK_HORIZ): Fix values. + This is error #3. + + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + + * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Correct error #1. + Use character `|' to separate characters for reference and overshoot + values. + Improve tracing messages, synchronizing them with the latin + auto-hinter. + (af_cjk_hints_compute_blue_edges): Fix value of `is_top_right_blue'. + This is error #2. + (af_cjk_align_linked_edge): Add tracing message. + + * src/autofit/afcjk.h (AF_CJK_IS_FILLED_BLUE): Removed, no longer + used. + +2014-04-17 Werner Lemberg + + [autofit] More coverage fixes for complex scripts. + + * src/autofit/hbshim.c (af_get_coverage): Merge input glyph coverage + of GSUB lookups into output coverage. Otherwise, ligatures are not + handled properly. + Don't check blue zone characters for default coverage. + +2014-04-17 Werner Lemberg + + Make `FT_Get_SubGlyph_Info' actually work. + + * src/base/ftobjs.c (FT_Get_SubGlyph_Info): Return FT_Err_Ok + if there is no error. + +2014-04-15 Werner Lemberg + + [afblue.pl]: Minor improvements. + + * src/tools/afblue.pl: Allow whitespace before comments. + Ignore whitespace in strings. + +2014-04-14 Werner Lemberg + + [autofit] Improve coverage handling. + + * src/autofit/hbshim.c (af_get_coverage): Don't exclude glyphs + appearing in the GPOS table if we are processing the default + coverage. + +2014-04-13 David Weber + + [smooth] Fix stand-alone compilation. + + * src/smooth/ftgrays.c (FT_BEGIN_STMNT, FT_END_STMNT): Define. + +2014-04-12 Werner Lemberg + + [autofit] Redesign the recognition algorithm of strong points. + + In particular, local extrema without horizontal or vertical segments + are better recognized: + + + A + D + \ / + \ / + \ / + \ / + \ + C + \ / + B +/ + + If the distances AB and CD are large, point B wasn't previously + detected as an extremum since the `ft_corner_is_flat' function + `swallowed' BC regardless of its direction, tagging point B as weak. + The next iteration started at B and made `ft_corner_is_flat' swallow + point C, tagging it as weak also, et voilà. + + To improve that, another pass gets now performed before calling + `ft_corner_is_flat' to improve the `topology' of an outline: A + sequence of non-horizontal or non-vertical vectors that point into + the same quadrant are handled as a single, large vector. + + Additionally, distances of near points are now accumulated, which + makes the auto-hinter handle them as if they were prepended to the + next non-near vector. + + This generally improves the auto-hinter's rendering results. + + * src/autofit/afhints.c (af_glyph_hints_reload): Implement it. + + * src/autofit/afhints.h (AF_FLAGS): Remove no longer used flag + `AF_FLAG_NEAR'. + +2014-04-05 Werner Lemberg + + [autofit] Improve scoring algorithm for identifying stems. + + Problem reported by Karsten Lücke . + + The new algorithm takes care of the width of stems: If the distance + between two segments is larger than the largest stem width, the + demerits quickly increase for larger distances. This improves + hinting of slanted fonts (especially if the inner parts of serifs + have non-horizontal `shoulders'), avoiding false stem links. + + * src/autofit/aflatin.c (af_latin_hints_link_segments): Use largest + stem width (if available) to compute better demerits for distances + between stems. + (af_latin_hints_detect_features): Pass stem width array and array + size. + (af_latin_metrics_init_widths): Updated to use original algorithm. + (af_latin_hints_apply): Updated to use new algorithm. + + * src/autofit/aflatin.h: Updated. + * src/autofit/afcjk.c: Updated. + +2014-04-03 Werner Lemberg + + Don't require `gzip' module for `sfnt'. + + Reported by Preet . + + * src/sfnt/sfobjs.c (woff_open_font): Guard use of + FT_Gzip_Uncompress with FT_CONFIG_OPTION_USE_ZLIB. + +2014-03-27 Werner Lemberg + + Fix Savannah bug #38235. + + Work around a bug in pkg-config version 0.28 and earlier: If a + variable value gets surrounded by doublequotes (in particular values + for the `prefix' variable), the prefix override mechanism fails. + + * builds/unix/freetype2.in: Don't use doublequotes. + * builds/unix/unix-def.in (freetype.pc): Escape spaces in directory + names with backslashes. + +2014-03-24 Werner Lemberg + + Fix Savannah bug #41946. + + Based on a patch from Marek Kašík . + + * builds/unix/configure.raw (LIBS_CONFIG): Remove. + * builds/unix/freetype-config.in (libs): Hard-code value. + * builds/unix/unix-def.in: Updated. + +2014-03-22 Werner Lemberg + + Another revert for the change from 2014-03-18. + + Problem reported by Nikolaus Waxweiler . + + * src/base/ftcalc.c (FT_MulFix): Ensure that an `FT_MulFix' symbol + gets always exported. + +2014-03-20 Werner Lemberg + + CMakeLists.txt: Another fix for include directories. + + Problem reported by Taylor Holberton . + +2014-03-19 Werner Lemberg + + CMakeLists.txt: Fix include directories. + + Problem reported by Taylor Holberton . + +2014-03-19 Werner Lemberg + + Partially revert last commit. + + Found by Alexei. + + * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initializing + those variables is plain wrong, since we are in a loop. + +2014-03-18 Sean McBride + Werner Lemberg + + Fix clang warnings. + + * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize + some variables. + + * src/base/ftcalc.c (FT_MulFix): Only use code if + `FT_MULFIX_INLINED' is not defined. + + * src/bdf/bdfdrivr.c (bdf_cmap_class), src/cache/ftcbasic.c + (ftc_basic_image_family_class, ftc_basic_image_cache_class, + ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class), + src/cache/ftccmap.c (ftc_cmap_cache_class), src/cache/ftcmanag.c + (ftc_size_list_class, ftc_face_list_class), src/pcf/pcfdrivr.c + (pcf_cmap_class), src/pfr/pfrdrivr.c (pfr_metrics_service_rec): Make + function static. + + * src/type1/t1driver.c (t1_ps_get_font_value): Remove redundant + code. + +2014-03-17 Werner Lemberg + + Fix Savannah bug #41869. + + This works around a problem with HarfBuzz (<= 0.9.26), which doesn't + validate glyph indices returned by + `hb_ot_layout_lookup_collect_glyphs'. + + * src/autofit/hbshim.c (af_get_coverage): Guard `idx'. + + * docs/CHANGES: Updated. + +2014-03-14 Werner Lemberg + + * builds/unix/configure.raw: Don't show error messages of `which'. + +2014-03-09 Alan Coopersmith + + Fix cppcheck 1.64 warning. + + * src/autofit/afglobal.c (af_face_globals_new): Catch NULL pointer + dereference in case of error. + +2014-03-09 Sean McBride + + * src/sfnt/ttcmap.c (tt_face_build_cmaps): Remove clang warning. + 2014-03-06 Werner Lemberg * Version 2.5.3 released. @@ -106,7 +2063,7 @@ option. (libs): Updated. (staticlibs): New variable, to be used if `--static' is given. - * builds/doc/freetype-config.1: Document `--static'. + * docs/freetype-config.1: Document `--static'. * builds/unix/freetype2.in, builds/unix/unix-def.in: Updated. diff --git a/freetype/ChangeLog.21 b/freetype/ChangeLog.21 index d6371d175..300a094f2 100644 --- a/freetype/ChangeLog.21 +++ b/freetype/ChangeLog.21 @@ -6260,7 +6260,7 @@ Adding a new API `FT_Get_BDF_Property' to retrieve the BDF properties of a given PCF or BDF font. - * include/freetype/ftbdf.h (FT_PropertyType): New enumeration. + * include/freetype/ftbdf.h (BDF_PropertyType): New enumeration. (BDF_Property, BDF_PropertyRec): New structure. FT_Get_BDF_Property): New function. * include/freetype/internal/bdftypes.h: Include FT_BDF_H. diff --git a/freetype/Jamfile b/freetype/Jamfile index 61e64b543..16e097ed9 100644 --- a/freetype/Jamfile +++ b/freetype/Jamfile @@ -195,7 +195,7 @@ rule RefDoc actions RefDoc { - python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.5.3 --output=$(DOC_DIR) $(FT2_INCLUDE)/*.h $(FT2_INCLUDE)/config/*.h + python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.5.5 --output=$(DOC_DIR) $(FT2_INCLUDE)/*.h $(FT2_INCLUDE)/config/*.h } RefDoc refdoc ; diff --git a/freetype/README b/freetype/README index 9a793cd88..f00a1ab79 100644 --- a/freetype/README +++ b/freetype/README @@ -1,4 +1,4 @@ - FreeType 2.5.3 + FreeType 2.5.5 ============== Homepage: http://www.freetype.org @@ -24,9 +24,9 @@ and download one of the following files. - freetype-doc-2.5.3.tar.bz2 - freetype-doc-2.5.3.tar.gz - ftdoc253.zip + freetype-doc-2.5.5.tar.bz2 + freetype-doc-2.5.5.tar.gz + ftdoc255.zip To view the documentation online, go to @@ -53,15 +53,15 @@ Bugs ==== - Please report bugs by e-mail to `freetype-devel@nongnu.org'. Don't - forget to send a detailed explanation of the problem -- there is - nothing worse than receiving a terse message that only says `it - doesn't work'. - - Alternatively, you may submit a bug report at + Please submit bug reports at https://savannah.nongnu.org/bugs/?group=freetype + Alternatively, you might report bugs by e-mail to + `freetype-devel@nongnu.org'. Don't forget to send a detailed + explanation of the problem -- there is nothing worse than receiving + a terse message that only says `it doesn't work'. + Enjoy! diff --git a/freetype/builds/atari/deflinejoiner.awk b/freetype/builds/atari/deflinejoiner.awk index c872a70d8..16d9e6dd9 100644 --- a/freetype/builds/atari/deflinejoiner.awk +++ b/freetype/builds/atari/deflinejoiner.awk @@ -15,7 +15,7 @@ function shift( array, \ function init_cpp_src_line() { logical_line = "" - delete break_pos + delete break_pos } @@ -110,8 +110,8 @@ function shrink_spaces_to_linebreak( pos, \ { for ( i = 0; i < asorti( break_pos, junk ) && break_pos[i] < pos ; i++ ) ; - - if ( break_pos[i] < 1 ) + + if ( break_pos[i] < 1 ) return; part_str = substr( logical_line, pos, break_pos[i] - pos + 1 ) diff --git a/freetype/builds/cmake/iOS.cmake b/freetype/builds/cmake/iOS.cmake new file mode 100755 index 000000000..a41a7acf2 --- /dev/null +++ b/freetype/builds/cmake/iOS.cmake @@ -0,0 +1,275 @@ +# iOS.cmake +# +# Copyright 2014 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# Written by David Wimsey +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. +# +# +# This file is derived from the files `Platform/Darwin.cmake' and +# `Platform/UnixPaths.cmake', which are part of CMake 2.8.4. It has been +# altered for iOS development. + + +# Options +# ------- +# +# IOS_PLATFORM = OS | SIMULATOR +# +# This decides whether SDKS are selected from the `iPhoneOS.platform' or +# `iPhoneSimulator.platform' folders. +# +# OS - the default, used to build for iPhone and iPad physical devices, +# which have an ARM architecture. +# SIMULATOR - used to build for the Simulator platforms, which have an +# x86 architecture. +# +# CMAKE_IOS_DEVELOPER_ROOT = /path/to/platform/Developer folder +# +# By default, this location is automatically chosen based on the +# IOS_PLATFORM value above. If you manually set this variable, it +# overrides the default location and forces the use of a particular +# Developer Platform. +# +# CMAKE_IOS_SDK_ROOT = /path/to/platform/Developer/SDKs/SDK folder +# +# By default, this location is automatically chosen based on the +# CMAKE_IOS_DEVELOPER_ROOT value. In this case it is always the most +# up-to-date SDK found in the CMAKE_IOS_DEVELOPER_ROOT path. If you +# manually set this variable, it forces the use of a specific SDK +# version. +# +# +# Macros +# ------ +# +# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE) +# +# A convenience macro for setting Xcode specific properties on targets. +# +# Example: +# +# set_xcode_property(myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1") +# +# find_host_package (PROGRAM ARGS) +# +# A macro to find executable programs on the host system, not within the +# iOS environment. Thanks to the `android-cmake' project for providing +# the command. + + +# standard settings +set(CMAKE_SYSTEM_NAME Darwin) +set(CMAKE_SYSTEM_VERSION 1) +set(UNIX True) +set(APPLE True) +set(IOS True) + +# required as of cmake 2.8.10 +set(CMAKE_OSX_DEPLOYMENT_TARGET "" + CACHE STRING "Force unset of the deployment target for iOS" FORCE +) + +# determine the cmake host system version so we know where to find the iOS +# SDKs +find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin) +if (CMAKE_UNAME) + exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION) + string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" + DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}") +endif (CMAKE_UNAME) + +# force the compilers to gcc for iOS +include(CMakeForceCompiler) +CMAKE_FORCE_C_COMPILER(gcc gcc) +CMAKE_FORCE_CXX_COMPILER(g++ g++) + +# skip the platform compiler checks for cross compiling +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_C_COMPILER_WORKS TRUE) + +# all iOS/Darwin specific settings - some may be redundant +set(CMAKE_SHARED_LIBRARY_PREFIX "lib") +set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib") +set(CMAKE_SHARED_MODULE_PREFIX "lib") +set(CMAKE_SHARED_MODULE_SUFFIX ".so") +set(CMAKE_MODULE_EXISTS 1) +set(CMAKE_DL_LIBS "") + +set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG + "-compatibility_version ") +set(CMAKE_C_OSX_CURRENT_VERSION_FLAG + "-current_version ") +set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG + "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}") +set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG + "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}") + +# hidden visibility is required for cxx on iOS +set(CMAKE_C_FLAGS_INIT "") +set(CMAKE_CXX_FLAGS_INIT + "-headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden") + +set(CMAKE_C_LINK_FLAGS + "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}") +set(CMAKE_CXX_LINK_FLAGS + "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}") + +set(CMAKE_PLATFORM_HAS_INSTALLNAME 1) +set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS + "-dynamiclib -headerpad_max_install_names") +set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS + "-bundle -headerpad_max_install_names") +set(CMAKE_SHARED_MODULE_LOADER_C_FLAG + "-Wl,-bundle_loader,") +set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG + "-Wl,-bundle_loader,") +set(CMAKE_FIND_LIBRARY_SUFFIXES + ".dylib" ".so" ".a") + +# hack: If a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old +# build tree (where `install_name_tool' was hardcoded), and where +# CMAKE_INSTALL_NAME_TOOL isn't in the cache and still cmake didn't +# fail in `CMakeFindBinUtils.cmake' (because it isn't rerun), hardcode +# CMAKE_INSTALL_NAME_TOOL here to `install_name_tool' so it behaves as +# it did before. +if (NOT DEFINED CMAKE_INSTALL_NAME_TOOL) + find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool) +endif (NOT DEFINED CMAKE_INSTALL_NAME_TOOL) + +# set up iOS platform unless specified manually with IOS_PLATFORM +if (NOT DEFINED IOS_PLATFORM) + set(IOS_PLATFORM "OS") +endif (NOT DEFINED IOS_PLATFORM) + +set(IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING "Type of iOS Platform") + +# check the platform selection and setup for developer root +if (${IOS_PLATFORM} STREQUAL "OS") + set(IOS_PLATFORM_LOCATION "iPhoneOS.platform") + + # this causes the installers to properly locate the output libraries + set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos") + +elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR") + set(IOS_PLATFORM_LOCATION "iPhoneSimulator.platform") + + # this causes the installers to properly locate the output libraries + set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator") + +else (${IOS_PLATFORM} STREQUAL "OS") + message(FATAL_ERROR + "Unsupported IOS_PLATFORM value selected. Please choose OS or SIMULATOR.") + +endif (${IOS_PLATFORM} STREQUAL "OS") + +# set up iOS developer location unless specified manually with +# CMAKE_IOS_DEVELOPER_ROOT -- +# note that Xcode 4.3 changed the installation location; choose the most +# recent one available +set(XCODE_POST_43_ROOT + "/Applications/Xcode.app/Contents/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer") +set(XCODE_PRE_43_ROOT + "/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer") + +if (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT) + if (EXISTS ${XCODE_POST_43_ROOT}) + set(CMAKE_IOS_DEVELOPER_ROOT ${XCODE_POST_43_ROOT}) + elseif (EXISTS ${XCODE_PRE_43_ROOT}) + set(CMAKE_IOS_DEVELOPER_ROOT ${XCODE_PRE_43_ROOT}) + endif (EXISTS ${XCODE_POST_43_ROOT}) +endif (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT) + +set(CMAKE_IOS_DEVELOPER_ROOT ${CMAKE_IOS_DEVELOPER_ROOT} + CACHE PATH "Location of iOS Platform" +) + +# find and use the most recent iOS SDK unless specified manually with +# CMAKE_IOS_SDK_ROOT +if (NOT DEFINED CMAKE_IOS_SDK_ROOT) + file(GLOB _CMAKE_IOS_SDKS "${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/*") + if (_CMAKE_IOS_SDKS) + list(SORT _CMAKE_IOS_SDKS) + list(REVERSE _CMAKE_IOS_SDKS) + list(GET _CMAKE_IOS_SDKS 0 CMAKE_IOS_SDK_ROOT) + else (_CMAKE_IOS_SDKS) + message(FATAL_ERROR + "No iOS SDK's found in default search path ${CMAKE_IOS_DEVELOPER_ROOT}. Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.") + endif (_CMAKE_IOS_SDKS) + + message(STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}") +endif (NOT DEFINED CMAKE_IOS_SDK_ROOT) + +set(CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT} + CACHE PATH "Location of the selected iOS SDK" +) + +# set the sysroot default to the most recent SDK +set(CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} + CACHE PATH "Sysroot used for iOS support" +) + +# set the architecture for iOS -- +# note that currently both ARCHS_STANDARD_32_BIT and +# ARCHS_UNIVERSAL_IPHONE_OS set armv7 only, so set both manually +if (${IOS_PLATFORM} STREQUAL "OS") + set(IOS_ARCH $(ARCHS_STANDARD_32_64_BIT)) +else (${IOS_PLATFORM} STREQUAL "OS") + set(IOS_ARCH i386) +endif (${IOS_PLATFORM} STREQUAL "OS") + +set(CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} + CACHE string "Build architecture for iOS" +) + +# set the find root to the iOS developer roots and to user defined paths +set(CMAKE_FIND_ROOT_PATH + ${CMAKE_IOS_DEVELOPER_ROOT} + ${CMAKE_IOS_SDK_ROOT} + ${CMAKE_PREFIX_PATH} + CACHE string "iOS find search path root" +) + +# default to searching for frameworks first +set(CMAKE_FIND_FRAMEWORK FIRST) + +# set up the default search directories for frameworks +set(CMAKE_SYSTEM_FRAMEWORK_PATH + ${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks + ${CMAKE_IOS_SDK_ROOT}/System/Library/PrivateFrameworks + ${CMAKE_IOS_SDK_ROOT}/Developer/Library/Frameworks +) + +# only search the iOS SDKs, not the remainder of the host filesystem +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# this little macro lets you set any Xcode specific property +macro(set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE) + set_property(TARGET ${TARGET} + PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE}) +endmacro(set_xcode_property) + +# this macro lets you find executable programs on the host system +macro(find_host_package) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + set(IOS FALSE) + + find_package(${ARGN}) + + set(IOS TRUE) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endmacro(find_host_package) + +# eof diff --git a/freetype/builds/compiler/bcc-dev.mk b/freetype/builds/compiler/bcc-dev.mk index 63a46ad16..42a99b0c0 100644 --- a/freetype/builds/compiler/bcc-dev.mk +++ b/freetype/builds/compiler/bcc-dev.mk @@ -53,7 +53,7 @@ L := # Target flag -- no trailing space. # T := -o -TE := -e +TE := -e # C flags diff --git a/freetype/builds/detect.mk b/freetype/builds/detect.mk index ce407baf6..ff4045d5c 100644 --- a/freetype/builds/detect.mk +++ b/freetype/builds/detect.mk @@ -3,7 +3,7 @@ # -# Copyright 1996-2003, 2006, 2008, 2013 by +# Copyright 1996-2003, 2006, 2008, 2013, 2014 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -124,7 +124,7 @@ std_setup: @echo "\`$(CONFIG_MK)' from this directory then read the INSTALL file for help." @echo "" @echo "Otherwise, simply type \`$(MAKE)' again to build the library," - @echo "or \`$(MAKE) refdoc' to build the API reference (the latter needs python)." + @echo "or \`$(MAKE) refdoc' to build the API reference (this needs python >= 2.6)." @echo "" @$(COPY) $(CONFIG_RULES) $(CONFIG_MK) @@ -146,7 +146,7 @@ dos_setup: @echo '$(CONFIG_MK)' from this directory then read the INSTALL file for help. @type builds$(SEP)newline @echo Otherwise, simply type 'make' again to build the library. - @echo or 'make refdoc' to build the API reference (the latter needs python). + @echo or 'make refdoc' to build the API reference (this needs python >= 2.6). @type builds$(SEP)newline @$(COPY) $(subst /,$(SEP),$(CONFIG_RULES) $(CONFIG_MK)) > nul diff --git a/freetype/builds/freetype.mk b/freetype/builds/freetype.mk index 3f1519eba..8b2e2eace 100644 --- a/freetype/builds/freetype.mk +++ b/freetype/builds/freetype.mk @@ -297,19 +297,16 @@ ifneq ($(findstring refdoc,$(MAKECMDGOALS)),) version := $(major).$(minor).$(patch) endif -# We write-protect the docmaker directory to suppress generation -# of .pyc files. +# Option `-B' disables generation of .pyc files (available since python 2.6) # refdoc: - -chmod -w $(SRC_DIR)/tools/docmaker - python $(SRC_DIR)/tools/docmaker/docmaker.py \ - --prefix=ft2 \ - --title=FreeType-$(version) \ - --output=$(DOC_DIR) \ - $(PUBLIC_DIR)/*.h \ - $(PUBLIC_DIR)/config/*.h \ - $(PUBLIC_DIR)/cache/*.h - -chmod +w $(SRC_DIR)/tools/docmaker + python -B $(SRC_DIR)/tools/docmaker/docmaker.py \ + --prefix=ft2 \ + --title=FreeType-$(version) \ + --output=$(DOC_DIR) \ + $(PUBLIC_DIR)/*.h \ + $(PUBLIC_DIR)/config/*.h \ + $(PUBLIC_DIR)/cache/*.h .PHONY: clean_project_std distclean_project_std diff --git a/freetype/builds/mac/freetype-Info.plist b/freetype/builds/mac/freetype-Info.plist new file mode 100755 index 000000000..b3d114dad --- /dev/null +++ b/freetype/builds/mac/freetype-Info.plist @@ -0,0 +1,36 @@ + + + + + + + CFBundleDevelopmentRegion + English + + CFBundleExecutable + FreeType + + CFBundleGetInfoString + FreeType ${PROJECT_VERSION} + + CFBundleInfoDictionaryVersion + 6.0 + + CFBundleName + FreeType + + CFBundlePackageType + FMWK + + CFBundleShortVersionString + ${PROJECT_VERSION} + + CFBundleSignature + ???? + + CFBundleVersion + ${PROJECT_VERSION} + + + diff --git a/freetype/builds/mac/ftmac.c b/freetype/builds/mac/ftmac.c index 40f6bd20c..27b5511c0 100644 --- a/freetype/builds/mac/ftmac.c +++ b/freetype/builds/mac/ftmac.c @@ -5,7 +5,7 @@ /* Mac FOND support. Written by just@letterror.com. */ /* Heavily Fixed by mpsuzuki, George Williams and Sean McBride */ /* */ -/* Copyright 1996-2008, 2013 by */ +/* Copyright 1996-2008, 2013, 2014 by */ /* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -204,6 +204,9 @@ typedef short ResourceIndex; FMFontFamily family = 0; + if ( !fontName || !face_index ) + return FT_THROW( Invalid_Argument ); + *face_index = 0; while ( status == 0 && !the_font ) { @@ -381,7 +384,7 @@ typedef short ResourceIndex; err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index ); - if ( FT_Err_Ok != err ) + if ( err ) return err; if ( noErr != FSRefMakePath( &ref, path, maxPathSize ) ) @@ -420,7 +423,7 @@ typedef short ResourceIndex; err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index ); - if ( FT_Err_Ok != err ) + if ( err ) return err; if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoNone, NULL, NULL, @@ -1238,6 +1241,9 @@ typedef short ResourceIndex; FT_Error error = FT_Err_Ok; + /* test for valid `aface' and `library' delayed to */ + /* `FT_New_Face_From_XXX' */ + GetResInfo( fond, &fond_id, &fond_type, fond_name ); if ( ResError() != noErr || fond_type != TTAG_FOND ) return FT_THROW( Invalid_File_Format ); @@ -1442,6 +1448,8 @@ typedef short ResourceIndex; UInt8 pathname[PATH_MAX]; + /* test for valid `library' and `aface' delayed to `FT_Open_Face' */ + if ( !ref ) return FT_THROW( Invalid_Argument ); diff --git a/freetype/builds/toplevel.mk b/freetype/builds/toplevel.mk index 812750ac5..16d4be837 100644 --- a/freetype/builds/toplevel.mk +++ b/freetype/builds/toplevel.mk @@ -220,9 +220,9 @@ dist: mv tmp freetype-$(version) - tar cfh - freetype-$(version) \ + tar -H ustar -chf - freetype-$(version) \ | gzip -9 -c > freetype-$(version).tar.gz - tar cfh - freetype-$(version) \ + tar -H ustar -chf - freetype-$(version) \ | bzip2 -c > freetype-$(version).tar.bz2 @# Use CR/LF for zip files. diff --git a/freetype/builds/unix/config.guess b/freetype/builds/unix/config.guess index 72625d40c..6c32c8645 100644 --- a/freetype/builds/unix/config.guess +++ b/freetype/builds/unix/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2014-02-12' +timestamp='2014-11-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ timestamp='2014-02-12' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -579,8 +579,9 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -826,7 +827,7 @@ EOF *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -969,10 +970,10 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) diff --git a/freetype/builds/unix/config.sub b/freetype/builds/unix/config.sub index 092cff00e..7ffe37378 100644 --- a/freetype/builds/unix/config.sub +++ b/freetype/builds/unix/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2014-01-01' +timestamp='2014-12-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ timestamp='2014-01-01' # of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -283,8 +283,10 @@ case $basic_machine in | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -296,11 +298,11 @@ case $basic_machine in | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -311,6 +313,7 @@ case $basic_machine in | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -325,6 +328,9 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none @@ -402,8 +408,10 @@ case $basic_machine in | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -415,6 +423,7 @@ case $basic_machine in | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ @@ -432,6 +441,7 @@ case $basic_machine in | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -769,6 +779,9 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -824,6 +837,10 @@ case $basic_machine in basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -1369,14 +1386,14 @@ case $os in | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1594,9 +1611,6 @@ case $basic_machine in mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; diff --git a/freetype/builds/unix/configure b/freetype/builds/unix/configure index 4ae00dd58..08357a9cb 100644 --- a/freetype/builds/unix/configure +++ b/freetype/builds/unix/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for FreeType 2.5.3. +# Generated by GNU Autoconf 2.69 for FreeType 2.5.5. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='FreeType' PACKAGE_TARNAME='freetype' -PACKAGE_VERSION='2.5.3' -PACKAGE_STRING='FreeType 2.5.3' +PACKAGE_VERSION='2.5.5' +PACKAGE_STRING='FreeType 2.5.5' PACKAGE_BUGREPORT='freetype@nongnu.org' PACKAGE_URL='' @@ -639,7 +639,6 @@ build_libtool_libs wl hardcode_libdir_flag_spec LIBSSTATIC_CONFIG -LIBS_CONFIG LIBS_PRIVATE REQUIRES_PRIVATE ftmac_c @@ -1326,7 +1325,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures FreeType 2.5.3 to adapt to many kinds of systems. +\`configure' configures FreeType 2.5.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1391,7 +1390,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of FreeType 2.5.3:";; + short | recursive ) echo "Configuration of FreeType 2.5.5:";; esac cat <<\_ACEOF @@ -1532,7 +1531,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -FreeType configure 2.5.3 +FreeType configure 2.5.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2130,7 +2129,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by FreeType $as_me 2.5.3, which was +It was created by FreeType $as_me 2.5.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2486,7 +2485,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Don't forget to update docs/VERSION.DLL! -version_info='17:2:11' +version_info='17:4:11' ft_version=`echo $version_info | tr : .` @@ -12966,7 +12965,7 @@ fi # fall back to config script. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpng-config" >&5 $as_echo_n "checking for libpng-config... " >&6; } - if which libpng-config > /dev/null; then + if which libpng-config > /dev/null 2>&1; then LIBPNG_CFLAGS=`libpng-config --cflags` LIBPNG_LIBS=`libpng-config --ldflags` libpng_libpriv=`libpng-config --static --ldflags` @@ -13324,7 +13323,7 @@ else fi -# Whether to use FileManager which is deprecated since Mac OS X 10.4. +# Whether to use FileManager, which is deprecated since Mac OS X 10.4. # Check whether --with-fsspec was given. @@ -13478,7 +13477,7 @@ rm -f core conftest.err conftest.$ac_objext \ fi -# Whether to use QuickDraw API in ToolBox which is deprecated since +# Whether to use QuickDraw API in ToolBox, which is deprecated since # Mac OS X 10.4. @@ -13540,7 +13539,7 @@ rm -f core conftest.err conftest.$ac_objext \ fi -# Whether to use QuickDraw API in Carbon which is deprecated since +# Whether to use QuickDraw API in Carbon, which is deprecated since # Mac OS X 10.4. @@ -13715,21 +13714,6 @@ LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \ -e 's/ *$//' \ -e 's/ */ /g'` -LIBS_CONFIG="-lfreetype \ - $ZLIB_LIBS \ - $BZIP2_LIBS \ - $LIBPNG_LIBS \ - $HARFBUZZ_LIBS \ - $ft2_extra_libs" -# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later -# on if necessary; also beautify -LIBS_CONFIG=`echo "$LIBS_CONFIG" \ - | sed -e 's|-L */usr/lib64/* | |g' \ - -e 's|-L */usr/lib/* | |g' \ - -e 's/^ *//' \ - -e 's/ *$//' \ - -e 's/ */ /g'` - LIBSSTATIC_CONFIG="-lfreetype \ $zlib_libstaticconf \ $bzip2_libstaticconf \ @@ -13756,7 +13740,6 @@ LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \ - # changing LDFLAGS value should only be done after # lt_cv_prog_compiler_static_works test @@ -14305,7 +14288,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by FreeType $as_me 2.5.3, which was +This file was extended by FreeType $as_me 2.5.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14371,7 +14354,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -FreeType config.status 2.5.3 +FreeType config.status 2.5.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/freetype/builds/unix/configure.ac b/freetype/builds/unix/configure.ac index 4dcbf4617..f6f754699 100644 --- a/freetype/builds/unix/configure.ac +++ b/freetype/builds/unix/configure.ac @@ -11,13 +11,13 @@ # indicate that you have read the license and understand and accept it # fully. -AC_INIT([FreeType], [2.5.3], [freetype@nongnu.org], [freetype]) +AC_INIT([FreeType], [2.5.5], [freetype@nongnu.org], [freetype]) AC_CONFIG_SRCDIR([ftconfig.in]) # Don't forget to update docs/VERSION.DLL! -version_info='17:2:11' +version_info='17:4:11' AC_SUBST([version_info]) ft_version=`echo $version_info | tr : .` AC_SUBST([ft_version]) @@ -437,7 +437,7 @@ if test x"$with_png" = xyes -o x"$with_png" = xauto; then else # fall back to config script. AC_MSG_CHECKING([for libpng-config]) - if which libpng-config > /dev/null; then + if which libpng-config > /dev/null 2>&1; then LIBPNG_CFLAGS=`libpng-config --cflags` LIBPNG_LIBS=`libpng-config --ldflags` libpng_libpriv=`libpng-config --static --ldflags` @@ -656,7 +656,7 @@ else fi -# Whether to use FileManager which is deprecated since Mac OS X 10.4. +# Whether to use FileManager, which is deprecated since Mac OS X 10.4. AC_ARG_WITH([fsspec], AS_HELP_STRING([--with-fsspec], @@ -765,7 +765,7 @@ elif test x$with_old_mac_fonts = xyes -a x$with_fsref != x; then fi -# Whether to use QuickDraw API in ToolBox which is deprecated since +# Whether to use QuickDraw API in ToolBox, which is deprecated since # Mac OS X 10.4. AC_ARG_WITH([quickdraw-toolbox], @@ -807,7 +807,7 @@ elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_toolbox != x; then fi -# Whether to use QuickDraw API in Carbon which is deprecated since +# Whether to use QuickDraw API in Carbon, which is deprecated since # Mac OS X 10.4. AC_ARG_WITH([quickdraw-carbon], @@ -937,21 +937,6 @@ LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \ -e 's/ *$//' \ -e 's/ */ /g'` -LIBS_CONFIG="-lfreetype \ - $ZLIB_LIBS \ - $BZIP2_LIBS \ - $LIBPNG_LIBS \ - $HARFBUZZ_LIBS \ - $ft2_extra_libs" -# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later -# on if necessary; also beautify -LIBS_CONFIG=`echo "$LIBS_CONFIG" \ - | sed -e 's|-L */usr/lib64/* | |g' \ - -e 's|-L */usr/lib/* | |g' \ - -e 's/^ *//' \ - -e 's/ *$//' \ - -e 's/ */ /g'` - LIBSSTATIC_CONFIG="-lfreetype \ $zlib_libstaticconf \ $bzip2_libstaticconf \ @@ -971,7 +956,6 @@ LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \ AC_SUBST([ftmac_c]) AC_SUBST([REQUIRES_PRIVATE]) AC_SUBST([LIBS_PRIVATE]) -AC_SUBST([LIBS_CONFIG]) AC_SUBST([LIBSSTATIC_CONFIG]) AC_SUBST([hardcode_libdir_flag_spec]) diff --git a/freetype/builds/unix/configure.raw b/freetype/builds/unix/configure.raw index dd7e576f3..72543cf88 100644 --- a/freetype/builds/unix/configure.raw +++ b/freetype/builds/unix/configure.raw @@ -17,7 +17,7 @@ AC_CONFIG_SRCDIR([ftconfig.in]) # Don't forget to update docs/VERSION.DLL! -version_info='17:2:11' +version_info='17:4:11' AC_SUBST([version_info]) ft_version=`echo $version_info | tr : .` AC_SUBST([ft_version]) @@ -437,7 +437,7 @@ if test x"$with_png" = xyes -o x"$with_png" = xauto; then else # fall back to config script. AC_MSG_CHECKING([for libpng-config]) - if which libpng-config > /dev/null; then + if which libpng-config > /dev/null 2>&1; then LIBPNG_CFLAGS=`libpng-config --cflags` LIBPNG_LIBS=`libpng-config --ldflags` libpng_libpriv=`libpng-config --static --ldflags` @@ -656,7 +656,7 @@ else fi -# Whether to use FileManager which is deprecated since Mac OS X 10.4. +# Whether to use FileManager, which is deprecated since Mac OS X 10.4. AC_ARG_WITH([fsspec], AS_HELP_STRING([--with-fsspec], @@ -765,7 +765,7 @@ elif test x$with_old_mac_fonts = xyes -a x$with_fsref != x; then fi -# Whether to use QuickDraw API in ToolBox which is deprecated since +# Whether to use QuickDraw API in ToolBox, which is deprecated since # Mac OS X 10.4. AC_ARG_WITH([quickdraw-toolbox], @@ -807,7 +807,7 @@ elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_toolbox != x; then fi -# Whether to use QuickDraw API in Carbon which is deprecated since +# Whether to use QuickDraw API in Carbon, which is deprecated since # Mac OS X 10.4. AC_ARG_WITH([quickdraw-carbon], @@ -937,21 +937,6 @@ LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \ -e 's/ *$//' \ -e 's/ */ /g'` -LIBS_CONFIG="-lfreetype \ - $ZLIB_LIBS \ - $BZIP2_LIBS \ - $LIBPNG_LIBS \ - $HARFBUZZ_LIBS \ - $ft2_extra_libs" -# remove -L/usr/lib and -L/usr/lib64 since `freetype-config' adds them later -# on if necessary; also beautify -LIBS_CONFIG=`echo "$LIBS_CONFIG" \ - | sed -e 's|-L */usr/lib64/* | |g' \ - -e 's|-L */usr/lib/* | |g' \ - -e 's/^ *//' \ - -e 's/ *$//' \ - -e 's/ */ /g'` - LIBSSTATIC_CONFIG="-lfreetype \ $zlib_libstaticconf \ $bzip2_libstaticconf \ @@ -971,7 +956,6 @@ LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \ AC_SUBST([ftmac_c]) AC_SUBST([REQUIRES_PRIVATE]) AC_SUBST([LIBS_PRIVATE]) -AC_SUBST([LIBS_CONFIG]) AC_SUBST([LIBSSTATIC_CONFIG]) AC_SUBST([hardcode_libdir_flag_spec]) diff --git a/freetype/builds/unix/freetype-config.in b/freetype/builds/unix/freetype-config.in index 41c3a8807..ebc311f07 100644 --- a/freetype/builds/unix/freetype-config.in +++ b/freetype/builds/unix/freetype-config.in @@ -142,7 +142,7 @@ if test "$echo_cflags" = "yes" ; then fi if test "$echo_libs" = "yes" ; then - libs="%LIBS_CONFIG%" + libs="-lfreetype" staticlibs="%LIBSSTATIC_CONFIG%" if test "$show_static" = "yes" ; then libs="$staticlibs" diff --git a/freetype/builds/unix/freetype2.in b/freetype/builds/unix/freetype2.in index 6e7fb104f..a488d9609 100644 --- a/freetype/builds/unix/freetype2.in +++ b/freetype/builds/unix/freetype2.in @@ -1,7 +1,7 @@ -prefix="%prefix%" -exec_prefix="%exec_prefix%" -libdir="%libdir%" -includedir="%includedir%/freetype2" +prefix=%prefix% +exec_prefix=%exec_prefix% +libdir=%libdir% +includedir=%includedir%/freetype2 Name: FreeType 2 URL: http://freetype.org diff --git a/freetype/builds/unix/freetype2.m4 b/freetype/builds/unix/freetype2.m4 index 3d0ecb355..3a806d90f 100644 --- a/freetype/builds/unix/freetype2.m4 +++ b/freetype/builds/unix/freetype2.m4 @@ -1,7 +1,7 @@ # Configure paths for FreeType2 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor # -# Copyright 2001, 2003, 2007, 2009 by +# Copyright 2001, 2003, 2007, 2009, 2014 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -15,7 +15,7 @@ # generated by Autoconf, under the same distribution terms as the rest of # that program. # -# serial 3 +# serial 4 # AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) # Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS. @@ -61,7 +61,7 @@ AC_DEFUN([AC_CHECK_FT2], fi if test "x$FT2_CONFIG" = x ; then - AC_PATH_PROG([FT2_CONFIG], [freetype-config], [no]) + AC_PATH_TOOL([FT2_CONFIG], [freetype-config], [no]) fi min_ft_version=m4_if([$1], [], [7.0.1], [$1]) diff --git a/freetype/builds/unix/ftconfig.in b/freetype/builds/unix/ftconfig.in index 2cf670815..e66f3eab3 100644 --- a/freetype/builds/unix/ftconfig.in +++ b/freetype/builds/unix/ftconfig.in @@ -296,7 +296,16 @@ FT_BEGIN_HEADER #define FT_INT64 long #define FT_UINT64 unsigned long -#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ + /*************************************************************************/ + /* */ + /* A 64-bit data type may create compilation problems if you compile */ + /* in strict ANSI mode. To avoid them, we disable other 64-bit data */ + /* types if __STDC__ is defined. You can however ignore this rule */ + /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ + /* */ +#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 ) + +#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ /* this compiler provides the __int64 type */ #define FT_LONG64 @@ -330,30 +339,9 @@ FT_BEGIN_HEADER #define FT_INT64 long long int #define FT_UINT64 unsigned long long int -#endif /* FT_SIZEOF_LONG == 8 */ - - - /*************************************************************************/ - /* */ - /* A 64-bit data type will create compilation problems if you compile */ - /* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */ - /* is defined. You can however ignore this rule by defining the */ - /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ - /* */ -#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 ) - -#ifdef __STDC__ - - /* Undefine the 64-bit macros in strict ANSI compilation mode. */ - /* Since `#undef' doesn't survive in configuration header files */ - /* we use the postprocessing facility of AC_CONFIG_HEADERS to */ - /* replace the leading `/' with `#'. */ -/undef FT_LONG64 -/undef FT_INT64 - -#endif /* __STDC__ */ +#endif /* _MSC_VER */ -#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */ +#endif /* FT_SIZEOF_LONG == 8 */ #ifdef FT_LONG64 typedef FT_INT64 FT_Int64; @@ -366,219 +354,6 @@ FT_BEGIN_HEADER #define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT -#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER - /* Provide assembler fragments for performance-critical functions. */ - /* These must be defined `static __inline__' with GCC. */ - -#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */ - -#define FT_MULFIX_ASSEMBLER FT_MulFix_arm - - /* documentation is in freetype.h */ - - static __inline FT_Int32 - FT_MulFix_arm( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 t, t2; - - - __asm - { - smull t2, t, b, a /* (lo=t2,hi=t) = a*b */ - mov a, t, asr #31 /* a = (hi >> 31) */ - add a, a, #0x8000 /* a += 0x8000 */ - adds t2, t2, a /* t2 += a */ - adc t, t, #0 /* t += carry */ - mov a, t2, lsr #16 /* a = t2 >> 16 */ - orr a, a, t, lsl #16 /* a |= t << 16 */ - } - return a; - } - -#endif /* __CC_ARM || __ARMCC__ */ - - -#ifdef __GNUC__ - -#if defined( __arm__ ) && \ - ( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \ - !( defined( __CC_ARM ) || defined( __ARMCC__ ) ) - -#define FT_MULFIX_ASSEMBLER FT_MulFix_arm - - /* documentation is in freetype.h */ - - static __inline__ FT_Int32 - FT_MulFix_arm( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 t, t2; - - - __asm__ __volatile__ ( - "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ - "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ -#if defined( __clang__ ) && defined( __thumb2__ ) - "add.w %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ -#else - "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ -#endif - "adds %1, %1, %0\n\t" /* %1 += %0 */ - "adc %2, %2, #0\n\t" /* %2 += carry */ - "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */ - "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */ - : "=r"(a), "=&r"(t2), "=&r"(t) - : "r"(a), "r"(b) - : "cc" ); - return a; - } - -#endif /* __arm__ && */ - /* ( __thumb2__ || !__thumb__ ) && */ - /* !( __CC_ARM || __ARMCC__ ) */ - - -#if defined( __i386__ ) - -#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 - - /* documentation is in freetype.h */ - - static __inline__ FT_Int32 - FT_MulFix_i386( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 result; - - - __asm__ __volatile__ ( - "imul %%edx\n" - "movl %%edx, %%ecx\n" - "sarl $31, %%ecx\n" - "addl $0x8000, %%ecx\n" - "addl %%ecx, %%eax\n" - "adcl $0, %%edx\n" - "shrl $16, %%eax\n" - "shll $16, %%edx\n" - "addl %%edx, %%eax\n" - : "=a"(result), "=d"(b) - : "a"(a), "d"(b) - : "%ecx", "cc" ); - return result; - } - -#endif /* i386 */ - -#endif /* __GNUC__ */ - - -#ifdef _MSC_VER /* Visual C++ */ - -#ifdef _M_IX86 - -#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 - - /* documentation is in freetype.h */ - - static __inline FT_Int32 - FT_MulFix_i386( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 result; - - __asm - { - mov eax, a - mov edx, b - imul edx - mov ecx, edx - sar ecx, 31 - add ecx, 8000h - add eax, ecx - adc edx, 0 - shr eax, 16 - shl edx, 16 - add eax, edx - mov result, eax - } - return result; - } - -#endif /* _M_IX86 */ - -#endif /* _MSC_VER */ - - -#if defined( __GNUC__ ) && defined( __x86_64__ ) - -#define FT_MULFIX_ASSEMBLER FT_MulFix_x86_64 - - static __inline__ FT_Int32 - FT_MulFix_x86_64( FT_Int32 a, - FT_Int32 b ) - { - /* Temporarily disable the warning that C90 doesn't support */ - /* `long long'. */ -#if ( __GNUC__ > 4 ) || ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 6 ) ) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wlong-long" -#endif - -#if 1 - /* Technically not an assembly fragment, but GCC does a really good */ - /* job at inlining it and generating good machine code for it. */ - long long ret, tmp; - - - ret = (long long)a * b; - tmp = ret >> 63; - ret += 0x8000 + tmp; - - return (FT_Int32)( ret >> 16 ); -#else - - /* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine */ - /* code from the lines below. The main issue is that `wide_a' is not */ - /* properly initialized by sign-extending `a'. Instead, the generated */ - /* machine code assumes that the register that contains `a' on input */ - /* can be used directly as a 64-bit value, which is wrong most of the */ - /* time. */ - long long wide_a = (long long)a; - long long wide_b = (long long)b; - long long result; - - - __asm__ __volatile__ ( - "imul %2, %1\n" - "mov %1, %0\n" - "sar $63, %0\n" - "lea 0x8000(%1, %0), %0\n" - "sar $16, %0\n" - : "=&r"(result), "=&r"(wide_a) - : "r"(wide_b) - : "cc" ); - - return (FT_Int32)result; -#endif - -#if ( __GNUC__ > 4 ) || ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 6 ) ) -#pragma GCC diagnostic pop -#endif - } - -#endif /* __GNUC__ && __x86_64__ */ - -#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ - - -#ifdef FT_CONFIG_OPTION_INLINE_MULFIX -#ifdef FT_MULFIX_ASSEMBLER -#define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER -#endif -#endif - - #ifdef FT_MAKE_OPTION_SINGLE_OBJECT #define FT_LOCAL( x ) static x diff --git a/freetype/builds/unix/unix-def.in b/freetype/builds/unix/unix-def.in index 35ea9c86c..4c06a05c7 100644 --- a/freetype/builds/unix/unix-def.in +++ b/freetype/builds/unix/unix-def.in @@ -64,7 +64,6 @@ version_info := @version_info@ # REQUIRES_PRIVATE := @REQUIRES_PRIVATE@ LIBS_PRIVATE := @LIBS_PRIVATE@ -LIBS_CONFIG := @LIBS_CONFIG@ LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@ build_libtool_libs := @build_libtool_libs@ ft_version := @ft_version@ @@ -102,8 +101,7 @@ NO_OUTPUT := 2> /dev/null $(OBJ_BUILD)/freetype-config: $(TOP_DIR)/builds/unix/freetype-config.in rm -f $@ $@.tmp - sed -e 's|%LIBS_CONFIG%|$(LIBS_CONFIG)|' \ - -e 's|%LIBSSTATIC_CONFIG%|$(LIBSSTATIC_CONFIG)|' \ + sed -e 's|%LIBSSTATIC_CONFIG%|$(LIBSSTATIC_CONFIG)|' \ -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \ -e 's|%exec_prefix%|$(exec_prefix)|' \ -e 's|%ft_version%|$(ft_version)|' \ @@ -116,16 +114,29 @@ $(OBJ_BUILD)/freetype-config: $(TOP_DIR)/builds/unix/freetype-config.in chmod a-w $@.tmp mv $@.tmp $@ +# To support directory names with spaces (as might easily happen on Windows +# platforms), the right solution would be to surround the pkg-variables in +# `freetype2.pc' with double quotes. However, doing so ironically disables +# the prefix override mechanism especially written for Windows. This is a +# bug in pkg-config version 0.28 and earlier. +# +# For this reason, we escape spaces with backslashes. + +exec_prefix_x := $(subst $(space),\\$(space),$(exec_prefix)) +includedir_x := $(subst $(space),\\$(space),$(includedir)) +libdir_x := $(subst $(space),\\$(space),$(libdir)) +prefix_x := $(subst $(space),\\$(space),$(prefix)) + $(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in rm -f $@ $@.tmp sed -e 's|%REQUIRES_PRIVATE%|$(REQUIRES_PRIVATE)|' \ -e 's|%LIBS_PRIVATE%|$(LIBS_PRIVATE)|' \ -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \ - -e 's|%exec_prefix%|$(exec_prefix)|' \ + -e 's|%exec_prefix%|$(exec_prefix_x)|' \ -e 's|%ft_version%|$(ft_version)|' \ - -e 's|%includedir%|$(includedir)|' \ - -e 's|%libdir%|$(libdir)|' \ - -e 's|%prefix%|$(prefix)|' \ + -e 's|%includedir%|$(includedir_x)|' \ + -e 's|%libdir%|$(libdir_x)|' \ + -e 's|%prefix%|$(prefix_x)|' \ $< \ > $@.tmp chmod a-w $@.tmp diff --git a/freetype/builds/vms/ftconfig.h b/freetype/builds/vms/ftconfig.h index 3fb8f84fd..b3096512e 100644 --- a/freetype/builds/vms/ftconfig.h +++ b/freetype/builds/vms/ftconfig.h @@ -4,7 +4,7 @@ /* */ /* VMS-specific configuration file (specification only). */ /* */ -/* Copyright 1996-2004, 2006-2008, 2011, 2013 by */ +/* Copyright 1996-2004, 2006-2008, 2011, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -239,7 +239,16 @@ FT_BEGIN_HEADER #define FT_INT64 long #define FT_UINT64 unsigned long -#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ + /*************************************************************************/ + /* */ + /* A 64-bit data type may create compilation problems if you compile */ + /* in strict ANSI mode. To avoid them, we disable other 64-bit data */ + /* types if __STDC__ is defined. You can however ignore this rule */ + /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ + /* */ +#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 ) + +#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ /* this compiler provides the __int64 type */ #define FT_LONG64 @@ -273,27 +282,9 @@ FT_BEGIN_HEADER #define FT_INT64 long long int #define FT_UINT64 unsigned long long int -#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */ - - - /*************************************************************************/ - /* */ - /* A 64-bit data type will create compilation problems if you compile */ - /* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */ - /* is defined. You can however ignore this rule by defining the */ - /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ - /* */ -#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 ) - -#ifdef __STDC__ - - /* undefine the 64-bit macros in strict ANSI compilation mode */ -#undef FT_LONG64 -#undef FT_INT64 - -#endif /* __STDC__ */ +#endif /* _MSC_VER */ -#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */ +#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */ #ifdef FT_LONG64 typedef FT_INT64 FT_Int64; @@ -306,215 +297,6 @@ FT_BEGIN_HEADER #define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT -#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER - /* Provide assembler fragments for performance-critical functions. */ - /* These must be defined `static __inline__' with GCC. */ - -#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */ - -#define FT_MULFIX_ASSEMBLER FT_MulFix_arm - - /* documentation is in freetype.h */ - - static __inline FT_Int32 - FT_MulFix_arm( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 t, t2; - - - __asm - { - smull t2, t, b, a /* (lo=t2,hi=t) = a*b */ - mov a, t, asr #31 /* a = (hi >> 31) */ - add a, a, #0x8000 /* a += 0x8000 */ - adds t2, t2, a /* t2 += a */ - adc t, t, #0 /* t += carry */ - mov a, t2, lsr #16 /* a = t2 >> 16 */ - orr a, a, t, lsl #16 /* a |= t << 16 */ - } - return a; - } - -#endif /* __CC_ARM || __ARMCC__ */ - - -#ifdef __GNUC__ - -#if defined( __arm__ ) && \ - ( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \ - !( defined( __CC_ARM ) || defined( __ARMCC__ ) ) - -#define FT_MULFIX_ASSEMBLER FT_MulFix_arm - - /* documentation is in freetype.h */ - - static __inline__ FT_Int32 - FT_MulFix_arm( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 t, t2; - - - __asm__ __volatile__ ( - "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ - "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ - "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ - "adds %1, %1, %0\n\t" /* %1 += %0 */ - "adc %2, %2, #0\n\t" /* %2 += carry */ - "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */ - "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */ - : "=r"(a), "=&r"(t2), "=&r"(t) - : "r"(a), "r"(b) - : "cc" ); - return a; - } - -#endif /* __arm__ && */ - /* ( __thumb2__ || !__thumb__ ) && */ - /* !( __CC_ARM || __ARMCC__ ) */ - - -#if defined( __i386__ ) - -#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 - - /* documentation is in freetype.h */ - - static __inline__ FT_Int32 - FT_MulFix_i386( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 result; - - - __asm__ __volatile__ ( - "imul %%edx\n" - "movl %%edx, %%ecx\n" - "sarl $31, %%ecx\n" - "addl $0x8000, %%ecx\n" - "addl %%ecx, %%eax\n" - "adcl $0, %%edx\n" - "shrl $16, %%eax\n" - "shll $16, %%edx\n" - "addl %%edx, %%eax\n" - : "=a"(result), "=d"(b) - : "a"(a), "d"(b) - : "%ecx", "cc" ); - return result; - } - -#endif /* i386 */ - -#endif /* __GNUC__ */ - - -#ifdef _MSC_VER /* Visual C++ */ - -#ifdef _M_IX86 - -#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 - - /* documentation is in freetype.h */ - - static __inline FT_Int32 - FT_MulFix_i386( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 result; - - __asm - { - mov eax, a - mov edx, b - imul edx - mov ecx, edx - sar ecx, 31 - add ecx, 8000h - add eax, ecx - adc edx, 0 - shr eax, 16 - shl edx, 16 - add eax, edx - mov result, eax - } - return result; - } - -#endif /* _M_IX86 */ - -#endif /* _MSC_VER */ - - -#if defined( __GNUC__ ) && defined( __x86_64__ ) - -#define FT_MULFIX_ASSEMBLER FT_MulFix_x86_64 - - static __inline__ FT_Int32 - FT_MulFix_x86_64( FT_Int32 a, - FT_Int32 b ) - { - /* Temporarily disable the warning that C90 doesn't support */ - /* `long long'. */ -#if ( __GNUC__ > 4 ) || ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 6 ) ) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wlong-long" -#endif - -#if 1 - /* Technically not an assembly fragment, but GCC does a really good */ - /* job at inlining it and generating good machine code for it. */ - long long ret, tmp; - - - ret = (long long)a * b; - tmp = ret >> 63; - ret += 0x8000 + tmp; - - return (FT_Int32)( ret >> 16 ); -#else - - /* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine */ - /* code from the lines below. The main issue is that `wide_a' is not */ - /* properly initialized by sign-extending `a'. Instead, the generated */ - /* machine code assumes that the register that contains `a' on input */ - /* can be used directly as a 64-bit value, which is wrong most of the */ - /* time. */ - long long wide_a = (long long)a; - long long wide_b = (long long)b; - long long result; - - - __asm__ __volatile__ ( - "imul %2, %1\n" - "mov %1, %0\n" - "sar $63, %0\n" - "lea 0x8000(%1, %0), %0\n" - "sar $16, %0\n" - : "=&r"(result), "=&r"(wide_a) - : "r"(wide_b) - : "cc" ); - - return (FT_Int32)result; -#endif - -#if ( __GNUC__ > 4 ) || ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 6 ) ) -#pragma GCC diagnostic pop -#endif - } - -#endif /* __GNUC__ && __x86_64__ */ - -#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ - - -#ifdef FT_CONFIG_OPTION_INLINE_MULFIX -#ifdef FT_MULFIX_ASSEMBLER -#define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER -#endif -#endif - - #ifdef FT_MAKE_OPTION_SINGLE_OBJECT #define FT_LOCAL( x ) static x diff --git a/freetype/builds/wince/vc2005-ce/freetype.vcproj b/freetype/builds/wince/vc2005-ce/freetype.vcproj index 0626d488a..5614235cb 100644 --- a/freetype/builds/wince/vc2005-ce/freetype.vcproj +++ b/freetype/builds/wince/vc2005-ce/freetype.vcproj @@ -21,7 +21,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -61,7 +61,7 @@ - + @@ -81,7 +81,7 @@ - + @@ -101,7 +101,7 @@ - + @@ -121,7 +121,7 @@ - + @@ -141,7 +141,7 @@ - + @@ -161,7 +161,7 @@ - + @@ -181,7 +181,7 @@ - + @@ -201,7 +201,7 @@ - + @@ -221,7 +221,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -261,7 +261,7 @@ - + @@ -281,7 +281,7 @@ - + @@ -301,7 +301,7 @@ - + @@ -321,7 +321,7 @@ - + @@ -341,7 +341,7 @@ - + @@ -361,7 +361,7 @@ - + @@ -381,7 +381,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -421,7 +421,7 @@ - + @@ -441,7 +441,7 @@ - + @@ -461,7 +461,7 @@ - + @@ -481,7 +481,7 @@ - + @@ -501,7 +501,7 @@ - + @@ -521,7 +521,7 @@ - + @@ -541,7 +541,7 @@ - + @@ -561,7 +561,7 @@ - + @@ -581,7 +581,7 @@ - + @@ -601,7 +601,7 @@ - + @@ -621,7 +621,7 @@ - + @@ -641,7 +641,7 @@ - + @@ -661,7 +661,7 @@ - + @@ -681,7 +681,7 @@ - + @@ -701,7 +701,7 @@ - + @@ -721,7 +721,7 @@ - + @@ -741,7 +741,7 @@ - + @@ -758,7 +758,7 @@ - + diff --git a/freetype/builds/wince/vc2005-ce/index.html b/freetype/builds/wince/vc2005-ce/index.html index fdbf48813..e2160f687 100644 --- a/freetype/builds/wince/vc2005-ce/index.html +++ b/freetype/builds/wince/vc2005-ce/index.html @@ -21,14 +21,14 @@ the following targets:
  • PPC/SP WM6 (Windows Mobile 6)
  • -It compiles the following libraries from the FreeType 2.5.3 sources:

    +It compiles the following libraries from the FreeType 2.5.5 sources:

      -    freetype253.lib     - release build; single threaded
      -    freetype253_D.lib   - debug build;   single threaded
      -    freetype253MT.lib   - release build; multi-threaded
      -    freetype253MT_D.lib - debug build;   multi-threaded
      + freetype255.lib - release build; single threaded + freetype255_D.lib - debug build; single threaded + freetype255MT.lib - release build; multi-threaded + freetype255MT_D.lib - debug build; multi-threaded

    Be sure to extract the files with the Windows (CR+LF) line endings. ZIP diff --git a/freetype/builds/wince/vc2008-ce/freetype.vcproj b/freetype/builds/wince/vc2008-ce/freetype.vcproj index d5afdac10..e36ccb059 100644 --- a/freetype/builds/wince/vc2008-ce/freetype.vcproj +++ b/freetype/builds/wince/vc2008-ce/freetype.vcproj @@ -88,7 +88,7 @@ /> PPC/SP WM6 (Windows Mobile 6) -It compiles the following libraries from the FreeType 2.5.3 sources:

    +It compiles the following libraries from the FreeType 2.5.5 sources:

      -    freetype253.lib     - release build; single threaded
      -    freetype253_D.lib   - debug build;   single threaded
      -    freetype253MT.lib   - release build; multi-threaded
      -    freetype253MT_D.lib - debug build;   multi-threaded
      + freetype255.lib - release build; single threaded + freetype255_D.lib - debug build; single threaded + freetype255MT.lib - release build; multi-threaded + freetype255MT_D.lib - debug build; multi-threaded

    Be sure to extract the files with the Windows (CR+LF) line endings. ZIP diff --git a/freetype/builds/windows/vc2005/freetype.vcproj b/freetype/builds/windows/vc2005/freetype.vcproj index caebeaf65..5880b7d27 100644 --- a/freetype/builds/windows/vc2005/freetype.vcproj +++ b/freetype/builds/windows/vc2005/freetype.vcproj @@ -16,7 +16,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -84,7 +84,7 @@ - + @@ -101,7 +101,7 @@ - + diff --git a/freetype/builds/windows/vc2005/index.html b/freetype/builds/windows/vc2005/index.html index 6d9261600..4929dcdd0 100644 --- a/freetype/builds/windows/vc2005/index.html +++ b/freetype/builds/windows/vc2005/index.html @@ -11,14 +11,14 @@

    This directory contains project files for Visual C++, named freetype.vcproj, and Visual Studio, called freetype.sln. It -compiles the following libraries from the FreeType 2.5.3 sources:

    +compiles the following libraries from the FreeType 2.5.5 sources:

      -    freetype253.lib     - release build; single threaded
      -    freetype253_D.lib   - debug build;   single threaded
      -    freetype253MT.lib   - release build; multi-threaded
      -    freetype253MT_D.lib - debug build;   multi-threaded
      + freetype255.lib - release build; single threaded + freetype255_D.lib - debug build; single threaded + freetype255MT.lib - release build; multi-threaded + freetype255MT_D.lib - debug build; multi-threaded

    Be sure to extract the files with the Windows (CR+LF) line endings. ZIP diff --git a/freetype/builds/windows/vc2008/freetype.vcproj b/freetype/builds/windows/vc2008/freetype.vcproj index b4baaeda6..95d722b97 100644 --- a/freetype/builds/windows/vc2008/freetype.vcproj +++ b/freetype/builds/windows/vc2008/freetype.vcproj @@ -70,7 +70,7 @@ /> This directory contains project files for Visual C++, named freetype.vcproj, and Visual Studio, called freetype.sln. It -compiles the following libraries from the FreeType 2.5.3 sources:

    +compiles the following libraries from the FreeType 2.5.5 sources:

      -    freetype253.lib     - release build; single threaded
      -    freetype253_D.lib   - debug build;   single threaded
      -    freetype253MT.lib   - release build; multi-threaded
      -    freetype253MT_D.lib - debug build;   multi-threaded
      + freetype255.lib - release build; single threaded + freetype255_D.lib - debug build; single threaded + freetype255MT.lib - release build; multi-threaded + freetype255MT_D.lib - debug build; multi-threaded

    Be sure to extract the files with the Windows (CR+LF) line endings. ZIP diff --git a/freetype/builds/windows/vc2010/freetype.sln b/freetype/builds/windows/vc2010/freetype.sln index e0f13a290..3bd176a78 100644 --- a/freetype/builds/windows/vc2010/freetype.sln +++ b/freetype/builds/windows/vc2010/freetype.sln @@ -5,20 +5,24 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "freetype.vcxpro EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Debug Multithreaded|Win32 = Debug Multithreaded|Win32 Debug Multithreaded|x64 = Debug Multithreaded|x64 Debug Singlethreaded|Win32 = Debug Singlethreaded|Win32 Debug Singlethreaded|x64 = Debug Singlethreaded|x64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 Release Multithreaded|Win32 = Release Multithreaded|Win32 Release Multithreaded|x64 = Release Multithreaded|x64 Release Singlethreaded|Win32 = Release Singlethreaded|Win32 Release Singlethreaded|x64 = Release Singlethreaded|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.ActiveCfg = Debug Multithreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.Build.0 = Debug Multithreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|x64.ActiveCfg = Debug Multithreaded|x64 @@ -27,10 +31,10 @@ Global {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|Win32.Build.0 = Debug Singlethreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|x64.ActiveCfg = Debug Singlethreaded|x64 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|x64.Build.0 = Debug Singlethreaded|x64 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64 + {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|Win32.ActiveCfg = Release Multithreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|Win32.Build.0 = Release Multithreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded|x64.ActiveCfg = Release Multithreaded|x64 @@ -39,10 +43,6 @@ Global {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|Win32.Build.0 = Release Singlethreaded|Win32 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|x64.ActiveCfg = Release Singlethreaded|x64 {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded|x64.Build.0 = Release Singlethreaded|x64 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/freetype/builds/windows/vc2010/freetype.user.props b/freetype/builds/windows/vc2010/freetype.user.props new file mode 100755 index 000000000..234dd5d79 --- /dev/null +++ b/freetype/builds/windows/vc2010/freetype.user.props @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/freetype/builds/windows/vc2010/freetype.vcxproj b/freetype/builds/windows/vc2010/freetype.vcxproj index 1b9421775..7cafe4539 100644 --- a/freetype/builds/windows/vc2010/freetype.vcxproj +++ b/freetype/builds/windows/vc2010/freetype.vcxproj @@ -1,6 +1,14 @@  + + Debug + Win32 + + + Debug + x64 + Debug Multithreaded Win32 @@ -17,12 +25,12 @@ Debug Singlethreaded x64 - - Debug + + Release Win32 - - Debug + + Release x64 @@ -41,62 +49,54 @@ Release Singlethreaded x64 - - Release - Win32 - - - Release - x64 - {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} - + StaticLibrary false MultiByte v100 - + StaticLibrary false MultiByte v100 - + StaticLibrary false MultiByte v100 - + StaticLibrary false MultiByte v100 - + StaticLibrary false MultiByte v100 - + StaticLibrary false MultiByte v100 - + StaticLibrary false MultiByte v100 - + StaticLibrary false MultiByte @@ -114,13 +114,13 @@ MultiByte v100 - + StaticLibrary false MultiByte v100 - + StaticLibrary false MultiByte @@ -131,18 +131,36 @@ <_ProjectFileVersion>10.0.30319.1 - .\..\..\..\objs\win32\vc2010\ - .\..\..\..\objs\release\ - .\..\..\..\objs\win32\vc2010\ - .\..\..\..\objs\release_mt\ - .\..\..\..\objs\win32\vc2010\ - .\..\..\..\objs\release_st\ - .\..\..\..\objs\win32\vc2010\ - .\..\..\..\objs\debug\ - .\..\..\..\objs\win32\vc2010\ - .\..\..\..\objs\debug_st\ - .\..\..\..\objs\win32\vc2010\ - .\..\..\..\objs\debug_mt\ + .\..\..\..\objs\vc2010\$(Platform)\ + .\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\ + .\..\..\..\objs\vc2010\$(Platform)\ + .\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\ + .\..\..\..\objs\vc2010\$(Platform)\ + .\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\ + .\..\..\..\objs\vc2010\$(Platform)\ + .\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\ + .\..\..\..\objs\vc2010\$(Platform)\ + .\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\ + .\..\..\..\objs\vc2010\$(Platform)\ + .\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\ + .\..\..\..\objs\vc2010\$(Platform)\ + .\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\ + .\..\..\..\objs\vc2010\$(Platform)\ + .\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\ + .\..\..\..\objs\vc2010\$(Platform)\ + .\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\ + .\..\..\..\objs\vc2010\$(Platform)\ + .\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\ + .\..\..\..\objs\vc2010\$(Platform)\ + .\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\ + .\..\..\..\objs\vc2010\$(Platform)\ + .\..\..\..\objs\vc2010\$(Platform)\$(Configuration)\ + AllRules.ruleset + AllRules.ruleset + + + + AllRules.ruleset AllRules.ruleset @@ -155,12 +173,12 @@ - AllRules.ruleset - AllRules.ruleset - - - - + AllRules.ruleset + AllRules.ruleset + + + + AllRules.ruleset AllRules.ruleset @@ -173,309 +191,432 @@ - AllRules.ruleset - AllRules.ruleset - - - - - freetype253_D - freetype253_D - freetype253MT_D - freetype253MT_D - freetype253ST_D - freetype253ST_D - freetype253 - freetype253 - freetype253MT - freetype253MT - freetype253ST - freetype253ST - - - .\..\..\..\objs\win64\vc2010\ - .\..\..\..\objs\debug\ + freetype255d + freetype255d + freetype255MTd + freetype255MTd + freetype255STd + freetype255STd + freetype255 + freetype255 + freetype255MT + freetype255MT + freetype255ST + freetype255ST - + + - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true + Disabled + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL true Level4 - - + ProgramDatabase Default 4001 true + false + $(OutDir)$(TargetName).pdb + Disabled - NDEBUG;%(PreprocessorDefinitions) + _DEBUG;$(UserDefines);%(PreprocessorDefinitions) 0x0409 true + MachineX86 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) - + - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true + Disabled + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL true Level4 - - + ProgramDatabase Default 4001 true + false + $(OutDir)$(TargetName).pdb + Disabled - NDEBUG;%(PreprocessorDefinitions) + _DEBUG;$(UserDefines);%(PreprocessorDefinitions) 0x0409 true + MachineX64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) - + - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) - true - MultiThreaded - true + Disabled + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;_CRT_SECURE_NO_DEPRECATE;$(UserDefines);%(PreprocessorDefinitions) + false + false + EnableFastChecks + MultiThreadedDebug true Level4 - - + ProgramDatabase Default 4001 true + false + $(OutDir)$(TargetName).pdb + Disabled - NDEBUG;%(PreprocessorDefinitions) + _DEBUG;$(UserDefines);%(PreprocessorDefinitions) 0x0409 true + MachineX86 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) - + - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) - true - MultiThreaded - true + Disabled + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;_CRT_SECURE_NO_DEPRECATE;$(UserDefines);%(PreprocessorDefinitions) + false + false + EnableFastChecks + MultiThreadedDebug true Level4 - - + ProgramDatabase Default 4001 true + false + $(OutDir)$(TargetName).pdb + Disabled - NDEBUG;%(PreprocessorDefinitions) + _DEBUG;$(UserDefines);%(PreprocessorDefinitions) 0x0409 true + MachineX64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) - + - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) - true - MultiThreaded - true + Disabled + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug true Level4 - - + ProgramDatabase Default 4001 true + false + $(OutDir)$(TargetName).pdb + Disabled - NDEBUG;%(PreprocessorDefinitions) + _DEBUG;$(UserDefines);%(PreprocessorDefinitions) 0x0409 - + + true + MachineX86 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + - + - MaxSpeed - OnlyExplicitInline - ..\..\..\include;%(AdditionalIncludeDirectories) - NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) - true - MultiThreaded - true + Disabled + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug true Level4 - - + ProgramDatabase Default 4001 true + false + $(OutDir)$(TargetName).pdb + Disabled - NDEBUG;%(PreprocessorDefinitions) + _DEBUG;$(UserDefines);%(PreprocessorDefinitions) 0x0409 - + + true + MachineX64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) + - + - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL + Full + AnySuitable + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + true + MultiThreadedDLL + true true Level4 - ProgramDatabase Default 4001 true + false + StreamingSIMDExtensions2 + false + false + false + + + true + + + true + Neither + true - _DEBUG;%(PreprocessorDefinitions) + NDEBUG;$(UserDefines);%(PreprocessorDefinitions) 0x0409 true + true + MachineX86 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) - + - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL + Full + AnySuitable + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + true + MultiThreadedDLL + true true Level4 - ProgramDatabase Default 4001 true + false + StreamingSIMDExtensions2 + false + false + false + + + true + + + true + Neither + true - _DEBUG;%(PreprocessorDefinitions) + NDEBUG;$(UserDefines);%(PreprocessorDefinitions) 0x0409 true + true + MachineX64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) - + - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug + Full + AnySuitable + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + true + MultiThreaded + true true Level4 - ProgramDatabase Default 4001 true + false + StreamingSIMDExtensions2 + false + false + false + false + + + true + + + true + Neither + true - _DEBUG;%(PreprocessorDefinitions) + NDEBUG;$(UserDefines);%(PreprocessorDefinitions) 0x0409 true + true + MachineX86 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) - + - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug + Full + AnySuitable + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + true + MultiThreaded + true true Level4 - ProgramDatabase Default 4001 true + false + StreamingSIMDExtensions2 + false + false + false + false + + + true + + + true + Neither + true - _DEBUG;%(PreprocessorDefinitions) + NDEBUG;$(UserDefines);%(PreprocessorDefinitions) 0x0409 true + true + MachineX64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) - + - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - false - false - EnableFastChecks - MultiThreadedDebug + Full + AnySuitable + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + true + MultiThreaded + true true Level4 - ProgramDatabase Default 4001 true + false + StreamingSIMDExtensions2 + false + false + false + + + true + + + true + Neither + true - _DEBUG;%(PreprocessorDefinitions) + NDEBUG;$(UserDefines);%(PreprocessorDefinitions) 0x0409 + - true + true + MachineX86 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) - + - Disabled - ..\..\..\include;%(AdditionalIncludeDirectories) - _DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - false - false - EnableFastChecks - MultiThreadedDebug + Full + AnySuitable + $(UserOptionDirectory);..\..\..\include;$(UserIncludeDirectories);%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT2_BUILD_LIBRARY;$(UserDefines);%(PreprocessorDefinitions) + true + MultiThreaded + true true Level4 - ProgramDatabase Default 4001 true + false + StreamingSIMDExtensions2 + false + false + false + + + true + + + true + Neither + true - _DEBUG;%(PreprocessorDefinitions) + NDEBUG;$(UserDefines);%(PreprocessorDefinitions) 0x0409 + - true + true + MachineX64 + $(UserLibraryDirectories);%(AdditionalLibraryDirectories) + $(UserDependencies);%(AdditionalDependencies) @@ -1574,4 +1715,4 @@ - + \ No newline at end of file diff --git a/freetype/builds/windows/vc2010/index.html b/freetype/builds/windows/vc2010/index.html index 2b2b4317d..cb205aa70 100644 --- a/freetype/builds/windows/vc2010/index.html +++ b/freetype/builds/windows/vc2010/index.html @@ -12,16 +12,16 @@

    This directory contains a project file for Visual C++ (VS.NET 2010 or newer), named freetype.vcxproj, and Visual Studio, called freetype.sln. It compiles the following libraries from the -FreeType 2.5.3 sources:

    +FreeType 2.5.5 sources:

      -freetype253.lib     - release build
      -freetype253_D.lib   - debug build
      -freetype253ST.lib   - release build; single threaded
      -freetype253ST_D.lib - debug build;   single threaded
      -freetype253MT.lib   - release build; multi-threaded
      -freetype253MT_D.lib - debug build;   multi-threaded
      +freetype255.lib - release build +freetype255d.lib - debug build +freetype255ST.lib - release build; single threaded +freetype255STd.lib - debug build; single threaded +freetype255MT.lib - release build; multi-threaded +freetype255MTd.lib - debug build; multi-threaded

    Both Win32 and x64 builds are supported.

    @@ -30,13 +30,23 @@ freetype253MT_D.lib - debug build; multi-threaded archives are already stored this way, so no further action is required. If you use some .tar.*z archives, be sure to configure your extracting tool to convert the line endings. For example, with WinZip, you should activate the TAR -file smart CR/LF Conversion option. Alternatively, you may consider +href="http://www.winzip.com">WinZip, you should activate the TAR +file smart CR/LF Conversion option. Alternatively, you may consider using the unix2dos or u2d utilities that are floating around, which specifically deal with this particular problem. -

    Build directories are placed in the top-level objs +

    Build directories are placed in the top-level objs\vc2010 directory.

    +

    Customization of the FreeType library is done by editing the +ftoptions.h header file in the top-level devel path. +Alternatively, you may copy the file to another directory and change the +include directory in freetype.users.props.

    + +

    To configure library dependencies like zlib and libpng, +edit the freetype.users.props file in this directory. It also +simplifies automated (command-line) builds using msbuild.

    + diff --git a/freetype/builds/windows/visualc/freetype.dsp b/freetype/builds/windows/visualc/freetype.dsp index c09afe54b..cf76f7c2d 100644 --- a/freetype/builds/windows/visualc/freetype.dsp +++ b/freetype/builds/windows/visualc/freetype.dsp @@ -7,23 +7,23 @@ CFG=freetype - Win32 Debug Singlethreaded !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "freetype.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "freetype.mak" CFG="freetype - Win32 Debug Singlethreaded" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "freetype - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "freetype - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "freetype - Win32 Debug Multithreaded" (based on "Win32 (x86) Static Library") !MESSAGE "freetype - Win32 Release Multithreaded" (based on "Win32 (x86) Static Library") !MESSAGE "freetype - Win32 Release Singlethreaded" (based on "Win32 (x86) Static Library") !MESSAGE "freetype - Win32 Debug Singlethreaded" (based on "Win32 (x86) Static Library") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -54,7 +54,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype253.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Debug" @@ -78,7 +78,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype253_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255_D.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Debug Multithreaded" @@ -102,8 +102,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"lib\freetype253_D.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype253MT_D.lib" +# ADD BASE LIB32 /nologo /out:"lib\freetype255_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255MT_D.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Release Multithreaded" @@ -126,8 +126,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"lib\freetype253.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype253MT.lib" +# ADD BASE LIB32 /nologo /out:"lib\freetype255.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255MT.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Release Singlethreaded" @@ -151,8 +151,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype253.lib" -# ADD LIB32 /out:"..\..\..\objs\freetype253ST.lib" +# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype255.lib" +# ADD LIB32 /out:"..\..\..\objs\freetype255ST.lib" # SUBTRACT LIB32 /nologo !ELSEIF "$(CFG)" == "freetype - Win32 Debug Singlethreaded" @@ -177,10 +177,10 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype253_D.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype253ST_D.lib" +# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype255_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255ST_D.lib" -!ENDIF +!ENDIF # Begin Target diff --git a/freetype/builds/windows/visualc/freetype.vcproj b/freetype/builds/windows/visualc/freetype.vcproj index 3baa3e21c..a71a0e978 100644 --- a/freetype/builds/windows/visualc/freetype.vcproj +++ b/freetype/builds/windows/visualc/freetype.vcproj @@ -69,7 +69,7 @@ /> This directory contains project files for Visual C++, named freetype.dsp, and Visual Studio, called freetype.sln. It -compiles the following libraries from the FreeType 2.5.3 sources:

    +compiles the following libraries from the FreeType 2.5.5 sources:

      -    freetype253.lib     - release build; single threaded
      -    freetype253_D.lib   - debug build;   single threaded
      -    freetype253MT.lib   - release build; multi-threaded
      -    freetype253MT_D.lib - debug build;   multi-threaded
      + freetype255.lib - release build; single threaded + freetype255_D.lib - debug build; single threaded + freetype255MT.lib - release build; multi-threaded + freetype255MT_D.lib - debug build; multi-threaded

    Be sure to extract the files with the Windows (CR+LF) line endings. ZIP diff --git a/freetype/builds/windows/visualce/freetype.dsp b/freetype/builds/windows/visualce/freetype.dsp index c09afe54b..cf76f7c2d 100644 --- a/freetype/builds/windows/visualce/freetype.dsp +++ b/freetype/builds/windows/visualce/freetype.dsp @@ -7,23 +7,23 @@ CFG=freetype - Win32 Debug Singlethreaded !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "freetype.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "freetype.mak" CFG="freetype - Win32 Debug Singlethreaded" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "freetype - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "freetype - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "freetype - Win32 Debug Multithreaded" (based on "Win32 (x86) Static Library") !MESSAGE "freetype - Win32 Release Multithreaded" (based on "Win32 (x86) Static Library") !MESSAGE "freetype - Win32 Release Singlethreaded" (based on "Win32 (x86) Static Library") !MESSAGE "freetype - Win32 Debug Singlethreaded" (based on "Win32 (x86) Static Library") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -54,7 +54,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype253.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Debug" @@ -78,7 +78,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype253_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255_D.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Debug Multithreaded" @@ -102,8 +102,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"lib\freetype253_D.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype253MT_D.lib" +# ADD BASE LIB32 /nologo /out:"lib\freetype255_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255MT_D.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Release Multithreaded" @@ -126,8 +126,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"lib\freetype253.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype253MT.lib" +# ADD BASE LIB32 /nologo /out:"lib\freetype255.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255MT.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Release Singlethreaded" @@ -151,8 +151,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype253.lib" -# ADD LIB32 /out:"..\..\..\objs\freetype253ST.lib" +# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype255.lib" +# ADD LIB32 /out:"..\..\..\objs\freetype255ST.lib" # SUBTRACT LIB32 /nologo !ELSEIF "$(CFG)" == "freetype - Win32 Debug Singlethreaded" @@ -177,10 +177,10 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype253_D.lib" -# ADD LIB32 /nologo /out:"..\..\..\objs\freetype253ST_D.lib" +# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype255_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype255ST_D.lib" -!ENDIF +!ENDIF # Begin Target diff --git a/freetype/builds/windows/visualce/freetype.vcproj b/freetype/builds/windows/visualce/freetype.vcproj index 78580b751..e4cddfb0d 100644 --- a/freetype/builds/windows/visualce/freetype.vcproj +++ b/freetype/builds/windows/visualce/freetype.vcproj @@ -87,7 +87,7 @@ /> PPC/SP WM6 (Windows Mobile 6) -It compiles the following libraries from the FreeType 2.5.3 sources:

    +It compiles the following libraries from the FreeType 2.5.5 sources:

      -    freetype253.lib     - release build; single threaded
      -    freetype253_D.lib   - debug build;   single threaded
      -    freetype253MT.lib   - release build; multi-threaded
      -    freetype253MT_D.lib - debug build;   multi-threaded
      + freetype255.lib - release build; single threaded + freetype255_D.lib - debug build; single threaded + freetype255MT.lib - release build; multi-threaded + freetype255MT_D.lib - debug build; multi-threaded

    Be sure to extract the files with the Windows (CR+LF) line endings. ZIP diff --git a/freetype/devel/ftoption.h b/freetype/devel/ftoption.h index d7b6a6301..10027bb54 100644 --- a/freetype/devel/ftoption.h +++ b/freetype/devel/ftoption.h @@ -4,7 +4,7 @@ /* */ /* User-selectable configuration macros (specification only). */ /* */ -/* Copyright 1996-2013 by */ +/* Copyright 1996-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -61,7 +61,7 @@ FT_BEGIN_HEADER /* that are statically linked to the library at compile time. By */ /* default, this file is . */ /* */ - /* We highly recommend using the third method whenever possible. */ + /* We highly recommend using the third method whenever possible. */ /* */ /*************************************************************************/ @@ -205,7 +205,7 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ - /* PNG bitmap support. */ + /* PNG bitmap support. */ /* */ /* FreeType now handles loading color bitmap glyphs in the PNG format. */ /* This requires help from the external libpng library. Uncompressed */ @@ -219,7 +219,7 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ - /* HarfBuzz support. */ + /* HarfBuzz support. */ /* */ /* FreeType uses the HarfBuzz library to improve auto-hinting of */ /* OpenType fonts. If available, many glyphs not directly addressable */ @@ -771,6 +771,30 @@ FT_BEGIN_HEADER /*************************************************************************/ + /*************************************************************************/ + /* */ + /* Using CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4} it is */ + /* possible to set up the default values of the four control points that */ + /* define the stem darkening behaviour of the (new) CFF engine. For */ + /* more details please read the documentation of the */ + /* `darkening-parameters' property of the cff driver module (file */ + /* `ftcffdrv.h'), which allows the control at run-time. */ + /* */ + /* Do *not* undefine these macros! */ + /* */ +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 500 +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 400 + +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 1000 +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 275 + +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 1667 +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 275 + +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 2333 +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 0 + + /*************************************************************************/ /* */ /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */ @@ -820,8 +844,8 @@ FT_BEGIN_HEADER /* - * This macro is obsolete. Support has been removed in FreeType - * version 2.5. + * This macro is obsolete. Support has been removed in FreeType + * version 2.5. */ /* #define FT_CONFIG_OPTION_OLD_INTERNALS */ @@ -837,6 +861,35 @@ FT_BEGIN_HEADER #define TT_USE_BYTECODE_INTERPRETER #endif + + /* + * Check CFF darkening parameters. The checks are the same as in function + * `cff_property_set' in file `cffdrivr.c'. + */ +#if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0 || \ + \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0 || \ + \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 > \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 > \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 > \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 || \ + \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500 +#error "Invalid CFF darkening parameters!" +#endif + FT_END_HEADER diff --git a/freetype/docs/CHANGES b/freetype/docs/CHANGES index 803f02dc6..bbc31104a 100644 --- a/freetype/docs/CHANGES +++ b/freetype/docs/CHANGES @@ -1,11 +1,92 @@ +CHANGES BETWEEN 2.5.4 and 2.5.5 + + I. IMPORTANT BUG FIXES + + - Handling of uncompressed PCF files works again (bug introduced + in version 2.5.4). + + +====================================================================== + +CHANGES BETWEEN 2.5.3 and 2.5.4 + + I. IMPORTANT BUG FIXES + + - A variant of vulnerability CVE-2014-2240 was identified + (cf. http://savannah.nongnu.org/bugs/?43661) and fixed in the + new CFF driver. All users should upgrade. + + - The new auto-hinter code using HarfBuzz crashed for some invalid + fonts. + + - Many fixes to better protect against malformed input. + + + II. IMPORTANT CHANGES + + - Full auto-hinter support of the Devanagari script. + + - Experimental auto-hinter support of the Telugu script. + + - CFF stem darkening behaviour can now be controlled at build time + using the eight macros + + CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4} . + + - Some fields in the `FT_Bitmap' structure have been changed from + signed to unsigned type, which better reflects the actual usage. + It is also an additional means to protect against malformed + input. + + This change doesn't break the ABI; however, it might cause + compiler warnings. + + + III. MISCELLANEOUS + + - Improvements to the auto-hinter's algorithm to recognize stems + and local extrema. + + - Function `FT_Get_SubGlyph_Info' always returned an error even in + case of success. + + - Version 2.5.1 introduced major bugs in the cjk part of the + auto-hinter, which are now fixed. + + - The `FT_Sfnt_Tag' enumeration values have been changed to + uppercase, e.g. `FT_SFNT_HEAD'. The lowercase variants are + deprecated. This is for orthogonality with all other + enumeration (and enumeration-like) values in FreeType. + + - `cmake' now supports builds of FreeType as an OS X framework and + for iOS. + + - Improved project files for vc2010, introducing a property file. + + - The documentation generator for the API reference has been + updated to produce better HTML code (with proper CSS). At the + same time, the documentation got a better structure. + + - The FT_LOAD_BITMAP_CROP flag is obsolete; it is not used by any + driver. + + - The TrueType DELTAP[123] bytecode instructions now work in + subpixel hinting mode as described in the ClearType whitepaper + (i.e., for touched points in the non-subpixel direction). + + - Many small improvements to the internal arithmetic routines. + + +====================================================================== + CHANGES BETWEEN 2.5.2 and 2.5.3 I. IMPORTANT BUG FIXES - - A vulnerability was identified and fixed in the new CFF driver - (cf. http://savannah.nongnu.org/bugs/?41697; it doesn't have a - CVE number yet). All users should upgrade. + - A vulnerability (CVE-2014-2240) was identified and fixed in the + new CFF driver (cf. http://savannah.nongnu.org/bugs/?41697). + All users should upgrade. - More bug fixes related to correct positioning of composite glyphs. @@ -261,6 +342,9 @@ CHANGES BETWEEN 2.4.12 and 2.5 it accepts a new command line option `-H' to select the hinting engine. + - `ftdump's verbose option has been renamed to `-V'. For all demo + programs, `-v' now shows version information. + - Another round of TrueType subpixel hinting fixes. - The `apinames' tool can now create an import file for NetWare. diff --git a/freetype/docs/VERSION.DLL b/freetype/docs/VERSION.DLL index 7446954fe..dd4926195 100644 --- a/freetype/docs/VERSION.DLL +++ b/freetype/docs/VERSION.DLL @@ -52,6 +52,8 @@ on _most_ systems, but not all of them: release libtool so ------------------------------- + 2.5.5 17.4.11 6.11.4 + 2.5.4 17.3.11 6.11.3 2.5.3 17.2.11 6.11.2 2.5.2 17.1.11 6.11.1 2.5.1 17.0.11 6.11.0 diff --git a/freetype/docs/formats.txt b/freetype/docs/formats.txt index 827c8947f..aed885c89 100644 --- a/freetype/docs/formats.txt +++ b/freetype/docs/formats.txt @@ -153,7 +153,7 @@ MAC --- PS TYPE_1 --- type1 T1_SPEC.pdf for a specification given in Appendix D on pgs. 436-450. However, this information might be out of date; unfortunately, there is no - PCF specification available online, and this book is out of print. + PCF specification available online, and this book is out of print. George Williams deduced the font format from the X11 sources and documented it for his FontForge font editor: diff --git a/freetype/docs/freetype-config.1 b/freetype/docs/freetype-config.1 index 99a17c576..7b4a118f3 100644 --- a/freetype/docs/freetype-config.1 +++ b/freetype/docs/freetype-config.1 @@ -1,4 +1,4 @@ -.TH FREETYPE-CONFIG 1 "March 2014" "FreeType 2.5.3" +.TH FREETYPE-CONFIG 1 "December 2014" "FreeType 2.5.5" . . .SH NAME diff --git a/freetype/docs/reference/ft2-auto_hinter.html b/freetype/docs/reference/ft2-auto_hinter.html index d434ec47c..71dede419 100644 --- a/freetype/docs/reference/ft2-auto_hinter.html +++ b/freetype/docs/reference/ft2-auto_hinter.html @@ -3,58 +3,121 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference -

    - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -The auto-hinter -

    +

    The auto-hinter

    Synopsis

    - - - - - -
    glyph-to-script-mapdefault-script
    FT_AUTOHINTER_SCRIPT_XXXincrease-x-height
    FT_Prop_GlyphToScriptMapFT_Prop_IncreaseXHeight
    fallback-script


    - -
    + + + + + +
    glyph-to-script-mapdefault-script
    FT_AUTOHINTER_SCRIPT_XXXincrease-x-height
    FT_Prop_GlyphToScriptMapFT_Prop_IncreaseXHeight
    fallback-script
    + +

    While FreeType's auto-hinter doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get. The following lists the available properties together with the necessary macros and structures.

    Note that the auto-hinter's module name is ‘autofitter’ for historical reasons.

    -

    -
    -

    glyph-to-script-map

    -
    + +
    +

    glyph-to-script-map

    +

    Experimental only

    The auto-hinter provides various script modules to hint glyphs. Examples of supported scripts are Latin or CJK. Before a glyph is auto-hinted, the Unicode character map of the font gets examined, and the script is then determined based on Unicode character ranges, see below.

    OpenType fonts, however, often provide much more glyphs than character codes (small caps, superscripts, ligatures, swashes, etc.), to be controlled by so-called ‘features’. Handling OpenType features can be quite complicated and thus needs a separate library on top of FreeType.

    @@ -78,39 +141,29 @@ The auto-hinter FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT ); -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_AUTOHINTER_SCRIPT_XXX

    -
    -Defined in FT_AUTOHINTER_H (ftautoh.h). -

    -
    -
    -#define FT_AUTOHINTER_SCRIPT_NONE   0
    -#define FT_AUTOHINTER_SCRIPT_LATIN  1
    -#define FT_AUTOHINTER_SCRIPT_CJK    2
    -#define FT_AUTOHINTER_SCRIPT_INDIC  3
    -
    -

    -
    + +
    + + +
    +

    FT_AUTOHINTER_SCRIPT_XXX

    +

    Defined in FT_AUTOHINTER_H (ftautoh.h).

    +
    +#define FT_AUTOHINTER_SCRIPT_NONE   0
    +#define FT_AUTOHINTER_SCRIPT_LATIN  1
    +#define FT_AUTOHINTER_SCRIPT_CJK    2
    +#define FT_AUTOHINTER_SCRIPT_INDIC  3
    +
    +

    Experimental only

    A list of constants used for the glyph-to-script-map property to specify the script submodule the auto-hinter should use for hinting a particular glyph.

    -

    -
    values
    -

    - - -
    FT_AUTOHINTER_SCRIPT_NONE
    + +

    values

    + + - - - - - -
    FT_AUTOHINTER_SCRIPT_NONE

    Don't auto-hint this glyph.

    FT_AUTOHINTER_SCRIPT_LATIN
    +
    FT_AUTOHINTER_SCRIPT_LATIN

    Apply the latin auto-hinter. For the auto-hinter, ‘latin’ is a very broad term, including Cyrillic and Greek also since characters from those scripts share the same design constraints.

    By default, characters from the following Unicode ranges are assigned to this submodule.

    @@ -145,8 +198,7 @@ Defined in FT_AUTOHINTER_H (ftautoh.h).
     

    FT_AUTOHINTER_SCRIPT_CJK
    +
    FT_AUTOHINTER_SCRIPT_CJK

    Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old Vietnamese, and some other scripts.

    By default, characters from the following Unicode ranges are assigned to this submodule.

    @@ -185,8 +237,7 @@ Defined in FT_AUTOHINTER_H (ftautoh.h).
     

    FT_AUTOHINTER_SCRIPT_INDIC
    +
    FT_AUTOHINTER_SCRIPT_INDIC

    Apply the indic auto-hinter, covering all major scripts from the Indian sub-continent and some other related scripts like Thai, Lao, or Tibetan.

    By default, characters from the following Unicode ranges are assigned to this submodule.

    @@ -201,41 +252,31 @@ Defined in FT_AUTOHINTER_H (ftautoh.h).
     

    Note that currently Indic support is rudimentary only, missing blue zone support.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Prop_GlyphToScriptMap

    -
    -Defined in FT_AUTOHINTER_H (ftautoh.h). -

    -
    -
    -   typedef struct  FT_Prop_GlyphToScriptMap_
    -   {
    -     FT_Face   face;
    -     FT_Byte*  map;
    -
    -   } FT_Prop_GlyphToScriptMap;
    -
    -

    -
    + +
    + + +
    +

    FT_Prop_GlyphToScriptMap

    +

    Defined in FT_AUTOHINTER_H (ftautoh.h).

    +
    +  typedef struct  FT_Prop_GlyphToScriptMap_
    +  {
    +    FT_Face   face;
    +    FT_Byte*  map;
    +
    +  } FT_Prop_GlyphToScriptMap;
    +
    +

    Experimental only

    The data exchange structure for the glyph-to-script-map property.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    fallback-script

    -
    + +
    + + +
    +

    fallback-script

    +

    Experimental only

    If no auto-hinter script module can be assigned to a glyph, a fallback script gets assigned to it (see also the glyph-to-script-map property). By default, this is FT_AUTOHINTER_SCRIPT_CJK. Using the ‘fallback-script’ property, this fallback value can be changed.

    @@ -248,20 +289,17 @@ Defined in FT_AUTOHINTER_H (ftautoh.h).
       FT_Property_Set( library, "autofitter",
                                 "fallback-script", &fallback_script );
     
    -

    -
    note
    + +

    note

    This property can be used with FT_Property_Get also.

    It's important to use the right timing for changing this value: The creation of the glyph-to-script map that eventually uses the fallback script value gets triggered either by setting or reading a face-specific property like glyph-to-script-map, or by auto-hinting any glyph from that face. In particular, if you have already created an FT_Face structure but not loaded any glyph (using the auto-hinter), a change of the fallback script will affect this face.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    default-script

    -
    + +
    + + +
    +

    default-script

    +

    Experimental only

    If Freetype gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make the HarfBuzz library access OpenType features for getting better glyph coverages, this property sets the (auto-fitter) script to be used for the default (OpenType) script data of a font's GSUB table. Features for the default script are intended for all scripts not explicitly handled in GSUB; an example is a ‘dlig’ feature, containing the combination of the characters ‘T’, ‘E’, and ‘L’ to form a ‘TEL’ ligature.

    By default, this is FT_AUTOHINTER_SCRIPT_LATIN. Using the ‘default-script’ property, this default value can be changed.

    @@ -275,20 +313,17 @@ Defined in FT_AUTOHINTER_H (ftautoh.h). FT_Property_Set( library, "autofitter", "default-script", &default_script ); -

    -
    note
    + +

    note

    This property can be used with FT_Property_Get also.

    It's important to use the right timing for changing this value: The creation of the glyph-to-script map that eventually uses the default script value gets triggered either by setting or reading a face-specific property like glyph-to-script-map, or by auto-hinting any glyph from that face. In particular, if you have already created an FT_Face structure but not loaded any glyph (using the auto-hinter), a change of the default script will affect this face.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    increase-x-height

    -
    + +
    + + +
    +

    increase-x-height

    +

    For ppem values in the range 6 <= ppem <= ‘increase-x-height’, round up the font's x height much more often than normally. If the value is set to 0, which is the default, this feature is switched off. Use this property to improve the legibility of small font sizes if necessary.

       FT_Library               library;
    @@ -306,40 +341,30 @@ Defined in FT_AUTOHINTER_H (ftautoh.h).
       FT_Property_Set( library, "autofitter",
                                 "increase-x-height", &prop );
     
    -

    -
    note
    + +

    note

    This property can be used with FT_Property_Get also.

    Set this value right after calling FT_Set_Char_Size, but before loading any glyph (using the auto-hinter).

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Prop_IncreaseXHeight

    -
    -Defined in FT_AUTOHINTER_H (ftautoh.h). -

    -
    -
    -   typedef struct  FT_Prop_IncreaseXHeight_
    -   {
    -     FT_Face  face;
    -     FT_UInt  limit;
    -
    -   } FT_Prop_IncreaseXHeight;
    -
    -

    -
    + +
    + + +
    +

    FT_Prop_IncreaseXHeight

    +

    Defined in FT_AUTOHINTER_H (ftautoh.h).

    +
    +  typedef struct  FT_Prop_IncreaseXHeight_
    +  {
    +    FT_Face  face;
    +    FT_UInt  limit;
    +
    +  } FT_Prop_IncreaseXHeight;
    +
    +

    The data exchange structure for the increase-x-height property.

    -

    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-base_interface.html b/freetype/docs/reference/ft2-base_interface.html index 229254510..4547b6f1c 100644 --- a/freetype/docs/reference/ft2-base_interface.html +++ b/freetype/docs/reference/ft2-base_interface.html @@ -3,323 +3,378 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Base Interface -

    +

    Base Interface

    Synopsis

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FT_LibraryFT_IS_TRICKYFT_Load_Glyph
    FT_FaceFT_HAS_COLORFT_Load_Char
    FT_SizeFT_STYLE_FLAG_XXXFT_LOAD_XXX
    FT_GlyphSlotFT_Size_InternalFT_LOAD_TARGET_XXX
    FT_CharMapFT_Size_MetricsFT_LOAD_TARGET_MODE
    FT_EncodingFT_SizeRecFT_Set_Transform
    FT_Glyph_MetricsFT_SubGlyphFT_Render_Mode
    FT_Bitmap_SizeFT_Slot_Internalft_render_mode_xxx
    FT_ModuleFT_GlyphSlotRecFT_Render_Glyph
    FT_DriverFT_Init_FreeTypeFT_Kerning_Mode
    FT_RendererFT_Done_FreeTypeft_kerning_default
    FT_ENC_TAGFT_OPEN_XXXft_kerning_unfitted
    ft_encoding_xxxFT_Parameterft_kerning_unscaled
    FT_CharMapRecFT_Open_ArgsFT_Get_Kerning
    FT_Face_InternalFT_New_FaceFT_Get_Track_Kerning
    FT_FaceRecFT_New_Memory_FaceFT_Get_Glyph_Name
    FT_FACE_FLAG_XXXFT_Open_FaceFT_Get_Postscript_Name
    FT_HAS_HORIZONTALFT_Attach_FileFT_Select_Charmap
    FT_HAS_VERTICALFT_Attach_StreamFT_Set_Charmap
    FT_HAS_KERNINGFT_Reference_FaceFT_Get_Charmap_Index
    FT_IS_SCALABLEFT_Done_FaceFT_Get_Char_Index
    FT_IS_SFNTFT_Select_SizeFT_Get_First_Char
    FT_IS_FIXED_WIDTHFT_Size_Request_TypeFT_Get_Next_Char
    FT_HAS_FIXED_SIZESFT_Size_RequestRecFT_Get_Name_Index
    FT_HAS_FAST_GLYPHSFT_Size_RequestFT_SUBGLYPH_FLAG_XXX
    FT_HAS_GLYPH_NAMESFT_Request_SizeFT_Get_SubGlyph_Info
    FT_HAS_MULTIPLE_MASTERSFT_Set_Char_SizeFT_FSTYPE_XXX
    FT_IS_CID_KEYEDFT_Set_Pixel_SizesFT_Get_FSType_Flags


    - -
    -

    This section describes the public high-level API of FreeType 2.

    -

    -
    -

    FT_Library

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    FT_LibraryFT_Glyph_MetricsFT_LOAD_COLOR
    FT_FaceFT_SubGlyph 
    FT_Size FT_LOAD_VERTICAL_LAYOUT
    FT_GlyphSlotFT_Bitmap_SizeFT_LOAD_IGNORE_TRANSFORM
    FT_CharMap FT_LOAD_FORCE_AUTOHINT
    FT_EncodingFT_Init_FreeTypeFT_LOAD_NO_RECURSE
    FT_ENC_TAGFT_Done_FreeTypeFT_LOAD_PEDANTIC
       
    FT_FaceRecFT_New_FaceFT_LOAD_TARGET_NORMAL
     FT_Done_FaceFT_LOAD_TARGET_LIGHT
    FT_FACE_FLAG_SCALABLEFT_Reference_FaceFT_LOAD_TARGET_MONO
    FT_FACE_FLAG_FIXED_SIZESFT_New_Memory_FaceFT_LOAD_TARGET_LCD
    FT_FACE_FLAG_FIXED_WIDTHFT_Open_FaceFT_LOAD_TARGET_LCD_V
    FT_FACE_FLAG_HORIZONTALFT_Open_Args 
    FT_FACE_FLAG_VERTICALFT_ParameterFT_LOAD_TARGET_MODE
    FT_FACE_FLAG_COLORFT_Attach_File 
    FT_FACE_FLAG_SFNTFT_Attach_StreamFT_Render_Glyph
    FT_FACE_FLAG_CID_KEYED FT_Render_Mode
    FT_FACE_FLAG_TRICKYFT_Set_Char_SizeFT_Get_Kerning
    FT_FACE_FLAG_KERNINGFT_Set_Pixel_SizesFT_Kerning_Mode
    FT_FACE_FLAG_MULTIPLE_MASTERSFT_Request_SizeFT_Get_Track_Kerning
    FT_FACE_FLAG_GLYPH_NAMESFT_Select_SizeFT_Get_Glyph_Name
    FT_FACE_FLAG_EXTERNAL_STREAMFT_Size_Request_TypeFT_Get_Postscript_Name
    FT_FACE_FLAG_HINTERFT_Size_RequestRec 
    FT_FACE_FLAG_TRICKYFT_Size_RequestFT_CharMapRec
     FT_Set_TransformFT_Select_Charmap
    FT_HAS_HORIZONTALFT_Load_GlyphFT_Set_Charmap
    FT_HAS_VERTICALFT_Get_Char_IndexFT_Get_Charmap_Index
    FT_HAS_KERNINGFT_Get_First_Char 
    FT_HAS_FIXED_SIZESFT_Get_Next_CharFT_Get_FSType_Flags
    FT_HAS_GLYPH_NAMESFT_Get_Name_IndexFT_Get_SubGlyph_Info
    FT_HAS_MULTIPLE_MASTERSFT_Load_Char 
    FT_HAS_COLOR FT_Face_Internal
     FT_OPEN_MEMORYFT_Size_Internal
    FT_IS_SFNTFT_OPEN_STREAMFT_Slot_Internal
    FT_IS_SCALABLEFT_OPEN_PATHNAME 
    FT_IS_FIXED_WIDTHFT_OPEN_DRIVERFT_FACE_FLAG_XXX
    FT_IS_CID_KEYEDFT_OPEN_PARAMSFT_STYLE_FLAG_XXX
    FT_IS_TRICKY FT_OPEN_XXX
     FT_LOAD_DEFAULTFT_LOAD_XXX
    FT_STYLE_FLAG_BOLDFT_LOAD_RENDERFT_LOAD_TARGET_XXX
    FT_STYLE_FLAG_ITALICFT_LOAD_MONOCHROMEFT_SUBGLYPH_FLAG_XXX
     FT_LOAD_LINEAR_DESIGNFT_FSTYPE_XXX
    FT_SizeRecFT_LOAD_NO_SCALE 
    FT_Size_MetricsFT_LOAD_NO_HINTINGFT_HAS_FAST_GLYPHS
     FT_LOAD_NO_BITMAP
    FT_GlyphSlotRecFT_LOAD_NO_AUTOHINT
    + + +

    This section describes the most important public high-level API functions of FreeType 2.

    + +
    +

    FT_Library

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef struct FT_LibraryRec_  *FT_Library;
    +
    -

    -

    A handle to a FreeType library instance. Each ‘library’ is completely independent from the others; it is the ‘root’ of a set of objects like fonts, faces, sizes, etc.

    It also embeds a memory manager (see FT_Memory), as well as a scan-line converter object (see FT_Raster).

    In multi-threaded applications, make sure that the same FT_Library object or any of its children doesn't get accessed in parallel.

    -

    -
    note
    + +

    note

    Library objects are normally created by FT_Init_FreeType, and destroyed with FT_Done_FreeType. If you need reference-counting (cf. FT_Reference_Library), use FT_New_Library and FT_Done_Library.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Face

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Face

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef struct FT_FaceRec_*  FT_Face;
    +
    -

    -

    A handle to a given typographic face object. A face object models a given typeface, in a given style.

    -

    -
    note
    + +

    note

    Each face object also owns a single FT_GlyphSlot object, as well as one or more FT_Size objects.

    Use FT_New_Face or FT_Open_Face to create a new face object from a given filepathname or a custom input stream.

    Use FT_Done_Face to destroy it (along with its slot and sizes).

    -
    -
    also
    + +

    also

    See FT_FaceRec for the publicly accessible fields of a given face object.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Size

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Size

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef struct FT_SizeRec_*  FT_Size;
    +
    -

    -

    A handle to an object used to model a face scaled to a given character size.

    -

    -
    note
    + +

    note

    Each FT_Face has an active FT_Size object that is used by functions like FT_Load_Glyph to determine the scaling transformation that in turn is used to load and hint glyphs and metrics.

    You can use FT_Set_Char_Size, FT_Set_Pixel_Sizes, FT_Request_Size or even FT_Select_Size to change the content (i.e., the scaling values) of the active FT_Size.

    You can use FT_New_Size to create additional size objects for a given FT_Face, but they won't be used by other functions until you activate it through FT_Activate_Size. Only one size can be activated at any given time per face.

    -
    -
    also
    + +

    also

    See FT_SizeRec for the publicly accessible fields of a given size object.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_GlyphSlot

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_GlyphSlot

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef struct FT_GlyphSlotRec_*  FT_GlyphSlot;
    +
    -

    -

    A handle to a given ‘glyph slot’. A slot is a container where it is possible to load any of the glyphs contained in its parent face.

    In other words, each time you call FT_Load_Glyph or FT_Load_Char, the slot's content is erased by the new glyph data, i.e., the glyph's metrics, its image (bitmap or outline), and other control information.

    -

    -
    also
    + +

    also

    See FT_GlyphSlotRec for the publicly accessible glyph fields.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_CharMap

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_CharMap

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef struct FT_CharMapRec_*  FT_CharMap;
    +
    -

    -

    A handle to a given character map. A charmap is used to translate character codes in a given encoding into glyph indexes for its parent's face. Some font formats may provide several charmaps per font.

    Each face object owns zero or more charmaps, but only one of them can be ‘active’ and used by FT_Get_Char_Index or FT_Load_Char.

    The list of available charmaps in a face is available through the ‘face->num_charmaps’ and ‘face->charmaps’ fields of FT_FaceRec.

    The currently active charmap is available as ‘face->charmap’. You should call FT_Set_Charmap to change it.

    -

    -
    note
    + +

    note

    When a new face is created (either through FT_New_Face or FT_Open_Face), the library looks for a Unicode charmap within the list and automatically activates it.

    -
    -
    also
    + +

    also

    See FT_CharMapRec for the publicly accessible fields of a given character map.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Encoding

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Encoding

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef enum  FT_Encoding_
       {
    -    FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
    +    FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
     
    -    FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
    -    FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),
    +    FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
    +    FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),
     
    -    FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),
    -    FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),
    -    FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),
    -    FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
    -    FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),
    +    FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),
    +    FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),
    +    FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),
    +    FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),
    +    FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),
     
         /* for backwards compatibility */
    -    FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,
    -    FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,
    -    FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,
    -    FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
    -    FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,
    +    FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,
    +    FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,
    +    FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,
    +    FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,
    +    FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,
     
    -    FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
    -    FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E' ),
    -    FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C' ),
    -    FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1,  'l', 'a', 't', '1' ),
    +    FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
    +    FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E' ),
    +    FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C' ),
    +    FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1,  'l', 'a', 't', '1' ),
     
    -    FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
    +    FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
     
    -    FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
    +    FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
     
       } FT_Encoding;
     
    -

    -
    + + /* these constants are deprecated; use the corresponding `FT_Encoding' */ + /* values instead */ +#define ft_encoding_none FT_ENCODING_NONE +#define ft_encoding_unicode FT_ENCODING_UNICODE +#define ft_encoding_symbol FT_ENCODING_MS_SYMBOL +#define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1 +#define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2 +#define ft_encoding_sjis FT_ENCODING_SJIS +#define ft_encoding_gb2312 FT_ENCODING_GB2312 +#define ft_encoding_big5 FT_ENCODING_BIG5 +#define ft_encoding_wansung FT_ENCODING_WANSUNG +#define ft_encoding_johab FT_ENCODING_JOHAB + +#define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD +#define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT +#define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM +#define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN + +

    An enumeration used to specify character sets supported by charmaps. Used in the FT_Select_Charmap API function.

    -

    -
    note
    + +

    note

    Despite the name, this enumeration lists specific character repertories (i.e., charsets), and not text encoding methods (e.g., UTF-8, UTF-16, etc.).

    Other encodings might be defined in the future.

    -
    -
    values
    -

    - -
    FT_ENCODING_NONE + +

    values

    + + - - - - - - - - - - - - - - - - - - - - - - - -
    FT_ENCODING_NONE

    The encoding value 0 is reserved.

    FT_ENCODING_UNICODE +
    FT_ENCODING_UNICODE

    Corresponds to the Unicode character set. This value covers all versions of the Unicode repertoire, including ASCII and Latin-1. Most fonts include a Unicode charmap, but not all of them.

    For example, if you want to access Unicode value U+1F028 (and the font contains it), use value 0x1F028 as the input value for FT_Get_Char_Index.

    FT_ENCODING_MS_SYMBOL +
    FT_ENCODING_MS_SYMBOL

    Corresponds to the Microsoft Symbol encoding, used to encode mathematical symbols in the 32..255 character code range. For more information, see ‘http://www.kostis.net/charsets/symbol.htm’.

    FT_ENCODING_SJIS +
    FT_ENCODING_SJIS

    Corresponds to Japanese SJIS encoding. More info at at ‘http://en.wikipedia.org/wiki/Shift_JIS’. See note on multi-byte encodings below.

    FT_ENCODING_GB2312 +
    FT_ENCODING_GB2312

    Corresponds to an encoding system for Simplified Chinese as used used in mainland China.

    FT_ENCODING_BIG5 +
    FT_ENCODING_BIG5

    Corresponds to an encoding system for Traditional Chinese as used in Taiwan and Hong Kong.

    FT_ENCODING_WANSUNG +
    FT_ENCODING_WANSUNG

    Corresponds to the Korean encoding system known as Wansung. For more information see ‘http://msdn.microsoft.com/en-US/goglobal/cc305154’.

    FT_ENCODING_JOHAB +
    FT_ENCODING_JOHAB

    The Korean standard character set (KS C 5601-1992), which corresponds to MS Windows code page 1361. This character set includes all possible Hangeul character combinations.

    FT_ENCODING_ADOBE_LATIN_1
    +
    FT_ENCODING_ADOBE_LATIN_1

    Corresponds to a Latin-1 encoding as defined in a Type 1 PostScript font. It is limited to 256 character codes.

    FT_ENCODING_ADOBE_STANDARD
    +
    FT_ENCODING_ADOBE_STANDARD

    Corresponds to the Adobe Standard encoding, as found in Type 1, CFF, and OpenType/CFF fonts. It is limited to 256 character codes.

    FT_ENCODING_ADOBE_EXPERT
    +
    FT_ENCODING_ADOBE_EXPERT

    Corresponds to the Adobe Expert encoding, as found in Type 1, CFF, and OpenType/CFF fonts. It is limited to 256 character codes.

    FT_ENCODING_ADOBE_CUSTOM
    +
    FT_ENCODING_ADOBE_CUSTOM

    Corresponds to a custom encoding, as found in Type 1, CFF, and OpenType/CFF fonts. It is limited to 256 character codes.

    FT_ENCODING_APPLE_ROMAN
    +
    FT_ENCODING_APPLE_ROMAN

    Corresponds to the 8-bit Apple roman encoding. Many TrueType and OpenType fonts contain a charmap for this encoding, since older versions of Mac OS are able to use it.

    FT_ENCODING_OLD_LATIN_2
    +
    FT_ENCODING_OLD_LATIN_2

    This value is deprecated and was never used nor reported by FreeType. Don't use or test for it.

    FT_ENCODING_MS_SJIS +
    FT_ENCODING_MS_SJIS

    Same as FT_ENCODING_SJIS. Deprecated.

    FT_ENCODING_MS_GB2312 +
    FT_ENCODING_MS_GB2312

    Same as FT_ENCODING_GB2312. Deprecated.

    FT_ENCODING_MS_BIG5 +
    FT_ENCODING_MS_BIG5

    Same as FT_ENCODING_BIG5. Deprecated.

    FT_ENCODING_MS_WANSUNG +
    FT_ENCODING_MS_WANSUNG

    Same as FT_ENCODING_WANSUNG. Deprecated.

    FT_ENCODING_MS_JOHAB +
    FT_ENCODING_MS_JOHAB

    Same as FT_ENCODING_JOHAB. Deprecated.

    -
    -
    note
    + +

    note

    By default, FreeType automatically synthesizes a Unicode charmap for PostScript fonts, using their glyph names dictionaries. However, it also reports the encodings defined explicitly in the font file, for the cases when they are needed, with the Adobe values as well.

    FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap is neither Unicode nor ISO-8859-1 (otherwise it is set to FT_ENCODING_UNICODE). Use FT_Get_BDF_Charset_ID to find out which encoding is really present. If, for example, the ‘cs_registry’ field is ‘KOI8’ and the ‘cs_encoding’ field is ‘R’, the font is encoded in KOI8-R.

    FT_ENCODING_NONE is always set (with a single exception) by the winfonts driver. Use FT_Get_WinFNT_Header and examine the ‘charset’ field of the FT_WinFNT_HeaderRec structure to find out which encoding is really present. For example, FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for Russian).

    @@ -327,195 +382,14 @@ Defined in FT_FREETYPE_H (freetype.h).

    If ‘platform_id’ is TT_PLATFORM_MACINTOSH, use the function FT_Get_CMap_Language_ID to query the Mac language ID that may be needed to be able to distinguish Apple encoding variants. See

    http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt

    to get an idea how to do that. Basically, if the language ID is 0, don't use it, otherwise subtract 1 from the language ID. Then examine ‘encoding_id’. If, for example, ‘encoding_id’ is TT_MAC_ID_ROMAN and the language ID (minus 1) is ‘TT_MAC_LANGID_GREEK’, it is the Greek encoding, not Roman. TT_MAC_ID_ARABIC with ‘TT_MAC_LANGID_FARSI’ means the Farsi variant the Arabic encoding.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Glyph_Metrics

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -  typedef struct  FT_Glyph_Metrics_
    -  {
    -    FT_Pos  width;
    -    FT_Pos  height;
    -
    -    FT_Pos  horiBearingX;
    -    FT_Pos  horiBearingY;
    -    FT_Pos  horiAdvance;
    -
    -    FT_Pos  vertBearingX;
    -    FT_Pos  vertBearingY;
    -    FT_Pos  vertAdvance;
    -
    -  } FT_Glyph_Metrics;
    -
    -

    -
    -

    A structure used to model the metrics of a single glyph. The values are expressed in 26.6 fractional pixel format; if the flag FT_LOAD_NO_SCALE has been used while loading the glyph, values are expressed in font units instead.

    -

    -
    fields
    -

    - - - - - - - - - -
    width -

    The glyph's width.

    -
    height -

    The glyph's height.

    -
    horiBearingX -

    Left side bearing for horizontal layout.

    -
    horiBearingY -

    Top side bearing for horizontal layout.

    -
    horiAdvance -

    Advance width for horizontal layout.

    -
    vertBearingX -

    Left side bearing for vertical layout.

    -
    vertBearingY -

    Top side bearing for vertical layout. Larger positive values mean further below the vertical glyph origin.

    -
    vertAdvance -

    Advance height for vertical layout. Positive values mean the glyph has a positive advance downward.

    -
    -
    -
    note
    -

    If not disabled with FT_LOAD_NO_HINTING, the values represent dimensions of the hinted glyph (in case hinting is applicable).

    -

    Stroking a glyph with an outside border does not increase ‘horiAdvance’ or ‘vertAdvance’; you have to manually adjust these values to account for the added width and height.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Bitmap_Size

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -  typedef struct  FT_Bitmap_Size_
    -  {
    -    FT_Short  height;
    -    FT_Short  width;
     
    -    FT_Pos    size;
    -
    -    FT_Pos    x_ppem;
    -    FT_Pos    y_ppem;
    -
    -  } FT_Bitmap_Size;
    -
    -

    -
    -

    This structure models the metrics of a bitmap strike (i.e., a set of glyphs for a given point size and resolution) in a bitmap font. It is used for the ‘available_sizes’ field of FT_Face.

    -

    -
    fields
    -

    - - - - - - -
    height -

    The vertical distance, in pixels, between two consecutive baselines. It is always positive.

    -
    width -

    The average width, in pixels, of all glyphs in the strike.

    -
    size -

    The nominal size of the strike in 26.6 fractional points. This field is not very useful.

    -
    x_ppem -

    The horizontal ppem (nominal width) in 26.6 fractional pixels.

    -
    y_ppem -

    The vertical ppem (nominal height) in 26.6 fractional pixels.

    -
    -
    -
    note
    -

    Windows FNT: The nominal size given in a FNT font is not reliable. Thus when the driver finds it incorrect, it sets ‘size’ to some calculated values and sets ‘x_ppem’ and ‘y_ppem’ to the pixel width and height given in the font, respectively.

    -

    TrueType embedded bitmaps: ‘size’, ‘width’, and ‘height’ values are not contained in the bitmap strike itself. They are computed from the global font parameters.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Module

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -  typedef struct FT_ModuleRec_*  FT_Module;
    -
    -

    -
    -

    A handle to a given FreeType module object. Each module can be a font driver, a renderer, or anything else that provides services to the formers.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Driver

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -  typedef struct FT_DriverRec_*  FT_Driver;
    -
    -

    -
    -

    A handle to a given FreeType font driver object. Each font driver is a special module capable of creating faces from font files.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Renderer

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -  typedef struct FT_RendererRec_*  FT_Renderer;
    -
    -

    -
    -

    A handle to a given FreeType renderer. A renderer is a special module in charge of converting a glyph image to a bitmap, when necessary. Each renderer supports a given glyph image format, and one or more target surface depths.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_ENC_TAG

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +
    + +
    +

    FT_ENC_TAG

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
     #ifndef FT_ENC_TAG
     #define FT_ENC_TAG( value, a, b, c, d )         \
               value = ( ( (FT_UInt32)(a) << 24 ) |  \
    @@ -524,127 +398,24 @@ Defined in FT_FREETYPE_H (freetype.h).
                           (FT_UInt32)(d)         )
     
     #endif /* FT_ENC_TAG */
    +
    -

    -

    This macro converts four-letter tags into an unsigned long. It is used to define ‘encoding’ identifiers (see FT_Encoding).

    -

    -
    note
    + +

    note

    Since many 16-bit compilers don't like 32-bit enumerations, you should redefine this macro in case of problems to something like this:

       #define FT_ENC_TAG( value, a, b, c, d )  value                   
     

    to get a simple enumeration without assigning special numbers.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    ft_encoding_xxx

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define ft_encoding_none            FT_ENCODING_NONE
    -#define ft_encoding_unicode         FT_ENCODING_UNICODE
    -#define ft_encoding_symbol          FT_ENCODING_MS_SYMBOL
    -#define ft_encoding_latin_1         FT_ENCODING_ADOBE_LATIN_1
    -#define ft_encoding_latin_2         FT_ENCODING_OLD_LATIN_2
    -#define ft_encoding_sjis            FT_ENCODING_SJIS
    -#define ft_encoding_gb2312          FT_ENCODING_GB2312
    -#define ft_encoding_big5            FT_ENCODING_BIG5
    -#define ft_encoding_wansung         FT_ENCODING_WANSUNG
    -#define ft_encoding_johab           FT_ENCODING_JOHAB
    -
    -#define ft_encoding_adobe_standard  FT_ENCODING_ADOBE_STANDARD
    -#define ft_encoding_adobe_expert    FT_ENCODING_ADOBE_EXPERT
    -#define ft_encoding_adobe_custom    FT_ENCODING_ADOBE_CUSTOM
    -#define ft_encoding_apple_roman     FT_ENCODING_APPLE_ROMAN
    -
    -

    -
    -

    These constants are deprecated; use the corresponding FT_Encoding values instead.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_CharMapRec

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -  typedef struct  FT_CharMapRec_
    -  {
    -    FT_Face      face;
    -    FT_Encoding  encoding;
    -    FT_UShort    platform_id;
    -    FT_UShort    encoding_id;
    -
    -  } FT_CharMapRec;
    -
    -

    -
    -

    The base charmap structure.

    -

    -
    fields
    -

    - - - - - -
    face -

    A handle to the parent face object.

    -
    encoding -

    An FT_Encoding tag identifying the charmap. Use this with FT_Select_Charmap.

    -
    platform_id -

    An ID number describing the platform for the following encoding ID. This comes directly from the TrueType specification and should be emulated for other formats.

    -
    encoding_id -

    A platform specific encoding number. This also comes from the TrueType specification and should be emulated similarly.

    -
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Face_Internal

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -  typedef struct FT_Face_InternalRec_*  FT_Face_Internal;
     
    -

    -
    -

    An opaque handle to an ‘FT_Face_InternalRec’ structure, used to model private data of a given FT_Face object.

    -

    This structure might change between releases of FreeType 2 and is not generally available to client applications.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_FaceRec

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +
    + +
    +

    FT_FaceRec

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef struct  FT_FaceRec_
       {
         FT_Long           num_faces;
    @@ -688,7 +459,7 @@ Defined in FT_FREETYPE_H (freetype.h).
     
         /*@private begin */
     
    -    FT_Driver         driver;
    +    FT_Driver         driver;
         FT_Memory         memory;
         FT_Stream         stream;
     
    @@ -702,517 +473,292 @@ Defined in FT_FREETYPE_H (freetype.h).
         /*@private end */
     
       } FT_FaceRec;
    +
    -

    -

    FreeType root face class structure. A face object models a typeface in a font file.

    -

    -
    fields
    -

    - -
    num_faces + +

    fields

    + + - - - - - - - - - - - - - - - - - - - - - - -
    num_faces

    The number of faces in the font file. Some font formats can have multiple faces in a font file.

    face_index +
    face_index

    The index of the face in the font file. It is set to 0 if there is only one face in the font file.

    face_flags +
    face_flags

    A set of bit flags that give important information about the face; see FT_FACE_FLAG_XXX for the details.

    style_flags +
    style_flags

    A set of bit flags indicating the style of the face; see FT_STYLE_FLAG_XXX for the details.

    num_glyphs +
    num_glyphs

    The number of glyphs in the face. If the face is scalable and has sbits (see ‘num_fixed_sizes’), it is set to the number of outline glyphs.

    For CID-keyed fonts, this value gives the highest CID used in the font.

    family_name +
    family_name

    The face's family name. This is an ASCII string, usually in English, that describes the typeface's family (like ‘Times New Roman’, ‘Bodoni’, ‘Garamond’, etc). This is a least common denominator used to list fonts. Some formats (TrueType & OpenType) provide localized and Unicode versions of this string. Applications should use the format specific interface to access them. Can be NULL (e.g., in fonts embedded in a PDF file).

    style_name +
    style_name

    The face's style name. This is an ASCII string, usually in English, that describes the typeface's style (like ‘Italic’, ‘Bold’, ‘Condensed’, etc). Not all font formats provide a style name, so this field is optional, and can be set to NULL. As for ‘family_name’, some formats provide localized and Unicode versions of this string. Applications should use the format specific interface to access them.

    num_fixed_sizes +
    num_fixed_sizes

    The number of bitmap strikes in the face. Even if the face is scalable, there might still be bitmap strikes, which are called ‘sbits’ in that case.

    available_sizes +
    available_sizes

    An array of FT_Bitmap_Size for all bitmap strikes in the face. It is set to NULL if there is no bitmap strike.

    num_charmaps +
    num_charmaps

    The number of charmaps in the face.

    charmaps +
    charmaps

    An array of the charmaps of the face.

    generic +
    generic

    A field reserved for client uses. See the FT_Generic type description.

    bbox +
    bbox

    The font bounding box. Coordinates are expressed in font units (see ‘units_per_EM’). The box is large enough to contain any glyph from the font. Thus, ‘bbox.yMax’ can be seen as the ‘maximum ascender’, and ‘bbox.yMin’ as the ‘minimum descender’. Only relevant for scalable formats.

    Note that the bounding box might be off by (at least) one pixel for hinted fonts. See FT_Size_Metrics for further discussion.

    units_per_EM +
    units_per_EM

    The number of font units per EM square for this face. This is typically 2048 for TrueType fonts, and 1000 for Type 1 fonts. Only relevant for scalable formats.

    ascender +
    ascender

    The typographic ascender of the face, expressed in font units. For font formats not having this information, it is set to ‘bbox.yMax’. Only relevant for scalable formats.

    descender +
    descender

    The typographic descender of the face, expressed in font units. For font formats not having this information, it is set to ‘bbox.yMin’. Note that this field is usually negative. Only relevant for scalable formats.

    height +
    height

    This value is the vertical distance between two consecutive baselines, expressed in font units. It is always positive. Only relevant for scalable formats.

    If you want the global glyph height, use ‘ascender - descender’.

    max_advance_width +
    max_advance_width

    The maximum advance width, in font units, for all glyphs in this face. This can be used to make word wrapping computations faster. Only relevant for scalable formats.

    max_advance_height +
    max_advance_height

    The maximum advance height, in font units, for all glyphs in this face. This is only relevant for vertical layouts, and is set to ‘height’ for fonts that do not provide vertical metrics. Only relevant for scalable formats.

    underline_position +
    underline_position

    The position, in font units, of the underline line for this face. It is the center of the underlining stem. Only relevant for scalable formats.

    underline_thickness +
    underline_thickness

    The thickness, in font units, of the underline for this face. Only relevant for scalable formats.

    glyph +
    glyph

    The face's associated glyph slot(s).

    size +
    size

    The current active size for this face.

    charmap +
    charmap

    The current active charmap for this face.

    -
    -
    note
    + +

    note

    Fields may be changed after a call to FT_Attach_File or FT_Attach_Stream.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_FACE_FLAG_XXX

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )
    -#define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )
    -#define FT_FACE_FLAG_FIXED_WIDTH       ( 1L <<  2 )
    -#define FT_FACE_FLAG_SFNT              ( 1L <<  3 )
    -#define FT_FACE_FLAG_HORIZONTAL        ( 1L <<  4 )
    -#define FT_FACE_FLAG_VERTICAL          ( 1L <<  5 )
    -#define FT_FACE_FLAG_KERNING           ( 1L <<  6 )
    -#define FT_FACE_FLAG_FAST_GLYPHS       ( 1L <<  7 )
    -#define FT_FACE_FLAG_MULTIPLE_MASTERS  ( 1L <<  8 )
    -#define FT_FACE_FLAG_GLYPH_NAMES       ( 1L <<  9 )
    -#define FT_FACE_FLAG_EXTERNAL_STREAM   ( 1L << 10 )
    -#define FT_FACE_FLAG_HINTER            ( 1L << 11 )
    -#define FT_FACE_FLAG_CID_KEYED         ( 1L << 12 )
    -#define FT_FACE_FLAG_TRICKY            ( 1L << 13 )
    -#define FT_FACE_FLAG_COLOR             ( 1L << 14 )
    -
    -

    -
    -

    A list of bit flags used in the ‘face_flags’ field of the FT_FaceRec structure. They inform client applications of properties of the corresponding face.

    -

    -
    values
    -

    - - - - - - - - - - - - - - - - - - - - - - - -
    FT_FACE_FLAG_SCALABLE -

    Indicates that the face contains outline glyphs. This doesn't prevent bitmap strikes, i.e., a face can have both this and and FT_FACE_FLAG_FIXED_SIZES set.

    -
    FT_FACE_FLAG_FIXED_SIZES
    -

    Indicates that the face contains bitmap strikes. See also the ‘num_fixed_sizes’ and ‘available_sizes’ fields of FT_FaceRec.

    -
    FT_FACE_FLAG_FIXED_WIDTH
    -

    Indicates that the face contains fixed-width characters (like Courier, Lucido, MonoType, etc.).

    -
    FT_FACE_FLAG_SFNT -

    Indicates that the face uses the ‘sfnt’ storage scheme. For now, this means TrueType and OpenType.

    -
    FT_FACE_FLAG_HORIZONTAL
    -

    Indicates that the face contains horizontal glyph metrics. This should be set for all common formats.

    -
    FT_FACE_FLAG_VERTICAL -

    Indicates that the face contains vertical glyph metrics. This is only available in some formats, not all of them.

    -
    FT_FACE_FLAG_KERNING -

    Indicates that the face contains kerning information. If set, the kerning distance can be retrieved through the function FT_Get_Kerning. Otherwise the function always return the vector (0,0). Note that FreeType doesn't handle kerning data from the ‘GPOS’ table (as present in some OpenType fonts).

    -
    FT_FACE_FLAG_FAST_GLYPHS
    -

    THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT.

    -
    FT_FACE_FLAG_MULTIPLE_MASTERS
    -

    Indicates that the font contains multiple masters and is capable of interpolating between them. See the multiple-masters specific API for details.

    -
    FT_FACE_FLAG_GLYPH_NAMES
    -

    Indicates that the font contains glyph names that can be retrieved through FT_Get_Glyph_Name. Note that some TrueType fonts contain broken glyph name tables. Use the function FT_Has_PS_Glyph_Names when needed.

    -
    FT_FACE_FLAG_EXTERNAL_STREAM
    -

    Used internally by FreeType to indicate that a face's stream was provided by the client application and should not be destroyed when FT_Done_Face is called. Don't read or test this flag.

    -
    FT_FACE_FLAG_HINTER -

    Set if the font driver has a hinting machine of its own. For example, with TrueType fonts, it makes sense to use data from the SFNT ‘gasp’ table only if the native TrueType hinting engine (with the bytecode interpreter) is available and active.

    -
    FT_FACE_FLAG_CID_KEYED -

    Set if the font is CID-keyed. In that case, the font is not accessed by glyph indices but by CID values. For subsetted CID-keyed fonts this has the consequence that not all index values are a valid argument to FT_Load_Glyph. Only the CID values for which corresponding glyphs in the subsetted font exist make FT_Load_Glyph return successfully; in all other cases you get an ‘FT_Err_Invalid_Argument’ error.

    -

    Note that CID-keyed fonts that are in an SFNT wrapper don't have this flag set since the glyphs are accessed in the normal way (using contiguous indices); the ‘CID-ness’ isn't visible to the application.

    -
    FT_FACE_FLAG_TRICKY -

    Set if the font is ‘tricky’, this is, it always needs the font format's native hinting engine to get a reasonable result. A typical example is the Chinese font ‘mingli.ttf’ that uses TrueType bytecode instructions to move and scale all of its subglyphs.

    -

    It is not possible to autohint such fonts using FT_LOAD_FORCE_AUTOHINT; it will also ignore FT_LOAD_NO_HINTING. You have to set both FT_LOAD_NO_HINTING and FT_LOAD_NO_AUTOHINT to really disable hinting; however, you probably never want this except for demonstration purposes.

    -

    Currently, there are about a dozen TrueType fonts in the list of tricky fonts; they are hard-coded in file ‘ttobjs.c’.

    -
    FT_FACE_FLAG_COLOR -

    Set if the font has color glyph tables. To access color glyphs use FT_LOAD_COLOR.

    -
    -
    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_HAS_HORIZONTAL

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +
    + +
    +

    FT_HAS_HORIZONTAL

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
     #define FT_HAS_HORIZONTAL( face ) \
    -          ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
    +          ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
    +
    -

    -

    A macro that returns true whenever a face object contains horizontal metrics (this is true for all font formats though).

    -

    -
    also
    + +

    also

    FT_HAS_VERTICAL can be used to check for vertical metrics.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_HAS_VERTICAL

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_HAS_VERTICAL

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
     #define FT_HAS_VERTICAL( face ) \
    -          ( face->face_flags & FT_FACE_FLAG_VERTICAL )
    +          ( face->face_flags & FT_FACE_FLAG_VERTICAL )
    +
    -

    -

    A macro that returns true whenever a face object contains real vertical metrics (and not only synthesized ones).

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_HAS_KERNING

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_HAS_KERNING

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
     #define FT_HAS_KERNING( face ) \
    -          ( face->face_flags & FT_FACE_FLAG_KERNING )
    +          ( face->face_flags & FT_FACE_FLAG_KERNING )
    +
    -

    -

    A macro that returns true whenever a face object contains kerning data that can be accessed with FT_Get_Kerning.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_IS_SCALABLE

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -#define FT_IS_SCALABLE( face ) \
    -          ( face->face_flags & FT_FACE_FLAG_SCALABLE )
    -
    -

    -
    -

    A macro that returns true whenever a face object contains a scalable font face (true for TrueType, Type 1, Type 42, CID, OpenType/CFF, and PFR font formats.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_IS_SFNT

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define FT_IS_SFNT( face ) \
    -          ( face->face_flags & FT_FACE_FLAG_SFNT )
    -
    -

    -
    -

    A macro that returns true whenever a face object contains a font whose format is based on the SFNT storage scheme. This usually means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded bitmap fonts.

    -

    If this macro is true, all functions defined in FT_SFNT_NAMES_H and FT_TRUETYPE_TABLES_H are available.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_IS_FIXED_WIDTH

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define FT_IS_FIXED_WIDTH( face ) \
    -          ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
    -
    -

    -
    -

    A macro that returns true whenever a face object contains a font face that contains fixed-width (or ‘monospace’, ‘fixed-pitch’, etc.) glyphs.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_HAS_FIXED_SIZES

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +
    + +
    +

    FT_HAS_FIXED_SIZES

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
     #define FT_HAS_FIXED_SIZES( face ) \
    -          ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
    +          ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
    +
    -

    -

    A macro that returns true whenever a face object contains some embedded bitmaps. See the ‘available_sizes’ field of the FT_FaceRec structure.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_HAS_FAST_GLYPHS

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define FT_HAS_FAST_GLYPHS( face )  0
     
    -

    -
    -

    Deprecated.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_HAS_GLYPH_NAMES

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +
    + +
    +

    FT_HAS_GLYPH_NAMES

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
     #define FT_HAS_GLYPH_NAMES( face ) \
    -          ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
    +          ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
    +
    -

    -

    A macro that returns true whenever a face object contains some glyph names that can be accessed through FT_Get_Glyph_Name.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_HAS_MULTIPLE_MASTERS

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_HAS_MULTIPLE_MASTERS

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
     #define FT_HAS_MULTIPLE_MASTERS( face ) \
    -          ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
    +          ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
    +
    -

    -

    A macro that returns true whenever a face object contains some multiple masters. The functions provided by FT_MULTIPLE_MASTERS_H are then available to choose the exact design you want.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_IS_CID_KEYED

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_HAS_COLOR

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +#define FT_HAS_COLOR( face ) \
    +          ( face->face_flags & FT_FACE_FLAG_COLOR )
    +
    + +

    A macro that returns true whenever a face object contains tables for color glyphs.

    + +
    +
    + +
    +

    FT_IS_SFNT

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +#define FT_IS_SFNT( face ) \
    +          ( face->face_flags & FT_FACE_FLAG_SFNT )
    +
    + +

    A macro that returns true whenever a face object contains a font whose format is based on the SFNT storage scheme. This usually means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded bitmap fonts.

    +

    If this macro is true, all functions defined in FT_SFNT_NAMES_H and FT_TRUETYPE_TABLES_H are available.

    + +
    +
    + +
    +

    FT_IS_SCALABLE

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +#define FT_IS_SCALABLE( face ) \
    +          ( face->face_flags & FT_FACE_FLAG_SCALABLE )
    +
    + +

    A macro that returns true whenever a face object contains a scalable font face (true for TrueType, Type 1, Type 42, CID, OpenType/CFF, and PFR font formats.

    + +
    +
    + +
    +

    FT_IS_FIXED_WIDTH

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +#define FT_IS_FIXED_WIDTH( face ) \
    +          ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
    +
    + +

    A macro that returns true whenever a face object contains a font face that contains fixed-width (or ‘monospace’, ‘fixed-pitch’, etc.) glyphs.

    + +
    +
    + +
    +

    FT_IS_CID_KEYED

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
     #define FT_IS_CID_KEYED( face ) \
    -          ( face->face_flags & FT_FACE_FLAG_CID_KEYED )
    +          ( face->face_flags & FT_FACE_FLAG_CID_KEYED )
    +
    -

    -

    A macro that returns true whenever a face object contains a CID-keyed font. See the discussion of FT_FACE_FLAG_CID_KEYED for more details.

    If this macro is true, all functions defined in FT_CID_H are available.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_IS_TRICKY

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_IS_TRICKY

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
     #define FT_IS_TRICKY( face ) \
    -          ( face->face_flags & FT_FACE_FLAG_TRICKY )
    +          ( face->face_flags & FT_FACE_FLAG_TRICKY )
    +
    -

    -

    A macro that returns true whenever a face represents a ‘tricky’ font. See the discussion of FT_FACE_FLAG_TRICKY for more details.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_HAS_COLOR

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -#define FT_HAS_COLOR( face ) \
    -          ( face->face_flags & FT_FACE_FLAG_COLOR )
    +
    + -

    -
    -

    A macro that returns true whenever a face object contains tables for color glyphs.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_STYLE_FLAG_XXX

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define FT_STYLE_FLAG_ITALIC  ( 1 << 0 )
    -#define FT_STYLE_FLAG_BOLD    ( 1 << 1 )
    -
    -

    -
    -

    A list of bit-flags used to indicate the style of a given face. These are used in the ‘style_flags’ field of FT_FaceRec.

    -

    -
    values
    -

    - -
    FT_STYLE_FLAG_ITALIC -

    Indicates that a given face style is italic or oblique.

    +
    +

    FT_SizeRec

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  typedef struct  FT_SizeRec_
    +  {
    +    FT_Face           face;      /* parent face object              */
    +    FT_Generic        generic;   /* generic pointer for client uses */
    +    FT_Size_Metrics   metrics;   /* size metrics                    */
    +    FT_Size_Internal  internal;
    +
    +  } FT_SizeRec;
    +
    + +

    FreeType root size class structure. A size object models a face object at a given size.

    + +

    fields

    + + - +
    face +

    Handle to the parent face object.

    FT_STYLE_FLAG_BOLD -

    Indicates that a given face is bold.

    +
    generic +

    A typeless pointer, unused by the FreeType library or any of its drivers. It can be used by client applications to link their own data to each size object.

    +
    metrics +

    Metrics for this size object. This field is read-only.

    -
    -
    note
    -

    The style information as provided by FreeType is very basic. More details are beyond the scope and should be done on a higher level (for example, by analyzing various fields of the ‘OS/2’ table in SFNT based fonts).

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Size_Internal

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -  typedef struct FT_Size_InternalRec_*  FT_Size_Internal;
     
    -

    -
    -

    An opaque handle to an ‘FT_Size_InternalRec’ structure, used to model private data of a given FT_Size object.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Size_Metrics

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +
    + +
    +

    FT_Size_Metrics

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef struct  FT_Size_Metrics_
       {
         FT_UShort  x_ppem;      /* horizontal pixels per EM               */
    @@ -1227,141 +773,51 @@ Defined in FT_FREETYPE_H (freetype.h).
         FT_Pos     max_advance; /* max horizontal advance, in 26.6 pixels */
     
       } FT_Size_Metrics;
    +
    -

    -

    The size metrics structure gives the metrics of a size object.

    -

    -
    fields
    -

    - -
    x_ppem + +

    fields

    + + - - - - - - -
    x_ppem

    The width of the scaled EM square in pixels, hence the term ‘ppem’ (pixels per EM). It is also referred to as ‘nominal width’.

    y_ppem +
    y_ppem

    The height of the scaled EM square in pixels, hence the term ‘ppem’ (pixels per EM). It is also referred to as ‘nominal height’.

    x_scale +
    x_scale

    A 16.16 fractional scaling value used to convert horizontal metrics from font units to 26.6 fractional pixels. Only relevant for scalable font formats.

    y_scale +
    y_scale

    A 16.16 fractional scaling value used to convert vertical metrics from font units to 26.6 fractional pixels. Only relevant for scalable font formats.

    ascender +
    ascender

    The ascender in 26.6 fractional pixels. See FT_FaceRec for the details.

    descender +
    descender

    The descender in 26.6 fractional pixels. See FT_FaceRec for the details.

    height +
    height

    The height in 26.6 fractional pixels. See FT_FaceRec for the details.

    max_advance +
    max_advance

    The maximum advance width in 26.6 fractional pixels. See FT_FaceRec for the details.

    -
    -
    note
    + +

    note

    The scaling values, if relevant, are determined first during a size changing operation. The remaining fields are then set by the driver. For scalable formats, they are usually set to scaled values of the corresponding fields in FT_FaceRec.

    Note that due to glyph hinting, these values might not be exact for certain fonts. Thus they must be treated as unreliable with an error margin of at least one pixel!

    Indeed, the only way to get the exact metrics is to render all glyphs. As this would be a definite performance hit, it is up to client applications to perform such computations.

    The FT_Size_Metrics structure is valid for bitmap fonts also.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_SizeRec

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -  typedef struct  FT_SizeRec_
    -  {
    -    FT_Face           face;      /* parent face object              */
    -    FT_Generic        generic;   /* generic pointer for client uses */
    -    FT_Size_Metrics   metrics;   /* size metrics                    */
    -    FT_Size_Internal  internal;
    -
    -  } FT_SizeRec;
    -
    -

    -
    -

    FreeType root size class structure. A size object models a face object at a given size.

    -

    -
    fields
    -

    - - - - -
    face -

    Handle to the parent face object.

    -
    generic -

    A typeless pointer, unused by the FreeType library or any of its drivers. It can be used by client applications to link their own data to each size object.

    -
    metrics -

    Metrics for this size object. This field is read-only.

    -
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_SubGlyph

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -  typedef struct FT_SubGlyphRec_*  FT_SubGlyph;
    -
    -

    -
    -

    The subglyph structure is an internal object used to describe subglyphs (for example, in the case of composites).

    -

    -
    note
    -

    The subglyph implementation is not part of the high-level API, hence the forward structure declaration.

    -

    You can however retrieve subglyph information with FT_Get_SubGlyph_Info.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Slot_Internal

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -  typedef struct FT_Slot_InternalRec_*  FT_Slot_Internal;
    -
    -

    -
    -

    An opaque handle to an ‘FT_Slot_InternalRec’ structure, used to model private data of a given FT_GlyphSlot object.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_GlyphSlotRec

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +
    + +
    +

    FT_GlyphSlotRec

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef struct  FT_GlyphSlotRec_
       {
         FT_Library        library;
    @@ -1397,84 +853,82 @@ Defined in FT_FREETYPE_H (freetype.h).
         FT_Slot_Internal  internal;
     
       } FT_GlyphSlotRec;
    +
    -

    -

    FreeType root glyph slot class structure. A glyph slot is a container where individual glyphs can be loaded, be they in outline or bitmap format.

    -

    -
    fields
    -

    - -
    library + +

    fields

    + + - - - - - - - - - - - - - - - - - - -
    library

    A handle to the FreeType library instance this slot belongs to.

    face +
    face

    A handle to the parent face object.

    next +
    next

    In some cases (like some font tools), several glyph slots per face object can be a good thing. As this is rare, the glyph slots are listed through a direct, single-linked list using its ‘next’ field.

    generic +
    generic

    A typeless pointer unused by the FreeType library or any of its drivers. It can be used by client applications to link their own data to each glyph slot object.

    metrics +
    metrics

    The metrics of the last loaded glyph in the slot. The returned values depend on the last load flags (see the FT_Load_Glyph API function) and can be expressed either in 26.6 fractional pixels or font units.

    Note that even when the glyph image is transformed, the metrics are not.

    linearHoriAdvance +
    linearHoriAdvance

    The advance width of the unhinted glyph. Its value is expressed in 16.16 fractional pixels, unless FT_LOAD_LINEAR_DESIGN is set when loading the glyph. This field can be important to perform correct WYSIWYG layout. Only relevant for outline glyphs.

    linearVertAdvance +
    linearVertAdvance

    The advance height of the unhinted glyph. Its value is expressed in 16.16 fractional pixels, unless FT_LOAD_LINEAR_DESIGN is set when loading the glyph. This field can be important to perform correct WYSIWYG layout. Only relevant for outline glyphs.

    advance +
    advance

    This shorthand is, depending on FT_LOAD_IGNORE_TRANSFORM, the transformed (hinted) advance width for the glyph, in 26.6 fractional pixel format. As specified with FT_LOAD_VERTICAL_LAYOUT, it uses either the ‘horiAdvance’ or the ‘vertAdvance’ value of ‘metrics’ field.

    format +
    format

    This field indicates the format of the image contained in the glyph slot. Typically FT_GLYPH_FORMAT_BITMAP, FT_GLYPH_FORMAT_OUTLINE, or FT_GLYPH_FORMAT_COMPOSITE, but others are possible.

    bitmap +
    bitmap

    This field is used as a bitmap descriptor when the slot format is FT_GLYPH_FORMAT_BITMAP. Note that the address and content of the bitmap buffer can change between calls of FT_Load_Glyph and a few other functions.

    bitmap_left -

    This is the bitmap's left bearing expressed in integer pixels. Of course, this is only valid if the format is FT_GLYPH_FORMAT_BITMAP.

    +
    bitmap_left +

    The bitmap's left bearing expressed in integer pixels. Only valid if the format is FT_GLYPH_FORMAT_BITMAP, this is, if the glyph slot contains a bitmap.

    bitmap_top -

    This is the bitmap's top bearing expressed in integer pixels. Remember that this is the distance from the baseline to the top-most glyph scanline, upwards y coordinates being positive.

    +
    bitmap_top +

    The bitmap's top bearing expressed in integer pixels. Remember that this is the distance from the baseline to the top-most glyph scanline, upwards y coordinates being positive.

    outline +
    outline

    The outline descriptor for the current glyph image if its format is FT_GLYPH_FORMAT_OUTLINE. Once a glyph is loaded, ‘outline’ can be transformed, distorted, embolded, etc. However, it must not be freed.

    num_subglyphs -

    The number of subglyphs in a composite glyph. This field is only valid for the composite glyph format that should normally only be loaded with the FT_LOAD_NO_RECURSE flag. For now this is internal to FreeType.

    +
    num_subglyphs +

    The number of subglyphs in a composite glyph. This field is only valid for the composite glyph format that should normally only be loaded with the FT_LOAD_NO_RECURSE flag.

    subglyphs +
    subglyphs

    An array of subglyph descriptors for composite glyphs. There are ‘num_subglyphs’ elements in there. Currently internal to FreeType.

    control_data +
    control_data

    Certain font drivers can also return the control data for a given glyph image (e.g. TrueType bytecode, Type 1 charstrings, etc.). This field is a pointer to such data.

    control_len +
    control_len

    This is the length in bytes of the control data.

    other +
    other

    Really wicked formats can use this pointer to present their own glyph image to client applications. Note that the application needs to know about the image format.

    lsb_delta +
    lsb_delta

    The difference between hinted and unhinted left side bearing while autohinting is active. Zero otherwise.

    rsb_delta +
    rsb_delta

    The difference between hinted and unhinted right side bearing while autohinting is active. Zero otherwise.

    -
    -
    note
    + +

    note

    If FT_Load_Glyph is called with default flags (see FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in its native format (e.g., an outline glyph for TrueType and Type 1 formats).

    This image can later be converted into a bitmap by calling FT_Render_Glyph. This function finds the current renderer for the native image's format, then invokes it.

    The renderer is in charge of transforming the native image through the slot's face transformation fields, then converting it into a bitmap that is returned in ‘slot->bitmap’.

    Note that ‘slot->bitmap_left’ and ‘slot->bitmap_top’ are also used to specify the position of the bitmap relative to the current pen position (e.g., coordinates (0,0) on the baseline). Of course, ‘slot->format’ is also changed to FT_GLYPH_FORMAT_BITMAP.

    -
    -
    note
    + +

    note

    Here a small pseudo code fragment that shows how to use ‘lsb_delta’ and ‘rsb_delta’:

       FT_Pos  origin_x       = 0;                                      
    @@ -1499,687 +953,738 @@ Defined in FT_FREETYPE_H (freetype.h).
         origin_x += face->glyph->advance.x;                            
       endfor                                                           
     
    -
    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_Init_FreeType

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +
    + - FT_EXPORT( FT_Error ) - FT_Init_FreeType( FT_Library *alibrary ); +
    +

    FT_Glyph_Metrics

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  typedef struct  FT_Glyph_Metrics_
    +  {
    +    FT_Pos  width;
    +    FT_Pos  height;
     
    -

    -
    -

    Initialize a new FreeType library object. The set of modules that are registered by this function is determined at build time.

    -

    -
    output
    -

    - - -
    alibrary -

    A handle to a new library object.

    -
    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    In case you want to provide your own memory allocating routines, use FT_New_Library instead, followed by a call to FT_Add_Default_Modules (or a series of calls to FT_Add_Module).

    -

    For multi-threading applications each thread should have its own FT_Library object.

    -

    If you need reference-counting (cf. FT_Reference_Library), use FT_New_Library and FT_Done_Library.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Done_FreeType

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +    FT_Pos  horiBearingX;
    +    FT_Pos  horiBearingY;
    +    FT_Pos  horiAdvance;
     
    -  FT_EXPORT( FT_Error )
    -  FT_Done_FreeType( FT_Library  library );
    +    FT_Pos  vertBearingX;
    +    FT_Pos  vertBearingY;
    +    FT_Pos  vertAdvance;
     
    -

    -
    -

    Destroy a given FreeType library object and all of its children, including resources, drivers, faces, sizes, etc.

    -

    -
    input
    -

    - - -
    library -

    A handle to the target library object.

    -
    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_OPEN_XXX

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define FT_OPEN_MEMORY    0x1
    -#define FT_OPEN_STREAM    0x2
    -#define FT_OPEN_PATHNAME  0x4
    -#define FT_OPEN_DRIVER    0x8
    -#define FT_OPEN_PARAMS    0x10
    -
    -#define ft_open_memory    FT_OPEN_MEMORY     /* deprecated */
    -#define ft_open_stream    FT_OPEN_STREAM     /* deprecated */
    -#define ft_open_pathname  FT_OPEN_PATHNAME   /* deprecated */
    -#define ft_open_driver    FT_OPEN_DRIVER     /* deprecated */
    -#define ft_open_params    FT_OPEN_PARAMS     /* deprecated */
    -
    -

    -
    -

    A list of bit-field constants used within the ‘flags’ field of the FT_Open_Args structure.

    -

    -
    values
    -

    - - - -
    FT_OPEN_MEMORY -

    This is a memory-based stream.

    -
    FT_OPEN_STREAM -

    Copy the stream from the ‘stream’ field.

    -
    FT_OPEN_PATHNAME -

    Create a new input stream from a C path name.

    + } FT_Glyph_Metrics; + + +

    A structure used to model the metrics of a single glyph. The values are expressed in 26.6 fractional pixel format; if the flag FT_LOAD_NO_SCALE has been used while loading the glyph, values are expressed in font units instead.

    + +

    fields

    + + - - - - - - -
    width +

    The glyph's width.

    FT_OPEN_DRIVER -

    Use the ‘driver’ field.

    +
    height +

    The glyph's height.

    FT_OPEN_PARAMS -

    Use the ‘num_params’ and ‘params’ fields.

    +
    horiBearingX +

    Left side bearing for horizontal layout.

    ft_open_memory -

    Deprecated; use FT_OPEN_MEMORY instead.

    +
    horiBearingY +

    Top side bearing for horizontal layout.

    ft_open_stream -

    Deprecated; use FT_OPEN_STREAM instead.

    +
    horiAdvance +

    Advance width for horizontal layout.

    ft_open_pathname -

    Deprecated; use FT_OPEN_PATHNAME instead.

    +
    vertBearingX +

    Left side bearing for vertical layout.

    ft_open_driver -

    Deprecated; use FT_OPEN_DRIVER instead.

    +
    vertBearingY +

    Top side bearing for vertical layout. Larger positive values mean further below the vertical glyph origin.

    ft_open_params -

    Deprecated; use FT_OPEN_PARAMS instead.

    +
    vertAdvance +

    Advance height for vertical layout. Positive values mean the glyph has a positive advance downward.

    -
    -
    note
    -

    The ‘FT_OPEN_MEMORY’, ‘FT_OPEN_STREAM’, and ‘FT_OPEN_PATHNAME’ flags are mutually exclusive.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Parameter

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -  typedef struct  FT_Parameter_
    -  {
    -    FT_ULong    tag;
    -    FT_Pointer  data;
    +

    note

    +

    If not disabled with FT_LOAD_NO_HINTING, the values represent dimensions of the hinted glyph (in case hinting is applicable).

    +

    Stroking a glyph with an outside border does not increase ‘horiAdvance’ or ‘vertAdvance’; you have to manually adjust these values to account for the added width and height.

    - } FT_Parameter; +
    + -

    -
    -

    A simple structure used to pass more or less generic parameters to FT_Open_Face.

    -

    -
    fields
    -

    - - - -
    tag -

    A four-byte identification tag.

    -
    data -

    A pointer to the parameter data.

    -
    -
    -
    note
    -

    The ID and function of parameters are driver-specific. See the various FT_PARAM_TAG_XXX flags for more information.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Open_Args

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +
    +

    FT_SubGlyph

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  typedef struct FT_SubGlyphRec_*  FT_SubGlyph;
    +
    - typedef struct FT_Open_Args_ +

    The subglyph structure is an internal object used to describe subglyphs (for example, in the case of composites).

    + +

    note

    +

    The subglyph implementation is not part of the high-level API, hence the forward structure declaration.

    +

    You can however retrieve subglyph information with FT_Get_SubGlyph_Info.

    + +
    +
    + +
    +

    FT_Bitmap_Size

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  typedef struct  FT_Bitmap_Size_
       {
    -    FT_UInt         flags;
    -    const FT_Byte*  memory_base;
    -    FT_Long         memory_size;
    -    FT_String*      pathname;
    -    FT_Stream       stream;
    -    FT_Module       driver;
    -    FT_Int          num_params;
    -    FT_Parameter*   params;
    +    FT_Short  height;
    +    FT_Short  width;
     
    -  } FT_Open_Args;
    +    FT_Pos    size;
     
    -

    -
    -

    A structure used to indicate how to open a new font file or stream. A pointer to such a structure can be used as a parameter for the functions FT_Open_Face and FT_Attach_Stream.

    -

    -
    fields
    -

    - - -
    flags -

    A set of bit flags indicating how to use the structure.

    -
    memory_base -

    The first byte of the file in memory.

    + FT_Pos x_ppem; + FT_Pos y_ppem; + + } FT_Bitmap_Size; + + +

    This structure models the metrics of a bitmap strike (i.e., a set of glyphs for a given point size and resolution) in a bitmap font. It is used for the ‘available_sizes’ field of FT_Face.

    + +

    fields

    + + - - - - -
    height +

    The vertical distance, in pixels, between two consecutive baselines. It is always positive.

    memory_size -

    The size in bytes of the file in memory.

    +
    width +

    The average width, in pixels, of all glyphs in the strike.

    pathname -

    A pointer to an 8-bit file pathname.

    +
    size +

    The nominal size of the strike in 26.6 fractional points. This field is not very useful.

    stream -

    A handle to a source stream object.

    +
    x_ppem +

    The horizontal ppem (nominal width) in 26.6 fractional pixels.

    driver -

    This field is exclusively used by FT_Open_Face; it simply specifies the font driver to use to open the face. If set to 0, FreeType tries to load the face with each one of the drivers in its list.

    +
    y_ppem +

    The vertical ppem (nominal height) in 26.6 fractional pixels.

    num_params -

    The number of extra parameters.

    +
    + +

    note

    +

    Windows FNT: The nominal size given in a FNT font is not reliable. Thus when the driver finds it incorrect, it sets ‘size’ to some calculated values and sets ‘x_ppem’ and ‘y_ppem’ to the pixel width and height given in the font, respectively.

    +

    TrueType embedded bitmaps: ‘size’, ‘width’, and ‘height’ values are not contained in the bitmap strike itself. They are computed from the global font parameters.

    + +
    + + +
    +

    FT_Init_FreeType

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Init_FreeType( FT_Library  *alibrary );
    +
    + +

    Initialize a new FreeType library object. The set of modules that are registered by this function is determined at build time.

    + +

    output

    + + -
    alibrary +

    A handle to a new library object.

    params -

    Extra parameters passed to the font driver when opening a new face.

    +
    + +

    return

    +

    FreeType error code. 0 means success.

    + +

    note

    +

    In case you want to provide your own memory allocating routines, use FT_New_Library instead, followed by a call to FT_Add_Default_Modules (or a series of calls to FT_Add_Module).

    +

    For multi-threading applications each thread should have its own FT_Library object.

    +

    If you need reference-counting (cf. FT_Reference_Library), use FT_New_Library and FT_Done_Library.

    + +
    +
    + +
    +

    FT_Done_FreeType

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Done_FreeType( FT_Library  library );
    +
    + +

    Destroy a given FreeType library object and all of its children, including resources, drivers, faces, sizes, etc.

    + +

    input

    + +
    library +

    A handle to the target library object.

    -
    -
    note
    -

    The stream type is determined by the contents of ‘flags’ that are tested in the following order by FT_Open_Face:

    -

    If the ‘FT_OPEN_MEMORY’ bit is set, assume that this is a memory file of ‘memory_size’ bytes, located at ‘memory_address’. The data are are not copied, and the client is responsible for releasing and destroying them after the corresponding call to FT_Done_Face.

    -

    Otherwise, if the ‘FT_OPEN_STREAM’ bit is set, assume that a custom input stream ‘stream’ is used.

    -

    Otherwise, if the ‘FT_OPEN_PATHNAME’ bit is set, assume that this is a normal file and use ‘pathname’ to open it.

    -

    If the ‘FT_OPEN_DRIVER’ bit is set, FT_Open_Face only tries to open the file with the driver whose handler is in ‘driver’.

    -

    If the ‘FT_OPEN_PARAMS’ bit is set, the parameters given by ‘num_params’ and ‘params’ is used. They are ignored otherwise.

    -

    Ideally, both the ‘pathname’ and ‘params’ fields should be tagged as ‘const’; this is missing for API backwards compatibility. In other words, applications should treat them as read-only.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_New_Face

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +

    return

    +

    FreeType error code. 0 means success.

    + +
    + + +
    +

    FT_New_Face

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Error )
       FT_New_Face( FT_Library   library,
                    const char*  filepathname,
                    FT_Long      face_index,
                    FT_Face     *aface );
    +
    -

    -

    This function calls FT_Open_Face to open a font by its pathname.

    -

    -
    inout
    -

    - -
    library + +

    inout

    + +
    library

    A handle to the library resource.

    -
    -
    input
    -

    - -
    pathname + +

    input

    + + -
    pathname

    A path to the font file.

    face_index +
    face_index

    The index of the face within the font. The first face has index 0.

    -
    -
    output
    -

    - -
    aface + +

    output

    + +
    aface

    A handle to a new face object. If ‘face_index’ is greater than or equal to zero, it must be non-NULL. See FT_Open_Face for more details.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    Use FT_Done_Face to destroy the created FT_Face object (along with its slot and sizes).

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_New_Memory_Face

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Done_Face

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Done_Face( FT_Face  face );
    +
    + +

    Discard a given face object, as well as all of its child slots and sizes.

    + +

    input

    + + +
    face +

    A handle to a target face object.

    +
    + +

    return

    +

    FreeType error code. 0 means success.

    + +

    note

    +

    See the discussion of reference counters in the description of FT_Reference_Face.

    + +
    +
    + +
    +

    FT_Reference_Face

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Reference_Face( FT_Face  face );
    +
    + +

    A counter gets initialized to 1 at the time an FT_Face structure is created. This function increments the counter. FT_Done_Face then only destroys a face if the counter is 1, otherwise it simply decrements the counter.

    +

    This function helps in managing life-cycles of structures that reference FT_Face objects.

    + +

    input

    + + +
    face +

    A handle to a target face object.

    +
    + +

    return

    +

    FreeType error code. 0 means success.

    + +

    since

    +

    2.4.2

    + +
    +
    + +
    +

    FT_New_Memory_Face

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Error )
       FT_New_Memory_Face( FT_Library      library,
                           const FT_Byte*  file_base,
                           FT_Long         file_size,
                           FT_Long         face_index,
                           FT_Face        *aface );
    +
    -

    -

    This function calls FT_Open_Face to open a font that has been loaded into memory.

    -

    -
    inout
    -

    - -
    library + +

    inout

    + +
    library

    A handle to the library resource.

    -
    -
    input
    -

    - -
    file_base + +

    input

    + + - -
    file_base

    A pointer to the beginning of the font data.

    file_size +
    file_size

    The size of the memory chunk used by the font data.

    face_index +
    face_index

    The index of the face within the font. The first face has index 0.

    -
    -
    output
    -

    - -
    aface + +

    output

    + +
    aface

    A handle to a new face object. If ‘face_index’ is greater than or equal to zero, it must be non-NULL. See FT_Open_Face for more details.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    You must not deallocate the memory before calling FT_Done_Face.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Open_Face

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Open_Face

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Error )
       FT_Open_Face( FT_Library           library,
                     const FT_Open_Args*  args,
                     FT_Long              face_index,
                     FT_Face             *aface );
    +
    -

    -

    Create a face object from a given resource described by FT_Open_Args.

    -

    -
    inout
    -

    - -
    library + +

    inout

    + +
    library

    A handle to the library resource.

    -
    -
    input
    -

    - -
    args + +

    input

    + + -
    args

    A pointer to an ‘FT_Open_Args’ structure that must be filled by the caller.

    face_index +
    face_index

    The index of the face within the font. The first face has index 0.

    -
    -
    output
    -

    - -
    aface + +

    output

    + +
    aface

    A handle to a new face object. If ‘face_index’ is greater than or equal to zero, it must be non-NULL. See note below.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    Unlike FreeType 1.x, this function automatically creates a glyph slot for the face object that can be accessed directly through ‘face->glyph’.

    FT_Open_Face can be used to quickly check whether the font format of a given font resource is supported by FreeType. If the ‘face_index’ field is negative, the function's return value is 0 if the font format is recognized, or non-zero otherwise; the function returns a more or less empty face handle in ‘*aface’ (if ‘aface’ isn't NULL). The only useful field in this special case is ‘face->num_faces’ that gives the number of faces within the font file. After examination, the returned FT_Face structure should be deallocated with a call to FT_Done_Face.

    Each new face object created with this function also owns a default FT_Size object, accessible as ‘face->size’.

    One FT_Library instance can have multiple face objects, this is, FT_Open_Face and its siblings can be called multiple times using the same ‘library’ argument.

    See the discussion of reference counters in the description of FT_Reference_Face.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Attach_File

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -  FT_EXPORT( FT_Error )
    -  FT_Attach_File( FT_Face      face,
    -                  const char*  filepathname );
    -
    -

    -
    -

    This function calls FT_Attach_Stream to attach a file.

    -

    -
    inout
    -

    - - -
    face -

    The target face object.

    -
    -
    -
    input
    -

    - - -
    filepathname -

    The pathname.

    -
    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Attach_Stream

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -  FT_EXPORT( FT_Error )
    -  FT_Attach_Stream( FT_Face        face,
    -                    FT_Open_Args*  parameters );
    +
    + + +
    +

    FT_Open_Args

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  typedef struct  FT_Open_Args_
    +  {
    +    FT_UInt         flags;
    +    const FT_Byte*  memory_base;
    +    FT_Long         memory_size;
    +    FT_String*      pathname;
    +    FT_Stream       stream;
    +    FT_Module       driver;
    +    FT_Int          num_params;
    +    FT_Parameter*   params;
    +
    +  } FT_Open_Args;
    +
    + +

    A structure used to indicate how to open a new font file or stream. A pointer to such a structure can be used as a parameter for the functions FT_Open_Face and FT_Attach_Stream.

    + +

    fields

    + + + + + + + + + +
    flags +

    A set of bit flags indicating how to use the structure.

    +
    memory_base +

    The first byte of the file in memory.

    +
    memory_size +

    The size in bytes of the file in memory.

    +
    pathname +

    A pointer to an 8-bit file pathname.

    +
    stream +

    A handle to a source stream object.

    +
    driver +

    This field is exclusively used by FT_Open_Face; it simply specifies the font driver to use to open the face. If set to 0, FreeType tries to load the face with each one of the drivers in its list.

    +
    num_params +

    The number of extra parameters.

    +
    params +

    Extra parameters passed to the font driver when opening a new face.

    +
    + +

    note

    +

    The stream type is determined by the contents of ‘flags’ that are tested in the following order by FT_Open_Face:

    +

    If the FT_OPEN_MEMORY bit is set, assume that this is a memory file of ‘memory_size’ bytes, located at ‘memory_address’. The data are are not copied, and the client is responsible for releasing and destroying them after the corresponding call to FT_Done_Face.

    +

    Otherwise, if the FT_OPEN_STREAM bit is set, assume that a custom input stream ‘stream’ is used.

    +

    Otherwise, if the FT_OPEN_PATHNAME bit is set, assume that this is a normal file and use ‘pathname’ to open it.

    +

    If the FT_OPEN_DRIVER bit is set, FT_Open_Face only tries to open the file with the driver whose handler is in ‘driver’.

    +

    If the FT_OPEN_PARAMS bit is set, the parameters given by ‘num_params’ and ‘params’ is used. They are ignored otherwise.

    +

    Ideally, both the ‘pathname’ and ‘params’ fields should be tagged as ‘const’; this is missing for API backwards compatibility. In other words, applications should treat them as read-only.

    + +
    +
    + +
    +

    FT_Parameter

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  typedef struct  FT_Parameter_
    +  {
    +    FT_ULong    tag;
    +    FT_Pointer  data;
    +
    +  } FT_Parameter;
    +
    + +

    A simple structure used to pass more or less generic parameters to FT_Open_Face.

    + +

    fields

    + + + +
    tag +

    A four-byte identification tag.

    +
    data +

    A pointer to the parameter data.

    +
    + +

    note

    +

    The ID and function of parameters are driver-specific. See the various FT_PARAM_TAG_XXX flags for more information.

    + +
    +
    + +
    +

    FT_Attach_File

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Attach_File( FT_Face      face,
    +                  const char*  filepathname );
    +
    + +

    This function calls FT_Attach_Stream to attach a file.

    + +

    inout

    + + +
    face +

    The target face object.

    +
    + +

    input

    + + +
    filepathname +

    The pathname.

    +
    + +

    return

    +

    FreeType error code. 0 means success.

    + +
    +
    + +
    +

    FT_Attach_Stream

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Attach_Stream( FT_Face        face,
    +                    FT_Open_Args*  parameters );
    +
    -

    -

    ‘Attach’ data to a face object. Normally, this is used to read additional information for the face object. For example, you can attach an AFM file that comes with a Type 1 font to get the kerning values and other metrics.

    -

    -
    inout
    -

    - -
    face + +

    inout

    + +
    face

    The target face object.

    -
    -
    input
    -

    - -
    parameters + +

    input

    + +
    parameters

    A pointer to FT_Open_Args that must be filled by the caller.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The meaning of the ‘attach’ (i.e., what really happens when the new file is read) is not fixed by FreeType itself. It really depends on the font format (and thus the font driver).

    Client applications are expected to know what they are doing when invoking this function. Most drivers simply do not implement file attachments.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Reference_Face

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Set_Char_Size

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Error )
    -  FT_Reference_Face( FT_Face  face );
    +  FT_Set_Char_Size( FT_Face     face,
    +                    FT_F26Dot6  char_width,
    +                    FT_F26Dot6  char_height,
    +                    FT_UInt     horz_resolution,
    +                    FT_UInt     vert_resolution );
    +
    -

    -
    -

    A counter gets initialized to 1 at the time an FT_Face structure is created. This function increments the counter. FT_Done_Face then only destroys a face if the counter is 1, otherwise it simply decrements the counter.

    -

    This function helps in managing life-cycles of structures that reference FT_Face objects.

    -

    -
    input
    -

    - -
    face +

    This function calls FT_Request_Size to request the nominal size (in points).

    + +

    inout

    + +
    face

    A handle to a target face object.

    -
    -
    return
    + +

    input

    + + + + + +
    char_width +

    The nominal width, in 26.6 fractional points.

    +
    char_height +

    The nominal height, in 26.6 fractional points.

    +
    horz_resolution +

    The horizontal resolution in dpi.

    +
    vert_resolution +

    The vertical resolution in dpi.

    +
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    since
    -

    2.4.2

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Done_Face

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +

    note

    +

    If either the character width or height is zero, it is set equal to the other value.

    +

    If either the horizontal or vertical resolution is zero, it is set equal to the other value.

    +

    A character width or height smaller than 1pt is set to 1pt; if both resolution values are zero, they are set to 72dpi.

    +

    Don't use this function if you are using the FreeType cache API.

    + +
    + + +
    +

    FT_Set_Pixel_Sizes

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Error )
    -  FT_Done_Face( FT_Face  face );
    +  FT_Set_Pixel_Sizes( FT_Face  face,
    +                      FT_UInt  pixel_width,
    +                      FT_UInt  pixel_height );
    +
    -

    -
    -

    Discard a given face object, as well as all of its child slots and sizes.

    -

    -
    input
    -

    - -
    face +

    This function calls FT_Request_Size to request the nominal size (in pixels).

    + +

    inout

    + + +
    face +

    A handle to the target face object.

    +
    + +

    input

    + + + +
    pixel_width +

    The nominal width, in pixels.

    +
    pixel_height +

    The nominal height, in pixels.

    +
    + +

    return

    +

    FreeType error code. 0 means success.

    + +

    note

    +

    You should not rely on the resulting glyphs matching, or being constrained, to this pixel size. Refer to FT_Request_Size to understand how requested sizes relate to actual sizes.

    +

    Don't use this function if you are using the FreeType cache API.

    + +
    + + +
    +

    FT_Request_Size

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Request_Size( FT_Face          face,
    +                   FT_Size_Request  req );
    +
    + +

    Resize the scale of the active FT_Size object in a face.

    + +

    inout

    + +
    face

    A handle to a target face object.

    -
    -
    return
    + +

    input

    + + +
    req +

    A pointer to a FT_Size_RequestRec.

    +
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    -

    See the discussion of reference counters in the description of FT_Reference_Face.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Select_Size

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +

    note

    +

    Although drivers may select the bitmap strike matching the request, you should not rely on this if you intend to select a particular bitmap strike. Use FT_Select_Size instead in that case.

    +

    The relation between the requested size and the resulting glyph size is dependent entirely on how the size is defined in the source face. The font designer chooses the final size of each glyph relative to this size. For more information refer to ‘http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html

    +

    Don't use this function if you are using the FreeType cache API.

    + +
    + + +
    +

    FT_Select_Size

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Error )
       FT_Select_Size( FT_Face  face,
                       FT_Int   strike_index );
    +
    -

    -

    Select a bitmap strike.

    -

    -
    inout
    -

    - -
    face + +

    inout

    + +
    face

    A handle to a target face object.

    -
    -
    input
    -

    - -
    strike_index + +

    input

    + +
    strike_index

    The index of the bitmap strike in the ‘available_sizes’ field of FT_FaceRec structure.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Size_Request_Type

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Size_Request_Type

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef enum  FT_Size_Request_Type_
       {
    -    FT_SIZE_REQUEST_TYPE_NOMINAL,
    -    FT_SIZE_REQUEST_TYPE_REAL_DIM,
    -    FT_SIZE_REQUEST_TYPE_BBOX,
    -    FT_SIZE_REQUEST_TYPE_CELL,
    -    FT_SIZE_REQUEST_TYPE_SCALES,
    +    FT_SIZE_REQUEST_TYPE_NOMINAL,
    +    FT_SIZE_REQUEST_TYPE_REAL_DIM,
    +    FT_SIZE_REQUEST_TYPE_BBOX,
    +    FT_SIZE_REQUEST_TYPE_CELL,
    +    FT_SIZE_REQUEST_TYPE_SCALES,
     
         FT_SIZE_REQUEST_TYPE_MAX
     
       } FT_Size_Request_Type;
    +
    -

    -

    An enumeration type that lists the supported size request types.

    -

    -
    values
    -

    - - -
    FT_SIZE_REQUEST_TYPE_NOMINAL
    + +

    values

    + + - - - - - - - -
    FT_SIZE_REQUEST_TYPE_NOMINAL

    The nominal size. The ‘units_per_EM’ field of FT_FaceRec is used to determine both scaling values.

    FT_SIZE_REQUEST_TYPE_REAL_DIM
    +
    FT_SIZE_REQUEST_TYPE_REAL_DIM

    The real dimension. The sum of the the ‘ascender’ and (minus of) the ‘descender’ fields of FT_FaceRec are used to determine both scaling values.

    FT_SIZE_REQUEST_TYPE_BBOX
    +
    FT_SIZE_REQUEST_TYPE_BBOX

    The font bounding box. The width and height of the ‘bbox’ field of FT_FaceRec are used to determine the horizontal and vertical scaling value, respectively.

    FT_SIZE_REQUEST_TYPE_CELL
    +
    FT_SIZE_REQUEST_TYPE_CELL

    The ‘max_advance_width’ field of FT_FaceRec is used to determine the horizontal scaling value; the vertical scaling value is determined the same way as FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling values are set to the smaller one. This type is useful if you want to specify the font size for, say, a window of a given dimension and 80x24 cells.

    FT_SIZE_REQUEST_TYPE_SCALES
    +
    FT_SIZE_REQUEST_TYPE_SCALES

    Specify the scaling values directly.

    -
    -
    note
    + +

    note

    The above descriptions only apply to scalable formats. For bitmap formats, the behaviour is up to the driver.

    See the note section of FT_Size_Metrics if you wonder how size requesting relates to scaling values.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Size_RequestRec

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Size_RequestRec

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef struct  FT_Size_RequestRec_
       {
         FT_Size_Request_Type  type;
    @@ -2189,1467 +1694,1246 @@ Defined in FT_FREETYPE_H (freetype.h).
         FT_UInt               vertResolution;
     
       } FT_Size_RequestRec;
    +
    -

    -

    A structure used to model a size request.

    -

    -
    fields
    -

    - -
    type + +

    fields

    + + - - - -
    type

    See FT_Size_Request_Type.

    width +
    width

    The desired width.

    height +
    height

    The desired height.

    horiResolution +
    horiResolution

    The horizontal resolution. If set to zero, ‘width’ is treated as a 26.6 fractional pixel value.

    vertResolution +
    vertResolution

    The vertical resolution. If set to zero, ‘height’ is treated as a 26.6 fractional pixel value.

    -
    -
    note
    + +

    note

    If ‘width’ is zero, then the horizontal scaling value is set equal to the vertical scaling value, and vice versa.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Size_Request

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Size_Request

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef struct FT_Size_RequestRec_  *FT_Size_Request;
    +
    -

    -

    A handle to a size request structure.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Request_Size

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -  FT_EXPORT( FT_Error )
    -  FT_Request_Size( FT_Face          face,
    -                   FT_Size_Request  req );
    +
    + -

    -
    -

    Resize the scale of the active FT_Size object in a face.

    -

    -
    inout
    -

    - - -
    face -

    A handle to a target face object.

    -
    -
    -
    input
    -

    - - -
    req -

    A pointer to a FT_Size_RequestRec.

    -
    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    Although drivers may select the bitmap strike matching the request, you should not rely on this if you intend to select a particular bitmap strike. Use FT_Select_Size instead in that case.

    -

    The relation between the requested size and the resulting glyph size is dependent entirely on how the size is defined in the source face. The font designer chooses the final size of each glyph relative to this size. For more information refer to ‘http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html

    -

    Don't use this function if you are using the FreeType cache API.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Set_Char_Size

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +
    +

    FT_Set_Transform

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( void )
    +  FT_Set_Transform( FT_Face     face,
    +                    FT_Matrix*  matrix,
    +                    FT_Vector*  delta );
    +
    - FT_EXPORT( FT_Error ) - FT_Set_Char_Size( FT_Face face, - FT_F26Dot6 char_width, - FT_F26Dot6 char_height, - FT_UInt horz_resolution, - FT_UInt vert_resolution ); +

    A function used to set the transformation that is applied to glyph images when they are loaded into a glyph slot through FT_Load_Glyph.

    -

    -
    -

    This function calls FT_Request_Size to request the nominal size (in points).

    -

    -
    inout
    -

    - -
    face -

    A handle to a target face object.

    +

    inout

    + +
    face +

    A handle to the source face object.

    -
    -
    input
    -

    - - - -
    char_width -

    The nominal width, in 26.6 fractional points.

    -
    char_height -

    The nominal height, in 26.6 fractional points.

    -
    horz_resolution -

    The horizontal resolution in dpi.

    + +

    input

    + + -
    matrix +

    A pointer to the transformation's 2x2 matrix. Use 0 for the identity matrix.

    vert_resolution -

    The vertical resolution in dpi.

    +
    delta +

    A pointer to the translation vector. Use 0 for the null vector.

    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    If either the character width or height is zero, it is set equal to the other value.

    -

    If either the horizontal or vertical resolution is zero, it is set equal to the other value.

    -

    A character width or height smaller than 1pt is set to 1pt; if both resolution values are zero, they are set to 72dpi.

    -

    Don't use this function if you are using the FreeType cache API.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Set_Pixel_Sizes

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -  FT_EXPORT( FT_Error )
    -  FT_Set_Pixel_Sizes( FT_Face  face,
    -                      FT_UInt  pixel_width,
    -                      FT_UInt  pixel_height );
    +

    note

    +

    The transformation is only applied to scalable image formats after the glyph has been loaded. It means that hinting is unaltered by the transformation and is performed on the character size given in the last call to FT_Set_Char_Size or FT_Set_Pixel_Sizes.

    +

    Note that this also transforms the ‘face.glyph.advance’ field, but not the values in ‘face.glyph.metrics’.

    -

    -
    -

    This function calls FT_Request_Size to request the nominal size (in pixels).

    -

    -
    inout
    -

    - - -
    face -

    A handle to the target face object.

    -
    -
    -
    input
    -

    - - - -
    pixel_width -

    The nominal width, in pixels.

    -
    pixel_height -

    The nominal height, in pixels.

    -
    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    You should not rely on the resulting glyphs matching, or being constrained, to this pixel size. Refer to FT_Request_Size to understand how requested sizes relate to actual sizes.

    -

    Don't use this function if you are using the FreeType cache API.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Load_Glyph

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +
    + +
    +

    FT_Load_Glyph

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Error )
       FT_Load_Glyph( FT_Face   face,
                      FT_UInt   glyph_index,
                      FT_Int32  load_flags );
    +
    -

    -

    A function used to load a single glyph into the glyph slot of a face object.

    -

    -
    inout
    -

    - -
    face + +

    inout

    + +
    face

    A handle to the target face object where the glyph is loaded.

    -
    -
    input
    -

    - -
    glyph_index + +

    input

    + + -
    glyph_index

    The index of the glyph in the font file. For CID-keyed fonts (either in PS or in CFF format) this argument specifies the CID value.

    load_flags +
    load_flags

    A flag indicating what to load for this glyph. The FT_LOAD_XXX constants can be used to control the glyph loading process (e.g., whether the outline should be scaled, whether to load bitmaps or not, whether to hint the outline, etc).

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The loaded glyph may be transformed. See FT_Set_Transform for the details.

    For subsetted CID-keyed fonts, ‘FT_Err_Invalid_Argument’ is returned for invalid CID values (this is, for CID values that don't have a corresponding glyph in the font). See the discussion of the FT_FACE_FLAG_CID_KEYED flag for more details.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Load_Char

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -  FT_EXPORT( FT_Error )
    -  FT_Load_Char( FT_Face   face,
    -                FT_ULong  char_code,
    -                FT_Int32  load_flags );
    +
    + -

    -
    -

    A function used to load a single glyph into the glyph slot of a face object, according to its character code.

    -

    -
    inout
    -

    - - -
    face -

    A handle to a target face object where the glyph is loaded.

    -
    -
    -
    input
    -

    - -
    char_code -

    The glyph's character code, according to the current charmap used in the face.

    +
    +

    FT_Get_Char_Index

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_UInt )
    +  FT_Get_Char_Index( FT_Face   face,
    +                     FT_ULong  charcode );
    +
    + +

    Return the glyph index of a given character code. This function uses a charmap object to do the mapping.

    + +

    input

    + + -
    face +

    A handle to the source face object.

    load_flags -

    A flag indicating what to load for this glyph. The FT_LOAD_XXX constants can be used to control the glyph loading process (e.g., whether the outline should be scaled, whether to load bitmaps or not, whether to hint the outline, etc).

    +
    charcode +

    The character code.

    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    This function simply calls FT_Get_Char_Index and FT_Load_Glyph.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_LOAD_XXX

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define FT_LOAD_DEFAULT                      0x0
    -#define FT_LOAD_NO_SCALE                     ( 1L << 0 )
    -#define FT_LOAD_NO_HINTING                   ( 1L << 1 )
    -#define FT_LOAD_RENDER                       ( 1L << 2 )
    -#define FT_LOAD_NO_BITMAP                    ( 1L << 3 )
    -#define FT_LOAD_VERTICAL_LAYOUT              ( 1L << 4 )
    -#define FT_LOAD_FORCE_AUTOHINT               ( 1L << 5 )
    -#define FT_LOAD_CROP_BITMAP                  ( 1L << 6 )
    -#define FT_LOAD_PEDANTIC                     ( 1L << 7 )
    -#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  ( 1L << 9 )
    -#define FT_LOAD_NO_RECURSE                   ( 1L << 10 )
    -#define FT_LOAD_IGNORE_TRANSFORM             ( 1L << 11 )
    -#define FT_LOAD_MONOCHROME                   ( 1L << 12 )
    -#define FT_LOAD_LINEAR_DESIGN                ( 1L << 13 )
    -#define FT_LOAD_NO_AUTOHINT                  ( 1L << 15 )
    -  /* Bits 16..19 are used by `FT_LOAD_TARGET_' */
    -#define FT_LOAD_COLOR                        ( 1L << 20 )
     
    -

    -
    -

    A list of bit-field constants used with FT_Load_Glyph to indicate what kind of operations to perform during glyph loading.

    -

    -
    values
    -

    - - - - - - - - - - - - - - - -
    FT_LOAD_DEFAULT -

    Corresponding to 0, this value is used as the default glyph load operation. In this case, the following happens:

    -

    1. FreeType looks for a bitmap for the glyph corresponding to the face's current size. If one is found, the function returns. The bitmap data can be accessed from the glyph slot (see note below).

    -

    2. If no embedded bitmap is searched or found, FreeType looks for a scalable outline. If one is found, it is loaded from the font file, scaled to device pixels, then ‘hinted’ to the pixel grid in order to optimize it. The outline data can be accessed from the glyph slot (see note below).

    -

    Note that by default, the glyph loader doesn't render outlines into bitmaps. The following flags are used to modify this default behaviour to more specific and useful cases.

    -
    FT_LOAD_NO_SCALE -

    Don't scale the loaded outline glyph but keep it in font units.

    -

    This flag implies FT_LOAD_NO_HINTING and FT_LOAD_NO_BITMAP, and unsets FT_LOAD_RENDER.

    -

    If the font is ‘tricky’ (see FT_FACE_FLAG_TRICKY for more), using FT_LOAD_NO_SCALE usually yields meaningless outlines because the subglyphs must be scaled and positioned with hinting instructions. This can be solved by loading the font without FT_LOAD_NO_SCALE and setting the character size to ‘font->units_per_EM’.

    -
    FT_LOAD_NO_HINTING -

    Disable hinting. This generally generates ‘blurrier’ bitmap glyphs when the glyph are rendered in any of the anti-aliased modes. See also the note below.

    -

    This flag is implied by FT_LOAD_NO_SCALE.

    -
    FT_LOAD_RENDER -

    Call FT_Render_Glyph after the glyph is loaded. By default, the glyph is rendered in FT_RENDER_MODE_NORMAL mode. This can be overridden by FT_LOAD_TARGET_XXX or FT_LOAD_MONOCHROME.

    -

    This flag is unset by FT_LOAD_NO_SCALE.

    -
    FT_LOAD_NO_BITMAP -

    Ignore bitmap strikes when loading. Bitmap-only fonts ignore this flag.

    -

    FT_LOAD_NO_SCALE always sets this flag.

    -
    FT_LOAD_VERTICAL_LAYOUT
    -

    Load the glyph for vertical text layout. In particular, the ‘advance’ value in the FT_GlyphSlotRec structure is set to the ‘vertAdvance’ value of the ‘metrics’ field.

    -

    In case FT_HAS_VERTICAL doesn't return true, you shouldn't use this flag currently. Reason is that in this case vertical metrics get synthesized, and those values are not always consistent across various font formats.

    -
    FT_LOAD_FORCE_AUTOHINT -

    Indicates that the auto-hinter is preferred over the font's native hinter. See also the note below.

    -
    FT_LOAD_CROP_BITMAP -

    Indicates that the font driver should crop the loaded bitmap glyph (i.e., remove all space around its black bits). Not all drivers implement this.

    -
    FT_LOAD_PEDANTIC -

    Indicates that the font driver should perform pedantic verifications during glyph loading. This is mostly used to detect broken glyphs in fonts. By default, FreeType tries to handle broken fonts also.

    -

    In particular, errors from the TrueType bytecode engine are not passed to the application if this flag is not set; this might result in partially hinted or distorted glyphs in case a glyph's bytecode is buggy.

    -
    FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH
    -

    Ignored. Deprecated.

    -
    FT_LOAD_NO_RECURSE -

    This flag is only used internally. It merely indicates that the font driver should not load composite glyphs recursively. Instead, it should set the ‘num_subglyph’ and ‘subglyphs’ values of the glyph slot accordingly, and set ‘glyph->format’ to FT_GLYPH_FORMAT_COMPOSITE.

    -

    The description of sub-glyphs is not available to client applications for now.

    -

    This flag implies FT_LOAD_NO_SCALE and FT_LOAD_IGNORE_TRANSFORM.

    -
    FT_LOAD_IGNORE_TRANSFORM
    -

    Indicates that the transform matrix set by FT_Set_Transform should be ignored.

    +

    return

    +

    The glyph index. 0 means ‘undefined character code’.

    + +

    note

    +

    If you use FreeType to manipulate the contents of font files directly, be aware that the glyph index returned by this function doesn't always correspond to the internal indices used within the file. This is done to ensure that value 0 always corresponds to the ‘missing glyph’. If the first glyph is not named ‘.notdef’, then for Type 1 and Type 42 fonts, ‘.notdef’ will be moved into the glyph ID 0 position, and whatever was there will be moved to the position ‘.notdef’ had. For Type 1 fonts, if there is no ‘.notdef’ glyph at all, then one will be created at index 0 and whatever was there will be moved to the last index -- Type 42 fonts are considered invalid under this condition.

    + +
    + + +
    +

    FT_Get_First_Char

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_ULong )
    +  FT_Get_First_Char( FT_Face   face,
    +                     FT_UInt  *agindex );
    +
    + +

    This function is used to return the first character code in the current charmap of a given face. It also returns the corresponding glyph index.

    + +

    input

    + + -
    face +

    A handle to the source face object.

    FT_LOAD_MONOCHROME -

    This flag is used with FT_LOAD_RENDER to indicate that you want to render an outline glyph to a 1-bit monochrome bitmap glyph, with 8 pixels packed into each byte of the bitmap data.

    -

    Note that this has no effect on the hinting algorithm used. You should rather use FT_LOAD_TARGET_MONO so that the monochrome-optimized hinting algorithm is used.

    +
    + +

    output

    + + -
    agindex +

    Glyph index of first character code. 0 if charmap is empty.

    FT_LOAD_LINEAR_DESIGN -

    Indicates that the ‘linearHoriAdvance’ and ‘linearVertAdvance’ fields of FT_GlyphSlotRec should be kept in font units. See FT_GlyphSlotRec for details.

    +
    + +

    return

    +

    The charmap's first character code.

    + +

    note

    +

    You should use this function with FT_Get_Next_Char to be able to parse all character codes available in a given charmap. The code should look like this:

    +
    +  FT_ULong  charcode;                                              
    +  FT_UInt   gindex;                                                
    +                                                                   
    +                                                                   
    +  charcode = FT_Get_First_Char( face, &gindex );                   
    +  while ( gindex != 0 )                                            
    +  {                                                                
    +    ... do something with (charcode,gindex) pair ...               
    +                                                                   
    +    charcode = FT_Get_Next_Char( face, charcode, &gindex );        
    +  }                                                                
    +
    +

    Note that ‘*agindex’ is set to 0 if the charmap is empty. The result itself can be 0 in two cases: if the charmap is empty or if the value 0 is the first valid character code.

    + +
    +
    + +
    +

    FT_Get_Next_Char

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_ULong )
    +  FT_Get_Next_Char( FT_Face    face,
    +                    FT_ULong   char_code,
    +                    FT_UInt   *agindex );
    +
    + +

    This function is used to return the next character code in the current charmap of a given face following the value ‘char_code’, as well as the corresponding glyph index.

    + +

    input

    + + - -
    face +

    A handle to the source face object.

    FT_LOAD_NO_AUTOHINT -

    Disable auto-hinter. See also the note below.

    +
    char_code +

    The starting character code.

    FT_LOAD_COLOR -

    This flag is used to request loading of color embedded-bitmap images. The resulting color bitmaps, if available, will have the FT_PIXEL_MODE_BGRA format. When the flag is not used and color bitmaps are found, they will be converted to 256-level gray bitmaps transparently. Those bitmaps will be in the FT_PIXEL_MODE_GRAY format.

    +
    + +

    output

    + +
    agindex +

    Glyph index of next character code. 0 if charmap is empty.

    -
    -
    note
    -

    By default, hinting is enabled and the font's native hinter (see FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can disable hinting by setting FT_LOAD_NO_HINTING or change the precedence by setting FT_LOAD_FORCE_AUTOHINT. You can also set FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be used at all.

    -

    See the description of FT_FACE_FLAG_TRICKY for a special exception (affecting only a handful of Asian fonts).

    -

    Besides deciding which hinter to use, you can also decide which hinting algorithm to use. See FT_LOAD_TARGET_XXX for details.

    -

    Note that the auto-hinter needs a valid Unicode cmap (either a native one or synthesized by FreeType) for producing correct results. If a font provides an incorrect mapping (for example, assigning the character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a mathematical integral sign), the auto-hinter might produce useless results.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_LOAD_TARGET_XXX

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -#define FT_LOAD_TARGET_( x )   ( (FT_Int32)( (x) & 15 ) << 16 )
    +

    return

    +

    The charmap's next character code.

    -#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) -#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) -#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) -#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD ) -#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V ) +

    note

    +

    You should use this function with FT_Get_First_Char to walk over all character codes available in a given charmap. See the note for this function for a simple code example.

    +

    Note that ‘*agindex’ is set to 0 when there are no more codes in the charmap.

    -

    -
    -

    A list of values that are used to select a specific hinting algorithm to use by the hinter. You should OR one of these values to your ‘load_flags’ when calling FT_Load_Glyph.

    -

    Note that font's native hinters may ignore the hinting algorithm you have specified (e.g., the TrueType bytecode interpreter). You can set FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.

    -

    Also note that FT_LOAD_TARGET_LIGHT is an exception, in that it always implies FT_LOAD_FORCE_AUTOHINT.

    -

    -
    values
    -

    - -
    FT_LOAD_TARGET_NORMAL -

    This corresponds to the default hinting algorithm, optimized for standard gray-level rendering. For monochrome output, use FT_LOAD_TARGET_MONO instead.

    +
    + + +
    +

    FT_Get_Name_Index

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_UInt )
    +  FT_Get_Name_Index( FT_Face     face,
    +                     FT_String*  glyph_name );
    +
    + +

    Return the glyph index of a given glyph name. This function uses driver specific objects to do the translation.

    + +

    input

    + + - -
    face +

    A handle to the source face object.

    FT_LOAD_TARGET_LIGHT -

    A lighter hinting algorithm for non-monochrome modes. Many generated glyphs are more fuzzy but better resemble its original shape. A bit like rendering on Mac OS X.

    -

    As a special exception, this target implies FT_LOAD_FORCE_AUTOHINT.

    +
    glyph_name +

    The glyph name.

    FT_LOAD_TARGET_MONO -

    Strong hinting algorithm that should only be used for monochrome output. The result is probably unpleasant if the glyph is rendered in non-monochrome modes.

    +
    + +

    return

    +

    The glyph index. 0 means ‘undefined character code’.

    + +
    +
    + +
    +

    FT_Load_Char

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Load_Char( FT_Face   face,
    +                FT_ULong  char_code,
    +                FT_Int32  load_flags );
    +
    + +

    A function used to load a single glyph into the glyph slot of a face object, according to its character code.

    + +

    inout

    + + -
    face +

    A handle to a target face object where the glyph is loaded.

    FT_LOAD_TARGET_LCD -

    A variant of FT_LOAD_TARGET_NORMAL optimized for horizontally decimated LCD displays.

    +
    + +

    input

    + + -
    char_code +

    The glyph's character code, according to the current charmap used in the face.

    FT_LOAD_TARGET_LCD_V -

    A variant of FT_LOAD_TARGET_NORMAL optimized for vertically decimated LCD displays.

    +
    load_flags +

    A flag indicating what to load for this glyph. The FT_LOAD_XXX constants can be used to control the glyph loading process (e.g., whether the outline should be scaled, whether to load bitmaps or not, whether to hint the outline, etc).

    -
    -
    note
    -

    You should use only one of the FT_LOAD_TARGET_XXX values in your ‘load_flags’. They can't be ORed.

    -

    If FT_LOAD_RENDER is also set, the glyph is rendered in the corresponding mode (i.e., the mode that matches the used algorithm best). An exeption is FT_LOAD_TARGET_MONO since it implies FT_LOAD_MONOCHROME.

    -

    You can use a hinting algorithm that doesn't correspond to the same rendering mode. As an example, it is possible to use the ‘light’ hinting algorithm and have the results rendered in horizontal LCD pixel mode, with code like

    -
    -  FT_Load_Glyph( face, glyph_index,
    -                 load_flags | FT_LOAD_TARGET_LIGHT );
     
    -  FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
    -
    -
    -
    -
    - - -
    [Index][TOC]
    +

    return

    +

    FreeType error code. 0 means success.

    + +

    note

    +

    This function simply calls FT_Get_Char_Index and FT_Load_Glyph.

    -
    -

    FT_LOAD_TARGET_MODE

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +
    + +
    +

    FT_LOAD_TARGET_MODE

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
     #define FT_LOAD_TARGET_MODE( x )  ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
    +
    -

    -

    Return the FT_Render_Mode corresponding to a given FT_LOAD_TARGET_XXX value.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Set_Transform

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -  FT_EXPORT( void )
    -  FT_Set_Transform( FT_Face     face,
    -                    FT_Matrix*  matrix,
    -                    FT_Vector*  delta );
    +
    + -

    -
    -

    A function used to set the transformation that is applied to glyph images when they are loaded into a glyph slot through FT_Load_Glyph.

    -

    -
    inout
    -

    - -
    face -

    A handle to the source face object.

    +
    +

    FT_Render_Glyph

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Render_Glyph( FT_GlyphSlot    slot,
    +                   FT_Render_Mode  render_mode );
    +
    + +

    Convert a given glyph image to a bitmap. It does so by inspecting the glyph image format, finding the relevant renderer, and invoking it.

    + +

    inout

    + +
    slot +

    A handle to the glyph slot containing the image to convert.

    -
    -
    input
    -

    - - -
    matrix -

    A pointer to the transformation's 2x2 matrix. Use 0 for the identity matrix.

    -
    delta -

    A pointer to the translation vector. Use 0 for the null vector.

    + +

    input

    + +
    render_mode +

    This is the render mode used to render the glyph image into a bitmap. See FT_Render_Mode for a list of possible values.

    -
    -
    note
    -

    The transformation is only applied to scalable image formats after the glyph has been loaded. It means that hinting is unaltered by the transformation and is performed on the character size given in the last call to FT_Set_Char_Size or FT_Set_Pixel_Sizes.

    -

    Note that this also transforms the ‘face.glyph.advance’ field, but not the values in ‘face.glyph.metrics’.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Render_Mode

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +

    return

    +

    FreeType error code. 0 means success.

    + +

    note

    +

    To get meaningful results, font scaling values must be set with functions like FT_Set_Char_Size before calling FT_Render_Glyph.

    + +
    + + +
    +

    FT_Render_Mode

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef enum  FT_Render_Mode_
       {
    -    FT_RENDER_MODE_NORMAL = 0,
    -    FT_RENDER_MODE_LIGHT,
    -    FT_RENDER_MODE_MONO,
    -    FT_RENDER_MODE_LCD,
    -    FT_RENDER_MODE_LCD_V,
    +    FT_RENDER_MODE_NORMAL = 0,
    +    FT_RENDER_MODE_LIGHT,
    +    FT_RENDER_MODE_MONO,
    +    FT_RENDER_MODE_LCD,
    +    FT_RENDER_MODE_LCD_V,
     
         FT_RENDER_MODE_MAX
     
       } FT_Render_Mode;
     
    -

    -
    + + /* these constants are deprecated; use the corresponding */ + /* `FT_Render_Mode' values instead */ +#define ft_render_mode_normal FT_RENDER_MODE_NORMAL +#define ft_render_mode_mono FT_RENDER_MODE_MONO + +

    An enumeration type that lists the render modes supported by FreeType 2. Each mode corresponds to a specific type of scanline conversion performed on the outline.

    For bitmap fonts and embedded bitmaps the ‘bitmap->pixel_mode’ field in the FT_GlyphSlotRec structure gives the format of the returned bitmap.

    All modes except FT_RENDER_MODE_MONO use 256 levels of opacity.

    -

    -
    values
    -

    - -
    FT_RENDER_MODE_NORMAL + +

    values

    + + - - - -
    FT_RENDER_MODE_NORMAL

    This is the default render mode; it corresponds to 8-bit anti-aliased bitmaps.

    FT_RENDER_MODE_LIGHT +
    FT_RENDER_MODE_LIGHT

    This is equivalent to FT_RENDER_MODE_NORMAL. It is only defined as a separate value because render modes are also used indirectly to define hinting algorithm selectors. See FT_LOAD_TARGET_XXX for details.

    FT_RENDER_MODE_MONO +
    FT_RENDER_MODE_MONO

    This mode corresponds to 1-bit bitmaps (with 2 levels of opacity).

    FT_RENDER_MODE_LCD +
    FT_RENDER_MODE_LCD

    This mode corresponds to horizontal RGB and BGR sub-pixel displays like LCD screens. It produces 8-bit bitmaps that are 3 times the width of the original glyph outline in pixels, and which use the FT_PIXEL_MODE_LCD mode.

    FT_RENDER_MODE_LCD_V +
    FT_RENDER_MODE_LCD_V

    This mode corresponds to vertical RGB and BGR sub-pixel displays (like PDA screens, rotated LCD displays, etc.). It produces 8-bit bitmaps that are 3 times the height of the original glyph outline in pixels and use the FT_PIXEL_MODE_LCD_V mode.

    -
    -
    note
    + +

    note

    The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be filtered to reduce color-fringes by using FT_Library_SetLcdFilter (not active in the default builds). It is up to the caller to either call FT_Library_SetLcdFilter (if available) or do the filtering itself.

    The selected render mode only affects vector glyphs of a font. Embedded bitmaps often have a different pixel mode like FT_PIXEL_MODE_MONO. You can use FT_Bitmap_Convert to transform them into 8-bit pixmaps.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    ft_render_mode_xxx

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define ft_render_mode_normal  FT_RENDER_MODE_NORMAL
    -#define ft_render_mode_mono    FT_RENDER_MODE_MONO
    -
    -

    -
    -

    These constants are deprecated. Use the corresponding FT_Render_Mode values instead.

    -

    -
    values
    -

    - - - -
    ft_render_mode_normal -

    see FT_RENDER_MODE_NORMAL

    -
    ft_render_mode_mono -

    see FT_RENDER_MODE_MONO

    -
    -
    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_Render_Glyph

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +
    + +
    +

    FT_Get_Kerning

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Error )
    -  FT_Render_Glyph( FT_GlyphSlot    slot,
    -                   FT_Render_Mode  render_mode );
    +  FT_Get_Kerning( FT_Face     face,
    +                  FT_UInt     left_glyph,
    +                  FT_UInt     right_glyph,
    +                  FT_UInt     kern_mode,
    +                  FT_Vector  *akerning );
    +
    -

    -
    -

    Convert a given glyph image to a bitmap. It does so by inspecting the glyph image format, finding the relevant renderer, and invoking it.

    -

    -
    inout
    -

    - -
    slot -

    A handle to the glyph slot containing the image to convert.

    +

    Return the kerning vector between two glyphs of a same face.

    + +

    input

    + + + + +
    face +

    A handle to a source face object.

    +
    left_glyph +

    The index of the left glyph in the kern pair.

    +
    right_glyph +

    The index of the right glyph in the kern pair.

    +
    kern_mode +

    See FT_Kerning_Mode for more information. Determines the scale and dimension of the returned kerning vector.

    -
    -
    input
    -

    - -
    render_mode -

    This is the render mode used to render the glyph image into a bitmap. See FT_Render_Mode for a list of possible values.

    + +

    output

    + +
    akerning +

    The kerning vector. This is either in font units or in pixels (26.6 format) for scalable formats, and in pixels for fixed-sizes formats.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    -

    To get meaningful results, font scaling values must be set with functions like FT_Set_Char_Size before calling FT_Render_Glyph.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Kerning_Mode

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +

    note

    +

    Only horizontal layouts (left-to-right & right-to-left) are supported by this method. Other layouts, or more sophisticated kernings, are out of the scope of this API function -- they can be implemented through format-specific interfaces.

    + +
    + + +
    +

    FT_Kerning_Mode

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       typedef enum  FT_Kerning_Mode_
       {
    -    FT_KERNING_DEFAULT  = 0,
    -    FT_KERNING_UNFITTED,
    -    FT_KERNING_UNSCALED
    +    FT_KERNING_DEFAULT  = 0,
    +    FT_KERNING_UNFITTED,
    +    FT_KERNING_UNSCALED
     
       } FT_Kerning_Mode;
     
    -

    -
    + + /* these constants are deprecated; use the corresponding */ + /* `FT_Kerning_Mode' values instead */ +#define ft_kerning_default FT_KERNING_DEFAULT +#define ft_kerning_unfitted FT_KERNING_UNFITTED +#define ft_kerning_unscaled FT_KERNING_UNSCALED + +

    An enumeration used to specify which kerning values to return in FT_Get_Kerning.

    -

    -
    values
    -

    - -
    FT_KERNING_DEFAULT + +

    values

    + + - -
    FT_KERNING_DEFAULT

    Return scaled and grid-fitted kerning distances (value is 0).

    FT_KERNING_UNFITTED +
    FT_KERNING_UNFITTED

    Return scaled but un-grid-fitted kerning distances.

    FT_KERNING_UNSCALED +
    FT_KERNING_UNSCALED

    Return the kerning vector in original font units.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    ft_kerning_default

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define ft_kerning_default   FT_KERNING_DEFAULT
    -
    -

    -
    -

    This constant is deprecated. Please use FT_KERNING_DEFAULT instead.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    ft_kerning_unfitted

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define ft_kerning_unfitted  FT_KERNING_UNFITTED
    -
    -

    -
    -

    This constant is deprecated. Please use FT_KERNING_UNFITTED instead.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    ft_kerning_unscaled

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define ft_kerning_unscaled  FT_KERNING_UNSCALED
    -
    -

    -
    -

    This constant is deprecated. Please use FT_KERNING_UNSCALED instead.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Kerning

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Get_Track_Kerning

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Error )
    -  FT_Get_Kerning( FT_Face     face,
    -                  FT_UInt     left_glyph,
    -                  FT_UInt     right_glyph,
    -                  FT_UInt     kern_mode,
    -                  FT_Vector  *akerning );
    +  FT_Get_Track_Kerning( FT_Face    face,
    +                        FT_Fixed   point_size,
    +                        FT_Int     degree,
    +                        FT_Fixed*  akerning );
    +
    -

    -
    -

    Return the kerning vector between two glyphs of a same face.

    -

    -
    input
    -

    - -
    face +

    Return the track kerning for a given face object at a given size.

    + +

    input

    + + - - - -
    face

    A handle to a source face object.

    left_glyph -

    The index of the left glyph in the kern pair.

    +
    point_size +

    The point size in 16.16 fractional points.

    right_glyph -

    The index of the right glyph in the kern pair.

    -
    kern_mode -

    See FT_Kerning_Mode for more information. Determines the scale and dimension of the returned kerning vector.

    -
    -
    -
    output
    -

    - - -
    akerning -

    The kerning vector. This is either in font units or in pixels (26.6 format) for scalable formats, and in pixels for fixed-sizes formats.

    -
    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    Only horizontal layouts (left-to-right & right-to-left) are supported by this method. Other layouts, or more sophisticated kernings, are out of the scope of this API function -- they can be implemented through format-specific interfaces.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Track_Kerning

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -  FT_EXPORT( FT_Error )
    -  FT_Get_Track_Kerning( FT_Face    face,
    -                        FT_Fixed   point_size,
    -                        FT_Int     degree,
    -                        FT_Fixed*  akerning );
    -
    -

    -
    -

    Return the track kerning for a given face object at a given size.

    -

    -
    input
    -

    - - - -
    face -

    A handle to a source face object.

    -
    point_size -

    The point size in 16.16 fractional points.

    -
    degree +
    degree

    The degree of tightness. Increasingly negative values represent tighter track kerning, while increasingly positive values represent looser track kerning. Value zero means no track kerning.

    -
    -
    output
    -

    - -
    akerning + +

    output

    + +
    akerning

    The kerning in 16.16 fractional points, to be uniformly applied between all glyphs.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    Currently, only the Type 1 font driver supports track kerning, using data from AFM files (if attached with FT_Attach_File or FT_Attach_Stream).

    Only very few AFM files come with track kerning data; please refer to the Adobe's AFM specification for more details.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Glyph_Name

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Get_Glyph_Name

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_Glyph_Name( FT_Face     face,
                          FT_UInt     glyph_index,
                          FT_Pointer  buffer,
                          FT_UInt     buffer_max );
    +
    -

    -

    Retrieve the ASCII name of a given glyph in a face. This only works for those faces where FT_HAS_GLYPH_NAMES(face) returns 1.

    -

    -
    input
    -

    - -
    face + +

    input

    + + - -
    face

    A handle to a source face object.

    glyph_index +
    glyph_index

    The glyph index.

    buffer_max +
    buffer_max

    The maximum number of bytes available in the buffer.

    -
    -
    output
    -

    - -
    buffer + +

    output

    + +
    buffer

    A pointer to a target buffer where the name is copied to.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    An error is returned if the face doesn't provide glyph names or if the glyph index is invalid. In all cases of failure, the first byte of ‘buffer’ is set to 0 to indicate an empty name.

    The glyph name is truncated to fit within the buffer if it is too long. The returned string is always zero-terminated.

    Be aware that FreeType reorders glyph indices internally so that glyph index 0 always corresponds to the ‘missing glyph’ (called ‘.notdef’).

    -

    This function is not compiled within the library if the config macro ‘FT_CONFIG_OPTION_NO_GLYPH_NAMES’ is defined in ‘ftoptions.h’.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Postscript_Name

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +

    This function always returns an error if the config macro ‘FT_CONFIG_OPTION_NO_GLYPH_NAMES’ is not defined in ‘ftoptions.h’.

    + +
    + +
    +

    FT_Get_Postscript_Name

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( const char* )
       FT_Get_Postscript_Name( FT_Face  face );
    +
    -

    -

    Retrieve the ASCII PostScript name of a given face, if available. This only works with PostScript and TrueType fonts.

    -

    -
    input
    -

    - -
    face + +

    input

    + +
    face

    A handle to the source face object.

    -
    -
    return
    + +

    return

    A pointer to the face's PostScript name. NULL if unavailable.

    -
    -
    note
    + +

    note

    The returned pointer is owned by the face and is destroyed with it.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Select_Charmap

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_CharMapRec

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  typedef struct  FT_CharMapRec_
    +  {
    +    FT_Face      face;
    +    FT_Encoding  encoding;
    +    FT_UShort    platform_id;
    +    FT_UShort    encoding_id;
    +
    +  } FT_CharMapRec;
    +
    + +

    The base charmap structure.

    + +

    fields

    + + + + + +
    face +

    A handle to the parent face object.

    +
    encoding +

    An FT_Encoding tag identifying the charmap. Use this with FT_Select_Charmap.

    +
    platform_id +

    An ID number describing the platform for the following encoding ID. This comes directly from the TrueType specification and should be emulated for other formats.

    +
    encoding_id +

    A platform specific encoding number. This also comes from the TrueType specification and should be emulated similarly.

    +
    + +
    +
    + +
    +

    FT_Select_Charmap

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Error )
       FT_Select_Charmap( FT_Face      face,
                          FT_Encoding  encoding );
    +
    -

    -

    Select a given charmap by its encoding tag (as listed in ‘freetype.h’).

    -

    -
    inout
    -

    - -
    face + +

    inout

    + +
    face

    A handle to the source face object.

    -
    -
    input
    -

    - -
    encoding + +

    input

    + +
    encoding

    A handle to the selected encoding.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function returns an error if no charmap in the face corresponds to the encoding queried here.

    Because many fonts contain more than a single cmap for Unicode encoding, this function has some special code to select the one that covers Unicode best (‘best’ in the sense that a UCS-4 cmap is preferred to a UCS-2 cmap). It is thus preferable to FT_Set_Charmap in this case.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Set_Charmap

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Set_Charmap

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Error )
       FT_Set_Charmap( FT_Face     face,
                       FT_CharMap  charmap );
    +
    -

    -

    Select a given charmap for character code to glyph index mapping.

    -

    -
    inout
    -

    - -
    face + +

    inout

    + +
    face

    A handle to the source face object.

    -
    -
    input
    -

    - -
    charmap + +

    input

    + +
    charmap

    A handle to the selected charmap.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function returns an error if the charmap is not part of the face (i.e., if it is not listed in the ‘face->charmaps’ table).

    It also fails if a type 14 charmap is selected.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Charmap_Index

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Get_Charmap_Index

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Int )
       FT_Get_Charmap_Index( FT_CharMap  charmap );
    +
    -

    -

    Retrieve index of a given charmap.

    -

    -
    input
    -

    - -
    charmap + +

    input

    + +
    charmap

    A handle to a charmap.

    -
    -
    return
    + +

    return

    The index into the array of character maps within the face to which ‘charmap’ belongs. If an error occurs, -1 is returned.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Char_Index

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -  FT_EXPORT( FT_UInt )
    -  FT_Get_Char_Index( FT_Face   face,
    -                     FT_ULong  charcode );
    +
    + -

    -
    -

    Return the glyph index of a given character code. This function uses a charmap object to do the mapping.

    -

    -
    input
    -

    - -
    face +
    +

    FT_Get_FSType_Flags

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_UShort )
    +  FT_Get_FSType_Flags( FT_Face  face );
    +
    + +

    Return the fsType flags for a font.

    + +

    input

    + + -
    face

    A handle to the source face object.

    charcode -

    The character code.

    -
    -
    -
    return
    -

    The glyph index. 0 means ‘undefined character code’.

    -
    -
    note
    -

    If you use FreeType to manipulate the contents of font files directly, be aware that the glyph index returned by this function doesn't always correspond to the internal indices used within the file. This is done to ensure that value 0 always corresponds to the ‘missing glyph’. If the first glyph is not named ‘.notdef’, then for Type 1 and Type 42 fonts, ‘.notdef’ will be moved into the glyph ID 0 position, and whatever was there will be moved to the position ‘.notdef’ had. For Type 1 fonts, if there is no ‘.notdef’ glyph at all, then one will be created at index 0 and whatever was there will be moved to the last index -- Type 42 fonts are considered invalid under this condition.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_First_Char

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -  FT_EXPORT( FT_ULong )
    -  FT_Get_First_Char( FT_Face   face,
    -                     FT_UInt  *agindex );
    +

    return

    +

    The fsType flags, FT_FSTYPE_XXX.

    -

    -
    -

    This function is used to return the first character code in the current charmap of a given face. It also returns the corresponding glyph index.

    -

    -
    input
    -

    - -
    face -

    A handle to the source face object.

    +

    note

    +

    Use this function rather than directly reading the ‘fs_type’ field in the PS_FontInfoRec structure, which is only guaranteed to return the correct results for Type 1 fonts.

    + +

    since

    +

    2.3.8

    + +
    + + +
    +

    FT_Get_SubGlyph_Info

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Get_SubGlyph_Info( FT_GlyphSlot  glyph,
    +                        FT_UInt       sub_index,
    +                        FT_Int       *p_index,
    +                        FT_UInt      *p_flags,
    +                        FT_Int       *p_arg1,
    +                        FT_Int       *p_arg2,
    +                        FT_Matrix    *p_transform );
    +
    + +

    Retrieve a description of a given subglyph. Only use it if ‘glyph->format’ is FT_GLYPH_FORMAT_COMPOSITE; an error is returned otherwise.

    + +

    input

    + + +
    glyph +

    The source glyph slot.

    +
    sub_index +

    The index of the subglyph. Must be less than ‘glyph->num_subglyphs’.

    -
    -
    output
    -

    - -
    agindex -

    Glyph index of first character code. 0 if charmap is empty.

    + +

    output

    + + + + + +
    p_index +

    The glyph index of the subglyph.

    +
    p_flags +

    The subglyph flags, see FT_SUBGLYPH_FLAG_XXX.

    +
    p_arg1 +

    The subglyph's first argument (if any).

    +
    p_arg2 +

    The subglyph's second argument (if any).

    +
    p_transform +

    The subglyph transformation (if any).

    -
    -
    return
    -

    The charmap's first character code.

    -
    -
    note
    -

    You should use this function with FT_Get_Next_Char to be able to parse all character codes available in a given charmap. The code should look like this:

    -
    -  FT_ULong  charcode;                                              
    -  FT_UInt   gindex;                                                
    -                                                                   
    -                                                                   
    -  charcode = FT_Get_First_Char( face, &gindex );                   
    -  while ( gindex != 0 )                                            
    -  {                                                                
    -    ... do something with (charcode,gindex) pair ...               
    -                                                                   
    -    charcode = FT_Get_Next_Char( face, charcode, &gindex );        
    -  }                                                                
    +
    +

    return

    +

    FreeType error code. 0 means success.

    + +

    note

    +

    The values of ‘*p_arg1’, ‘*p_arg2’, and ‘*p_transform’ must be interpreted depending on the flags returned in ‘*p_flags’. See the TrueType specification for details.

    + +
    + + +
    +

    FT_Face_Internal

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  typedef struct FT_Face_InternalRec_*  FT_Face_Internal;
     
    -

    Note that ‘*agindex’ is set to 0 if the charmap is empty. The result itself can be 0 in two cases: if the charmap is empty or if the value 0 is the first valid character code.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Next_Char

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -  FT_EXPORT( FT_ULong )
    -  FT_Get_Next_Char( FT_Face    face,
    -                    FT_ULong   char_code,
    -                    FT_UInt   *agindex );
    +

    An opaque handle to an ‘FT_Face_InternalRec’ structure, used to model private data of a given FT_Face object.

    +

    This structure might change between releases of FreeType 2 and is not generally available to client applications.

    -

    -
    -

    This function is used to return the next character code in the current charmap of a given face following the value ‘char_code’, as well as the corresponding glyph index.

    -

    -
    input
    -

    - -
    face -

    A handle to the source face object.

    +
    + + +
    +

    FT_Size_Internal

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  typedef struct FT_Size_InternalRec_*  FT_Size_Internal;
    +
    + +

    An opaque handle to an ‘FT_Size_InternalRec’ structure, used to model private data of a given FT_Size object.

    + +
    +
    + +
    +

    FT_Slot_Internal

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  typedef struct FT_Slot_InternalRec_*  FT_Slot_Internal;
    +
    + +

    An opaque handle to an ‘FT_Slot_InternalRec’ structure, used to model private data of a given FT_GlyphSlot object.

    + +
    +
    + +
    +

    FT_FACE_FLAG_XXX

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +#define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )
    +#define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )
    +#define FT_FACE_FLAG_FIXED_WIDTH       ( 1L <<  2 )
    +#define FT_FACE_FLAG_SFNT              ( 1L <<  3 )
    +#define FT_FACE_FLAG_HORIZONTAL        ( 1L <<  4 )
    +#define FT_FACE_FLAG_VERTICAL          ( 1L <<  5 )
    +#define FT_FACE_FLAG_KERNING           ( 1L <<  6 )
    +#define FT_FACE_FLAG_FAST_GLYPHS       ( 1L <<  7 )
    +#define FT_FACE_FLAG_MULTIPLE_MASTERS  ( 1L <<  8 )
    +#define FT_FACE_FLAG_GLYPH_NAMES       ( 1L <<  9 )
    +#define FT_FACE_FLAG_EXTERNAL_STREAM   ( 1L << 10 )
    +#define FT_FACE_FLAG_HINTER            ( 1L << 11 )
    +#define FT_FACE_FLAG_CID_KEYED         ( 1L << 12 )
    +#define FT_FACE_FLAG_TRICKY            ( 1L << 13 )
    +#define FT_FACE_FLAG_COLOR             ( 1L << 14 )
    +
    + +

    A list of bit flags used in the ‘face_flags’ field of the FT_FaceRec structure. They inform client applications of properties of the corresponding face.

    + +

    values

    + + - + + + + + + + + + + + + +
    FT_FACE_FLAG_SCALABLE +

    Indicates that the face contains outline glyphs. This doesn't prevent bitmap strikes, i.e., a face can have both this and and FT_FACE_FLAG_FIXED_SIZES set.

    char_code -

    The starting character code.

    +
    FT_FACE_FLAG_FIXED_SIZES +

    Indicates that the face contains bitmap strikes. See also the ‘num_fixed_sizes’ and ‘available_sizes’ fields of FT_FaceRec.

    +
    FT_FACE_FLAG_FIXED_WIDTH +

    Indicates that the face contains fixed-width characters (like Courier, Lucido, MonoType, etc.).

    +
    FT_FACE_FLAG_SFNT +

    Indicates that the face uses the ‘sfnt’ storage scheme. For now, this means TrueType and OpenType.

    +
    FT_FACE_FLAG_HORIZONTAL +

    Indicates that the face contains horizontal glyph metrics. This should be set for all common formats.

    +
    FT_FACE_FLAG_VERTICAL +

    Indicates that the face contains vertical glyph metrics. This is only available in some formats, not all of them.

    +
    FT_FACE_FLAG_KERNING +

    Indicates that the face contains kerning information. If set, the kerning distance can be retrieved through the function FT_Get_Kerning. Otherwise the function always return the vector (0,0). Note that FreeType doesn't handle kerning data from the ‘GPOS’ table (as present in some OpenType fonts).

    +
    FT_FACE_FLAG_FAST_GLYPHS +

    THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT.

    +
    FT_FACE_FLAG_MULTIPLE_MASTERS +

    Indicates that the font contains multiple masters and is capable of interpolating between them. See the multiple-masters specific API for details.

    +
    FT_FACE_FLAG_GLYPH_NAMES +

    Indicates that the font contains glyph names that can be retrieved through FT_Get_Glyph_Name. Note that some TrueType fonts contain broken glyph name tables. Use the function FT_Has_PS_Glyph_Names when needed.

    +
    FT_FACE_FLAG_EXTERNAL_STREAM +

    Used internally by FreeType to indicate that a face's stream was provided by the client application and should not be destroyed when FT_Done_Face is called. Don't read or test this flag.

    +
    FT_FACE_FLAG_HINTER +

    Set if the font driver has a hinting machine of its own. For example, with TrueType fonts, it makes sense to use data from the SFNT ‘gasp’ table only if the native TrueType hinting engine (with the bytecode interpreter) is available and active.

    +
    FT_FACE_FLAG_CID_KEYED +

    Set if the font is CID-keyed. In that case, the font is not accessed by glyph indices but by CID values. For subsetted CID-keyed fonts this has the consequence that not all index values are a valid argument to FT_Load_Glyph. Only the CID values for which corresponding glyphs in the subsetted font exist make FT_Load_Glyph return successfully; in all other cases you get an ‘FT_Err_Invalid_Argument’ error.

    +

    Note that CID-keyed fonts that are in an SFNT wrapper don't have this flag set since the glyphs are accessed in the normal way (using contiguous indices); the ‘CID-ness’ isn't visible to the application.

    +
    FT_FACE_FLAG_TRICKY +

    Set if the font is ‘tricky’, this is, it always needs the font format's native hinting engine to get a reasonable result. A typical example is the Chinese font ‘mingli.ttf’ that uses TrueType bytecode instructions to move and scale all of its subglyphs.

    +

    It is not possible to autohint such fonts using FT_LOAD_FORCE_AUTOHINT; it will also ignore FT_LOAD_NO_HINTING. You have to set both FT_LOAD_NO_HINTING and FT_LOAD_NO_AUTOHINT to really disable hinting; however, you probably never want this except for demonstration purposes.

    +

    Currently, there are about a dozen TrueType fonts in the list of tricky fonts; they are hard-coded in file ‘ttobjs.c’.

    +
    FT_FACE_FLAG_COLOR +

    Set if the font has color glyph tables. To access color glyphs use FT_LOAD_COLOR.

    -
    -
    output
    -

    - -
    agindex -

    Glyph index of next character code. 0 if charmap is empty.

    + +
    + + +
    +

    FT_STYLE_FLAG_XXX

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +#define FT_STYLE_FLAG_ITALIC  ( 1 << 0 )
    +#define FT_STYLE_FLAG_BOLD    ( 1 << 1 )
    +
    + +

    A list of bit-flags used to indicate the style of a given face. These are used in the ‘style_flags’ field of FT_FaceRec.

    + +

    values

    + + +
    FT_STYLE_FLAG_ITALIC +

    Indicates that a given face style is italic or oblique.

    +
    FT_STYLE_FLAG_BOLD +

    Indicates that a given face is bold.

    -
    -
    return
    -

    The charmap's next character code.

    -
    -
    note
    -

    You should use this function with FT_Get_First_Char to walk over all character codes available in a given charmap. See the note for this function for a simple code example.

    -

    Note that ‘*agindex’ is set to 0 when there are no more codes in the charmap.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Name_Index

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -  FT_EXPORT( FT_UInt )
    -  FT_Get_Name_Index( FT_Face     face,
    -                     FT_String*  glyph_name );
    +

    note

    +

    The style information as provided by FreeType is very basic. More details are beyond the scope and should be done on a higher level (for example, by analyzing various fields of the ‘OS/2’ table in SFNT based fonts).

    -

    -
    -

    Return the glyph index of a given glyph name. This function uses driver specific objects to do the translation.

    -

    -
    input
    -

    - -
    face -

    A handle to the source face object.

    +
    + + +
    +

    FT_OPEN_XXX

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +#define FT_OPEN_MEMORY    0x1
    +#define FT_OPEN_STREAM    0x2
    +#define FT_OPEN_PATHNAME  0x4
    +#define FT_OPEN_DRIVER    0x8
    +#define FT_OPEN_PARAMS    0x10
    +
    +
    +  /* these constants are deprecated; use the corresponding `FT_OPEN_XXX' */
    +  /* values instead                                                      */
    +#define ft_open_memory    FT_OPEN_MEMORY
    +#define ft_open_stream    FT_OPEN_STREAM
    +#define ft_open_pathname  FT_OPEN_PATHNAME
    +#define ft_open_driver    FT_OPEN_DRIVER
    +#define ft_open_params    FT_OPEN_PARAMS
    +
    + +

    A list of bit-field constants used within the ‘flags’ field of the FT_Open_Args structure.

    + +

    values

    + + - + + +
    FT_OPEN_MEMORY +

    This is a memory-based stream.

    glyph_name -

    The glyph name.

    +
    FT_OPEN_STREAM +

    Copy the stream from the ‘stream’ field.

    +
    FT_OPEN_PATHNAME +

    Create a new input stream from a C path name.

    +
    FT_OPEN_DRIVER +

    Use the ‘driver’ field.

    +
    FT_OPEN_PARAMS +

    Use the ‘num_params’ and ‘params’ fields.

    -
    -
    return
    -

    The glyph index. 0 means ‘undefined character code’.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_SUBGLYPH_FLAG_XXX

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1
    -#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2
    -#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4
    -#define FT_SUBGLYPH_FLAG_SCALE                   8
    -#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40
    -#define FT_SUBGLYPH_FLAG_2X2                  0x80
    -#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200
    -
    -

    -
    -

    A list of constants used to describe subglyphs. Please refer to the TrueType specification for the meaning of the various flags.

    -

    -
    values
    -

    - - -
    FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS
    -

    + +

    note

    +

    The ‘FT_OPEN_MEMORY’, ‘FT_OPEN_STREAM’, and ‘FT_OPEN_PATHNAME’ flags are mutually exclusive.

    + +
    + + +
    +

    FT_LOAD_XXX

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +#define FT_LOAD_DEFAULT                      0x0
    +#define FT_LOAD_NO_SCALE                     ( 1L << 0 )
    +#define FT_LOAD_NO_HINTING                   ( 1L << 1 )
    +#define FT_LOAD_RENDER                       ( 1L << 2 )
    +#define FT_LOAD_NO_BITMAP                    ( 1L << 3 )
    +#define FT_LOAD_VERTICAL_LAYOUT              ( 1L << 4 )
    +#define FT_LOAD_FORCE_AUTOHINT               ( 1L << 5 )
    +#define FT_LOAD_CROP_BITMAP                  ( 1L << 6 )
    +#define FT_LOAD_PEDANTIC                     ( 1L << 7 )
    +#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  ( 1L << 9 )
    +#define FT_LOAD_NO_RECURSE                   ( 1L << 10 )
    +#define FT_LOAD_IGNORE_TRANSFORM             ( 1L << 11 )
    +#define FT_LOAD_MONOCHROME                   ( 1L << 12 )
    +#define FT_LOAD_LINEAR_DESIGN                ( 1L << 13 )
    +#define FT_LOAD_NO_AUTOHINT                  ( 1L << 15 )
    +  /* Bits 16..19 are used by `FT_LOAD_TARGET_' */
    +#define FT_LOAD_COLOR                        ( 1L << 20 )
    +
    + +

    A list of bit-field constants used with FT_Load_Glyph to indicate what kind of operations to perform during glyph loading.

    + +

    values

    + + - - - - - - - - - - + + + + + + + + +
    FT_LOAD_DEFAULT +

    Corresponding to 0, this value is used as the default glyph load operation. In this case, the following happens:

    +

    1. FreeType looks for a bitmap for the glyph corresponding to the face's current size. If one is found, the function returns. The bitmap data can be accessed from the glyph slot (see note below).

    +

    2. If no embedded bitmap is searched or found, FreeType looks for a scalable outline. If one is found, it is loaded from the font file, scaled to device pixels, then ‘hinted’ to the pixel grid in order to optimize it. The outline data can be accessed from the glyph slot (see note below).

    +

    Note that by default, the glyph loader doesn't render outlines into bitmaps. The following flags are used to modify this default behaviour to more specific and useful cases.

    FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES
    -

    +
    FT_LOAD_NO_SCALE +

    Don't scale the loaded outline glyph but keep it in font units.

    +

    This flag implies FT_LOAD_NO_HINTING and FT_LOAD_NO_BITMAP, and unsets FT_LOAD_RENDER.

    +

    If the font is ‘tricky’ (see FT_FACE_FLAG_TRICKY for more), using FT_LOAD_NO_SCALE usually yields meaningless outlines because the subglyphs must be scaled and positioned with hinting instructions. This can be solved by loading the font without FT_LOAD_NO_SCALE and setting the character size to ‘font->units_per_EM’.

    FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID
    -

    +
    FT_LOAD_NO_HINTING +

    Disable hinting. This generally generates ‘blurrier’ bitmap glyphs when the glyph are rendered in any of the anti-aliased modes. See also the note below.

    +

    This flag is implied by FT_LOAD_NO_SCALE.

    FT_SUBGLYPH_FLAG_SCALE -

    +
    FT_LOAD_RENDER +

    Call FT_Render_Glyph after the glyph is loaded. By default, the glyph is rendered in FT_RENDER_MODE_NORMAL mode. This can be overridden by FT_LOAD_TARGET_XXX or FT_LOAD_MONOCHROME.

    +

    This flag is unset by FT_LOAD_NO_SCALE.

    FT_SUBGLYPH_FLAG_XY_SCALE
    -

    +
    FT_LOAD_NO_BITMAP +

    Ignore bitmap strikes when loading. Bitmap-only fonts ignore this flag.

    +

    FT_LOAD_NO_SCALE always sets this flag.

    FT_SUBGLYPH_FLAG_2X2 -

    +
    FT_LOAD_VERTICAL_LAYOUT +

    Load the glyph for vertical text layout. In particular, the ‘advance’ value in the FT_GlyphSlotRec structure is set to the ‘vertAdvance’ value of the ‘metrics’ field.

    +

    In case FT_HAS_VERTICAL doesn't return true, you shouldn't use this flag currently. Reason is that in this case vertical metrics get synthesized, and those values are not always consistent across various font formats.

    FT_SUBGLYPH_FLAG_USE_MY_METRICS
    -

    +
    FT_LOAD_FORCE_AUTOHINT +

    Indicates that the auto-hinter is preferred over the font's native hinter. See also the note below.

    +
    FT_LOAD_PEDANTIC +

    Indicates that the font driver should perform pedantic verifications during glyph loading. This is mostly used to detect broken glyphs in fonts. By default, FreeType tries to handle broken fonts also.

    +

    In particular, errors from the TrueType bytecode engine are not passed to the application if this flag is not set; this might result in partially hinted or distorted glyphs in case a glyph's bytecode is buggy.

    +
    FT_LOAD_NO_RECURSE +

    Indicate that the font driver should not load composite glyphs recursively. Instead, it should set the ‘num_subglyph’ and ‘subglyphs’ values of the glyph slot accordingly, and set ‘glyph->format’ to FT_GLYPH_FORMAT_COMPOSITE. The description of subglyphs can then be accessed with FT_Get_SubGlyph_Info.

    +

    This flag implies FT_LOAD_NO_SCALE and FT_LOAD_IGNORE_TRANSFORM.

    +
    FT_LOAD_IGNORE_TRANSFORM +

    Indicates that the transform matrix set by FT_Set_Transform should be ignored.

    +
    FT_LOAD_MONOCHROME +

    This flag is used with FT_LOAD_RENDER to indicate that you want to render an outline glyph to a 1-bit monochrome bitmap glyph, with 8 pixels packed into each byte of the bitmap data.

    +

    Note that this has no effect on the hinting algorithm used. You should rather use FT_LOAD_TARGET_MONO so that the monochrome-optimized hinting algorithm is used.

    +
    FT_LOAD_LINEAR_DESIGN +

    Indicates that the ‘linearHoriAdvance’ and ‘linearVertAdvance’ fields of FT_GlyphSlotRec should be kept in font units. See FT_GlyphSlotRec for details.

    +
    FT_LOAD_NO_AUTOHINT +

    Disable auto-hinter. See also the note below.

    +
    FT_LOAD_COLOR +

    This flag is used to request loading of color embedded-bitmap images. The resulting color bitmaps, if available, will have the FT_PIXEL_MODE_BGRA format. When the flag is not used and color bitmaps are found, they will be converted to 256-level gray bitmaps transparently. Those bitmaps will be in the FT_PIXEL_MODE_GRAY format.

    +
    FT_LOAD_CROP_BITMAP +

    Ignored. Deprecated.

    +
    FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH +

    Ignored. Deprecated.

    -
    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_Get_SubGlyph_Info

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    +

    note

    +

    By default, hinting is enabled and the font's native hinter (see FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can disable hinting by setting FT_LOAD_NO_HINTING or change the precedence by setting FT_LOAD_FORCE_AUTOHINT. You can also set FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be used at all.

    +

    See the description of FT_FACE_FLAG_TRICKY for a special exception (affecting only a handful of Asian fonts).

    +

    Besides deciding which hinter to use, you can also decide which hinting algorithm to use. See FT_LOAD_TARGET_XXX for details.

    +

    Note that the auto-hinter needs a valid Unicode cmap (either a native one or synthesized by FreeType) for producing correct results. If a font provides an incorrect mapping (for example, assigning the character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a mathematical integral sign), the auto-hinter might produce useless results.

    - FT_EXPORT( FT_Error ) - FT_Get_SubGlyph_Info( FT_GlyphSlot glyph, - FT_UInt sub_index, - FT_Int *p_index, - FT_UInt *p_flags, - FT_Int *p_arg1, - FT_Int *p_arg2, - FT_Matrix *p_transform ); +
    + -

    -
    -

    Retrieve a description of a given subglyph. Only use it if ‘glyph->format’ is FT_GLYPH_FORMAT_COMPOSITE; an error is returned otherwise.

    -

    -
    input
    -

    - -
    glyph -

    The source glyph slot.

    +
    +

    FT_LOAD_TARGET_XXX

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +#define FT_LOAD_TARGET_( x )   ( (FT_Int32)( (x) & 15 ) << 16 )
    +
    +#define FT_LOAD_TARGET_NORMAL  FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
    +#define FT_LOAD_TARGET_LIGHT   FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT  )
    +#define FT_LOAD_TARGET_MONO    FT_LOAD_TARGET_( FT_RENDER_MODE_MONO   )
    +#define FT_LOAD_TARGET_LCD     FT_LOAD_TARGET_( FT_RENDER_MODE_LCD    )
    +#define FT_LOAD_TARGET_LCD_V   FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V  )
    +
    + +

    A list of values that are used to select a specific hinting algorithm to use by the hinter. You should OR one of these values to your ‘load_flags’ when calling FT_Load_Glyph.

    +

    Note that font's native hinters may ignore the hinting algorithm you have specified (e.g., the TrueType bytecode interpreter). You can set FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.

    +

    Also note that FT_LOAD_TARGET_LIGHT is an exception, in that it always implies FT_LOAD_FORCE_AUTOHINT.

    + +

    values

    + + - + + +
    FT_LOAD_TARGET_NORMAL +

    This corresponds to the default hinting algorithm, optimized for standard gray-level rendering. For monochrome output, use FT_LOAD_TARGET_MONO instead.

    sub_index -

    The index of the subglyph. Must be less than ‘glyph->num_subglyphs’.

    +
    FT_LOAD_TARGET_LIGHT +

    A lighter hinting algorithm for non-monochrome modes. Many generated glyphs are more fuzzy but better resemble its original shape. A bit like rendering on Mac OS X.

    +

    As a special exception, this target implies FT_LOAD_FORCE_AUTOHINT.

    +
    FT_LOAD_TARGET_MONO +

    Strong hinting algorithm that should only be used for monochrome output. The result is probably unpleasant if the glyph is rendered in non-monochrome modes.

    +
    FT_LOAD_TARGET_LCD +

    A variant of FT_LOAD_TARGET_NORMAL optimized for horizontally decimated LCD displays.

    +
    FT_LOAD_TARGET_LCD_V +

    A variant of FT_LOAD_TARGET_NORMAL optimized for vertically decimated LCD displays.

    -
    -
    output
    + +

    note

    +

    You should use only one of the FT_LOAD_TARGET_XXX values in your ‘load_flags’. They can't be ORed.

    +

    If FT_LOAD_RENDER is also set, the glyph is rendered in the corresponding mode (i.e., the mode that matches the used algorithm best). An exeption is FT_LOAD_TARGET_MONO since it implies FT_LOAD_MONOCHROME.

    +

    You can use a hinting algorithm that doesn't correspond to the same rendering mode. As an example, it is possible to use the ‘light’ hinting algorithm and have the results rendered in horizontal LCD pixel mode, with code like

    +
    +  FT_Load_Glyph( face, glyph_index,
    +                 load_flags | FT_LOAD_TARGET_LIGHT );
    +
    +  FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
    +
    + +
    + + +
    +

    FT_SUBGLYPH_FLAG_XXX

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1
    +#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2
    +#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4
    +#define FT_SUBGLYPH_FLAG_SCALE                   8
    +#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40
    +#define FT_SUBGLYPH_FLAG_2X2                  0x80
    +#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200
    +
    + +

    A list of constants used to describe subglyphs. Please refer to the TrueType specification for the meaning of the various flags.

    + +

    values

    + +
    FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS

    - - - - - - + +
    p_index -

    The glyph index of the subglyph.

    p_flags -

    The subglyph flags, see FT_SUBGLYPH_FLAG_XXX.

    +
    FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES +

    p_arg1 -

    The subglyph's first argument (if any).

    +
    FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID +

    p_arg2 -

    The subglyph's second argument (if any).

    +
    FT_SUBGLYPH_FLAG_SCALE +

    p_transform -

    The subglyph transformation (if any).

    +
    FT_SUBGLYPH_FLAG_XY_SCALE +

    +
    FT_SUBGLYPH_FLAG_2X2 +

    +
    FT_SUBGLYPH_FLAG_USE_MY_METRICS +

    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    The values of ‘*p_arg1’, ‘*p_arg2’, and ‘*p_transform’ must be interpreted depending on the flags returned in ‘*p_flags’. See the TrueType specification for details.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_FSTYPE_XXX

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
    -
    -#define FT_FSTYPE_INSTALLABLE_EMBEDDING         0x0000
    -#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING  0x0002
    -#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING   0x0004
    -#define FT_FSTYPE_EDITABLE_EMBEDDING            0x0008
    -#define FT_FSTYPE_NO_SUBSETTING                 0x0100
    -#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY         0x0200
    -
    -

    -
    + +
    + + +
    +

    FT_FSTYPE_XXX

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +#define FT_FSTYPE_INSTALLABLE_EMBEDDING         0x0000
    +#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING  0x0002
    +#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING   0x0004
    +#define FT_FSTYPE_EDITABLE_EMBEDDING            0x0008
    +#define FT_FSTYPE_NO_SUBSETTING                 0x0100
    +#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY         0x0200
    +
    +

    A list of bit flags used in the ‘fsType’ field of the OS/2 table in a TrueType or OpenType font and the ‘FSType’ entry in a PostScript font. These bit flags are returned by FT_Get_FSType_Flags; they inform client applications of embedding and subsetting restrictions associated with a font.

    See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for more details.

    -

    -
    values
    -

    - - -
    FT_FSTYPE_INSTALLABLE_EMBEDDING
    + +

    values

    + + - - - - - - - - - -
    FT_FSTYPE_INSTALLABLE_EMBEDDING

    Fonts with no fsType bit set may be embedded and permanently installed on the remote system by an application.

    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING
    +
    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING

    Fonts that have only this bit set must not be modified, embedded or exchanged in any manner without first obtaining permission of the font software copyright owner.

    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING
    +
    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING

    If this bit is set, the font may be embedded and temporarily loaded on the remote system. Documents containing Preview & Print fonts must be opened ‘read-only’; no edits can be applied to the document.

    FT_FSTYPE_EDITABLE_EMBEDDING
    +
    FT_FSTYPE_EDITABLE_EMBEDDING

    If this bit is set, the font may be embedded but must only be installed temporarily on other systems. In contrast to Preview & Print fonts, documents containing editable fonts may be opened for reading, editing is permitted, and changes may be saved.

    FT_FSTYPE_NO_SUBSETTING
    +
    FT_FSTYPE_NO_SUBSETTING

    If this bit is set, the font may not be subsetted prior to embedding.

    FT_FSTYPE_BITMAP_EMBEDDING_ONLY
    +
    FT_FSTYPE_BITMAP_EMBEDDING_ONLY

    If this bit is set, only bitmaps contained in the font may be embedded; no outline data may be embedded. If there are no bitmaps available in the font, then the font is unembeddable.

    -
    -
    note
    + +

    note

    While the fsType flags can indicate that a font may be embedded, a license with the font vendor may be separately required to use the font in this way.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_FSType_Flags

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    -  FT_EXPORT( FT_UShort )
    -  FT_Get_FSType_Flags( FT_Face  face );
    +
    + -

    -
    -

    Return the fsType flags for a font.

    -

    -
    input
    -

    - - -
    face -

    A handle to the source face object.

    -
    -
    -
    return
    -

    The fsType flags, FT_FSTYPE_XXX.

    -
    -
    note
    -

    Use this function rather than directly reading the ‘fs_type’ field in the PS_FontInfoRec structure, which is only guaranteed to return the correct results for Type 1 fonts.

    -
    -
    since
    -

    2.3.8

    -
    -
    -
    - - -
    [Index][TOC]
    +
    +

    FT_HAS_FAST_GLYPHS

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +#define FT_HAS_FAST_GLYPHS( face )  0
    +
    + +

    Deprecated.

    + +
    +
    diff --git a/freetype/docs/reference/ft2-basic_types.html b/freetype/docs/reference/ft2-basic_types.html index c600032e6..e39573d5b 100644 --- a/freetype/docs/reference/ft2-basic_types.html +++ b/freetype/docs/reference/ft2-basic_types.html @@ -3,1208 +3,867 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Basic Data Types -

    +

    Basic Data Types

    Synopsis

    - - - - - - - - - - - - - - - - -
    FT_ByteFT_PtrDistFT_Pixel_Mode
    FT_BytesFT_Stringft_pixel_mode_xxx
    FT_CharFT_TagFT_Palette_Mode
    FT_IntFT_ErrorFT_Bitmap
    FT_UIntFT_FixedFT_IMAGE_TAG
    FT_Int16FT_PointerFT_Glyph_Format
    FT_UInt16FT_Posft_glyph_format_xxx
    FT_Int32FT_VectorFT_Data
    FT_UInt32FT_BBoxFT_Generic_Finalizer
    FT_ShortFT_MatrixFT_Generic
    FT_UShortFT_FWordFT_MAKE_TAG
    FT_LongFT_UFWordFT_Int64
    FT_ULongFT_F2Dot14FT_UInt64
    FT_BoolFT_UnitVector
    FT_OffsetFT_F26Dot6


    - -
    + + + + + + + + + + + + + + + + +
    FT_ByteFT_BoolFT_UnitVector
    FT_BytesFT_OffsetFT_F26Dot6
    FT_CharFT_PtrDistFT_Data
    FT_IntFT_String 
    FT_UIntFT_TagFT_MAKE_TAG
    FT_Int16FT_Error 
    FT_UInt16FT_FixedFT_Generic
    FT_Int32FT_PointerFT_Generic_Finalizer
    FT_UInt32FT_Pos 
    FT_Int64FT_VectorFT_Bitmap
    FT_UInt64FT_BBoxFT_Pixel_Mode
    FT_ShortFT_MatrixFT_Palette_Mode
    FT_UShortFT_FWordFT_Glyph_Format
    FT_LongFT_UFWordFT_IMAGE_TAG
    FT_ULongFT_F2Dot14
    + +

    This section contains the basic data types defined by FreeType 2, ranging from simple scalar types to bitmap descriptors. More font-specific structures are defined in a different section.

    -

    -
    -

    FT_Byte

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    +

    FT_Byte

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef unsigned char  FT_Byte;
    +
    -

    -

    A simple typedef for the unsigned char type.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Bytes

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_Bytes

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef const FT_Byte*  FT_Bytes;
    +
    -

    -

    A typedef for constant memory areas.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Char

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_Char

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef signed char  FT_Char;
    +
    -

    -

    A simple typedef for the signed char type.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Int

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_Int

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef signed int  FT_Int;
    +
    -

    -

    A typedef for the int type.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_UInt

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_UInt

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef unsigned int  FT_UInt;
    +
    -

    -

    A typedef for the unsigned int type.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Int16

    -
    -Defined in FT_CONFIG_CONFIG_H (config/ftconfig.h). -

    -
     
    +
    + + +
    +

    FT_Int16

    +

    Defined in FT_CONFIG_CONFIG_H (config/ftconfig.h).

    +
       typedef signed short  FT_Int16;
    +
    -

    -

    A typedef for a 16bit signed integer type.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_UInt16

    -
    -Defined in FT_CONFIG_CONFIG_H (config/ftconfig.h). -

    -
     
    +
    + + +
    +

    FT_UInt16

    +

    Defined in FT_CONFIG_CONFIG_H (config/ftconfig.h).

    +
       typedef unsigned short  FT_UInt16;
    +
    -

    -

    A typedef for a 16bit unsigned integer type.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Int32

    -
    -Defined in FT_CONFIG_CONFIG_H (config/ftconfig.h). -

    -
     
    +
    + + +
    +

    FT_Int32

    +

    Defined in FT_CONFIG_CONFIG_H (config/ftconfig.h).

    +
       typedef signed XXX  FT_Int32;
    +
    -

    -

    A typedef for a 32bit signed integer type. The size depends on the configuration.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_UInt32

    -
    -Defined in FT_CONFIG_CONFIG_H (config/ftconfig.h). -

    -
     
    +
    + + +
    +

    FT_UInt32

    +

    Defined in FT_CONFIG_CONFIG_H (config/ftconfig.h).

    +
       typedef unsigned XXX  FT_UInt32;
    +
    +
    +
    -

    -
    -
    - - -
    [Index][TOC]
    +
    +

    FT_Int64

    +

    Defined in FT_CONFIG_CONFIG_H (config/ftconfig.h).

    +
    +  typedef signed XXX  FT_Int64;
    +
    +
    +
    -
    -

    FT_Short

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
    +
    +

    FT_UInt64

    +

    Defined in FT_CONFIG_CONFIG_H (config/ftconfig.h).

    +
    +  typedef unsigned XXX  FT_UInt64;
    +
    +
    +
    +
    +

    FT_Short

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef signed short  FT_Short;
    +
    -

    -

    A typedef for signed short.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_UShort

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_UShort

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef unsigned short  FT_UShort;
    +
    -

    -

    A typedef for unsigned short.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Long

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_Long

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef signed long  FT_Long;
    +
    -

    -

    A typedef for signed long.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_ULong

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_ULong

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef unsigned long  FT_ULong;
    +
    -

    -

    A typedef for unsigned long.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Bool

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_Bool

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef unsigned char  FT_Bool;
    +
    -

    -

    A typedef of unsigned char, used for simple booleans. As usual, values 1 and 0 represent true and false, respectively.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Offset

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_Offset

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef size_t  FT_Offset;
    +
    -

    -

    This is equivalent to the ANSI C ‘size_t’ type, i.e., the largest unsigned integer type used to express a file size or position, or a memory block size.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_PtrDist

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_PtrDist

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef ft_ptrdiff_t  FT_PtrDist;
    +
    -

    -

    This is equivalent to the ANSI C ‘ptrdiff_t’ type, i.e., the largest signed integer type used to express the distance between two pointers.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_String

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_String

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef char  FT_String;
    +
    -

    -

    A simple typedef for the char type, usually used for strings.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Tag

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_Tag

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef FT_UInt32  FT_Tag;
    +
    -

    -

    A typedef for 32-bit tags (as used in the SFNT format).

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Error

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_Error

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef int  FT_Error;
    +
    -

    -

    The FreeType error code type. A value of 0 is always interpreted as a successful operation.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Fixed

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_Fixed

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef signed long  FT_Fixed;
    +
    -

    -

    This type is used to store 16.16 fixed-point values, like scaling values or matrix coefficients.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Pointer

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_Pointer

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef void*  FT_Pointer;
    +
    -

    -

    A simple typedef for a typeless pointer.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Pos

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    +
    + + +
    +

    FT_Pos

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef signed long  FT_Pos;
    +
    -

    -

    The type FT_Pos is used to store vectorial coordinates. Depending on the context, these can represent distances in integer font units, or 16.16, or 26.6 fixed-point pixel coordinates.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Vector

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    +
    + + +
    +

    FT_Vector

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef struct  FT_Vector_
       {
         FT_Pos  x;
         FT_Pos  y;
     
       } FT_Vector;
    +
    -

    -

    A simple structure used to store a 2D vector; coordinates are of the FT_Pos type.

    -

    -
    fields
    -

    - -
    x + +

    fields

    + + -
    x

    The horizontal coordinate.

    y +
    y

    The vertical coordinate.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_BBox

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    +
    + + +
    +

    FT_BBox

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef struct  FT_BBox_
       {
         FT_Pos  xMin, yMin;
         FT_Pos  xMax, yMax;
     
       } FT_BBox;
    +
    -

    -

    A structure used to hold an outline's bounding box, i.e., the coordinates of its extrema in the horizontal and vertical directions.

    -

    -
    fields
    -

    - -
    xMin + +

    fields

    + + - - -
    xMin

    The horizontal minimum (left-most).

    yMin +
    yMin

    The vertical minimum (bottom-most).

    xMax +
    xMax

    The horizontal maximum (right-most).

    yMax +
    yMax

    The vertical maximum (top-most).

    -
    -
    note
    + +

    note

    The bounding box is specified with the coordinates of the lower left and the upper right corner. In PostScript, those values are often called (llx,lly) and (urx,ury), respectively.

    If ‘yMin’ is negative, this value gives the glyph's descender. Otherwise, the glyph doesn't descend below the baseline. Similarly, if ‘ymax’ is positive, this value gives the glyph's ascender.

    ‘xMin’ gives the horizontal distance from the glyph's origin to the left edge of the glyph's bounding box. If ‘xMin’ is negative, the glyph extends to the left of the origin.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Matrix

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_Matrix

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef struct  FT_Matrix_
       {
         FT_Fixed  xx, xy;
         FT_Fixed  yx, yy;
     
       } FT_Matrix;
    +
    -

    -

    A simple structure used to store a 2x2 matrix. Coefficients are in 16.16 fixed-point format. The computation performed is:

        x' = x*xx + y*xy                                             
        y' = x*yx + y*yy                                             
     
    -

    -
    fields
    -

    - -
    xx + +

    fields

    + + - - -
    xx

    Matrix coefficient.

    xy +
    xy

    Matrix coefficient.

    yx +
    yx

    Matrix coefficient.

    yy +
    yy

    Matrix coefficient.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_FWord

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_FWord

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef signed short  FT_FWord;   /* distance in FUnits */
    +
    -

    -

    A signed 16-bit integer used to store a distance in original font units.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_UFWord

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_UFWord

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef unsigned short  FT_UFWord;  /* unsigned distance */
    +
    -

    -

    An unsigned 16-bit integer used to store a distance in original font units.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_F2Dot14

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_F2Dot14

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef signed short  FT_F2Dot14;
    +
    -

    -

    A signed 2.14 fixed-point type used for unit vectors.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_UnitVector

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_UnitVector

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef struct  FT_UnitVector_
       {
         FT_F2Dot14  x;
         FT_F2Dot14  y;
     
       } FT_UnitVector;
    +
    -

    -

    A simple structure used to store a 2D vector unit vector. Uses FT_F2Dot14 types.

    -

    -
    fields
    -

    - -
    x + +

    fields

    + + -
    x

    Horizontal coordinate.

    y +
    y

    Vertical coordinate.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_F26Dot6

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_F26Dot6

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef signed long  FT_F26Dot6;
    +
    -

    -

    A signed 26.6 fixed-point type used for vectorial pixel coordinates.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Pixel_Mode

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    -  typedef enum  FT_Pixel_Mode_
    +
    + + +
    +

    FT_Data

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
    +  typedef struct  FT_Data_
       {
    -    FT_PIXEL_MODE_NONE = 0,
    -    FT_PIXEL_MODE_MONO,
    -    FT_PIXEL_MODE_GRAY,
    -    FT_PIXEL_MODE_GRAY2,
    -    FT_PIXEL_MODE_GRAY4,
    -    FT_PIXEL_MODE_LCD,
    -    FT_PIXEL_MODE_LCD_V,
    -    FT_PIXEL_MODE_BGRA,
    +    const FT_Byte*  pointer;
    +    FT_Int          length;
     
    -    FT_PIXEL_MODE_MAX      /* do not remove */
    +  } FT_Data;
    +
    - } FT_Pixel_Mode; +

    Read-only binary data represented as a pointer and a length.

    -

    -
    -

    An enumeration type used to describe the format of pixels in a given bitmap. Note that additional formats may be added in the future.

    -

    -
    values
    -

    - - - - - - - - - -
    FT_PIXEL_MODE_NONE -

    Value 0 is reserved.

    -
    FT_PIXEL_MODE_MONO -

    A monochrome bitmap, using 1 bit per pixel. Note that pixels are stored in most-significant order (MSB), which means that the left-most pixel in a byte has value 128.

    -
    FT_PIXEL_MODE_GRAY -

    An 8-bit bitmap, generally used to represent anti-aliased glyph images. Each pixel is stored in one byte. Note that the number of ‘gray’ levels is stored in the ‘num_grays’ field of the FT_Bitmap structure (it generally is 256).

    -
    FT_PIXEL_MODE_GRAY2 -

    A 2-bit per pixel bitmap, used to represent embedded anti-aliased bitmaps in font files according to the OpenType specification. We haven't found a single font using this format, however.

    -
    FT_PIXEL_MODE_GRAY4 -

    A 4-bit per pixel bitmap, representing embedded anti-aliased bitmaps in font files according to the OpenType specification. We haven't found a single font using this format, however.

    -
    FT_PIXEL_MODE_LCD -

    An 8-bit bitmap, representing RGB or BGR decimated glyph images used for display on LCD displays; the bitmap is three times wider than the original glyph image. See also FT_RENDER_MODE_LCD.

    -
    FT_PIXEL_MODE_LCD_V -

    An 8-bit bitmap, representing RGB or BGR decimated glyph images used for display on rotated LCD displays; the bitmap is three times taller than the original glyph image. See also FT_RENDER_MODE_LCD_V.

    -
    FT_PIXEL_MODE_BGRA -

    An image with four 8-bit channels per pixel, representing a color image (such as emoticons) with alpha channel. For each pixel, the format is BGRA, which means, the blue channel comes first in memory. The color channels are pre-multiplied and in the sRGB colorspace. For example, full red at half-translucent opacity will be represented as ‘00,00,80,80’, not ‘00,00,FF,80’. See also FT_LOAD_COLOR.

    -
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    ft_pixel_mode_xxx

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
    -
    -#define ft_pixel_mode_none   FT_PIXEL_MODE_NONE
    -#define ft_pixel_mode_mono   FT_PIXEL_MODE_MONO
    -#define ft_pixel_mode_grays  FT_PIXEL_MODE_GRAY
    -#define ft_pixel_mode_pal2   FT_PIXEL_MODE_GRAY2
    -#define ft_pixel_mode_pal4   FT_PIXEL_MODE_GRAY4
    -
    -

    -
    -

    A list of deprecated constants. Use the corresponding FT_Pixel_Mode values instead.

    -

    -
    values
    -

    - - - - -
    ft_pixel_mode_none -

    See FT_PIXEL_MODE_NONE.

    -
    ft_pixel_mode_mono -

    See FT_PIXEL_MODE_MONO.

    -
    ft_pixel_mode_grays -

    See FT_PIXEL_MODE_GRAY.

    -
    ft_pixel_mode_pal2 -

    See FT_PIXEL_MODE_GRAY2.

    +

    fields

    + + -
    pointer +

    The data.

    ft_pixel_mode_pal4 -

    See FT_PIXEL_MODE_GRAY4.

    +
    length +

    The length of the data in bytes.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Palette_Mode

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
    -
    -  typedef enum  FT_Palette_Mode_
    +
    +
    + + +
    +

    FT_MAKE_TAG

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
    +#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
    +          (FT_Tag)                        \
    +          ( ( (FT_ULong)_x1 << 24 ) |     \
    +            ( (FT_ULong)_x2 << 16 ) |     \
    +            ( (FT_ULong)_x3 <<  8 ) |     \
    +              (FT_ULong)_x4         )
    +
    + +

    This macro converts four-letter tags that are used to label TrueType tables into an unsigned long, to be used within FreeType.

    + +

    note

    +

    The produced values must be 32-bit integers. Don't redefine this macro.

    + +
    +
    + +
    +

    FT_Generic

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
    +  typedef struct  FT_Generic_
       {
    -    ft_palette_mode_rgb = 0,
    -    ft_palette_mode_rgba,
    -
    -    ft_palette_mode_max   /* do not remove */
    -
    -  } FT_Palette_Mode;
    -
    -

    -
    -

    THIS TYPE IS DEPRECATED. DO NOT USE IT!

    -

    An enumeration type to describe the format of a bitmap palette, used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8.

    -

    -
    values
    -

    - -
    ft_palette_mode_rgb -

    The palette is an array of 3-byte RGB records.

    + void* data; + FT_Generic_Finalizer finalizer; + + } FT_Generic; + + +

    Client applications often need to associate their own data to a variety of FreeType core objects. For example, a text layout API might want to associate a glyph cache to a given size object.

    +

    Some FreeType object contains a ‘generic’ field, of type FT_Generic, which usage is left to client applications and font servers.

    +

    It can be used to store a pointer to client-specific data, as well as the address of a ‘finalizer’ function, which will be called by FreeType when the object is destroyed (for example, the previous client example would put the address of the glyph cache destructor in the ‘finalizer’ field).

    + +

    fields

    + + -
    data +

    A typeless pointer to any client-specified data. This field is completely ignored by the FreeType library.

    ft_palette_mode_rgba -

    The palette is an array of 4-byte RGBA records.

    +
    finalizer +

    A pointer to a ‘generic finalizer’ function, which will be called when the object is destroyed. If this field is set to NULL, no code will be called.

    -
    -
    note
    -

    As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by FreeType, these types are not handled by the library itself.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Bitmap

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    +
    + + +
    +

    FT_Generic_Finalizer

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
    +  typedef void  (*FT_Generic_Finalizer)(void*  object);
    +
    + +

    Describe a function used to destroy the ‘client’ data of any FreeType object. See the description of the FT_Generic type for details of usage.

    + +

    input

    +

    The address of the FreeType object that is under finalization. Its client data is accessed through its ‘generic’ field.

    + +
    +
    + +
    +

    FT_Bitmap

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef struct  FT_Bitmap_
       {
    -    int             rows;
    -    int             width;
    +    unsigned int    rows;
    +    unsigned int    width;
         int             pitch;
         unsigned char*  buffer;
    -    short           num_grays;
    -    char            pixel_mode;
    -    char            palette_mode;
    +    unsigned short  num_grays;
    +    unsigned char   pixel_mode;
    +    unsigned char   palette_mode;
         void*           palette;
     
       } FT_Bitmap;
    +
    -

    -

    A structure used to describe a bitmap or pixmap to the raster. Note that we now manage pixmaps of various depths through the ‘pixel_mode’ field.

    -

    -
    fields
    -

    - -
    rows + +

    fields

    + + - - - - - - -
    rows

    The number of bitmap rows.

    width +
    width

    The number of pixels in bitmap row.

    pitch +
    pitch

    The pitch's absolute value is the number of bytes taken by one bitmap row, including padding. However, the pitch is positive when the bitmap has a ‘down’ flow, and negative when it has an ‘up’ flow. In all cases, the pitch is an offset to add to a bitmap pointer in order to go down one row.

    Note that ‘padding’ means the alignment of a bitmap to a byte border, and FreeType functions normally align to the smallest possible integer value.

    For the B/W rasterizer, ‘pitch’ is always an even number.

    To change the pitch of a bitmap (say, to make it a multiple of 4), use FT_Bitmap_Convert. Alternatively, you might use callback functions to directly render to the application's surface; see the file ‘example2.cpp’ in the tutorial for a demonstration.

    buffer +
    buffer

    A typeless pointer to the bitmap buffer. This value should be aligned on 32-bit boundaries in most cases.

    num_grays +
    num_grays

    This field is only used with FT_PIXEL_MODE_GRAY; it gives the number of gray levels used in the bitmap.

    pixel_mode +
    pixel_mode

    The pixel mode, i.e., how pixel bits are stored. See FT_Pixel_Mode for possible values.

    palette_mode +
    palette_mode

    This field is intended for paletted pixel modes; it indicates how the palette is stored. Not used currently.

    palette +
    palette

    A typeless pointer to the bitmap palette; this field is intended for paletted pixel modes. Not used currently.

    -
    -
    note
    + +

    note

    For now, the only pixel modes supported by FreeType are mono and grays. However, drivers might be added in the future to support more ‘colorful’ options.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_IMAGE_TAG

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    -#ifndef FT_IMAGE_TAG
    -#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  \
    -          value = ( ( (unsigned long)_x1 << 24 ) | \
    -                    ( (unsigned long)_x2 << 16 ) | \
    -                    ( (unsigned long)_x3 << 8  ) | \
    -                      (unsigned long)_x4         )
    -#endif /* FT_IMAGE_TAG */
    +
    + -

    -
    -

    This macro converts four-letter tags to an unsigned long type.

    -

    -
    note
    -

    Since many 16-bit compilers don't like 32-bit enumerations, you should redefine this macro in case of problems to something like this:

    -
    -  #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  value         
    -
    -

    to get a simple enumeration without assigning special numbers.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Glyph_Format

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
    -
    -  typedef enum  FT_Glyph_Format_
    +
    +

    FT_Pixel_Mode

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
    +  typedef enum  FT_Pixel_Mode_
       {
    -    FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),
    +    FT_PIXEL_MODE_NONE = 0,
    +    FT_PIXEL_MODE_MONO,
    +    FT_PIXEL_MODE_GRAY,
    +    FT_PIXEL_MODE_GRAY2,
    +    FT_PIXEL_MODE_GRAY4,
    +    FT_PIXEL_MODE_LCD,
    +    FT_PIXEL_MODE_LCD_V,
    +    FT_PIXEL_MODE_BGRA,
     
    -    FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
    -    FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP,    'b', 'i', 't', 's' ),
    -    FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE,   'o', 'u', 't', 'l' ),
    -    FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER,   'p', 'l', 'o', 't' )
    +    FT_PIXEL_MODE_MAX      /* do not remove */
     
    -  } FT_Glyph_Format;
    +  } FT_Pixel_Mode;
     
    -

    -
    -

    An enumeration type used to describe the format of a given glyph image. Note that this version of FreeType only supports two image formats, even though future font drivers will be able to register their own format.

    -

    -
    values
    -

    - - - - -
    FT_GLYPH_FORMAT_NONE -

    The value 0 is reserved.

    -
    FT_GLYPH_FORMAT_COMPOSITE
    -

    The glyph image is a composite of several other images. This format is only used with FT_LOAD_NO_RECURSE, and is used to report compound glyphs (like accented characters).

    -
    FT_GLYPH_FORMAT_BITMAP -

    The glyph image is a bitmap, and can be described as an FT_Bitmap. You generally need to access the ‘bitmap’ field of the FT_GlyphSlotRec structure to read it.

    + + /* these constants are deprecated; use the corresponding `FT_Pixel_Mode' */ + /* values instead. */ +#define ft_pixel_mode_none FT_PIXEL_MODE_NONE +#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO +#define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY +#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2 +#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4 + + +

    An enumeration type used to describe the format of pixels in a given bitmap. Note that additional formats may be added in the future.

    + +

    values

    + + - - - - -
    FT_PIXEL_MODE_NONE +

    Value 0 is reserved.

    FT_GLYPH_FORMAT_OUTLINE
    -

    The glyph image is a vectorial outline made of line segments and Bézier arcs; it can be described as an FT_Outline; you generally want to access the ‘outline’ field of the FT_GlyphSlotRec structure to read it.

    +
    FT_PIXEL_MODE_MONO +

    A monochrome bitmap, using 1 bit per pixel. Note that pixels are stored in most-significant order (MSB), which means that the left-most pixel in a byte has value 128.

    FT_GLYPH_FORMAT_PLOTTER
    -

    The glyph image is a vectorial path with no inside and outside contours. Some Type 1 fonts, like those in the Hershey family, contain glyphs in this format. These are described as FT_Outline, but FreeType isn't currently capable of rendering them correctly.

    +
    FT_PIXEL_MODE_GRAY +

    An 8-bit bitmap, generally used to represent anti-aliased glyph images. Each pixel is stored in one byte. Note that the number of ‘gray’ levels is stored in the ‘num_grays’ field of the FT_Bitmap structure (it generally is 256).

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    ft_glyph_format_xxx

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
    -
    -#define ft_glyph_format_none       FT_GLYPH_FORMAT_NONE
    -#define ft_glyph_format_composite  FT_GLYPH_FORMAT_COMPOSITE
    -#define ft_glyph_format_bitmap     FT_GLYPH_FORMAT_BITMAP
    -#define ft_glyph_format_outline    FT_GLYPH_FORMAT_OUTLINE
    -#define ft_glyph_format_plotter    FT_GLYPH_FORMAT_PLOTTER
    -
    -

    -
    -

    A list of deprecated constants. Use the corresponding FT_Glyph_Format values instead.

    -

    -
    values
    -

    - - - - - - - - -
    ft_glyph_format_none -

    See FT_GLYPH_FORMAT_NONE.

    +
    FT_PIXEL_MODE_GRAY2 +

    A 2-bit per pixel bitmap, used to represent embedded anti-aliased bitmaps in font files according to the OpenType specification. We haven't found a single font using this format, however.

    ft_glyph_format_composite
    -

    See FT_GLYPH_FORMAT_COMPOSITE.

    +
    FT_PIXEL_MODE_GRAY4 +

    A 4-bit per pixel bitmap, representing embedded anti-aliased bitmaps in font files according to the OpenType specification. We haven't found a single font using this format, however.

    ft_glyph_format_bitmap -

    See FT_GLYPH_FORMAT_BITMAP.

    +
    FT_PIXEL_MODE_LCD +

    An 8-bit bitmap, representing RGB or BGR decimated glyph images used for display on LCD displays; the bitmap is three times wider than the original glyph image. See also FT_RENDER_MODE_LCD.

    ft_glyph_format_outline
    -

    See FT_GLYPH_FORMAT_OUTLINE.

    +
    FT_PIXEL_MODE_LCD_V +

    An 8-bit bitmap, representing RGB or BGR decimated glyph images used for display on rotated LCD displays; the bitmap is three times taller than the original glyph image. See also FT_RENDER_MODE_LCD_V.

    ft_glyph_format_plotter
    -

    See FT_GLYPH_FORMAT_PLOTTER.

    +
    FT_PIXEL_MODE_BGRA +

    An image with four 8-bit channels per pixel, representing a color image (such as emoticons) with alpha channel. For each pixel, the format is BGRA, which means, the blue channel comes first in memory. The color channels are pre-multiplied and in the sRGB colorspace. For example, full red at half-translucent opacity will be represented as ‘00,00,80,80’, not ‘00,00,FF,80’. See also FT_LOAD_COLOR.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Data

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    -  typedef struct  FT_Data_
    -  {
    -    const FT_Byte*  pointer;
    -    FT_Int          length;
    +
    + - } FT_Data; +
    +

    FT_Glyph_Format

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
    +  typedef enum  FT_Glyph_Format_
    +  {
    +    FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),
     
    -

    -
    -

    Read-only binary data represented as a pointer and a length.

    -

    -
    fields
    -

    - - - -
    pointer -

    The data.

    -
    length -

    The length of the data in bytes.

    -
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Generic_Finalizer

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
    +    FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
    +    FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP,    'b', 'i', 't', 's' ),
    +    FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE,   'o', 'u', 't', 'l' ),
    +    FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER,   'p', 'l', 'o', 't' )
     
    -  typedef void  (*FT_Generic_Finalizer)(void*  object);
    +  } FT_Glyph_Format;
     
    -

    -
    -

    Describe a function used to destroy the ‘client’ data of any FreeType object. See the description of the FT_Generic type for details of usage.

    -

    -
    input
    -

    The address of the FreeType object that is under finalization. Its client data is accessed through its ‘generic’ field.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Generic

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    -  typedef struct  FT_Generic_
    -  {
    -    void*                 data;
    -    FT_Generic_Finalizer  finalizer;
    +  /* these constants are deprecated; use the corresponding */
    +  /* `FT_Glyph_Format' values instead.                     */
    +#define ft_glyph_format_none       FT_GLYPH_FORMAT_NONE
    +#define ft_glyph_format_composite  FT_GLYPH_FORMAT_COMPOSITE
    +#define ft_glyph_format_bitmap     FT_GLYPH_FORMAT_BITMAP
    +#define ft_glyph_format_outline    FT_GLYPH_FORMAT_OUTLINE
    +#define ft_glyph_format_plotter    FT_GLYPH_FORMAT_PLOTTER
    +
    - } FT_Generic; +

    An enumeration type used to describe the format of a given glyph image. Note that this version of FreeType only supports two image formats, even though future font drivers will be able to register their own format.

    -

    -
    -

    Client applications often need to associate their own data to a variety of FreeType core objects. For example, a text layout API might want to associate a glyph cache to a given size object.

    -

    Some FreeType object contains a ‘generic’ field, of type FT_Generic, which usage is left to client applications and font servers.

    -

    It can be used to store a pointer to client-specific data, as well as the address of a ‘finalizer’ function, which will be called by FreeType when the object is destroyed (for example, the previous client example would put the address of the glyph cache destructor in the ‘finalizer’ field).

    -

    -
    fields
    -

    - -
    data -

    A typeless pointer to any client-specified data. This field is completely ignored by the FreeType library.

    +

    values

    + + - + + +
    FT_GLYPH_FORMAT_NONE +

    The value 0 is reserved.

    finalizer -

    A pointer to a ‘generic finalizer’ function, which will be called when the object is destroyed. If this field is set to NULL, no code will be called.

    +
    FT_GLYPH_FORMAT_COMPOSITE +

    The glyph image is a composite of several other images. This format is only used with FT_LOAD_NO_RECURSE, and is used to report compound glyphs (like accented characters).

    +
    FT_GLYPH_FORMAT_BITMAP +

    The glyph image is a bitmap, and can be described as an FT_Bitmap. You generally need to access the ‘bitmap’ field of the FT_GlyphSlotRec structure to read it.

    +
    FT_GLYPH_FORMAT_OUTLINE +

    The glyph image is a vectorial outline made of line segments and Bézier arcs; it can be described as an FT_Outline; you generally want to access the ‘outline’ field of the FT_GlyphSlotRec structure to read it.

    +
    FT_GLYPH_FORMAT_PLOTTER +

    The glyph image is a vectorial path with no inside and outside contours. Some Type 1 fonts, like those in the Hershey family, contain glyphs in this format. These are described as FT_Outline, but FreeType isn't currently capable of rendering them correctly.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_MAKE_TAG

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
    -
    -#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
    -          (FT_Tag)                        \
    -          ( ( (FT_ULong)_x1 << 24 ) |     \
    -            ( (FT_ULong)_x2 << 16 ) |     \
    -            ( (FT_ULong)_x3 <<  8 ) |     \
    -              (FT_ULong)_x4         )
    -
    -

    -
    -

    This macro converts four-letter tags that are used to label TrueType tables into an unsigned long, to be used within FreeType.

    -

    -
    note
    -

    The produced values must be 32-bit integers. Don't redefine this macro.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Int64

    -
    -Defined in FT_CONFIG_CONFIG_H (config/ftconfig.h). -

    -
     
    -  typedef signed XXX  FT_Int64;
    +
    + -

    -
    -
    - - -
    [Index][TOC]
    +
    +

    FT_IMAGE_TAG

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
    +#ifndef FT_IMAGE_TAG
    +#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  \
    +          value = ( ( (unsigned long)_x1 << 24 ) | \
    +                    ( (unsigned long)_x2 << 16 ) | \
    +                    ( (unsigned long)_x3 << 8  ) | \
    +                      (unsigned long)_x4         )
    +#endif /* FT_IMAGE_TAG */
    +
    -
    -

    FT_UInt64

    -
    -Defined in FT_CONFIG_CONFIG_H (config/ftconfig.h). -

    -
    +

    This macro converts four-letter tags to an unsigned long type.

    - typedef unsigned XXX FT_UInt64; +

    note

    +

    Since many 16-bit compilers don't like 32-bit enumerations, you should redefine this macro in case of problems to something like this:

    +
    +  #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  value         
    +
    +

    to get a simple enumeration without assigning special numbers.

    -

    -
    -
    - - -
    [Index][TOC]
    +
    +
    diff --git a/freetype/docs/reference/ft2-bdf_fonts.html b/freetype/docs/reference/ft2-bdf_fonts.html index 92d887a92..daf2307c0 100644 --- a/freetype/docs/reference/ft2-bdf_fonts.html +++ b/freetype/docs/reference/ft2-bdf_fonts.html @@ -3,126 +3,169 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -BDF and PCF Files -

    +

    BDF and PCF Files

    Synopsis

    - - - -
    FT_PropertyTypeBDF_PropertyRecFT_Get_BDF_Property
    BDF_PropertyFT_Get_BDF_Charset_ID


    + + + +
    BDF_PropertyTypeBDF_PropertyRecFT_Get_BDF_Property
    BDF_PropertyFT_Get_BDF_Charset_ID
    + -

    This section contains the declaration of functions specific to BDF and PCF fonts.

    -

    -
    -

    FT_PropertyType

    -
    -Defined in FT_BDF_H (ftbdf.h). -

    -
     
    +
    +

    BDF_PropertyType

    +

    Defined in FT_BDF_H (ftbdf.h).

    +
       typedef enum  BDF_PropertyType_
       {
    -    BDF_PROPERTY_TYPE_NONE     = 0,
    -    BDF_PROPERTY_TYPE_ATOM     = 1,
    -    BDF_PROPERTY_TYPE_INTEGER  = 2,
    -    BDF_PROPERTY_TYPE_CARDINAL = 3
    +    BDF_PROPERTY_TYPE_NONE     = 0,
    +    BDF_PROPERTY_TYPE_ATOM     = 1,
    +    BDF_PROPERTY_TYPE_INTEGER  = 2,
    +    BDF_PROPERTY_TYPE_CARDINAL = 3
     
    -  } BDF_PropertyType;
    +  } BDF_PropertyType;
    +
    -

    -

    A list of BDF property types.

    -

    -
    values
    -

    - -
    BDF_PROPERTY_TYPE_NONE + +

    values

    + + - - - - -
    BDF_PROPERTY_TYPE_NONE

    Value 0 is used to indicate a missing property.

    BDF_PROPERTY_TYPE_ATOM +
    BDF_PROPERTY_TYPE_ATOM

    Property is a string atom.

    BDF_PROPERTY_TYPE_INTEGER
    +
    BDF_PROPERTY_TYPE_INTEGER

    Property is a 32-bit signed integer.

    BDF_PROPERTY_TYPE_CARDINAL
    +
    BDF_PROPERTY_TYPE_CARDINAL

    Property is a 32-bit unsigned integer.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    BDF_Property

    -
    -Defined in FT_BDF_H (ftbdf.h). -

    -
     
    +
    + + +
    +

    BDF_Property

    +

    Defined in FT_BDF_H (ftbdf.h).

    +
       typedef struct BDF_PropertyRec_*  BDF_Property;
    +
    -

    -

    A handle to a BDF_PropertyRec structure to model a given BDF/PCF property.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    BDF_PropertyRec

    -
    -Defined in FT_BDF_H (ftbdf.h). -

    -
     
    +
    + + +
    +

    BDF_PropertyRec

    +

    Defined in FT_BDF_H (ftbdf.h).

    +
       typedef struct  BDF_PropertyRec_
       {
    -    BDF_PropertyType  type;
    +    BDF_PropertyType  type;
         union {
           const char*     atom;
           FT_Int32        integer;
    @@ -131,130 +174,107 @@ Defined in FT_BDF_H (ftbdf.h).
         } u;
     
       } BDF_PropertyRec;
    +
    -

    -

    This structure models a given BDF/PCF property.

    -

    -
    fields
    -

    - -
    type + +

    fields

    + + - - -
    type

    The property type.

    u.atom -

    The atom string, if type is BDF_PROPERTY_TYPE_ATOM. May be NULL, indicating an empty string.

    +
    u.atom +

    The atom string, if type is BDF_PROPERTY_TYPE_ATOM. May be NULL, indicating an empty string.

    u.integer -

    A signed integer, if type is BDF_PROPERTY_TYPE_INTEGER.

    +
    u.integer +

    A signed integer, if type is BDF_PROPERTY_TYPE_INTEGER.

    u.cardinal -

    An unsigned integer, if type is BDF_PROPERTY_TYPE_CARDINAL.

    +
    u.cardinal +

    An unsigned integer, if type is BDF_PROPERTY_TYPE_CARDINAL.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_BDF_Charset_ID

    -
    -Defined in FT_BDF_H (ftbdf.h). -

    -
     
    +
    + + +
    +

    FT_Get_BDF_Charset_ID

    +

    Defined in FT_BDF_H (ftbdf.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_BDF_Charset_ID( FT_Face       face,
                              const char*  *acharset_encoding,
                              const char*  *acharset_registry );
    +
    -

    -

    Retrieve a BDF font character set identity, according to the BDF specification.

    -

    -
    input
    -

    - -
    face + +

    input

    + +
    face

    A handle to the input face.

    -
    -
    output
    -

    - -
    acharset_encoding + +

    output

    + + -
    acharset_encoding

    Charset encoding, as a C string, owned by the face.

    acharset_registry +
    acharset_registry

    Charset registry, as a C string, owned by the face.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function only works with BDF faces, returning an error otherwise.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_BDF_Property

    -
    -Defined in FT_BDF_H (ftbdf.h). -

    -
     
    +
    + + +
    +

    FT_Get_BDF_Property

    +

    Defined in FT_BDF_H (ftbdf.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_BDF_Property( FT_Face           face,
                            const char*       prop_name,
                            BDF_PropertyRec  *aproperty );
    +
    -

    -

    Retrieve a BDF property from a BDF or PCF font file.

    -

    -
    input
    -

    - -
    face + +

    input

    + + -
    face

    A handle to the input face.

    name +
    name

    The property name.

    -
    -
    output
    -

    - -
    aproperty + +

    output

    + +
    aproperty

    The property.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function works with BDF and PCF fonts. It returns an error otherwise. It also returns an error if the property is not in the font.

    A ‘property’ is a either key-value pair within the STARTPROPERTIES ... ENDPROPERTIES block of a BDF font or a key-value pair from the ‘info->props’ array within a ‘FontRec’ structure of a PCF font.

    -

    Integer properties are always stored as ‘signed’ within PCF fonts; consequently, BDF_PROPERTY_TYPE_CARDINAL is a possible return value for BDF fonts only.

    -

    In case of error, ‘aproperty->type’ is always set to BDF_PROPERTY_TYPE_NONE.

    -
    -
    -
    - - -
    [Index][TOC]
    +

    Integer properties are always stored as ‘signed’ within PCF fonts; consequently, BDF_PROPERTY_TYPE_CARDINAL is a possible return value for BDF fonts only.

    +

    In case of error, ‘aproperty->type’ is always set to BDF_PROPERTY_TYPE_NONE.

    + +
    + diff --git a/freetype/docs/reference/ft2-bitmap_handling.html b/freetype/docs/reference/ft2-bitmap_handling.html index b1d9f8853..a0eec744f 100644 --- a/freetype/docs/reference/ft2-bitmap_handling.html +++ b/freetype/docs/reference/ft2-bitmap_handling.html @@ -3,300 +3,313 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Bitmap Handling -

    +

    Bitmap Handling

    Synopsis

    - - - -
    FT_Bitmap_NewFT_Bitmap_EmboldenFT_GlyphSlot_Own_Bitmap
    FT_Bitmap_CopyFT_Bitmap_ConvertFT_Bitmap_Done


    - -
    -

    This section contains functions for converting FT_Bitmap objects.

    -

    -
    -

    FT_Bitmap_New

    -
    -Defined in FT_BITMAP_H (ftbitmap.h). -

    -
    +
    +
    +
    +
    FT_Bitmap_NewFT_Bitmap_EmboldenFT_GlyphSlot_Own_Bitmap
    FT_Bitmap_CopyFT_Bitmap_ConvertFT_Bitmap_Done
    + +

    This section contains functions for handling FT_Bitmap objects. Note that none of the functions changes the bitmap's ‘flow’ (as indicated by the sign of the ‘pitch’ field in ‘FT_Bitmap’).

    + +
    +

    FT_Bitmap_New

    +

    Defined in FT_BITMAP_H (ftbitmap.h).

    +
       FT_EXPORT( void )
       FT_Bitmap_New( FT_Bitmap  *abitmap );
    +
    -

    -

    Initialize a pointer to an FT_Bitmap structure.

    -

    -
    inout
    -

    - -
    abitmap + +

    inout

    + +
    abitmap

    A pointer to the bitmap structure.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Bitmap_Copy

    -
    -Defined in FT_BITMAP_H (ftbitmap.h). -

    -
     
    +
    + + +
    +

    FT_Bitmap_Copy

    +

    Defined in FT_BITMAP_H (ftbitmap.h).

    +
       FT_EXPORT( FT_Error )
       FT_Bitmap_Copy( FT_Library        library,
                       const FT_Bitmap  *source,
                       FT_Bitmap        *target);
    +
    -

    -

    Copy a bitmap into another one.

    -

    -
    input
    -

    - -
    library + +

    input

    + + -
    library

    A handle to a library object.

    source +
    source

    A handle to the source bitmap.

    -
    -
    output
    -

    - -
    target + +

    output

    + +
    target

    A handle to the target bitmap.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Bitmap_Embolden

    -
    -Defined in FT_BITMAP_H (ftbitmap.h). -

    -
     
    +
    + + +
    +

    FT_Bitmap_Embolden

    +

    Defined in FT_BITMAP_H (ftbitmap.h).

    +
       FT_EXPORT( FT_Error )
       FT_Bitmap_Embolden( FT_Library  library,
                           FT_Bitmap*  bitmap,
                           FT_Pos      xStrength,
                           FT_Pos      yStrength );
    +
    -

    -

    Embolden a bitmap. The new bitmap will be about ‘xStrength’ pixels wider and ‘yStrength’ pixels higher. The left and bottom borders are kept unchanged.

    -

    -
    input
    -

    - -
    library + +

    input

    + + - -
    library

    A handle to a library object.

    xStrength +
    xStrength

    How strong the glyph is emboldened horizontally. Expressed in 26.6 pixel format.

    yStrength +
    yStrength

    How strong the glyph is emboldened vertically. Expressed in 26.6 pixel format.

    -
    -
    inout
    -

    - -
    bitmap + +

    inout

    + +
    bitmap

    A handle to the target bitmap.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The current implementation restricts ‘xStrength’ to be less than or equal to 8 if bitmap is of pixel_mode FT_PIXEL_MODE_MONO.

    If you want to embolden the bitmap owned by a FT_GlyphSlotRec, you should call FT_GlyphSlot_Own_Bitmap on the slot first.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Bitmap_Convert

    -
    -Defined in FT_BITMAP_H (ftbitmap.h). -

    -
    +

    Bitmaps in FT_PIXEL_MODE_GRAY2 and FT_PIXEL_MODE_GRAY@ format are converted to FT_PIXEL_MODE_GRAY format (i.e., 8bpp).

    + +
    + +
    +

    FT_Bitmap_Convert

    +

    Defined in FT_BITMAP_H (ftbitmap.h).

    +
       FT_EXPORT( FT_Error )
       FT_Bitmap_Convert( FT_Library        library,
                          const FT_Bitmap  *source,
                          FT_Bitmap        *target,
                          FT_Int            alignment );
    +
    -

    -

    Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp to a bitmap object with depth 8bpp, making the number of used bytes line (a.k.a. the ‘pitch’) a multiple of ‘alignment’.

    -

    -
    input
    -

    - -
    library + +

    input

    + + - -
    library

    A handle to a library object.

    source +
    source

    The source bitmap.

    alignment +
    alignment

    The pitch of the bitmap is a multiple of this parameter. Common values are 1, 2, or 4.

    -
    -
    output
    -

    - -
    target + +

    output

    + +
    target

    The target bitmap.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    It is possible to call FT_Bitmap_Convert multiple times without calling FT_Bitmap_Done (the memory is simply reallocated).

    Use FT_Bitmap_Done to finally remove the bitmap object.

    The ‘library’ argument is taken to have access to FreeType's memory handling functions.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_GlyphSlot_Own_Bitmap

    -
    -Defined in FT_BITMAP_H (ftbitmap.h). -

    -
     
    +
    + + +
    +

    FT_GlyphSlot_Own_Bitmap

    +

    Defined in FT_BITMAP_H (ftbitmap.h).

    +
       FT_EXPORT( FT_Error )
       FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot  slot );
    +
    -

    -

    Make sure that a glyph slot owns ‘slot->bitmap’.

    -

    -
    input
    -

    - -
    slot + +

    input

    + +
    slot

    The glyph slot.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function is to be used in combination with FT_Bitmap_Embolden.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Bitmap_Done

    -
    -Defined in FT_BITMAP_H (ftbitmap.h). -

    -
     
    +
    + + +
    +

    FT_Bitmap_Done

    +

    Defined in FT_BITMAP_H (ftbitmap.h).

    +
       FT_EXPORT( FT_Error )
       FT_Bitmap_Done( FT_Library  library,
                       FT_Bitmap  *bitmap );
    +
    -

    -

    Destroy a bitmap object created with FT_Bitmap_New.

    -

    -
    input
    -

    - -
    library + +

    input

    + + -
    library

    A handle to a library object.

    bitmap +
    bitmap

    The bitmap object to be freed.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The ‘library’ argument is taken to have access to FreeType's memory handling functions.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-bzip2.html b/freetype/docs/reference/ft2-bzip2.html index 59e15464e..dc33973b1 100644 --- a/freetype/docs/reference/ft2-bzip2.html +++ b/freetype/docs/reference/ft2-bzip2.html @@ -3,92 +3,147 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -BZIP2 Streams -

    +

    BZIP2 Streams

    Synopsis

    - - -
    FT_Stream_OpenBzip2


    + + +
    FT_Stream_OpenBzip2
    + -

    This section contains the declaration of Bzip2-specific functions.

    -

    -
    -

    FT_Stream_OpenBzip2

    -
    -Defined in FT_BZIP2_H (ftbzip2.h). -

    -
     
    +
    +

    FT_Stream_OpenBzip2

    +

    Defined in FT_BZIP2_H (ftbzip2.h).

    +
       FT_EXPORT( FT_Error )
       FT_Stream_OpenBzip2( FT_Stream  stream,
                            FT_Stream  source );
    +
    -

    -

    Open a new stream to parse bzip2-compressed font files. This is mainly used to support the compressed ‘*.pcf.bz2’ fonts that come with XFree86.

    -

    -
    input
    -

    - -
    stream + +

    input

    + + -
    stream

    The target embedding stream.

    source +
    source

    The source stream.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The source stream must be opened before calling this function.

    Calling the internal function ‘FT_Stream_Close’ on the new stream will not call ‘FT_Stream_Close’ on the source stream. None of the stream objects will be released to the heap.

    The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream.

    In certain builds of the library, bzip2 compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face. This means that if no font driver is capable of handling the raw compressed file, the library will try to open a bzip2 compressed stream from it and re-open the face with it.

    This function may return ‘FT_Err_Unimplemented_Feature’ if your build of FreeType was not compiled with bzip2 support.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-cache_subsystem.html b/freetype/docs/reference/ft2-cache_subsystem.html index 772a29a6e..18650de7e 100644 --- a/freetype/docs/reference/ft2-cache_subsystem.html +++ b/freetype/docs/reference/ft2-cache_subsystem.html @@ -3,62 +3,128 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Cache Sub-System -

    +

    Cache Sub-System

    Synopsis

    - - - - - - - - - - - - - - - -
    FTC_ManagerFTC_CMapCache_New
    FTC_FaceIDFTC_CMapCache_Lookup
    FTC_Face_RequesterFTC_ImageTypeRec
    FTC_NodeFTC_ImageType
    FTC_Manager_NewFTC_ImageCache
    FTC_Manager_ResetFTC_ImageCache_New
    FTC_Manager_DoneFTC_ImageCache_Lookup
    FTC_Manager_LookupFaceFTC_ImageCache_LookupScaler
    FTC_ScalerRecFTC_SBit
    FTC_ScalerFTC_SBitRec
    FTC_Manager_LookupSizeFTC_SBitCache
    FTC_Node_UnrefFTC_SBitCache_New
    FTC_Manager_RemoveFaceIDFTC_SBitCache_Lookup
    FTC_CMapCacheFTC_SBitCache_LookupScaler


    - -
    + + + + + + + + + + + + + + + + + + +
    FTC_Manager 
    FTC_FaceIDFTC_SBit
    FTC_Face_RequesterFTC_SBitCache
     FTC_SBitCache_New
    FTC_Manager_NewFTC_SBitCache_Lookup
    FTC_Manager_Reset 
    FTC_Manager_DoneFTC_CMapCache
    FTC_Manager_LookupFaceFTC_CMapCache_New
    FTC_Manager_LookupSizeFTC_CMapCache_Lookup
    FTC_Manager_RemoveFaceID 
     FTC_ScalerRec
    FTC_NodeFTC_Scaler
    FTC_Node_UnrefFTC_ImageTypeRec
     FTC_ImageType
    FTC_ImageCacheFTC_ImageCache_LookupScaler
    FTC_ImageCache_NewFTC_SBitRec
    FTC_ImageCache_LookupFTC_SBitCache_LookupScaler
    + +

    This section describes the FreeType 2 cache sub-system, which is used to limit the number of concurrently opened FT_Face and FT_Size objects, as well as caching information like character maps and glyph images while limiting their maximum memory usage.

    Note that all types and functions begin with the ‘FTC_’ prefix.

    The cache is highly portable and thus doesn't know anything about the fonts installed on your system, or how to access them. This implies the following scheme:

    @@ -72,135 +138,88 @@ Cache Sub-System

    If you want to use the FT_Glyph caching, call FTC_ImageCache, then later use FTC_ImageCache_Lookup to retrieve the corresponding FT_Glyph objects from the cache.

    If you need lots of small bitmaps, it is much more memory efficient to call FTC_SBitCache_New followed by FTC_SBitCache_Lookup. This returns FTC_SBitRec structures, which are used to store small bitmaps directly. (A small bitmap is one whose metrics and dimensions all fit into 8-bit integers).

    We hope to also provide a kerning cache in the near future.

    -

    -
    -

    FTC_Manager

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    +
    +

    FTC_Manager

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       typedef struct FTC_ManagerRec_*  FTC_Manager;
    +
    -

    -

    This object corresponds to one instance of the cache-subsystem. It is used to cache one or more FT_Face objects, along with corresponding FT_Size objects.

    The manager intentionally limits the total number of opened FT_Face and FT_Size objects to control memory usage. See the ‘max_faces’ and ‘max_sizes’ parameters of FTC_Manager_New.

    The manager is also used to cache ‘nodes’ of various types while limiting their total memory usage.

    All limitations are enforced by keeping lists of managed objects in most-recently-used order, and flushing old nodes to make room for new ones.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_FaceID

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    +
    + + +
    +

    FTC_FaceID

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       typedef FT_Pointer  FTC_FaceID;
    +
    -

    -

    An opaque pointer type that is used to identity face objects. The contents of such objects is application-dependent.

    These pointers are typically used to point to a user-defined structure containing a font file path, and face index.

    -

    -
    note
    + +

    note

    Never use NULL as a valid FTC_FaceID.

    Face IDs are passed by the client to the cache manager that calls, when needed, the FTC_Face_Requester to translate them into new FT_Face objects.

    If the content of a given face ID changes at runtime, or if the value becomes invalid (e.g., when uninstalling a font), you should immediately call FTC_Manager_RemoveFaceID before any other cache function.

    Failure to do so will result in incorrect behaviour or even memory leaks and crashes.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_Face_Requester

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    +
    + + +
    +

    FTC_Face_Requester

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       typedef FT_Error
       (*FTC_Face_Requester)( FTC_FaceID  face_id,
                              FT_Library  library,
    -                         FT_Pointer  request_data,
    +                         FT_Pointer  req_data,
                              FT_Face*    aface );
    +
    -

    -

    A callback function provided by client applications. It is used by the cache manager to translate a given FTC_FaceID into a new valid FT_Face object, on demand.

    -

    -
    input
    -

    - -
    face_id + +

    input

    + + - -
    face_id

    The face ID to resolve.

    library +
    library

    A handle to a FreeType library object.

    req_data +
    req_data

    Application-provided request data (see note below).

    -
    -
    output
    -

    - -
    aface + +

    output

    + +
    aface

    A new FT_Face handle.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The third parameter ‘req_data’ is the same as the one passed by the client when FTC_Manager_New is called.

    The face requester should not perform funny things on the returned face object, like creating a new FT_Size for it, or setting a transformation through FT_Set_Transform!

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_Node

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    -  typedef struct FTC_NodeRec_*  FTC_Node;
    -
    -

    -
    -

    An opaque handle to a cache node object. Each cache node is reference-counted. A node with a count of 0 might be flushed out of a full cache whenever a lookup request is performed.

    -

    If you look up nodes, you have the ability to ‘acquire’ them, i.e., to increment their reference count. This will prevent the node from being flushed out of the cache until you explicitly ‘release’ it (see FTC_Node_Unref).

    -

    See also FTC_SBitCache_Lookup and FTC_ImageCache_Lookup.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_Manager_New

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
    +
    + +
    +

    FTC_Manager_New

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       FT_EXPORT( FT_Error )
       FTC_Manager_New( FT_Library          library,
                        FT_UInt             max_faces,
    @@ -209,463 +228,574 @@ Defined in FT_CACHE_H (ftcache.h).
                        FTC_Face_Requester  requester,
                        FT_Pointer          req_data,
                        FTC_Manager        *amanager );
    +
    -

    -

    Create a new cache manager.

    -

    -
    input
    -

    - -
    library + +

    input

    + + - - - - -
    library

    The parent FreeType library handle to use.

    max_faces +
    max_faces

    Maximum number of opened FT_Face objects managed by this cache instance. Use 0 for defaults.

    max_sizes +
    max_sizes

    Maximum number of opened FT_Size objects managed by this cache instance. Use 0 for defaults.

    max_bytes +
    max_bytes

    Maximum number of bytes to use for cached data nodes. Use 0 for defaults. Note that this value does not account for managed FT_Face and FT_Size objects.

    requester +
    requester

    An application-provided callback used to translate face IDs into real FT_Face objects.

    req_data +
    req_data

    A generic pointer that is passed to the requester each time it is called (see FTC_Face_Requester).

    -
    -
    output
    -

    - -
    amanager + +

    output

    + +
    amanager

    A handle to a new manager object. 0 in case of failure.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_Manager_Reset

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    +
    + + +
    +

    FTC_Manager_Reset

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       FT_EXPORT( void )
       FTC_Manager_Reset( FTC_Manager  manager );
    +
    -

    -

    Empty a given cache manager. This simply gets rid of all the currently cached FT_Face and FT_Size objects within the manager.

    -

    -
    inout
    -

    - -
    manager + +

    inout

    + +
    manager

    A handle to the manager.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_Manager_Done

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    +
    + + +
    +

    FTC_Manager_Done

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       FT_EXPORT( void )
       FTC_Manager_Done( FTC_Manager  manager );
    +
    -

    -

    Destroy a given manager after emptying it.

    -

    -
    input
    -

    - -
    manager + +

    input

    + +
    manager

    A handle to the target cache manager object.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_Manager_LookupFace

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    +
    + + +
    +

    FTC_Manager_LookupFace

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       FT_EXPORT( FT_Error )
       FTC_Manager_LookupFace( FTC_Manager  manager,
                               FTC_FaceID   face_id,
                               FT_Face     *aface );
    +
    -

    -

    Retrieve the FT_Face object that corresponds to a given face ID through a cache manager.

    -

    -
    input
    -

    - -
    manager + +

    input

    + + -
    manager

    A handle to the cache manager.

    face_id +
    face_id

    The ID of the face object.

    -
    -
    output
    -

    - -
    aface + +

    output

    + +
    aface

    A handle to the face object.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The returned FT_Face object is always owned by the manager. You should never try to discard it yourself.

    The FT_Face object doesn't necessarily have a current size object (i.e., face->size can be 0). If you need a specific ‘font size’, use FTC_Manager_LookupSize instead.

    Never change the face's transformation matrix (i.e., never call the FT_Set_Transform function) on a returned face! If you need to transform glyphs, do it yourself after glyph loading.

    When you perform a lookup, out-of-memory errors are detected within the lookup and force incremental flushes of the cache until enough memory is released for the lookup to succeed.

    If a lookup fails with ‘FT_Err_Out_Of_Memory’ the cache has already been completely flushed, and still no memory was available for the operation.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_ScalerRec

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    -  typedef struct  FTC_ScalerRec_
    -  {
    -    FTC_FaceID  face_id;
    -    FT_UInt     width;
    -    FT_UInt     height;
    -    FT_Int      pixel;
    -    FT_UInt     x_res;
    -    FT_UInt     y_res;
    -
    -  } FTC_ScalerRec;
    -
    -

    -
    -

    A structure used to describe a given character size in either pixels or points to the cache manager. See FTC_Manager_LookupSize.

    -

    -
    fields
    -

    - - - - - - - -
    face_id -

    The source face ID.

    -
    width -

    The character width.

    -
    height -

    The character height.

    -
    pixel -

    A Boolean. If 1, the ‘width’ and ‘height’ fields are interpreted as integer pixel character sizes. Otherwise, they are expressed as 1/64th of points.

    -
    x_res -

    Only used when ‘pixel’ is value 0 to indicate the horizontal resolution in dpi.

    -
    y_res -

    Only used when ‘pixel’ is value 0 to indicate the vertical resolution in dpi.

    -
    -
    -
    note
    -

    This type is mainly used to retrieve FT_Size objects through the cache manager.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_Scaler

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
    -
    -  typedef struct FTC_ScalerRec_*  FTC_Scaler;
    -
    -

    -
    -

    A handle to an FTC_ScalerRec structure.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_Manager_LookupSize

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
    +
    + +
    +

    FTC_Manager_LookupSize

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       FT_EXPORT( FT_Error )
       FTC_Manager_LookupSize( FTC_Manager  manager,
                               FTC_Scaler   scaler,
                               FT_Size     *asize );
    +
    -

    -

    Retrieve the FT_Size object that corresponds to a given FTC_ScalerRec pointer through a cache manager.

    -

    -
    input
    -

    - -
    manager + +

    input

    + + -
    manager

    A handle to the cache manager.

    scaler +
    scaler

    A scaler handle.

    -
    -
    output
    -

    - -
    asize + +

    output

    + +
    asize

    A handle to the size object.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The returned FT_Size object is always owned by the manager. You should never try to discard it by yourself.

    You can access the parent FT_Face object simply as ‘size->face’ if you need it. Note that this object is also owned by the manager.

    -
    -
    note
    + +

    note

    When you perform a lookup, out-of-memory errors are detected within the lookup and force incremental flushes of the cache until enough memory is released for the lookup to succeed.

    If a lookup fails with ‘FT_Err_Out_Of_Memory’ the cache has already been completely flushed, and still no memory is available for the operation.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_Node_Unref

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    +
    + + +
    +

    FTC_Manager_RemoveFaceID

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
    +  FT_EXPORT( void )
    +  FTC_Manager_RemoveFaceID( FTC_Manager  manager,
    +                            FTC_FaceID   face_id );
    +
    + +

    A special function used to indicate to the cache manager that a given FTC_FaceID is no longer valid, either because its content changed, or because it was deallocated or uninstalled.

    + +

    input

    + + + +
    manager +

    The cache manager handle.

    +
    face_id +

    The FTC_FaceID to be removed.

    +
    + +

    note

    +

    This function flushes all nodes from the cache corresponding to this ‘face_id’, with the exception of nodes with a non-null reference count.

    +

    Such nodes are however modified internally so as to never appear in later lookups with the same ‘face_id’ value, and to be immediately destroyed when released by all their users.

    + +
    +
    + +
    +

    FTC_Node

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
    +  typedef struct FTC_NodeRec_*  FTC_Node;
    +
    + +

    An opaque handle to a cache node object. Each cache node is reference-counted. A node with a count of 0 might be flushed out of a full cache whenever a lookup request is performed.

    +

    If you look up nodes, you have the ability to ‘acquire’ them, i.e., to increment their reference count. This will prevent the node from being flushed out of the cache until you explicitly ‘release’ it (see FTC_Node_Unref).

    +

    See also FTC_SBitCache_Lookup and FTC_ImageCache_Lookup.

    + +
    +
    + +
    +

    FTC_Node_Unref

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       FT_EXPORT( void )
       FTC_Node_Unref( FTC_Node     node,
                       FTC_Manager  manager );
    +
    -

    -

    Decrement a cache node's internal reference count. When the count reaches 0, it is not destroyed but becomes eligible for subsequent cache flushes.

    -

    -
    input
    -

    - -
    node + +

    input

    + + -
    node

    The cache node handle.

    manager +
    manager

    The cache manager handle.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_Manager_RemoveFaceID

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    -  FT_EXPORT( void )
    -  FTC_Manager_RemoveFaceID( FTC_Manager  manager,
    -                            FTC_FaceID   face_id );
    +
    + -

    -
    -

    A special function used to indicate to the cache manager that a given FTC_FaceID is no longer valid, either because its content changed, or because it was deallocated or uninstalled.

    -

    -
    input
    -

    - -
    manager -

    The cache manager handle.

    +
    +

    FTC_ImageCache

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
    +  typedef struct FTC_ImageCacheRec_*  FTC_ImageCache;
    +
    + +

    A handle to a glyph image cache object. They are designed to hold many distinct glyph images while not exceeding a certain memory threshold.

    + +
    +
    + +
    +

    FTC_ImageCache_New

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FTC_ImageCache_New( FTC_Manager      manager,
    +                      FTC_ImageCache  *acache );
    +
    + +

    Create a new glyph image cache.

    + +

    input

    + + -
    manager +

    The parent manager for the image cache.

    face_id -

    The FTC_FaceID to be removed.

    +
    + +

    output

    + +
    acache +

    A handle to the new glyph image cache object.

    -
    -
    note
    -

    This function flushes all nodes from the cache corresponding to this ‘face_id’, with the exception of nodes with a non-null reference count.

    -

    Such nodes are however modified internally so as to never appear in later lookups with the same ‘face_id’ value, and to be immediately destroyed when released by all their users.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_CMapCache

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    +

    return

    +

    FreeType error code. 0 means success.

    + +
    + + +
    +

    FTC_ImageCache_Lookup

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FTC_ImageCache_Lookup( FTC_ImageCache  cache,
    +                         FTC_ImageType   type,
    +                         FT_UInt         gindex,
    +                         FT_Glyph       *aglyph,
    +                         FTC_Node       *anode );
    +
    + +

    Retrieve a given glyph image from a glyph image cache.

    + +

    input

    + + + + +
    cache +

    A handle to the source glyph image cache.

    +
    type +

    A pointer to a glyph image type descriptor.

    +
    gindex +

    The glyph index to retrieve.

    +
    + +

    output

    + + + +
    aglyph +

    The corresponding FT_Glyph object. 0 in case of failure.

    +
    anode +

    Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).

    +
    + +

    return

    +

    FreeType error code. 0 means success.

    + +

    note

    +

    The returned glyph is owned and managed by the glyph image cache. Never try to transform or discard it manually! You can however create a copy with FT_Glyph_Copy and modify the new one.

    +

    If ‘anode’ is not NULL, it receives the address of the cache node containing the glyph image, after increasing its reference count. This ensures that the node (as well as the FT_Glyph) will always be kept in the cache until you call FTC_Node_Unref to ‘release’ it.

    +

    If ‘anode’ is NULL, the cache node is left unchanged, which means that the FT_Glyph could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!

    + +
    +
    + +
    +

    FTC_SBit

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
    +  typedef struct FTC_SBitRec_*  FTC_SBit;
    +
    + +

    A handle to a small bitmap descriptor. See the FTC_SBitRec structure for details.

    + +
    +
    + +
    +

    FTC_SBitCache

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
    +  typedef struct FTC_SBitCacheRec_*  FTC_SBitCache;
    +
    + +

    A handle to a small bitmap cache. These are special cache objects used to store small glyph bitmaps (and anti-aliased pixmaps) in a much more efficient way than the traditional glyph image cache implemented by FTC_ImageCache.

    + +
    +
    + +
    +

    FTC_SBitCache_New

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FTC_SBitCache_New( FTC_Manager     manager,
    +                     FTC_SBitCache  *acache );
    +
    + +

    Create a new cache to store small glyph bitmaps.

    + +

    input

    + + +
    manager +

    A handle to the source cache manager.

    +
    + +

    output

    + + +
    acache +

    A handle to the new sbit cache. NULL in case of error.

    +
    + +

    return

    +

    FreeType error code. 0 means success.

    + +
    +
    + +
    +

    FTC_SBitCache_Lookup

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FTC_SBitCache_Lookup( FTC_SBitCache    cache,
    +                        FTC_ImageType    type,
    +                        FT_UInt          gindex,
    +                        FTC_SBit        *sbit,
    +                        FTC_Node        *anode );
    +
    + +

    Look up a given small glyph bitmap in a given sbit cache and ‘lock’ it to prevent its flushing from the cache until needed.

    + +

    input

    + + + + +
    cache +

    A handle to the source sbit cache.

    +
    type +

    A pointer to the glyph image type descriptor.

    +
    gindex +

    The glyph index.

    +
    + +

    output

    + + + +
    sbit +

    A handle to a small bitmap descriptor.

    +
    anode +

    Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).

    +
    + +

    return

    +

    FreeType error code. 0 means success.

    + +

    note

    +

    The small bitmap descriptor and its bit buffer are owned by the cache and should never be freed by the application. They might as well disappear from memory on the next cache lookup, so don't treat them as persistent data.

    +

    The descriptor's ‘buffer’ field is set to 0 to indicate a missing glyph bitmap.

    +

    If ‘anode’ is not NULL, it receives the address of the cache node containing the bitmap, after increasing its reference count. This ensures that the node (as well as the image) will always be kept in the cache until you call FTC_Node_Unref to ‘release’ it.

    +

    If ‘anode’ is NULL, the cache node is left unchanged, which means that the bitmap could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!

    + +
    +
    + +
    +

    FTC_CMapCache

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       typedef struct FTC_CMapCacheRec_*  FTC_CMapCache;
    +
    -

    -

    An opaque handle used to model a charmap cache. This cache is to hold character codes -> glyph indices mappings.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_CMapCache_New

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    +
    + + +
    +

    FTC_CMapCache_New

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       FT_EXPORT( FT_Error )
       FTC_CMapCache_New( FTC_Manager     manager,
                          FTC_CMapCache  *acache );
    +
    -

    -

    Create a new charmap cache.

    -

    -
    input
    -

    - -
    manager + +

    input

    + +
    manager

    A handle to the cache manager.

    -
    -
    output
    -

    - -
    acache + +

    output

    + +
    acache

    A new cache handle. NULL in case of error.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    Like all other caches, this one will be destroyed with the cache manager.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_CMapCache_Lookup

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    +
    + + +
    +

    FTC_CMapCache_Lookup

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       FT_EXPORT( FT_UInt )
       FTC_CMapCache_Lookup( FTC_CMapCache  cache,
                             FTC_FaceID     face_id,
                             FT_Int         cmap_index,
                             FT_UInt32      char_code );
    +
    -

    -

    Translate a character code into a glyph index, using the charmap cache.

    -

    -
    input
    -

    - -
    cache + +

    input

    + + - - -
    cache

    A charmap cache handle.

    face_id +
    face_id

    The source face ID.

    cmap_index +
    cmap_index

    The index of the charmap in the source face. Any negative value means to use the cache FT_Face's default charmap.

    char_code +
    char_code

    The character code (in the corresponding charmap).

    -
    -
    return
    + +

    return

    Glyph index. 0 means ‘no glyph’.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_ImageTypeRec

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    +
    + + +
    +

    FTC_ScalerRec

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
    +  typedef struct  FTC_ScalerRec_
    +  {
    +    FTC_FaceID  face_id;
    +    FT_UInt     width;
    +    FT_UInt     height;
    +    FT_Int      pixel;
    +    FT_UInt     x_res;
    +    FT_UInt     y_res;
    +
    +  } FTC_ScalerRec;
    +
    + +

    A structure used to describe a given character size in either pixels or points to the cache manager. See FTC_Manager_LookupSize.

    + +

    fields

    + + + + + + + +
    face_id +

    The source face ID.

    +
    width +

    The character width.

    +
    height +

    The character height.

    +
    pixel +

    A Boolean. If 1, the ‘width’ and ‘height’ fields are interpreted as integer pixel character sizes. Otherwise, they are expressed as 1/64th of points.

    +
    x_res +

    Only used when ‘pixel’ is value 0 to indicate the horizontal resolution in dpi.

    +
    y_res +

    Only used when ‘pixel’ is value 0 to indicate the vertical resolution in dpi.

    +
    + +

    note

    +

    This type is mainly used to retrieve FT_Size objects through the cache manager.

    + +
    +
    + +
    +

    FTC_Scaler

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
    +  typedef struct FTC_ScalerRec_*  FTC_Scaler;
    +
    + +

    A handle to an FTC_ScalerRec structure.

    + +
    +
    + +
    +

    FTC_ImageTypeRec

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       typedef struct  FTC_ImageTypeRec_
       {
         FTC_FaceID  face_id;
    @@ -674,176 +804,45 @@ Defined in FT_CACHE_H (ftcache.h).
         FT_Int32    flags;
     
       } FTC_ImageTypeRec;
    +
    -

    -

    A structure used to model the type of images in a glyph cache.

    -

    -
    fields
    -

    - -
    face_id + +

    fields

    + + - - -
    face_id

    The face ID.

    width +
    width

    The width in pixels.

    height +
    height

    The height in pixels.

    flags +
    flags

    The load flags, as in FT_Load_Glyph.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_ImageType

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    +
    + + +
    +

    FTC_ImageType

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       typedef struct FTC_ImageTypeRec_*  FTC_ImageType;
    +
    -

    -

    A handle to an FTC_ImageTypeRec structure.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_ImageCache

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    -  typedef struct FTC_ImageCacheRec_*  FTC_ImageCache;
    -
    -

    -
    -

    A handle to a glyph image cache object. They are designed to hold many distinct glyph images while not exceeding a certain memory threshold.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_ImageCache_New

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
    -
    -  FT_EXPORT( FT_Error )
    -  FTC_ImageCache_New( FTC_Manager      manager,
    -                      FTC_ImageCache  *acache );
    -
    -

    -
    -

    Create a new glyph image cache.

    -

    -
    input
    -

    - - -
    manager -

    The parent manager for the image cache.

    -
    -
    -
    output
    -

    - - -
    acache -

    A handle to the new glyph image cache object.

    -
    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_ImageCache_Lookup

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
    -
    -  FT_EXPORT( FT_Error )
    -  FTC_ImageCache_Lookup( FTC_ImageCache  cache,
    -                         FTC_ImageType   type,
    -                         FT_UInt         gindex,
    -                         FT_Glyph       *aglyph,
    -                         FTC_Node       *anode );
    -
    -

    -
    -

    Retrieve a given glyph image from a glyph image cache.

    -

    -
    input
    -

    - - - - -
    cache -

    A handle to the source glyph image cache.

    -
    type -

    A pointer to a glyph image type descriptor.

    -
    gindex -

    The glyph index to retrieve.

    -
    -
    -
    output
    -

    - - - -
    aglyph -

    The corresponding FT_Glyph object. 0 in case of failure.

    -
    anode -

    Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).

    -
    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    The returned glyph is owned and managed by the glyph image cache. Never try to transform or discard it manually! You can however create a copy with FT_Glyph_Copy and modify the new one.

    -

    If ‘anode’ is not NULL, it receives the address of the cache node containing the glyph image, after increasing its reference count. This ensures that the node (as well as the FT_Glyph) will always be kept in the cache until you call FTC_Node_Unref to ‘release’ it.

    -

    If ‘anode’ is NULL, the cache node is left unchanged, which means that the FT_Glyph could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_ImageCache_LookupScaler

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
    +
    + +
    +

    FTC_ImageCache_LookupScaler

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       FT_EXPORT( FT_Error )
       FTC_ImageCache_LookupScaler( FTC_ImageCache  cache,
                                    FTC_Scaler      scaler,
    @@ -851,80 +850,52 @@ Defined in FT_CACHE_H (ftcache.h).
                                    FT_UInt         gindex,
                                    FT_Glyph       *aglyph,
                                    FTC_Node       *anode );
    +
    -

    -

    A variant of FTC_ImageCache_Lookup that uses an FTC_ScalerRec to specify the face ID and its size.

    -

    -
    input
    -

    - -
    cache + +

    input

    + + - - -
    cache

    A handle to the source glyph image cache.

    scaler +
    scaler

    A pointer to a scaler descriptor.

    load_flags +
    load_flags

    The corresponding load flags.

    gindex +
    gindex

    The glyph index to retrieve.

    -
    -
    output
    -

    - -
    aglyph + +

    output

    + + -
    aglyph

    The corresponding FT_Glyph object. 0 in case of failure.

    anode +
    anode

    Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The returned glyph is owned and managed by the glyph image cache. Never try to transform or discard it manually! You can however create a copy with FT_Glyph_Copy and modify the new one.

    If ‘anode’ is not NULL, it receives the address of the cache node containing the glyph image, after increasing its reference count. This ensures that the node (as well as the FT_Glyph) will always be kept in the cache until you call FTC_Node_Unref to ‘release’ it.

    If ‘anode’ is NULL, the cache node is left unchanged, which means that the FT_Glyph could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!

    Calls to FT_Set_Char_Size and friends have no effect on cached glyphs; you should always use the FreeType cache API instead.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_SBit

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    -  typedef struct FTC_SBitRec_*  FTC_SBit;
    -
    -

    -
    -

    A handle to a small bitmap descriptor. See the FTC_SBitRec structure for details.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_SBitRec

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
    +
    + +
    +

    FTC_SBitRec

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       typedef struct  FTC_SBitRec_
       {
         FT_Byte   width;
    @@ -941,176 +912,51 @@ Defined in FT_CACHE_H (ftcache.h).
         FT_Byte*  buffer;
     
       } FTC_SBitRec;
    +
    -

    -

    A very compact structure used to describe a small glyph bitmap.

    -

    -
    fields
    -

    - -
    width + +

    fields

    + + - - - - - - - - -
    width

    The bitmap width in pixels.

    height +
    height

    The bitmap height in pixels.

    left +
    left

    The horizontal distance from the pen position to the left bitmap border (a.k.a. ‘left side bearing’, or ‘lsb’).

    top +
    top

    The vertical distance from the pen position (on the baseline) to the upper bitmap border (a.k.a. ‘top side bearing’). The distance is positive for upwards y coordinates.

    format +
    format

    The format of the glyph bitmap (monochrome or gray).

    max_grays +
    max_grays

    Maximum gray level value (in the range 1 to 255).

    pitch +
    pitch

    The number of bytes per bitmap line. May be positive or negative.

    xadvance +
    xadvance

    The horizontal advance width in pixels.

    yadvance +
    yadvance

    The vertical advance height in pixels.

    buffer +
    buffer

    A pointer to the bitmap pixels.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_SBitCache

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
    -
    -  typedef struct FTC_SBitCacheRec_*  FTC_SBitCache;
    -
    -

    -
    -

    A handle to a small bitmap cache. These are special cache objects used to store small glyph bitmaps (and anti-aliased pixmaps) in a much more efficient way than the traditional glyph image cache implemented by FTC_ImageCache.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_SBitCache_New

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
    -
    -  FT_EXPORT( FT_Error )
    -  FTC_SBitCache_New( FTC_Manager     manager,
    -                     FTC_SBitCache  *acache );
    -
    -

    -
    -

    Create a new cache to store small glyph bitmaps.

    -

    -
    input
    -

    - - -
    manager -

    A handle to the source cache manager.

    -
    -
    -
    output
    -

    - - -
    acache -

    A handle to the new sbit cache. NULL in case of error.

    -
    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_SBitCache_Lookup

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
     
    -  FT_EXPORT( FT_Error )
    -  FTC_SBitCache_Lookup( FTC_SBitCache    cache,
    -                        FTC_ImageType    type,
    -                        FT_UInt          gindex,
    -                        FTC_SBit        *sbit,
    -                        FTC_Node        *anode );
    -
    -

    -
    -

    Look up a given small glyph bitmap in a given sbit cache and ‘lock’ it to prevent its flushing from the cache until needed.

    -

    -
    input
    -

    - - - - -
    cache -

    A handle to the source sbit cache.

    -
    type -

    A pointer to the glyph image type descriptor.

    -
    gindex -

    The glyph index.

    -
    -
    -
    output
    -

    - - - -
    sbit -

    A handle to a small bitmap descriptor.

    -
    anode -

    Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).

    -
    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    The small bitmap descriptor and its bit buffer are owned by the cache and should never be freed by the application. They might as well disappear from memory on the next cache lookup, so don't treat them as persistent data.

    -

    The descriptor's ‘buffer’ field is set to 0 to indicate a missing glyph bitmap.

    -

    If ‘anode’ is not NULL, it receives the address of the cache node containing the bitmap, after increasing its reference count. This ensures that the node (as well as the image) will always be kept in the cache until you call FTC_Node_Unref to ‘release’ it.

    -

    If ‘anode’ is NULL, the cache node is left unchanged, which means that the bitmap could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FTC_SBitCache_LookupScaler

    -
    -Defined in FT_CACHE_H (ftcache.h). -

    -
    +
    + +
    +

    FTC_SBitCache_LookupScaler

    +

    Defined in FT_CACHE_H (ftcache.h).

    +
       FT_EXPORT( FT_Error )
       FTC_SBitCache_LookupScaler( FTC_SBitCache  cache,
                                   FTC_Scaler     scaler,
    @@ -1118,53 +964,47 @@ Defined in FT_CACHE_H (ftcache.h).
                                   FT_UInt        gindex,
                                   FTC_SBit      *sbit,
                                   FTC_Node      *anode );
    +
    -

    -

    A variant of FTC_SBitCache_Lookup that uses an FTC_ScalerRec to specify the face ID and its size.

    -

    -
    input
    -

    - -
    cache + +

    input

    + + - - -
    cache

    A handle to the source sbit cache.

    scaler +
    scaler

    A pointer to the scaler descriptor.

    load_flags +
    load_flags

    The corresponding load flags.

    gindex +
    gindex

    The glyph index.

    -
    -
    output
    -

    - -
    sbit + +

    output

    + + -
    sbit

    A handle to a small bitmap descriptor.

    anode +
    anode

    Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The small bitmap descriptor and its bit buffer are owned by the cache and should never be freed by the application. They might as well disappear from memory on the next cache lookup, so don't treat them as persistent data.

    The descriptor's ‘buffer’ field is set to 0 to indicate a missing glyph bitmap.

    If ‘anode’ is not NULL, it receives the address of the cache node containing the bitmap, after increasing its reference count. This ensures that the node (as well as the image) will always be kept in the cache until you call FTC_Node_Unref to ‘release’ it.

    If ‘anode’ is NULL, the cache node is left unchanged, which means that the bitmap could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-cff_driver.html b/freetype/docs/reference/ft2-cff_driver.html index 7ae308de6..f1de5661a 100644 --- a/freetype/docs/reference/ft2-cff_driver.html +++ b/freetype/docs/reference/ft2-cff_driver.html @@ -3,50 +3,113 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -The CFF driver -

    +

    The CFF driver

    Synopsis

    - - - -
    hinting-engineno-stem-darkening
    FT_CFF_HINTING_XXXdarkening-parameters


    + + + +
    hinting-enginedarkening-parametersFT_CFF_HINTING_XXX
    no-stem-darkening 
    + -

    While FreeType's CFF driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get. The list below gives the available properties together with the necessary macros and structures.

    The CFF driver's module name is ‘cff’.

    Hinting and antialiasing principles of the new engine

    @@ -57,10 +120,10 @@ The CFF driver

    2) Aligment in the vertical direction: Weights and spacing along the y axis are less critical; what is much more important is the visual alignment of related features (like cap-height and x-height). The sense of alignment for these is enhanced by the sharpness of grid-fit edges, while the cruder vertical resolution (full pixels instead of 1/3 pixels) is less of a problem.

    On the technical side, horizontal alignment zones for ascender, x-height, and other important height values (traditionally called ‘blue zones’) as defined in the font are positioned independently, each being rounded to the nearest pixel edge, taking care of overshoot suppression at small sizes, stem darkening, and scaling.

    Hstems (this is, hint values defined in the font to help align horizontal features) that fall within a blue zone are said to be ‘captured’ and are aligned to that zone. Uncaptured stems are moved in one of four ways, top edge up or down, bottom edge up or down. Unless there are conflicting hstems, the smallest movement is taken to minimize distortion.

    -

    -
    -

    hinting-engine

    -
    + +
    +

    hinting-engine

    +

    Thanks to Adobe, which contributed a new hinting (and parsing) engine, an application can select between ‘freetype’ and ‘adobe’ if compiled with CFF_CONFIG_OPTION_OLD_ENGINE. If this configuration macro isn't defined, ‘hinting-engine’ does nothing.

    The default engine is ‘freetype’ if CFF_CONFIG_OPTION_OLD_ENGINE is defined, and ‘adobe’ otherwise.

    The following example code demonstrates how to select Adobe's hinting engine (omitting the error handling).

    @@ -74,51 +137,16 @@ The CFF driver FT_Property_Set( library, "cff", "hinting-engine", &hinting_engine ); -

    -
    note
    + +

    note

    This property can be used with FT_Property_Get also.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_CFF_HINTING_XXX

    -
    -Defined in FT_CFF_DRIVER_H (ftcffdrv.h). -

    -
    -
    -#define FT_CFF_HINTING_FREETYPE  0
    -#define FT_CFF_HINTING_ADOBE     1
    -
    -

    -
    -

    A list of constants used for the hinting-engine property to select the hinting engine for CFF fonts.

    -

    -
    values
    -

    - - - - -
    FT_CFF_HINTING_FREETYPE
    -

    Use the old FreeType hinting engine.

    -
    FT_CFF_HINTING_ADOBE -

    Use the hinting engine contributed by Adobe.

    -
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    no-stem-darkening

    -
    + +
    + + +
    +

    no-stem-darkening

    +

    By default, the Adobe CFF engine darkens stems at smaller sizes, regardless of hinting, to enhance contrast. This feature requires a rendering system with proper gamma correction. Setting this property, stem darkening gets switched off.

    Note that stem darkening is never applied if FT_LOAD_NO_SCALE is set.

    @@ -131,19 +159,16 @@ Defined in FT_CFF_DRIVER_H (ftcffdrv.h).
       FT_Property_Set( library, "cff",
                                 "no-stem-darkening", &no_stem_darkening );
     
    -

    -
    note
    + +

    note

    This property can be used with FT_Property_Get also.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    darkening-parameters

    -
    + +
    + + +
    +

    darkening-parameters

    +

    By default, the Adobe CFF engine darkens stems as follows (if the ‘no-stem-darkening’ property isn't set):

       stem width <= 0.5px:   darkening amount = 0.4px
    @@ -151,7 +176,7 @@ Defined in FT_CFF_DRIVER_H (ftcffdrv.h).
       stem width  = 1.667px: darkening amount = 0.275px
       stem width >= 2.333px: darkening amount = 0px
     
    -

    and piecewise linear in-between. Using the ‘darkening-parameters’ property, these four control points can be changed, as the following example demonstrates.

    +

    and piecewise linear in-between. At configuration time, these four control points can be set with the macro ‘CFF_CONFIG_OPTION_DARKENING_PARAMETERS’. At runtime, the control points can be changed using the ‘darkening-parameters’ property, as the following example demonstrates.

       FT_Library  library;
       FT_Int      darken_params[8] = {  500, 300,   // x1, y1
    @@ -166,15 +191,35 @@ Defined in FT_CFF_DRIVER_H (ftcffdrv.h).
                                 "darkening-parameters", darken_params );
     

    The x values give the stem width, and the y values the darkening amount. The unit is 1000th of pixels. All coordinate values must be positive; the x values must be monotonically increasing; the y values must be monotonically decreasing and smaller than or equal to 500 (corresponding to half a pixel); the slope of each linear piece must be shallower than -1 (e.g., -.4).

    -

    -
    note
    + +

    note

    This property can be used with FT_Property_Get also.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + + +
    +

    FT_CFF_HINTING_XXX

    +

    Defined in FT_CFF_DRIVER_H (ftcffdrv.h).

    +
    +#define FT_CFF_HINTING_FREETYPE  0
    +#define FT_CFF_HINTING_ADOBE     1
    +
    + +

    A list of constants used for the hinting-engine property to select the hinting engine for CFF fonts.

    + +

    values

    + + + +
    FT_CFF_HINTING_FREETYPE +

    Use the old FreeType hinting engine.

    +
    FT_CFF_HINTING_ADOBE +

    Use the hinting engine contributed by Adobe.

    +
    + +
    +
    diff --git a/freetype/docs/reference/ft2-cid_fonts.html b/freetype/docs/reference/ft2-cid_fonts.html index 2e2c4cf80..cb0b506fe 100644 --- a/freetype/docs/reference/ft2-cid_fonts.html +++ b/freetype/docs/reference/ft2-cid_fonts.html @@ -3,202 +3,238 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -CID Fonts -

    +

    CID Fonts

    Synopsis

    - - - - -
    FT_Get_CID_Registry_Ordering_Supplement
    FT_Get_CID_Is_Internally_CID_Keyed
    FT_Get_CID_From_Glyph_Index


    + + + + +
    FT_Get_CID_Registry_Ordering_Supplement
    FT_Get_CID_Is_Internally_CID_Keyed
    FT_Get_CID_From_Glyph_Index
    + -

    This section contains the declaration of CID-keyed font specific functions.

    -

    -
    -

    FT_Get_CID_Registry_Ordering_Supplement

    -
    -Defined in FT_CID_H (ftcid.h). -

    -
     
    +
    +

    FT_Get_CID_Registry_Ordering_Supplement

    +

    Defined in FT_CID_H (ftcid.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_CID_Registry_Ordering_Supplement( FT_Face       face,
                                                const char*  *registry,
                                                const char*  *ordering,
                                                FT_Int       *supplement);
    +
    -

    -

    Retrieve the Registry/Ordering/Supplement triple (also known as the "R/O/S") from a CID-keyed font.

    -

    -
    input
    -

    - -
    face + +

    input

    + +
    face

    A handle to the input face.

    -
    -
    output
    -

    - -
    registry + +

    output

    + + - -
    registry

    The registry, as a C string, owned by the face.

    ordering +
    ordering

    The ordering, as a C string, owned by the face.

    supplement +
    supplement

    The supplement.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function only works with CID faces, returning an error otherwise.

    -
    -
    since
    + +

    since

    2.3.6

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_CID_Is_Internally_CID_Keyed

    -
    -Defined in FT_CID_H (ftcid.h). -

    -
     
    +
    + + +
    +

    FT_Get_CID_Is_Internally_CID_Keyed

    +

    Defined in FT_CID_H (ftcid.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_CID_Is_Internally_CID_Keyed( FT_Face   face,
                                           FT_Bool  *is_cid );
    +
    -

    -

    Retrieve the type of the input face, CID keyed or not. In constrast to the FT_IS_CID_KEYED macro this function returns successfully also for CID-keyed fonts in an SNFT wrapper.

    -

    -
    input
    -

    - -
    face + +

    input

    + +
    face

    A handle to the input face.

    -
    -
    output
    -

    - -
    is_cid + +

    output

    + +
    is_cid

    The type of the face as an FT_Bool.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function only works with CID faces and OpenType fonts, returning an error otherwise.

    -
    -
    since
    + +

    since

    2.3.9

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_CID_From_Glyph_Index

    -
    -Defined in FT_CID_H (ftcid.h). -

    -
     
    +
    + + +
    +

    FT_Get_CID_From_Glyph_Index

    +

    Defined in FT_CID_H (ftcid.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_CID_From_Glyph_Index( FT_Face   face,
                                    FT_UInt   glyph_index,
                                    FT_UInt  *cid );
    +
    -

    -

    Retrieve the CID of the input glyph index.

    -

    -
    input
    -

    - -
    face + +

    input

    + + -
    face

    A handle to the input face.

    glyph_index +
    glyph_index

    The input glyph index.

    -
    -
    output
    -

    - -
    cid + +

    output

    + +
    cid

    The CID as an FT_UInt.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function only works with CID faces and OpenType fonts, returning an error otherwise.

    -
    -
    since
    + +

    since

    2.3.9

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-computations.html b/freetype/docs/reference/ft2-computations.html index 3bee10452..a7771ef41 100644 --- a/freetype/docs/reference/ft2-computations.html +++ b/freetype/docs/reference/ft2-computations.html @@ -3,830 +3,698 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Computations -

    +

    Computations

    Synopsis

    - - - - - - - - - -
    FT_MulDivFT_Matrix_InvertFT_Tan
    FT_MulFixFT_AngleFT_Atan2
    FT_DivFixFT_ANGLE_PIFT_Angle_Diff
    FT_RoundFixFT_ANGLE_2PIFT_Vector_Unit
    FT_CeilFixFT_ANGLE_PI2FT_Vector_Rotate
    FT_FloorFixFT_ANGLE_PI4FT_Vector_Length
    FT_Vector_TransformFT_SinFT_Vector_Polarize
    FT_Matrix_MultiplyFT_CosFT_Vector_From_Polar


    - -
    + + + + + + + + + + +
    FT_MulDiv FT_Atan2
    FT_MulFixFT_AngleFT_Angle_Diff
    FT_DivFixFT_ANGLE_PIFT_Vector_Unit
    FT_RoundFixFT_ANGLE_2PIFT_Vector_Rotate
    FT_CeilFixFT_ANGLE_PI2FT_Vector_Length
    FT_FloorFixFT_ANGLE_PI4FT_Vector_Polarize
    FT_Vector_TransformFT_SinFT_Vector_From_Polar
    FT_Matrix_MultiplyFT_Cos
    FT_Matrix_InvertFT_Tan
    + +

    This section contains various functions used to perform computations on 16.16 fixed-float numbers or 2d vectors.

    -

    -
    -

    FT_MulDiv

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    +

    FT_MulDiv

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Long )
       FT_MulDiv( FT_Long  a,
                  FT_Long  b,
                  FT_Long  c );
    +
    -

    -

    A very simple function used to perform the computation ‘(a*b)/c’ with maximum accuracy (it uses a 64-bit intermediate integer whenever necessary).

    This function isn't necessarily as fast as some processor specific operations, but is at least completely portable.

    -

    -
    input
    -

    - -
    a + +

    input

    + + - -
    a

    The first multiplier.

    b +
    b

    The second multiplier.

    c +
    c

    The divisor.

    -
    -
    return
    + +

    return

    The result of ‘(a*b)/c’. This function never traps when trying to divide by zero; it simply returns ‘MaxInt’ or ‘MinInt’ depending on the signs of ‘a’ and ‘b’.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_MulFix

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_MulFix

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Long )
       FT_MulFix( FT_Long  a,
                  FT_Long  b );
    +
    -

    -

    A very simple function used to perform the computation ‘(a*b)/0x10000’ with maximum accuracy. Most of the time this is used to multiply a given value by a 16.16 fixed-point factor.

    -

    -
    input
    -

    - -
    a + +

    input

    + + -
    a

    The first multiplier.

    b +
    b

    The second multiplier. Use a 16.16 factor here whenever possible (see note below).

    -
    -
    return
    + +

    return

    The result of ‘(a*b)/0x10000’.

    -
    -
    note
    + +

    note

    This function has been optimized for the case where the absolute value of ‘a’ is less than 2048, and ‘b’ is a 16.16 scaling factor. As this happens mainly when scaling from notional units to fractional pixels in FreeType, it resulted in noticeable speed improvements between versions 2.x and 1.x.

    As a conclusion, always try to place a 16.16 factor as the second argument of this function; this can make a great difference.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_DivFix

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_DivFix

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Long )
       FT_DivFix( FT_Long  a,
                  FT_Long  b );
    +
    -

    -

    A very simple function used to perform the computation ‘(a*0x10000)/b’ with maximum accuracy. Most of the time, this is used to divide a given value by a 16.16 fixed-point factor.

    -

    -
    input
    -

    - -
    a -

    The first multiplier.

    + +

    input

    + + -
    a +

    The numerator.

    b -

    The second multiplier. Use a 16.16 factor here whenever possible (see note below).

    +
    b +

    The denominator. Use a 16.16 factor here.

    -
    -
    return
    + +

    return

    The result of ‘(a*0x10000)/b’.

    -
    -
    note
    -

    The optimization for FT_DivFix() is simple: If (a << 16) fits in 32 bits, then the division is computed directly. Otherwise, we use a specialized version of FT_MulDiv.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_RoundFix

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_RoundFix

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Fixed )
       FT_RoundFix( FT_Fixed  a );
    +
    -

    -

    A very simple function used to round a 16.16 fixed number.

    -

    -
    input
    -

    - -
    a + +

    input

    + +
    a

    The number to be rounded.

    -
    -
    return
    + +

    return

    The result of ‘(a + 0x8000) & -0x10000’.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_CeilFix

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_CeilFix

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Fixed )
       FT_CeilFix( FT_Fixed  a );
    +
    -

    -

    A very simple function used to compute the ceiling function of a 16.16 fixed number.

    -

    -
    input
    -

    - -
    a + +

    input

    + +
    a

    The number for which the ceiling function is to be computed.

    -
    -
    return
    + +

    return

    The result of ‘(a + 0x10000 - 1) & -0x10000’.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_FloorFix

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_FloorFix

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Fixed )
       FT_FloorFix( FT_Fixed  a );
    +
    -

    -

    A very simple function used to compute the floor function of a 16.16 fixed number.

    -

    -
    input
    -

    - -
    a + +

    input

    + +
    a

    The number for which the floor function is to be computed.

    -
    -
    return
    + +

    return

    The result of ‘a & -0x10000’.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Vector_Transform

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Vector_Transform

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( void )
       FT_Vector_Transform( FT_Vector*        vec,
                            const FT_Matrix*  matrix );
    +
    -

    -

    Transform a single vector through a 2x2 matrix.

    -

    -
    inout
    -

    - -
    vector + +

    inout

    + +
    vector

    The target vector to transform.

    -
    -
    input
    -

    - -
    matrix + +

    input

    + +
    matrix

    A pointer to the source 2x2 matrix.

    -
    -
    note
    + +

    note

    The result is undefined if either ‘vector’ or ‘matrix’ is invalid.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Matrix_Multiply

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_Matrix_Multiply

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       FT_EXPORT( void )
       FT_Matrix_Multiply( const FT_Matrix*  a,
                           FT_Matrix*        b );
    +
    -

    -

    Perform the matrix operation ‘b = a*b’.

    -

    -
    input
    -

    - -
    a + +

    input

    + +
    a

    A pointer to matrix ‘a’.

    -
    -
    inout
    -

    - -
    b + +

    inout

    + +
    b

    A pointer to matrix ‘b’.

    -
    -
    note
    + +

    note

    The result is undefined if either ‘a’ or ‘b’ is zero.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Matrix_Invert

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_Matrix_Invert

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       FT_EXPORT( FT_Error )
       FT_Matrix_Invert( FT_Matrix*  matrix );
    +
    -

    -

    Invert a 2x2 matrix. Return an error if it can't be inverted.

    -

    -
    inout
    -

    - -
    matrix + +

    inout

    + +
    matrix

    A pointer to the target matrix. Remains untouched in case of error.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Angle

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_Angle

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
       typedef FT_Fixed  FT_Angle;
    +
    -

    -

    This type is used to model angle values in FreeType. Note that the angle is a 16.16 fixed-point value expressed in degrees.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_ANGLE_PI

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_ANGLE_PI

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
     #define FT_ANGLE_PI  ( 180L << 16 )
    +
    -

    -

    The angle pi expressed in FT_Angle units.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_ANGLE_2PI

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_ANGLE_2PI

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
     #define FT_ANGLE_2PI  ( FT_ANGLE_PI * 2 )
    +
    -

    -

    The angle 2*pi expressed in FT_Angle units.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_ANGLE_PI2

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_ANGLE_PI2

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
     #define FT_ANGLE_PI2  ( FT_ANGLE_PI / 2 )
    +
    -

    -

    The angle pi/2 expressed in FT_Angle units.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_ANGLE_PI4

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_ANGLE_PI4

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
     #define FT_ANGLE_PI4  ( FT_ANGLE_PI / 4 )
    +
    -

    -

    The angle pi/4 expressed in FT_Angle units.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Sin

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_Sin

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
       FT_EXPORT( FT_Fixed )
       FT_Sin( FT_Angle  angle );
    +
    -

    -

    Return the sinus of a given angle in fixed-point format.

    -

    -
    input
    -

    - -
    angle + +

    input

    + +
    angle

    The input angle.

    -
    -
    return
    + +

    return

    The sinus value.

    -
    -
    note
    + +

    note

    If you need both the sinus and cosinus for a given angle, use the function FT_Vector_Unit.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Cos

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_Cos

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
       FT_EXPORT( FT_Fixed )
       FT_Cos( FT_Angle  angle );
    +
    -

    -

    Return the cosinus of a given angle in fixed-point format.

    -

    -
    input
    -

    - -
    angle + +

    input

    + +
    angle

    The input angle.

    -
    -
    return
    + +

    return

    The cosinus value.

    -
    -
    note
    + +

    note

    If you need both the sinus and cosinus for a given angle, use the function FT_Vector_Unit.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Tan

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_Tan

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
       FT_EXPORT( FT_Fixed )
       FT_Tan( FT_Angle  angle );
    +
    -

    -

    Return the tangent of a given angle in fixed-point format.

    -

    -
    input
    -

    - -
    angle + +

    input

    + +
    angle

    The input angle.

    -
    -
    return
    + +

    return

    The tangent value.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Atan2

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_Atan2

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
       FT_EXPORT( FT_Angle )
       FT_Atan2( FT_Fixed  x,
                 FT_Fixed  y );
    +
    -

    -

    Return the arc-tangent corresponding to a given vector (x,y) in the 2d plane.

    -

    -
    input
    -

    - -
    x + +

    input

    + + -
    x

    The horizontal vector coordinate.

    y +
    y

    The vertical vector coordinate.

    -
    -
    return
    + +

    return

    The arc-tangent value (i.e. angle).

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Angle_Diff

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_Angle_Diff

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
       FT_EXPORT( FT_Angle )
       FT_Angle_Diff( FT_Angle  angle1,
                      FT_Angle  angle2 );
    +
    -

    -

    Return the difference between two angles. The result is always constrained to the ]-PI..PI] interval.

    -

    -
    input
    -

    - -
    angle1 + +

    input

    + + -
    angle1

    First angle.

    angle2 +
    angle2

    Second angle.

    -
    -
    return
    + +

    return

    Constrained value of ‘value2-value1’.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Vector_Unit

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_Vector_Unit

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
       FT_EXPORT( void )
       FT_Vector_Unit( FT_Vector*  vec,
                       FT_Angle    angle );
    +
    -

    -

    Return the unit vector corresponding to a given angle. After the call, the value of ‘vec.x’ will be ‘sin(angle)’, and the value of ‘vec.y’ will be ‘cos(angle)’.

    This function is useful to retrieve both the sinus and cosinus of a given angle quickly.

    -

    -
    output
    -

    - -
    vec + +

    output

    + +
    vec

    The address of target vector.

    -
    -
    input
    -

    - -
    angle -

    The address of angle.

    + +

    input

    + +
    angle +

    The input angle.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Vector_Rotate

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_Vector_Rotate

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
       FT_EXPORT( void )
       FT_Vector_Rotate( FT_Vector*  vec,
                         FT_Angle    angle );
    +
    -

    -

    Rotate a vector by a given angle.

    -

    -
    inout
    -

    - -
    vec + +

    inout

    + +
    vec

    The address of target vector.

    -
    -
    input
    -

    - -
    angle -

    The address of angle.

    + +

    input

    + +
    angle +

    The input angle.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Vector_Length

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_Vector_Length

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
       FT_EXPORT( FT_Fixed )
       FT_Vector_Length( FT_Vector*  vec );
    +
    -

    -

    Return the length of a given vector.

    -

    -
    input
    -

    - -
    vec + +

    input

    + +
    vec

    The address of target vector.

    -
    -
    return
    + +

    return

    The vector length, expressed in the same units that the original vector coordinates.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Vector_Polarize

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_Vector_Polarize

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
       FT_EXPORT( void )
       FT_Vector_Polarize( FT_Vector*  vec,
                           FT_Fixed   *length,
                           FT_Angle   *angle );
    +
    -

    -

    Compute both the length and angle of a given vector.

    -

    -
    input
    -

    - -
    vec + +

    input

    + +
    vec

    The address of source vector.

    -
    -
    output
    -

    - -
    length + +

    output

    + + -
    length

    The vector length.

    angle +
    angle

    The vector angle.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Vector_From_Polar

    -
    -Defined in FT_TRIGONOMETRY_H (fttrigon.h). -

    -
     
    +
    + + +
    +

    FT_Vector_From_Polar

    +

    Defined in FT_TRIGONOMETRY_H (fttrigon.h).

    +
       FT_EXPORT( void )
       FT_Vector_From_Polar( FT_Vector*  vec,
                             FT_Fixed    length,
                             FT_Angle    angle );
    +
    -

    -

    Compute vector coordinates from a length and angle.

    -

    -
    output
    -

    - -
    vec + +

    output

    + +
    vec

    The address of source vector.

    -
    -
    input
    -

    - -
    length + +

    input

    + + -
    length

    The vector length.

    angle +
    angle

    The vector angle.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-font_formats.html b/freetype/docs/reference/ft2-font_formats.html index 7ff31bccb..508cee2a5 100644 --- a/freetype/docs/reference/ft2-font_formats.html +++ b/freetype/docs/reference/ft2-font_formats.html @@ -3,82 +3,137 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Font Formats -

    +

    Font Formats

    Synopsis

    - - -
    FT_Get_X11_Font_Format


    + + +
    FT_Get_X11_Font_Format
    + -

    The single function in this section can be used to get the font format. Note that this information is not needed normally; however, there are special cases (like in PDF devices) where it is important to differentiate, in spite of FreeType's uniform API.

    This function is in the X11/xf86 namespace for historical reasons and in no way depends on that windowing system.

    -

    -
    -

    FT_Get_X11_Font_Format

    -
    -Defined in FT_XFREE86_H (ftxf86.h). -

    -
     
    +
    +

    FT_Get_X11_Font_Format

    +

    Defined in FT_XFREE86_H (ftxf86.h).

    +
       FT_EXPORT( const char* )
       FT_Get_X11_Font_Format( FT_Face  face );
    +
    -

    -

    Return a string describing the format of a given face, using values that can be used as an X11 FONT_PROPERTY. Possible values are ‘TrueType’, ‘Type 1’, ‘BDF’, ‘PCF’, ‘Type 42’, ‘CID Type 1’, ‘CFF’, ‘PFR’, and ‘Windows FNT’.

    -

    -
    input
    -

    - -
    face + +

    input

    + +
    face

    Input face handle.

    -
    -
    return
    + +

    return

    Font format string. NULL in case of error.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-gasp_table.html b/freetype/docs/reference/ft2-gasp_table.html index 28ce1cdea..3b56119a1 100644 --- a/freetype/docs/reference/ft2-gasp_table.html +++ b/freetype/docs/reference/ft2-gasp_table.html @@ -3,140 +3,185 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Gasp Table -

    +

    Gasp Table

    Synopsis

    - - -
    FT_GASP_XXXFT_Get_Gasp


    + + +
    FT_GASP_XXXFT_Get_Gasp
    + -

    The function FT_Get_Gasp can be used to query a TrueType or OpenType font for specific entries in its ‘gasp’ table, if any. This is mainly useful when implementing native TrueType hinting with the bytecode interpreter to duplicate the Windows text rendering results.

    -

    -
    -

    FT_GASP_XXX

    -
    -Defined in FT_GASP_H (ftgasp.h). -

    -
    -
    -#define FT_GASP_NO_TABLE               -1
    -#define FT_GASP_DO_GRIDFIT           0x01
    -#define FT_GASP_DO_GRAY              0x02
    -#define FT_GASP_SYMMETRIC_SMOOTHING  0x08
    -#define FT_GASP_SYMMETRIC_GRIDFIT    0x10
    -
    -

    -
    + +
    +

    FT_GASP_XXX

    +

    Defined in FT_GASP_H (ftgasp.h).

    +
    +#define FT_GASP_NO_TABLE               -1
    +#define FT_GASP_DO_GRIDFIT           0x01
    +#define FT_GASP_DO_GRAY              0x02
    +#define FT_GASP_SYMMETRIC_SMOOTHING  0x08
    +#define FT_GASP_SYMMETRIC_GRIDFIT    0x10
    +
    +

    A list of values and/or bit-flags returned by the FT_Get_Gasp function.

    -

    -
    values
    -

    - -
    FT_GASP_NO_TABLE + +

    values

    + + - - - - - -
    FT_GASP_NO_TABLE

    This special value means that there is no GASP table in this face. It is up to the client to decide what to do.

    FT_GASP_DO_GRIDFIT +
    FT_GASP_DO_GRIDFIT

    Grid-fitting and hinting should be performed at the specified ppem. This really means TrueType bytecode interpretation. If this bit is not set, no hinting gets applied.

    FT_GASP_DO_GRAY +
    FT_GASP_DO_GRAY

    Anti-aliased rendering should be performed at the specified ppem. If not set, do monochrome rendering.

    FT_GASP_SYMMETRIC_SMOOTHING
    +
    FT_GASP_SYMMETRIC_SMOOTHING

    If set, smoothing along multiple axes must be used with ClearType.

    FT_GASP_SYMMETRIC_GRIDFIT
    +
    FT_GASP_SYMMETRIC_GRIDFIT

    Grid-fitting must be used with ClearType's symmetric smoothing.

    -
    -
    note
    + +

    note

    The bit-flags ‘FT_GASP_DO_GRIDFIT’ and ‘FT_GASP_DO_GRAY’ are to be used for standard font rasterization only. Independently of that, ‘FT_GASP_SYMMETRIC_SMOOTHING’ and ‘FT_GASP_SYMMETRIC_GRIDFIT’ are to be used if ClearType is enabled (and ‘FT_GASP_DO_GRIDFIT’ and ‘FT_GASP_DO_GRAY’ are consequently ignored).

    ‘ClearType’ is Microsoft's implementation of LCD rendering, partly protected by patents.

    -
    -
    since
    + +

    since

    2.3.0

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Gasp

    -
    -Defined in FT_GASP_H (ftgasp.h). -

    -
     
    +
    + + +
    +

    FT_Get_Gasp

    +

    Defined in FT_GASP_H (ftgasp.h).

    +
       FT_EXPORT( FT_Int )
       FT_Get_Gasp( FT_Face  face,
                    FT_UInt  ppem );
    +
    -

    -

    Read the ‘gasp’ table from a TrueType or OpenType font file and return the entry corresponding to a given character pixel size.

    -

    -
    input
    -

    - -
    face + +

    input

    + + -
    face

    The source face handle.

    ppem +
    ppem

    The vertical character pixel size.

    -
    -
    return
    + +

    return

    Bit flags (see FT_GASP_XXX), or FT_GASP_NO_TABLE if there is no ‘gasp’ table in the face.

    -
    -
    since
    + +

    since

    2.3.0

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-glyph_management.html b/freetype/docs/reference/ft2-glyph_management.html index f34d3a77b..017db1f1c 100644 --- a/freetype/docs/reference/ft2-glyph_management.html +++ b/freetype/docs/reference/ft2-glyph_management.html @@ -3,84 +3,137 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Glyph Management -

    +

    Glyph Management

    Synopsis

    - - - - - - -
    FT_GlyphFT_OutlineGlyphRecft_glyph_bbox_xxx
    FT_GlyphRecFT_Get_GlyphFT_Glyph_Get_CBox
    FT_BitmapGlyphFT_Glyph_CopyFT_Glyph_To_Bitmap
    FT_BitmapGlyphRecFT_Glyph_TransformFT_Done_Glyph
    FT_OutlineGlyphFT_Glyph_BBox_Mode


    - -
    + + + + + + +
    FT_GlyphFT_OutlineGlyphRecFT_Glyph_Get_CBox
    FT_GlyphRecFT_Get_GlyphFT_Glyph_To_Bitmap
    FT_BitmapGlyphFT_Glyph_CopyFT_Done_Glyph
    FT_BitmapGlyphRecFT_Glyph_Transform
    FT_OutlineGlyphFT_Glyph_BBox_Mode
    + +

    This section contains definitions used to manage glyph data through generic FT_Glyph objects. Each of them can contain a bitmap, a vector outline, or even images in other formats.

    -

    -
    -

    FT_Glyph

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    +

    FT_Glyph

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       typedef struct FT_GlyphRec_*  FT_Glyph;
    +
    -

    -

    Handle to an object used to model generic glyph images. It is a pointer to the FT_GlyphRec structure and can contain a glyph bitmap or pointer.

    -

    -
    note
    + +

    note

    Glyph objects are not owned by the library. You must thus release them manually (through FT_Done_Glyph) before calling FT_Done_FreeType.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_GlyphRec

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_GlyphRec

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       typedef struct  FT_GlyphRec_
       {
         FT_Library             library;
    @@ -89,60 +142,45 @@ Defined in FT_GLYPH_H (ftglyph.h).
         FT_Vector              advance;
     
       } FT_GlyphRec;
    +
    -

    -

    The root glyph structure contains a given glyph image plus its advance width in 16.16 fixed-point format.

    -

    -
    fields
    -

    - -
    library + +

    fields

    + + - - -
    library

    A handle to the FreeType library object.

    clazz +
    clazz

    A pointer to the glyph's class. Private.

    format +
    format

    The format of the glyph's image.

    advance +
    advance

    A 16.16 vector that gives the glyph's advance width.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_BitmapGlyph

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_BitmapGlyph

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       typedef struct FT_BitmapGlyphRec_*  FT_BitmapGlyph;
    +
    -

    -

    A handle to an object used to model a bitmap glyph image. This is a sub-class of FT_Glyph, and a pointer to FT_BitmapGlyphRec.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_BitmapGlyphRec

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_BitmapGlyphRec

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       typedef struct  FT_BitmapGlyphRec_
       {
         FT_GlyphRec  root;
    @@ -151,353 +189,256 @@ Defined in FT_GLYPH_H (ftglyph.h).
         FT_Bitmap    bitmap;
     
       } FT_BitmapGlyphRec;
    +
    -

    -

    A structure used for bitmap glyph images. This really is a ‘sub-class’ of FT_GlyphRec.

    -

    -
    fields
    -

    - -
    root + +

    fields

    + + - - -
    root

    The root FT_Glyph fields.

    left +
    left

    The left-side bearing, i.e., the horizontal distance from the current pen position to the left border of the glyph bitmap.

    top +
    top

    The top-side bearing, i.e., the vertical distance from the current pen position to the top border of the glyph bitmap. This distance is positive for upwards y!

    bitmap +
    bitmap

    A descriptor for the bitmap.

    -
    -
    note
    + +

    note

    You can typecast an FT_Glyph to FT_BitmapGlyph if you have ‘glyph->format == FT_GLYPH_FORMAT_BITMAP’. This lets you access the bitmap's contents easily.

    The corresponding pixel buffer is always owned by FT_BitmapGlyph and is thus created and destroyed with it.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_OutlineGlyph

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_OutlineGlyph

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       typedef struct FT_OutlineGlyphRec_*  FT_OutlineGlyph;
    +
    -

    -

    A handle to an object used to model an outline glyph image. This is a sub-class of FT_Glyph, and a pointer to FT_OutlineGlyphRec.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_OutlineGlyphRec

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_OutlineGlyphRec

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       typedef struct  FT_OutlineGlyphRec_
       {
         FT_GlyphRec  root;
         FT_Outline   outline;
     
       } FT_OutlineGlyphRec;
    +
    -

    -

    A structure used for outline (vectorial) glyph images. This really is a ‘sub-class’ of FT_GlyphRec.

    -

    -
    fields
    -

    - -
    root + +

    fields

    + + -
    root

    The root FT_Glyph fields.

    outline +
    outline

    A descriptor for the outline.

    -
    -
    note
    + +

    note

    You can typecast an FT_Glyph to FT_OutlineGlyph if you have ‘glyph->format == FT_GLYPH_FORMAT_OUTLINE’. This lets you access the outline's content easily.

    As the outline is extracted from a glyph slot, its coordinates are expressed normally in 26.6 pixels, unless the flag FT_LOAD_NO_SCALE was used in FT_Load_Glyph() or FT_Load_Char().

    The outline's tables are always owned by the object and are destroyed with it.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Glyph

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_Get_Glyph

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_Glyph( FT_GlyphSlot  slot,
                     FT_Glyph     *aglyph );
    +
    -

    -

    A function used to extract a glyph image from a slot. Note that the created FT_Glyph object must be released with FT_Done_Glyph.

    -

    -
    input
    -

    - -
    slot + +

    input

    + +
    slot

    A handle to the source glyph slot.

    -
    -
    output
    -

    - -
    aglyph + +

    output

    + +
    aglyph

    A handle to the glyph object.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Glyph_Copy

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_Glyph_Copy

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       FT_EXPORT( FT_Error )
       FT_Glyph_Copy( FT_Glyph   source,
                      FT_Glyph  *target );
    +
    -

    -

    A function used to copy a glyph image. Note that the created FT_Glyph object must be released with FT_Done_Glyph.

    -

    -
    input
    -

    - -
    source + +

    input

    + +
    source

    A handle to the source glyph object.

    -
    -
    output
    -

    - -
    target + +

    output

    + +
    target

    A handle to the target glyph object. 0 in case of error.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Glyph_Transform

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_Glyph_Transform

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       FT_EXPORT( FT_Error )
       FT_Glyph_Transform( FT_Glyph    glyph,
                           FT_Matrix*  matrix,
                           FT_Vector*  delta );
    +
    -

    -

    Transform a glyph image if its format is scalable.

    -

    -
    inout
    -

    - -
    glyph + +

    inout

    + +
    glyph

    A handle to the target glyph object.

    -
    -
    input
    -

    - -
    matrix + +

    input

    + + -
    matrix

    A pointer to a 2x2 matrix to apply.

    delta +
    delta

    A pointer to a 2d vector to apply. Coordinates are expressed in 1/64th of a pixel.

    -
    -
    return
    + +

    return

    FreeType error code (if not 0, the glyph format is not scalable).

    -
    -
    note
    + +

    note

    The 2x2 transformation matrix is also applied to the glyph's advance vector.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Glyph_BBox_Mode

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_Glyph_BBox_Mode

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       typedef enum  FT_Glyph_BBox_Mode_
       {
    -    FT_GLYPH_BBOX_UNSCALED  = 0,
    -    FT_GLYPH_BBOX_SUBPIXELS = 0,
    -    FT_GLYPH_BBOX_GRIDFIT   = 1,
    -    FT_GLYPH_BBOX_TRUNCATE  = 2,
    -    FT_GLYPH_BBOX_PIXELS    = 3
    +    FT_GLYPH_BBOX_UNSCALED  = 0,
    +    FT_GLYPH_BBOX_SUBPIXELS = 0,
    +    FT_GLYPH_BBOX_GRIDFIT   = 1,
    +    FT_GLYPH_BBOX_TRUNCATE  = 2,
    +    FT_GLYPH_BBOX_PIXELS    = 3
     
       } FT_Glyph_BBox_Mode;
     
    -

    -
    + + /* these constants are deprecated; use the corresponding */ + /* `FT_Glyph_BBox_Mode' values instead */ +#define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED +#define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS +#define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT +#define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE +#define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS + +

    The mode how the values of FT_Glyph_Get_CBox are returned.

    -

    -
    values
    -

    - -
    FT_GLYPH_BBOX_UNSCALED + +

    values

    + + - - - - -
    FT_GLYPH_BBOX_UNSCALED

    Return unscaled font units.

    FT_GLYPH_BBOX_SUBPIXELS
    +
    FT_GLYPH_BBOX_SUBPIXELS

    Return unfitted 26.6 coordinates.

    FT_GLYPH_BBOX_GRIDFIT +
    FT_GLYPH_BBOX_GRIDFIT

    Return grid-fitted 26.6 coordinates.

    FT_GLYPH_BBOX_TRUNCATE +
    FT_GLYPH_BBOX_TRUNCATE

    Return coordinates in integer pixels.

    FT_GLYPH_BBOX_PIXELS +
    FT_GLYPH_BBOX_PIXELS

    Return grid-fitted pixel coordinates.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    ft_glyph_bbox_xxx

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
    -
    -#define ft_glyph_bbox_unscaled   FT_GLYPH_BBOX_UNSCALED
    -#define ft_glyph_bbox_subpixels  FT_GLYPH_BBOX_SUBPIXELS
    -#define ft_glyph_bbox_gridfit    FT_GLYPH_BBOX_GRIDFIT
    -#define ft_glyph_bbox_truncate   FT_GLYPH_BBOX_TRUNCATE
    -#define ft_glyph_bbox_pixels     FT_GLYPH_BBOX_PIXELS
    -
    -

    -
    -

    These constants are deprecated. Use the corresponding FT_Glyph_BBox_Mode values instead.

    -

    -
    values
    -

    - - - - - - - -
    ft_glyph_bbox_unscaled -

    See FT_GLYPH_BBOX_UNSCALED.

    -
    ft_glyph_bbox_subpixels
    -

    See FT_GLYPH_BBOX_SUBPIXELS.

    -
    ft_glyph_bbox_gridfit -

    See FT_GLYPH_BBOX_GRIDFIT.

    -
    ft_glyph_bbox_truncate -

    See FT_GLYPH_BBOX_TRUNCATE.

    -
    ft_glyph_bbox_pixels -

    See FT_GLYPH_BBOX_PIXELS.

    -
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Glyph_Get_CBox

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_Glyph_Get_CBox

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       FT_EXPORT( void )
       FT_Glyph_Get_CBox( FT_Glyph  glyph,
                          FT_UInt   bbox_mode,
                          FT_BBox  *acbox );
    +
    -

    -

    Return a glyph's ‘control box’. The control box encloses all the outline's points, including Bézier control points. Though it coincides with the exact bounding box for most glyphs, it can be slightly larger in some situations (like when rotating an outline that contains Bézier outside arcs).

    Computing the control box is very fast, while getting the bounding box can take much more time as it needs to walk over all segments and arcs in the outline. To get the latter, you can use the ‘ftbbox’ component, which is dedicated to this single task.

    -

    -
    input
    -

    - -
    glyph + +

    input

    + + -
    glyph

    A handle to the source glyph object.

    mode +
    mode

    The mode that indicates how to interpret the returned bounding box values.

    -
    -
    output
    -

    - -
    acbox + +

    output

    + +
    acbox

    The glyph coordinate bounding box. Coordinates are expressed in 1/64th of pixels if it is grid-fitted.

    -
    -
    note
    + +

    note

    Coordinates are relative to the glyph origin, using the y upwards convention.

    If the glyph has been loaded with FT_LOAD_NO_SCALE, ‘bbox_mode’ must be set to FT_GLYPH_BBOX_UNSCALED to get unscaled font units in 26.6 pixel format. The value FT_GLYPH_BBOX_SUBPIXELS is another name for this constant.

    If the font is tricky and the glyph has been loaded with FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get reasonable values for the CBox it is necessary to load the glyph at a large ppem value (so that the hinting instructions can properly shift and scale the subglyphs), then extracting the CBox, which can be eventually converted back to font units.

    @@ -515,56 +456,47 @@ Defined in FT_GLYPH_H (ftglyph.h).

    To get the bbox in pixel coordinates, set ‘bbox_mode’ to FT_GLYPH_BBOX_TRUNCATE.

    To get the bbox in grid-fitted pixel coordinates, set ‘bbox_mode’ to FT_GLYPH_BBOX_PIXELS.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Glyph_To_Bitmap

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_Glyph_To_Bitmap

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       FT_EXPORT( FT_Error )
       FT_Glyph_To_Bitmap( FT_Glyph*       the_glyph,
                           FT_Render_Mode  render_mode,
                           FT_Vector*      origin,
                           FT_Bool         destroy );
    +
    -

    -

    Convert a given glyph object to a bitmap glyph object.

    -

    -
    inout
    -

    - -
    the_glyph + +

    inout

    + +
    the_glyph

    A pointer to a handle to the target glyph.

    -
    -
    input
    -

    - -
    render_mode + +

    input

    + + - -
    render_mode

    An enumeration that describes how the data is rendered.

    origin +
    origin

    A pointer to a vector used to translate the glyph image before rendering. Can be 0 (if no translation). The origin is expressed in 26.6 pixels.

    destroy +
    destroy

    A boolean that indicates that the original glyph image should be destroyed by this function. It is never destroyed in case of error.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function does nothing if the glyph format isn't scalable.

    The glyph image is translated with the ‘origin’ vector before rendering.

    The first parameter is a pointer to an FT_Glyph handle, that will be replaced by this function (with newly allocated data). Typically, you would use (omitting error handling):

    @@ -634,40 +566,29 @@ Defined in FT_GLYPH_H (ftglyph.h). for ( idx = 0; i < MAX_GLYPHS; i++ ) FT_Done_Glyph( glyphs[idx] ); -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Done_Glyph

    -
    -Defined in FT_GLYPH_H (ftglyph.h). -

    -
     
    +
    + + +
    +

    FT_Done_Glyph

    +

    Defined in FT_GLYPH_H (ftglyph.h).

    +
       FT_EXPORT( void )
       FT_Done_Glyph( FT_Glyph  glyph );
    +
    -

    -

    Destroy a given glyph.

    -

    -
    input
    -

    - -
    glyph + +

    input

    + +
    glyph

    A handle to the target glyph object.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-glyph_stroker.html b/freetype/docs/reference/ft2-glyph_stroker.html index b904130ef..d5daa46c3 100644 --- a/freetype/docs/reference/ft2-glyph_stroker.html +++ b/freetype/docs/reference/ft2-glyph_stroker.html @@ -3,938 +3,817 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Glyph Stroker -

    +

    Glyph Stroker

    Synopsis

    - - - - - - - - - - - - -
    FT_StrokerFT_Stroker_EndSubPath
    FT_Stroker_LineJoinFT_Stroker_LineTo
    FT_Stroker_LineCapFT_Stroker_ConicTo
    FT_StrokerBorderFT_Stroker_CubicTo
    FT_Outline_GetInsideBorderFT_Stroker_GetBorderCounts
    FT_Outline_GetOutsideBorderFT_Stroker_ExportBorder
    FT_Stroker_NewFT_Stroker_GetCounts
    FT_Stroker_SetFT_Stroker_Export
    FT_Stroker_RewindFT_Stroker_Done
    FT_Stroker_ParseOutlineFT_Glyph_Stroke
    FT_Stroker_BeginSubPathFT_Glyph_StrokeBorder


    - -
    + + + + + + + + + + + + + + + + +
    FT_StrokerFT_Stroker_ParseOutline
     FT_Stroker_Done
    FT_Stroker_LineJoin 
    FT_Stroker_LineCapFT_Stroker_BeginSubPath
    FT_StrokerBorderFT_Stroker_EndSubPath
      
    FT_Outline_GetInsideBorderFT_Stroker_LineTo
    FT_Outline_GetOutsideBorderFT_Stroker_ConicTo
     FT_Stroker_CubicTo
    FT_Glyph_Stroke 
    FT_Glyph_StrokeBorderFT_Stroker_GetBorderCounts
     FT_Stroker_ExportBorder
    FT_Stroker_NewFT_Stroker_GetCounts
    FT_Stroker_SetFT_Stroker_Export
    FT_Stroker_Rewind
    + +

    This component generates stroked outlines of a given vectorial glyph. It also allows you to retrieve the ‘outside’ and/or the ‘inside’ borders of the stroke.

    This can be useful to generate ‘bordered’ glyph, i.e., glyphs displayed with a coloured (and anti-aliased) border around their shape.

    -

    -
    -

    FT_Stroker

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    +

    FT_Stroker

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       typedef struct FT_StrokerRec_*  FT_Stroker;
    +
    -

    -
    -

    Opaque handler to a path stroker object.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_LineJoin

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
    +

    Opaque handle to a path stroker object.

    +
    + + +

    -

    These values determine how two joining lines are rendered in a stroker.

    -

    -
    values
    -

    - - -
    FT_STROKER_LINEJOIN_ROUND
    + +

    values

    + + - - - - - - - -
    FT_STROKER_LINEJOIN_ROUND

    Used to render rounded line joins. Circular arcs are used to join two lines smoothly.

    FT_STROKER_LINEJOIN_BEVEL
    +
    FT_STROKER_LINEJOIN_BEVEL

    Used to render beveled line joins. The outer corner of the joined lines is filled by enclosing the triangular region of the corner with a straight line between the outer corners of each stroke.

    FT_STROKER_LINEJOIN_MITER_FIXED
    +
    FT_STROKER_LINEJOIN_MITER_FIXED

    Used to render mitered line joins, with fixed bevels if the miter limit is exceeded. The outer edges of the strokes for the two segments are extended until they meet at an angle. If the segments meet at too sharp an angle (such that the miter would extend from the intersection of the segments a distance greater than the product of the miter limit value and the border radius), then a bevel join (see above) is used instead. This prevents long spikes being created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter line join as used in PostScript and PDF.

    FT_STROKER_LINEJOIN_MITER_VARIABLE
    +
    FT_STROKER_LINEJOIN_MITER_VARIABLE

    FT_STROKER_LINEJOIN_MITER
    +
    FT_STROKER_LINEJOIN_MITER

    Used to render mitered line joins, with variable bevels if the miter limit is exceeded. The intersection of the strokes is clipped at a line perpendicular to the bisector of the angle between the strokes, at the distance from the intersection of the segments equal to the product of the miter limit value and the border radius. This prevents long spikes being created. FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for backwards compatibility.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_LineCap

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Stroker_LineCap

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       typedef enum  FT_Stroker_LineCap_
       {
    -    FT_STROKER_LINECAP_BUTT = 0,
    -    FT_STROKER_LINECAP_ROUND,
    -    FT_STROKER_LINECAP_SQUARE
    +    FT_STROKER_LINECAP_BUTT = 0,
    +    FT_STROKER_LINECAP_ROUND,
    +    FT_STROKER_LINECAP_SQUARE
     
       } FT_Stroker_LineCap;
    +
    -

    -

    These values determine how the end of opened sub-paths are rendered in a stroke.

    -

    -
    values
    -

    - - -
    FT_STROKER_LINECAP_BUTT
    + +

    values

    + + - - - -
    FT_STROKER_LINECAP_BUTT

    The end of lines is rendered as a full stop on the last point itself.

    FT_STROKER_LINECAP_ROUND
    +
    FT_STROKER_LINECAP_ROUND

    The end of lines is rendered as a half-circle around the last point.

    FT_STROKER_LINECAP_SQUARE
    +
    FT_STROKER_LINECAP_SQUARE

    The end of lines is rendered as a square around the last point.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_StrokerBorder

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_StrokerBorder

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       typedef enum  FT_StrokerBorder_
       {
    -    FT_STROKER_BORDER_LEFT = 0,
    -    FT_STROKER_BORDER_RIGHT
    +    FT_STROKER_BORDER_LEFT = 0,
    +    FT_STROKER_BORDER_RIGHT
     
       } FT_StrokerBorder;
    +
    -

    -

    These values are used to select a given stroke border in FT_Stroker_GetBorderCounts and FT_Stroker_ExportBorder.

    -

    -
    values
    -

    - -
    FT_STROKER_BORDER_LEFT + +

    values

    + + - -
    FT_STROKER_BORDER_LEFT

    Select the left border, relative to the drawing direction.

    FT_STROKER_BORDER_RIGHT
    +
    FT_STROKER_BORDER_RIGHT

    Select the right border, relative to the drawing direction.

    -
    -
    note
    + +

    note

    Applications are generally interested in the ‘inside’ and ‘outside’ borders. However, there is no direct mapping between these and the ‘left’ and ‘right’ ones, since this really depends on the glyph's drawing orientation, which varies between font formats.

    You can however use FT_Outline_GetInsideBorder and FT_Outline_GetOutsideBorder to get these.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_GetInsideBorder

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Outline_GetInsideBorder

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( FT_StrokerBorder )
       FT_Outline_GetInsideBorder( FT_Outline*  outline );
    +
    -

    -

    Retrieve the FT_StrokerBorder value corresponding to the ‘inside’ borders of a given outline.

    -

    -
    input
    -

    - -
    outline + +

    input

    + +
    outline

    The source outline handle.

    -
    -
    return
    + +

    return

    The border index. FT_STROKER_BORDER_RIGHT for empty or invalid outlines.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_GetOutsideBorder

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Outline_GetOutsideBorder

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( FT_StrokerBorder )
       FT_Outline_GetOutsideBorder( FT_Outline*  outline );
    +
    -

    -

    Retrieve the FT_StrokerBorder value corresponding to the ‘outside’ borders of a given outline.

    -

    -
    input
    -

    - -
    outline + +

    input

    + +
    outline

    The source outline handle.

    -
    -
    return
    + +

    return

    The border index. FT_STROKER_BORDER_LEFT for empty or invalid outlines.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_New

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Glyph_Stroke

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Glyph_Stroke( FT_Glyph    *pglyph,
    +                   FT_Stroker   stroker,
    +                   FT_Bool      destroy );
    +
    + +

    Stroke a given outline glyph object with a given stroker.

    + +

    inout

    + + +
    pglyph +

    Source glyph handle on input, new glyph handle on output.

    +
    + +

    input

    + + + +
    stroker +

    A stroker handle.

    +
    destroy +

    A Boolean. If 1, the source glyph object is destroyed on success.

    +
    + +

    return

    +

    FreeType error code. 0 means success.

    + +

    note

    +

    The source glyph is untouched in case of error.

    +

    Adding stroke may yield a significantly wider and taller glyph depending on how large of a radius was used to stroke the glyph. You may need to manually adjust horizontal and vertical advance amounts to account for this added size.

    + +
    +
    + +
    +

    FT_Glyph_StrokeBorder

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,
    +                         FT_Stroker   stroker,
    +                         FT_Bool      inside,
    +                         FT_Bool      destroy );
    +
    + +

    Stroke a given outline glyph object with a given stroker, but only return either its inside or outside border.

    + +

    inout

    + + +
    pglyph +

    Source glyph handle on input, new glyph handle on output.

    +
    + +

    input

    + + + + +
    stroker +

    A stroker handle.

    +
    inside +

    A Boolean. If 1, return the inside border, otherwise the outside border.

    +
    destroy +

    A Boolean. If 1, the source glyph object is destroyed on success.

    +
    + +

    return

    +

    FreeType error code. 0 means success.

    + +

    note

    +

    The source glyph is untouched in case of error.

    +

    Adding stroke may yield a significantly wider and taller glyph depending on how large of a radius was used to stroke the glyph. You may need to manually adjust horizontal and vertical advance amounts to account for this added size.

    + +
    +
    + +
    +

    FT_Stroker_New

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( FT_Error )
       FT_Stroker_New( FT_Library   library,
                       FT_Stroker  *astroker );
    +
    -

    -

    Create a new stroker object.

    -

    -
    input
    -

    - -
    library + +

    input

    + +
    library

    FreeType library handle.

    -
    -
    output
    -

    - -
    astroker + +

    output

    + +
    astroker

    A new stroker object handle. NULL in case of error.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_Set

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Stroker_Set

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( void )
       FT_Stroker_Set( FT_Stroker           stroker,
                       FT_Fixed             radius,
                       FT_Stroker_LineCap   line_cap,
                       FT_Stroker_LineJoin  line_join,
                       FT_Fixed             miter_limit );
    +
    -

    -

    Reset a stroker object's attributes.

    -

    -
    input
    -

    - -
    stroker + +

    input

    + + - - - -
    stroker

    The target stroker handle.

    radius +
    radius

    The border radius.

    line_cap +
    line_cap

    The line cap style.

    line_join +
    line_join

    The line join style.

    miter_limit +
    miter_limit

    The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles, expressed as 16.16 fixed-point value.

    -
    -
    note
    + +

    note

    The radius is expressed in the same units as the outline coordinates.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_Rewind

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
    +

    This function calls FT_Stroker_Rewind automatically.

    +
    + + +
    +

    FT_Stroker_Rewind

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( void )
       FT_Stroker_Rewind( FT_Stroker  stroker );
    +
    -

    -

    Reset a stroker object without changing its attributes. You should call this function before beginning a new series of calls to FT_Stroker_BeginSubPath or FT_Stroker_EndSubPath.

    -

    -
    input
    -

    - -
    stroker + +

    input

    + +
    stroker

    The target stroker handle.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_ParseOutline

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Stroker_ParseOutline

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( FT_Error )
       FT_Stroker_ParseOutline( FT_Stroker   stroker,
                                FT_Outline*  outline,
                                FT_Bool      opened );
    +
    -

    -

    A convenience function used to parse a whole outline with the stroker. The resulting outline(s) can be retrieved later by functions like FT_Stroker_GetCounts and FT_Stroker_Export.

    -

    -
    input
    -

    - -
    stroker + +

    input

    + + - -
    stroker

    The target stroker handle.

    outline +
    outline

    The source outline.

    opened +
    opened

    A boolean. If 1, the outline is treated as an open path instead of a closed one.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    If ‘opened’ is 0 (the default), the outline is treated as a closed path, and the stroker generates two distinct ‘border’ outlines.

    If ‘opened’ is 1, the outline is processed as an open path, and the stroker generates a single ‘stroke’ outline.

    This function calls FT_Stroker_Rewind automatically.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_BeginSubPath

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Stroker_Done

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
    +  FT_EXPORT( void )
    +  FT_Stroker_Done( FT_Stroker  stroker );
    +
    + +

    Destroy a stroker object.

    + +

    input

    + + +
    stroker +

    A stroker handle. Can be NULL.

    +
    + +
    +
    + +
    +

    FT_Stroker_BeginSubPath

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( FT_Error )
       FT_Stroker_BeginSubPath( FT_Stroker  stroker,
                                FT_Vector*  to,
                                FT_Bool     open );
    +
    -

    -

    Start a new sub-path in the stroker.

    -

    -
    input
    -

    - -
    stroker + +

    input

    + + - -
    stroker

    The target stroker handle.

    to +
    to

    A pointer to the start vector.

    open +
    open

    A boolean. If 1, the sub-path is treated as an open one.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function is useful when you need to stroke a path that is not stored as an FT_Outline object.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_EndSubPath

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Stroker_EndSubPath

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( FT_Error )
       FT_Stroker_EndSubPath( FT_Stroker  stroker );
    +
    -

    -

    Close the current sub-path in the stroker.

    -

    -
    input
    -

    - -
    stroker + +

    input

    + +
    stroker

    The target stroker handle.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    You should call this function after FT_Stroker_BeginSubPath. If the subpath was not ‘opened’, this function ‘draws’ a single line segment to the start position when needed.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_LineTo

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Stroker_LineTo

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( FT_Error )
       FT_Stroker_LineTo( FT_Stroker  stroker,
                          FT_Vector*  to );
    +
    -

    -

    ‘Draw’ a single line segment in the stroker's current sub-path, from the last position.

    -

    -
    input
    -

    - -
    stroker + +

    input

    + + -
    stroker

    The target stroker handle.

    to +
    to

    A pointer to the destination point.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    You should call this function between FT_Stroker_BeginSubPath and FT_Stroker_EndSubPath.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_ConicTo

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Stroker_ConicTo

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( FT_Error )
       FT_Stroker_ConicTo( FT_Stroker  stroker,
                           FT_Vector*  control,
                           FT_Vector*  to );
    +
    -

    -

    ‘Draw’ a single quadratic Bézier in the stroker's current sub-path, from the last position.

    -

    -
    input
    -

    - -
    stroker + +

    input

    + + - -
    stroker

    The target stroker handle.

    control +
    control

    A pointer to a Bézier control point.

    to +
    to

    A pointer to the destination point.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    You should call this function between FT_Stroker_BeginSubPath and FT_Stroker_EndSubPath.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_CubicTo

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Stroker_CubicTo

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( FT_Error )
       FT_Stroker_CubicTo( FT_Stroker  stroker,
                           FT_Vector*  control1,
                           FT_Vector*  control2,
                           FT_Vector*  to );
    +
    -

    -

    ‘Draw’ a single cubic Bézier in the stroker's current sub-path, from the last position.

    -

    -
    input
    -

    - -
    stroker + +

    input

    + + - - -
    stroker

    The target stroker handle.

    control1 +
    control1

    A pointer to the first Bézier control point.

    control2 +
    control2

    A pointer to second Bézier control point.

    to +
    to

    A pointer to the destination point.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    You should call this function between FT_Stroker_BeginSubPath and FT_Stroker_EndSubPath.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_GetBorderCounts

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Stroker_GetBorderCounts

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( FT_Error )
       FT_Stroker_GetBorderCounts( FT_Stroker        stroker,
                                   FT_StrokerBorder  border,
                                   FT_UInt          *anum_points,
                                   FT_UInt          *anum_contours );
    +
    -

    -

    Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export one of the ‘border’ or ‘stroke’ outlines generated by the stroker.

    -

    -
    input
    -

    - -
    stroker + +

    input

    + + -
    stroker

    The target stroker handle.

    border +
    border

    The border index.

    -
    -
    output
    -

    - -
    anum_points + +

    output

    + + -
    anum_points

    The number of points.

    anum_contours +
    anum_contours

    The number of contours.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    When an outline, or a sub-path, is ‘closed’, the stroker generates two independent ‘border’ outlines, named ‘left’ and ‘right’.

    When the outline, or a sub-path, is ‘opened’, the stroker merges the ‘border’ outlines with caps. The ‘left’ border receives all points, while the ‘right’ border becomes empty.

    Use the function FT_Stroker_GetCounts instead if you want to retrieve the counts associated to both borders.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_ExportBorder

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Stroker_ExportBorder

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( void )
       FT_Stroker_ExportBorder( FT_Stroker        stroker,
                                FT_StrokerBorder  border,
                                FT_Outline*       outline );
    +
    -

    -

    Call this function after FT_Stroker_GetBorderCounts to export the corresponding border to your own FT_Outline structure.

    Note that this function appends the border points and contours to your outline, but does not try to resize its arrays.

    -

    -
    input
    -

    - -
    stroker + +

    input

    + + - -
    stroker

    The target stroker handle.

    border +
    border

    The border index.

    outline +
    outline

    The target outline handle.

    -
    -
    note
    + +

    note

    Always call this function after FT_Stroker_GetBorderCounts to get sure that there is enough room in your FT_Outline object to receive all new data.

    -

    When an outline, or a sub-path, is ‘closed’, the stroker generates two independent ‘border’ outlines, named ‘left’ and ‘right’

    +

    When an outline, or a sub-path, is ‘closed’, the stroker generates two independent ‘border’ outlines, named ‘left’ and ‘right’.

    When the outline, or a sub-path, is ‘opened’, the stroker merges the ‘border’ outlines with caps. The ‘left’ border receives all points, while the ‘right’ border becomes empty.

    Use the function FT_Stroker_Export instead if you want to retrieve all borders at once.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_GetCounts

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Stroker_GetCounts

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( FT_Error )
       FT_Stroker_GetCounts( FT_Stroker  stroker,
                             FT_UInt    *anum_points,
                             FT_UInt    *anum_contours );
    +
    -

    -

    Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export all points/borders from the stroked outline/path.

    -

    -
    input
    -

    - -
    stroker + +

    input

    + +
    stroker

    The target stroker handle.

    -
    -
    output
    -

    - -
    anum_points + +

    output

    + + -
    anum_points

    The number of points.

    anum_contours +
    anum_contours

    The number of contours.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_Export

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    +
    + + +
    +

    FT_Stroker_Export

    +

    Defined in FT_STROKER_H (ftstroke.h).

    +
       FT_EXPORT( void )
       FT_Stroker_Export( FT_Stroker   stroker,
                          FT_Outline*  outline );
    +
    -

    -

    Call this function after FT_Stroker_GetBorderCounts to export all borders to your own FT_Outline structure.

    Note that this function appends the border points and contours to your outline, but does not try to resize its arrays.

    -

    -
    input
    -

    - -
    stroker + +

    input

    + + -
    stroker

    The target stroker handle.

    outline +
    outline

    The target outline handle.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stroker_Done

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
    -
    -  FT_EXPORT( void )
    -  FT_Stroker_Done( FT_Stroker  stroker );
    -
    -

    -
    -

    Destroy a stroker object.

    -

    -
    input
    -

    - - -
    stroker -

    A stroker handle. Can be NULL.

    -
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Glyph_Stroke

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
    -
    -  FT_EXPORT( FT_Error )
    -  FT_Glyph_Stroke( FT_Glyph    *pglyph,
    -                   FT_Stroker   stroker,
    -                   FT_Bool      destroy );
    -
    -

    -
    -

    Stroke a given outline glyph object with a given stroker.

    -

    -
    inout
    -

    - - -
    pglyph -

    Source glyph handle on input, new glyph handle on output.

    -
    -
    -
    input
    -

    - - - -
    stroker -

    A stroker handle.

    -
    destroy -

    A Boolean. If 1, the source glyph object is destroyed on success.

    -
    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    The source glyph is untouched in case of error.

    -

    Adding stroke may yield a significantly wider and taller glyph depending on how large of a radius was used to stroke the glyph. You may need to manually adjust horizontal and vertical advance amounts to account for this added size.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Glyph_StrokeBorder

    -
    -Defined in FT_STROKER_H (ftstroke.h). -

    -
     
    -  FT_EXPORT( FT_Error )
    -  FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,
    -                         FT_Stroker   stroker,
    -                         FT_Bool      inside,
    -                         FT_Bool      destroy );
    -
    -

    -
    -

    Stroke a given outline glyph object with a given stroker, but only return either its inside or outside border.

    -

    -
    inout
    -

    - - -
    pglyph -

    Source glyph handle on input, new glyph handle on output.

    -
    -
    -
    input
    -

    - - - - -
    stroker -

    A stroker handle.

    -
    inside -

    A Boolean. If 1, return the inside border, otherwise the outside border.

    -
    destroy -

    A Boolean. If 1, the source glyph object is destroyed on success.

    -
    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    The source glyph is untouched in case of error.

    -

    Adding stroke may yield a significantly wider and taller glyph depending on how large of a radius was used to stroke the glyph. You may need to manually adjust horizontal and vertical advance amounts to account for this added size.

    -
    -
    -
    - - -
    [Index][TOC]
    +
    + diff --git a/freetype/docs/reference/ft2-glyph_variants.html b/freetype/docs/reference/ft2-glyph_variants.html index ef5d5f8aa..a19db11ea 100644 --- a/freetype/docs/reference/ft2-glyph_variants.html +++ b/freetype/docs/reference/ft2-glyph_variants.html @@ -3,267 +3,290 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Glyph Variants -

    +

    Glyph Variants

    Synopsis

    - - - - -
    FT_Face_GetCharVariantIndexFT_Face_GetVariantsOfChar
    FT_Face_GetCharVariantIsDefaultFT_Face_GetCharsOfVariant
    FT_Face_GetVariantSelectors


    + + + + +
    FT_Face_GetCharVariantIndexFT_Face_GetVariantsOfChar
    FT_Face_GetCharVariantIsDefaultFT_Face_GetCharsOfVariant
    FT_Face_GetVariantSelectors
    + -

    Many CJK characters have variant forms. They are a sort of grey area somewhere between being totally irrelevant and semantically distinct; for this reason, the Unicode consortium decided to introduce Ideographic Variation Sequences (IVS), consisting of a Unicode base character and one of 240 variant selectors (U+E0100-U+E01EF), instead of further extending the already huge code range for CJK characters.

    An IVS is registered and unique; for further details please refer to Unicode Technical Standard #37, the Ideographic Variation Database:

    http://www.unicode.org/reports/tr37/

    -

    To date (November 2012), the character with the most variants is U+9089, having 31 such IVS.

    +

    To date (November 2014), the character with the most variants is U+9089, having 32 such IVS.

    Adobe and MS decided to support IVS with a new cmap subtable (format 14). It is an odd subtable because it is not a mapping of input code points to glyphs, but contains lists of all variants supported by the font.

    A variant may be either ‘default’ or ‘non-default’. A default variant is the one you will get for that code point if you look it up in the standard Unicode cmap. A non-default variant is a different glyph.

    -

    -
    -

    FT_Face_GetCharVariantIndex

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    +

    FT_Face_GetCharVariantIndex

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_UInt )
       FT_Face_GetCharVariantIndex( FT_Face   face,
                                    FT_ULong  charcode,
                                    FT_ULong  variantSelector );
    +
    -

    -

    Return the glyph index of a given character code as modified by the variation selector.

    -

    -
    input
    -

    - -
    face + +

    input

    + + - -
    face

    A handle to the source face object.

    charcode +
    charcode

    The character code point in Unicode.

    variantSelector +
    variantSelector

    The Unicode code point of the variation selector.

    -
    -
    return
    + +

    return

    The glyph index. 0 means either ‘undefined character code’, or ‘undefined selector code’, or ‘no variation selector cmap subtable’, or ‘current CharMap is not Unicode’.

    -
    -
    note
    + +

    note

    If you use FreeType to manipulate the contents of font files directly, be aware that the glyph index returned by this function doesn't always correspond to the internal indices used within the file. This is done to ensure that value 0 always corresponds to the ‘missing glyph’.

    This function is only meaningful if a) the font has a variation selector cmap sub table, and b) the current charmap has a Unicode encoding.

    -
    -
    since
    + +

    since

    2.3.6

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Face_GetCharVariantIsDefault

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Face_GetCharVariantIsDefault

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_Int )
       FT_Face_GetCharVariantIsDefault( FT_Face   face,
                                        FT_ULong  charcode,
                                        FT_ULong  variantSelector );
    +
    -

    -

    Check whether this variant of this Unicode character is the one to be found in the ‘cmap’.

    -

    -
    input
    -

    - -
    face + +

    input

    + + - -
    face

    A handle to the source face object.

    charcode +
    charcode

    The character codepoint in Unicode.

    variantSelector +
    variantSelector

    The Unicode codepoint of the variation selector.

    -
    -
    return
    + +

    return

    1 if found in the standard (Unicode) cmap, 0 if found in the variation selector cmap, or -1 if it is not a variant.

    -
    -
    note
    + +

    note

    This function is only meaningful if the font has a variation selector cmap subtable.

    -
    -
    since
    + +

    since

    2.3.6

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Face_GetVariantSelectors

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Face_GetVariantSelectors

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_UInt32* )
       FT_Face_GetVariantSelectors( FT_Face  face );
    +
    -

    -

    Return a zero-terminated list of Unicode variant selectors found in the font.

    -

    -
    input
    -

    - -
    face + +

    input

    + +
    face

    A handle to the source face object.

    -
    -
    return
    + +

    return

    A pointer to an array of selector code points, or NULL if there is no valid variant selector cmap subtable.

    -
    -
    note
    + +

    note

    The last item in the array is 0; the array is owned by the FT_Face object but can be overwritten or released on the next call to a FreeType function.

    -
    -
    since
    + +

    since

    2.3.6

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Face_GetVariantsOfChar

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Face_GetVariantsOfChar

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_UInt32* )
       FT_Face_GetVariantsOfChar( FT_Face   face,
                                  FT_ULong  charcode );
    +
    -

    -

    Return a zero-terminated list of Unicode variant selectors found for the specified character code.

    -

    -
    input
    -

    - -
    face + +

    input

    + + -
    face

    A handle to the source face object.

    charcode +
    charcode

    The character codepoint in Unicode.

    -
    -
    return
    + +

    return

    A pointer to an array of variant selector code points that are active for the given character, or NULL if the corresponding list is empty.

    -
    -
    note
    + +

    note

    The last item in the array is 0; the array is owned by the FT_Face object but can be overwritten or released on the next call to a FreeType function.

    -
    -
    since
    + +

    since

    2.3.6

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Face_GetCharsOfVariant

    -
    -Defined in FT_FREETYPE_H (freetype.h). -

    -
     
    +
    + + +
    +

    FT_Face_GetCharsOfVariant

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
       FT_EXPORT( FT_UInt32* )
       FT_Face_GetCharsOfVariant( FT_Face   face,
                                  FT_ULong  variantSelector );
    +
    -

    -

    Return a zero-terminated list of Unicode character codes found for the specified variant selector.

    -

    -
    input
    -

    - -
    face + +

    input

    + + -
    face

    A handle to the source face object.

    variantSelector +
    variantSelector

    The variant selector code point in Unicode.

    -
    -
    return
    + +

    return

    A list of all the code points that are specified by this selector (both default and non-default codes are returned) or NULL if there is no valid cmap or the variant selector is invalid.

    -
    -
    note
    + +

    note

    The last item in the array is 0; the array is owned by the FT_Face object but can be overwritten or released on the next call to a FreeType function.

    -
    -
    since
    + +

    since

    2.3.6

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-gx_validation.html b/freetype/docs/reference/ft2-gx_validation.html index 9a1f1c22b..ff2eef6ac 100644 --- a/freetype/docs/reference/ft2-gx_validation.html +++ b/freetype/docs/reference/ft2-gx_validation.html @@ -3,354 +3,360 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -TrueTypeGX/AAT Validation -

    +

    TrueTypeGX/AAT Validation

    Synopsis

    - - - - -
    FT_VALIDATE_GX_LENGTHFT_TrueTypeGX_FreeFT_ClassicKern_Free
    FT_VALIDATE_GXXXXFT_VALIDATE_CKERNXXX
    FT_TrueTypeGX_ValidateFT_ClassicKern_Validate


    - -
    -

    This section contains the declaration of functions to validate some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop, lcar).

    -

    -
    -

    FT_VALIDATE_GX_LENGTH

    -
    -Defined in FT_GX_VALIDATE_H (ftgxval.h). -

    -
    +
    +
    +
    +
    +
    FT_TrueTypeGX_ValidateFT_ClassicKern_ValidateFT_VALIDATE_GX_LENGTH
    FT_TrueTypeGX_FreeFT_ClassicKern_FreeFT_VALIDATE_GXXXX
      FT_VALIDATE_CKERNXXX
    -#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1) -

    -
    -

    The number of tables checked in this module. Use it as a parameter for the ‘table-length’ argument of function FT_TrueTypeGX_Validate.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_VALIDATE_GXXXX

    -
    -Defined in FT_GX_VALIDATE_H (ftgxval.h). -

    -
    -
    -#define FT_VALIDATE_feat  FT_VALIDATE_GX_BITFIELD( feat )
    -#define FT_VALIDATE_mort  FT_VALIDATE_GX_BITFIELD( mort )
    -#define FT_VALIDATE_morx  FT_VALIDATE_GX_BITFIELD( morx )
    -#define FT_VALIDATE_bsln  FT_VALIDATE_GX_BITFIELD( bsln )
    -#define FT_VALIDATE_just  FT_VALIDATE_GX_BITFIELD( just )
    -#define FT_VALIDATE_kern  FT_VALIDATE_GX_BITFIELD( kern )
    -#define FT_VALIDATE_opbd  FT_VALIDATE_GX_BITFIELD( opbd )
    -#define FT_VALIDATE_trak  FT_VALIDATE_GX_BITFIELD( trak )
    -#define FT_VALIDATE_prop  FT_VALIDATE_GX_BITFIELD( prop )
    -#define FT_VALIDATE_lcar  FT_VALIDATE_GX_BITFIELD( lcar )
    -
    -#define FT_VALIDATE_GX  ( FT_VALIDATE_feat | \
    -                          FT_VALIDATE_mort | \
    -                          FT_VALIDATE_morx | \
    -                          FT_VALIDATE_bsln | \
    -                          FT_VALIDATE_just | \
    -                          FT_VALIDATE_kern | \
    -                          FT_VALIDATE_opbd | \
    -                          FT_VALIDATE_trak | \
    -                          FT_VALIDATE_prop | \
    -                          FT_VALIDATE_lcar )
    -
    -

    -
    -

    A list of bit-field constants used with FT_TrueTypeGX_Validate to indicate which TrueTypeGX/AAT Type tables should be validated.

    -

    -
    values
    -

    - - - - - - - - - - - - -
    FT_VALIDATE_feat -

    Validate ‘feat’ table.

    -
    FT_VALIDATE_mort -

    Validate ‘mort’ table.

    -
    FT_VALIDATE_morx -

    Validate ‘morx’ table.

    -
    FT_VALIDATE_bsln -

    Validate ‘bsln’ table.

    -
    FT_VALIDATE_just -

    Validate ‘just’ table.

    -
    FT_VALIDATE_kern -

    Validate ‘kern’ table.

    -
    FT_VALIDATE_opbd -

    Validate ‘opbd’ table.

    -
    FT_VALIDATE_trak -

    Validate ‘trak’ table.

    -
    FT_VALIDATE_prop -

    Validate ‘prop’ table.

    -
    FT_VALIDATE_lcar -

    Validate ‘lcar’ table.

    -
    FT_VALIDATE_GX -

    Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop and lcar).

    -
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_TrueTypeGX_Validate

    -
    -Defined in FT_GX_VALIDATE_H (ftgxval.h). -

    -
    +

    This section contains the declaration of functions to validate some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop, lcar).

    +
    +

    FT_TrueTypeGX_Validate

    +

    Defined in FT_GX_VALIDATE_H (ftgxval.h).

    +
       FT_EXPORT( FT_Error )
       FT_TrueTypeGX_Validate( FT_Face   face,
                               FT_UInt   validation_flags,
                               FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],
                               FT_UInt   table_length );
    +
    -

    -

    Validate various TrueTypeGX tables to assure that all offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming).

    -

    -
    input
    -

    - -
    face + +

    input

    + + - -
    face

    A handle to the input face.

    validation_flags +
    validation_flags

    A bit field that specifies the tables to be validated. See FT_VALIDATE_GXXXX for possible values.

    table_length +
    table_length

    The size of the ‘tables’ array. Normally, FT_VALIDATE_GX_LENGTH should be passed.

    -
    -
    output
    -

    - -
    tables + +

    output

    + +
    tables

    The array where all validated sfnt tables are stored. The array itself must be allocated by a client.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function only works with TrueTypeGX fonts, returning an error otherwise.

    After use, the application should deallocate the buffers pointed to by each ‘tables’ element, by calling FT_TrueTypeGX_Free. A NULL value indicates that the table either doesn't exist in the font, the application hasn't asked for validation, or the validator doesn't have the ability to validate the sfnt table.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_TrueTypeGX_Free

    -
    -Defined in FT_GX_VALIDATE_H (ftgxval.h). -

    -
     
    +
    + + +
    +

    FT_TrueTypeGX_Free

    +

    Defined in FT_GX_VALIDATE_H (ftgxval.h).

    +
       FT_EXPORT( void )
       FT_TrueTypeGX_Free( FT_Face   face,
                           FT_Bytes  table );
    +
    -

    -

    Free the buffer allocated by TrueTypeGX validator.

    -

    -
    input
    -

    - -
    face + +

    input

    + + -
    face

    A handle to the input face.

    table +
    table

    The pointer to the buffer allocated by FT_TrueTypeGX_Validate.

    -
    -
    note
    + +

    note

    This function must be used to free the buffer allocated by FT_TrueTypeGX_Validate only.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_VALIDATE_CKERNXXX

    -
    -Defined in FT_GX_VALIDATE_H (ftgxval.h). -

    -
    -
    -#define FT_VALIDATE_MS     ( FT_VALIDATE_GX_START << 0 )
    -#define FT_VALIDATE_APPLE  ( FT_VALIDATE_GX_START << 1 )
    -
    -#define FT_VALIDATE_CKERN  ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
    -
    -

    -
    -

    A list of bit-field constants used with FT_ClassicKern_Validate to indicate the classic kern dialect or dialects. If the selected type doesn't fit, FT_ClassicKern_Validate regards the table as invalid.

    -

    -
    values
    -

    - - - - -
    FT_VALIDATE_MS -

    Handle the ‘kern’ table as a classic Microsoft kern table.

    -
    FT_VALIDATE_APPLE -

    Handle the ‘kern’ table as a classic Apple kern table.

    -
    FT_VALIDATE_CKERN -

    Handle the ‘kern’ as either classic Apple or Microsoft kern table.

    -
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_ClassicKern_Validate

    -
    -Defined in FT_GX_VALIDATE_H (ftgxval.h). -

    -
     
    +
    + + +
    +

    FT_ClassicKern_Validate

    +

    Defined in FT_GX_VALIDATE_H (ftgxval.h).

    +
       FT_EXPORT( FT_Error )
       FT_ClassicKern_Validate( FT_Face    face,
                                FT_UInt    validation_flags,
                                FT_Bytes  *ckern_table );
    +
    -

    -

    Validate classic (16-bit format) kern table to assure that the offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming).

    The ‘kern’ table validator in FT_TrueTypeGX_Validate deals with both the new 32-bit format and the classic 16-bit format, while FT_ClassicKern_Validate only supports the classic 16-bit format.

    -

    -
    input
    -

    - -
    face + +

    input

    + + -
    face

    A handle to the input face.

    validation_flags +
    validation_flags

    A bit field that specifies the dialect to be validated. See FT_VALIDATE_CKERNXXX for possible values.

    -
    -
    output
    -

    - -
    ckern_table + +

    output

    + +
    ckern_table

    A pointer to the kern table.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    After use, the application should deallocate the buffers pointed to by ‘ckern_table’, by calling FT_ClassicKern_Free. A NULL value indicates that the table doesn't exist in the font.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_ClassicKern_Free

    -
    -Defined in FT_GX_VALIDATE_H (ftgxval.h). -

    -
     
    +
    + + +
    +

    FT_ClassicKern_Free

    +

    Defined in FT_GX_VALIDATE_H (ftgxval.h).

    +
       FT_EXPORT( void )
       FT_ClassicKern_Free( FT_Face   face,
                            FT_Bytes  table );
    +
    -

    -

    Free the buffer allocated by classic Kern validator.

    -

    -
    input
    -

    - -
    face + +

    input

    + + -
    face

    A handle to the input face.

    table +
    table

    The pointer to the buffer that is allocated by FT_ClassicKern_Validate.

    -
    -
    note
    + +

    note

    This function must be used to free the buffer allocated by FT_ClassicKern_Validate only.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + + +
    +

    FT_VALIDATE_GX_LENGTH

    +

    Defined in FT_GX_VALIDATE_H (ftgxval.h).

    +
    +#define FT_VALIDATE_GX_LENGTH     (FT_VALIDATE_GX_LAST_INDEX + 1)
    +
    + +

    The number of tables checked in this module. Use it as a parameter for the ‘table-length’ argument of function FT_TrueTypeGX_Validate.

    + +
    +
    + +
    +

    FT_VALIDATE_GXXXX

    +

    Defined in FT_GX_VALIDATE_H (ftgxval.h).

    +
    +#define FT_VALIDATE_feat  FT_VALIDATE_GX_BITFIELD( feat )
    +#define FT_VALIDATE_mort  FT_VALIDATE_GX_BITFIELD( mort )
    +#define FT_VALIDATE_morx  FT_VALIDATE_GX_BITFIELD( morx )
    +#define FT_VALIDATE_bsln  FT_VALIDATE_GX_BITFIELD( bsln )
    +#define FT_VALIDATE_just  FT_VALIDATE_GX_BITFIELD( just )
    +#define FT_VALIDATE_kern  FT_VALIDATE_GX_BITFIELD( kern )
    +#define FT_VALIDATE_opbd  FT_VALIDATE_GX_BITFIELD( opbd )
    +#define FT_VALIDATE_trak  FT_VALIDATE_GX_BITFIELD( trak )
    +#define FT_VALIDATE_prop  FT_VALIDATE_GX_BITFIELD( prop )
    +#define FT_VALIDATE_lcar  FT_VALIDATE_GX_BITFIELD( lcar )
    +
    +#define FT_VALIDATE_GX  ( FT_VALIDATE_feat | \
    +                          FT_VALIDATE_mort | \
    +                          FT_VALIDATE_morx | \
    +                          FT_VALIDATE_bsln | \
    +                          FT_VALIDATE_just | \
    +                          FT_VALIDATE_kern | \
    +                          FT_VALIDATE_opbd | \
    +                          FT_VALIDATE_trak | \
    +                          FT_VALIDATE_prop | \
    +                          FT_VALIDATE_lcar )
    +
    + +

    A list of bit-field constants used with FT_TrueTypeGX_Validate to indicate which TrueTypeGX/AAT Type tables should be validated.

    + +

    values

    + + + + + + + + + + + + +
    FT_VALIDATE_feat +

    Validate ‘feat’ table.

    +
    FT_VALIDATE_mort +

    Validate ‘mort’ table.

    +
    FT_VALIDATE_morx +

    Validate ‘morx’ table.

    +
    FT_VALIDATE_bsln +

    Validate ‘bsln’ table.

    +
    FT_VALIDATE_just +

    Validate ‘just’ table.

    +
    FT_VALIDATE_kern +

    Validate ‘kern’ table.

    +
    FT_VALIDATE_opbd +

    Validate ‘opbd’ table.

    +
    FT_VALIDATE_trak +

    Validate ‘trak’ table.

    +
    FT_VALIDATE_prop +

    Validate ‘prop’ table.

    +
    FT_VALIDATE_lcar +

    Validate ‘lcar’ table.

    +
    FT_VALIDATE_GX +

    Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop and lcar).

    +
    + +
    +
    + +
    +

    FT_VALIDATE_CKERNXXX

    +

    Defined in FT_GX_VALIDATE_H (ftgxval.h).

    +
    +#define FT_VALIDATE_MS     ( FT_VALIDATE_GX_START << 0 )
    +#define FT_VALIDATE_APPLE  ( FT_VALIDATE_GX_START << 1 )
    +
    +#define FT_VALIDATE_CKERN  ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
    +
    + +

    A list of bit-field constants used with FT_ClassicKern_Validate to indicate the classic kern dialect or dialects. If the selected type doesn't fit, FT_ClassicKern_Validate regards the table as invalid.

    + +

    values

    + + + + +
    FT_VALIDATE_MS +

    Handle the ‘kern’ table as a classic Microsoft kern table.

    +
    FT_VALIDATE_APPLE +

    Handle the ‘kern’ table as a classic Apple kern table.

    +
    FT_VALIDATE_CKERN +

    Handle the ‘kern’ as either classic Apple or Microsoft kern table.

    +
    + +
    +
    diff --git a/freetype/docs/reference/ft2-gzip.html b/freetype/docs/reference/ft2-gzip.html index 6a0c6d249..c7e5a84f3 100644 --- a/freetype/docs/reference/ft2-gzip.html +++ b/freetype/docs/reference/ft2-gzip.html @@ -3,152 +3,197 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -GZIP Streams -

    +

    GZIP Streams

    Synopsis

    - - -
    FT_Stream_OpenGzipFT_Gzip_Uncompress


    + + +
    FT_Stream_OpenGzipFT_Gzip_Uncompress
    + -

    This section contains the declaration of Gzip-specific functions.

    -

    -
    -

    FT_Stream_OpenGzip

    -
    -Defined in FT_GZIP_H (ftgzip.h). -

    -
     
    +
    +

    FT_Stream_OpenGzip

    +

    Defined in FT_GZIP_H (ftgzip.h).

    +
       FT_EXPORT( FT_Error )
       FT_Stream_OpenGzip( FT_Stream  stream,
                           FT_Stream  source );
    +
    -

    -

    Open a new stream to parse gzip-compressed font files. This is mainly used to support the compressed ‘*.pcf.gz’ fonts that come with XFree86.

    -

    -
    input
    -

    - -
    stream + +

    input

    + + -
    stream

    The target embedding stream.

    source +
    source

    The source stream.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The source stream must be opened before calling this function.

    Calling the internal function ‘FT_Stream_Close’ on the new stream will not call ‘FT_Stream_Close’ on the source stream. None of the stream objects will be released to the heap.

    The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream.

    In certain builds of the library, gzip compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face. This means that if no font driver is capable of handling the raw compressed file, the library will try to open a gzipped stream from it and re-open the face with it.

    This function may return ‘FT_Err_Unimplemented_Feature’ if your build of FreeType was not compiled with zlib support.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Gzip_Uncompress

    -
    -Defined in FT_GZIP_H (ftgzip.h). -

    -
     
    +
    + + +
    +

    FT_Gzip_Uncompress

    +

    Defined in FT_GZIP_H (ftgzip.h).

    +
       FT_EXPORT( FT_Error )
       FT_Gzip_Uncompress( FT_Memory       memory,
                           FT_Byte*        output,
                           FT_ULong*       output_len,
                           const FT_Byte*  input,
                           FT_ULong        input_len );
    +
    -

    -

    Decompress a zipped input buffer into an output buffer. This function is modeled after zlib's ‘uncompress’ function.

    -

    -
    input
    -

    - -
    memory + +

    input

    + + - -
    memory

    A FreeType memory handle.

    input +
    input

    The input buffer.

    input_len +
    input_len

    The length of the input buffer.

    -
    -
    output
    -

    - -
    output + +

    output

    + +
    output

    The output buffer.

    -
    -
    inout
    -

    - -
    output_len + +

    inout

    + +
    output_len

    Before calling the function, this is the the total size of the output buffer, which must be large enough to hold the entire uncompressed data (so the size of the uncompressed data must be known in advance). After calling the function, ‘output_len’ is the size of the used data in ‘output’.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function may return ‘FT_Err_Unimplemented_Feature’ if your build of FreeType was not compiled with zlib support.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-header_file_macros.html b/freetype/docs/reference/ft2-header_file_macros.html index d703415de..35954db9a 100644 --- a/freetype/docs/reference/ft2-header_file_macros.html +++ b/freetype/docs/reference/ft2-header_file_macros.html @@ -3,73 +3,136 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Header File Macros -

    +

    Header File Macros

    Synopsis

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FT_CONFIG_CONFIG_HFT_LZW_H
    FT_CONFIG_STANDARD_LIBRARY_HFT_BZIP2_H
    FT_CONFIG_OPTIONS_HFT_WINFONTS_H
    FT_CONFIG_MODULES_HFT_GLYPH_H
    FT_FREETYPE_HFT_BITMAP_H
    FT_ERRORS_HFT_BBOX_H
    FT_MODULE_ERRORS_HFT_CACHE_H
    FT_SYSTEM_HFT_CACHE_IMAGE_H
    FT_IMAGE_HFT_CACHE_SMALL_BITMAPS_H
    FT_TYPES_HFT_CACHE_CHARMAP_H
    FT_LIST_HFT_MAC_H
    FT_OUTLINE_HFT_MULTIPLE_MASTERS_H
    FT_SIZES_HFT_SFNT_NAMES_H
    FT_MODULE_HFT_OPENTYPE_VALIDATE_H
    FT_RENDER_HFT_GX_VALIDATE_H
    FT_AUTOHINTER_HFT_PFR_H
    FT_CFF_DRIVER_HFT_STROKER_H
    FT_TRUETYPE_DRIVER_HFT_SYNTHESIS_H
    FT_TYPE1_TABLES_HFT_XFREE86_H
    FT_TRUETYPE_IDS_HFT_TRIGONOMETRY_H
    FT_TRUETYPE_TABLES_HFT_LCD_FILTER_H
    FT_TRUETYPE_TAGS_HFT_UNPATENTED_HINTING_H
    FT_BDF_HFT_INCREMENTAL_H
    FT_CID_HFT_GASP_H
    FT_GZIP_HFT_ADVANCES_H


    - -
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FT_CONFIG_CONFIG_HFT_LZW_H
    FT_CONFIG_STANDARD_LIBRARY_HFT_BZIP2_H
    FT_CONFIG_OPTIONS_HFT_WINFONTS_H
    FT_CONFIG_MODULES_HFT_GLYPH_H
    FT_FREETYPE_HFT_BITMAP_H
    FT_ERRORS_HFT_BBOX_H
    FT_MODULE_ERRORS_HFT_CACHE_H
    FT_SYSTEM_HFT_CACHE_IMAGE_H
    FT_IMAGE_HFT_CACHE_SMALL_BITMAPS_H
    FT_TYPES_HFT_CACHE_CHARMAP_H
    FT_LIST_HFT_MAC_H
    FT_OUTLINE_HFT_MULTIPLE_MASTERS_H
    FT_SIZES_HFT_SFNT_NAMES_H
    FT_MODULE_HFT_OPENTYPE_VALIDATE_H
    FT_RENDER_HFT_GX_VALIDATE_H
    FT_AUTOHINTER_HFT_PFR_H
    FT_CFF_DRIVER_HFT_STROKER_H
    FT_TRUETYPE_DRIVER_HFT_SYNTHESIS_H
    FT_TYPE1_TABLES_HFT_XFREE86_H
    FT_TRUETYPE_IDS_HFT_TRIGONOMETRY_H
    FT_TRUETYPE_TABLES_HFT_LCD_FILTER_H
    FT_TRUETYPE_TAGS_HFT_UNPATENTED_HINTING_H
    FT_BDF_HFT_INCREMENTAL_H
    FT_CID_HFT_GASP_H
    FT_GZIP_HFT_ADVANCES_H
    + +

    The following macros are defined to the name of specific FreeType 2 header files. They can be used directly in #include statements as in:

       #include FT_FREETYPE_H                                           
    @@ -78,825 +141,575 @@ Header File Macros
     

    There are several reasons why we are now using macros to name public header files. The first one is that such macros are not limited to the infamous 8.3 naming rule required by DOS (and ‘FT_MULTIPLE_MASTERS_H’ is a lot more meaningful than ‘ftmm.h’).

    The second reason is that it allows for more flexibility in the way FreeType 2 is installed on a given system.

    -

    -
    -

    FT_CONFIG_CONFIG_H

    -
     
    +
    +

    FT_CONFIG_CONFIG_H

    +
     #ifndef FT_CONFIG_CONFIG_H
     #define FT_CONFIG_CONFIG_H  <config/ftconfig.h>
     #endif
    +
    -

    -

    A macro used in #include statements to name the file containing FreeType 2 configuration data.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_CONFIG_STANDARD_LIBRARY_H

    -
    +
    + +
    +

    FT_CONFIG_STANDARD_LIBRARY_H

    +
     #ifndef FT_CONFIG_STANDARD_LIBRARY_H
     #define FT_CONFIG_STANDARD_LIBRARY_H  <config/ftstdlib.h>
     #endif
    +
    -

    -

    A macro used in #include statements to name the file containing FreeType 2 interface to the standard C library functions.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_CONFIG_OPTIONS_H

    -
    +
    + +
    +

    FT_CONFIG_OPTIONS_H

    +
     #ifndef FT_CONFIG_OPTIONS_H
     #define FT_CONFIG_OPTIONS_H  <config/ftoption.h>
     #endif
    +
    -

    -

    A macro used in #include statements to name the file containing FreeType 2 project-specific configuration options.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_CONFIG_MODULES_H

    -
    +
    + +
    +

    FT_CONFIG_MODULES_H

    +
     #ifndef FT_CONFIG_MODULES_H
     #define FT_CONFIG_MODULES_H  <config/ftmodule.h>
     #endif
    +
    -

    -

    A macro used in #include statements to name the file containing the list of FreeType 2 modules that are statically linked to new library instances in FT_Init_FreeType.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_FREETYPE_H

    -
    +
    + +
    +

    FT_FREETYPE_H

    +
     #define FT_FREETYPE_H  <freetype.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the base FreeType 2 API.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_ERRORS_H

    -
    +
    + +
    +

    FT_ERRORS_H

    +
     #define FT_ERRORS_H  <fterrors.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the list of FreeType 2 error codes (and messages).

    It is included by FT_FREETYPE_H.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_MODULE_ERRORS_H

    -
    +
    + +
    +

    FT_MODULE_ERRORS_H

    +
     #define FT_MODULE_ERRORS_H  <ftmoderr.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the list of FreeType 2 module error offsets (and messages).

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_SYSTEM_H

    -
    +
    + +
    +

    FT_SYSTEM_H

    +
     #define FT_SYSTEM_H  <ftsystem.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the FreeType 2 interface to low-level operations (i.e., memory management and stream i/o).

    It is included by FT_FREETYPE_H.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_IMAGE_H

    -
    +
    + +
    +

    FT_IMAGE_H

    +
     #define FT_IMAGE_H  <ftimage.h>
    +
    -

    -

    A macro used in #include statements to name the file containing type definitions related to glyph images (i.e., bitmaps, outlines, scan-converter parameters).

    It is included by FT_FREETYPE_H.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_TYPES_H

    -
    +
    + +
    +

    FT_TYPES_H

    +
     #define FT_TYPES_H  <fttypes.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the basic data types defined by FreeType 2.

    It is included by FT_FREETYPE_H.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_LIST_H

    -
    +
    + +
    +

    FT_LIST_H

    +
     #define FT_LIST_H  <ftlist.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the list management API of FreeType 2.

    (Most applications will never need to include this file.)

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_OUTLINE_H

    -
    +
    + +
    +

    FT_OUTLINE_H

    +
     #define FT_OUTLINE_H  <ftoutln.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the scalable outline management API of FreeType 2.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_SIZES_H

    -
    +
    + +
    +

    FT_SIZES_H

    +
     #define FT_SIZES_H  <ftsizes.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the API which manages multiple FT_Size objects per face.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_MODULE_H

    -
    +
    + +
    +

    FT_MODULE_H

    +
     #define FT_MODULE_H  <ftmodapi.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the module management API of FreeType 2.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_RENDER_H

    -
    +
    + +
    +

    FT_RENDER_H

    +
     #define FT_RENDER_H  <ftrender.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the renderer module management API of FreeType 2.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_AUTOHINTER_H

    -
    +
    + +
    +

    FT_AUTOHINTER_H

    +
     #define FT_AUTOHINTER_H  <ftautoh.h>
    +
    -

    -

    A macro used in #include statements to name the file containing structures and macros related to the auto-hinting module.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_CFF_DRIVER_H

    -
    +
    + +
    +

    FT_CFF_DRIVER_H

    +
     #define FT_CFF_DRIVER_H  <ftcffdrv.h>
    +
    -

    -

    A macro used in #include statements to name the file containing structures and macros related to the CFF driver module.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_TRUETYPE_DRIVER_H

    -
    +
    + +
    +

    FT_TRUETYPE_DRIVER_H

    +
     #define FT_TRUETYPE_DRIVER_H  <ftttdrv.h>
    +
    -

    -

    A macro used in #include statements to name the file containing structures and macros related to the TrueType driver module.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_TYPE1_TABLES_H

    -
    +
    + +
    +

    FT_TYPE1_TABLES_H

    +
     #define FT_TYPE1_TABLES_H  <t1tables.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the types and API specific to the Type 1 format.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_TRUETYPE_IDS_H

    -
    +
    + +
    +

    FT_TRUETYPE_IDS_H

    +
     #define FT_TRUETYPE_IDS_H  <ttnameid.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the enumeration values which identify name strings, languages, encodings, etc. This file really contains a large set of constant macro definitions, taken from the TrueType and OpenType specifications.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_TRUETYPE_TABLES_H

    -
    +
    + +
    +

    FT_TRUETYPE_TABLES_H

    +
     #define FT_TRUETYPE_TABLES_H  <tttables.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the types and API specific to the TrueType (as well as OpenType) format.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_TRUETYPE_TAGS_H

    -
    +
    + +
    +

    FT_TRUETYPE_TAGS_H

    +
     #define FT_TRUETYPE_TAGS_H  <tttags.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the definitions of TrueType four-byte ‘tags’ which identify blocks in SFNT-based font formats (i.e., TrueType and OpenType).

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_BDF_H

    -
    +
    + +
    +

    FT_BDF_H

    +
     #define FT_BDF_H  <ftbdf.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the definitions of an API which accesses BDF-specific strings from a face.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_CID_H

    -
    +
    + +
    +

    FT_CID_H

    +
     #define FT_CID_H  <ftcid.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the definitions of an API which access CID font information from a face.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_GZIP_H

    -
    +
    + +
    +

    FT_GZIP_H

    +
     #define FT_GZIP_H  <ftgzip.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the definitions of an API which supports gzip-compressed files.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_LZW_H

    -
    +
    + +
    +

    FT_LZW_H

    +
     #define FT_LZW_H  <ftlzw.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the definitions of an API which supports LZW-compressed files.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_BZIP2_H

    -
    +
    + +
    +

    FT_BZIP2_H

    +
     #define FT_BZIP2_H  <ftbzip2.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the definitions of an API which supports bzip2-compressed files.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_WINFONTS_H

    -
    +
    + +
    +

    FT_WINFONTS_H

    +
     #define FT_WINFONTS_H   <ftwinfnt.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the definitions of an API which supports Windows FNT files.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_GLYPH_H

    -
    +
    + +
    +

    FT_GLYPH_H

    +
     #define FT_GLYPH_H  <ftglyph.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the API of the optional glyph management component.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_BITMAP_H

    -
    +
    + +
    +

    FT_BITMAP_H

    +
     #define FT_BITMAP_H  <ftbitmap.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the API of the optional bitmap conversion component.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_BBOX_H

    -
    +
    + +
    +

    FT_BBOX_H

    +
     #define FT_BBOX_H  <ftbbox.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the API of the optional exact bounding box computation routines.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_CACHE_H

    -
    +
    + +
    +

    FT_CACHE_H

    +
     #define FT_CACHE_H  <ftcache.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the API of the optional FreeType 2 cache sub-system.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_CACHE_IMAGE_H

    -
    +
    + +
    +

    FT_CACHE_IMAGE_H

    +
     #define FT_CACHE_IMAGE_H  FT_CACHE_H
    +
    -

    -

    A macro used in #include statements to name the file containing the ‘glyph image’ API of the FreeType 2 cache sub-system.

    It is used to define a cache for FT_Glyph elements. You can also use the API defined in FT_CACHE_SMALL_BITMAPS_H if you only need to store small glyph bitmaps, as it will use less memory.

    This macro is deprecated. Simply include FT_CACHE_H to have all glyph image-related cache declarations.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_CACHE_SMALL_BITMAPS_H

    -
    +
    + +
    +

    FT_CACHE_SMALL_BITMAPS_H

    +
     #define FT_CACHE_SMALL_BITMAPS_H  FT_CACHE_H
    +
    -

    -

    A macro used in #include statements to name the file containing the ‘small bitmaps’ API of the FreeType 2 cache sub-system.

    It is used to define a cache for small glyph bitmaps in a relatively memory-efficient way. You can also use the API defined in FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images, including scalable outlines.

    This macro is deprecated. Simply include FT_CACHE_H to have all small bitmaps-related cache declarations.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_CACHE_CHARMAP_H

    -
    +
    + +
    +

    FT_CACHE_CHARMAP_H

    +
     #define FT_CACHE_CHARMAP_H  FT_CACHE_H
    +
    -

    -

    A macro used in #include statements to name the file containing the ‘charmap’ API of the FreeType 2 cache sub-system.

    This macro is deprecated. Simply include FT_CACHE_H to have all charmap-based cache declarations.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_MAC_H

    -
    +
    + +
    +

    FT_MAC_H

    +
     #define FT_MAC_H  <ftmac.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the Macintosh-specific FreeType 2 API. The latter is used to access fonts embedded in resource forks.

    This header file must be explicitly included by client applications compiled on the Mac (note that the base API still works though).

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_MULTIPLE_MASTERS_H

    -
    +
    + +
    +

    FT_MULTIPLE_MASTERS_H

    +
     #define FT_MULTIPLE_MASTERS_H  <ftmm.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the optional multiple-masters management API of FreeType 2.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_SFNT_NAMES_H

    -
    +
    + +
    +

    FT_SFNT_NAMES_H

    +
     #define FT_SFNT_NAMES_H  <ftsnames.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the optional FreeType 2 API which accesses embedded ‘name’ strings in SFNT-based font formats (i.e., TrueType and OpenType).

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_OPENTYPE_VALIDATE_H

    -
    +
    + +
    +

    FT_OPENTYPE_VALIDATE_H

    +
     #define FT_OPENTYPE_VALIDATE_H  <ftotval.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the optional FreeType 2 API which validates OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF).

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_GX_VALIDATE_H

    -
    +
    + +
    +

    FT_GX_VALIDATE_H

    +
     #define FT_GX_VALIDATE_H  <ftgxval.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the optional FreeType 2 API which validates TrueTypeGX/AAT tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop).

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_PFR_H

    -
    +
    + +
    +

    FT_PFR_H

    +
     #define FT_PFR_H  <ftpfr.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the FreeType 2 API which accesses PFR-specific data.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_STROKER_H

    -
    +
    + +
    +

    FT_STROKER_H

    +
     #define FT_STROKER_H  <ftstroke.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the FreeType 2 API which provides functions to stroke outline paths.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_SYNTHESIS_H

    -
    +
    + +
    +

    FT_SYNTHESIS_H

    +
     #define FT_SYNTHESIS_H  <ftsynth.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the FreeType 2 API which performs artificial obliquing and emboldening.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_XFREE86_H

    -
    +
    + +
    +

    FT_XFREE86_H

    +
     #define FT_XFREE86_H  <ftxf86.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the FreeType 2 API which provides functions specific to the XFree86 and X.Org X11 servers.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_TRIGONOMETRY_H

    -
    +
    + +
    +

    FT_TRIGONOMETRY_H

    +
     #define FT_TRIGONOMETRY_H  <fttrigon.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the FreeType 2 API which performs trigonometric computations (e.g., cosines and arc tangents).

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_LCD_FILTER_H

    -
    +
    + +
    +

    FT_LCD_FILTER_H

    +
     #define FT_LCD_FILTER_H  <ftlcdfil.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the FreeType 2 API which performs color filtering for subpixel rendering.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_UNPATENTED_HINTING_H

    -
    +
    + +
    +

    FT_UNPATENTED_HINTING_H

    +
     #define FT_UNPATENTED_HINTING_H  <ttunpat.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the FreeType 2 API which performs color filtering for subpixel rendering.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_INCREMENTAL_H

    -
    +
    + +
    +

    FT_INCREMENTAL_H

    +
     #define FT_INCREMENTAL_H  <ftincrem.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the FreeType 2 API which performs color filtering for subpixel rendering.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_GASP_H

    -
    +
    + +
    +

    FT_GASP_H

    +
     #define FT_GASP_H  <ftgasp.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the FreeType 2 API which returns entries from the TrueType GASP table.

    -

    -
    -
    - - -
    [Index][TOC]
    -
    -

    FT_ADVANCES_H

    -
    +
    + +
    +

    FT_ADVANCES_H

    +
     #define FT_ADVANCES_H  <ftadvanc.h>
    +
    -

    -

    A macro used in #include statements to name the file containing the FreeType 2 API which returns individual and ranged glyph advances.

    -

    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-header_inclusion.html b/freetype/docs/reference/ft2-header_inclusion.html index 5ca09dcf7..4171decb0 100644 --- a/freetype/docs/reference/ft2-header_inclusion.html +++ b/freetype/docs/reference/ft2-header_inclusion.html @@ -3,44 +3,107 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    + +

    FreeType's header inclusion scheme

    -

    -FreeType's header inclusion scheme -

    -

    To be as flexible as possible (and for historical reasons), FreeType uses a very special inclusion scheme to load header files, for example

       #include <ft2build.h>                                            
    @@ -49,6 +112,6 @@ FreeType's header inclusion scheme
       #include FT_OUTLINE_H                                            
     

    A compiler and its preprocessor only needs an include path to find the file ‘ft2build.h’; the exact locations and names of the other FreeType header files are hidden by preprocessor macro names, loaded by ‘ft2build.h’. The API documentation always gives the header macro name needed for a particular function.

    -

    + diff --git a/freetype/docs/reference/ft2-incremental.html b/freetype/docs/reference/ft2-incremental.html index 423aa0bb3..26225c255 100644 --- a/freetype/docs/reference/ft2-incremental.html +++ b/freetype/docs/reference/ft2-incremental.html @@ -3,87 +3,140 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Incremental Loading -

    +

    Incremental Loading

    Synopsis

    - - - - - - -
    FT_IncrementalFT_Incremental_GetGlyphMetricsFunc
    FT_Incremental_MetricsRecFT_Incremental_FuncsRec
    FT_Incremental_MetricsFT_Incremental_InterfaceRec
    FT_Incremental_GetGlyphDataFuncFT_Incremental_Interface
    FT_Incremental_FreeGlyphDataFuncFT_PARAM_TAG_INCREMENTAL


    - -
    -

    This section contains various functions used to perform so-called ‘incremental’ glyph loading. This is a mode where all glyphs loaded from a given FT_Face are provided by the client application,

    + + + + + + +
    FT_IncrementalFT_Incremental_GetGlyphMetricsFunc
    FT_Incremental_MetricsRecFT_Incremental_FuncsRec
    FT_Incremental_MetricsFT_Incremental_InterfaceRec
    FT_Incremental_GetGlyphDataFuncFT_Incremental_Interface
    FT_Incremental_FreeGlyphDataFuncFT_PARAM_TAG_INCREMENTAL
    + + +

    This section contains various functions used to perform so-called ‘incremental’ glyph loading. This is a mode where all glyphs loaded from a given FT_Face are provided by the client application.

    Apart from that, all other tables are loaded normally from the font file. This mode is useful when FreeType is used within another engine, e.g., a PostScript Imaging Processor.

    To enable this mode, you must use FT_Open_Face, passing an FT_Parameter with the FT_PARAM_TAG_INCREMENTAL tag and an FT_Incremental_Interface value. See the comments for FT_Incremental_InterfaceRec for an example.

    -

    -
    -

    FT_Incremental

    -
    -Defined in FT_INCREMENTAL_H (ftincrem.h). -

    -
     
    +
    +

    FT_Incremental

    +

    Defined in FT_INCREMENTAL_H (ftincrem.h).

    +
       typedef struct FT_IncrementalRec_*  FT_Incremental;
    +
    -

    -

    An opaque type describing a user-provided object used to implement ‘incremental’ glyph loading within FreeType. This is used to support embedded fonts in certain environments (e.g., PostScript interpreters), where the glyph data isn't in the font file, or must be overridden by different values.

    -

    -
    note
    + +

    note

    It is up to client applications to create and implement FT_Incremental objects, as long as they provide implementations for the methods FT_Incremental_GetGlyphDataFunc, FT_Incremental_FreeGlyphDataFunc and FT_Incremental_GetGlyphMetricsFunc.

    See the description of FT_Incremental_InterfaceRec to understand how to use incremental objects with FreeType.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Incremental_MetricsRec

    -
    -Defined in FT_INCREMENTAL_H (ftincrem.h). -

    -
     
    +
    + + +
    +

    FT_Incremental_MetricsRec

    +

    Defined in FT_INCREMENTAL_H (ftincrem.h).

    +
       typedef struct  FT_Incremental_MetricsRec_
       {
         FT_Long  bearing_x;
    @@ -92,193 +145,152 @@ Defined in FT_INCREMENTAL_H (ftincrem.h).
         FT_Long  advance_v;     /* since 2.3.12 */
     
       } FT_Incremental_MetricsRec;
    +
    -

    -

    A small structure used to contain the basic glyph metrics returned by the FT_Incremental_GetGlyphMetricsFunc method.

    -

    -
    fields
    -

    - -
    bearing_x + +

    fields

    + + - - -
    bearing_x

    Left bearing, in font units.

    bearing_y +
    bearing_y

    Top bearing, in font units.

    advance +
    advance

    Horizontal component of glyph advance, in font units.

    advance_v +
    advance_v

    Vertical component of glyph advance, in font units.

    -
    -
    note
    + +

    note

    These correspond to horizontal or vertical metrics depending on the value of the ‘vertical’ argument to the function FT_Incremental_GetGlyphMetricsFunc.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Incremental_Metrics

    -
    -Defined in FT_INCREMENTAL_H (ftincrem.h). -

    -
     
    +
    + + +
    +

    FT_Incremental_Metrics

    +

    Defined in FT_INCREMENTAL_H (ftincrem.h).

    +
        typedef struct FT_Incremental_MetricsRec_*  FT_Incremental_Metrics;
    +
    -

    -

    A handle to an FT_Incremental_MetricsRec structure.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Incremental_GetGlyphDataFunc

    -
    -Defined in FT_INCREMENTAL_H (ftincrem.h). -

    -
     
    +
    + + +
    +

    FT_Incremental_GetGlyphDataFunc

    +

    Defined in FT_INCREMENTAL_H (ftincrem.h).

    +
       typedef FT_Error
       (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental  incremental,
                                           FT_UInt         glyph_index,
                                           FT_Data*        adata );
    +
    -

    -

    A function called by FreeType to access a given glyph's data bytes during FT_Load_Glyph or FT_Load_Char if incremental loading is enabled.

    Note that the format of the glyph's data bytes depends on the font file format. For TrueType, it must correspond to the raw bytes within the ‘glyf’ table. For PostScript formats, it must correspond to the unencrypted charstring bytes, without any ‘lenIV’ header. It is undefined for any other format.

    -

    -
    input
    -

    - -
    incremental + +

    input

    + + -
    incremental

    Handle to an opaque FT_Incremental handle provided by the client application.

    glyph_index +
    glyph_index

    Index of relevant glyph.

    -
    -
    output
    -

    - -
    adata + +

    output

    + +
    adata

    A structure describing the returned glyph data bytes (which will be accessed as a read-only byte block).

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    If this function returns successfully the method FT_Incremental_FreeGlyphDataFunc will be called later to release the data bytes.

    Nested calls to FT_Incremental_GetGlyphDataFunc can happen for compound glyphs.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Incremental_FreeGlyphDataFunc

    -
    -Defined in FT_INCREMENTAL_H (ftincrem.h). -

    -
     
    +
    + + +
    +

    FT_Incremental_FreeGlyphDataFunc

    +

    Defined in FT_INCREMENTAL_H (ftincrem.h).

    +
       typedef void
       (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental  incremental,
                                            FT_Data*        data );
    +
    -

    -

    A function used to release the glyph data bytes returned by a successful call to FT_Incremental_GetGlyphDataFunc.

    -

    -
    input
    -

    - -
    incremental + +

    input

    + + -
    incremental

    A handle to an opaque FT_Incremental handle provided by the client application.

    data +
    data

    A structure describing the glyph data bytes (which will be accessed as a read-only byte block).

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Incremental_GetGlyphMetricsFunc

    -
    -Defined in FT_INCREMENTAL_H (ftincrem.h). -

    -
     
    +
    + + +
    +

    FT_Incremental_GetGlyphMetricsFunc

    +

    Defined in FT_INCREMENTAL_H (ftincrem.h).

    +
       typedef FT_Error
       (*FT_Incremental_GetGlyphMetricsFunc)
                           ( FT_Incremental              incremental,
                             FT_UInt                     glyph_index,
                             FT_Bool                     vertical,
                             FT_Incremental_MetricsRec  *ametrics );
    +
    -

    -

    A function used to retrieve the basic metrics of a given glyph index before accessing its data. This is necessary because, in certain formats like TrueType, the metrics are stored in a different place from the glyph images proper.

    -

    -
    input
    -

    - -
    incremental + +

    input

    + + - - -
    incremental

    A handle to an opaque FT_Incremental handle provided by the client application.

    glyph_index +
    glyph_index

    Index of relevant glyph.

    vertical +
    vertical

    If true, return vertical metrics.

    ametrics +
    ametrics

    This parameter is used for both input and output. The original glyph metrics, if any, in font units. If metrics are not available all the values must be set to zero.

    -
    -
    output
    -

    - -
    ametrics + +

    output

    + +
    ametrics

    The replacement glyph metrics in font units.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Incremental_FuncsRec

    -
    -Defined in FT_INCREMENTAL_H (ftincrem.h). -

    -
     
    +
    + + +
    +

    FT_Incremental_FuncsRec

    +

    Defined in FT_INCREMENTAL_H (ftincrem.h).

    +
       typedef struct  FT_Incremental_FuncsRec_
       {
         FT_Incremental_GetGlyphDataFunc     get_glyph_data;
    @@ -286,47 +298,38 @@ Defined in FT_INCREMENTAL_H (ftincrem.h).
         FT_Incremental_GetGlyphMetricsFunc  get_glyph_metrics;
     
       } FT_Incremental_FuncsRec;
    +
    -

    -

    A table of functions for accessing fonts that load data incrementally. Used in FT_Incremental_InterfaceRec.

    -

    -
    fields
    -

    - -
    get_glyph_data + +

    fields

    + + - -
    get_glyph_data

    The function to get glyph data. Must not be null.

    free_glyph_data +
    free_glyph_data

    The function to release glyph data. Must not be null.

    get_glyph_metrics +
    get_glyph_metrics

    The function to get glyph metrics. May be null if the font does not provide overriding glyph metrics.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Incremental_InterfaceRec

    -
    -Defined in FT_INCREMENTAL_H (ftincrem.h). -

    -
     
    +
    + + +
    +

    FT_Incremental_InterfaceRec

    +

    Defined in FT_INCREMENTAL_H (ftincrem.h).

    +
       typedef struct  FT_Incremental_InterfaceRec_
       {
         const FT_Incremental_FuncsRec*  funcs;
         FT_Incremental                  object;
     
       } FT_Incremental_InterfaceRec;
    +
    -

    -

    A structure to be used with FT_Open_Face to indicate that the user wants to support incremental glyph loading. You should use it with FT_PARAM_TAG_INCREMENTAL as in the following example:

       FT_Incremental_InterfaceRec  inc_int;
    @@ -352,50 +355,33 @@ Defined in FT_INCREMENTAL_H (ftincrem.h).
       error = FT_Open_Face( library, &open_args, index, &face );
       ...
     
    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Incremental_Interface

    -
    -Defined in FT_INCREMENTAL_H (ftincrem.h). -

    -
     
    +
    + + +
    +

    FT_Incremental_Interface

    +

    Defined in FT_INCREMENTAL_H (ftincrem.h).

    +
       typedef FT_Incremental_InterfaceRec*   FT_Incremental_Interface;
    +
    -

    -

    A pointer to an FT_Incremental_InterfaceRec structure.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_PARAM_TAG_INCREMENTAL

    -
    -Defined in FT_INCREMENTAL_H (ftincrem.h). -

    -
     
    +
    + + +
    +

    FT_PARAM_TAG_INCREMENTAL

    +

    Defined in FT_INCREMENTAL_H (ftincrem.h).

    +
     #define FT_PARAM_TAG_INCREMENTAL  FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
    +
    -

    -

    A constant used as the tag of FT_Parameter structures to indicate an incremental loading object to be used by FreeType.

    -

    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-index.html b/freetype/docs/reference/ft2-index.html index ebe3c2d21..2e16e94a0 100644 --- a/freetype/docs/reference/ft2-index.html +++ b/freetype/docs/reference/ft2-index.html @@ -3,303 +3,379 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - -
    [TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    BDF_PROPERTY_TYPE_ATOMFT_LCD_FILTER_DEFAULTFT_Stroker_New
    BDF_PROPERTY_TYPE_CARDINALFT_LCD_FILTER_HFT_Stroker_ParseOutline
    BDF_PROPERTY_TYPE_INTEGERFT_LCD_FILTER_LEGACYFT_Stroker_Rewind
    BDF_PROPERTY_TYPE_NONEFT_LCD_FILTER_LIGHTFT_Stroker_Set
    BDF_PropertyFT_LCD_FILTER_NONEFT_StrokerBorder
    BDF_PropertyRecFT_LcdFilterFT_SUBGLYPH_FLAG_2X2
    CID_FaceDictFT_LIST_HFT_SUBGLYPH_FLAG_ARGS_ARE_WORDS
    CID_FaceDictRecFT_LibraryFT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES
    CID_FaceInfoFT_Library_SetLcdFilterFT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID
    CID_FaceInfoRecFT_Library_SetLcdFilterWeightsFT_SUBGLYPH_FLAG_SCALE
    CID_InfoFT_Library_VersionFT_SUBGLYPH_FLAG_USE_MY_METRICS
    darkening-parametersFT_ListFT_SUBGLYPH_FLAG_XXX
    default-scriptFT_List_AddFT_SUBGLYPH_FLAG_XY_SCALE
    FREETYPE_MAJORFT_List_DestructorFT_SubGlyph
    FREETYPE_MINORFT_List_FinalizeFT_SYNTHESIS_H
    FREETYPE_PATCHFT_List_FindFT_SYSTEM_H
    FREETYPE_XXXFT_List_InsertFT_Tag
    FT_Activate_SizeFT_List_IterateFT_Tan
    FT_ADVANCE_FLAG_FAST_ONLYFT_List_IteratorFT_TRIGONOMETRY_H
    FT_ADVANCES_HFT_List_RemoveFT_TRUETYPE_DRIVER_H
    FT_Add_Default_ModulesFT_List_UpFT_TRUETYPE_ENGINE_TYPE_NONE
    FT_Add_ModuleFT_ListNodeFT_TRUETYPE_ENGINE_TYPE_PATENTED
    FT_Alloc_FuncFT_ListNodeRecFT_TRUETYPE_ENGINE_TYPE_UNPATENTED
    FT_ANGLE_2PIFT_ListRecFT_TRUETYPE_IDS_H
    FT_ANGLE_PIFT_LOAD_COLORFT_TRUETYPE_TABLES_H
    FT_ANGLE_PI2FT_LOAD_CROP_BITMAPFT_TRUETYPE_TAGS_H
    FT_ANGLE_PI4FT_LOAD_DEFAULTFT_TrueTypeEngineType
    FT_AngleFT_LOAD_FORCE_AUTOHINTFT_TrueTypeGX_Free
    FT_Angle_DiffFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTHFT_TrueTypeGX_Validate
    FT_Atan2FT_LOAD_IGNORE_TRANSFORMFT_TYPE1_TABLES_H
    FT_Attach_FileFT_LOAD_LINEAR_DESIGNFT_TYPES_H
    FT_Attach_StreamFT_LOAD_MONOCHROMEFT_UFWord
    FT_AUTOHINTER_HFT_LOAD_NO_AUTOHINTFT_UInt
    FT_AUTOHINTER_SCRIPT_CJKFT_LOAD_NO_BITMAPFT_UInt16
    FT_AUTOHINTER_SCRIPT_INDICFT_LOAD_NO_HINTINGFT_UInt32
    FT_AUTOHINTER_SCRIPT_LATINFT_LOAD_NO_RECURSEFT_UInt64
    FT_AUTOHINTER_SCRIPT_NONEFT_LOAD_NO_SCALEFT_ULong
    FT_AUTOHINTER_SCRIPT_XXXFT_LOAD_PEDANTICFT_UNPATENTED_HINTING_H
    FT_BBOX_HFT_LOAD_RENDERFT_UnitVector
    FT_BBoxFT_LOAD_TARGET_LCDFT_UShort
    FT_BDF_HFT_LOAD_TARGET_LCD_VFT_VALIDATE_APPLE
    FT_BITMAP_HFT_LOAD_TARGET_LIGHTFT_VALIDATE_BASE
    FT_BitmapFT_LOAD_TARGET_MODEFT_VALIDATE_bsln
    FT_Bitmap_ConvertFT_LOAD_TARGET_MONOFT_VALIDATE_CKERN
    FT_Bitmap_CopyFT_LOAD_TARGET_NORMALFT_VALIDATE_CKERNXXX
    FT_Bitmap_DoneFT_LOAD_TARGET_XXXFT_VALIDATE_feat
    FT_Bitmap_EmboldenFT_LOAD_VERTICAL_LAYOUTFT_VALIDATE_GDEF
    FT_Bitmap_NewFT_LOAD_XXXFT_VALIDATE_GPOS
    FT_Bitmap_SizeFT_Load_CharFT_VALIDATE_GSUB
    FT_BitmapGlyphFT_Load_GlyphFT_VALIDATE_GX
    FT_BitmapGlyphRecFT_Load_Sfnt_TableFT_VALIDATE_GX_LENGTH
    FT_BoolFT_LongFT_VALIDATE_GXXXX
    FT_ByteFT_LZW_HFT_VALIDATE_JSTF
    FT_BytesFT_MAC_HFT_VALIDATE_just
    FT_BZIP2_HFT_MAKE_TAGFT_VALIDATE_kern
    FT_CACHE_CHARMAP_HFT_MatrixFT_VALIDATE_lcar
    FT_CACHE_HFT_Matrix_InvertFT_VALIDATE_MATH
    FT_CACHE_IMAGE_HFT_Matrix_MultiplyFT_VALIDATE_MS
    FT_CACHE_SMALL_BITMAPS_HFT_MemoryFT_VALIDATE_mort
    FT_CeilFixFT_MemoryRecFT_VALIDATE_morx
    FT_CFF_DRIVER_HFT_MM_AxisFT_VALIDATE_OT
    FT_CFF_HINTING_ADOBEFT_MM_VarFT_VALIDATE_OTXXX
    FT_CFF_HINTING_FREETYPEFT_MODULE_ERRORS_HFT_VALIDATE_opbd
    FT_CFF_HINTING_XXXFT_MODULE_HFT_VALIDATE_prop
    FT_CharFT_ModuleFT_VALIDATE_trak
    FT_CharMapFT_Module_ClassFT_Var_Axis
    FT_CharMapRecFT_Module_ConstructorFT_Var_Named_Style
    FT_CID_HFT_Module_DestructorFT_Vector
    FT_ClassicKern_FreeFT_Module_RequesterFT_Vector_From_Polar
    FT_ClassicKern_ValidateFT_MULTIPLE_MASTERS_HFT_Vector_Length
    FT_CONFIG_CONFIG_HFT_MulDivFT_Vector_Polarize
    FT_CONFIG_MODULES_HFT_MulFixFT_Vector_Rotate
    FT_CONFIG_OPTIONS_HFT_Multi_MasterFT_Vector_Transform
    FT_CONFIG_STANDARD_LIBRARY_HFT_New_FaceFT_Vector_Unit
    FT_CosFT_New_Face_From_FONDFT_WINFONTS_H
    FT_DataFT_New_Face_From_FSRefFT_WinFNT_Header
    FT_DivFixFT_New_Face_From_FSSpecFT_WinFNT_HeaderRec
    FT_Done_FaceFT_New_LibraryFT_WinFNT_ID_CP1250
    FT_Done_FreeTypeFT_New_Memory_FaceFT_WinFNT_ID_CP1251
    FT_Done_GlyphFT_New_SizeFT_WinFNT_ID_CP1252
    FT_Done_LibraryFT_OffsetFT_WinFNT_ID_CP1253
    FT_Done_SizeFT_OPEN_DRIVERFT_WinFNT_ID_CP1254
    FT_DriverFT_OPEN_MEMORYFT_WinFNT_ID_CP1255
    FT_ENC_TAGFT_OPEN_PARAMSFT_WinFNT_ID_CP1256
    FT_ENCODING_ADOBE_CUSTOMFT_OPEN_PATHNAMEFT_WinFNT_ID_CP1257
    FT_ENCODING_ADOBE_EXPERTFT_OPEN_STREAMFT_WinFNT_ID_CP1258
    FT_ENCODING_ADOBE_LATIN_1FT_OPEN_XXXFT_WinFNT_ID_CP1361
    FT_ENCODING_ADOBE_STANDARDFT_OPENTYPE_VALIDATE_HFT_WinFNT_ID_CP874
    FT_ENCODING_APPLE_ROMANFT_Open_ArgsFT_WinFNT_ID_CP932
    FT_ENCODING_BIG5FT_Open_FaceFT_WinFNT_ID_CP936
    FT_ENCODING_GB2312FT_OpenType_FreeFT_WinFNT_ID_CP949
    FT_ENCODING_JOHABFT_OpenType_ValidateFT_WinFNT_ID_CP950
    FT_ENCODING_MS_BIG5FT_ORIENTATION_FILL_LEFTFT_WinFNT_ID_DEFAULT
    FT_ENCODING_MS_GB2312FT_ORIENTATION_FILL_RIGHTFT_WinFNT_ID_MAC
    FT_ENCODING_MS_JOHABFT_ORIENTATION_NONEFT_WinFNT_ID_OEM
    FT_ENCODING_MS_SJISFT_ORIENTATION_POSTSCRIPTFT_WinFNT_ID_SYMBOL
    FT_ENCODING_MS_SYMBOLFT_ORIENTATION_TRUETYPEFT_WinFNT_ID_XXX
    FT_ENCODING_MS_WANSUNGFT_OrientationFT_XFREE86_H
    FT_ENCODING_NONEFT_OUTLINE_EVEN_ODD_FILLFTC_CMapCache
    FT_ENCODING_OLD_LATIN_2FT_OUTLINE_FLAGSFTC_CMapCache_Lookup
    FT_ENCODING_SJISFT_OUTLINE_HFTC_CMapCache_New
    FT_ENCODING_UNICODEFT_OUTLINE_HIGH_PRECISIONFTC_Face_Requester
    FT_ENCODING_WANSUNGFT_OUTLINE_IGNORE_DROPOUTSFTC_FaceID
    FT_EncodingFT_OUTLINE_INCLUDE_STUBSFTC_ImageCache
    FT_ERRORS_HFT_OUTLINE_NONEFTC_ImageCache_Lookup
    FT_ErrorFT_OUTLINE_OWNERFTC_ImageCache_LookupScaler
    FT_F26Dot6FT_OUTLINE_REVERSE_FILLFTC_ImageCache_New
    FT_F2Dot14FT_OUTLINE_SINGLE_PASSFTC_ImageType
    FT_FACE_FLAG_CID_KEYEDFT_OUTLINE_SMART_DROPOUTSFTC_ImageTypeRec
    FT_FACE_FLAG_COLORFT_OutlineFTC_Manager
    FT_FACE_FLAG_EXTERNAL_STREAMFT_Outline_CheckFTC_Manager_Done
    FT_FACE_FLAG_FAST_GLYPHSFT_Outline_ConicToFuncFTC_Manager_LookupFace
    FT_FACE_FLAG_FIXED_SIZESFT_Outline_CopyFTC_Manager_LookupSize
    FT_FACE_FLAG_FIXED_WIDTHFT_Outline_CubicToFuncFTC_Manager_New
    FT_FACE_FLAG_GLYPH_NAMESFT_Outline_DecomposeFTC_Manager_RemoveFaceID
    FT_FACE_FLAG_HINTERFT_Outline_DoneFTC_Manager_Reset
    FT_FACE_FLAG_HORIZONTALFT_Outline_EmboldenFTC_Node
    FT_FACE_FLAG_KERNINGFT_Outline_EmboldenXYFTC_Node_Unref
    FT_FACE_FLAG_MULTIPLE_MASTERSFT_Outline_FuncsFTC_SBit
    FT_FACE_FLAG_SCALABLEFT_Outline_Get_BBoxFTC_SBitCache
    FT_FACE_FLAG_SFNTFT_Outline_Get_BitmapFTC_SBitCache_Lookup
    FT_FACE_FLAG_TRICKYFT_Outline_Get_CBoxFTC_SBitCache_LookupScaler
    FT_FACE_FLAG_VERTICALFT_Outline_Get_OrientationFTC_SBitCache_New
    FT_FACE_FLAG_XXXFT_Outline_GetInsideBorderFTC_SBitRec
    FT_FaceFT_Outline_GetOutsideBorderFTC_Scaler
    FT_Face_CheckTrueTypePatentsFT_Outline_LineToFuncFTC_ScalerRec
    FT_Face_GetCharsOfVariantFT_Outline_MoveToFuncfallback-script
    FT_Face_GetCharVariantIndexFT_Outline_Newft_encoding_xxx
    FT_Face_GetCharVariantIsDefaultFT_Outline_Renderft_glyph_bbox_gridfit
    FT_Face_GetVariantSelectorsFT_Outline_Reverseft_glyph_bbox_pixels
    FT_Face_GetVariantsOfCharFT_Outline_Transformft_glyph_bbox_subpixels
    FT_Face_InternalFT_Outline_Translateft_glyph_bbox_truncate
    FT_Face_SetUnpatentedHintingFT_OutlineGlyphft_glyph_bbox_unscaled
    FT_FaceRecFT_OutlineGlyphRecft_glyph_bbox_xxx
    FT_FixedFT_PARAM_TAG_IGNORE_PREFERRED_FAMILYft_glyph_format_bitmap
    FT_FloorFixFT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILYft_glyph_format_composite
    FT_FREETYPE_HFT_PARAM_TAG_INCREMENTALft_glyph_format_none
    FT_Free_FuncFT_PARAM_TAG_UNPATENTED_HINTINGft_glyph_format_outline
    FT_FSTYPE_BITMAP_EMBEDDING_ONLYFT_Palette_Modeft_glyph_format_plotter
    FT_FSTYPE_EDITABLE_EMBEDDINGFT_Parameterft_glyph_format_xxx
    FT_FSTYPE_INSTALLABLE_EMBEDDINGFT_PFR_Hft_kerning_default
    FT_FSTYPE_NO_SUBSETTINGFT_PIXEL_MODE_BGRAft_kerning_unfitted
    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDINGFT_PIXEL_MODE_GRAYft_kerning_unscaled
    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDINGFT_PIXEL_MODE_GRAY2ft_open_driver
    FT_FSTYPE_XXXFT_PIXEL_MODE_GRAY4ft_open_memory
    FT_FWordFT_PIXEL_MODE_LCDft_open_params
    FT_GASP_DO_GRAYFT_PIXEL_MODE_LCD_Vft_open_pathname
    FT_GASP_DO_GRIDFITFT_PIXEL_MODE_MONOft_open_stream
    FT_GASP_HFT_PIXEL_MODE_NONEft_outline_even_odd_fill
    FT_GASP_NO_TABLEFT_Pixel_Modeft_outline_flags
    FT_GASP_SYMMETRIC_GRIDFITFT_Pointerft_outline_high_precision
    FT_GASP_SYMMETRIC_SMOOTHINGFT_Posft_outline_ignore_dropouts
    FT_GASP_XXXFT_Prop_GlyphToScriptMapft_outline_none
    FT_GenericFT_Prop_IncreaseXHeightft_outline_owner
    FT_Generic_FinalizerFT_Property_Getft_outline_reverse_fill
    FT_Get_AdvanceFT_Property_Setft_outline_single_pass
    FT_Get_AdvancesFT_PropertyTypeft_palette_mode_rgb
    FT_Get_BDF_Charset_IDFT_PtrDistft_palette_mode_rgba
    FT_Get_BDF_PropertyFT_RASTER_FLAG_AAft_pixel_mode_grays
    FT_Get_Char_IndexFT_RASTER_FLAG_CLIPft_pixel_mode_mono
    FT_Get_Charmap_IndexFT_RASTER_FLAG_DEFAULTft_pixel_mode_none
    FT_Get_CID_From_Glyph_IndexFT_RASTER_FLAG_DIRECTft_pixel_mode_pal2
    FT_Get_CID_Is_Internally_CID_KeyedFT_RASTER_FLAG_XXXft_pixel_mode_pal4
    FT_Get_CID_Registry_Ordering_SupplementFT_Rasterft_pixel_mode_xxx
    FT_Get_CMap_FormatFT_Raster_BitSet_Funcft_render_mode_mono
    FT_Get_CMap_Language_IDFT_Raster_BitTest_Funcft_render_mode_normal
    FT_Get_First_CharFT_Raster_DoneFuncft_render_mode_xxx
    FT_Get_FSType_FlagsFT_Raster_Funcsglyph-to-script-map
    FT_Get_GaspFT_Raster_NewFunchinting-engine
    FT_Get_GlyphFT_Raster_Paramsincrease-x-height
    FT_Get_Glyph_NameFT_Raster_RenderFuncinterpreter-version
    FT_Get_KerningFT_Raster_ResetFuncno-stem-darkening
    FT_Get_MM_VarFT_Raster_SetModeFuncPS_Dict_Keys
    FT_Get_ModuleFT_RENDER_HPS_FontInfo
    FT_Get_Multi_MasterFT_RENDER_MODE_LCDPS_FontInfoRec
    FT_Get_Name_IndexFT_RENDER_MODE_LCD_VPS_Private
    FT_Get_Next_CharFT_RENDER_MODE_LIGHTPS_PrivateRec
    FT_Get_PFR_AdvanceFT_RENDER_MODE_MONOT1_Blend_Flags
    FT_Get_PFR_KerningFT_RENDER_MODE_NORMALT1_EncodingType
    FT_Get_PFR_MetricsFT_Realloc_FuncT1_FontInfo
    FT_Get_Postscript_NameFT_Reference_FaceT1_Private
    FT_Get_PS_Font_InfoFT_Reference_LibraryTT_ADOBE_ID_CUSTOM
    FT_Get_PS_Font_PrivateFT_Remove_ModuleTT_ADOBE_ID_EXPERT
    FT_Get_PS_Font_ValueFT_Render_GlyphTT_ADOBE_ID_LATIN_1
    FT_Get_RendererFT_Render_ModeTT_ADOBE_ID_STANDARD
    FT_Get_Sfnt_NameFT_RendererTT_ADOBE_ID_XXX
    FT_Get_Sfnt_Name_CountFT_Renderer_ClassTT_APPLE_ID_DEFAULT
    FT_Get_Sfnt_TableFT_Request_SizeTT_APPLE_ID_ISO_10646
    FT_Get_SubGlyph_InfoFT_RoundFixTT_APPLE_ID_UNICODE_1_1
    FT_Get_Track_KerningFT_Select_CharmapTT_APPLE_ID_UNICODE_2_0
    FT_Get_TrueType_Engine_TypeFT_Select_SizeTT_APPLE_ID_UNICODE_32
    FT_Get_WinFNT_HeaderFT_Set_Char_SizeTT_APPLE_ID_VARIANT_SELECTOR
    FT_Get_X11_Font_FormatFT_Set_CharmapTT_APPLE_ID_XXX
    FT_GetFile_From_Mac_ATS_NameFT_Set_Debug_HookTT_Header
    FT_GetFile_From_Mac_NameFT_Set_MM_Blend_CoordinatesTT_HoriHeader
    FT_GetFilePath_From_Mac_ATS_NameFT_Set_MM_Design_CoordinatesTT_INTERPRETER_VERSION_35
    FT_GLYPH_BBOX_GRIDFITFT_Set_Pixel_SizesTT_INTERPRETER_VERSION_38
    FT_GLYPH_BBOX_PIXELSFT_Set_RendererTT_INTERPRETER_VERSION_XXX
    FT_GLYPH_BBOX_SUBPIXELSFT_Set_TransformTT_ISO_ID_10646
    FT_GLYPH_BBOX_TRUNCATEFT_Set_Var_Blend_CoordinatesTT_ISO_ID_7BIT_ASCII
    FT_GLYPH_BBOX_UNSCALEDFT_Set_Var_Design_CoordinatesTT_ISO_ID_8859_1
    FT_GLYPH_FORMAT_BITMAPFT_SFNT_NAMES_HTT_ISO_ID_XXX
    FT_GLYPH_FORMAT_COMPOSITEFT_Sfnt_Table_InfoTT_MAC_ID_ARABIC
    FT_GLYPH_FORMAT_NONEFT_Sfnt_TagTT_MAC_ID_ARMENIAN
    FT_GLYPH_FORMAT_OUTLINEFT_SfntNameTT_MAC_ID_BENGALI
    FT_GLYPH_FORMAT_PLOTTERFT_ShortTT_MAC_ID_BURMESE
    FT_GLYPH_HFT_SIZE_REQUEST_TYPE_BBOXTT_MAC_ID_DEVANAGARI
    FT_GlyphFT_SIZE_REQUEST_TYPE_CELLTT_MAC_ID_GEEZ
    FT_Glyph_BBox_ModeFT_SIZE_REQUEST_TYPE_NOMINALTT_MAC_ID_GEORGIAN
    FT_Glyph_CopyFT_SIZE_REQUEST_TYPE_REAL_DIMTT_MAC_ID_GREEK
    FT_Glyph_FormatFT_SIZE_REQUEST_TYPE_SCALESTT_MAC_ID_GUJARATI
    FT_Glyph_Get_CBoxFT_SIZES_HTT_MAC_ID_GURMUKHI
    FT_Glyph_MetricsFT_SinTT_MAC_ID_HEBREW
    FT_Glyph_StrokeFT_SizeTT_MAC_ID_JAPANESE
    FT_Glyph_StrokeBorderFT_Size_InternalTT_MAC_ID_KANNADA
    FT_Glyph_To_BitmapFT_Size_MetricsTT_MAC_ID_KHMER
    FT_Glyph_TransformFT_Size_RequestTT_MAC_ID_KOREAN
    FT_GlyphRecFT_Size_Request_TypeTT_MAC_ID_LAOTIAN
    FT_GlyphSlotFT_Size_RequestRecTT_MAC_ID_MALAYALAM
    FT_GlyphSlot_Own_BitmapFT_SizeRecTT_MAC_ID_MALDIVIAN
    FT_GlyphSlotRecFT_Slot_InternalTT_MAC_ID_MONGOLIAN
    FT_GX_VALIDATE_HFT_SpanTT_MAC_ID_ORIYA
    FT_GZIP_HFT_SpanFuncTT_MAC_ID_ROMAN
    FT_Gzip_UncompressFT_STROKER_BORDER_LEFTTT_MAC_ID_RSYMBOL
    FT_HAS_COLORFT_STROKER_BORDER_RIGHTTT_MAC_ID_RUSSIAN
    FT_HAS_FAST_GLYPHSFT_STROKER_HTT_MAC_ID_SIMPLIFIED_CHINESE
    FT_HAS_FIXED_SIZESFT_STROKER_LINECAP_BUTTTT_MAC_ID_SINDHI
    FT_HAS_GLYPH_NAMESFT_STROKER_LINECAP_ROUNDTT_MAC_ID_SINHALESE
    FT_HAS_HORIZONTALFT_STROKER_LINECAP_SQUARETT_MAC_ID_SLAVIC
    FT_HAS_KERNINGFT_STROKER_LINEJOIN_BEVELTT_MAC_ID_TAMIL
    FT_HAS_MULTIPLE_MASTERSFT_STROKER_LINEJOIN_MITERTT_MAC_ID_TELUGU
    FT_HAS_VERTICALFT_STROKER_LINEJOIN_MITER_FIXEDTT_MAC_ID_THAI
    FT_Has_PS_Glyph_NamesFT_STROKER_LINEJOIN_MITER_VARIABLETT_MAC_ID_TIBETAN
    FT_IMAGE_HFT_STROKER_LINEJOIN_ROUNDTT_MAC_ID_TRADITIONAL_CHINESE
    FT_IMAGE_TAGFT_STYLE_FLAG_BOLDTT_MAC_ID_UNINTERP
    FT_INCREMENTAL_HFT_STYLE_FLAG_ITALICTT_MAC_ID_VIETNAMESE
    FT_IncrementalFT_STYLE_FLAG_XXXTT_MAC_ID_XXX
    FT_Incremental_FreeGlyphDataFuncFT_StreamTT_MaxProfile
    FT_Incremental_FuncsRecFT_Stream_CloseFuncTT_MS_ID_BIG_5
    FT_Incremental_GetGlyphDataFuncFT_Stream_IoFuncTT_MS_ID_GB2312
    FT_Incremental_GetGlyphMetricsFuncFT_Stream_OpenBzip2TT_MS_ID_JOHAB
    FT_Incremental_InterfaceFT_Stream_OpenGzipTT_MS_ID_SJIS
    FT_Incremental_InterfaceRecFT_Stream_OpenLZWTT_MS_ID_SYMBOL_CS
    FT_Incremental_MetricsFT_StreamDescTT_MS_ID_UCS_4
    FT_Incremental_MetricsRecFT_StreamRecTT_MS_ID_UNICODE_CS
    FT_Init_FreeTypeFT_StringTT_MS_ID_WANSUNG
    FT_IntFT_StrokerTT_MS_ID_XXX
    FT_Int16FT_Stroker_BeginSubPathTT_OS2
    FT_Int32FT_Stroker_ConicToTT_PCLT
    FT_Int64FT_Stroker_CubicToTT_PLATFORM_ADOBE
    FT_IS_CID_KEYEDFT_Stroker_DoneTT_PLATFORM_APPLE_UNICODE
    FT_IS_FIXED_WIDTHFT_Stroker_EndSubPathTT_PLATFORM_CUSTOM
    FT_IS_SCALABLEFT_Stroker_ExportTT_PLATFORM_ISO
    FT_IS_SFNTFT_Stroker_ExportBorderTT_PLATFORM_MACINTOSH
    FT_IS_TRICKYFT_Stroker_GetBorderCountsTT_PLATFORM_MICROSOFT
    FT_KERNING_DEFAULTFT_Stroker_GetCountsTT_PLATFORM_XXX
    FT_KERNING_UNFITTEDFT_Stroker_LineCapTT_Postscript
    FT_KERNING_UNSCALEDFT_Stroker_LineJoinTT_VertHeader
    FT_Kerning_ModeFT_Stroker_LineTo
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    BDF_PROPERTY_TYPE_ATOMFT_Library_SetLcdFilterWeightsFT_SYSTEM_H
    BDF_PROPERTY_TYPE_CARDINALFT_Library_VersionFT_Tag
    BDF_PROPERTY_TYPE_INTEGERFT_ListFT_Tan
    BDF_PROPERTY_TYPE_NONEFT_List_AddFT_TRIGONOMETRY_H
    BDF_PropertyFT_List_DestructorFT_TRUETYPE_DRIVER_H
    BDF_PropertyRecFT_List_FinalizeFT_TRUETYPE_ENGINE_TYPE_NONE
    BDF_PropertyTypeFT_List_FindFT_TRUETYPE_ENGINE_TYPE_PATENTED
    CID_FaceDictFT_List_InsertFT_TRUETYPE_ENGINE_TYPE_UNPATENTED
    CID_FaceDictRecFT_List_IterateFT_TRUETYPE_IDS_H
    CID_FaceInfoFT_List_IteratorFT_TRUETYPE_TABLES_H
    CID_FaceInfoRecFT_List_RemoveFT_TRUETYPE_TAGS_H
    CID_FontDictFT_List_UpFT_TrueTypeEngineType
    CID_InfoFT_ListNodeFT_TrueTypeGX_Free
    darkening-parametersFT_ListNodeRecFT_TrueTypeGX_Validate
    default-scriptFT_ListRecFT_TYPE1_TABLES_H
    FREETYPE_MAJORFT_LOAD_COLORFT_TYPES_H
    FREETYPE_MINORFT_LOAD_CROP_BITMAPFT_UFWord
    FREETYPE_PATCHFT_LOAD_DEFAULTFT_UInt
    FREETYPE_XXXFT_LOAD_FORCE_AUTOHINTFT_UInt16
    FT_Activate_SizeFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTHFT_UInt32
    FT_ADVANCE_FLAG_FAST_ONLYFT_LOAD_IGNORE_TRANSFORMFT_UInt64
    FT_ADVANCES_HFT_LOAD_LINEAR_DESIGNFT_ULong
    FT_Add_Default_ModulesFT_LOAD_MONOCHROMEFT_UNPATENTED_HINTING_H
    FT_Add_ModuleFT_LOAD_NO_AUTOHINTFT_UnitVector
    FT_Alloc_FuncFT_LOAD_NO_BITMAPFT_UShort
    FT_ANGLE_2PIFT_LOAD_NO_HINTINGFT_VALIDATE_APPLE
    FT_ANGLE_PIFT_LOAD_NO_RECURSEFT_VALIDATE_BASE
    FT_ANGLE_PI2FT_LOAD_NO_SCALEFT_VALIDATE_bsln
    FT_ANGLE_PI4FT_LOAD_PEDANTICFT_VALIDATE_CKERN
    FT_AngleFT_LOAD_RENDERFT_VALIDATE_CKERNXXX
    FT_Angle_DiffFT_LOAD_TARGET_LCDFT_VALIDATE_feat
    FT_Atan2FT_LOAD_TARGET_LCD_VFT_VALIDATE_GDEF
    FT_Attach_FileFT_LOAD_TARGET_LIGHTFT_VALIDATE_GPOS
    FT_Attach_StreamFT_LOAD_TARGET_MODEFT_VALIDATE_GSUB
    FT_AUTOHINTER_HFT_LOAD_TARGET_MONOFT_VALIDATE_GX
    FT_AUTOHINTER_SCRIPT_CJKFT_LOAD_TARGET_NORMALFT_VALIDATE_GX_LENGTH
    FT_AUTOHINTER_SCRIPT_INDICFT_LOAD_TARGET_XXXFT_VALIDATE_GXXXX
    FT_AUTOHINTER_SCRIPT_LATINFT_LOAD_VERTICAL_LAYOUTFT_VALIDATE_JSTF
    FT_AUTOHINTER_SCRIPT_NONEFT_LOAD_XXXFT_VALIDATE_just
    FT_AUTOHINTER_SCRIPT_XXXFT_Load_CharFT_VALIDATE_kern
    FT_BBOX_HFT_Load_GlyphFT_VALIDATE_lcar
    FT_BBoxFT_Load_Sfnt_TableFT_VALIDATE_MATH
    FT_BDF_HFT_LongFT_VALIDATE_MS
    FT_BITMAP_HFT_LZW_HFT_VALIDATE_mort
    FT_BitmapFT_MAC_HFT_VALIDATE_morx
    FT_Bitmap_ConvertFT_MAKE_TAGFT_VALIDATE_OT
    FT_Bitmap_CopyFT_MatrixFT_VALIDATE_OTXXX
    FT_Bitmap_DoneFT_Matrix_InvertFT_VALIDATE_opbd
    FT_Bitmap_EmboldenFT_Matrix_MultiplyFT_VALIDATE_prop
    FT_Bitmap_NewFT_MemoryFT_VALIDATE_trak
    FT_Bitmap_SizeFT_MemoryRecFT_Var_Axis
    FT_BitmapGlyphFT_MM_AxisFT_Var_Named_Style
    FT_BitmapGlyphRecFT_MM_VarFT_Vector
    FT_BoolFT_MODULE_ERRORS_HFT_Vector_From_Polar
    FT_ByteFT_MODULE_HFT_Vector_Length
    FT_BytesFT_ModuleFT_Vector_Polarize
    FT_BZIP2_HFT_Module_ClassFT_Vector_Rotate
    FT_CACHE_CHARMAP_HFT_Module_ConstructorFT_Vector_Transform
    FT_CACHE_HFT_Module_DestructorFT_Vector_Unit
    FT_CACHE_IMAGE_HFT_Module_RequesterFT_WINFONTS_H
    FT_CACHE_SMALL_BITMAPS_HFT_MULTIPLE_MASTERS_HFT_WinFNT_Header
    FT_CeilFixFT_MulDivFT_WinFNT_HeaderRec
    FT_CFF_DRIVER_HFT_MulFixFT_WinFNT_ID_CP1250
    FT_CFF_HINTING_ADOBEFT_Multi_MasterFT_WinFNT_ID_CP1251
    FT_CFF_HINTING_FREETYPEFT_New_FaceFT_WinFNT_ID_CP1252
    FT_CFF_HINTING_XXXFT_New_Face_From_FONDFT_WinFNT_ID_CP1253
    FT_CharFT_New_Face_From_FSRefFT_WinFNT_ID_CP1254
    FT_CharMapFT_New_Face_From_FSSpecFT_WinFNT_ID_CP1255
    FT_CharMapRecFT_New_LibraryFT_WinFNT_ID_CP1256
    FT_CID_HFT_New_Memory_FaceFT_WinFNT_ID_CP1257
    FT_ClassicKern_FreeFT_New_SizeFT_WinFNT_ID_CP1258
    FT_ClassicKern_ValidateFT_OffsetFT_WinFNT_ID_CP1361
    FT_CONFIG_CONFIG_HFT_OPEN_DRIVERFT_WinFNT_ID_CP874
    FT_CONFIG_MODULES_HFT_OPEN_MEMORYFT_WinFNT_ID_CP932
    FT_CONFIG_OPTIONS_HFT_OPEN_PARAMSFT_WinFNT_ID_CP936
    FT_CONFIG_STANDARD_LIBRARY_HFT_OPEN_PATHNAMEFT_WinFNT_ID_CP949
    FT_CosFT_OPEN_STREAMFT_WinFNT_ID_CP950
    FT_DataFT_OPEN_XXXFT_WinFNT_ID_DEFAULT
    FT_DivFixFT_OPENTYPE_VALIDATE_HFT_WinFNT_ID_MAC
    FT_Done_FaceFT_Open_ArgsFT_WinFNT_ID_OEM
    FT_Done_FreeTypeFT_Open_FaceFT_WinFNT_ID_SYMBOL
    FT_Done_GlyphFT_OpenType_FreeFT_WinFNT_ID_XXX
    FT_Done_LibraryFT_OpenType_ValidateFT_XFREE86_H
    FT_Done_SizeFT_ORIENTATION_FILL_LEFTFTC_CMapCache
    FT_DriverFT_ORIENTATION_FILL_RIGHTFTC_CMapCache_Lookup
    FT_ENC_TAGFT_ORIENTATION_NONEFTC_CMapCache_New
    FT_ENCODING_ADOBE_CUSTOMFT_ORIENTATION_POSTSCRIPTFTC_Face_Requester
    FT_ENCODING_ADOBE_EXPERTFT_ORIENTATION_TRUETYPEFTC_FaceID
    FT_ENCODING_ADOBE_LATIN_1FT_OrientationFTC_ImageCache
    FT_ENCODING_ADOBE_STANDARDFT_OUTLINE_EVEN_ODD_FILLFTC_ImageCache_Lookup
    FT_ENCODING_APPLE_ROMANFT_OUTLINE_HFTC_ImageCache_LookupScaler
    FT_ENCODING_BIG5FT_OUTLINE_HIGH_PRECISIONFTC_ImageCache_New
    FT_ENCODING_GB2312FT_OUTLINE_IGNORE_DROPOUTSFTC_ImageType
    FT_ENCODING_JOHABFT_OUTLINE_INCLUDE_STUBSFTC_ImageTypeRec
    FT_ENCODING_MS_BIG5FT_OUTLINE_NONEFTC_Manager
    FT_ENCODING_MS_GB2312FT_OUTLINE_OWNERFTC_Manager_Done
    FT_ENCODING_MS_JOHABFT_OUTLINE_REVERSE_FILLFTC_Manager_LookupFace
    FT_ENCODING_MS_SJISFT_OUTLINE_SINGLE_PASSFTC_Manager_LookupSize
    FT_ENCODING_MS_SYMBOLFT_OUTLINE_SMART_DROPOUTSFTC_Manager_New
    FT_ENCODING_MS_WANSUNGFT_OUTLINE_XXXFTC_Manager_RemoveFaceID
    FT_ENCODING_NONEFT_OutlineFTC_Manager_Reset
    FT_ENCODING_OLD_LATIN_2FT_Outline_CheckFTC_Node
    FT_ENCODING_SJISFT_Outline_ConicToFuncFTC_Node_Unref
    FT_ENCODING_UNICODEFT_Outline_CopyFTC_SBit
    FT_ENCODING_WANSUNGFT_Outline_CubicToFuncFTC_SBitCache
    FT_EncodingFT_Outline_DecomposeFTC_SBitCache_Lookup
    FT_ERRORS_HFT_Outline_DoneFTC_SBitCache_LookupScaler
    FT_ErrorFT_Outline_EmboldenFTC_SBitCache_New
    FT_F26Dot6FT_Outline_EmboldenXYFTC_SBitRec
    FT_F2Dot14FT_Outline_FuncsFTC_Scaler
    FT_FACE_FLAG_CID_KEYEDFT_Outline_Get_BBoxFTC_ScalerRec
    FT_FACE_FLAG_COLORFT_Outline_Get_Bitmapfallback-script
    FT_FACE_FLAG_EXTERNAL_STREAMFT_Outline_Get_CBoxglyph-to-script-map
    FT_FACE_FLAG_FAST_GLYPHSFT_Outline_Get_Orientationhinting-engine
    FT_FACE_FLAG_FIXED_SIZESFT_Outline_GetInsideBorderincrease-x-height
    FT_FACE_FLAG_FIXED_WIDTHFT_Outline_GetOutsideBorderinterpreter-version
    FT_FACE_FLAG_GLYPH_NAMESFT_Outline_LineToFuncno-stem-darkening
    FT_FACE_FLAG_HINTERFT_Outline_MoveToFuncPS_DICT_BLUE_FUZZ
    FT_FACE_FLAG_HORIZONTALFT_Outline_NewPS_DICT_BLUE_SCALE
    FT_FACE_FLAG_KERNINGFT_Outline_RenderPS_DICT_BLUE_SHIFT
    FT_FACE_FLAG_MULTIPLE_MASTERSFT_Outline_ReversePS_DICT_BLUE_VALUE
    FT_FACE_FLAG_SCALABLEFT_Outline_TransformPS_DICT_CHAR_STRING
    FT_FACE_FLAG_SFNTFT_Outline_TranslatePS_DICT_CHAR_STRING_KEY
    FT_FACE_FLAG_TRICKYFT_OutlineGlyphPS_DICT_ENCODING_ENTRY
    FT_FACE_FLAG_VERTICALFT_OutlineGlyphRecPS_DICT_ENCODING_TYPE
    FT_FACE_FLAG_XXXFT_PARAM_TAG_IGNORE_PREFERRED_FAMILYPS_DICT_FAMILY_BLUE
    FT_FaceFT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILYPS_DICT_FAMILY_NAME
    FT_Face_CheckTrueTypePatentsFT_PARAM_TAG_INCREMENTALPS_DICT_FAMILY_OTHER_BLUE
    FT_Face_GetCharsOfVariantFT_PARAM_TAG_UNPATENTED_HINTINGPS_DICT_FONT_BBOX
    FT_Face_GetCharVariantIndexFT_ParameterPS_DICT_FONT_MATRIX
    FT_Face_GetCharVariantIsDefaultFT_PFR_HPS_DICT_FONT_NAME
    FT_Face_GetVariantSelectorsFT_PIXEL_MODE_BGRAPS_DICT_FONT_TYPE
    FT_Face_GetVariantsOfCharFT_PIXEL_MODE_GRAYPS_DICT_FORCE_BOLD
    FT_Face_InternalFT_PIXEL_MODE_GRAY2PS_DICT_FS_TYPE
    FT_Face_SetUnpatentedHintingFT_PIXEL_MODE_GRAY4PS_DICT_FULL_NAME
    FT_FaceRecFT_PIXEL_MODE_LCDPS_DICT_IS_FIXED_PITCH
    FT_FixedFT_PIXEL_MODE_LCD_VPS_DICT_ITALIC_ANGLE
    FT_FloorFixFT_PIXEL_MODE_MONOPS_DICT_LANGUAGE_GROUP
    FT_FREETYPE_HFT_PIXEL_MODE_NONEPS_DICT_LEN_IV
    FT_Free_FuncFT_Pixel_ModePS_DICT_MIN_FEATURE
    FT_FSTYPE_BITMAP_EMBEDDING_ONLYFT_PointerPS_DICT_NOTICE
    FT_FSTYPE_EDITABLE_EMBEDDINGFT_PosPS_DICT_NUM_BLUE_VALUES
    FT_FSTYPE_INSTALLABLE_EMBEDDINGFT_Prop_GlyphToScriptMapPS_DICT_NUM_CHAR_STRINGS
    FT_FSTYPE_NO_SUBSETTINGFT_Prop_IncreaseXHeightPS_DICT_NUM_FAMILY_BLUES
    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDINGFT_Property_GetPS_DICT_NUM_FAMILY_OTHER_BLUES
    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDINGFT_Property_SetPS_DICT_NUM_OTHER_BLUES
    FT_FSTYPE_XXXFT_PtrDistPS_DICT_NUM_STEM_SNAP_H
    FT_FWordFT_RASTER_FLAG_AAPS_DICT_NUM_STEM_SNAP_V
    FT_GASP_DO_GRAYFT_RASTER_FLAG_CLIPPS_DICT_NUM_SUBRS
    FT_GASP_DO_GRIDFITFT_RASTER_FLAG_DEFAULTPS_DICT_OTHER_BLUE
    FT_GASP_HFT_RASTER_FLAG_DIRECTPS_DICT_PAINT_TYPE
    FT_GASP_NO_TABLEFT_RASTER_FLAG_XXXPS_DICT_PASSWORD
    FT_GASP_SYMMETRIC_GRIDFITFT_RasterPS_DICT_RND_STEM_UP
    FT_GASP_SYMMETRIC_SMOOTHINGFT_Raster_BitSet_FuncPS_DICT_STD_HW
    FT_GASP_XXXFT_Raster_BitTest_FuncPS_DICT_STD_VW
    FT_GenericFT_Raster_DoneFuncPS_DICT_STEM_SNAP_H
    FT_Generic_FinalizerFT_Raster_FuncsPS_DICT_STEM_SNAP_V
    FT_Get_AdvanceFT_Raster_NewFuncPS_DICT_SUBR
    FT_Get_AdvancesFT_Raster_ParamsPS_DICT_UNDERLINE_POSITION
    FT_Get_BDF_Charset_IDFT_Raster_RenderFuncPS_DICT_UNDERLINE_THICKNESS
    FT_Get_BDF_PropertyFT_Raster_ResetFuncPS_DICT_UNIQUE_ID
    FT_Get_Char_IndexFT_Raster_SetModeFuncPS_DICT_VERSION
    FT_Get_Charmap_IndexFT_RENDER_HPS_DICT_WEIGHT
    FT_Get_CID_From_Glyph_IndexFT_RENDER_MODE_LCDPS_Dict_Keys
    FT_Get_CID_Is_Internally_CID_KeyedFT_RENDER_MODE_LCD_VPS_FontInfo
    FT_Get_CID_Registry_Ordering_SupplementFT_RENDER_MODE_LIGHTPS_FontInfoRec
    FT_Get_CMap_FormatFT_RENDER_MODE_MONOPS_Private
    FT_Get_CMap_Language_IDFT_RENDER_MODE_NORMALPS_PrivateRec
    FT_Get_First_CharFT_Realloc_FuncT1_BLEND_BLUE_SCALE
    FT_Get_FSType_FlagsFT_Reference_FaceT1_BLEND_BLUE_SHIFT
    FT_Get_GaspFT_Reference_LibraryT1_BLEND_BLUE_VALUES
    FT_Get_GlyphFT_Remove_ModuleT1_BLEND_FAMILY_BLUES
    FT_Get_Glyph_NameFT_Render_GlyphT1_BLEND_FAMILY_OTHER_BLUES
    FT_Get_KerningFT_Render_ModeT1_BLEND_FORCE_BOLD
    FT_Get_MM_VarFT_RendererT1_BLEND_ITALIC_ANGLE
    FT_Get_ModuleFT_Renderer_ClassT1_BLEND_OTHER_BLUES
    FT_Get_Multi_MasterFT_Request_SizeT1_BLEND_STANDARD_HEIGHT
    FT_Get_Name_IndexFT_RoundFixT1_BLEND_STANDARD_WIDTH
    FT_Get_Next_CharFT_Select_CharmapT1_BLEND_STEM_SNAP_HEIGHTS
    FT_Get_PFR_AdvanceFT_Select_SizeT1_BLEND_STEM_SNAP_WIDTHS
    FT_Get_PFR_KerningFT_Set_Char_SizeT1_BLEND_UNDERLINE_POSITION
    FT_Get_PFR_MetricsFT_Set_CharmapT1_BLEND_UNDERLINE_THICKNESS
    FT_Get_Postscript_NameFT_Set_Debug_HookT1_Blend_Flags
    FT_Get_PS_Font_InfoFT_Set_MM_Blend_CoordinatesT1_ENCODING_TYPE_ARRAY
    FT_Get_PS_Font_PrivateFT_Set_MM_Design_CoordinatesT1_ENCODING_TYPE_EXPERT
    FT_Get_PS_Font_ValueFT_Set_Pixel_SizesT1_ENCODING_TYPE_ISOLATIN1
    FT_Get_RendererFT_Set_RendererT1_ENCODING_TYPE_NONE
    FT_Get_Sfnt_NameFT_Set_TransformT1_ENCODING_TYPE_STANDARD
    FT_Get_Sfnt_Name_CountFT_Set_Var_Blend_CoordinatesT1_EncodingType
    FT_Get_Sfnt_TableFT_Set_Var_Design_CoordinatesT1_FontInfo
    FT_Get_SubGlyph_InfoFT_SFNT_HEADT1_Private
    FT_Get_Track_KerningFT_SFNT_HHEATT_ADOBE_ID_CUSTOM
    FT_Get_TrueType_Engine_TypeFT_SFNT_MAXPTT_ADOBE_ID_EXPERT
    FT_Get_WinFNT_HeaderFT_SFNT_NAMES_HTT_ADOBE_ID_LATIN_1
    FT_Get_X11_Font_FormatFT_SFNT_OS2TT_ADOBE_ID_STANDARD
    FT_GetFile_From_Mac_ATS_NameFT_SFNT_PCLTTT_ADOBE_ID_XXX
    FT_GetFile_From_Mac_NameFT_SFNT_POSTTT_APPLE_ID_DEFAULT
    FT_GetFilePath_From_Mac_ATS_NameFT_SFNT_VHEATT_APPLE_ID_ISO_10646
    FT_GLYPH_BBOX_GRIDFITFT_Sfnt_Table_InfoTT_APPLE_ID_UNICODE_1_1
    FT_GLYPH_BBOX_PIXELSFT_Sfnt_TagTT_APPLE_ID_UNICODE_2_0
    FT_GLYPH_BBOX_SUBPIXELSFT_SfntNameTT_APPLE_ID_UNICODE_32
    FT_GLYPH_BBOX_TRUNCATEFT_ShortTT_APPLE_ID_VARIANT_SELECTOR
    FT_GLYPH_BBOX_UNSCALEDFT_SIZE_REQUEST_TYPE_BBOXTT_APPLE_ID_XXX
    FT_GLYPH_FORMAT_BITMAPFT_SIZE_REQUEST_TYPE_CELLTT_Header
    FT_GLYPH_FORMAT_COMPOSITEFT_SIZE_REQUEST_TYPE_NOMINALTT_HoriHeader
    FT_GLYPH_FORMAT_NONEFT_SIZE_REQUEST_TYPE_REAL_DIMTT_INTERPRETER_VERSION_35
    FT_GLYPH_FORMAT_OUTLINEFT_SIZE_REQUEST_TYPE_SCALESTT_INTERPRETER_VERSION_38
    FT_GLYPH_FORMAT_PLOTTERFT_SIZES_HTT_INTERPRETER_VERSION_XXX
    FT_GLYPH_HFT_SinTT_ISO_ID_10646
    FT_GlyphFT_SizeTT_ISO_ID_7BIT_ASCII
    FT_Glyph_BBox_ModeFT_Size_InternalTT_ISO_ID_8859_1
    FT_Glyph_CopyFT_Size_MetricsTT_ISO_ID_XXX
    FT_Glyph_FormatFT_Size_RequestTT_MAC_ID_ARABIC
    FT_Glyph_Get_CBoxFT_Size_Request_TypeTT_MAC_ID_ARMENIAN
    FT_Glyph_MetricsFT_Size_RequestRecTT_MAC_ID_BENGALI
    FT_Glyph_StrokeFT_SizeRecTT_MAC_ID_BURMESE
    FT_Glyph_StrokeBorderFT_Slot_InternalTT_MAC_ID_DEVANAGARI
    FT_Glyph_To_BitmapFT_SpanTT_MAC_ID_GEEZ
    FT_Glyph_TransformFT_SpanFuncTT_MAC_ID_GEORGIAN
    FT_GlyphRecFT_STROKER_BORDER_LEFTTT_MAC_ID_GREEK
    FT_GlyphSlotFT_STROKER_BORDER_RIGHTTT_MAC_ID_GUJARATI
    FT_GlyphSlot_Own_BitmapFT_STROKER_HTT_MAC_ID_GURMUKHI
    FT_GlyphSlotRecFT_STROKER_LINECAP_BUTTTT_MAC_ID_HEBREW
    FT_GX_VALIDATE_HFT_STROKER_LINECAP_ROUNDTT_MAC_ID_JAPANESE
    FT_GZIP_HFT_STROKER_LINECAP_SQUARETT_MAC_ID_KANNADA
    FT_Gzip_UncompressFT_STROKER_LINEJOIN_BEVELTT_MAC_ID_KHMER
    FT_HAS_COLORFT_STROKER_LINEJOIN_MITERTT_MAC_ID_KOREAN
    FT_HAS_FAST_GLYPHSFT_STROKER_LINEJOIN_MITER_FIXEDTT_MAC_ID_LAOTIAN
    FT_HAS_FIXED_SIZESFT_STROKER_LINEJOIN_MITER_VARIABLETT_MAC_ID_MALAYALAM
    FT_HAS_GLYPH_NAMESFT_STROKER_LINEJOIN_ROUNDTT_MAC_ID_MALDIVIAN
    FT_HAS_HORIZONTALFT_STYLE_FLAG_BOLDTT_MAC_ID_MONGOLIAN
    FT_HAS_KERNINGFT_STYLE_FLAG_ITALICTT_MAC_ID_ORIYA
    FT_HAS_MULTIPLE_MASTERSFT_STYLE_FLAG_XXXTT_MAC_ID_ROMAN
    FT_HAS_VERTICALFT_StreamTT_MAC_ID_RSYMBOL
    FT_Has_PS_Glyph_NamesFT_Stream_CloseFuncTT_MAC_ID_RUSSIAN
    FT_IMAGE_HFT_Stream_IoFuncTT_MAC_ID_SIMPLIFIED_CHINESE
    FT_IMAGE_TAGFT_Stream_OpenBzip2TT_MAC_ID_SINDHI
    FT_INCREMENTAL_HFT_Stream_OpenGzipTT_MAC_ID_SINHALESE
    FT_IncrementalFT_Stream_OpenLZWTT_MAC_ID_SLAVIC
    FT_Incremental_FreeGlyphDataFuncFT_StreamDescTT_MAC_ID_TAMIL
    FT_Incremental_FuncsRecFT_StreamRecTT_MAC_ID_TELUGU
    FT_Incremental_GetGlyphDataFuncFT_StringTT_MAC_ID_THAI
    FT_Incremental_GetGlyphMetricsFuncFT_StrokerTT_MAC_ID_TIBETAN
    FT_Incremental_InterfaceFT_Stroker_BeginSubPathTT_MAC_ID_TRADITIONAL_CHINESE
    FT_Incremental_InterfaceRecFT_Stroker_ConicToTT_MAC_ID_UNINTERP
    FT_Incremental_MetricsFT_Stroker_CubicToTT_MAC_ID_VIETNAMESE
    FT_Incremental_MetricsRecFT_Stroker_DoneTT_MAC_ID_XXX
    FT_Init_FreeTypeFT_Stroker_EndSubPathTT_MaxProfile
    FT_IntFT_Stroker_ExportTT_MS_ID_BIG_5
    FT_Int16FT_Stroker_ExportBorderTT_MS_ID_GB2312
    FT_Int32FT_Stroker_GetBorderCountsTT_MS_ID_JOHAB
    FT_Int64FT_Stroker_GetCountsTT_MS_ID_SJIS
    FT_IS_CID_KEYEDFT_Stroker_LineCapTT_MS_ID_SYMBOL_CS
    FT_IS_FIXED_WIDTHFT_Stroker_LineJoinTT_MS_ID_UCS_4
    FT_IS_SCALABLEFT_Stroker_LineToTT_MS_ID_UNICODE_CS
    FT_IS_SFNTFT_Stroker_NewTT_MS_ID_WANSUNG
    FT_IS_TRICKYFT_Stroker_ParseOutlineTT_MS_ID_XXX
    FT_KERNING_DEFAULTFT_Stroker_RewindTT_OS2
    FT_KERNING_UNFITTEDFT_Stroker_SetTT_PCLT
    FT_KERNING_UNSCALEDFT_StrokerBorderTT_PLATFORM_ADOBE
    FT_Kerning_ModeFT_SUBGLYPH_FLAG_2X2TT_PLATFORM_APPLE_UNICODE
    FT_LCD_FILTER_DEFAULTFT_SUBGLYPH_FLAG_ARGS_ARE_WORDSTT_PLATFORM_CUSTOM
    FT_LCD_FILTER_HFT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUESTT_PLATFORM_ISO
    FT_LCD_FILTER_LEGACYFT_SUBGLYPH_FLAG_ROUND_XY_TO_GRIDTT_PLATFORM_MACINTOSH
    FT_LCD_FILTER_LIGHTFT_SUBGLYPH_FLAG_SCALETT_PLATFORM_MICROSOFT
    FT_LCD_FILTER_NONEFT_SUBGLYPH_FLAG_USE_MY_METRICSTT_PLATFORM_XXX
    FT_LcdFilterFT_SUBGLYPH_FLAG_XXXTT_Postscript
    FT_LIST_HFT_SUBGLYPH_FLAG_XY_SCALETT_VertHeader
    FT_LibraryFT_SubGlyph
    FT_Library_SetLcdFilterFT_SYNTHESIS_H

    - -
    [TOC]
    + -
    generated on Thu Mar 6 23:13:44 2014
    +
    generated on Tue Dec 30 21:42:54 2014
    diff --git a/freetype/docs/reference/ft2-lcd_filtering.html b/freetype/docs/reference/ft2-lcd_filtering.html index ca3df8d85..768fbf02c 100644 --- a/freetype/docs/reference/ft2-lcd_filtering.html +++ b/freetype/docs/reference/ft2-lcd_filtering.html @@ -3,53 +3,116 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -LCD Filtering -

    +

    LCD Filtering

    Synopsis

    - - - -
    FT_LcdFilterFT_Library_SetLcdFilterWeights
    FT_Library_SetLcdFilter


    + + + +
    FT_LcdFilterFT_Library_SetLcdFilterWeights
    FT_Library_SetLcdFilter
    + -

    The FT_Library_SetLcdFilter API can be used to specify a low-pass filter, which is then applied to LCD-optimized bitmaps generated through FT_Render_Glyph. This is useful to reduce color fringes that would occur with unfiltered rendering.

    Note that no filter is active by default, and that this function is not implemented in default builds of the library. You need to #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your ‘ftoption.h’ file in order to activate it.

    -

    FreeType generates alpha coverage maps, which are linear by nature. For instance, the value 0x80 in bitmap representation means that (within numerical precision) 0x80/0xff fraction of that pixel is covered by the glyph's outline. The blending function for placing text over a background is

    +

    FreeType generates alpha coverage maps, which are linear by nature. For instance, the value 0x80 in bitmap representation means that (within numerical precision) 0x80/0xFF fraction of that pixel is covered by the glyph's outline. The blending function for placing text over a background is

       dst = alpha * src + (1 - alpha) * dst    ,
     
    @@ -63,144 +126,120 @@ LCD Filtering [0x10, 0x50, 0x60, 0x50, 0x10] ,

    where ‘a’ has value 0x30 and ‘b’ value 0x20. The weights in filter may have a sum larger than 0x100, which increases coloration slightly but also improves contrast.

    -

    -
    -

    FT_LcdFilter

    -
    -Defined in FT_LCD_FILTER_H (ftlcdfil.h). -

    -
     
    +
    +

    FT_LcdFilter

    +

    Defined in FT_LCD_FILTER_H (ftlcdfil.h).

    +
       typedef enum  FT_LcdFilter_
       {
    -    FT_LCD_FILTER_NONE    = 0,
    -    FT_LCD_FILTER_DEFAULT = 1,
    -    FT_LCD_FILTER_LIGHT   = 2,
    -    FT_LCD_FILTER_LEGACY  = 16,
    +    FT_LCD_FILTER_NONE    = 0,
    +    FT_LCD_FILTER_DEFAULT = 1,
    +    FT_LCD_FILTER_LIGHT   = 2,
    +    FT_LCD_FILTER_LEGACY  = 16,
     
         FT_LCD_FILTER_MAX   /* do not remove */
     
       } FT_LcdFilter;
    +
    -

    -

    A list of values to identify various types of LCD filters.

    -

    -
    values
    -

    - -
    FT_LCD_FILTER_NONE + +

    values

    + + - - -
    FT_LCD_FILTER_NONE

    Do not perform filtering. When used with subpixel rendering, this results in sometimes severe color fringes.

    FT_LCD_FILTER_DEFAULT +
    FT_LCD_FILTER_DEFAULT

    The default filter reduces color fringes considerably, at the cost of a slight blurriness in the output.

    FT_LCD_FILTER_LIGHT +
    FT_LCD_FILTER_LIGHT

    The light filter is a variant that produces less blurriness at the cost of slightly more color fringes than the default one. It might be better, depending on taste, your monitor, or your personal vision.

    FT_LCD_FILTER_LEGACY +
    FT_LCD_FILTER_LEGACY

    This filter corresponds to the original libXft color filter. It provides high contrast output but can exhibit really bad color fringes if glyphs are not extremely well hinted to the pixel grid. In other words, it only works well if the TrueType bytecode interpreter is enabled and high-quality hinted fonts are used.

    This filter is only provided for comparison purposes, and might be disabled or stay unsupported in the future.

    -
    -
    since
    + +

    since

    2.3.0

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Library_SetLcdFilter

    -
    -Defined in FT_LCD_FILTER_H (ftlcdfil.h). -

    -
     
    +
    + + +
    +

    FT_Library_SetLcdFilter

    +

    Defined in FT_LCD_FILTER_H (ftlcdfil.h).

    +
       FT_EXPORT( FT_Error )
       FT_Library_SetLcdFilter( FT_Library    library,
                                FT_LcdFilter  filter );
    +
    -

    -

    This function is used to apply color filtering to LCD decimated bitmaps, like the ones used when calling FT_Render_Glyph with FT_RENDER_MODE_LCD or FT_RENDER_MODE_LCD_V.

    -

    -
    input
    -

    - -
    library + +

    input

    + + -
    library

    A handle to the target library instance.

    filter +
    filter

    The filter type.

    You can use FT_LCD_FILTER_NONE here to disable this feature, or FT_LCD_FILTER_DEFAULT to use a default filter that should work well on most LCD screens.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This feature is always disabled by default. Clients must make an explicit call to this function with a ‘filter’ value other than FT_LCD_FILTER_NONE in order to enable it.

    Due to PATENTS covering subpixel rendering, this function doesn't do anything except returning ‘FT_Err_Unimplemented_Feature’ if the configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not defined in your build of the library, which should correspond to all default builds of FreeType.

    The filter affects glyph bitmaps rendered through FT_Render_Glyph, FT_Outline_Get_Bitmap, FT_Load_Glyph, and FT_Load_Char.

    It does not affect the output of FT_Outline_Render and FT_Outline_Get_Bitmap.

    If this feature is activated, the dimensions of LCD glyph bitmaps are either larger or taller than the dimensions of the corresponding outline with regards to the pixel grid. For example, for FT_RENDER_MODE_LCD, the filter adds up to 3 pixels to the left, and up to 3 pixels to the right.

    The bitmap offset values are adjusted correctly, so clients shouldn't need to modify their layout and glyph positioning code when enabling the filter.

    -
    -
    since
    + +

    since

    2.3.0

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Library_SetLcdFilterWeights

    -
    -Defined in FT_LCD_FILTER_H (ftlcdfil.h). -

    -
     
    +
    + + +
    +

    FT_Library_SetLcdFilterWeights

    +

    Defined in FT_LCD_FILTER_H (ftlcdfil.h).

    +
       FT_EXPORT( FT_Error )
       FT_Library_SetLcdFilterWeights( FT_Library      library,
                                       unsigned char  *weights );
    +
    -

    -

    Use this function to override the filter weights selected by FT_Library_SetLcdFilter. By default, FreeType uses the quintuple (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10, 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and FT_LCD_FILTER_LEGACY.

    -

    -
    input
    -

    - -
    library + +

    input

    + + -
    library

    A handle to the target library instance.

    weights +
    weights

    A pointer to an array; the function copies the first five bytes and uses them to specify the filter weights.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    Due to PATENTS covering subpixel rendering, this function doesn't do anything except returning ‘FT_Err_Unimplemented_Feature’ if the configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not defined in your build of the library, which should correspond to all default builds of FreeType.

    This function must be called after FT_Library_SetLcdFilter to have any effect.

    -
    -
    since
    + +

    since

    2.4.0

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-list_processing.html b/freetype/docs/reference/ft2-list_processing.html index cf8ad8cbe..2617e504f 100644 --- a/freetype/docs/reference/ft2-list_processing.html +++ b/freetype/docs/reference/ft2-list_processing.html @@ -3,135 +3,173 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -List Processing -

    +

    List Processing

    Synopsis

    - - - - - - -
    FT_ListFT_List_AddFT_List_Iterate
    FT_ListNodeFT_List_InsertFT_List_Destructor
    FT_ListRecFT_List_RemoveFT_List_Finalize
    FT_ListNodeRecFT_List_Up
    FT_List_FindFT_List_Iterator


    - -
    + + + + + + +
    FT_ListFT_List_AddFT_List_Iterate
    FT_ListNodeFT_List_InsertFT_List_Iterator
    FT_ListRecFT_List_FindFT_List_Finalize
    FT_ListNodeRecFT_List_RemoveFT_List_Destructor
     FT_List_Up
    + +

    This section contains various definitions related to list processing using doubly-linked nodes.

    -

    -
    -

    FT_List

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    +

    FT_List

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef struct FT_ListRec_*  FT_List;
    +
    -

    -

    A handle to a list record (see FT_ListRec).

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_ListNode

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_ListNode

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef struct FT_ListNodeRec_*  FT_ListNode;
    +
    -

    -

    Many elements and objects in FreeType are listed through an FT_List record (see FT_ListRec). As its name suggests, an FT_ListNode is a handle to a single list element.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_ListRec

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_ListRec

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef struct  FT_ListRec_
       {
         FT_ListNode  head;
         FT_ListNode  tail;
     
       } FT_ListRec;
    +
    -

    -

    A structure used to hold a simple doubly-linked list. These are used in many parts of FreeType.

    -

    -
    fields
    -

    - -
    head + +

    fields

    + + -

    The head (first element) of doubly-linked list.

    tail +
    tail

    The tail (last element) of doubly-linked list.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_ListNodeRec

    -
    -Defined in FT_TYPES_H (fttypes.h). -

    -
     
    +
    + + +
    +

    FT_ListNodeRec

    +

    Defined in FT_TYPES_H (fttypes.h).

    +
       typedef struct  FT_ListNodeRec_
       {
         FT_ListNode  prev;
    @@ -139,348 +177,270 @@ Defined in FT_TYPES_H (fttypes.h).
         void*        data;
     
       } FT_ListNodeRec;
    +
    -

    -

    A structure used to hold a single list element.

    -

    -
    fields
    -

    - -
    prev + +

    fields

    + + - -
    prev

    The previous element in the list. NULL if first.

    next +
    next

    The next element in the list. NULL if last.

    data +
    data

    A typeless pointer to the listed object.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_List_Find

    -
    -Defined in FT_LIST_H (ftlist.h). -

    -
     
    -  FT_EXPORT( FT_ListNode )
    -  FT_List_Find( FT_List  list,
    -                void*    data );
    -
    -

    -
    -

    Find the list node for a given listed object.

    -

    -
    input
    -

    - - - -
    list -

    A pointer to the parent list.

    -
    data -

    The address of the listed object.

    -
    -
    -
    return
    -

    List node. NULL if it wasn't found.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_List_Add

    -
    -Defined in FT_LIST_H (ftlist.h). -

    -
    +
    + +
    +

    FT_List_Add

    +

    Defined in FT_LIST_H (ftlist.h).

    +
       FT_EXPORT( void )
       FT_List_Add( FT_List      list,
                    FT_ListNode  node );
    +
    -

    -

    Append an element to the end of a list.

    -

    -
    inout
    -

    - -
    list + +

    inout

    + + -
    list

    A pointer to the parent list.

    node +
    node

    The node to append.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_List_Insert

    -
    -Defined in FT_LIST_H (ftlist.h). -

    -
     
    +
    + + +
    +

    FT_List_Insert

    +

    Defined in FT_LIST_H (ftlist.h).

    +
       FT_EXPORT( void )
       FT_List_Insert( FT_List      list,
                       FT_ListNode  node );
    +
    -

    -

    Insert an element at the head of a list.

    -

    -
    inout
    -

    - -
    list + +

    inout

    + + -
    list

    A pointer to parent list.

    node +
    node

    The node to insert.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_List_Remove

    -
    -Defined in FT_LIST_H (ftlist.h). -

    -
     
    +
    + + +
    +

    FT_List_Find

    +

    Defined in FT_LIST_H (ftlist.h).

    +
    +  FT_EXPORT( FT_ListNode )
    +  FT_List_Find( FT_List  list,
    +                void*    data );
    +
    + +

    Find the list node for a given listed object.

    + +

    input

    + + + +
    list +

    A pointer to the parent list.

    +
    data +

    The address of the listed object.

    +
    + +

    return

    +

    List node. NULL if it wasn't found.

    + +
    +
    + +
    +

    FT_List_Remove

    +

    Defined in FT_LIST_H (ftlist.h).

    +
       FT_EXPORT( void )
       FT_List_Remove( FT_List      list,
                       FT_ListNode  node );
    +
    -

    -

    Remove a node from a list. This function doesn't check whether the node is in the list!

    -

    -
    input
    -

    - -
    node + +

    input

    + +
    node

    The node to remove.

    -
    -
    inout
    -

    - -
    list + +

    inout

    + +
    list

    A pointer to the parent list.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_List_Up

    -
    -Defined in FT_LIST_H (ftlist.h). -

    -
     
    +
    + + +
    +

    FT_List_Up

    +

    Defined in FT_LIST_H (ftlist.h).

    +
       FT_EXPORT( void )
       FT_List_Up( FT_List      list,
                   FT_ListNode  node );
    +
    -

    -

    Move a node to the head/top of a list. Used to maintain LRU lists.

    -

    -
    inout
    -

    - -
    list + +

    inout

    + + -
    list

    A pointer to the parent list.

    node +
    node

    The node to move.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_List_Iterator

    -
    -Defined in FT_LIST_H (ftlist.h). -

    -
     
    -  typedef FT_Error
    -  (*FT_List_Iterator)( FT_ListNode  node,
    -                       void*        user );
    -
    -

    -
    -

    An FT_List iterator function that is called during a list parse by FT_List_Iterate.

    -

    -
    input
    -

    - - - -
    node -

    The current iteration list node.

    -
    user -

    A typeless pointer passed to FT_List_Iterate. Can be used to point to the iteration's state.

    -
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_List_Iterate

    -
    -Defined in FT_LIST_H (ftlist.h). -

    -
    +
    + +
    +

    FT_List_Iterate

    +

    Defined in FT_LIST_H (ftlist.h).

    +
       FT_EXPORT( FT_Error )
       FT_List_Iterate( FT_List           list,
                        FT_List_Iterator  iterator,
                        void*             user );
    +
    -

    -

    Parse a list and calls a given iterator function on each element. Note that parsing is stopped as soon as one of the iterator calls returns a non-zero value.

    -

    -
    input
    -

    - -
    list + +

    input

    + + - -
    list

    A handle to the list.

    iterator +
    iterator

    An iterator function, called on each node of the list.

    user +
    user

    A user-supplied field that is passed as the second argument to the iterator.

    -
    -
    return
    + +

    return

    The result (a FreeType error code) of the last iterator call.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_List_Destructor

    -
    -Defined in FT_LIST_H (ftlist.h). -

    -
     
    -  typedef void
    -  (*FT_List_Destructor)( FT_Memory  memory,
    -                         void*      data,
    -                         void*      user );
    +
    + -

    -
    -

    An FT_List iterator function that is called during a list finalization by FT_List_Finalize to destroy all elements in a given list.

    -

    -
    input
    -

    - - -
    system -

    The current system object.

    -
    data -

    The current object to destroy.

    +
    +

    FT_List_Iterator

    +

    Defined in FT_LIST_H (ftlist.h).

    +
    +  typedef FT_Error
    +  (*FT_List_Iterator)( FT_ListNode  node,
    +                       void*        user );
    +
    + +

    An FT_List iterator function that is called during a list parse by FT_List_Iterate.

    + +

    input

    + + -
    node +

    The current iteration list node.

    user -

    A typeless pointer passed to FT_List_Iterate. It can be used to point to the iteration's state.

    +
    user +

    A typeless pointer passed to FT_List_Iterate. Can be used to point to the iteration's state.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_List_Finalize

    -
    -Defined in FT_LIST_H (ftlist.h). -

    -
     
    +
    + + +
    +

    FT_List_Finalize

    +

    Defined in FT_LIST_H (ftlist.h).

    +
       FT_EXPORT( void )
       FT_List_Finalize( FT_List             list,
                         FT_List_Destructor  destroy,
                         FT_Memory           memory,
                         void*               user );
    +
    -

    -

    Destroy all elements in the list as well as the list itself.

    -

    -
    input
    -

    - -
    list + +

    input

    + + - - -
    list

    A handle to the list.

    destroy -

    A list destructor that will be applied to each element of the list.

    +
    destroy +

    A list destructor that will be applied to each element of the list. Set this to NULL if not needed.

    memory +
    memory

    The current memory object that handles deallocation.

    user +
    user

    A user-supplied field that is passed as the last argument to the destructor.

    -
    -
    note
    + +

    note

    This function expects that all nodes added by FT_List_Add or FT_List_Insert have been dynamically allocated.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + + +
    +

    FT_List_Destructor

    +

    Defined in FT_LIST_H (ftlist.h).

    +
    +  typedef void
    +  (*FT_List_Destructor)( FT_Memory  memory,
    +                         void*      data,
    +                         void*      user );
    +
    + +

    An FT_List iterator function that is called during a list finalization by FT_List_Finalize to destroy all elements in a given list.

    + +

    input

    + + + + +
    system +

    The current system object.

    +
    data +

    The current object to destroy.

    +
    user +

    A typeless pointer passed to FT_List_Iterate. It can be used to point to the iteration's state.

    +
    + +
    +
    diff --git a/freetype/docs/reference/ft2-lzw.html b/freetype/docs/reference/ft2-lzw.html index b45f8d814..5f500e643 100644 --- a/freetype/docs/reference/ft2-lzw.html +++ b/freetype/docs/reference/ft2-lzw.html @@ -3,92 +3,147 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -LZW Streams -

    +

    LZW Streams

    Synopsis

    - - -
    FT_Stream_OpenLZW


    + + +
    FT_Stream_OpenLZW
    + -

    This section contains the declaration of LZW-specific functions.

    -

    -
    -

    FT_Stream_OpenLZW

    -
    -Defined in FT_LZW_H (ftlzw.h). -

    -
     
    +
    +

    FT_Stream_OpenLZW

    +

    Defined in FT_LZW_H (ftlzw.h).

    +
       FT_EXPORT( FT_Error )
       FT_Stream_OpenLZW( FT_Stream  stream,
                          FT_Stream  source );
    +
    -

    -

    Open a new stream to parse LZW-compressed font files. This is mainly used to support the compressed ‘*.pcf.Z’ fonts that come with XFree86.

    -

    -
    input
    -

    - -
    stream + +

    input

    + + -
    stream

    The target embedding stream.

    source +
    source

    The source stream.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The source stream must be opened before calling this function.

    Calling the internal function ‘FT_Stream_Close’ on the new stream will not call ‘FT_Stream_Close’ on the source stream. None of the stream objects will be released to the heap.

    The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream

    In certain builds of the library, LZW compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face. This means that if no font driver is capable of handling the raw compressed file, the library will try to open a LZW stream from it and re-open the face with it.

    This function may return ‘FT_Err_Unimplemented_Feature’ if your build of FreeType was not compiled with LZW support.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-mac_specific.html b/freetype/docs/reference/ft2-mac_specific.html index 7b62628e2..ca66af63b 100644 --- a/freetype/docs/reference/ft2-mac_specific.html +++ b/freetype/docs/reference/ft2-mac_specific.html @@ -3,366 +3,372 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Mac Specific Interface -

    +

    Mac Specific Interface

    Synopsis

    - - - - -
    FT_New_Face_From_FONDFT_GetFilePath_From_Mac_ATS_Name
    FT_GetFile_From_Mac_NameFT_New_Face_From_FSSpec
    FT_GetFile_From_Mac_ATS_NameFT_New_Face_From_FSRef


    + + + + +
    FT_New_Face_From_FONDFT_GetFilePath_From_Mac_ATS_Name
    FT_GetFile_From_Mac_NameFT_New_Face_From_FSSpec
    FT_GetFile_From_Mac_ATS_NameFT_New_Face_From_FSRef
    + -

    The following definitions are only available if FreeType is compiled on a Macintosh.

    -

    -
    -

    FT_New_Face_From_FOND

    -
    -Defined in FT_MAC_H (ftmac.h). -

    -
     
    +
    +

    FT_New_Face_From_FOND

    +

    Defined in FT_MAC_H (ftmac.h).

    +
       FT_EXPORT( FT_Error )
       FT_New_Face_From_FOND( FT_Library  library,
                              Handle      fond,
                              FT_Long     face_index,
                              FT_Face    *aface )
                            FT_DEPRECATED_ATTRIBUTE;
    +
    -

    -

    Create a new face object from a FOND resource.

    -

    -
    inout
    -

    - -
    library + +

    inout

    + +
    library

    A handle to the library resource.

    -
    -
    input
    -

    - -
    fond + +

    input

    + + -
    fond

    A FOND resource.

    face_index +
    face_index

    Only supported for the -1 ‘sanity check’ special case.

    -
    -
    output
    -

    - -
    aface + +

    output

    + +
    aface

    A handle to a new face object.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    notes
    + +

    notes

    This function can be used to create FT_Face objects from fonts that are installed in the system as follows.

       fond = GetResource( 'FOND', fontName );                          
       error = FT_New_Face_From_FOND( library, fond, 0, &face );        
     
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_GetFile_From_Mac_Name

    -
    -Defined in FT_MAC_H (ftmac.h). -

    -
     
    +
    + + +
    +

    FT_GetFile_From_Mac_Name

    +

    Defined in FT_MAC_H (ftmac.h).

    +
       FT_EXPORT( FT_Error )
       FT_GetFile_From_Mac_Name( const char*  fontName,
                                 FSSpec*      pathSpec,
                                 FT_Long*     face_index )
                               FT_DEPRECATED_ATTRIBUTE;
    +
    -

    -

    Return an FSSpec for the disk file containing the named font.

    -

    -
    input
    -

    - -
    fontName + +

    input

    + +
    fontName

    Mac OS name of the font (e.g., Times New Roman Bold).

    -
    -
    output
    -

    - -
    pathSpec + +

    output

    + + -
    pathSpec

    FSSpec to the file. For passing to FT_New_Face_From_FSSpec.

    face_index +
    face_index

    Index of the face. For passing to FT_New_Face_From_FSSpec.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_GetFile_From_Mac_ATS_Name

    -
    -Defined in FT_MAC_H (ftmac.h). -

    -
     
    +
    + + +
    +

    FT_GetFile_From_Mac_ATS_Name

    +

    Defined in FT_MAC_H (ftmac.h).

    +
       FT_EXPORT( FT_Error )
       FT_GetFile_From_Mac_ATS_Name( const char*  fontName,
                                     FSSpec*      pathSpec,
                                     FT_Long*     face_index )
                                   FT_DEPRECATED_ATTRIBUTE;
    +
    -

    -

    Return an FSSpec for the disk file containing the named font.

    -

    -
    input
    -

    - -
    fontName + +

    input

    + +
    fontName

    Mac OS name of the font in ATS framework.

    -
    -
    output
    -

    - -
    pathSpec + +

    output

    + + -
    pathSpec

    FSSpec to the file. For passing to FT_New_Face_From_FSSpec.

    face_index +
    face_index

    Index of the face. For passing to FT_New_Face_From_FSSpec.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_GetFilePath_From_Mac_ATS_Name

    -
    -Defined in FT_MAC_H (ftmac.h). -

    -
     
    +
    + + +
    +

    FT_GetFilePath_From_Mac_ATS_Name

    +

    Defined in FT_MAC_H (ftmac.h).

    +
       FT_EXPORT( FT_Error )
       FT_GetFilePath_From_Mac_ATS_Name( const char*  fontName,
                                         UInt8*       path,
                                         UInt32       maxPathSize,
                                         FT_Long*     face_index )
                                       FT_DEPRECATED_ATTRIBUTE;
    +
    -

    -

    Return a pathname of the disk file and face index for given font name that is handled by ATS framework.

    -

    -
    input
    -

    - -
    fontName + +

    input

    + +
    fontName

    Mac OS name of the font in ATS framework.

    -
    -
    output
    -

    - -
    path + +

    output

    + + - -
    path

    Buffer to store pathname of the file. For passing to FT_New_Face. The client must allocate this buffer before calling this function.

    maxPathSize +
    maxPathSize

    Lengths of the buffer ‘path’ that client allocated.

    face_index +
    face_index

    Index of the face. For passing to FT_New_Face.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_New_Face_From_FSSpec

    -
    -Defined in FT_MAC_H (ftmac.h). -

    -
     
    +
    + + +
    +

    FT_New_Face_From_FSSpec

    +

    Defined in FT_MAC_H (ftmac.h).

    +
       FT_EXPORT( FT_Error )
       FT_New_Face_From_FSSpec( FT_Library     library,
                                const FSSpec  *spec,
                                FT_Long        face_index,
                                FT_Face       *aface )
                              FT_DEPRECATED_ATTRIBUTE;
    +
    -

    -

    Create a new face object from a given resource and typeface index using an FSSpec to the font file.

    -

    -
    inout
    -

    - -
    library + +

    inout

    + +
    library

    A handle to the library resource.

    -
    -
    input
    -

    - -
    spec + +

    input

    + + -
    spec

    FSSpec to the font file.

    face_index +
    face_index

    The index of the face within the resource. The first face has index 0.

    -
    -
    output
    -

    - -
    aface + +

    output

    + +
    aface

    A handle to a new face object.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    FT_New_Face_From_FSSpec is identical to FT_New_Face except it accepts an FSSpec instead of a path.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_New_Face_From_FSRef

    -
    -Defined in FT_MAC_H (ftmac.h). -

    -
     
    +
    + + +
    +

    FT_New_Face_From_FSRef

    +

    Defined in FT_MAC_H (ftmac.h).

    +
       FT_EXPORT( FT_Error )
       FT_New_Face_From_FSRef( FT_Library    library,
                               const FSRef  *ref,
                               FT_Long       face_index,
                               FT_Face      *aface )
                             FT_DEPRECATED_ATTRIBUTE;
    +
    -

    -

    Create a new face object from a given resource and typeface index using an FSRef to the font file.

    -

    -
    inout
    -

    - -
    library + +

    inout

    + +
    library

    A handle to the library resource.

    -
    -
    input
    -

    - -
    spec + +

    input

    + + -
    spec

    FSRef to the font file.

    face_index +
    face_index

    The index of the face within the resource. The first face has index 0.

    -
    -
    output
    -

    - -
    aface + +

    output

    + +
    aface

    A handle to a new face object.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    FT_New_Face_From_FSRef is identical to FT_New_Face except it accepts an FSRef instead of a path.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-module_management.html b/freetype/docs/reference/ft2-module_management.html index 754a648bf..a836715e2 100644 --- a/freetype/docs/reference/ft2-module_management.html +++ b/freetype/docs/reference/ft2-module_management.html @@ -3,54 +3,120 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Module Management -

    +

    Module Management

    Synopsis

    - - - - - - - -
    FT_Module_ConstructorFT_Remove_ModuleFT_Set_Debug_Hook
    FT_Module_DestructorFT_Property_SetFT_Add_Default_Modules
    FT_Module_RequesterFT_Property_GetFT_Renderer_Class
    FT_Module_ClassFT_Reference_LibraryFT_Get_Renderer
    FT_Add_ModuleFT_New_LibraryFT_Set_Renderer
    FT_Get_ModuleFT_Done_Library


    - -
    + + + + + + + + + + +
    FT_ModuleFT_Add_Default_ModulesFT_Renderer
    FT_Module_Constructor FT_Renderer_Class
    FT_Module_DestructorFT_Property_Set 
    FT_Module_RequesterFT_Property_GetFT_Get_Renderer
    FT_Module_Class FT_Set_Renderer
     FT_New_Library 
    FT_Add_ModuleFT_Done_LibraryFT_Set_Debug_Hook
    FT_Get_ModuleFT_Reference_Library 
    FT_Remove_Module FT_Driver
    + +

    The definitions below are used to manage modules within FreeType. Modules can be added, upgraded, and removed at runtime. Additionally, some module properties can be controlled also.

    Here is a list of possible values of the ‘module_name’ field in the FT_Module_Class structure.

    @@ -74,102 +140,87 @@ Module Management
       winfonts                                                         
     

    Note that the FreeType Cache sub-system is not a FreeType module.

    -

    -
    -

    FT_Module_Constructor

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
     
    +
    +

    FT_Module

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  typedef struct FT_ModuleRec_*  FT_Module;
    +
    + +

    A handle to a given FreeType module object. Each module can be a font driver, a renderer, or anything else that provides services to the formers.

    + +
    +
    + +
    +

    FT_Module_Constructor

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
       typedef FT_Error
    -  (*FT_Module_Constructor)( FT_Module  module );
    +  (*FT_Module_Constructor)( FT_Module  module );
    +
    -

    -

    A function used to initialize (not create) a new module object.

    -

    -
    input
    -

    - -
    module + +

    input

    + +
    module

    The module to initialize.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Module_Destructor

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
     
    +
    + + +
    +

    FT_Module_Destructor

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
       typedef void
    -  (*FT_Module_Destructor)( FT_Module  module );
    +  (*FT_Module_Destructor)( FT_Module  module );
    +
    -

    -

    A function used to finalize (not destroy) a given module object.

    -

    -
    input
    -

    - -
    module + +

    input

    + +
    module

    The module to finalize.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Module_Requester

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
     
    +
    + + +
    +

    FT_Module_Requester

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
       typedef FT_Module_Interface
    -  (*FT_Module_Requester)( FT_Module    module,
    +  (*FT_Module_Requester)( FT_Module    module,
                               const char*  name );
    +
    -

    -

    A function used to query a given module for a specific interface.

    -

    -
    input
    -

    - -
    module + +

    input

    + + -
    module

    The module to be searched.

    name +
    name

    The name of the interface in the module.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Module_Class

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
     
    +
    + + +
    +

    FT_Module_Class

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
       typedef struct  FT_Module_Class_
       {
         FT_ULong               module_flags;
    @@ -185,209 +236,193 @@ Defined in FT_MODULE_H (ftmodapi.h).
         FT_Module_Requester    get_interface;
     
       } FT_Module_Class;
    +
    -

    -

    The module class descriptor.

    -

    -
    fields
    -

    - -
    module_flags + +

    fields

    + + - - - - - - -
    module_flags

    Bit flags describing the module.

    module_size +
    module_size

    The size of one module object/instance in bytes.

    module_name +
    module_name

    The name of the module.

    module_version +
    module_version

    The version, as a 16.16 fixed number (major.minor).

    module_requires +
    module_requires

    The version of FreeType this module requires, as a 16.16 fixed number (major.minor). Starts at version 2.0, i.e., 0x20000.

    module_init +
    module_init

    The initializing function.

    module_done +
    module_done

    The finalizing function.

    get_interface +
    get_interface

    The interface requesting function.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Add_Module

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
     
    +
    + + +
    +

    FT_Add_Module

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
       FT_EXPORT( FT_Error )
       FT_Add_Module( FT_Library              library,
                      const FT_Module_Class*  clazz );
    +
    -

    -

    Add a new module to a given library instance.

    -

    -
    inout
    -

    - -
    library + +

    inout

    + +
    library

    A handle to the library object.

    -
    -
    input
    -

    - -
    clazz + +

    input

    + +
    clazz

    A pointer to class descriptor for the module.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    An error will be returned if a module already exists by that name, or if the module requires a version of FreeType that is too great.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Module

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
    -
    -  FT_EXPORT( FT_Module )
    +
    +
    + + +
    +

    FT_Get_Module

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
    +  FT_EXPORT( FT_Module )
       FT_Get_Module( FT_Library   library,
                      const char*  module_name );
    +
    -

    -

    Find a module by its name.

    -

    -
    input
    -

    - -
    library + +

    input

    + + -
    library

    A handle to the library object.

    module_name +
    module_name

    The module's name (as an ASCII string).

    -
    -
    return
    + +

    return

    A module handle. 0 if none was found.

    -
    -
    note
    + +

    note

    FreeType's internal modules aren't documented very well, and you should look up the source code for details.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Remove_Module

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
     
    +
    + + +
    +

    FT_Remove_Module

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
       FT_EXPORT( FT_Error )
       FT_Remove_Module( FT_Library  library,
    -                    FT_Module   module );
    +                    FT_Module   module );
    +
    -

    -

    Remove a given module from a library instance.

    -

    -
    inout
    -

    - -
    library + +

    inout

    + +
    library

    A handle to a library object.

    -
    -
    input
    -

    - -
    module + +

    input

    + +
    module

    A handle to a module object.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The module object is destroyed by the function in case of success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Property_Set

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
     
    +
    + + +
    +

    FT_Add_Default_Modules

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
    +  FT_EXPORT( void )
    +  FT_Add_Default_Modules( FT_Library  library );
    +
    + +

    Add the set of default drivers to a given library object. This is only useful when you create a library object with FT_New_Library (usually to plug a custom memory manager).

    + +

    inout

    + + +
    library +

    A handle to a new library object.

    +
    + +
    +
    + +
    +

    FT_Property_Set

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
       FT_EXPORT( FT_Error )
       FT_Property_Set( FT_Library        library,
                        const FT_String*  module_name,
                        const FT_String*  property_name,
                        const void*       value );
    +
    -

    -

    Set a property for a given module.

    -

    -
    input
    -

    - -
    library + +

    input

    + + - - -
    library

    A handle to the library the module is part of.

    module_name +
    module_name

    The module name.

    property_name +
    property_name

    The property name. Properties are described in the ‘Synopsis’ subsection of the module's documentation.

    Note that only a few modules have properties.

    value +
    value

    A generic pointer to a variable or structure that gives the new value of the property. The exact definition of ‘value’ is dependent on the property; see the ‘Synopsis’ subsection of the module's documentation.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    If ‘module_name’ isn't a valid module name, or ‘property_name’ doesn't specify a valid property, or if ‘value’ doesn't represent a valid value for the given property, an error is returned.

    The following example sets property ‘bar’ (a simple integer) in module ‘foo’ to value 1.

    @@ -399,59 +434,50 @@ Defined in FT_MODULE_H (ftmodapi.h).
     

    Note that the FreeType Cache sub-system doesn't recognize module property changes. To avoid glyph lookup confusion within the cache you should call FTC_Manager_Reset to completely flush the cache if a module property gets changed after FTC_Manager_New has been called.

    It is not possible to set properties of the FreeType Cache sub-system itself with FT_Property_Set; use ?FTC_Property_Set? instead.

    -
    -
    since
    + +

    since

    2.4.11

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Property_Get

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
     
    +
    + + +
    +

    FT_Property_Get

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
       FT_EXPORT( FT_Error )
       FT_Property_Get( FT_Library        library,
                        const FT_String*  module_name,
                        const FT_String*  property_name,
                        void*             value );
    +
    -

    -

    Get a module's property value.

    -

    -
    input
    -

    - -
    library + +

    input

    + + - -
    library

    A handle to the library the module is part of.

    module_name +
    module_name

    The module name.

    property_name +
    property_name

    The property name. Properties are described in the ‘Synopsis’ subsection of the module's documentation.

    -
    -
    inout
    -

    - -
    value + +

    inout

    + +
    value

    A generic pointer to a variable or structure that gives the value of the property. The exact definition of ‘value’ is dependent on the property; see the ‘Synopsis’ subsection of the module's documentation.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    If ‘module_name’ isn't a valid module name, or ‘property_name’ doesn't specify a valid property, or if ‘value’ doesn't represent a valid value for the given property, an error is returned.

    The following example gets property ‘baz’ (a range) in module ‘foo’.

    @@ -468,210 +494,118 @@ Defined in FT_MODULE_H (ftmodapi.h).
       FT_Property_Get( library, "foo", "baz", &baz );
     

    It is not possible to retrieve properties of the FreeType Cache sub-system with FT_Property_Get; use ?FTC_Property_Get? instead.

    -
    -
    since
    -

    2.4.11

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Reference_Library

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
     
    -  FT_EXPORT( FT_Error )
    -  FT_Reference_Library( FT_Library  library );
    +

    since

    +

    2.4.11

    -

    -
    -

    A counter gets initialized to 1 at the time an FT_Library structure is created. This function increments the counter. FT_Done_Library then only destroys a library if the counter is 1, otherwise it simply decrements the counter.

    -

    This function helps in managing life-cycles of structures that reference FT_Library objects.

    -

    -
    input
    -

    - - -
    library -

    A handle to a target library object.

    -
    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    since
    -

    2.4.2

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_New_Library

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
    +
    + +
    +

    FT_New_Library

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
       FT_EXPORT( FT_Error )
       FT_New_Library( FT_Memory    memory,
                       FT_Library  *alibrary );
    +
    -

    -

    This function is used to create a new FreeType library instance from a given memory object. It is thus possible to use libraries with distinct memory allocators within the same program.

    Normally, you would call this function (followed by a call to FT_Add_Default_Modules or a series of calls to FT_Add_Module) instead of FT_Init_FreeType to initialize the FreeType library.

    Don't use FT_Done_FreeType but FT_Done_Library to destroy a library instance.

    -

    -
    input
    -

    - -
    memory + +

    input

    + +
    memory

    A handle to the original memory object.

    -
    -
    output
    -

    - -
    alibrary + +

    output

    + +
    alibrary

    A pointer to handle of a new library object.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    See the discussion of reference counters in the description of FT_Reference_Library.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Done_Library

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
     
    +
    + + +
    +

    FT_Done_Library

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
       FT_EXPORT( FT_Error )
       FT_Done_Library( FT_Library  library );
    +
    -

    -

    Discard a given library object. This closes all drivers and discards all resource objects.

    -

    -
    input
    -

    - -
    library + +

    input

    + +
    library

    A handle to the target library.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    See the discussion of reference counters in the description of FT_Reference_Library.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Set_Debug_Hook

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
     
    -  FT_EXPORT( void )
    -  FT_Set_Debug_Hook( FT_Library         library,
    -                     FT_UInt            hook_index,
    -                     FT_DebugHook_Func  debug_hook );
    +
    + -

    -
    -

    Set a debug hook function for debugging the interpreter of a font format.

    -

    -
    inout
    -

    - - -
    library -

    A handle to the library object.

    -
    -
    -
    input
    -

    - - - -
    hook_index -

    The index of the debug hook. You should use the values defined in ‘ftobjs.h’, e.g., ‘FT_DEBUG_HOOK_TRUETYPE’.

    -
    debug_hook -

    The function used to debug the interpreter.

    -
    -
    -
    note
    -

    Currently, four debug hook slots are available, but only two (for the TrueType and the Type 1 interpreter) are defined.

    -

    Since the internal headers of FreeType are no longer installed, the symbol ‘FT_DEBUG_HOOK_TRUETYPE’ isn't available publicly. This is a bug and will be fixed in a forthcoming release.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Add_Default_Modules

    -
    -Defined in FT_MODULE_H (ftmodapi.h). -

    -
    +
    +

    FT_Reference_Library

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Reference_Library( FT_Library  library );
    +
    - FT_EXPORT( void ) - FT_Add_Default_Modules( FT_Library library ); +

    A counter gets initialized to 1 at the time an FT_Library structure is created. This function increments the counter. FT_Done_Library then only destroys a library if the counter is 1, otherwise it simply decrements the counter.

    +

    This function helps in managing life-cycles of structures that reference FT_Library objects.

    -

    -
    -

    Add the set of default drivers to a given library object. This is only useful when you create a library object with FT_New_Library (usually to plug a custom memory manager).

    -

    -
    inout
    -

    - -
    library -

    A handle to a new library object.

    +

    input

    + +
    library +

    A handle to a target library object.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Renderer_Class

    -
    -Defined in FT_RENDER_H (ftrender.h). -

    -
     
    +

    return

    +

    FreeType error code. 0 means success.

    + +

    since

    +

    2.4.2

    + +
    + + +
    +

    FT_Renderer

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  typedef struct FT_RendererRec_*  FT_Renderer;
    +
    + +

    A handle to a given FreeType renderer. A renderer is a special module in charge of converting a glyph image to a bitmap, when necessary. Each renderer supports a given glyph image format, and one or more target surface depths.

    + +
    +
    + +
    +

    FT_Renderer_Class

    +

    Defined in FT_RENDER_H (ftrender.h).

    +
       typedef struct  FT_Renderer_Class_
       {
         FT_Module_Class            root;
    @@ -686,134 +620,160 @@ Defined in FT_RENDER_H (ftrender.h).
         FT_Raster_Funcs*           raster_class;
     
       } FT_Renderer_Class;
    +
    -

    -

    The renderer module class descriptor.

    -

    -
    fields
    -

    - -
    root + +

    fields

    + + - - - - - -
    root

    The root FT_Module_Class fields.

    glyph_format +
    glyph_format

    The glyph image format this renderer handles.

    render_glyph +
    render_glyph

    A method used to render the image that is in a given glyph slot into a bitmap.

    transform_glyph +
    transform_glyph

    A method used to transform the image that is in a given glyph slot.

    get_glyph_cbox +
    get_glyph_cbox

    A method used to access the glyph's cbox.

    set_mode +
    set_mode

    A method used to pass additional parameters.

    raster_class +
    raster_class

    For FT_GLYPH_FORMAT_OUTLINE renderers only. This is a pointer to its raster's class.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Renderer

    -
    -Defined in FT_RENDER_H (ftrender.h). -

    -
    -
    -  FT_EXPORT( FT_Renderer )
    +
    +
    + + +
    +

    FT_Get_Renderer

    +

    Defined in FT_RENDER_H (ftrender.h).

    +
    +  FT_EXPORT( FT_Renderer )
       FT_Get_Renderer( FT_Library       library,
                        FT_Glyph_Format  format );
    +
    -

    -

    Retrieve the current renderer for a given glyph format.

    -

    -
    input
    -

    - -
    library + +

    input

    + + -
    library

    A handle to the library object.

    format +
    format

    The glyph format.

    -
    -
    return
    + +

    return

    A renderer handle. 0 if none found.

    -
    -
    note
    + +

    note

    An error will be returned if a module already exists by that name, or if the module requires a version of FreeType that is too great.

    To add a new renderer, simply use FT_Add_Module. To retrieve a renderer by its name, use FT_Get_Module.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Set_Renderer

    -
    -Defined in FT_RENDER_H (ftrender.h). -

    -
     
    +
    + + +
    +

    FT_Set_Renderer

    +

    Defined in FT_RENDER_H (ftrender.h).

    +
       FT_EXPORT( FT_Error )
       FT_Set_Renderer( FT_Library     library,
    -                   FT_Renderer    renderer,
    +                   FT_Renderer    renderer,
                        FT_UInt        num_params,
                        FT_Parameter*  parameters );
    +
    -

    -

    Set the current renderer to use, and set additional mode.

    -

    -
    inout
    -

    - -
    library + +

    inout

    + +
    library

    A handle to the library object.

    -
    -
    input
    -

    - -
    renderer + +

    input

    + + - -
    renderer

    A handle to the renderer object.

    num_params +
    num_params

    The number of additional parameters.

    parameters +
    parameters

    Additional parameters.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    In case of success, the renderer will be used to convert glyph images in the renderer's known format into bitmaps.

    This doesn't change the current renderer for other formats.

    Currently, only the B/W renderer, if compiled with FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels anti-aliasing mode; this option must be set directly in ‘ftraster.c’ and is undefined by default) accepts a single tag ‘pal5’ to set its gray palette as a character string with 5 elements. Consequently, the third and fourth argument are zero normally.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + + +
    +

    FT_Set_Debug_Hook

    +

    Defined in FT_MODULE_H (ftmodapi.h).

    +
    +  FT_EXPORT( void )
    +  FT_Set_Debug_Hook( FT_Library         library,
    +                     FT_UInt            hook_index,
    +                     FT_DebugHook_Func  debug_hook );
    +
    + +

    Set a debug hook function for debugging the interpreter of a font format.

    + +

    inout

    + + +
    library +

    A handle to the library object.

    +
    + +

    input

    + + + +
    hook_index +

    The index of the debug hook. You should use the values defined in ‘ftobjs.h’, e.g., ‘FT_DEBUG_HOOK_TRUETYPE’.

    +
    debug_hook +

    The function used to debug the interpreter.

    +
    + +

    note

    +

    Currently, four debug hook slots are available, but only two (for the TrueType and the Type 1 interpreter) are defined.

    +

    Since the internal headers of FreeType are no longer installed, the symbol ‘FT_DEBUG_HOOK_TRUETYPE’ isn't available publicly. This is a bug and will be fixed in a forthcoming release.

    + +
    +
    + +
    +

    FT_Driver

    +

    Defined in FT_FREETYPE_H (freetype.h).

    +
    +  typedef struct FT_DriverRec_*  FT_Driver;
    +
    + +

    A handle to a given FreeType font driver object. Each font driver is a special module capable of creating faces from font files.

    + +
    +
    diff --git a/freetype/docs/reference/ft2-multiple_masters.html b/freetype/docs/reference/ft2-multiple_masters.html index efb630aa7..ba5115b81 100644 --- a/freetype/docs/reference/ft2-multiple_masters.html +++ b/freetype/docs/reference/ft2-multiple_masters.html @@ -3,64 +3,124 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Multiple Masters -

    +

    Multiple Masters

    Synopsis

    - - - - - - - -
    FT_MM_AxisFT_Get_MM_Var
    FT_Multi_MasterFT_Set_MM_Design_Coordinates
    FT_Var_AxisFT_Set_Var_Design_Coordinates
    FT_Var_Named_StyleFT_Set_MM_Blend_Coordinates
    FT_MM_VarFT_Set_Var_Blend_Coordinates
    FT_Get_Multi_Master


    - -
    + + + + + + + +
    FT_MM_AxisFT_Get_MM_Var
    FT_Multi_MasterFT_Set_MM_Design_Coordinates
    FT_Var_AxisFT_Set_Var_Design_Coordinates
    FT_Var_Named_StyleFT_Set_MM_Blend_Coordinates
    FT_MM_VarFT_Set_Var_Blend_Coordinates
    FT_Get_Multi_Master
    + +

    The following types and functions are used to manage Multiple Master fonts, i.e., the selection of specific design instances by setting design axis coordinates.

    George Williams has extended this interface to make it work with both Type 1 Multiple Masters fonts and GX distortable (var) fonts. Some of these routines only work with MM fonts, others will work with both types. They are similar enough that a consistent interface makes sense.

    -

    -
    -

    FT_MM_Axis

    -
    -Defined in FT_MULTIPLE_MASTERS_H (ftmm.h). -

    -
     
    +
    +

    FT_MM_Axis

    +

    Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).

    +
       typedef struct  FT_MM_Axis_
       {
         FT_String*  name;
    @@ -68,39 +128,31 @@ Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).
         FT_Long     maximum;
     
       } FT_MM_Axis;
    +
    -

    -

    A simple structure used to model a given axis in design space for Multiple Masters fonts.

    This structure can't be used for GX var fonts.

    -

    -
    fields
    -

    - -
    name + +

    fields

    + + - -
    name

    The axis's name.

    minimum +
    minimum

    The axis's minimum design coordinate.

    maximum +
    maximum

    The axis's maximum design coordinate.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Multi_Master

    -
    -Defined in FT_MULTIPLE_MASTERS_H (ftmm.h). -

    -
     
    +
    + + +
    +

    FT_Multi_Master

    +

    Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).

    +
       typedef struct  FT_Multi_Master_
       {
         FT_UInt     num_axis;
    @@ -108,39 +160,31 @@ Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).
         FT_MM_Axis  axis[T1_MAX_MM_AXIS];
     
       } FT_Multi_Master;
    +
    -

    -

    A structure used to model the axes and space of a Multiple Masters font.

    This structure can't be used for GX var fonts.

    -

    -
    fields
    -

    - -
    num_axis + +

    fields

    + + - -
    num_axis

    Number of axes. Cannot exceed 4.

    num_designs +
    num_designs

    Number of designs; should be normally 2^num_axis even though the Type 1 specification strangely allows for intermediate designs to be present. This number cannot exceed 16.

    axis +
    axis

    A table of axis descriptors.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Var_Axis

    -
    -Defined in FT_MULTIPLE_MASTERS_H (ftmm.h). -

    -
     
    +
    + + +
    +

    FT_Var_Axis

    +

    Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).

    +
       typedef struct  FT_Var_Axis_
       {
         FT_String*  name;
    @@ -153,83 +197,67 @@ Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).
         FT_UInt     strid;
     
       } FT_Var_Axis;
    +
    -

    -

    A simple structure used to model a given axis in design space for Multiple Masters and GX var fonts.

    -

    -
    fields
    -

    - -
    name + +

    fields

    + + - - - - -
    name

    The axis's name. Not always meaningful for GX.

    minimum +
    minimum

    The axis's minimum design coordinate.

    def +
    def

    The axis's default design coordinate. FreeType computes meaningful default values for MM; it is then an integer value, not in 16.16 format.

    maximum +
    maximum

    The axis's maximum design coordinate.

    tag +
    tag

    The axis's tag (the GX equivalent to ‘name’). FreeType provides default values for MM if possible.

    strid +
    strid

    The entry in ‘name’ table (another GX version of ‘name’). Not meaningful for MM.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Var_Named_Style

    -
    -Defined in FT_MULTIPLE_MASTERS_H (ftmm.h). -

    -
     
    +
    + + +
    +

    FT_Var_Named_Style

    +

    Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).

    +
       typedef struct  FT_Var_Named_Style_
       {
         FT_Fixed*  coords;
         FT_UInt    strid;
     
       } FT_Var_Named_Style;
    +
    -

    -

    A simple structure used to model a named style in a GX var font.

    This structure can't be used for MM fonts.

    -

    -
    fields
    -

    - -
    coords + +

    fields

    + + -
    coords

    The design coordinates for this style. This is an array with one entry for each axis.

    strid +
    strid

    The entry in ‘name’ table identifying this style.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_MM_Var

    -
    -Defined in FT_MULTIPLE_MASTERS_H (ftmm.h). -

    -
     
    +
    + + +
    +

    FT_MM_Var

    +

    Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).

    +
       typedef struct  FT_MM_Var_
       {
         FT_UInt              num_axis;
    @@ -239,273 +267,216 @@ Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).
         FT_Var_Named_Style*  namedstyle;
     
       } FT_MM_Var;
    +
    -

    -

    A structure used to model the axes and space of a Multiple Masters or GX var distortable font.

    Some fields are specific to one format and not to the other.

    -

    -
    fields
    -

    - -
    num_axis + +

    fields

    + + - - - -
    num_axis

    The number of axes. The maximum value is 4 for MM; no limit in GX.

    num_designs +
    num_designs

    The number of designs; should be normally 2^num_axis for MM fonts. Not meaningful for GX (where every glyph could have a different number of designs).

    num_namedstyles +
    num_namedstyles

    The number of named styles; only meaningful for GX that allows certain design coordinates to have a string ID (in the ‘name’ table) associated with them. The font can tell the user that, for example, Weight=1.5 is ‘Bold’.

    axis +
    axis

    A table of axis descriptors. GX fonts contain slightly more data than MM.

    namedstyles +
    namedstyles

    A table of named styles. Only meaningful with GX.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Multi_Master

    -
    -Defined in FT_MULTIPLE_MASTERS_H (ftmm.h). -

    -
     
    +
    + + +
    +

    FT_Get_Multi_Master

    +

    Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_Multi_Master( FT_Face           face,
                            FT_Multi_Master  *amaster );
    +
    -

    -

    Retrieve the Multiple Master descriptor of a given font.

    This function can't be used with GX fonts.

    -

    -
    input
    -

    - -
    face + +

    input

    + +
    face

    A handle to the source face.

    -
    -
    output
    -

    - -
    amaster + +

    output

    + +
    amaster

    The Multiple Masters descriptor.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_MM_Var

    -
    -Defined in FT_MULTIPLE_MASTERS_H (ftmm.h). -

    -
     
    +
    + + +
    +

    FT_Get_MM_Var

    +

    Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_MM_Var( FT_Face      face,
                      FT_MM_Var*  *amaster );
    +
    -

    -

    Retrieve the Multiple Master/GX var descriptor of a given font.

    -

    -
    input
    -

    - -
    face + +

    input

    + +
    face

    A handle to the source face.

    -
    -
    output
    -

    - -
    amaster + +

    output

    + +
    amaster

    The Multiple Masters/GX var descriptor. Allocates a data structure, which the user must free.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Set_MM_Design_Coordinates

    -
    -Defined in FT_MULTIPLE_MASTERS_H (ftmm.h). -

    -
     
    +
    + + +
    +

    FT_Set_MM_Design_Coordinates

    +

    Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).

    +
       FT_EXPORT( FT_Error )
       FT_Set_MM_Design_Coordinates( FT_Face   face,
                                     FT_UInt   num_coords,
                                     FT_Long*  coords );
    +
    -

    -

    For Multiple Masters fonts, choose an interpolated font design through design coordinates.

    This function can't be used with GX fonts.

    -

    -
    inout
    -

    - -
    face + +

    inout

    + +
    face

    A handle to the source face.

    -
    -
    input
    -

    - -
    num_coords + +

    input

    + + -
    num_coords

    The number of design coordinates (must be equal to the number of axes in the font).

    coords +
    coords

    An array of design coordinates.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Set_Var_Design_Coordinates

    -
    -Defined in FT_MULTIPLE_MASTERS_H (ftmm.h). -

    -
     
    +
    + + +
    +

    FT_Set_Var_Design_Coordinates

    +

    Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).

    +
       FT_EXPORT( FT_Error )
       FT_Set_Var_Design_Coordinates( FT_Face    face,
                                      FT_UInt    num_coords,
                                      FT_Fixed*  coords );
    +
    -

    -

    For Multiple Master or GX Var fonts, choose an interpolated font design through design coordinates.

    -

    -
    inout
    -

    - -
    face + +

    inout

    + +
    face

    A handle to the source face.

    -
    -
    input
    -

    - -
    num_coords + +

    input

    + + -
    num_coords

    The number of design coordinates (must be equal to the number of axes in the font).

    coords +
    coords

    An array of design coordinates.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Set_MM_Blend_Coordinates

    -
    -Defined in FT_MULTIPLE_MASTERS_H (ftmm.h). -

    -
     
    +
    + + +
    +

    FT_Set_MM_Blend_Coordinates

    +

    Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).

    +
       FT_EXPORT( FT_Error )
       FT_Set_MM_Blend_Coordinates( FT_Face    face,
                                    FT_UInt    num_coords,
                                    FT_Fixed*  coords );
    +
    -

    -

    For Multiple Masters and GX var fonts, choose an interpolated font design through normalized blend coordinates.

    -

    -
    inout
    -

    - -
    face + +

    inout

    + +
    face

    A handle to the source face.

    -
    -
    input
    -

    - -
    num_coords + +

    input

    + + -
    num_coords

    The number of design coordinates (must be equal to the number of axes in the font).

    coords +
    coords

    The design coordinates array (each element must be between 0 and 1.0).

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Set_Var_Blend_Coordinates

    -
    -Defined in FT_MULTIPLE_MASTERS_H (ftmm.h). -

    -
     
    +
    + + +
    +

    FT_Set_Var_Blend_Coordinates

    +

    Defined in FT_MULTIPLE_MASTERS_H (ftmm.h).

    +
       FT_EXPORT( FT_Error )
       FT_Set_Var_Blend_Coordinates( FT_Face    face,
                                     FT_UInt    num_coords,
                                     FT_Fixed*  coords );
    +
    -

    -

    This is another name of FT_Set_MM_Blend_Coordinates.

    -

    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-ot_validation.html b/freetype/docs/reference/ft2-ot_validation.html index 1d9be98de..a4988e183 100644 --- a/freetype/docs/reference/ft2-ot_validation.html +++ b/freetype/docs/reference/ft2-ot_validation.html @@ -3,115 +3,119 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -OpenType Validation -

    +

    OpenType Validation

    Synopsis

    - - -
    FT_VALIDATE_OTXXXFT_OpenType_ValidateFT_OpenType_Free


    + + + +
    FT_OpenType_Validate 
    FT_OpenType_FreeFT_VALIDATE_OTXXX
    + -

    This section contains the declaration of functions to validate some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).

    -

    -
    -

    FT_VALIDATE_OTXXX

    -
    -Defined in FT_OPENTYPE_VALIDATE_H (ftotval.h). -

    -
    -
    -#define FT_VALIDATE_BASE  0x0100
    -#define FT_VALIDATE_GDEF  0x0200
    -#define FT_VALIDATE_GPOS  0x0400
    -#define FT_VALIDATE_GSUB  0x0800
    -#define FT_VALIDATE_JSTF  0x1000
    -#define FT_VALIDATE_MATH  0x2000
    -
    -#define FT_VALIDATE_OT  FT_VALIDATE_BASE | \
    -                        FT_VALIDATE_GDEF | \
    -                        FT_VALIDATE_GPOS | \
    -                        FT_VALIDATE_GSUB | \
    -                        FT_VALIDATE_JSTF | \
    -                        FT_VALIDATE_MATH
    -
    -

    -
    -

    A list of bit-field constants used with FT_OpenType_Validate to indicate which OpenType tables should be validated.

    -

    -
    values
    -

    - - - - - - - - -
    FT_VALIDATE_BASE -

    Validate BASE table.

    -
    FT_VALIDATE_GDEF -

    Validate GDEF table.

    -
    FT_VALIDATE_GPOS -

    Validate GPOS table.

    -
    FT_VALIDATE_GSUB -

    Validate GSUB table.

    -
    FT_VALIDATE_JSTF -

    Validate JSTF table.

    -
    FT_VALIDATE_MATH -

    Validate MATH table.

    -
    FT_VALIDATE_OT -

    Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).

    -
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_OpenType_Validate

    -
    -Defined in FT_OPENTYPE_VALIDATE_H (ftotval.h). -

    -
     
    +
    +

    FT_OpenType_Validate

    +

    Defined in FT_OPENTYPE_VALIDATE_H (ftotval.h).

    +
       FT_EXPORT( FT_Error )
       FT_OpenType_Validate( FT_Face    face,
                             FT_UInt    validation_flags,
    @@ -120,89 +124,124 @@ Defined in FT_OPENTYPE_VALIDATE_H (ftotval.h).
                             FT_Bytes  *GPOS_table,
                             FT_Bytes  *GSUB_table,
                             FT_Bytes  *JSTF_table );
    +
    -

    -

    Validate various OpenType tables to assure that all offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming).

    -

    -
    input
    -

    - -
    face + +

    input

    + + -
    face

    A handle to the input face.

    validation_flags +
    validation_flags

    A bit field that specifies the tables to be validated. See FT_VALIDATE_OTXXX for possible values.

    -
    -
    output
    -

    - -
    BASE_table + +

    output

    + + - - - -
    BASE_table

    A pointer to the BASE table.

    GDEF_table +
    GDEF_table

    A pointer to the GDEF table.

    GPOS_table +
    GPOS_table

    A pointer to the GPOS table.

    GSUB_table +
    GSUB_table

    A pointer to the GSUB table.

    JSTF_table +
    JSTF_table

    A pointer to the JSTF table.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function only works with OpenType fonts, returning an error otherwise.

    After use, the application should deallocate the five tables with FT_OpenType_Free. A NULL value indicates that the table either doesn't exist in the font, or the application hasn't asked for validation.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_OpenType_Free

    -
    -Defined in FT_OPENTYPE_VALIDATE_H (ftotval.h). -

    -
     
    +
    + + +
    +

    FT_OpenType_Free

    +

    Defined in FT_OPENTYPE_VALIDATE_H (ftotval.h).

    +
       FT_EXPORT( void )
       FT_OpenType_Free( FT_Face   face,
                         FT_Bytes  table );
    +
    -

    -

    Free the buffer allocated by OpenType validator.

    -

    -
    input
    -

    - -
    face + +

    input

    + + -
    face

    A handle to the input face.

    table +
    table

    The pointer to the buffer that is allocated by FT_OpenType_Validate.

    -
    -
    note
    + +

    note

    This function must be used to free the buffer allocated by FT_OpenType_Validate only.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + + +
    +

    FT_VALIDATE_OTXXX

    +

    Defined in FT_OPENTYPE_VALIDATE_H (ftotval.h).

    +
    +#define FT_VALIDATE_BASE  0x0100
    +#define FT_VALIDATE_GDEF  0x0200
    +#define FT_VALIDATE_GPOS  0x0400
    +#define FT_VALIDATE_GSUB  0x0800
    +#define FT_VALIDATE_JSTF  0x1000
    +#define FT_VALIDATE_MATH  0x2000
    +
    +#define FT_VALIDATE_OT  FT_VALIDATE_BASE | \
    +                        FT_VALIDATE_GDEF | \
    +                        FT_VALIDATE_GPOS | \
    +                        FT_VALIDATE_GSUB | \
    +                        FT_VALIDATE_JSTF | \
    +                        FT_VALIDATE_MATH
    +
    + +

    A list of bit-field constants used with FT_OpenType_Validate to indicate which OpenType tables should be validated.

    + +

    values

    + + + + + + + + +
    FT_VALIDATE_BASE +

    Validate BASE table.

    +
    FT_VALIDATE_GDEF +

    Validate GDEF table.

    +
    FT_VALIDATE_GPOS +

    Validate GPOS table.

    +
    FT_VALIDATE_GSUB +

    Validate GSUB table.

    +
    FT_VALIDATE_JSTF +

    Validate JSTF table.

    +
    FT_VALIDATE_MATH +

    Validate MATH table.

    +
    FT_VALIDATE_OT +

    Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).

    +
    + +
    +
    diff --git a/freetype/docs/reference/ft2-outline_processing.html b/freetype/docs/reference/ft2-outline_processing.html index 0c5fc09a6..323efc916 100644 --- a/freetype/docs/reference/ft2-outline_processing.html +++ b/freetype/docs/reference/ft2-outline_processing.html @@ -3,69 +3,131 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Outline Processing -

    +

    Outline Processing

    Synopsis

    - - - - - - - - - - - - - -
    FT_Outlineft_outline_flags
    FT_OUTLINE_FLAGSFT_Outline_MoveToFunc
    FT_Outline_NewFT_Outline_LineToFunc
    FT_Outline_DoneFT_Outline_ConicToFunc
    FT_Outline_CopyFT_Outline_CubicToFunc
    FT_Outline_TranslateFT_Outline_Funcs
    FT_Outline_TransformFT_Outline_Decompose
    FT_Outline_EmboldenFT_Outline_Get_CBox
    FT_Outline_EmboldenXYFT_Outline_Get_Bitmap
    FT_Outline_ReverseFT_Outline_Render
    FT_Outline_CheckFT_Orientation
    FT_Outline_Get_BBoxFT_Outline_Get_Orientation


    - -
    + + + + + + + + + + + + + + + +
    FT_OutlineFT_Outline_Get_Bitmap
    FT_Outline_NewFT_Outline_Render
    FT_Outline_DoneFT_Outline_Decompose
    FT_Outline_CopyFT_Outline_Funcs
    FT_Outline_TranslateFT_Outline_MoveToFunc
    FT_Outline_TransformFT_Outline_LineToFunc
    FT_Outline_EmboldenFT_Outline_ConicToFunc
    FT_Outline_EmboldenXYFT_Outline_CubicToFunc
    FT_Outline_Reverse 
    FT_Outline_CheckFT_Orientation
     FT_Outline_Get_Orientation
    FT_Outline_Get_CBox 
    FT_Outline_Get_BBoxFT_OUTLINE_XXX
     
    + +

    This section contains routines used to create and destroy scalable glyph images known as ‘outlines’. These can also be measured, transformed, and converted into bitmaps and pixmaps.

    -

    -
    -

    FT_Outline

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    +
    +

    FT_Outline

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef struct  FT_Outline_
       {
         short       n_contours;      /* number of contours in glyph        */
    @@ -78,130 +140,46 @@ Defined in FT_IMAGE_H (ftimage.h).
         int         flags;           /* outline masks                      */
     
       } FT_Outline;
    +
    - /* Following limits must be consistent with */ - /* FT_Outline.{n_contours,n_points} */ -#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX -#define FT_OUTLINE_POINTS_MAX SHRT_MAX - -

    -

    This structure is used to describe an outline to the scan-line converter.

    -

    -
    fields
    -

    - -
    n_contours + +

    fields

    + + - - - - - -
    n_contours

    The number of contours in the outline.

    n_points +
    n_points

    The number of points in the outline.

    points +
    points

    A pointer to an array of ‘n_points’ FT_Vector elements, giving the outline's point coordinates.

    tags +
    tags

    A pointer to an array of ‘n_points’ chars, giving each outline point's type.

    If bit 0 is unset, the point is ‘off’ the curve, i.e., a Bézier control point, while it is ‘on’ if set.

    Bit 1 is meaningful for ‘off’ points only. If set, it indicates a third-order Bézier arc control point; and a second-order control point if unset.

    If bit 2 is set, bits 5-7 contain the drop-out mode (as defined in the OpenType specification; the value is the same as the argument to the SCANMODE instruction).

    Bits 3 and 4 are reserved for internal purposes.

    contours +
    contours

    An array of ‘n_contours’ shorts, giving the end point of each contour within the outline. For example, the first contour is defined by the points ‘0’ to ‘contours[0]’, the second one is defined by the points ‘contours[0]+1’ to ‘contours[1]’, etc.

    flags -

    A set of bit flags used to characterize the outline and give hints to the scan-converter and hinter on how to convert/grid-fit it. See FT_OUTLINE_FLAGS.

    -
    -
    -
    note
    -

    The B/W rasterizer only checks bit 2 in the ‘tags’ array for the first point of each contour. The drop-out mode as given with FT_OUTLINE_IGNORE_DROPOUTS, FT_OUTLINE_SMART_DROPOUTS, and FT_OUTLINE_INCLUDE_STUBS in ‘flags’ is then overridden.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_OUTLINE_FLAGS

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
    -
    -#define FT_OUTLINE_NONE             0x0
    -#define FT_OUTLINE_OWNER            0x1
    -#define FT_OUTLINE_EVEN_ODD_FILL    0x2
    -#define FT_OUTLINE_REVERSE_FILL     0x4
    -#define FT_OUTLINE_IGNORE_DROPOUTS  0x8
    -#define FT_OUTLINE_SMART_DROPOUTS   0x10
    -#define FT_OUTLINE_INCLUDE_STUBS    0x20
    -
    -#define FT_OUTLINE_HIGH_PRECISION   0x100
    -#define FT_OUTLINE_SINGLE_PASS      0x200
    -
    -

    -
    -

    A list of bit-field constants use for the flags in an outline's ‘flags’ field.

    -

    -
    values
    -

    - - - - - - - - - - - - - - - -
    FT_OUTLINE_NONE -

    Value 0 is reserved.

    -
    FT_OUTLINE_OWNER -

    If set, this flag indicates that the outline's field arrays (i.e., ‘points’, ‘flags’, and ‘contours’) are ‘owned’ by the outline object, and should thus be freed when it is destroyed.

    -
    FT_OUTLINE_EVEN_ODD_FILL
    -

    By default, outlines are filled using the non-zero winding rule. If set to 1, the outline will be filled using the even-odd fill rule (only works with the smooth rasterizer).

    -
    FT_OUTLINE_REVERSE_FILL
    -

    By default, outside contours of an outline are oriented in clock-wise direction, as defined in the TrueType specification. This flag is set if the outline uses the opposite direction (typically for Type 1 fonts). This flag is ignored by the scan converter.

    -
    FT_OUTLINE_IGNORE_DROPOUTS
    -

    By default, the scan converter will try to detect drop-outs in an outline and correct the glyph bitmap to ensure consistent shape continuity. If set, this flag hints the scan-line converter to ignore such cases. See below for more information.

    -
    FT_OUTLINE_SMART_DROPOUTS
    -

    Select smart dropout control. If unset, use simple dropout control. Ignored if FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more information.

    -
    FT_OUTLINE_INCLUDE_STUBS
    -

    If set, turn pixels on for ‘stubs’, otherwise exclude them. Ignored if FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more information.

    -
    FT_OUTLINE_HIGH_PRECISION
    -

    This flag indicates that the scan-line converter should try to convert this outline to bitmaps with the highest possible quality. It is typically set for small character sizes. Note that this is only a hint that might be completely ignored by a given scan-converter.

    -
    FT_OUTLINE_SINGLE_PASS -

    This flag is set to force a given scan-converter to only use a single pass over the outline to render a bitmap glyph image. Normally, it is set for very large character sizes. It is only a hint that might be completely ignored by a given scan-converter.

    +
    flags +

    A set of bit flags used to characterize the outline and give hints to the scan-converter and hinter on how to convert/grid-fit it. See FT_OUTLINE_XXX.

    -
    -
    note
    -

    The flags FT_OUTLINE_IGNORE_DROPOUTS, FT_OUTLINE_SMART_DROPOUTS, and FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth rasterizer.

    -

    There exists a second mechanism to pass the drop-out mode to the B/W rasterizer; see the ‘tags’ field in FT_Outline.

    -

    Please refer to the description of the ‘SCANTYPE’ instruction in the OpenType specification (in file ‘ttinst1.doc’) how simple drop-outs, smart drop-outs, and stubs are defined.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_New

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    +

    note

    +

    The B/W rasterizer only checks bit 2 in the ‘tags’ array for the first point of each contour. The drop-out mode as given with FT_OUTLINE_IGNORE_DROPOUTS, FT_OUTLINE_SMART_DROPOUTS, and FT_OUTLINE_INCLUDE_STUBS in ‘flags’ is then overridden.

    + +
    + + +
    +

    FT_Outline_New

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
       FT_EXPORT( FT_Error )
       FT_Outline_New( FT_Library   library,
                       FT_UInt      numPoints,
    @@ -214,52 +192,43 @@ Defined in FT_OUTLINE_H (ftoutln.h).
                                FT_UInt      numPoints,
                                FT_Int       numContours,
                                FT_Outline  *anoutline );
    +
    -

    -

    Create a new outline of a given size.

    -

    -
    input
    -

    - -
    library + +

    input

    + + - -
    library

    A handle to the library object from where the outline is allocated. Note however that the new outline will not necessarily be freed, when destroying the library, by FT_Done_FreeType.

    numPoints +
    numPoints

    The maximum number of points within the outline. Must be smaller than or equal to 0xFFFF (65535).

    numContours +
    numContours

    The maximum number of contours within the outline. This value must be in the range 0 to ‘numPoints’.

    -
    -
    output
    -

    - -
    anoutline + +

    output

    + +
    anoutline

    A handle to the new outline.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The reason why this function takes a ‘library’ parameter is simply to use the library's memory allocator.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Done

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    +
    + + +
    +

    FT_Outline_Done

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
       FT_EXPORT( FT_Error )
       FT_Outline_Done( FT_Library   library,
                        FT_Outline*  outline );
    @@ -268,192 +237,154 @@ Defined in FT_OUTLINE_H (ftoutln.h).
       FT_EXPORT( FT_Error )
       FT_Outline_Done_Internal( FT_Memory    memory,
                                 FT_Outline*  outline );
    +
    -

    -

    Destroy an outline created with FT_Outline_New.

    -

    -
    input
    -

    - -
    library + +

    input

    + + -
    library

    A handle of the library object used to allocate the outline.

    outline +
    outline

    A pointer to the outline object to be discarded.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    If the outline's ‘owner’ field is not set, only the outline descriptor will be released.

    The reason why this function takes an ‘library’ parameter is simply to use ft_mem_free().

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Copy

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    +
    + + +
    +

    FT_Outline_Copy

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
       FT_EXPORT( FT_Error )
       FT_Outline_Copy( const FT_Outline*  source,
                        FT_Outline        *target );
    +
    -

    -

    Copy an outline into another one. Both objects must have the same sizes (number of points & number of contours) when this function is called.

    -

    -
    input
    -

    - -
    source + +

    input

    + +
    source

    A handle to the source outline.

    -
    -
    output
    -

    - -
    target + +

    output

    + +
    target

    A handle to the target outline.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Translate

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    +
    + + +
    +

    FT_Outline_Translate

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
       FT_EXPORT( void )
       FT_Outline_Translate( const FT_Outline*  outline,
                             FT_Pos             xOffset,
                             FT_Pos             yOffset );
    +
    -

    -

    Apply a simple translation to the points of an outline.

    -

    -
    inout
    -

    - -
    outline + +

    inout

    + +
    outline

    A pointer to the target outline descriptor.

    -
    -
    input
    -

    - -
    xOffset + +

    input

    + + -
    xOffset

    The horizontal offset.

    yOffset +
    yOffset

    The vertical offset.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Transform

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    +
    + + +
    +

    FT_Outline_Transform

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
       FT_EXPORT( void )
       FT_Outline_Transform( const FT_Outline*  outline,
                             const FT_Matrix*   matrix );
    +
    -

    -

    Apply a simple 2x2 matrix to all of an outline's points. Useful for applying rotations, slanting, flipping, etc.

    -

    -
    inout
    -

    - -
    outline + +

    inout

    + +
    outline

    A pointer to the target outline descriptor.

    -
    -
    input
    -

    - -
    matrix + +

    input

    + +
    matrix

    A pointer to the transformation matrix.

    -
    -
    note
    + +

    note

    You can use FT_Outline_Translate if you need to translate the outline's points.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Embolden

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    +
    + + +
    +

    FT_Outline_Embolden

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
       FT_EXPORT( FT_Error )
       FT_Outline_Embolden( FT_Outline*  outline,
                            FT_Pos       strength );
    +
    -

    -

    Embolden an outline. The new outline will be at most 4 times ‘strength’ pixels wider and higher. You may think of the left and bottom borders as unchanged.

    Negative ‘strength’ values to reduce the outline thickness are possible also.

    -

    -
    inout
    -

    - -
    outline + +

    inout

    + +
    outline

    A handle to the target outline.

    -
    -
    input
    -

    - -
    strength + +

    input

    + +
    strength

    How strong the glyph is emboldened. Expressed in 26.6 pixel format.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The used algorithm to increase or decrease the thickness of the glyph doesn't change the number of points; this means that certain situations like acute angles or intersections are sometimes handled incorrectly.

    If you need ‘better’ metrics values you should call FT_Outline_Get_CBox or FT_Outline_Get_BBox.

    Example call:

    @@ -463,367 +394,260 @@ Defined in FT_OUTLINE_H (ftoutln.h). FT_Outline_Embolden( &face->slot->outline, strength );

    To get meaningful results, font scaling values must be set with functions like FT_Set_Char_Size before calling FT_Render_Glyph.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_EmboldenXY

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    +
    + + +
    +

    FT_Outline_EmboldenXY

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
       FT_EXPORT( FT_Error )
       FT_Outline_EmboldenXY( FT_Outline*  outline,
                              FT_Pos       xstrength,
                              FT_Pos       ystrength );
    +
    -

    -

    Embolden an outline. The new outline will be ‘xstrength’ pixels wider and ‘ystrength’ pixels higher. Otherwise, it is similar to FT_Outline_Embolden, which uses the same strength in both directions.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Reverse

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    +
    + + +
    +

    FT_Outline_Reverse

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
       FT_EXPORT( void )
       FT_Outline_Reverse( FT_Outline*  outline );
    +
    -

    -

    Reverse the drawing direction of an outline. This is used to ensure consistent fill conventions for mirrored glyphs.

    -

    -
    inout
    -

    - -
    outline + +

    inout

    + +
    outline

    A pointer to the target outline descriptor.

    -
    -
    note
    -

    This function toggles the bit flag FT_OUTLINE_REVERSE_FILL in the outline's ‘flags’ field.

    + +

    note

    +

    This function toggles the bit flag FT_OUTLINE_REVERSE_FILL in the outline's ‘flags’ field.

    It shouldn't be used by a normal client application, unless it knows what it is doing.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Check

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    +
    + + +
    +

    FT_Outline_Check

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
       FT_EXPORT( FT_Error )
       FT_Outline_Check( FT_Outline*  outline );
    +
    -

    -

    Check the contents of an outline descriptor.

    -

    -
    input
    -

    - -
    outline + +

    input

    + +
    outline

    A handle to a source outline.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Get_BBox

    -
    -Defined in FT_BBOX_H (ftbbox.h). -

    -
     
    +
    + + +
    +

    FT_Outline_Get_CBox

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
    +  FT_EXPORT( void )
    +  FT_Outline_Get_CBox( const FT_Outline*  outline,
    +                       FT_BBox           *acbox );
    +
    + +

    Return an outline's ‘control box’. The control box encloses all the outline's points, including Bézier control points. Though it coincides with the exact bounding box for most glyphs, it can be slightly larger in some situations (like when rotating an outline that contains Bézier outside arcs).

    +

    Computing the control box is very fast, while getting the bounding box can take much more time as it needs to walk over all segments and arcs in the outline. To get the latter, you can use the ‘ftbbox’ component, which is dedicated to this single task.

    + +

    input

    + + +
    outline +

    A pointer to the source outline descriptor.

    +
    + +

    output

    + + +
    acbox +

    The outline's control box.

    +
    + +

    note

    +

    See FT_Glyph_Get_CBox for a discussion of tricky fonts.

    + +
    +
    + +
    +

    FT_Outline_Get_BBox

    +

    Defined in FT_BBOX_H (ftbbox.h).

    +
       FT_EXPORT( FT_Error )
       FT_Outline_Get_BBox( FT_Outline*  outline,
                            FT_BBox     *abbox );
    +
    -

    -

    Compute the exact bounding box of an outline. This is slower than computing the control box. However, it uses an advanced algorithm that returns very quickly when the two boxes coincide. Otherwise, the outline Bézier arcs are traversed to extract their extrema.

    -

    -
    input
    -

    - -
    outline + +

    input

    + +
    outline

    A pointer to the source outline.

    -
    -
    output
    -

    - -
    abbox + +

    output

    + +
    abbox

    The outline's exact bounding box.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    If the font is tricky and the glyph has been loaded with FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get reasonable values for the BBox it is necessary to load the glyph at a large ppem value (so that the hinting instructions can properly shift and scale the subglyphs), then extracting the BBox, which can be eventually converted back to font units.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    ft_outline_flags

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
    -
    -#define ft_outline_none             FT_OUTLINE_NONE
    -#define ft_outline_owner            FT_OUTLINE_OWNER
    -#define ft_outline_even_odd_fill    FT_OUTLINE_EVEN_ODD_FILL
    -#define ft_outline_reverse_fill     FT_OUTLINE_REVERSE_FILL
    -#define ft_outline_ignore_dropouts  FT_OUTLINE_IGNORE_DROPOUTS
    -#define ft_outline_high_precision   FT_OUTLINE_HIGH_PRECISION
    -#define ft_outline_single_pass      FT_OUTLINE_SINGLE_PASS
    -
    -

    -
    -

    These constants are deprecated. Please use the corresponding FT_OUTLINE_FLAGS values.

    -

    -
    values
    -

    - - - - - - - - - - - - -
    ft_outline_none -

    See FT_OUTLINE_NONE.

    -
    ft_outline_owner -

    See FT_OUTLINE_OWNER.

    -
    ft_outline_even_odd_fill
    -

    See FT_OUTLINE_EVEN_ODD_FILL.

    -
    ft_outline_reverse_fill
    -

    See FT_OUTLINE_REVERSE_FILL.

    -
    ft_outline_ignore_dropouts
    -

    See FT_OUTLINE_IGNORE_DROPOUTS.

    -
    ft_outline_high_precision
    -

    See FT_OUTLINE_HIGH_PRECISION.

    -
    ft_outline_single_pass -

    See FT_OUTLINE_SINGLE_PASS.

    -
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_MoveToFunc

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    -  typedef int
    -  (*FT_Outline_MoveToFunc)( const FT_Vector*  to,
    -                            void*             user );
    +
    + -#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc +
    +

    FT_Outline_Get_Bitmap

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Outline_Get_Bitmap( FT_Library        library,
    +                         FT_Outline*       outline,
    +                         const FT_Bitmap  *abitmap );
    +
    -

    -
    -

    A function pointer type used to describe the signature of a ‘move to’ function during outline walking/decomposition.

    -

    A ‘move to’ is emitted to start a new contour in an outline.

    -

    -
    input
    -

    - -
    to -

    A pointer to the target point of the ‘move to’.

    +

    Render an outline within a bitmap. The outline's image is simply OR-ed to the target bitmap.

    + +

    input

    + + -
    library +

    A handle to a FreeType library object.

    user -

    A typeless pointer, which is passed from the caller of the decomposition function.

    +
    outline +

    A pointer to the source outline descriptor.

    -
    -
    return
    -

    Error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_LineToFunc

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    -  typedef int
    -  (*FT_Outline_LineToFunc)( const FT_Vector*  to,
    -                            void*             user );
    -
    -#define FT_Outline_LineTo_Func  FT_Outline_LineToFunc
    -
    -

    -
    -

    A function pointer type used to describe the signature of a ‘line to’ function during outline walking/decomposition.

    -

    A ‘line to’ is emitted to indicate a segment in the outline.

    -

    -
    input
    -

    - - -
    to -

    A pointer to the target point of the ‘line to’.

    -
    user -

    A typeless pointer, which is passed from the caller of the decomposition function.

    +

    inout

    + +
    abitmap +

    A pointer to the target bitmap descriptor.

    -
    -
    return
    -

    Error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_ConicToFunc

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    -  typedef int
    -  (*FT_Outline_ConicToFunc)( const FT_Vector*  control,
    -                             const FT_Vector*  to,
    -                             void*             user );
    +

    return

    +

    FreeType error code. 0 means success.

    -#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc +

    note

    +

    This function does NOT CREATE the bitmap, it only renders an outline image within the one you pass to it! Consequently, the various fields in ‘abitmap’ should be set accordingly.

    +

    It will use the raster corresponding to the default glyph format.

    +

    The value of the ‘num_grays’ field in ‘abitmap’ is ignored. If you select the gray-level rasterizer, and you want less than 256 gray levels, you have to use FT_Outline_Render directly.

    -

    -
    -

    A function pointer type used to describe the signature of a ‘conic to’ function during outline walking or decomposition.

    -

    A ‘conic to’ is emitted to indicate a second-order Bézier arc in the outline.

    -

    -
    input
    -

    - -
    control -

    An intermediate control point between the last position and the new target in ‘to’.

    +
    + + +
    +

    FT_Outline_Render

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Outline_Render( FT_Library         library,
    +                     FT_Outline*        outline,
    +                     FT_Raster_Params*  params );
    +
    + +

    Render an outline within a bitmap using the current scan-convert. This function uses an FT_Raster_Params structure as an argument, allowing advanced features like direct composition, translucency, etc.

    + +

    input

    + + - -
    library +

    A handle to a FreeType library object.

    to -

    A pointer to the target end point of the conic arc.

    +
    outline +

    A pointer to the source outline descriptor.

    user -

    A typeless pointer, which is passed from the caller of the decomposition function.

    +
    + +

    inout

    + +
    params +

    A pointer to an FT_Raster_Params structure used to describe the rendering operation.

    -
    -
    return
    -

    Error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_CubicToFunc

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    -  typedef int
    -  (*FT_Outline_CubicToFunc)( const FT_Vector*  control1,
    -                             const FT_Vector*  control2,
    -                             const FT_Vector*  to,
    -                             void*             user );
    +

    return

    +

    FreeType error code. 0 means success.

    -#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc +

    note

    +

    You should know what you are doing and how FT_Raster_Params works to use this function.

    +

    The field ‘params.source’ will be set to ‘outline’ before the scan converter is called, which means that the value you give to it is actually ignored.

    +

    The gray-level rasterizer always uses 256 gray levels. If you want less gray levels, you have to provide your own span callback. See the FT_RASTER_FLAG_DIRECT value of the ‘flags’ field in the FT_Raster_Params structure for more details.

    -

    -
    -

    A function pointer type used to describe the signature of a ‘cubic to’ function during outline walking or decomposition.

    -

    A ‘cubic to’ is emitted to indicate a third-order Bézier arc.

    -

    -
    input
    -

    - - -
    control1 -

    A pointer to the first Bézier control point.

    -
    control2 -

    A pointer to the second Bézier control point.

    +
    + + +
    +

    FT_Outline_Decompose

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
    +  FT_EXPORT( FT_Error )
    +  FT_Outline_Decompose( FT_Outline*              outline,
    +                        const FT_Outline_Funcs*  func_interface,
    +                        void*                    user );
    +
    + +

    Walk over an outline's structure to decompose it into individual segments and Bézier arcs. This function also emits ‘move to’ operations to indicate the start of new contours in the outline.

    + +

    input

    + + - -
    outline +

    A pointer to the source target.

    to -

    A pointer to the target end point.

    +
    func_interface +

    A table of ‘emitters’, i.e., function pointers called during decomposition to indicate path operations.

    user -

    A typeless pointer, which is passed from the caller of the decomposition function.

    +
    + +

    inout

    + +
    user +

    A typeless pointer that is passed to each emitter during the decomposition. It can be used to store the state during the decomposition.

    -
    -
    return
    -

    Error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Funcs

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    +

    return

    +

    FreeType error code. 0 means success.

    + +

    note

    +

    A contour that contains a single point only is represented by a ‘move to’ operation followed by ‘line to’ to the same point. In most cases, it is best to filter this out before using the outline for stroking purposes (otherwise it would result in a visible dot when round caps are used).

    + +
    + + +
    +

    FT_Outline_Funcs

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef struct  FT_Outline_Funcs_
       {
         FT_Outline_MoveToFunc   move_to;
    @@ -835,317 +659,306 @@ Defined in FT_IMAGE_H (ftimage.h).
         FT_Pos                  delta;
     
       } FT_Outline_Funcs;
    +
    -

    -

    A structure to hold various function pointers used during outline decomposition in order to emit segments, conic, and cubic Béziers.

    -

    -
    fields
    -

    - -
    move_to + +

    fields

    + + - - - - -
    move_to

    The ‘move to’ emitter.

    line_to +
    line_to

    The segment emitter.

    conic_to +
    conic_to

    The second-order Bézier arc emitter.

    cubic_to +
    cubic_to

    The third-order Bézier arc emitter.

    shift +
    shift

    The shift that is applied to coordinates before they are sent to the emitter.

    delta +
    delta

    The delta that is applied to coordinates before they are sent to the emitter, but after the shift.

    -
    -
    note
    + +

    note

    The point coordinates sent to the emitters are the transformed version of the original coordinates (this is important for high accuracy during scan-conversion). The transformation is simple:

       x' = (x << shift) - delta                                        
       y' = (x << shift) - delta                                        
     

    Set the values of ‘shift’ and ‘delta’ to 0 to get the original point coordinates.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Decompose

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    -  FT_EXPORT( FT_Error )
    -  FT_Outline_Decompose( FT_Outline*              outline,
    -                        const FT_Outline_Funcs*  func_interface,
    -                        void*                    user );
    +
    + -

    -
    -

    Walk over an outline's structure to decompose it into individual segments and Bézier arcs. This function also emits ‘move to’ operations to indicate the start of new contours in the outline.

    -

    -
    input
    -

    - - -
    outline -

    A pointer to the source target.

    -
    func_interface -

    A table of ‘emitters’, i.e., function pointers called during decomposition to indicate path operations.

    +
    +

    FT_Outline_MoveToFunc

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
    +  typedef int
    +  (*FT_Outline_MoveToFunc)( const FT_Vector*  to,
    +                            void*             user );
    +
    +#define FT_Outline_MoveTo_Func  FT_Outline_MoveToFunc
    +
    + +

    A function pointer type used to describe the signature of a ‘move to’ function during outline walking/decomposition.

    +

    A ‘move to’ is emitted to start a new contour in an outline.

    + +

    input

    + + -
    to +

    A pointer to the target point of the ‘move to’.

    -
    -
    inout
    -

    - -
    user -

    A typeless pointer that is passed to each emitter during the decomposition. It can be used to store the state during the decomposition.

    +
    user +

    A typeless pointer, which is passed from the caller of the decomposition function.

    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    A contour that contains a single point only is represented by a ‘move to’ operation followed by ‘line to’ to the same point. In most cases, it is best to filter this out before using the outline for stroking purposes (otherwise it would result in a visible dot when round caps are used).

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Get_CBox

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    -  FT_EXPORT( void )
    -  FT_Outline_Get_CBox( const FT_Outline*  outline,
    -                       FT_BBox           *acbox );
    +

    return

    +

    Error code. 0 means success.

    -

    -
    -

    Return an outline's ‘control box’. The control box encloses all the outline's points, including Bézier control points. Though it coincides with the exact bounding box for most glyphs, it can be slightly larger in some situations (like when rotating an outline that contains Bézier outside arcs).

    -

    Computing the control box is very fast, while getting the bounding box can take much more time as it needs to walk over all segments and arcs in the outline. To get the latter, you can use the ‘ftbbox’ component, which is dedicated to this single task.

    -

    -
    input
    -

    - -
    outline -

    A pointer to the source outline descriptor.

    +
    + + +
    +

    FT_Outline_LineToFunc

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
    +  typedef int
    +  (*FT_Outline_LineToFunc)( const FT_Vector*  to,
    +                            void*             user );
    +
    +#define FT_Outline_LineTo_Func  FT_Outline_LineToFunc
    +
    + +

    A function pointer type used to describe the signature of a ‘line to’ function during outline walking/decomposition.

    +

    A ‘line to’ is emitted to indicate a segment in the outline.

    + +

    input

    + + -
    to +

    A pointer to the target point of the ‘line to’.

    -
    -
    output
    -

    - -
    acbox -

    The outline's control box.

    +
    user +

    A typeless pointer, which is passed from the caller of the decomposition function.

    -
    -
    note
    -

    See FT_Glyph_Get_CBox for a discussion of tricky fonts.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Get_Bitmap

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    -  FT_EXPORT( FT_Error )
    -  FT_Outline_Get_Bitmap( FT_Library        library,
    -                         FT_Outline*       outline,
    -                         const FT_Bitmap  *abitmap );
    +

    return

    +

    Error code. 0 means success.

    -

    -
    -

    Render an outline within a bitmap. The outline's image is simply OR-ed to the target bitmap.

    -

    -
    input
    -

    - -
    library -

    A handle to a FreeType library object.

    +
    + + +
    +

    FT_Outline_ConicToFunc

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
    +  typedef int
    +  (*FT_Outline_ConicToFunc)( const FT_Vector*  control,
    +                             const FT_Vector*  to,
    +                             void*             user );
    +
    +#define FT_Outline_ConicTo_Func  FT_Outline_ConicToFunc
    +
    + +

    A function pointer type used to describe the signature of a ‘conic to’ function during outline walking or decomposition.

    +

    A ‘conic to’ is emitted to indicate a second-order Bézier arc in the outline.

    + +

    input

    + + - -
    control +

    An intermediate control point between the last position and the new target in ‘to’.

    outline -

    A pointer to the source outline descriptor.

    +
    to +

    A pointer to the target end point of the conic arc.

    -
    -
    inout
    -

    - -
    abitmap -

    A pointer to the target bitmap descriptor.

    +
    user +

    A typeless pointer, which is passed from the caller of the decomposition function.

    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    This function does NOT CREATE the bitmap, it only renders an outline image within the one you pass to it! Consequently, the various fields in ‘abitmap’ should be set accordingly.

    -

    It will use the raster corresponding to the default glyph format.

    -

    The value of the ‘num_grays’ field in ‘abitmap’ is ignored. If you select the gray-level rasterizer, and you want less than 256 gray levels, you have to use FT_Outline_Render directly.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Render

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    -  FT_EXPORT( FT_Error )
    -  FT_Outline_Render( FT_Library         library,
    -                     FT_Outline*        outline,
    -                     FT_Raster_Params*  params );
    +

    return

    +

    Error code. 0 means success.

    -

    -
    -

    Render an outline within a bitmap using the current scan-convert. This function uses an FT_Raster_Params structure as an argument, allowing advanced features like direct composition, translucency, etc.

    -

    -
    input
    -

    - -
    library -

    A handle to a FreeType library object.

    +
    + + +
    +

    FT_Outline_CubicToFunc

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
    +  typedef int
    +  (*FT_Outline_CubicToFunc)( const FT_Vector*  control1,
    +                             const FT_Vector*  control2,
    +                             const FT_Vector*  to,
    +                             void*             user );
    +
    +#define FT_Outline_CubicTo_Func  FT_Outline_CubicToFunc
    +
    + +

    A function pointer type used to describe the signature of a ‘cubic to’ function during outline walking or decomposition.

    +

    A ‘cubic to’ is emitted to indicate a third-order Bézier arc.

    + +

    input

    + + - -
    control1 +

    A pointer to the first Bézier control point.

    outline -

    A pointer to the source outline descriptor.

    +
    control2 +

    A pointer to the second Bézier control point.

    -
    -
    inout
    -

    - - +
    params -

    A pointer to an FT_Raster_Params structure used to describe the rendering operation.

    +
    to +

    A pointer to the target end point.

    +
    user +

    A typeless pointer, which is passed from the caller of the decomposition function.

    -
    -
    return
    -

    FreeType error code. 0 means success.

    -
    -
    note
    -

    You should know what you are doing and how FT_Raster_Params works to use this function.

    -

    The field ‘params.source’ will be set to ‘outline’ before the scan converter is called, which means that the value you give to it is actually ignored.

    -

    The gray-level rasterizer always uses 256 gray levels. If you want less gray levels, you have to provide your own span callback. See the FT_RASTER_FLAG_DIRECT value of the ‘flags’ field in the FT_Raster_Params structure for more details.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Orientation

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    +

    return

    +

    Error code. 0 means success.

    + +
    + + +

    -

    A list of values used to describe an outline's contour orientation.

    The TrueType and PostScript specifications use different conventions to determine whether outline contours should be filled or unfilled.

    -

    -
    values
    -

    - - -
    FT_ORIENTATION_TRUETYPE
    + +

    values

    + + - - - - - - -
    FT_ORIENTATION_TRUETYPE

    According to the TrueType specification, clockwise contours must be filled, and counter-clockwise ones must be unfilled.

    FT_ORIENTATION_POSTSCRIPT
    +
    FT_ORIENTATION_POSTSCRIPT

    According to the PostScript specification, counter-clockwise contours must be filled, and clockwise ones must be unfilled.

    FT_ORIENTATION_FILL_RIGHT
    +
    FT_ORIENTATION_FILL_RIGHT

    This is identical to FT_ORIENTATION_TRUETYPE, but is used to remember that in TrueType, everything that is to the right of the drawing direction of a contour must be filled.

    FT_ORIENTATION_FILL_LEFT
    +
    FT_ORIENTATION_FILL_LEFT

    This is identical to FT_ORIENTATION_POSTSCRIPT, but is used to remember that in PostScript, everything that is to the left of the drawing direction of a contour must be filled.

    FT_ORIENTATION_NONE +
    FT_ORIENTATION_NONE

    The orientation cannot be determined. That is, different parts of the glyph have different orientation.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Outline_Get_Orientation

    -
    -Defined in FT_OUTLINE_H (ftoutln.h). -

    -
     
    +
    + + +
    +

    FT_Outline_Get_Orientation

    +

    Defined in FT_OUTLINE_H (ftoutln.h).

    +
       FT_EXPORT( FT_Orientation )
       FT_Outline_Get_Orientation( FT_Outline*  outline );
    +
    -

    -

    This function analyzes a glyph outline and tries to compute its fill orientation (see FT_Orientation). This is done by integrating the total area covered by the outline. The positive integral corresponds to the clockwise orientation and FT_ORIENTATION_POSTSCRIPT is returned. The negative integral corresponds to the counter-clockwise orientation and FT_ORIENTATION_TRUETYPE is returned.

    Note that this will return FT_ORIENTATION_TRUETYPE for empty outlines.

    -

    -
    input
    -

    - -
    outline + +

    input

    + +
    outline

    A handle to the source outline.

    -
    -
    return
    + +

    return

    The orientation.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + + +
    +

    FT_OUTLINE_XXX

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
    +#define FT_OUTLINE_NONE             0x0
    +#define FT_OUTLINE_OWNER            0x1
    +#define FT_OUTLINE_EVEN_ODD_FILL    0x2
    +#define FT_OUTLINE_REVERSE_FILL     0x4
    +#define FT_OUTLINE_IGNORE_DROPOUTS  0x8
    +#define FT_OUTLINE_SMART_DROPOUTS   0x10
    +#define FT_OUTLINE_INCLUDE_STUBS    0x20
    +
    +#define FT_OUTLINE_HIGH_PRECISION   0x100
    +#define FT_OUTLINE_SINGLE_PASS      0x200
    +
    +
    +  /* these constants are deprecated; use the corresponding */
    +  /* `FT_OUTLINE_XXX' values instead                       */
    +#define ft_outline_none             FT_OUTLINE_NONE
    +#define ft_outline_owner            FT_OUTLINE_OWNER
    +#define ft_outline_even_odd_fill    FT_OUTLINE_EVEN_ODD_FILL
    +#define ft_outline_reverse_fill     FT_OUTLINE_REVERSE_FILL
    +#define ft_outline_ignore_dropouts  FT_OUTLINE_IGNORE_DROPOUTS
    +#define ft_outline_high_precision   FT_OUTLINE_HIGH_PRECISION
    +#define ft_outline_single_pass      FT_OUTLINE_SINGLE_PASS
    +
    + +

    A list of bit-field constants use for the flags in an outline's ‘flags’ field.

    + +

    values

    + + + + + + + + + + +
    FT_OUTLINE_NONE +

    Value 0 is reserved.

    +
    FT_OUTLINE_OWNER +

    If set, this flag indicates that the outline's field arrays (i.e., ‘points’, ‘flags’, and ‘contours’) are ‘owned’ by the outline object, and should thus be freed when it is destroyed.

    +
    FT_OUTLINE_EVEN_ODD_FILL +

    By default, outlines are filled using the non-zero winding rule. If set to 1, the outline will be filled using the even-odd fill rule (only works with the smooth rasterizer).

    +
    FT_OUTLINE_REVERSE_FILL +

    By default, outside contours of an outline are oriented in clock-wise direction, as defined in the TrueType specification. This flag is set if the outline uses the opposite direction (typically for Type 1 fonts). This flag is ignored by the scan converter.

    +
    FT_OUTLINE_IGNORE_DROPOUTS +

    By default, the scan converter will try to detect drop-outs in an outline and correct the glyph bitmap to ensure consistent shape continuity. If set, this flag hints the scan-line converter to ignore such cases. See below for more information.

    +
    FT_OUTLINE_SMART_DROPOUTS +

    Select smart dropout control. If unset, use simple dropout control. Ignored if FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more information.

    +
    FT_OUTLINE_INCLUDE_STUBS +

    If set, turn pixels on for ‘stubs’, otherwise exclude them. Ignored if FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more information.

    +
    FT_OUTLINE_HIGH_PRECISION +

    This flag indicates that the scan-line converter should try to convert this outline to bitmaps with the highest possible quality. It is typically set for small character sizes. Note that this is only a hint that might be completely ignored by a given scan-converter.

    +
    FT_OUTLINE_SINGLE_PASS +

    This flag is set to force a given scan-converter to only use a single pass over the outline to render a bitmap glyph image. Normally, it is set for very large character sizes. It is only a hint that might be completely ignored by a given scan-converter.

    +
    + +

    note

    +

    The flags FT_OUTLINE_IGNORE_DROPOUTS, FT_OUTLINE_SMART_DROPOUTS, and FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth rasterizer.

    +

    There exists a second mechanism to pass the drop-out mode to the B/W rasterizer; see the ‘tags’ field in FT_Outline.

    +

    Please refer to the description of the ‘SCANTYPE’ instruction in the OpenType specification (in file ‘ttinst1.doc’) how simple drop-outs, smart drop-outs, and stubs are defined.

    + +
    +
    diff --git a/freetype/docs/reference/ft2-pfr_fonts.html b/freetype/docs/reference/ft2-pfr_fonts.html index c29bdd6b9..8f3cb8ab1 100644 --- a/freetype/docs/reference/ft2-pfr_fonts.html +++ b/freetype/docs/reference/ft2-pfr_fonts.html @@ -3,204 +3,240 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -PFR Fonts -

    +

    PFR Fonts

    Synopsis

    - - -
    FT_Get_PFR_MetricsFT_Get_PFR_KerningFT_Get_PFR_Advance


    + + +
    FT_Get_PFR_MetricsFT_Get_PFR_KerningFT_Get_PFR_Advance
    + -

    This section contains the declaration of PFR-specific functions.

    -

    -
    -

    FT_Get_PFR_Metrics

    -
    -Defined in FT_PFR_H (ftpfr.h). -

    -
     
    +
    +

    FT_Get_PFR_Metrics

    +

    Defined in FT_PFR_H (ftpfr.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_PFR_Metrics( FT_Face    face,
                           FT_UInt   *aoutline_resolution,
                           FT_UInt   *ametrics_resolution,
                           FT_Fixed  *ametrics_x_scale,
                           FT_Fixed  *ametrics_y_scale );
    +
    -

    -

    Return the outline and metrics resolutions of a given PFR face.

    -

    -
    input
    -

    - -
    face + +

    input

    + +
    face

    Handle to the input face. It can be a non-PFR face.

    -
    -
    output
    -

    - -
    aoutline_resolution + +

    output

    + + - - -
    aoutline_resolution

    Outline resolution. This is equivalent to ‘face->units_per_EM’ for non-PFR fonts. Optional (parameter can be NULL).

    ametrics_resolution +
    ametrics_resolution

    Metrics resolution. This is equivalent to ‘outline_resolution’ for non-PFR fonts. Optional (parameter can be NULL).

    ametrics_x_scale +
    ametrics_x_scale

    A 16.16 fixed-point number used to scale distance expressed in metrics units to device sub-pixels. This is equivalent to ‘face->size->x_scale’, but for metrics only. Optional (parameter can be NULL).

    ametrics_y_scale +
    ametrics_y_scale

    Same as ‘ametrics_x_scale’ but for the vertical direction. optional (parameter can be NULL).

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    If the input face is not a PFR, this function will return an error. However, in all cases, it will return valid values.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_PFR_Kerning

    -
    -Defined in FT_PFR_H (ftpfr.h). -

    -
     
    +
    + + +
    +

    FT_Get_PFR_Kerning

    +

    Defined in FT_PFR_H (ftpfr.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_PFR_Kerning( FT_Face     face,
                           FT_UInt     left,
                           FT_UInt     right,
                           FT_Vector  *avector );
    +
    -

    -

    Return the kerning pair corresponding to two glyphs in a PFR face. The distance is expressed in metrics units, unlike the result of FT_Get_Kerning.

    -

    -
    input
    -

    - -
    face + +

    input

    + + - -
    face

    A handle to the input face.

    left +
    left

    Index of the left glyph.

    right +

    Index of the right glyph.

    -
    -
    output
    -

    - -
    avector + +

    output

    + +
    avector

    A kerning vector.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function always return distances in original PFR metrics units. This is unlike FT_Get_Kerning with the FT_KERNING_UNSCALED mode, which always returns distances converted to outline units.

    You can use the value of the ‘x_scale’ and ‘y_scale’ parameters returned by FT_Get_PFR_Metrics to scale these to device sub-pixels.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_PFR_Advance

    -
    -Defined in FT_PFR_H (ftpfr.h). -

    -
     
    +
    + + +
    +

    FT_Get_PFR_Advance

    +

    Defined in FT_PFR_H (ftpfr.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_PFR_Advance( FT_Face   face,
                           FT_UInt   gindex,
                           FT_Pos   *aadvance );
    +
    -

    -

    Return a given glyph advance, expressed in original metrics units, from a PFR font.

    -

    -
    input
    -

    - -
    face + +

    input

    + + -
    face

    A handle to the input face.

    gindex +
    gindex

    The glyph index.

    -
    -
    output
    -

    - -
    aadvance + +

    output

    + +
    aadvance

    The glyph advance in metrics units.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    You can use the ‘x_scale’ or ‘y_scale’ results of FT_Get_PFR_Metrics to convert the advance to device sub-pixels (i.e., 1/64th of pixels).

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-quick_advance.html b/freetype/docs/reference/ft2-quick_advance.html index 4ae19fd09..4cffbf837 100644 --- a/freetype/docs/reference/ft2-quick_advance.html +++ b/freetype/docs/reference/ft2-quick_advance.html @@ -3,184 +3,222 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Quick retrieval of advance values -

    +

    Quick retrieval of advance values

    Synopsis

    - - - -
    FT_ADVANCE_FLAG_FAST_ONLYFT_Get_Advances
    FT_Get_Advance


    - -
    -

    This section contains functions to quickly extract advance values without handling glyph outlines, if possible.

    -

    -
    -

    FT_ADVANCE_FLAG_FAST_ONLY

    -
    -Defined in FT_ADVANCES_H (ftadvanc.h). -

    -
    +
    +
    +
    +
    FT_Get_Advance 
    FT_Get_AdvancesFT_ADVANCE_FLAG_FAST_ONLY
    -#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL -

    -
    -

    A bit-flag to be OR-ed with the ‘flags’ parameter of the FT_Get_Advance and FT_Get_Advances functions.

    -

    If set, it indicates that you want these functions to fail if the corresponding hinting mode or font driver doesn't allow for very quick advance computation.

    -

    Typically, glyphs that are either unscaled, unhinted, bitmapped, or light-hinted can have their advance width computed very quickly.

    -

    Normal and bytecode hinted modes that require loading, scaling, and hinting of the glyph outline, are extremely slow by comparison.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Advance

    -
    -Defined in FT_ADVANCES_H (ftadvanc.h). -

    -
    +

    This section contains functions to quickly extract advance values without handling glyph outlines, if possible.

    +
    +

    FT_Get_Advance

    +

    Defined in FT_ADVANCES_H (ftadvanc.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_Advance( FT_Face    face,
                       FT_UInt    gindex,
                       FT_Int32   load_flags,
                       FT_Fixed  *padvance );
    +
    -

    -

    Retrieve the advance value of a given glyph outline in an FT_Face.

    -

    -
    input
    -

    - -
    face + +

    input

    + + - -
    face

    The source FT_Face handle.

    gindex +
    gindex

    The glyph index.

    load_flags +
    load_flags

    A set of bit flags similar to those used when calling FT_Load_Glyph, used to determine what kind of advances you need.

    -
    -
    output
    -

    - -
    padvance + +

    output

    + +
    padvance

    The advance value. If scaling is performed (based on the value of ‘load_flags’), the advance value is in 16.16 format. Otherwise, it is in font units.

    If FT_LOAD_VERTICAL_LAYOUT is set, this is the vertical advance corresponding to a vertical layout. Otherwise, it is the horizontal advance in a horizontal layout.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function may fail if you use FT_ADVANCE_FLAG_FAST_ONLY and if the corresponding font backend doesn't have a quick way to retrieve the advances.

    A scaled advance is returned in 16.16 format but isn't transformed by the affine transformation specified by FT_Set_Transform.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Advances

    -
    -Defined in FT_ADVANCES_H (ftadvanc.h). -

    -
     
    +
    + + +
    +

    FT_Get_Advances

    +

    Defined in FT_ADVANCES_H (ftadvanc.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_Advances( FT_Face    face,
                        FT_UInt    start,
                        FT_UInt    count,
                        FT_Int32   load_flags,
                        FT_Fixed  *padvances );
    +
    -

    -

    Retrieve the advance values of several glyph outlines in an FT_Face.

    -

    -
    input
    -

    - -
    face + +

    input

    + + - - -
    face

    The source FT_Face handle.

    start +
    start

    The first glyph index.

    count +
    count

    The number of advance values you want to retrieve.

    load_flags +
    load_flags

    A set of bit flags similar to those used when calling FT_Load_Glyph.

    -
    -
    output
    -

    - -
    padvance + +

    output

    + +
    padvance

    The advance values. This array, to be provided by the caller, must contain at least ‘count’ elements.

    If scaling is performed (based on the value of ‘load_flags’), the advance values are in 16.16 format. Otherwise, they are in font units.

    If FT_LOAD_VERTICAL_LAYOUT is set, these are the vertical advances corresponding to a vertical layout. Otherwise, they are the horizontal advances in a horizontal layout.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    This function may fail if you use FT_ADVANCE_FLAG_FAST_ONLY and if the corresponding font backend doesn't have a quick way to retrieve the advances.

    Scaled advances are returned in 16.16 format but aren't transformed by the affine transformation specified by FT_Set_Transform.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + + +
    +

    FT_ADVANCE_FLAG_FAST_ONLY

    +

    Defined in FT_ADVANCES_H (ftadvanc.h).

    +
    +#define FT_ADVANCE_FLAG_FAST_ONLY  0x20000000UL
    +
    + +

    A bit-flag to be OR-ed with the ‘flags’ parameter of the FT_Get_Advance and FT_Get_Advances functions.

    +

    If set, it indicates that you want these functions to fail if the corresponding hinting mode or font driver doesn't allow for very quick advance computation.

    +

    Typically, glyphs that are either unscaled, unhinted, bitmapped, or light-hinted can have their advance width computed very quickly.

    +

    Normal and bytecode hinted modes that require loading, scaling, and hinting of the glyph outline, are extremely slow by comparison.

    + +
    +
    diff --git a/freetype/docs/reference/ft2-raster.html b/freetype/docs/reference/ft2-raster.html index b94ef6541..3d4062124 100644 --- a/freetype/docs/reference/ft2-raster.html +++ b/freetype/docs/reference/ft2-raster.html @@ -3,81 +3,135 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Scanline Converter -

    +

    Scanline Converter

    Synopsis

    - - - - - - -
    FT_RasterFT_RASTER_FLAG_XXXFT_Raster_SetModeFunc
    FT_SpanFT_Raster_ParamsFT_Raster_RenderFunc
    FT_SpanFuncFT_Raster_NewFuncFT_Raster_Funcs
    FT_Raster_BitTest_FuncFT_Raster_DoneFunc
    FT_Raster_BitSet_FuncFT_Raster_ResetFunc


    - -
    + + + + + + + +
    FT_Raster FT_Raster_Funcs
    FT_SpanFT_Raster_NewFunc 
    FT_SpanFuncFT_Raster_DoneFuncFT_Raster_BitTest_Func
     FT_Raster_ResetFuncFT_Raster_BitSet_Func
    FT_Raster_ParamsFT_Raster_SetModeFunc
    FT_RASTER_FLAG_XXXFT_Raster_RenderFunc
    + +

    This section contains technical definitions.

    -

    -
    -

    FT_Raster

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    +
    +

    FT_Raster

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef struct FT_RasterRec_*  FT_Raster;
    +
    + +

    An opaque handle (pointer) to a raster object. Each object can be used independently to convert an outline into a bitmap or pixmap.

    -

    -
    -

    A handle (pointer) to a raster object. Each object can be used independently to convert an outline into a bitmap or pixmap.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Span

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
    +
    + +
    +

    FT_Span

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef struct  FT_Span_
       {
         short           x;
    @@ -85,42 +139,34 @@ Defined in FT_IMAGE_H (ftimage.h).
         unsigned char   coverage;
     
       } FT_Span;
    +
    -

    -
    -

    A structure used to model a single span of gray (or black) pixels when rendering a monochrome or anti-aliased bitmap.

    -

    -
    fields
    -

    - -
    x +

    A structure used to model a single span of gray pixels when rendering an anti-aliased bitmap.

    + +

    fields

    + + - -
    x

    The span's horizontal start position.

    len +
    len

    The span's length in pixels.

    coverage -

    The span color/coverage, ranging from 0 (background) to 255 (foreground). Only used for anti-aliased rendering.

    +
    coverage +

    The span color/coverage, ranging from 0 (background) to 255 (foreground).

    -
    -
    note
    + +

    note

    This structure is used by the span drawing callback type named FT_SpanFunc that takes the y coordinate of the span as a parameter.

    The coverage value is always between 0 and 255. If you want less gray values, the callback function has to reduce them.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_SpanFunc

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    +
    + + +
    +

    FT_SpanFunc

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef void
       (*FT_SpanFunc)( int             y,
                       int             count,
    @@ -128,439 +174,294 @@ Defined in FT_IMAGE_H (ftimage.h).
                       void*           user );
     
     #define FT_Raster_Span_Func  FT_SpanFunc
    +
    -

    -

    A function used as a call-back by the anti-aliased renderer in order to let client applications draw themselves the gray pixel spans on each scan line.

    -

    -
    input
    -

    - -
    y + +

    input

    + + - - -
    y

    The scanline's y coordinate.

    count +
    count

    The number of spans to draw on this scanline.

    spans +
    spans

    A table of ‘count’ spans to draw on the scanline.

    user +
    user

    User-supplied data that is passed to the callback.

    -
    -
    note
    + +

    note

    This callback allows client applications to directly render the gray spans of the anti-aliased bitmap to any kind of surfaces.

    This can be used to write anti-aliased outlines directly to a given background bitmap, and even perform translucency.

    Note that the ‘count’ field cannot be greater than a fixed value defined by the ‘FT_MAX_GRAY_SPANS’ configuration macro in ‘ftoption.h’. By default, this value is set to 32, which means that if there are more than 32 spans on a given scanline, the callback is called several times with the same ‘y’ parameter in order to draw all callbacks.

    Otherwise, the callback is only called once per scan-line, and only for those scanlines that do have ‘gray’ pixels on them.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Raster_BitTest_Func

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    -  typedef int
    -  (*FT_Raster_BitTest_Func)( int    y,
    -                             int    x,
    -                             void*  user );
    -
    -

    -
    -

    THIS TYPE IS DEPRECATED. DO NOT USE IT.

    -

    A function used as a call-back by the monochrome scan-converter to test whether a given target pixel is already set to the drawing ‘color’. These tests are crucial to implement drop-out control per-se the TrueType spec.

    -

    -
    input
    -

    - - - - -
    y -

    The pixel's y coordinate.

    -
    x -

    The pixel's x coordinate.

    -
    user -

    User-supplied data that is passed to the callback.

    -
    -
    -
    return
    -

    1 if the pixel is ‘set’, 0 otherwise.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Raster_BitSet_Func

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
    -
    -  typedef void
    -  (*FT_Raster_BitSet_Func)( int    y,
    -                            int    x,
    -                            void*  user );
    -
    -

    -
    -

    THIS TYPE IS DEPRECATED. DO NOT USE IT.

    -

    A function used as a call-back by the monochrome scan-converter to set an individual target pixel. This is crucial to implement drop-out control according to the TrueType specification.

    -

    -
    input
    -

    - - - - -
    y -

    The pixel's y coordinate.

    -
    x -

    The pixel's x coordinate.

    -
    user -

    User-supplied data that is passed to the callback.

    -
    -
    -
    return
    -

    1 if the pixel is ‘set’, 0 otherwise.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_RASTER_FLAG_XXX

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
    -
    -#define FT_RASTER_FLAG_DEFAULT  0x0
    -#define FT_RASTER_FLAG_AA       0x1
    -#define FT_RASTER_FLAG_DIRECT   0x2
    -#define FT_RASTER_FLAG_CLIP     0x4
    -
    -  /* deprecated */
    -#define ft_raster_flag_default  FT_RASTER_FLAG_DEFAULT
    -#define ft_raster_flag_aa       FT_RASTER_FLAG_AA
    -#define ft_raster_flag_direct   FT_RASTER_FLAG_DIRECT
    -#define ft_raster_flag_clip     FT_RASTER_FLAG_CLIP
    -
    -

    -
    -

    A list of bit flag constants as used in the ‘flags’ field of a FT_Raster_Params structure.

    -

    -
    values
    -

    - - - - - -
    FT_RASTER_FLAG_DEFAULT -

    This value is 0.

    -
    FT_RASTER_FLAG_AA -

    This flag is set to indicate that an anti-aliased glyph image should be generated. Otherwise, it will be monochrome (1-bit).

    -
    FT_RASTER_FLAG_DIRECT -

    This flag is set to indicate direct rendering. In this mode, client applications must provide their own span callback. This lets them directly draw or compose over an existing bitmap. If this bit is not set, the target pixmap's buffer must be zeroed before rendering.

    -

    Note that for now, direct rendering is only possible with anti-aliased glyphs.

    -
    FT_RASTER_FLAG_CLIP -

    This flag is only used in direct rendering mode. If set, the output will be clipped to a box specified in the ‘clip_box’ field of the FT_Raster_Params structure.

    -

    Note that by default, the glyph bitmap is clipped to the target pixmap, except in direct rendering mode where all spans are generated if no clipping box is set.

    -
    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Raster_Params

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
    +
    + +
    +

    FT_Raster_Params

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef struct  FT_Raster_Params_
       {
         const FT_Bitmap*        target;
         const void*             source;
         int                     flags;
         FT_SpanFunc             gray_spans;
    -    FT_SpanFunc             black_spans;  /* doesn't work! */
    -    FT_Raster_BitTest_Func  bit_test;     /* doesn't work! */
    -    FT_Raster_BitSet_Func   bit_set;      /* doesn't work! */
    +    FT_SpanFunc             black_spans;  /* unused */
    +    FT_Raster_BitTest_Func  bit_test;     /* unused */
    +    FT_Raster_BitSet_Func   bit_set;      /* unused */
         void*                   user;
         FT_BBox                 clip_box;
     
       } FT_Raster_Params;
    +
    -

    -

    A structure to hold the arguments used by a raster's render function.

    -

    -
    fields
    -

    - -
    target + +

    fields

    + + - - - - - - - -
    target

    The target bitmap.

    source +
    source

    A pointer to the source glyph image (e.g., an FT_Outline).

    flags +
    flags

    The rendering flags.

    gray_spans +
    gray_spans

    The gray span drawing callback.

    black_spans -

    The black span drawing callback. UNIMPLEMENTED!

    +
    black_spans +

    Unused.

    bit_test -

    The bit test callback. UNIMPLEMENTED!

    +
    bit_test +

    Unused.

    bit_set -

    The bit set callback. UNIMPLEMENTED!

    +
    bit_set +

    Unused.

    user +
    user

    User-supplied data that is passed to each drawing callback.

    clip_box +
    clip_box

    An optional clipping box. It is only used in direct rendering mode. Note that coordinates here should be expressed in integer pixels (and not in 26.6 fixed-point units).

    -
    -
    note
    + +

    note

    An anti-aliased glyph bitmap is drawn if the FT_RASTER_FLAG_AA bit flag is set in the ‘flags’ field, otherwise a monochrome bitmap is generated.

    -

    If the FT_RASTER_FLAG_DIRECT bit flag is set in ‘flags’, the raster will call the ‘gray_spans’ callback to draw gray pixel spans, in the case of an aa glyph bitmap, it will call ‘black_spans’, and ‘bit_test’ and ‘bit_set’ in the case of a monochrome bitmap. This allows direct composition over a pre-existing bitmap through user-provided callbacks to perform the span drawing/composition.

    -

    Note that the ‘bit_test’ and ‘bit_set’ callbacks are required when rendering a monochrome bitmap, as they are crucial to implement correct drop-out control as defined in the TrueType specification.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Raster_NewFunc

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
    +

    If the FT_RASTER_FLAG_DIRECT bit flag is set in ‘flags’, the raster will call the ‘gray_spans’ callback to draw gray pixel spans. This allows direct composition over a pre-existing bitmap through user-provided callbacks to perform the span drawing and composition. Not supported by the monochrome rasterizer.

    + +
    + + +
    +

    FT_RASTER_FLAG_XXX

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
    +#define FT_RASTER_FLAG_DEFAULT  0x0
    +#define FT_RASTER_FLAG_AA       0x1
    +#define FT_RASTER_FLAG_DIRECT   0x2
    +#define FT_RASTER_FLAG_CLIP     0x4
    +
    +  /* these constants are deprecated; use the corresponding */
    +  /* `FT_RASTER_FLAG_XXX' values instead                   */
    +#define ft_raster_flag_default  FT_RASTER_FLAG_DEFAULT
    +#define ft_raster_flag_aa       FT_RASTER_FLAG_AA
    +#define ft_raster_flag_direct   FT_RASTER_FLAG_DIRECT
    +#define ft_raster_flag_clip     FT_RASTER_FLAG_CLIP
    +
    + +

    A list of bit flag constants as used in the ‘flags’ field of a FT_Raster_Params structure.

    + +

    values

    + + + + + +
    FT_RASTER_FLAG_DEFAULT +

    This value is 0.

    +
    FT_RASTER_FLAG_AA +

    This flag is set to indicate that an anti-aliased glyph image should be generated. Otherwise, it will be monochrome (1-bit).

    +
    FT_RASTER_FLAG_DIRECT +

    This flag is set to indicate direct rendering. In this mode, client applications must provide their own span callback. This lets them directly draw or compose over an existing bitmap. If this bit is not set, the target pixmap's buffer must be zeroed before rendering.

    +

    Direct rendering is only possible with anti-aliased glyphs.

    +
    FT_RASTER_FLAG_CLIP +

    This flag is only used in direct rendering mode. If set, the output will be clipped to a box specified in the ‘clip_box’ field of the FT_Raster_Params structure.

    +

    Note that by default, the glyph bitmap is clipped to the target pixmap, except in direct rendering mode where all spans are generated if no clipping box is set.

    +
    +
    +
    + +
    +

    FT_Raster_NewFunc

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef int
       (*FT_Raster_NewFunc)( void*       memory,
                             FT_Raster*  raster );
     
     #define FT_Raster_New_Func  FT_Raster_NewFunc
    +
    -

    -

    A function used to create a new raster object.

    -

    -
    input
    -

    - -
    memory + +

    input

    + +
    memory

    A handle to the memory allocator.

    -
    -
    output
    -

    - -
    raster + +

    output

    + +
    raster

    A handle to the new raster object.

    -
    -
    return
    + +

    return

    Error code. 0 means success.

    -
    -
    note
    + +

    note

    The ‘memory’ parameter is a typeless pointer in order to avoid un-wanted dependencies on the rest of the FreeType code. In practice, it is an FT_Memory object, i.e., a handle to the standard FreeType memory allocator. However, this field can be completely ignored by a given raster implementation.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Raster_DoneFunc

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    +
    + + +
    +

    FT_Raster_DoneFunc

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef void
       (*FT_Raster_DoneFunc)( FT_Raster  raster );
     
     #define FT_Raster_Done_Func  FT_Raster_DoneFunc
    +
    -

    -

    A function used to destroy a given raster object.

    -

    -
    input
    -

    - -
    raster + +

    input

    + +
    raster

    A handle to the raster object.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Raster_ResetFunc

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    +
    + + +
    +

    FT_Raster_ResetFunc

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef void
       (*FT_Raster_ResetFunc)( FT_Raster       raster,
                               unsigned char*  pool_base,
                               unsigned long   pool_size );
     
     #define FT_Raster_Reset_Func  FT_Raster_ResetFunc
    +
    -

    -

    FreeType provides an area of memory called the ‘render pool’, available to all registered rasters. This pool can be freely used during a given scan-conversion but is shared by all rasters. Its content is thus transient.

    This function is called each time the render pool changes, or just after a new raster object is created.

    -

    -
    input
    -

    - -
    raster + +

    input

    + + - -
    raster

    A handle to the new raster object.

    pool_base +
    pool_base

    The address in memory of the render pool.

    pool_size +
    pool_size

    The size in bytes of the render pool.

    -
    -
    note
    + +

    note

    Rasters can ignore the render pool and rely on dynamic memory allocation if they want to (a handle to the memory allocator is passed to the raster constructor). However, this is not recommended for efficiency purposes.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Raster_SetModeFunc

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    +
    + + +
    +

    FT_Raster_SetModeFunc

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef int
       (*FT_Raster_SetModeFunc)( FT_Raster      raster,
                                 unsigned long  mode,
                                 void*          args );
     
     #define FT_Raster_Set_Mode_Func  FT_Raster_SetModeFunc
    +
    -

    -

    This function is a generic facility to change modes or attributes in a given raster. This can be used for debugging purposes, or simply to allow implementation-specific ‘features’ in a given raster module.

    -

    -
    input
    -

    - -
    raster + +

    input

    + + - -
    raster

    A handle to the new raster object.

    mode +
    mode

    A 4-byte tag used to name the mode or property.

    args +
    args

    A pointer to the new mode/property to use.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Raster_RenderFunc

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    +
    + + +
    +

    FT_Raster_RenderFunc

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef int
       (*FT_Raster_RenderFunc)( FT_Raster                raster,
                                const FT_Raster_Params*  params );
     
     #define FT_Raster_Render_Func  FT_Raster_RenderFunc
    +
    -

    -

    Invoke a given raster to scan-convert a given glyph image into a target bitmap.

    -

    -
    input
    -

    - -
    raster + +

    input

    + + -
    raster

    A handle to the raster object.

    params +
    params

    A pointer to an FT_Raster_Params structure used to store the rendering parameters.

    -
    -
    return
    + +

    return

    Error code. 0 means success.

    -
    -
    note
    + +

    note

    The exact format of the source image depends on the raster's glyph format defined in its FT_Raster_Funcs structure. It can be an FT_Outline or anything else in order to support a large array of glyph formats.

    Note also that the render function can fail and return a ‘FT_Err_Unimplemented_Feature’ error code if the raster used does not support direct composition.

    XXX: For now, the standard raster doesn't support direct composition but this should change for the final release (see the files ‘demos/src/ftgrays.c’ and ‘demos/src/ftgrays2.c’ for examples of distinct implementations that support direct composition).

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Raster_Funcs

    -
    -Defined in FT_IMAGE_H (ftimage.h). -

    -
     
    +
    + + +
    +

    FT_Raster_Funcs

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
       typedef struct  FT_Raster_Funcs_
       {
         FT_Glyph_Format        glyph_format;
    @@ -571,36 +472,61 @@ Defined in FT_IMAGE_H (ftimage.h).
         FT_Raster_DoneFunc     raster_done;
     
       } FT_Raster_Funcs;
    +
    -

    -

    A structure used to describe a given raster class to the library.

    -

    -
    fields
    -

    - -
    glyph_format + +

    fields

    + + - - - -
    glyph_format

    The supported glyph format for this raster.

    raster_new +
    raster_new

    The raster constructor.

    raster_reset +
    raster_reset

    Used to reset the render pool within the raster.

    raster_render +
    raster_render

    A function to render a glyph into a given bitmap.

    raster_done +
    raster_done

    The raster destructor.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + + +
    +

    FT_Raster_BitTest_Func

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
    +  typedef int
    +  (*FT_Raster_BitTest_Func)( int    y,
    +                             int    x,
    +                             void*  user );
    +
    + +

    Deprecated, unimplemented.

    + +
    +
    + +
    +

    FT_Raster_BitSet_Func

    +

    Defined in FT_IMAGE_H (ftimage.h).

    +
    +  typedef void
    +  (*FT_Raster_BitSet_Func)( int    y,
    +                            int    x,
    +                            void*  user );
    +
    + +

    Deprecated, unimplemented.

    + +
    +
    diff --git a/freetype/docs/reference/ft2-sfnt_names.html b/freetype/docs/reference/ft2-sfnt_names.html index a1720b137..3bd918d3e 100644 --- a/freetype/docs/reference/ft2-sfnt_names.html +++ b/freetype/docs/reference/ft2-sfnt_names.html @@ -3,64 +3,124 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -SFNT Names -

    +

    SFNT Names

    Synopsis

    - - - - - - -
    FT_SfntName
    FT_Get_Sfnt_Name_Count
    FT_Get_Sfnt_Name
    FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
    FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY


    - -
    + + + + + + +
    FT_SfntName
    FT_Get_Sfnt_Name_Count
    FT_Get_Sfnt_Name
    FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
    FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
    + +

    The TrueType and OpenType specifications allow the inclusion of a special ‘names table’ in font files. This table contains textual (and internationalized) information regarding the font, like family name, copyright, version, etc.

    The definitions below are used to access them if available.

    Note that this has nothing to do with glyph names!

    -

    -
    -

    FT_SfntName

    -
    -Defined in FT_SFNT_NAMES_H (ftsnames.h). -

    -
     
    +
    +

    FT_SfntName

    +

    Defined in FT_SFNT_NAMES_H (ftsnames.h).

    +
       typedef struct  FT_SfntName_
       {
         FT_UShort  platform_id;
    @@ -72,161 +132,125 @@ Defined in FT_SFNT_NAMES_H (ftsnames.h).
         FT_UInt    string_len;  /* in bytes */
     
       } FT_SfntName;
    +
    -

    -

    A structure used to model an SFNT ‘name’ table entry.

    -

    -
    fields
    -

    - -
    platform_id + +

    fields

    + + - - - - -
    platform_id

    The platform ID for ‘string’.

    encoding_id +
    encoding_id

    The encoding ID for ‘string’.

    language_id +
    language_id

    The language ID for ‘string’.

    name_id +
    name_id

    An identifier for ‘string’.

    string +
    string

    The ‘name’ string. Note that its format differs depending on the (platform,encoding) pair. It can be a Pascal String, a UTF-16 one, etc.

    Generally speaking, the string is not zero-terminated. Please refer to the TrueType specification for details.

    string_len +
    string_len

    The length of ‘string’ in bytes.

    -
    -
    note
    + +

    note

    Possible values for ‘platform_id’, ‘encoding_id’, ‘language_id’, and ‘name_id’ are given in the file ‘ttnameid.h’. For details please refer to the TrueType or OpenType specification.

    See also TT_PLATFORM_XXX, TT_APPLE_ID_XXX, TT_MAC_ID_XXX, TT_ISO_ID_XXX, and TT_MS_ID_XXX.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Sfnt_Name_Count

    -
    -Defined in FT_SFNT_NAMES_H (ftsnames.h). -

    -
     
    +
    + + +
    +

    FT_Get_Sfnt_Name_Count

    +

    Defined in FT_SFNT_NAMES_H (ftsnames.h).

    +
       FT_EXPORT( FT_UInt )
       FT_Get_Sfnt_Name_Count( FT_Face  face );
    +
    -

    -

    Retrieve the number of name strings in the SFNT ‘name’ table.

    -

    -
    input
    -

    - -
    face + +

    input

    + +
    face

    A handle to the source face.

    -
    -
    return
    + +

    return

    The number of strings in the ‘name’ table.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Get_Sfnt_Name

    -
    -Defined in FT_SFNT_NAMES_H (ftsnames.h). -

    -
     
    +
    + + +
    +

    FT_Get_Sfnt_Name

    +

    Defined in FT_SFNT_NAMES_H (ftsnames.h).

    +
       FT_EXPORT( FT_Error )
       FT_Get_Sfnt_Name( FT_Face       face,
                         FT_UInt       idx,
                         FT_SfntName  *aname );
    +
    -

    -

    Retrieve a string of the SFNT ‘name’ table for a given index.

    -

    -
    input
    -

    - -
    face + +

    input

    + + -
    face

    A handle to the source face.

    idx +
    idx

    The index of the ‘name’ string.

    -
    -
    output
    -

    - -
    aname + +

    output

    + +
    aname

    The indexed FT_SfntName structure.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    The ‘string’ array returned in the ‘aname’ structure is not null-terminated. The application should deallocate it if it is no longer in use.

    Use FT_Get_Sfnt_Name_Count to get the total number of available ‘name’ table entries, then do a loop until you get the right platform, encoding, and name ID.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY

    -
    -Defined in FT_SFNT_NAMES_H (ftsnames.h). -

    -
     
    +
    + + +
    +

    FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY

    +

    Defined in FT_SFNT_NAMES_H (ftsnames.h).

    +
     #define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
    +
    -

    -

    A constant used as the tag of FT_Parameter structures to make FT_Open_Face() ignore preferred family subfamily names in ‘name’ table since OpenType version 1.4. For backwards compatibility with legacy systems that have a 4-face-per-family restriction.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY

    -
    -Defined in FT_SFNT_NAMES_H (ftsnames.h). -

    -
     
    +
    + + +
    +

    FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY

    +

    Defined in FT_SFNT_NAMES_H (ftsnames.h).

    +
     #define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 's' )
    +
    -

    -

    A constant used as the tag of FT_Parameter structures to make FT_Open_Face() ignore preferred subfamily names in ‘name’ table since OpenType version 1.4. For backwards compatibility with legacy systems that have a 4-face-per-family restriction.

    -

    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-sizes_management.html b/freetype/docs/reference/ft2-sizes_management.html index 698ef1c7b..50563eb5a 100644 --- a/freetype/docs/reference/ft2-sizes_management.html +++ b/freetype/docs/reference/ft2-sizes_management.html @@ -3,162 +3,200 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -Size Management -

    +

    Size Management

    Synopsis

    - - -
    FT_New_SizeFT_Done_SizeFT_Activate_Size


    + + +
    FT_New_SizeFT_Done_SizeFT_Activate_Size
    + -

    When creating a new face object (e.g., with FT_New_Face), an FT_Size object is automatically created and used to store all pixel-size dependent information, available in the ‘face->size’ field.

    It is however possible to create more sizes for a given face, mostly in order to manage several character pixel sizes of the same font family and style. See FT_New_Size and FT_Done_Size.

    Note that FT_Set_Pixel_Sizes and FT_Set_Char_Size only modify the contents of the current ‘active’ size; you thus need to use FT_Activate_Size to change it.

    99% of applications won't need the functions provided here, especially if they use the caching sub-system, so be cautious when using these.

    -

    -
    -

    FT_New_Size

    -
    -Defined in FT_SIZES_H (ftsizes.h). -

    -
     
    +
    +

    FT_New_Size

    +

    Defined in FT_SIZES_H (ftsizes.h).

    +
       FT_EXPORT( FT_Error )
       FT_New_Size( FT_Face   face,
                    FT_Size*  size );
    +
    -

    -

    Create a new size object from a given face object.

    -

    -
    input
    -

    - -
    face + +

    input

    + +
    face

    A handle to a parent face object.

    -
    -
    output
    -

    - -
    asize + +

    output

    + +
    asize

    A handle to a new size object.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    You need to call FT_Activate_Size in order to select the new size for upcoming calls to FT_Set_Pixel_Sizes, FT_Set_Char_Size, FT_Load_Glyph, FT_Load_Char, etc.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Done_Size

    -
    -Defined in FT_SIZES_H (ftsizes.h). -

    -
     
    +
    + + +
    +

    FT_Done_Size

    +

    Defined in FT_SIZES_H (ftsizes.h).

    +
       FT_EXPORT( FT_Error )
       FT_Done_Size( FT_Size  size );
    +
    -

    -

    Discard a given size object. Note that FT_Done_Face automatically discards all size objects allocated with FT_New_Size.

    -

    -
    input
    -

    - -
    size + +

    input

    + +
    size

    A handle to a target size object.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Activate_Size

    -
    -Defined in FT_SIZES_H (ftsizes.h). -

    -
     
    +
    + + +
    +

    FT_Activate_Size

    +

    Defined in FT_SIZES_H (ftsizes.h).

    +
       FT_EXPORT( FT_Error )
       FT_Activate_Size( FT_Size  size );
    +
    -

    -

    Even though it is possible to create several size objects for a given face (see FT_New_Size for details), functions like FT_Load_Glyph or FT_Load_Char only use the one that has been activated last to determine the ‘current character pixel size’.

    This function can be used to ‘activate’ a previously created size object.

    -

    -
    input
    -

    - -
    size + +

    input

    + +
    size

    A handle to a target size object.

    -
    -
    return
    + +

    return

    FreeType error code. 0 means success.

    -
    -
    note
    + +

    note

    If ‘face’ is the size's parent face object, this function changes the value of ‘face->size’ to the input size handle.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-system_interface.html b/freetype/docs/reference/ft2-system_interface.html index 05ce8320c..139cbc7f0 100644 --- a/freetype/docs/reference/ft2-system_interface.html +++ b/freetype/docs/reference/ft2-system_interface.html @@ -3,193 +3,222 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
    [Index][TOC]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    -System Interface -

    +

    System Interface

    Synopsis

    - - - - - -
    FT_MemoryFT_MemoryRecFT_Stream_CloseFunc
    FT_Alloc_FuncFT_StreamFT_StreamRec
    FT_Free_FuncFT_StreamDesc
    FT_Realloc_FuncFT_Stream_IoFunc


    - -
    + + + + + +
    FT_MemoryFT_MemoryRecFT_Stream_CloseFunc
    FT_Alloc_FuncFT_StreamFT_StreamRec
    FT_Free_FuncFT_StreamDesc
    FT_Realloc_FuncFT_Stream_IoFunc
    + +

    This section contains various definitions related to memory management and i/o access. You need to understand this information if you want to use a custom memory manager or you own i/o streams.

    -

    -
    -

    FT_Memory

    -
    -Defined in FT_SYSTEM_H (ftsystem.h). -

    -
     
    +
    +

    FT_Memory

    +

    Defined in FT_SYSTEM_H (ftsystem.h).

    +
       typedef struct FT_MemoryRec_*  FT_Memory;
    +
    -

    -

    A handle to a given memory manager object, defined with an FT_MemoryRec structure.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Alloc_Func

    -
    -Defined in FT_SYSTEM_H (ftsystem.h). -

    -
     
    +
    + + +
    +

    FT_Alloc_Func

    +

    Defined in FT_SYSTEM_H (ftsystem.h).

    +
       typedef void*
       (*FT_Alloc_Func)( FT_Memory  memory,
                         long       size );
    +
    -

    -

    A function used to allocate ‘size’ bytes from ‘memory’.

    -

    -
    input
    -

    - -
    memory + +

    input

    + + -
    memory

    A handle to the source memory manager.

    size +
    size

    The size in bytes to allocate.

    -
    -
    return
    + +

    return

    Address of new memory block. 0 in case of failure.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Free_Func

    -
    -Defined in FT_SYSTEM_H (ftsystem.h). -

    -
     
    +
    + + +
    +

    FT_Free_Func

    +

    Defined in FT_SYSTEM_H (ftsystem.h).

    +
       typedef void
       (*FT_Free_Func)( FT_Memory  memory,
                        void*      block );
    +
    -

    -

    A function used to release a given block of memory.

    -

    -
    input
    -

    - -
    memory + +

    input

    + + -
    memory

    A handle to the source memory manager.

    block +
    block

    The address of the target memory block.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Realloc_Func

    -
    -Defined in FT_SYSTEM_H (ftsystem.h). -

    -
     
    +
    + + +
    +

    FT_Realloc_Func

    +

    Defined in FT_SYSTEM_H (ftsystem.h).

    +
       typedef void*
       (*FT_Realloc_Func)( FT_Memory  memory,
                           long       cur_size,
                           long       new_size,
                           void*      block );
    +
    -

    -

    A function used to re-allocate a given block of memory.

    -

    -
    input
    -

    - -
    memory + +

    input

    + + - - -
    memory

    A handle to the source memory manager.

    cur_size +
    cur_size

    The block's current size in bytes.

    new_size +
    new_size

    The block's requested new size.

    block +
    block

    The block's current address.

    -
    -
    return
    + +

    return

    New block address. 0 in case of memory shortage.

    -
    -
    note
    + +

    note

    In case of error, the old block must still be available.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_MemoryRec

    -
    -Defined in FT_SYSTEM_H (ftsystem.h). -

    -
     
    +
    + + +
    +

    FT_MemoryRec

    +

    Defined in FT_SYSTEM_H (ftsystem.h).

    +
       struct  FT_MemoryRec_
       {
         void*            user;
    @@ -197,158 +226,123 @@ Defined in FT_SYSTEM_H (ftsystem.h).
         FT_Free_Func     free;
         FT_Realloc_Func  realloc;
       };
    +
    -

    -

    A structure used to describe a given memory manager to FreeType 2.

    -

    -
    fields
    -

    - -
    user + +

    fields

    + + - - -
    user

    A generic typeless pointer for user data.

    alloc +
    alloc

    A pointer type to an allocation function.

    free +
    free

    A pointer type to an memory freeing function.

    realloc +
    realloc

    A pointer type to a reallocation function.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stream

    -
    -Defined in FT_SYSTEM_H (ftsystem.h). -

    -
     
    +
    + + +
    +

    FT_Stream

    +

    Defined in FT_SYSTEM_H (ftsystem.h).

    +
       typedef struct FT_StreamRec_*  FT_Stream;
    +
    -

    -

    A handle to an input stream.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_StreamDesc

    -
    -Defined in FT_SYSTEM_H (ftsystem.h). -

    -
     
    +

    also

    +

    See FT_StreamRec for the publicly accessible fields of a given stream object.

    + +
    + + +
    +

    FT_StreamDesc

    +

    Defined in FT_SYSTEM_H (ftsystem.h).

    +
       typedef union  FT_StreamDesc_
       {
         long   value;
         void*  pointer;
     
       } FT_StreamDesc;
    +
    -

    -

    A union type used to store either a long or a pointer. This is used to store a file descriptor or a ‘FILE*’ in an input stream.

    -

    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stream_IoFunc

    -
    -Defined in FT_SYSTEM_H (ftsystem.h). -

    -
     
    +
    + + +
    +

    FT_Stream_IoFunc

    +

    Defined in FT_SYSTEM_H (ftsystem.h).

    +
       typedef unsigned long
       (*FT_Stream_IoFunc)( FT_Stream       stream,
                            unsigned long   offset,
                            unsigned char*  buffer,
                            unsigned long   count );
    +
    -

    -

    A function used to seek and read data from a given input stream.

    -

    -
    input
    -

    - -
    stream + +

    input

    + + - - -
    stream

    A handle to the source stream.

    offset +
    offset

    The offset of read in stream (always from start).

    buffer +
    buffer

    The address of the read buffer.

    count +
    count

    The number of bytes to read from the stream.

    -
    -
    return
    + +

    return

    The number of bytes effectively read by the stream.

    -
    -
    note
    + +

    note

    This function might be called to perform a seek or skip operation with a ‘count’ of 0. A non-zero return value then indicates an error.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_Stream_CloseFunc

    -
    -Defined in FT_SYSTEM_H (ftsystem.h). -

    -
     
    +
    + + +
    +

    FT_Stream_CloseFunc

    +

    Defined in FT_SYSTEM_H (ftsystem.h).

    +
       typedef void
       (*FT_Stream_CloseFunc)( FT_Stream  stream );
    +
    -

    -

    A function used to close a given input stream.

    -

    -
    input
    -

    - -
    stream + +

    input

    + +
    stream

    A handle to the target stream.

    -
    -
    -
    - - -
    [Index][TOC]
    - -
    -

    FT_StreamRec

    -
    -Defined in FT_SYSTEM_H (ftsystem.h). -

    -
     
    +
    + + +
    +

    FT_StreamRec

    +

    Defined in FT_SYSTEM_H (ftsystem.h).

    +
       typedef struct  FT_StreamRec_
       {
         unsigned char*       base;
    @@ -365,51 +359,47 @@ Defined in FT_SYSTEM_H (ftsystem.h).
         unsigned char*       limit;
     
       } FT_StreamRec;
    +
    -

    -

    A structure used to describe an input stream.

    -

    -
    input
    -

    - -
    base + +

    input

    + + - - - - - - - - -
    base

    For memory-based streams, this is the address of the first stream byte in memory. This field should always be set to NULL for disk-based streams.

    size +
    size

    The stream size in bytes.

    +

    In case of compressed streams where the size is unknown before actually doing the decompression, the value is set to 0x7FFFFFFF. (Note that this size value can occur for normal streams also; it is thus just a hint.)

    pos +
    pos

    The current position within the stream.

    descriptor +
    descriptor

    This field is a union that can hold an integer or a pointer. It is used by stream implementations to store file descriptors or ‘FILE*’ pointers.

    pathname +
    pathname

    This field is completely ignored by FreeType. However, it is often useful during debugging to use it to store the stream's filename (where available).

    read +
    read

    The stream's input function.

    close +
    close

    The stream's close function.

    memory +
    memory

    The memory manager to use to preload frames. This is set internally by FreeType and shouldn't be touched by stream implementations.

    cursor +
    cursor

    This field is set and used internally by FreeType when parsing frames.

    limit +
    limit

    This field is set and used internally by FreeType when parsing frames.

    -
    -
    -
    - - -
    [Index][TOC]
    + +
    + diff --git a/freetype/docs/reference/ft2-toc.html b/freetype/docs/reference/ft2-toc.html index 560212a99..61098164d 100644 --- a/freetype/docs/reference/ft2-toc.html +++ b/freetype/docs/reference/ft2-toc.html @@ -3,237 +3,268 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - -
    [Index]
    -

    FreeType-2.5.3 API Reference

    + +

    FreeType-2.5.5 API Reference

    -

    Table of Contents

    -

    General Remarks

    • - -
      -FreeType's header inclusion scheme +

      Table of Contents

      +
      +

      General Remarks

      + + -

      How client applications should include FreeType header files.

      -User allocation +

      How client applications should allocate FreeType data structures.

      -
      -

      Core API

      • - -
        -FreeType Version + +
        +

        Core API

        + + - - - - - - -

        Functions and macros related to FreeType versions.

        -Basic Data Types +

        The basic data types defined by the library.

        -Base Interface +

        The FreeType 2 base font interface.

        -Glyph Variants +

        The FreeType 2 interface to Unicode Ideographic Variation Sequences (IVS), using the SFNT cmap format 14.

        -Glyph Management +

        Generic interface to manage individual glyph data.

        -Mac Specific Interface +

        Only available on the Macintosh.

        -Size Management +

        Managing multiple sizes per face.

        -Header File Macros +

        Macro definitions used to #include specific header files.

        -
        -

        Format-Specific API

        • - -
          -Multiple Masters + +
          +

          Format-Specific API

          + + - - - - - - - - -

          How to manage Multiple Masters fonts.

          -TrueType Tables +

          TrueType specific table types and functions.

          -Type 1 Tables +

          Type 1 (PostScript) specific font tables.

          -SFNT Names +

          Access the names embedded in TrueType and OpenType files.

          -BDF and PCF Files +

          BDF and PCF specific API.

          -CID Fonts +

          CID-keyed font specific API.

          -PFR Fonts +

          PFR/TrueDoc specific API.

          -Window FNT Files +

          Windows FNT specific API.

          -Font Formats +

          Getting the font format.

          -Gasp Table +

          Retrieving TrueType ‘gasp’ table entries.

          -
          -

          Controlling FreeType Modules

          • - -
            -The auto-hinter + +
            +

            Controlling FreeType Modules

            + + - -

            Controlling the auto-hinting module.

            -The CFF driver +

            Controlling the CFF driver module.

            -The TrueType driver +

            Controlling the TrueType driver module.

            -
            -

            Cache Sub-System

            • - -
              -Cache Sub-System + +
              +

              Cache Sub-System

              + +

              How to cache face, size, and glyph data with FreeType 2.

              -
              -

              Support API

              • - -
                -Computations + +
                +

                Support API

                + + - - - - - - - - - - - -

                Crunching fixed numbers and vectors.

                -List Processing +

                Simple management of lists.

                -Outline Processing +

                Functions to create, transform, and render vectorial glyph images.

                -Quick retrieval of advance values +

                Retrieve horizontal and vertical advance values without processing glyph outlines, if possible.

                -Bitmap Handling +

                Handling FT_Bitmap objects.

                -Scanline Converter +

                How vectorial outlines are converted into bitmaps and pixmaps.

                -Glyph Stroker +

                Generating bordered and stroked glyphs.

                -System Interface +

                How FreeType manages memory and i/o.

                -Module Management +

                How to add, upgrade, remove, and control modules from FreeType.

                -GZIP Streams +

                Using gzip-compressed font files.

                -LZW Streams +

                Using LZW-compressed font files.

                -BZIP2 Streams +

                Using bzip2-compressed font files.

                -LCD Filtering +

                Reduce color fringes of LCD-optimized bitmaps.

                -
                -

                Miscellaneous

                • - -
                  -OpenType Validation + +
                  +

                  Miscellaneous

                  + + - - -

                  An API to validate OpenType tables.

                  -Incremental Loading +

                  Custom Glyph Loading.

                  -The TrueType Engine +

                  TrueType bytecode support.

                  -TrueTypeGX/AAT Validation +

                  An API to validate TrueTypeGX/AAT tables.

                  -
                  -

                  Global Index

                  + +
                  - - -
                  [Index]
                  + -
                  generated on Thu Mar 6 23:13:44 2014
                  +
                  generated on Tue Dec 30 21:42:54 2014
                  diff --git a/freetype/docs/reference/ft2-truetype_engine.html b/freetype/docs/reference/ft2-truetype_engine.html index bc4d4e3c3..d0c467bd4 100644 --- a/freetype/docs/reference/ft2-truetype_engine.html +++ b/freetype/docs/reference/ft2-truetype_engine.html @@ -3,130 +3,174 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
                  [Index][TOC]
                  -

                  FreeType-2.5.3 API Reference

                  + +

                  FreeType-2.5.5 API Reference

                  -

                  -The TrueType Engine -

                  +

                  The TrueType Engine

                  Synopsis

                  - - -
                  FT_TrueTypeEngineTypeFT_Get_TrueType_Engine_Type


                  + + +
                  FT_TrueTypeEngineTypeFT_Get_TrueType_Engine_Type
                  + -

                  This section contains a function used to query the level of TrueType bytecode support compiled in this version of the library.

                  -

                  -
                  -

                  FT_TrueTypeEngineType

                  -
                  -Defined in FT_MODULE_H (ftmodapi.h). -

                  -
                   
                  +
                  +

                  FT_TrueTypeEngineType

                  +

                  Defined in FT_MODULE_H (ftmodapi.h).

                  +
                     typedef enum  FT_TrueTypeEngineType_
                     {
                  -    FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
                  -    FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
                  -    FT_TRUETYPE_ENGINE_TYPE_PATENTED
                  +    FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
                  +    FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
                  +    FT_TRUETYPE_ENGINE_TYPE_PATENTED
                   
                     } FT_TrueTypeEngineType;
                  +
                  -

                  -

                  A list of values describing which kind of TrueType bytecode engine is implemented in a given FT_Library instance. It is used by the FT_Get_TrueType_Engine_Type function.

                  -

                  -
                  values
                  -

                  - - -
                  FT_TRUETYPE_ENGINE_TYPE_NONE
                  + +

                  values

                  + + - - - -
                  FT_TRUETYPE_ENGINE_TYPE_NONE

                  The library doesn't implement any kind of bytecode interpreter.

                  FT_TRUETYPE_ENGINE_TYPE_UNPATENTED
                  +
                  FT_TRUETYPE_ENGINE_TYPE_UNPATENTED

                  The library implements a bytecode interpreter that doesn't support the patented operations of the TrueType virtual machine.

                  Its main use is to load certain Asian fonts that position and scale glyph components with bytecode instructions. It produces bad output for most other fonts.

                  FT_TRUETYPE_ENGINE_TYPE_PATENTED
                  +
                  FT_TRUETYPE_ENGINE_TYPE_PATENTED

                  The library implements a bytecode interpreter that covers the full instruction set of the TrueType virtual machine (this was governed by patents until May 2010, hence the name).

                  -
                  -
                  since
                  + +

                  since

                  2.2

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Get_TrueType_Engine_Type

                  -
                  -Defined in FT_MODULE_H (ftmodapi.h). -

                  -
                   
                  +
                  + + +
                  +

                  FT_Get_TrueType_Engine_Type

                  +

                  Defined in FT_MODULE_H (ftmodapi.h).

                  +
                     FT_EXPORT( FT_TrueTypeEngineType )
                     FT_Get_TrueType_Engine_Type( FT_Library  library );
                  +
                  -

                  -

                  Return an FT_TrueTypeEngineType value to indicate which level of the TrueType virtual machine a given library instance supports.

                  -

                  -
                  input
                  -

                  - -
                  library + +

                  input

                  + +
                  library

                  A library instance.

                  -
                  -
                  return
                  + +

                  return

                  A value indicating which level is supported.

                  -
                  -
                  since
                  + +

                  since

                  2.2

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  + +
                  + diff --git a/freetype/docs/reference/ft2-truetype_tables.html b/freetype/docs/reference/ft2-truetype_tables.html index 5da7a9579..9c63d67da 100644 --- a/freetype/docs/reference/ft2-truetype_tables.html +++ b/freetype/docs/reference/ft2-truetype_tables.html @@ -3,456 +3,129 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
                  [Index][TOC]
                  -

                  FreeType-2.5.3 API Reference

                  + +

                  FreeType-2.5.5 API Reference

                  -

                  -TrueType Tables -

                  +

                  TrueType Tables

                  Synopsis

                  - - - - - - - - - - - -
                  TT_PLATFORM_XXXTT_Postscript
                  TT_APPLE_ID_XXXTT_PCLT
                  TT_MAC_ID_XXXTT_MaxProfile
                  TT_ISO_ID_XXXFT_Sfnt_Tag
                  TT_MS_ID_XXXFT_Get_Sfnt_Table
                  TT_ADOBE_ID_XXXFT_Load_Sfnt_Table
                  TT_HeaderFT_Sfnt_Table_Info
                  TT_HoriHeaderFT_Get_CMap_Language_ID
                  TT_VertHeaderFT_Get_CMap_Format
                  TT_OS2FT_PARAM_TAG_UNPATENTED_HINTING


                  - -
                  -

                  This section contains the definition of TrueType-specific tables as well as some routines used to access and process them.

                  -

                  -
                  -

                  TT_PLATFORM_XXX

                  -
                  -Defined in FT_TRUETYPE_IDS_H (ttnameid.h). -

                  -
                  -
                  -#define TT_PLATFORM_APPLE_UNICODE  0
                  -#define TT_PLATFORM_MACINTOSH      1
                  -#define TT_PLATFORM_ISO            2 /* deprecated */
                  -#define TT_PLATFORM_MICROSOFT      3
                  -#define TT_PLATFORM_CUSTOM         4
                  -#define TT_PLATFORM_ADOBE          7 /* artificial */
                  -
                  -

                  -
                  -

                  A list of valid values for the ‘platform_id’ identifier code in FT_CharMapRec and FT_SfntName structures.

                  -

                  -
                  values
                  -

                  - - - - - - - - -
                  TT_PLATFORM_APPLE_UNICODE
                  -

                  Used by Apple to indicate a Unicode character map and/or name entry. See TT_APPLE_ID_XXX for corresponding ‘encoding_id’ values. Note that name entries in this format are coded as big-endian UCS-2 character codes only.

                  -
                  TT_PLATFORM_MACINTOSH -

                  Used by Apple to indicate a MacOS-specific charmap and/or name entry. See TT_MAC_ID_XXX for corresponding ‘encoding_id’ values. Note that most TrueType fonts contain an Apple roman charmap to be usable on MacOS systems (even if they contain a Microsoft charmap as well).

                  -
                  TT_PLATFORM_ISO -

                  This value was used to specify ISO/IEC 10646 charmaps. It is however now deprecated. See TT_ISO_ID_XXX for a list of corresponding ‘encoding_id’ values.

                  -
                  TT_PLATFORM_MICROSOFT -

                  Used by Microsoft to indicate Windows-specific charmaps. See TT_MS_ID_XXX for a list of corresponding ‘encoding_id’ values. Note that most fonts contain a Unicode charmap using (TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS).

                  -
                  TT_PLATFORM_CUSTOM -

                  Used to indicate application-specific charmaps.

                  -
                  TT_PLATFORM_ADOBE -

                  This value isn't part of any font format specification, but is used by FreeType to report Adobe-specific charmaps in an FT_CharMapRec structure. See TT_ADOBE_ID_XXX.

                  -
                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  TT_APPLE_ID_XXX

                  -
                  -Defined in FT_TRUETYPE_IDS_H (ttnameid.h). -

                  -
                  -
                  -#define TT_APPLE_ID_DEFAULT           0 /* Unicode 1.0 */
                  -#define TT_APPLE_ID_UNICODE_1_1       1 /* specify Hangul at U+34xx */
                  -#define TT_APPLE_ID_ISO_10646         2 /* deprecated */
                  -#define TT_APPLE_ID_UNICODE_2_0       3 /* or later */
                  -#define TT_APPLE_ID_UNICODE_32        4 /* 2.0 or later, full repertoire */
                  -#define TT_APPLE_ID_VARIANT_SELECTOR  5 /* variation selector data */
                  -
                  -

                  -
                  -

                  A list of valid values for the ‘encoding_id’ for TT_PLATFORM_APPLE_UNICODE charmaps and name entries.

                  -

                  -
                  values
                  -

                  - - - - - - - - - - +
                  TT_APPLE_ID_DEFAULT -

                  Unicode version 1.0.

                  -
                  TT_APPLE_ID_UNICODE_1_1
                  -

                  Unicode 1.1; specifies Hangul characters starting at U+34xx.

                  -
                  TT_APPLE_ID_ISO_10646 -

                  Deprecated (identical to preceding).

                  -
                  TT_APPLE_ID_UNICODE_2_0
                  -

                  Unicode 2.0 and beyond (UTF-16 BMP only).

                  -
                  TT_APPLE_ID_UNICODE_32 -

                  Unicode 3.1 and beyond, using UTF-32.

                  -
                  TT_APPLE_ID_VARIANT_SELECTOR
                  -

                  From Adobe, not Apple. Not a normal cmap. Specifies variations on a real cmap.

                  -
                  + + + + + + + + + + + +
                  TT_Header 
                  TT_HoriHeaderFT_Get_CMap_Language_ID
                  TT_VertHeaderFT_Get_CMap_Format
                  TT_OS2 
                  TT_PostscriptFT_PARAM_TAG_UNPATENTED_HINTING
                  TT_PCLT 
                  TT_MaxProfileTT_PLATFORM_XXX
                   TT_APPLE_ID_XXX
                  FT_Sfnt_TagTT_MAC_ID_XXX
                  FT_Get_Sfnt_TableTT_ISO_ID_XXX
                  FT_Load_Sfnt_TableTT_MS_ID_XXX
                  FT_Sfnt_Table_InfoTT_ADOBE_ID_XXX
                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  TT_MAC_ID_XXX

                  -
                  -Defined in FT_TRUETYPE_IDS_H (ttnameid.h). -

                  -
                  -
                  -#define TT_MAC_ID_ROMAN                 0
                  -#define TT_MAC_ID_JAPANESE              1
                  -#define TT_MAC_ID_TRADITIONAL_CHINESE   2
                  -#define TT_MAC_ID_KOREAN                3
                  -#define TT_MAC_ID_ARABIC                4
                  -#define TT_MAC_ID_HEBREW                5
                  -#define TT_MAC_ID_GREEK                 6
                  -#define TT_MAC_ID_RUSSIAN               7
                  -#define TT_MAC_ID_RSYMBOL               8
                  -#define TT_MAC_ID_DEVANAGARI            9
                  -#define TT_MAC_ID_GURMUKHI             10
                  -#define TT_MAC_ID_GUJARATI             11
                  -#define TT_MAC_ID_ORIYA                12
                  -#define TT_MAC_ID_BENGALI              13
                  -#define TT_MAC_ID_TAMIL                14
                  -#define TT_MAC_ID_TELUGU               15
                  -#define TT_MAC_ID_KANNADA              16
                  -#define TT_MAC_ID_MALAYALAM            17
                  -#define TT_MAC_ID_SINHALESE            18
                  -#define TT_MAC_ID_BURMESE              19
                  -#define TT_MAC_ID_KHMER                20
                  -#define TT_MAC_ID_THAI                 21
                  -#define TT_MAC_ID_LAOTIAN              22
                  -#define TT_MAC_ID_GEORGIAN             23
                  -#define TT_MAC_ID_ARMENIAN             24
                  -#define TT_MAC_ID_MALDIVIAN            25
                  -#define TT_MAC_ID_SIMPLIFIED_CHINESE   25
                  -#define TT_MAC_ID_TIBETAN              26
                  -#define TT_MAC_ID_MONGOLIAN            27
                  -#define TT_MAC_ID_GEEZ                 28
                  -#define TT_MAC_ID_SLAVIC               29
                  -#define TT_MAC_ID_VIETNAMESE           30
                  -#define TT_MAC_ID_SINDHI               31
                  -#define TT_MAC_ID_UNINTERP             32
                  -
                  -

                  -
                  -

                  A list of valid values for the ‘encoding_id’ for TT_PLATFORM_MACINTOSH charmaps and name entries.

                  -

                  -
                  values
                  -

                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                  TT_MAC_ID_ROMAN -

                  -
                  TT_MAC_ID_JAPANESE -

                  -
                  TT_MAC_ID_TRADITIONAL_CHINESE
                  -

                  -
                  TT_MAC_ID_KOREAN -

                  -
                  TT_MAC_ID_ARABIC -

                  -
                  TT_MAC_ID_HEBREW -

                  -
                  TT_MAC_ID_GREEK -

                  -
                  TT_MAC_ID_RUSSIAN -

                  -
                  TT_MAC_ID_RSYMBOL -

                  -
                  TT_MAC_ID_DEVANAGARI -

                  -
                  TT_MAC_ID_GURMUKHI -

                  -
                  TT_MAC_ID_GUJARATI -

                  -
                  TT_MAC_ID_ORIYA -

                  -
                  TT_MAC_ID_BENGALI -

                  -
                  TT_MAC_ID_TAMIL -

                  -
                  TT_MAC_ID_TELUGU -

                  -
                  TT_MAC_ID_KANNADA -

                  -
                  TT_MAC_ID_MALAYALAM -

                  -
                  TT_MAC_ID_SINHALESE -

                  -
                  TT_MAC_ID_BURMESE -

                  -
                  TT_MAC_ID_KHMER -

                  -
                  TT_MAC_ID_THAI -

                  -
                  TT_MAC_ID_LAOTIAN -

                  -
                  TT_MAC_ID_GEORGIAN -

                  -
                  TT_MAC_ID_ARMENIAN -

                  -
                  TT_MAC_ID_MALDIVIAN -

                  -
                  TT_MAC_ID_SIMPLIFIED_CHINESE
                  -

                  -
                  TT_MAC_ID_TIBETAN -

                  -
                  TT_MAC_ID_MONGOLIAN -

                  -
                  TT_MAC_ID_GEEZ -

                  -
                  TT_MAC_ID_SLAVIC -

                  -
                  TT_MAC_ID_VIETNAMESE -

                  -
                  TT_MAC_ID_SINDHI -

                  -
                  TT_MAC_ID_UNINTERP -

                  -
                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  TT_ISO_ID_XXX

                  -
                  -Defined in FT_TRUETYPE_IDS_H (ttnameid.h). -

                  -
                  -
                  -#define TT_ISO_ID_7BIT_ASCII  0
                  -#define TT_ISO_ID_10646       1
                  -#define TT_ISO_ID_8859_1      2
                  -
                  -

                  -
                  -

                  A list of valid values for the ‘encoding_id’ for TT_PLATFORM_ISO charmaps and name entries.

                  -

                  Their use is now deprecated.

                  -

                  -
                  values
                  -

                  - - - - -
                  TT_ISO_ID_7BIT_ASCII -

                  ASCII.

                  -
                  TT_ISO_ID_10646 -

                  ISO/10646.

                  -
                  TT_ISO_ID_8859_1 -

                  Also known as Latin-1.

                  -
                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  TT_MS_ID_XXX

                  -
                  -Defined in FT_TRUETYPE_IDS_H (ttnameid.h). -

                  -
                  -
                  -#define TT_MS_ID_SYMBOL_CS    0
                  -#define TT_MS_ID_UNICODE_CS   1
                  -#define TT_MS_ID_SJIS         2
                  -#define TT_MS_ID_GB2312       3
                  -#define TT_MS_ID_BIG_5        4
                  -#define TT_MS_ID_WANSUNG      5
                  -#define TT_MS_ID_JOHAB        6
                  -#define TT_MS_ID_UCS_4       10
                  -
                  -

                  -
                  -

                  A list of valid values for the ‘encoding_id’ for TT_PLATFORM_MICROSOFT charmaps and name entries.

                  -

                  -
                  values
                  -

                  - - - - - - - - - -
                  TT_MS_ID_SYMBOL_CS -

                  Corresponds to Microsoft symbol encoding. See FT_ENCODING_MS_SYMBOL.

                  -
                  TT_MS_ID_UNICODE_CS -

                  Corresponds to a Microsoft WGL4 charmap, matching Unicode. See FT_ENCODING_UNICODE.

                  -
                  TT_MS_ID_SJIS -

                  Corresponds to SJIS Japanese encoding. See FT_ENCODING_SJIS.

                  -
                  TT_MS_ID_GB2312 -

                  Corresponds to Simplified Chinese as used in Mainland China. See FT_ENCODING_GB2312.

                  -
                  TT_MS_ID_BIG_5 -

                  Corresponds to Traditional Chinese as used in Taiwan and Hong Kong. See FT_ENCODING_BIG5.

                  -
                  TT_MS_ID_WANSUNG -

                  Corresponds to Korean Wansung encoding. See FT_ENCODING_WANSUNG.

                  -
                  TT_MS_ID_JOHAB -

                  Corresponds to Johab encoding. See FT_ENCODING_JOHAB.

                  -
                  TT_MS_ID_UCS_4 -

                  Corresponds to UCS-4 or UTF-32 charmaps. This has been added to the OpenType specification version 1.4 (mid-2001.)

                  -
                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  TT_ADOBE_ID_XXX

                  -
                  -Defined in FT_TRUETYPE_IDS_H (ttnameid.h). -

                  -
                  -
                  -#define TT_ADOBE_ID_STANDARD  0
                  -#define TT_ADOBE_ID_EXPERT    1
                  -#define TT_ADOBE_ID_CUSTOM    2
                  -#define TT_ADOBE_ID_LATIN_1   3
                  -
                  -

                  -
                  -

                  A list of valid values for the ‘encoding_id’ for TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension!

                  -

                  -
                  values
                  -

                  - - - - - -
                  TT_ADOBE_ID_STANDARD -

                  Adobe standard encoding.

                  -
                  TT_ADOBE_ID_EXPERT -

                  Adobe expert encoding.

                  -
                  TT_ADOBE_ID_CUSTOM -

                  Adobe custom encoding.

                  -
                  TT_ADOBE_ID_LATIN_1 -

                  Adobe Latin 1 encoding.

                  -
                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  TT_Header

                  -
                  -Defined in FT_TRUETYPE_TABLES_H (tttables.h). -

                  -
                   
                  +
                  +

                  This section contains the definition of TrueType-specific tables as well as some routines used to access and process them.

                  + +
                  +

                  TT_Header

                  +

                  Defined in FT_TRUETYPE_TABLES_H (tttables.h).

                  +
                     typedef struct  TT_Header_
                     {
                       FT_Fixed   Table_Version;
                  @@ -480,24 +153,17 @@ Defined in FT_TRUETYPE_TABLES_H (tttables.h).
                       FT_Short   Glyph_Data_Format;
                   
                     } TT_Header;
                  +
                  -

                  -

                  A structure used to model a TrueType font header table. All fields follow the TrueType specification.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  TT_HoriHeader

                  -
                  -Defined in FT_TRUETYPE_TABLES_H (tttables.h). -

                  -
                   
                  +
                  + + +
                  +

                  TT_HoriHeader

                  +

                  Defined in FT_TRUETYPE_TABLES_H (tttables.h).

                  +
                     typedef struct  TT_HoriHeader_
                     {
                       FT_Fixed   Version;
                  @@ -527,82 +193,74 @@ Defined in FT_TRUETYPE_TABLES_H (tttables.h).
                       void*      short_metrics;
                   
                     } TT_HoriHeader;
                  +
                  -

                  -

                  A structure used to model a TrueType horizontal header, the ‘hhea’ table, as well as the corresponding horizontal metrics table, i.e., the ‘hmtx’ table.

                  -

                  -
                  fields
                  -

                  - -
                  Version + +

                  fields

                  + + - - - - - - - - - - - - - -
                  Version

                  The table version.

                  Ascender +
                  Ascender

                  The font's ascender, i.e., the distance from the baseline to the top-most of all glyph points found in the font.

                  This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII).

                  You should use the ‘sTypoAscender’ field of the OS/2 table instead if you want the correct one.

                  Descender +
                  Descender

                  The font's descender, i.e., the distance from the baseline to the bottom-most of all glyph points found in the font. It is negative.

                  This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII).

                  You should use the ‘sTypoDescender’ field of the OS/2 table instead if you want the correct one.

                  Line_Gap +
                  Line_Gap

                  The font's line gap, i.e., the distance to add to the ascender and descender to get the BTB, i.e., the baseline-to-baseline distance for the font.

                  advance_Width_Max +
                  advance_Width_Max

                  This field is the maximum of all advance widths found in the font. It can be used to compute the maximum width of an arbitrary string of text.

                  min_Left_Side_Bearing +
                  min_Left_Side_Bearing

                  The minimum left side bearing of all glyphs within the font.

                  min_Right_Side_Bearing +
                  min_Right_Side_Bearing

                  The minimum right side bearing of all glyphs within the font.

                  xMax_Extent +
                  xMax_Extent

                  The maximum horizontal extent (i.e., the ‘width’ of a glyph's bounding box) for all glyphs in the font.

                  caret_Slope_Rise +
                  caret_Slope_Rise

                  The rise coefficient of the cursor's slope of the cursor (slope=rise/run).

                  caret_Slope_Run +
                  caret_Slope_Run

                  The run coefficient of the cursor's slope.

                  Reserved +
                  Reserved

                  8 reserved bytes.

                  metric_Data_Format +
                  metric_Data_Format

                  Always 0.

                  number_Of_HMetrics +
                  number_Of_HMetrics

                  Number of HMetrics entries in the ‘hmtx’ table -- this value can be smaller than the total number of glyphs in the font.

                  long_metrics +
                  long_metrics

                  A pointer into the ‘hmtx’ table.

                  short_metrics +
                  short_metrics

                  A pointer into the ‘hmtx’ table.

                  -
                  -
                  note
                  + +

                  note

                  IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should be identical except for the names of their fields, which are different.

                  This ensures that a single function in the ‘ttload’ module is able to read both the horizontal and vertical headers.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  TT_VertHeader

                  -
                  -Defined in FT_TRUETYPE_TABLES_H (tttables.h). -

                  -
                   
                  +
                  + + +
                  +

                  TT_VertHeader

                  +

                  Defined in FT_TRUETYPE_TABLES_H (tttables.h).

                  +
                     typedef struct  TT_VertHeader_
                     {
                       FT_Fixed   Version;
                  @@ -632,86 +290,77 @@ Defined in FT_TRUETYPE_TABLES_H (tttables.h).
                       void*      short_metrics;
                   
                     } TT_VertHeader;
                  +
                  -

                  -

                  A structure used to model a TrueType vertical header, the ‘vhea’ table, as well as the corresponding vertical metrics table, i.e., the ‘vmtx’ table.

                  -

                  -
                  fields
                  -

                  - -
                  Version + +

                  fields

                  + + - - - - - - - - - - - - - - - -
                  Version

                  The table version.

                  Ascender +
                  Ascender

                  The font's ascender, i.e., the distance from the baseline to the top-most of all glyph points found in the font.

                  This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII).

                  You should use the ‘sTypoAscender’ field of the OS/2 table instead if you want the correct one.

                  Descender +
                  Descender

                  The font's descender, i.e., the distance from the baseline to the bottom-most of all glyph points found in the font. It is negative.

                  This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII).

                  You should use the ‘sTypoDescender’ field of the OS/2 table instead if you want the correct one.

                  Line_Gap +
                  Line_Gap

                  The font's line gap, i.e., the distance to add to the ascender and descender to get the BTB, i.e., the baseline-to-baseline distance for the font.

                  advance_Height_Max +
                  advance_Height_Max

                  This field is the maximum of all advance heights found in the font. It can be used to compute the maximum height of an arbitrary string of text.

                  min_Top_Side_Bearing +
                  min_Top_Side_Bearing

                  The minimum top side bearing of all glyphs within the font.

                  min_Bottom_Side_Bearing
                  +
                  min_Bottom_Side_Bearing

                  The minimum bottom side bearing of all glyphs within the font.

                  yMax_Extent +
                  yMax_Extent

                  The maximum vertical extent (i.e., the ‘height’ of a glyph's bounding box) for all glyphs in the font.

                  caret_Slope_Rise +
                  caret_Slope_Rise

                  The rise coefficient of the cursor's slope of the cursor (slope=rise/run).

                  caret_Slope_Run +
                  caret_Slope_Run

                  The run coefficient of the cursor's slope.

                  caret_Offset +
                  caret_Offset

                  The cursor's offset for slanted fonts. This value is ‘reserved’ in vmtx version 1.0.

                  Reserved +
                  Reserved

                  8 reserved bytes.

                  metric_Data_Format +
                  metric_Data_Format

                  Always 0.

                  number_Of_HMetrics +
                  number_Of_HMetrics

                  Number of VMetrics entries in the ‘vmtx’ table -- this value can be smaller than the total number of glyphs in the font.

                  long_metrics +
                  long_metrics

                  A pointer into the ‘vmtx’ table.

                  short_metrics +
                  short_metrics

                  A pointer into the ‘vmtx’ table.

                  -
                  -
                  note
                  + +

                  note

                  IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should be identical except for the names of their fields, which are different.

                  This ensures that a single function in the ‘ttload’ module is able to read both the horizontal and vertical headers.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  TT_OS2

                  -
                  -Defined in FT_TRUETYPE_TABLES_H (tttables.h). -

                  -
                   
                  +
                  + + +
                  +

                  TT_OS2

                  +

                  Defined in FT_TRUETYPE_TABLES_H (tttables.h).

                  +
                     typedef struct  TT_OS2_
                     {
                       FT_UShort  version;                /* 0x0001 - more or 0xFFFF */
                  @@ -768,25 +417,18 @@ Defined in FT_TRUETYPE_TABLES_H (tttables.h).
                       FT_UShort  usUpperOpticalPointSize;       /* in twips (1/20th points) */
                   
                     } TT_OS2;
                  +
                  -

                  -

                  A structure used to model a TrueType OS/2 table. All fields comply to the OpenType specification.

                  Note that we now support old Mac fonts that do not include an OS/2 table. In this case, the ‘version’ field is always set to 0xFFFF.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  TT_Postscript

                  -
                  -Defined in FT_TRUETYPE_TABLES_H (tttables.h). -

                  -
                   
                  +
                  + + +
                  +

                  TT_Postscript

                  +

                  Defined in FT_TRUETYPE_TABLES_H (tttables.h).

                  +
                     typedef struct  TT_Postscript_
                     {
                       FT_Fixed  FormatType;
                  @@ -803,24 +445,17 @@ Defined in FT_TRUETYPE_TABLES_H (tttables.h).
                       /* load them by default.  See the ttpost.c file.  */
                   
                     } TT_Postscript;
                  +
                  -

                  -

                  A structure used to model a TrueType PostScript table. All fields comply to the TrueType specification. This structure does not reference the PostScript glyph names, which can be nevertheless accessed with the ‘ttpost’ module.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  TT_PCLT

                  -
                  -Defined in FT_TRUETYPE_TABLES_H (tttables.h). -

                  -
                   
                  +
                  + + +
                  +

                  TT_PCLT

                  +

                  Defined in FT_TRUETYPE_TABLES_H (tttables.h).

                  +
                     typedef struct  TT_PCLT_
                     {
                       FT_Fixed   Version;
                  @@ -840,24 +475,17 @@ Defined in FT_TRUETYPE_TABLES_H (tttables.h).
                       FT_Byte    Reserved;
                   
                     } TT_PCLT;
                  +
                  -

                  -

                  A structure used to model a TrueType PCLT table. All fields comply to the TrueType specification.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  TT_MaxProfile

                  -
                  -Defined in FT_TRUETYPE_TABLES_H (tttables.h). -

                  -
                   
                  +
                  + + +
                  +

                  TT_MaxProfile

                  +

                  Defined in FT_TRUETYPE_TABLES_H (tttables.h).

                  +
                     typedef struct  TT_MaxProfile_
                     {
                       FT_Fixed   version;
                  @@ -877,132 +505,150 @@ Defined in FT_TRUETYPE_TABLES_H (tttables.h).
                       FT_UShort  maxComponentDepth;
                   
                     } TT_MaxProfile;
                  +
                  -

                  -

                  The maximum profile is a table containing many max values, which can be used to pre-allocate arrays. This ensures that no memory allocation occurs during a glyph load.

                  -

                  -
                  fields
                  -

                  - -
                  version + +

                  fields

                  + + - - - - - - - - - - - - - -
                  version

                  The version number.

                  numGlyphs +
                  numGlyphs

                  The number of glyphs in this TrueType font.

                  maxPoints +
                  maxPoints

                  The maximum number of points in a non-composite TrueType glyph. See also the structure element ‘maxCompositePoints’.

                  maxContours +
                  maxContours

                  The maximum number of contours in a non-composite TrueType glyph. See also the structure element ‘maxCompositeContours’.

                  maxCompositePoints +
                  maxCompositePoints

                  The maximum number of points in a composite TrueType glyph. See also the structure element ‘maxPoints’.

                  maxCompositeContours +
                  maxCompositeContours

                  The maximum number of contours in a composite TrueType glyph. See also the structure element ‘maxContours’.

                  maxZones +
                  maxZones

                  The maximum number of zones used for glyph hinting.

                  maxTwilightPoints +
                  maxTwilightPoints

                  The maximum number of points in the twilight zone used for glyph hinting.

                  maxStorage +
                  maxStorage

                  The maximum number of elements in the storage area used for glyph hinting.

                  maxFunctionDefs +
                  maxFunctionDefs

                  The maximum number of function definitions in the TrueType bytecode for this font.

                  maxInstructionDefs +
                  maxInstructionDefs

                  The maximum number of instruction definitions in the TrueType bytecode for this font.

                  maxStackElements +
                  maxStackElements

                  The maximum number of stack elements used during bytecode interpretation.

                  maxSizeOfInstructions +
                  maxSizeOfInstructions

                  The maximum number of TrueType opcodes used for glyph hinting.

                  maxComponentElements +
                  maxComponentElements

                  The maximum number of simple (i.e., non- composite) glyphs in a composite glyph.

                  maxComponentDepth +
                  maxComponentDepth

                  The maximum nesting depth of composite glyphs.

                  -
                  -
                  note
                  + +

                  note

                  This structure is only used during font loading.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Sfnt_Tag

                  -
                  -Defined in FT_TRUETYPE_TABLES_H (tttables.h). -

                  -
                   
                  +
                  + + +
                  +

                  FT_Sfnt_Tag

                  +

                  Defined in FT_TRUETYPE_TABLES_H (tttables.h).

                  +
                     typedef enum  FT_Sfnt_Tag_
                     {
                  -    ft_sfnt_head = 0,    /* TT_Header     */
                  -    ft_sfnt_maxp = 1,    /* TT_MaxProfile */
                  -    ft_sfnt_os2  = 2,    /* TT_OS2        */
                  -    ft_sfnt_hhea = 3,    /* TT_HoriHeader */
                  -    ft_sfnt_vhea = 4,    /* TT_VertHeader */
                  -    ft_sfnt_post = 5,    /* TT_Postscript */
                  -    ft_sfnt_pclt = 6,    /* TT_PCLT       */
                  +    FT_SFNT_HEAD,
                  +    FT_SFNT_MAXP,
                  +    FT_SFNT_OS2,
                  +    FT_SFNT_HHEA,
                  +    FT_SFNT_VHEA,
                  +    FT_SFNT_POST,
                  +    FT_SFNT_PCLT,
                   
                  -    sfnt_max   /* internal end mark */
                  +    FT_SFNT_MAX
                   
                     } FT_Sfnt_Tag;
                   
                  -

                  -
                  + /* these constants are deprecated; use the corresponding `FT_Sfnt_Tag' */ + /* values instead */ +#define ft_sfnt_head FT_SFNT_HEAD +#define ft_sfnt_maxp FT_SFNT_MAXP +#define ft_sfnt_os2 FT_SFNT_OS2 +#define ft_sfnt_hhea FT_SFNT_HHEA +#define ft_sfnt_vhea FT_SFNT_VHEA +#define ft_sfnt_post FT_SFNT_POST +#define ft_sfnt_pclt FT_SFNT_PCLT + +

                  An enumeration used to specify the index of an SFNT table. Used in the FT_Get_Sfnt_Table API function.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Get_Sfnt_Table

                  -
                  -Defined in FT_TRUETYPE_TABLES_H (tttables.h). -

                  -
                   
                  +

                  values

                  + + + + + + + + +
                  FT_SFNT_HEAD +

                  To access the font's TT_Header structure.

                  +
                  FT_SFNT_MAXP +

                  To access the font's TT_MaxProfile structure.

                  +
                  FT_SFNT_OS2 +

                  To access the font's TT_OS2 structure.

                  +
                  FT_SFNT_HHEA +

                  To access the font's TT_HoriHeader structure.

                  +
                  FT_SFNT_VHEA +

                  To access the font's TT_VertHeader struture.

                  +
                  FT_SFNT_POST +

                  To access the font's TT_Postscript structure.

                  +
                  FT_SFNT_PCLT +

                  To access the font's TT_PCLT structure.

                  +
                  + +
                  + + +
                  +

                  FT_Get_Sfnt_Table

                  +

                  Defined in FT_TRUETYPE_TABLES_H (tttables.h).

                  +
                     FT_EXPORT( void* )
                     FT_Get_Sfnt_Table( FT_Face      face,
                                        FT_Sfnt_Tag  tag );
                  +
                  -

                  -

                  Return a pointer to a given SFNT table within a face.

                  -

                  -
                  input
                  -

                  - -
                  face + +

                  input

                  + + -
                  face

                  A handle to the source.

                  tag +
                  tag

                  The index of the SFNT table.

                  -
                  -
                  return
                  + +

                  return

                  A type-less pointer to the table. This will be 0 in case of error, or if the corresponding table was not found OR loaded from the file.

                  Use a typecast according to ‘tag’ to access the structure elements.

                  -
                  -
                  note
                  + +

                  note

                  The table is owned by the face object and disappears with it.

                  This function is only useful to access SFNT tables that are loaded by the sfnt, truetype, and opentype drivers. See FT_Sfnt_Tag for a list.

                  Here an example how to access the ‘vhea’ table:

                  @@ -1011,69 +657,59 @@ Defined in FT_TRUETYPE_TABLES_H (tttables.h). vert_header = - (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea ); + (TT_VertHeader*)FT_Get_Sfnt_Table( face, FT_SFNT_VHEA ); -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Load_Sfnt_Table

                  -
                  -Defined in FT_TRUETYPE_TABLES_H (tttables.h). -

                  -
                   
                  +
                  + + +
                  +

                  FT_Load_Sfnt_Table

                  +

                  Defined in FT_TRUETYPE_TABLES_H (tttables.h).

                  +
                     FT_EXPORT( FT_Error )
                     FT_Load_Sfnt_Table( FT_Face    face,
                                         FT_ULong   tag,
                                         FT_Long    offset,
                                         FT_Byte*   buffer,
                                         FT_ULong*  length );
                  +
                  -

                  -

                  Load any font table into client memory.

                  -

                  -
                  input
                  -

                  - -
                  face + +

                  input

                  + + - -
                  face

                  A handle to the source face.

                  tag +
                  tag

                  The four-byte tag of the table to load. Use the value 0 if you want to access the whole font file. Otherwise, you can use one of the definitions found in the FT_TRUETYPE_TAGS_H file, or forge a new one with FT_MAKE_TAG.

                  offset +
                  offset

                  The starting offset in the table (or file if tag == 0).

                  -
                  -
                  output
                  -

                  - -
                  buffer + +

                  output

                  + +
                  buffer

                  The target buffer address. The client must ensure that the memory array is big enough to hold the data.

                  -
                  -
                  inout
                  -

                  - -
                  length + +

                  inout

                  + +
                  length

                  If the ‘length’ parameter is NULL, then try to load the whole table. Return an error code if it fails.

                  Else, if ‘*length’ is 0, exit immediately while returning the table's (or file) full size in it.

                  Else the number of bytes to read from the table or file, from the starting offset.

                  -
                  -
                  return
                  + +

                  return

                  FreeType error code. 0 means success.

                  -
                  -
                  note
                  + +

                  note

                  If you need to determine the table's length you should first call this function with ‘*length’ set to 0, as in the following example:

                     FT_ULong  length = 0;
                  @@ -1089,150 +725,449 @@ Defined in FT_TRUETYPE_TABLES_H (tttables.h).
                     if ( error ) { ... could not load table ... }
                   

                  Note that structures like TT_Header or TT_OS2 can't be used with this function; they are limited to FT_Get_Sfnt_Table. Reason is that those structures depend on the processor architecture, with varying size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian).

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Sfnt_Table_Info

                  -
                  -Defined in FT_TRUETYPE_TABLES_H (tttables.h). -

                  -
                   
                  +
                  + + +
                  +

                  FT_Sfnt_Table_Info

                  +

                  Defined in FT_TRUETYPE_TABLES_H (tttables.h).

                  +
                     FT_EXPORT( FT_Error )
                     FT_Sfnt_Table_Info( FT_Face    face,
                                         FT_UInt    table_index,
                                         FT_ULong  *tag,
                                         FT_ULong  *length );
                  +
                  -

                  -

                  Return information on an SFNT table.

                  -

                  -
                  input
                  -

                  - -
                  face + +

                  input

                  + + -
                  face

                  A handle to the source face.

                  table_index +
                  table_index

                  The index of an SFNT table. The function returns FT_Err_Table_Missing for an invalid value.

                  -
                  -
                  inout
                  -

                  - -
                  tag + +

                  inout

                  + +
                  tag

                  The name tag of the SFNT table. If the value is NULL, ‘table_index’ is ignored, and ‘length’ returns the number of SFNT tables in the font.

                  -
                  -
                  output
                  -

                  - -
                  length + +

                  output

                  + +
                  length

                  The length of the SFNT table (or the number of SFNT tables, depending on ‘tag’).

                  -
                  -
                  return
                  + +

                  return

                  FreeType error code. 0 means success.

                  -
                  -
                  note
                  + +

                  note

                  While parsing fonts, FreeType handles SFNT tables with length zero as missing.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Get_CMap_Language_ID

                  -
                  -Defined in FT_TRUETYPE_TABLES_H (tttables.h). -

                  -
                   
                  +
                  + + +
                  +

                  FT_Get_CMap_Language_ID

                  +

                  Defined in FT_TRUETYPE_TABLES_H (tttables.h).

                  +
                     FT_EXPORT( FT_ULong )
                     FT_Get_CMap_Language_ID( FT_CharMap  charmap );
                  +
                  -

                  -

                  Return TrueType/sfnt specific cmap language ID. Definitions of language ID values are in ‘ttnameid.h’.

                  -

                  -
                  input
                  -

                  - -
                  charmap + +

                  input

                  + +
                  charmap

                  The target charmap.

                  -
                  -
                  return
                  + +

                  return

                  The language ID of ‘charmap’. If ‘charmap’ doesn't belong to a TrueType/sfnt face, just return 0 as the default value.

                  For a format 14 cmap (to access Unicode IVS), the return value is 0xFFFFFFFF.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Get_CMap_Format

                  -
                  -Defined in FT_TRUETYPE_TABLES_H (tttables.h). -

                  -
                   
                  +
                  + + +
                  +

                  FT_Get_CMap_Format

                  +

                  Defined in FT_TRUETYPE_TABLES_H (tttables.h).

                  +
                     FT_EXPORT( FT_Long )
                     FT_Get_CMap_Format( FT_CharMap  charmap );
                  +
                  -

                  -

                  Return TrueType/sfnt specific cmap format.

                  -

                  -
                  input
                  -

                  - -
                  charmap + +

                  input

                  + +
                  charmap

                  The target charmap.

                  -
                  -
                  return
                  + +

                  return

                  The format of ‘charmap’. If ‘charmap’ doesn't belong to a TrueType/sfnt face, return -1.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_PARAM_TAG_UNPATENTED_HINTING

                  -
                  -Defined in FT_UNPATENTED_HINTING_H (ttunpat.h). -

                  -
                   
                  +
                  + + +
                  +

                  FT_PARAM_TAG_UNPATENTED_HINTING

                  +

                  Defined in FT_UNPATENTED_HINTING_H (ttunpat.h).

                  +
                   #define FT_PARAM_TAG_UNPATENTED_HINTING  FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
                  +
                  -

                  -

                  A constant used as the tag of an FT_Parameter structure to indicate that unpatented methods only should be used by the TrueType bytecode interpreter for a typeface opened by FT_Open_Face.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  + +
                  + + +
                  +

                  TT_PLATFORM_XXX

                  +

                  Defined in FT_TRUETYPE_IDS_H (ttnameid.h).

                  +
                  +#define TT_PLATFORM_APPLE_UNICODE  0
                  +#define TT_PLATFORM_MACINTOSH      1
                  +#define TT_PLATFORM_ISO            2 /* deprecated */
                  +#define TT_PLATFORM_MICROSOFT      3
                  +#define TT_PLATFORM_CUSTOM         4
                  +#define TT_PLATFORM_ADOBE          7 /* artificial */
                  +
                  + +

                  A list of valid values for the ‘platform_id’ identifier code in FT_CharMapRec and FT_SfntName structures.

                  + +

                  values

                  + + + + + + + +
                  TT_PLATFORM_APPLE_UNICODE +

                  Used by Apple to indicate a Unicode character map and/or name entry. See TT_APPLE_ID_XXX for corresponding ‘encoding_id’ values. Note that name entries in this format are coded as big-endian UCS-2 character codes only.

                  +
                  TT_PLATFORM_MACINTOSH +

                  Used by Apple to indicate a MacOS-specific charmap and/or name entry. See TT_MAC_ID_XXX for corresponding ‘encoding_id’ values. Note that most TrueType fonts contain an Apple roman charmap to be usable on MacOS systems (even if they contain a Microsoft charmap as well).

                  +
                  TT_PLATFORM_ISO +

                  This value was used to specify ISO/IEC 10646 charmaps. It is however now deprecated. See TT_ISO_ID_XXX for a list of corresponding ‘encoding_id’ values.

                  +
                  TT_PLATFORM_MICROSOFT +

                  Used by Microsoft to indicate Windows-specific charmaps. See TT_MS_ID_XXX for a list of corresponding ‘encoding_id’ values. Note that most fonts contain a Unicode charmap using (TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS).

                  +
                  TT_PLATFORM_CUSTOM +

                  Used to indicate application-specific charmaps.

                  +
                  TT_PLATFORM_ADOBE +

                  This value isn't part of any font format specification, but is used by FreeType to report Adobe-specific charmaps in an FT_CharMapRec structure. See TT_ADOBE_ID_XXX.

                  +
                  + +
                  +
                  + +
                  +

                  TT_APPLE_ID_XXX

                  +

                  Defined in FT_TRUETYPE_IDS_H (ttnameid.h).

                  +
                  +#define TT_APPLE_ID_DEFAULT           0 /* Unicode 1.0 */
                  +#define TT_APPLE_ID_UNICODE_1_1       1 /* specify Hangul at U+34xx */
                  +#define TT_APPLE_ID_ISO_10646         2 /* deprecated */
                  +#define TT_APPLE_ID_UNICODE_2_0       3 /* or later */
                  +#define TT_APPLE_ID_UNICODE_32        4 /* 2.0 or later, full repertoire */
                  +#define TT_APPLE_ID_VARIANT_SELECTOR  5 /* variation selector data */
                  +
                  + +

                  A list of valid values for the ‘encoding_id’ for TT_PLATFORM_APPLE_UNICODE charmaps and name entries.

                  + +

                  values

                  + + + + + + + +
                  TT_APPLE_ID_DEFAULT +

                  Unicode version 1.0.

                  +
                  TT_APPLE_ID_UNICODE_1_1 +

                  Unicode 1.1; specifies Hangul characters starting at U+34xx.

                  +
                  TT_APPLE_ID_ISO_10646 +

                  Deprecated (identical to preceding).

                  +
                  TT_APPLE_ID_UNICODE_2_0 +

                  Unicode 2.0 and beyond (UTF-16 BMP only).

                  +
                  TT_APPLE_ID_UNICODE_32 +

                  Unicode 3.1 and beyond, using UTF-32.

                  +
                  TT_APPLE_ID_VARIANT_SELECTOR +

                  From Adobe, not Apple. Not a normal cmap. Specifies variations on a real cmap.

                  +
                  + +
                  +
                  + +
                  +

                  TT_MAC_ID_XXX

                  +

                  Defined in FT_TRUETYPE_IDS_H (ttnameid.h).

                  +
                  +#define TT_MAC_ID_ROMAN                 0
                  +#define TT_MAC_ID_JAPANESE              1
                  +#define TT_MAC_ID_TRADITIONAL_CHINESE   2
                  +#define TT_MAC_ID_KOREAN                3
                  +#define TT_MAC_ID_ARABIC                4
                  +#define TT_MAC_ID_HEBREW                5
                  +#define TT_MAC_ID_GREEK                 6
                  +#define TT_MAC_ID_RUSSIAN               7
                  +#define TT_MAC_ID_RSYMBOL               8
                  +#define TT_MAC_ID_DEVANAGARI            9
                  +#define TT_MAC_ID_GURMUKHI             10
                  +#define TT_MAC_ID_GUJARATI             11
                  +#define TT_MAC_ID_ORIYA                12
                  +#define TT_MAC_ID_BENGALI              13
                  +#define TT_MAC_ID_TAMIL                14
                  +#define TT_MAC_ID_TELUGU               15
                  +#define TT_MAC_ID_KANNADA              16
                  +#define TT_MAC_ID_MALAYALAM            17
                  +#define TT_MAC_ID_SINHALESE            18
                  +#define TT_MAC_ID_BURMESE              19
                  +#define TT_MAC_ID_KHMER                20
                  +#define TT_MAC_ID_THAI                 21
                  +#define TT_MAC_ID_LAOTIAN              22
                  +#define TT_MAC_ID_GEORGIAN             23
                  +#define TT_MAC_ID_ARMENIAN             24
                  +#define TT_MAC_ID_MALDIVIAN            25
                  +#define TT_MAC_ID_SIMPLIFIED_CHINESE   25
                  +#define TT_MAC_ID_TIBETAN              26
                  +#define TT_MAC_ID_MONGOLIAN            27
                  +#define TT_MAC_ID_GEEZ                 28
                  +#define TT_MAC_ID_SLAVIC               29
                  +#define TT_MAC_ID_VIETNAMESE           30
                  +#define TT_MAC_ID_SINDHI               31
                  +#define TT_MAC_ID_UNINTERP             32
                  +
                  + +

                  A list of valid values for the ‘encoding_id’ for TT_PLATFORM_MACINTOSH charmaps and name entries.

                  + +

                  values

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  TT_MAC_ID_ROMAN +

                  +
                  TT_MAC_ID_JAPANESE +

                  +
                  TT_MAC_ID_TRADITIONAL_CHINESE +

                  +
                  TT_MAC_ID_KOREAN +

                  +
                  TT_MAC_ID_ARABIC +

                  +
                  TT_MAC_ID_HEBREW +

                  +
                  TT_MAC_ID_GREEK +

                  +
                  TT_MAC_ID_RUSSIAN +

                  +
                  TT_MAC_ID_RSYMBOL +

                  +
                  TT_MAC_ID_DEVANAGARI +

                  +
                  TT_MAC_ID_GURMUKHI +

                  +
                  TT_MAC_ID_GUJARATI +

                  +
                  TT_MAC_ID_ORIYA +

                  +
                  TT_MAC_ID_BENGALI +

                  +
                  TT_MAC_ID_TAMIL +

                  +
                  TT_MAC_ID_TELUGU +

                  +
                  TT_MAC_ID_KANNADA +

                  +
                  TT_MAC_ID_MALAYALAM +

                  +
                  TT_MAC_ID_SINHALESE +

                  +
                  TT_MAC_ID_BURMESE +

                  +
                  TT_MAC_ID_KHMER +

                  +
                  TT_MAC_ID_THAI +

                  +
                  TT_MAC_ID_LAOTIAN +

                  +
                  TT_MAC_ID_GEORGIAN +

                  +
                  TT_MAC_ID_ARMENIAN +

                  +
                  TT_MAC_ID_MALDIVIAN +

                  +
                  TT_MAC_ID_SIMPLIFIED_CHINESE +

                  +
                  TT_MAC_ID_TIBETAN +

                  +
                  TT_MAC_ID_MONGOLIAN +

                  +
                  TT_MAC_ID_GEEZ +

                  +
                  TT_MAC_ID_SLAVIC +

                  +
                  TT_MAC_ID_VIETNAMESE +

                  +
                  TT_MAC_ID_SINDHI +

                  +
                  TT_MAC_ID_UNINTERP +

                  +
                  + +
                  +
                  + +
                  +

                  TT_ISO_ID_XXX

                  +

                  Defined in FT_TRUETYPE_IDS_H (ttnameid.h).

                  +
                  +#define TT_ISO_ID_7BIT_ASCII  0
                  +#define TT_ISO_ID_10646       1
                  +#define TT_ISO_ID_8859_1      2
                  +
                  + +

                  A list of valid values for the ‘encoding_id’ for TT_PLATFORM_ISO charmaps and name entries.

                  +

                  Their use is now deprecated.

                  + +

                  values

                  + + + + +
                  TT_ISO_ID_7BIT_ASCII +

                  ASCII.

                  +
                  TT_ISO_ID_10646 +

                  ISO/10646.

                  +
                  TT_ISO_ID_8859_1 +

                  Also known as Latin-1.

                  +
                  + +
                  +
                  + +
                  +

                  TT_MS_ID_XXX

                  +

                  Defined in FT_TRUETYPE_IDS_H (ttnameid.h).

                  +
                  +#define TT_MS_ID_SYMBOL_CS    0
                  +#define TT_MS_ID_UNICODE_CS   1
                  +#define TT_MS_ID_SJIS         2
                  +#define TT_MS_ID_GB2312       3
                  +#define TT_MS_ID_BIG_5        4
                  +#define TT_MS_ID_WANSUNG      5
                  +#define TT_MS_ID_JOHAB        6
                  +#define TT_MS_ID_UCS_4       10
                  +
                  + +

                  A list of valid values for the ‘encoding_id’ for TT_PLATFORM_MICROSOFT charmaps and name entries.

                  + +

                  values

                  + + + + + + + + + +
                  TT_MS_ID_SYMBOL_CS +

                  Corresponds to Microsoft symbol encoding. See FT_ENCODING_MS_SYMBOL.

                  +
                  TT_MS_ID_UNICODE_CS +

                  Corresponds to a Microsoft WGL4 charmap, matching Unicode. See FT_ENCODING_UNICODE.

                  +
                  TT_MS_ID_SJIS +

                  Corresponds to SJIS Japanese encoding. See FT_ENCODING_SJIS.

                  +
                  TT_MS_ID_GB2312 +

                  Corresponds to Simplified Chinese as used in Mainland China. See FT_ENCODING_GB2312.

                  +
                  TT_MS_ID_BIG_5 +

                  Corresponds to Traditional Chinese as used in Taiwan and Hong Kong. See FT_ENCODING_BIG5.

                  +
                  TT_MS_ID_WANSUNG +

                  Corresponds to Korean Wansung encoding. See FT_ENCODING_WANSUNG.

                  +
                  TT_MS_ID_JOHAB +

                  Corresponds to Johab encoding. See FT_ENCODING_JOHAB.

                  +
                  TT_MS_ID_UCS_4 +

                  Corresponds to UCS-4 or UTF-32 charmaps. This has been added to the OpenType specification version 1.4 (mid-2001.)

                  +
                  + +
                  +
                  + +
                  +

                  TT_ADOBE_ID_XXX

                  +

                  Defined in FT_TRUETYPE_IDS_H (ttnameid.h).

                  +
                  +#define TT_ADOBE_ID_STANDARD  0
                  +#define TT_ADOBE_ID_EXPERT    1
                  +#define TT_ADOBE_ID_CUSTOM    2
                  +#define TT_ADOBE_ID_LATIN_1   3
                  +
                  + +

                  A list of valid values for the ‘encoding_id’ for TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension!

                  + +

                  values

                  + + + + + +
                  TT_ADOBE_ID_STANDARD +

                  Adobe standard encoding.

                  +
                  TT_ADOBE_ID_EXPERT +

                  Adobe expert encoding.

                  +
                  TT_ADOBE_ID_CUSTOM +

                  Adobe custom encoding.

                  +
                  TT_ADOBE_ID_LATIN_1 +

                  Adobe Latin 1 encoding.

                  +
                  + +
                  +
                  diff --git a/freetype/docs/reference/ft2-tt_driver.html b/freetype/docs/reference/ft2-tt_driver.html index 101828dfb..5d71829e4 100644 --- a/freetype/docs/reference/ft2-tt_driver.html +++ b/freetype/docs/reference/ft2-tt_driver.html @@ -3,55 +3,118 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
                  [Index][TOC]
                  -

                  FreeType-2.5.3 API Reference

                  + +

                  FreeType-2.5.5 API Reference

                  -

                  -The TrueType driver -

                  +

                  The TrueType driver

                  Synopsis

                  - - -
                  interpreter-versionTT_INTERPRETER_VERSION_XXX


                  + + +
                  interpreter-versionTT_INTERPRETER_VERSION_XXX
                  + -

                  While FreeType's TrueType driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get. The following lists the available properties together with the necessary macros and structures.

                  The TrueType driver's module name is ‘truetype’.

                  -

                  -
                  -

                  interpreter-version

                  -
                  + +
                  +

                  interpreter-version

                  +

                  Currently, two versions are available, representing the bytecode interpreter with and without subpixel hinting support, respectively. The default is subpixel support if TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel support otherwise (since it isn't available then).

                  If subpixel hinting is on, many TrueType bytecode instructions behave differently compared to B/W or grayscale rendering. The main idea is to render at a much increased horizontal resolution, then sampling down the created output to subpixel precision. However, many older fonts are not suited to this and must be specially taken care of by applying (hardcoded) font-specific tweaks.

                  Details on subpixel hinting and some of the necessary tweaks can be found in Greg Hitchcock's whitepaper at ‘http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx’.

                  @@ -68,45 +131,35 @@ The TrueType driver "interpreter-version", &interpreter_version ); -

                  -
                  note
                  + +

                  note

                  This property can be used with FT_Property_Get also.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  TT_INTERPRETER_VERSION_XXX

                  -
                  -Defined in FT_TRUETYPE_DRIVER_H (ftttdrv.h). -

                  -
                  -
                  -#define TT_INTERPRETER_VERSION_35  35
                  -#define TT_INTERPRETER_VERSION_38  38
                  -
                  -

                  -
                  + +
                  + + +
                  +

                  TT_INTERPRETER_VERSION_XXX

                  +

                  Defined in FT_TRUETYPE_DRIVER_H (ftttdrv.h).

                  +
                  +#define TT_INTERPRETER_VERSION_35  35
                  +#define TT_INTERPRETER_VERSION_38  38
                  +
                  +

                  A list of constants used for the interpreter-version property to select the hinting engine for Truetype fonts.

                  The numeric value in the constant names represents the version number as returned by the ‘GETINFO’ bytecode instruction.

                  -

                  -
                  values
                  -

                  - - -
                  TT_INTERPRETER_VERSION_35
                  + +

                  values

                  + + - -
                  TT_INTERPRETER_VERSION_35

                  Version 35 corresponds to MS rasterizer v.1.7 as used e.g. in Windows 98; only grayscale and B/W rasterizing is supported.

                  TT_INTERPRETER_VERSION_38
                  +
                  TT_INTERPRETER_VERSION_38

                  Version 38 corresponds to MS rasterizer v.1.9; it is roughly equivalent to the hinting provided by DirectWrite ClearType (as can be found, for example, in the Internet Explorer 9 running on Windows 7).

                  -
                  -
                  note
                  + +

                  note

                  This property controls the behaviour of the bytecode interpreter and thus how outlines get hinted. It does not control how glyph get rasterized! In particular, it does not control subpixel color filtering.

                  If FreeType has not been compiled with configuration option FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version 38 causes an ‘FT_Err_Unimplemented_Feature’ error.

                  Depending on the graphics framework, Microsoft uses different bytecode engines. As a consequence, the version numbers returned by a call to the ‘GETINFO[1]’ bytecode instruction are more convoluted than desired.

                  @@ -122,12 +175,9 @@ Defined in FT_TRUETYPE_DRIVER_H (ftttdrv.h). DWrite 8 and later 40

                  Since FreeType doesn't provide all capabilities of DWrite ClearType, using version 38 seems justified.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  + +
                  + diff --git a/freetype/docs/reference/ft2-type1_tables.html b/freetype/docs/reference/ft2-type1_tables.html index 199f3f57f..71355a9d8 100644 --- a/freetype/docs/reference/ft2-type1_tables.html +++ b/freetype/docs/reference/ft2-type1_tables.html @@ -3,63 +3,125 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
                  [Index][TOC]
                  -

                  FreeType-2.5.3 API Reference

                  + +

                  FreeType-2.5.5 API Reference

                  -

                  -Type 1 Tables -

                  +

                  Type 1 Tables

                  Synopsis

                  - - - - - - - -
                  PS_FontInfoRecT1_Blend_FlagsFT_Has_PS_Glyph_Names
                  PS_FontInfoCID_FaceDictRecFT_Get_PS_Font_Info
                  T1_FontInfoCID_FaceDictFT_Get_PS_Font_Private
                  PS_PrivateRecCID_FaceInfoRecT1_EncodingType
                  PS_PrivateCID_FaceInfoPS_Dict_Keys
                  T1_PrivateCID_InfoFT_Get_PS_Font_Value


                  - -
                  + + + + + + + + + +
                  PS_FontInfoRecCID_FaceInfoT1_EncodingType
                  PS_FontInfo PS_Dict_Keys
                  PS_PrivateRecFT_Has_PS_Glyph_Names 
                  PS_PrivateFT_Get_PS_Font_InfoT1_FontInfo
                   FT_Get_PS_Font_PrivateT1_Private
                  CID_FaceDictRecFT_Get_PS_Font_ValueCID_FontDict
                  CID_FaceDict CID_Info
                  CID_FaceInfoRecT1_Blend_Flags
                  + +

                  This section contains the definition of Type 1-specific tables, including structures related to other PostScript font formats.

                  -

                  -
                  -

                  PS_FontInfoRec

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                   
                  +
                  +

                  PS_FontInfoRec

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                     typedef struct  PS_FontInfoRec_
                     {
                       FT_String*  version;
                  @@ -73,62 +135,29 @@ Defined in FT_TYPE1_TABLES_H (t1tables.h).
                       FT_UShort   underline_thickness;
                   
                     } PS_FontInfoRec;
                  +
                  -

                  -

                  A structure used to model a Type 1 or Type 2 FontInfo dictionary. Note that for Multiple Master fonts, each instance has its own FontInfo dictionary.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  PS_FontInfo

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                   
                  +
                  + + +
                  +

                  PS_FontInfo

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                     typedef struct PS_FontInfoRec_*  PS_FontInfo;
                  +
                  -

                  -

                  A handle to a PS_FontInfoRec structure.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  T1_FontInfo

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                   
                  -  typedef PS_FontInfoRec  T1_FontInfo;
                  -
                  -

                  -
                  -

                  This type is equivalent to PS_FontInfoRec. It is deprecated but kept to maintain source compatibility between various versions of FreeType.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  PS_PrivateRec

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                  +
                  + +
                  +

                  PS_PrivateRec

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                     typedef struct  PS_PrivateRec_
                     {
                       FT_Int     unique_id;
                  @@ -168,104 +197,29 @@ Defined in FT_TYPE1_TABLES_H (t1tables.h).
                       FT_Short   min_feature[2];
                   
                     } PS_PrivateRec;
                  +
                  -

                  -

                  A structure used to model a Type 1 or Type 2 private dictionary. Note that for Multiple Master fonts, each instance has its own Private dictionary.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  PS_Private

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                   
                  +
                  + + +
                  +

                  PS_Private

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                     typedef struct PS_PrivateRec_*  PS_Private;
                  +
                  -

                  -

                  A handle to a PS_PrivateRec structure.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  T1_Private

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                  -
                  -  typedef PS_PrivateRec  T1_Private;
                  -
                  -

                  -
                  -

                  This type is equivalent to PS_PrivateRec. It is deprecated but kept to maintain source compatibility between various versions of FreeType.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  T1_Blend_Flags

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                  -
                  -  typedef enum  T1_Blend_Flags_
                  -  {
                  -    /*# required fields in a FontInfo blend dictionary */
                  -    T1_BLEND_UNDERLINE_POSITION = 0,
                  -    T1_BLEND_UNDERLINE_THICKNESS,
                  -    T1_BLEND_ITALIC_ANGLE,
                  -
                  -    /*# required fields in a Private blend dictionary */
                  -    T1_BLEND_BLUE_VALUES,
                  -    T1_BLEND_OTHER_BLUES,
                  -    T1_BLEND_STANDARD_WIDTH,
                  -    T1_BLEND_STANDARD_HEIGHT,
                  -    T1_BLEND_STEM_SNAP_WIDTHS,
                  -    T1_BLEND_STEM_SNAP_HEIGHTS,
                  -    T1_BLEND_BLUE_SCALE,
                  -    T1_BLEND_BLUE_SHIFT,
                  -    T1_BLEND_FAMILY_BLUES,
                  -    T1_BLEND_FAMILY_OTHER_BLUES,
                  -    T1_BLEND_FORCE_BOLD,
                  -
                  -    /*# never remove */
                  -    T1_BLEND_MAX
                  -
                  -  } T1_Blend_Flags;
                   
                  -

                  -
                  -

                  A set of flags used to indicate which fields are present in a given blend dictionary (font info or private). Used to support Multiple Masters fonts.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  CID_FaceDictRec

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                  +
                  + +
                  +

                  CID_FaceDictRec

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                     typedef struct  CID_FaceDictRec_
                     {
                       PS_PrivateRec  private_dict;
                  @@ -285,43 +239,29 @@ Defined in FT_TYPE1_TABLES_H (t1tables.h).
                       FT_Int         sd_bytes;
                   
                     } CID_FaceDictRec;
                  +
                  -

                  -

                  A structure used to represent data in a CID top-level dictionary.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  CID_FaceDict

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                   
                  +
                  + + +
                  +

                  CID_FaceDict

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                     typedef struct CID_FaceDictRec_*  CID_FaceDict;
                  +
                  -

                  -

                  A handle to a CID_FaceDictRec structure.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  CID_FaceInfoRec

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                   
                  +
                  + + +
                  +

                  CID_FaceInfoRec

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                     typedef struct  CID_FaceInfoRec_
                     {
                       FT_String*      cid_font_name;
                  @@ -350,327 +290,163 @@ Defined in FT_TYPE1_TABLES_H (t1tables.h).
                       FT_ULong        data_offset;
                   
                     } CID_FaceInfoRec;
                  +
                  -

                  -

                  A structure used to represent CID Face information.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  CID_FaceInfo

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                   
                  +
                  + + +
                  +

                  CID_FaceInfo

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                     typedef struct CID_FaceInfoRec_*  CID_FaceInfo;
                  +
                  -

                  -

                  A handle to a CID_FaceInfoRec structure.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  CID_Info

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                   
                  -  typedef CID_FaceInfoRec  CID_Info;
                  -
                  -

                  -
                  -

                  This type is equivalent to CID_FaceInfoRec. It is deprecated but kept to maintain source compatibility between various versions of FreeType.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Has_PS_Glyph_Names

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                  +
                  + +
                  +

                  FT_Has_PS_Glyph_Names

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                     FT_EXPORT( FT_Int )
                     FT_Has_PS_Glyph_Names( FT_Face  face );
                  +
                  -

                  -

                  Return true if a given face provides reliable PostScript glyph names. This is similar to using the FT_HAS_GLYPH_NAMES macro, except that certain fonts (mostly TrueType) contain incorrect glyph name tables.

                  When this function returns true, the caller is sure that the glyph names returned by FT_Get_Glyph_Name are reliable.

                  -

                  -
                  input
                  -

                  - -
                  face + +

                  input

                  + +
                  face

                  face handle

                  -
                  -
                  return
                  + +

                  return

                  Boolean. True if glyph names are reliable.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Get_PS_Font_Info

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                   
                  +
                  + + +
                  +

                  FT_Get_PS_Font_Info

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                     FT_EXPORT( FT_Error )
                     FT_Get_PS_Font_Info( FT_Face      face,
                                          PS_FontInfo  afont_info );
                  +
                  -

                  -

                  Retrieve the PS_FontInfoRec structure corresponding to a given PostScript font.

                  -

                  -
                  input
                  -

                  - -
                  face + +

                  input

                  + +
                  face

                  PostScript face handle.

                  -
                  -
                  output
                  -

                  - -
                  afont_info + +

                  output

                  + +
                  afont_info

                  Output font info structure pointer.

                  -
                  -
                  return
                  + +

                  return

                  FreeType error code. 0 means success.

                  -
                  -
                  note
                  + +

                  note

                  The string pointers within the font info structure are owned by the face and don't need to be freed by the caller.

                  If the font's format is not PostScript-based, this function will return the ‘FT_Err_Invalid_Argument’ error code.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Get_PS_Font_Private

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                   
                  +
                  + + +
                  +

                  FT_Get_PS_Font_Private

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                     FT_EXPORT( FT_Error )
                     FT_Get_PS_Font_Private( FT_Face     face,
                                             PS_Private  afont_private );
                  +
                  -

                  -

                  Retrieve the PS_PrivateRec structure corresponding to a given PostScript font.

                  -

                  -
                  input
                  -

                  - -
                  face + +

                  input

                  + +
                  face

                  PostScript face handle.

                  -
                  -
                  output
                  -

                  - -
                  afont_private + +

                  output

                  + +
                  afont_private

                  Output private dictionary structure pointer.

                  -
                  -
                  return
                  + +

                  return

                  FreeType error code. 0 means success.

                  -
                  -
                  note
                  + +

                  note

                  The string pointers within the PS_PrivateRec structure are owned by the face and don't need to be freed by the caller.

                  If the font's format is not PostScript-based, this function returns the ‘FT_Err_Invalid_Argument’ error code.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  T1_EncodingType

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                  -
                  -  typedef enum  T1_EncodingType_
                  -  {
                  -    T1_ENCODING_TYPE_NONE = 0,
                  -    T1_ENCODING_TYPE_ARRAY,
                  -    T1_ENCODING_TYPE_STANDARD,
                  -    T1_ENCODING_TYPE_ISOLATIN1,
                  -    T1_ENCODING_TYPE_EXPERT
                  -
                  -  } T1_EncodingType;
                  -
                  -

                  -
                  -

                  An enumeration describing the ‘Encoding’ entry in a Type 1 dictionary.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  PS_Dict_Keys

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                  -
                  -  typedef enum  PS_Dict_Keys_
                  -  {
                  -    /* conventionally in the font dictionary */
                  -    PS_DICT_FONT_TYPE,              /* FT_Byte         */
                  -    PS_DICT_FONT_MATRIX,            /* FT_Fixed        */
                  -    PS_DICT_FONT_BBOX,              /* FT_Fixed        */
                  -    PS_DICT_PAINT_TYPE,             /* FT_Byte         */
                  -    PS_DICT_FONT_NAME,              /* FT_String*      */
                  -    PS_DICT_UNIQUE_ID,              /* FT_Int          */
                  -    PS_DICT_NUM_CHAR_STRINGS,       /* FT_Int          */
                  -    PS_DICT_CHAR_STRING_KEY,        /* FT_String*      */
                  -    PS_DICT_CHAR_STRING,            /* FT_String*      */
                  -    PS_DICT_ENCODING_TYPE,          /* T1_EncodingType */
                  -    PS_DICT_ENCODING_ENTRY,         /* FT_String*      */
                  -
                  -    /* conventionally in the font Private dictionary */
                  -    PS_DICT_NUM_SUBRS,              /* FT_Int     */
                  -    PS_DICT_SUBR,                   /* FT_String* */
                  -    PS_DICT_STD_HW,                 /* FT_UShort  */
                  -    PS_DICT_STD_VW,                 /* FT_UShort  */
                  -    PS_DICT_NUM_BLUE_VALUES,        /* FT_Byte    */
                  -    PS_DICT_BLUE_VALUE,             /* FT_Short   */
                  -    PS_DICT_BLUE_FUZZ,              /* FT_Int     */
                  -    PS_DICT_NUM_OTHER_BLUES,        /* FT_Byte    */
                  -    PS_DICT_OTHER_BLUE,             /* FT_Short   */
                  -    PS_DICT_NUM_FAMILY_BLUES,       /* FT_Byte    */
                  -    PS_DICT_FAMILY_BLUE,            /* FT_Short   */
                  -    PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte    */
                  -    PS_DICT_FAMILY_OTHER_BLUE,      /* FT_Short   */
                  -    PS_DICT_BLUE_SCALE,             /* FT_Fixed   */
                  -    PS_DICT_BLUE_SHIFT,             /* FT_Int     */
                  -    PS_DICT_NUM_STEM_SNAP_H,        /* FT_Byte    */
                  -    PS_DICT_STEM_SNAP_H,            /* FT_Short   */
                  -    PS_DICT_NUM_STEM_SNAP_V,        /* FT_Byte    */
                  -    PS_DICT_STEM_SNAP_V,            /* FT_Short   */
                  -    PS_DICT_FORCE_BOLD,             /* FT_Bool    */
                  -    PS_DICT_RND_STEM_UP,            /* FT_Bool    */
                  -    PS_DICT_MIN_FEATURE,            /* FT_Short   */
                  -    PS_DICT_LEN_IV,                 /* FT_Int     */
                  -    PS_DICT_PASSWORD,               /* FT_Long    */
                  -    PS_DICT_LANGUAGE_GROUP,         /* FT_Long    */
                   
                  -    /* conventionally in the font FontInfo dictionary */
                  -    PS_DICT_VERSION,                /* FT_String* */
                  -    PS_DICT_NOTICE,                 /* FT_String* */
                  -    PS_DICT_FULL_NAME,              /* FT_String* */
                  -    PS_DICT_FAMILY_NAME,            /* FT_String* */
                  -    PS_DICT_WEIGHT,                 /* FT_String* */
                  -    PS_DICT_IS_FIXED_PITCH,         /* FT_Bool    */
                  -    PS_DICT_UNDERLINE_POSITION,     /* FT_Short   */
                  -    PS_DICT_UNDERLINE_THICKNESS,    /* FT_UShort  */
                  -    PS_DICT_FS_TYPE,                /* FT_UShort  */
                  -    PS_DICT_ITALIC_ANGLE,           /* FT_Long    */
                  -
                  -    PS_DICT_MAX = PS_DICT_ITALIC_ANGLE
                  -
                  -  } PS_Dict_Keys;
                  -
                  -

                  -
                  -

                  An enumeration used in calls to FT_Get_PS_Font_Value to identify the Type 1 dictionary entry to retrieve.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Get_PS_Font_Value

                  -
                  -Defined in FT_TYPE1_TABLES_H (t1tables.h). -

                  -
                  +
                  + +
                  +

                  FT_Get_PS_Font_Value

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                     FT_EXPORT( FT_Long )
                     FT_Get_PS_Font_Value( FT_Face       face,
                                           PS_Dict_Keys  key,
                                           FT_UInt       idx,
                                           void         *value,
                                           FT_Long       value_len );
                  +
                  -

                  -

                  Retrieve the value for the supplied key from a PostScript font.

                  -

                  -
                  input
                  -

                  - -
                  face + +

                  input

                  + + - - - -
                  face

                  PostScript face handle.

                  key +
                  key

                  An enumeration value representing the dictionary key to retrieve.

                  idx +
                  idx

                  For array values, this specifies the index to be returned.

                  value +
                  value

                  A pointer to memory into which to write the value.

                  valen_len +
                  valen_len

                  The size, in bytes, of the memory supplied for the value.

                  -
                  -
                  output
                  -

                  - -
                  value + +

                  output

                  + +
                  value

                  The value matching the above key, if it exists.

                  -
                  -
                  return
                  + +

                  return

                  The amount of memory (in bytes) required to hold the requested value (if it exists, -1 otherwise).

                  -
                  -
                  note
                  + +

                  note

                  The values returned are not pointers into the internal structures of the face, but are ‘fresh’ copies, so that the memory containing them belongs to the calling application. This also enforces the ‘read-only’ nature of these values, i.e., this function cannot be used to manipulate the face.

                  ‘value’ is a void pointer because the values returned can be of various types.

                  If either ‘value’ is NULL or ‘value_len’ is too small, just the required memory size for the requested entry is returned.

                  @@ -678,12 +454,405 @@ Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To get the value as in the font stream, you need to divide by 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).

                  IMPORTANT: Only key/value pairs read by the FreeType interpreter can be retrieved. So, for example, PostScript procedures such as NP, ND, and RD are not available. Arbitrary keys are, obviously, not be available either.

                  If the font's format is not PostScript-based, this function returns the ‘FT_Err_Invalid_Argument’ error code.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  + +
                  + + +
                  +

                  T1_Blend_Flags

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                  +  typedef enum  T1_Blend_Flags_
                  +  {
                  +    /* required fields in a FontInfo blend dictionary */
                  +    T1_BLEND_UNDERLINE_POSITION = 0,
                  +    T1_BLEND_UNDERLINE_THICKNESS,
                  +    T1_BLEND_ITALIC_ANGLE,
                  +
                  +    /* required fields in a Private blend dictionary */
                  +    T1_BLEND_BLUE_VALUES,
                  +    T1_BLEND_OTHER_BLUES,
                  +    T1_BLEND_STANDARD_WIDTH,
                  +    T1_BLEND_STANDARD_HEIGHT,
                  +    T1_BLEND_STEM_SNAP_WIDTHS,
                  +    T1_BLEND_STEM_SNAP_HEIGHTS,
                  +    T1_BLEND_BLUE_SCALE,
                  +    T1_BLEND_BLUE_SHIFT,
                  +    T1_BLEND_FAMILY_BLUES,
                  +    T1_BLEND_FAMILY_OTHER_BLUES,
                  +    T1_BLEND_FORCE_BOLD,
                  +
                  +    T1_BLEND_MAX    /* do not remove */
                  +
                  +  } T1_Blend_Flags;
                  +
                  +
                  +  /* these constants are deprecated; use the corresponding */
                  +  /* `T1_Blend_Flags' values instead                       */
                  +#define t1_blend_underline_position   T1_BLEND_UNDERLINE_POSITION
                  +#define t1_blend_underline_thickness  T1_BLEND_UNDERLINE_THICKNESS
                  +#define t1_blend_italic_angle         T1_BLEND_ITALIC_ANGLE
                  +#define t1_blend_blue_values          T1_BLEND_BLUE_VALUES
                  +#define t1_blend_other_blues          T1_BLEND_OTHER_BLUES
                  +#define t1_blend_standard_widths      T1_BLEND_STANDARD_WIDTH
                  +#define t1_blend_standard_height      T1_BLEND_STANDARD_HEIGHT
                  +#define t1_blend_stem_snap_widths     T1_BLEND_STEM_SNAP_WIDTHS
                  +#define t1_blend_stem_snap_heights    T1_BLEND_STEM_SNAP_HEIGHTS
                  +#define t1_blend_blue_scale           T1_BLEND_BLUE_SCALE
                  +#define t1_blend_blue_shift           T1_BLEND_BLUE_SHIFT
                  +#define t1_blend_family_blues         T1_BLEND_FAMILY_BLUES
                  +#define t1_blend_family_other_blues   T1_BLEND_FAMILY_OTHER_BLUES
                  +#define t1_blend_force_bold           T1_BLEND_FORCE_BOLD
                  +#define t1_blend_max                  T1_BLEND_MAX
                  +
                  + +

                  A set of flags used to indicate which fields are present in a given blend dictionary (font info or private). Used to support Multiple Masters fonts.

                  + +

                  values

                  + + + + + + + + + + + + + + + +
                  T1_BLEND_UNDERLINE_POSITION +

                  +
                  T1_BLEND_UNDERLINE_THICKNESS +

                  +
                  T1_BLEND_ITALIC_ANGLE +

                  +
                  T1_BLEND_BLUE_VALUES +

                  +
                  T1_BLEND_OTHER_BLUES +

                  +
                  T1_BLEND_STANDARD_WIDTH +

                  +
                  T1_BLEND_STANDARD_HEIGHT +

                  +
                  T1_BLEND_STEM_SNAP_WIDTHS +

                  +
                  T1_BLEND_STEM_SNAP_HEIGHTS +

                  +
                  T1_BLEND_BLUE_SCALE +

                  +
                  T1_BLEND_BLUE_SHIFT +

                  +
                  T1_BLEND_FAMILY_BLUES +

                  +
                  T1_BLEND_FAMILY_OTHER_BLUES +

                  +
                  T1_BLEND_FORCE_BOLD +

                  +
                  + +
                  +
                  + +
                  +

                  T1_EncodingType

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                  +  typedef enum  T1_EncodingType_
                  +  {
                  +    T1_ENCODING_TYPE_NONE = 0,
                  +    T1_ENCODING_TYPE_ARRAY,
                  +    T1_ENCODING_TYPE_STANDARD,
                  +    T1_ENCODING_TYPE_ISOLATIN1,
                  +    T1_ENCODING_TYPE_EXPERT
                  +
                  +  } T1_EncodingType;
                  +
                  + +

                  An enumeration describing the ‘Encoding’ entry in a Type 1 dictionary.

                  + +

                  values

                  + + + + + + +
                  T1_ENCODING_TYPE_NONE +

                  +
                  T1_ENCODING_TYPE_ARRAY +

                  +
                  T1_ENCODING_TYPE_STANDARD +

                  +
                  T1_ENCODING_TYPE_ISOLATIN1 +

                  +
                  T1_ENCODING_TYPE_EXPERT +

                  +
                  + +
                  +
                  + +
                  +

                  PS_Dict_Keys

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                  +  typedef enum  PS_Dict_Keys_
                  +  {
                  +    /* conventionally in the font dictionary */
                  +    PS_DICT_FONT_TYPE,              /* FT_Byte         */
                  +    PS_DICT_FONT_MATRIX,            /* FT_Fixed        */
                  +    PS_DICT_FONT_BBOX,              /* FT_Fixed        */
                  +    PS_DICT_PAINT_TYPE,             /* FT_Byte         */
                  +    PS_DICT_FONT_NAME,              /* FT_String*      */
                  +    PS_DICT_UNIQUE_ID,              /* FT_Int          */
                  +    PS_DICT_NUM_CHAR_STRINGS,       /* FT_Int          */
                  +    PS_DICT_CHAR_STRING_KEY,        /* FT_String*      */
                  +    PS_DICT_CHAR_STRING,            /* FT_String*      */
                  +    PS_DICT_ENCODING_TYPE,          /* T1_EncodingType */
                  +    PS_DICT_ENCODING_ENTRY,         /* FT_String*      */
                  +
                  +    /* conventionally in the font Private dictionary */
                  +    PS_DICT_NUM_SUBRS,              /* FT_Int     */
                  +    PS_DICT_SUBR,                   /* FT_String* */
                  +    PS_DICT_STD_HW,                 /* FT_UShort  */
                  +    PS_DICT_STD_VW,                 /* FT_UShort  */
                  +    PS_DICT_NUM_BLUE_VALUES,        /* FT_Byte    */
                  +    PS_DICT_BLUE_VALUE,             /* FT_Short   */
                  +    PS_DICT_BLUE_FUZZ,              /* FT_Int     */
                  +    PS_DICT_NUM_OTHER_BLUES,        /* FT_Byte    */
                  +    PS_DICT_OTHER_BLUE,             /* FT_Short   */
                  +    PS_DICT_NUM_FAMILY_BLUES,       /* FT_Byte    */
                  +    PS_DICT_FAMILY_BLUE,            /* FT_Short   */
                  +    PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte    */
                  +    PS_DICT_FAMILY_OTHER_BLUE,      /* FT_Short   */
                  +    PS_DICT_BLUE_SCALE,             /* FT_Fixed   */
                  +    PS_DICT_BLUE_SHIFT,             /* FT_Int     */
                  +    PS_DICT_NUM_STEM_SNAP_H,        /* FT_Byte    */
                  +    PS_DICT_STEM_SNAP_H,            /* FT_Short   */
                  +    PS_DICT_NUM_STEM_SNAP_V,        /* FT_Byte    */
                  +    PS_DICT_STEM_SNAP_V,            /* FT_Short   */
                  +    PS_DICT_FORCE_BOLD,             /* FT_Bool    */
                  +    PS_DICT_RND_STEM_UP,            /* FT_Bool    */
                  +    PS_DICT_MIN_FEATURE,            /* FT_Short   */
                  +    PS_DICT_LEN_IV,                 /* FT_Int     */
                  +    PS_DICT_PASSWORD,               /* FT_Long    */
                  +    PS_DICT_LANGUAGE_GROUP,         /* FT_Long    */
                  +
                  +    /* conventionally in the font FontInfo dictionary */
                  +    PS_DICT_VERSION,                /* FT_String* */
                  +    PS_DICT_NOTICE,                 /* FT_String* */
                  +    PS_DICT_FULL_NAME,              /* FT_String* */
                  +    PS_DICT_FAMILY_NAME,            /* FT_String* */
                  +    PS_DICT_WEIGHT,                 /* FT_String* */
                  +    PS_DICT_IS_FIXED_PITCH,         /* FT_Bool    */
                  +    PS_DICT_UNDERLINE_POSITION,     /* FT_Short   */
                  +    PS_DICT_UNDERLINE_THICKNESS,    /* FT_UShort  */
                  +    PS_DICT_FS_TYPE,                /* FT_UShort  */
                  +    PS_DICT_ITALIC_ANGLE,           /* FT_Long    */
                  +
                  +    PS_DICT_MAX = PS_DICT_ITALIC_ANGLE
                  +
                  +  } PS_Dict_Keys;
                  +
                  + +

                  An enumeration used in calls to FT_Get_PS_Font_Value to identify the Type 1 dictionary entry to retrieve.

                  + +

                  values

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  PS_DICT_FONT_TYPE +

                  +
                  PS_DICT_FONT_MATRIX +

                  +
                  PS_DICT_FONT_BBOX +

                  +
                  PS_DICT_PAINT_TYPE +

                  +
                  PS_DICT_FONT_NAME +

                  +
                  PS_DICT_UNIQUE_ID +

                  +
                  PS_DICT_NUM_CHAR_STRINGS +

                  +
                  PS_DICT_CHAR_STRING_KEY +

                  +
                  PS_DICT_CHAR_STRING +

                  +
                  PS_DICT_ENCODING_TYPE +

                  +
                  PS_DICT_ENCODING_ENTRY +

                  +
                  PS_DICT_NUM_SUBRS +

                  +
                  PS_DICT_SUBR +

                  +
                  PS_DICT_STD_HW +

                  +
                  PS_DICT_STD_VW +

                  +
                  PS_DICT_NUM_BLUE_VALUES +

                  +
                  PS_DICT_BLUE_VALUE +

                  +
                  PS_DICT_BLUE_FUZZ +

                  +
                  PS_DICT_NUM_OTHER_BLUES +

                  +
                  PS_DICT_OTHER_BLUE +

                  +
                  PS_DICT_NUM_FAMILY_BLUES +

                  +
                  PS_DICT_FAMILY_BLUE +

                  +
                  PS_DICT_NUM_FAMILY_OTHER_BLUES +

                  +
                  PS_DICT_FAMILY_OTHER_BLUE +

                  +
                  PS_DICT_BLUE_SCALE +

                  +
                  PS_DICT_BLUE_SHIFT +

                  +
                  PS_DICT_NUM_STEM_SNAP_H +

                  +
                  PS_DICT_STEM_SNAP_H +

                  +
                  PS_DICT_NUM_STEM_SNAP_V +

                  +
                  PS_DICT_STEM_SNAP_V +

                  +
                  PS_DICT_FORCE_BOLD +

                  +
                  PS_DICT_RND_STEM_UP +

                  +
                  PS_DICT_MIN_FEATURE +

                  +
                  PS_DICT_LEN_IV +

                  +
                  PS_DICT_PASSWORD +

                  +
                  PS_DICT_LANGUAGE_GROUP +

                  +
                  PS_DICT_VERSION +

                  +
                  PS_DICT_NOTICE +

                  +
                  PS_DICT_FULL_NAME +

                  +
                  PS_DICT_FAMILY_NAME +

                  +
                  PS_DICT_WEIGHT +

                  +
                  PS_DICT_IS_FIXED_PITCH +

                  +
                  PS_DICT_UNDERLINE_POSITION +

                  +
                  PS_DICT_UNDERLINE_THICKNESS +

                  +
                  PS_DICT_FS_TYPE +

                  +
                  PS_DICT_ITALIC_ANGLE +

                  +
                  + +
                  +
                  + +
                  +

                  T1_FontInfo

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                  +  typedef PS_FontInfoRec  T1_FontInfo;
                  +
                  + +

                  This type is equivalent to PS_FontInfoRec. It is deprecated but kept to maintain source compatibility between various versions of FreeType.

                  + +
                  +
                  + +
                  +

                  T1_Private

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                  +  typedef PS_PrivateRec  T1_Private;
                  +
                  + +

                  This type is equivalent to PS_PrivateRec. It is deprecated but kept to maintain source compatibility between various versions of FreeType.

                  + +
                  +
                  + +
                  +

                  CID_FontDict

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                  +  typedef CID_FaceDictRec  CID_FontDict;
                  +
                  + +

                  This type is equivalent to CID_FaceDictRec. It is deprecated but kept to maintain source compatibility between various versions of FreeType.

                  + +
                  +
                  + +
                  +

                  CID_Info

                  +

                  Defined in FT_TYPE1_TABLES_H (t1tables.h).

                  +
                  +  typedef CID_FaceInfoRec  CID_Info;
                  +
                  + +

                  This type is equivalent to CID_FaceInfoRec. It is deprecated but kept to maintain source compatibility between various versions of FreeType.

                  + +
                  +
                  diff --git a/freetype/docs/reference/ft2-user_allocation.html b/freetype/docs/reference/ft2-user_allocation.html index 4875fb2b5..52bd6ec22 100644 --- a/freetype/docs/reference/ft2-user_allocation.html +++ b/freetype/docs/reference/ft2-user_allocation.html @@ -3,45 +3,108 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
                  [Index][TOC]
                  -

                  FreeType-2.5.3 API Reference

                  + +

                  FreeType-2.5.5 API Reference

                  + +

                  User allocation

                  -

                  -User allocation -

                  -

                  FreeType assumes that structures allocated by the user and passed as arguments are zeroed out except for the actual data. In other words, it is recommended to use ‘calloc’ (or variants of it) instead of ‘malloc’ for allocation.

                  -

                  + diff --git a/freetype/docs/reference/ft2-version.html b/freetype/docs/reference/ft2-version.html index 89d79a2ea..89e3dac90 100644 --- a/freetype/docs/reference/ft2-version.html +++ b/freetype/docs/reference/ft2-version.html @@ -3,217 +3,250 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
                  [Index][TOC]
                  -

                  FreeType-2.5.3 API Reference

                  + +

                  FreeType-2.5.5 API Reference

                  -

                  -FreeType Version -

                  +

                  FreeType Version

                  Synopsis

                  - - - -
                  FREETYPE_XXXFT_Face_CheckTrueTypePatents
                  FT_Library_VersionFT_Face_SetUnpatentedHinting


                  + + + + + + +
                  FT_Library_Version 
                   FT_Face_CheckTrueTypePatents
                  FREETYPE_MAJORFT_Face_SetUnpatentedHinting
                  FREETYPE_MINOR 
                  FREETYPE_PATCHFREETYPE_XXX
                  + -

                  Note that those functions and macros are of limited use because even a new release of FreeType with only documentation changes increases the version number.

                  -

                  -
                  -

                  FREETYPE_XXX

                  -
                  -Defined in FT_FREETYPE_H (freetype.h). -

                  -
                  -
                  -#define FREETYPE_MAJOR  2
                  -#define FREETYPE_MINOR  5
                  -#define FREETYPE_PATCH  3
                  -
                  -

                  -
                  -

                  These three macros identify the FreeType source code version. Use FT_Library_Version to access them at runtime.

                  -

                  -
                  values
                  -

                  - - - - -
                  FREETYPE_MAJOR -

                  The major version number.

                  -
                  FREETYPE_MINOR -

                  The minor version number.

                  -
                  FREETYPE_PATCH -

                  The patch level.

                  -
                  -
                  -
                  note
                  -

                  The version number of FreeType if built as a dynamic link library with the ‘libtool’ package is not controlled by these three macros.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Library_Version

                  -
                  -Defined in FT_FREETYPE_H (freetype.h). -

                  -
                   
                  +
                  +

                  FT_Library_Version

                  +

                  Defined in FT_FREETYPE_H (freetype.h).

                  +
                     FT_EXPORT( void )
                     FT_Library_Version( FT_Library   library,
                                         FT_Int      *amajor,
                                         FT_Int      *aminor,
                                         FT_Int      *apatch );
                  +
                  -

                  -

                  Return the version of the FreeType library being used. This is useful when dynamically linking to the library, since one cannot use the macros FREETYPE_MAJOR, FREETYPE_MINOR, and FREETYPE_PATCH.

                  -

                  -
                  input
                  -

                  - -
                  library + +

                  input

                  + +
                  library

                  A source library handle.

                  -
                  -
                  output
                  -

                  - -
                  amajor + +

                  output

                  + + - -
                  amajor

                  The major version number.

                  aminor +
                  aminor

                  The minor version number.

                  apatch +
                  apatch

                  The patch version number.

                  -
                  -
                  note
                  + +

                  note

                  The reason why this function takes a ‘library’ argument is because certain programs implement library initialization in a custom way that doesn't use FT_Init_FreeType.

                  In such cases, the library version might not be available before the library object has been created.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Face_CheckTrueTypePatents

                  -
                  -Defined in FT_FREETYPE_H (freetype.h). -

                  -
                   
                  +
                  + + +
                  +

                  FT_Face_CheckTrueTypePatents

                  +

                  Defined in FT_FREETYPE_H (freetype.h).

                  +
                     FT_EXPORT( FT_Bool )
                     FT_Face_CheckTrueTypePatents( FT_Face  face );
                  +
                  -

                  -

                  Parse all bytecode instructions of a TrueType font file to check whether any of the patented opcodes are used. This is only useful if you want to be able to use the unpatented hinter with fonts that do not use these opcodes.

                  Note that this function parses all glyph instructions in the font file, which may be slow.

                  -

                  -
                  input
                  -

                  - -
                  face + +

                  input

                  + +
                  face

                  A face handle.

                  -
                  -
                  return
                  + +

                  return

                  1 if this is a TrueType font that uses one of the patented opcodes, 0 otherwise.

                  -
                  -
                  note
                  + +

                  note

                  Since May 2010, TrueType hinting is no longer patented.

                  -
                  -
                  since
                  + +

                  since

                  2.3.5

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Face_SetUnpatentedHinting

                  -
                  -Defined in FT_FREETYPE_H (freetype.h). -

                  -
                   
                  +
                  + + +
                  +

                  FT_Face_SetUnpatentedHinting

                  +

                  Defined in FT_FREETYPE_H (freetype.h).

                  +
                     FT_EXPORT( FT_Bool )
                     FT_Face_SetUnpatentedHinting( FT_Face  face,
                                                   FT_Bool  value );
                  +
                  -

                  -

                  Enable or disable the unpatented hinter for a given face. Only enable it if you have determined that the face doesn't use any patented opcodes (see FT_Face_CheckTrueTypePatents).

                  -

                  -
                  input
                  -

                  - -
                  face + +

                  input

                  + + -
                  face

                  A face handle.

                  value +
                  value

                  New boolean setting.

                  -
                  -
                  return
                  + +

                  return

                  The old setting value. This will always be false if this is not an SFNT font, or if the unpatented hinter is not compiled in this instance of the library.

                  -
                  -
                  note
                  + +

                  note

                  Since May 2010, TrueType hinting is no longer patented.

                  -
                  -
                  since
                  + +

                  since

                  2.3.5

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  + +
                  + + +
                  +

                  FREETYPE_XXX

                  +

                  Defined in FT_FREETYPE_H (freetype.h).

                  +
                  +#define FREETYPE_MAJOR  2
                  +#define FREETYPE_MINOR  5
                  +#define FREETYPE_PATCH  5
                  +
                  + +

                  These three macros identify the FreeType source code version. Use FT_Library_Version to access them at runtime.

                  + +

                  values

                  + + + + +
                  FREETYPE_MAJOR +

                  The major version number.

                  +
                  FREETYPE_MINOR +

                  The minor version number.

                  +
                  FREETYPE_PATCH +

                  The patch level.

                  +
                  + +

                  note

                  +

                  The version number of FreeType if built as a dynamic link library with the ‘libtool’ package is not controlled by these three macros.

                  + +
                  +
                  diff --git a/freetype/docs/reference/ft2-winfnt_fonts.html b/freetype/docs/reference/ft2-winfnt_fonts.html index 792cd9e78..a17e350d2 100644 --- a/freetype/docs/reference/ft2-winfnt_fonts.html +++ b/freetype/docs/reference/ft2-winfnt_fonts.html @@ -3,96 +3,154 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
                  [Index][TOC]
                  -

                  FreeType-2.5.3 API Reference

                  + +

                  FreeType-2.5.5 API Reference

                  -

                  -Window FNT Files -

                  +

                  Window FNT Files

                  Synopsis

                  - - - -
                  FT_WinFNT_ID_XXXFT_WinFNT_Header
                  FT_WinFNT_HeaderRecFT_Get_WinFNT_Header


                  + + + +
                  FT_WinFNT_ID_XXXFT_WinFNT_Header
                  FT_WinFNT_HeaderRecFT_Get_WinFNT_Header
                  + -

                  This section contains the declaration of Windows FNT specific functions.

                  -

                  -
                  -

                  FT_WinFNT_ID_XXX

                  -
                  -Defined in FT_WINFONTS_H (ftwinfnt.h). -

                  -
                   
                  -#define FT_WinFNT_ID_CP1252    0
                  -#define FT_WinFNT_ID_DEFAULT   1
                  -#define FT_WinFNT_ID_SYMBOL    2
                  -#define FT_WinFNT_ID_MAC      77
                  -#define FT_WinFNT_ID_CP932   128
                  -#define FT_WinFNT_ID_CP949   129
                  -#define FT_WinFNT_ID_CP1361  130
                  -#define FT_WinFNT_ID_CP936   134
                  -#define FT_WinFNT_ID_CP950   136
                  -#define FT_WinFNT_ID_CP1253  161
                  -#define FT_WinFNT_ID_CP1254  162
                  -#define FT_WinFNT_ID_CP1258  163
                  -#define FT_WinFNT_ID_CP1255  177
                  -#define FT_WinFNT_ID_CP1256  178
                  -#define FT_WinFNT_ID_CP1257  186
                  -#define FT_WinFNT_ID_CP1251  204
                  -#define FT_WinFNT_ID_CP874   222
                  -#define FT_WinFNT_ID_CP1250  238
                  -#define FT_WinFNT_ID_OEM     255
                  +
                  +

                  FT_WinFNT_ID_XXX

                  +

                  Defined in FT_WINFONTS_H (ftwinfnt.h).

                  +
                  +#define FT_WinFNT_ID_CP1252    0
                  +#define FT_WinFNT_ID_DEFAULT   1
                  +#define FT_WinFNT_ID_SYMBOL    2
                  +#define FT_WinFNT_ID_MAC      77
                  +#define FT_WinFNT_ID_CP932   128
                  +#define FT_WinFNT_ID_CP949   129
                  +#define FT_WinFNT_ID_CP1361  130
                  +#define FT_WinFNT_ID_CP936   134
                  +#define FT_WinFNT_ID_CP950   136
                  +#define FT_WinFNT_ID_CP1253  161
                  +#define FT_WinFNT_ID_CP1254  162
                  +#define FT_WinFNT_ID_CP1258  163
                  +#define FT_WinFNT_ID_CP1255  177
                  +#define FT_WinFNT_ID_CP1256  178
                  +#define FT_WinFNT_ID_CP1257  186
                  +#define FT_WinFNT_ID_CP1251  204
                  +#define FT_WinFNT_ID_CP874   222
                  +#define FT_WinFNT_ID_CP1250  238
                  +#define FT_WinFNT_ID_OEM     255
                  +
                  -

                  -

                  A list of valid values for the ‘charset’ byte in FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX encodings (except for cp1361) can be found at ftp://ftp.unicode.org/public in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.

                  -

                  -
                  values
                  -

                  - -
                  FT_WinFNT_ID_DEFAULT + +

                  values

                  + + - - - - - - - - - - - - - - - - - -
                  FT_WinFNT_ID_DEFAULT

                  This is used for font enumeration and font creation as a ‘don't care’ value. Valid font files don't contain this value. When querying for information about the character set of the font that is currently selected into a specified device context, this return value (of the related Windows API) simply denotes failure.

                  FT_WinFNT_ID_SYMBOL +
                  FT_WinFNT_ID_SYMBOL

                  There is no known mapping table available.

                  FT_WinFNT_ID_MAC +
                  FT_WinFNT_ID_MAC

                  Mac Roman encoding.

                  FT_WinFNT_ID_OEM +
                  FT_WinFNT_ID_OEM

                  From Michael Pöttgen <michael@poettgen.de>:

                  The ‘Windows Font Mapping’ article says that FT_WinFNT_ID_OEM is used for the charset of vector fonts, like ‘modern.fon’, ‘roman.fon’, and ‘script.fon’ on Windows.

                  The ‘CreateFont’ documentation says: The FT_WinFNT_ID_OEM value specifies a character set that is operating-system dependent.

                  @@ -101,66 +159,60 @@ Defined in FT_WINFONTS_H (ftwinfnt.h).

                  http://www.microsoft.com/globaldev/reference/cphome.mspx,

                  and is used for the ‘DOS boxes’, to support legacy applications. A German Windows version for example usually uses ANSI codepage 1252 and OEM codepage 850.

                  FT_WinFNT_ID_CP874 +
                  FT_WinFNT_ID_CP874

                  A superset of Thai TIS 620 and ISO 8859-11.

                  FT_WinFNT_ID_CP932 +
                  FT_WinFNT_ID_CP932

                  A superset of Japanese Shift-JIS (with minor deviations).

                  FT_WinFNT_ID_CP936 +
                  FT_WinFNT_ID_CP936

                  A superset of simplified Chinese GB 2312-1980 (with different ordering and minor deviations).

                  FT_WinFNT_ID_CP949 +
                  FT_WinFNT_ID_CP949

                  A superset of Korean Hangul KS C 5601-1987 (with different ordering and minor deviations).

                  FT_WinFNT_ID_CP950 +
                  FT_WinFNT_ID_CP950

                  A superset of traditional Chinese Big 5 ETen (with different ordering and minor deviations).

                  FT_WinFNT_ID_CP1250 +
                  FT_WinFNT_ID_CP1250

                  A superset of East European ISO 8859-2 (with slightly different ordering).

                  FT_WinFNT_ID_CP1251 +
                  FT_WinFNT_ID_CP1251

                  A superset of Russian ISO 8859-5 (with different ordering).

                  FT_WinFNT_ID_CP1252 +
                  FT_WinFNT_ID_CP1252

                  ANSI encoding. A superset of ISO 8859-1.

                  FT_WinFNT_ID_CP1253 +
                  FT_WinFNT_ID_CP1253

                  A superset of Greek ISO 8859-7 (with minor modifications).

                  FT_WinFNT_ID_CP1254 +
                  FT_WinFNT_ID_CP1254

                  A superset of Turkish ISO 8859-9.

                  FT_WinFNT_ID_CP1255 +
                  FT_WinFNT_ID_CP1255

                  A superset of Hebrew ISO 8859-8 (with some modifications).

                  FT_WinFNT_ID_CP1256 +
                  FT_WinFNT_ID_CP1256

                  A superset of Arabic ISO 8859-6 (with different ordering).

                  FT_WinFNT_ID_CP1257 +
                  FT_WinFNT_ID_CP1257

                  A superset of Baltic ISO 8859-13 (with some deviations).

                  FT_WinFNT_ID_CP1258 +
                  FT_WinFNT_ID_CP1258

                  For Vietnamese. This encoding doesn't cover all necessary characters.

                  FT_WinFNT_ID_CP1361 +
                  FT_WinFNT_ID_CP1361

                  Korean (Johab).

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  -
                  -

                  FT_WinFNT_HeaderRec

                  -
                  -Defined in FT_WINFONTS_H (ftwinfnt.h). -

                  -
                  +
                  + +
                  +

                  FT_WinFNT_HeaderRec

                  +

                  Defined in FT_WINFONTS_H (ftwinfnt.h).

                  +
                     typedef struct  FT_WinFNT_HeaderRec_
                     {
                       FT_UShort  version;
                  @@ -201,78 +253,58 @@ Defined in FT_WINFONTS_H (ftwinfnt.h).
                       FT_ULong   reserved1[4];
                   
                     } FT_WinFNT_HeaderRec;
                  +
                  -

                  -

                  Windows FNT Header info.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  -
                  -

                  FT_WinFNT_Header

                  -
                  -Defined in FT_WINFONTS_H (ftwinfnt.h). -

                  -
                  +
                  + +
                  +

                  FT_WinFNT_Header

                  +

                  Defined in FT_WINFONTS_H (ftwinfnt.h).

                  +
                     typedef struct FT_WinFNT_HeaderRec_*  FT_WinFNT_Header;
                  +
                  -

                  -

                  A handle to an FT_WinFNT_HeaderRec structure.

                  -

                  -
                  -
                  - - -
                  [Index][TOC]
                  - -
                  -

                  FT_Get_WinFNT_Header

                  -
                  -Defined in FT_WINFONTS_H (ftwinfnt.h). -

                  -
                  +
                  + +
                  +

                  FT_Get_WinFNT_Header

                  +

                  Defined in FT_WINFONTS_H (ftwinfnt.h).

                  +
                     FT_EXPORT( FT_Error )
                     FT_Get_WinFNT_Header( FT_Face               face,
                                           FT_WinFNT_HeaderRec  *aheader );
                  +
                  -

                  -

                  Retrieve a Windows FNT font info header.

                  -

                  -
                  input
                  -

                  - -
                  face + +

                  input

                  + +
                  face

                  A handle to the input face.

                  -
                  -
                  output
                  -

                  - -
                  aheader + +

                  output

                  + +
                  aheader

                  The WinFNT header.

                  -
                  -
                  return
                  + +

                  return

                  FreeType error code. 0 means success.

                  -
                  -
                  note
                  + +

                  note

                  This function only works with Windows FNT faces, returning an error otherwise.

                  -
                  -
                  -
                  - - -
                  [Index][TOC]
                  + +
                  + diff --git a/freetype/docs/release b/freetype/docs/release index cf1f643d6..98f16cd35 100644 --- a/freetype/docs/release +++ b/freetype/docs/release @@ -41,7 +41,8 @@ How to prepare a new release . Run src/tools/chktrcmp.py and check that there are no undefined trace_XXXX macros. -. Tag the git repositories (freetype2, freetype2-demos) with +. After pushing the new release, tag the git repositories (freetype2, + freetype2-demos) with git tag VER- -m "" -u @@ -188,7 +189,7 @@ How to prepare a new release ---------------------------------------------------------------------- -Copyright 2003, 2005-2007, 2009, 2011-2013 by +Copyright 2003, 2005-2007, 2009, 2011-2014 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, diff --git a/freetype/include/config/ftconfig.h b/freetype/include/config/ftconfig.h index d98a3116b..22d70fd35 100644 --- a/freetype/include/config/ftconfig.h +++ b/freetype/include/config/ftconfig.h @@ -266,7 +266,16 @@ FT_BEGIN_HEADER #define FT_INT64 long #define FT_UINT64 unsigned long -#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ + /*************************************************************************/ + /* */ + /* A 64-bit data type may create compilation problems if you compile */ + /* in strict ANSI mode. To avoid them, we disable other 64-bit data */ + /* types if __STDC__ is defined. You can however ignore this rule */ + /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ + /* */ +#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 ) + +#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ /* this compiler provides the __int64 type */ #define FT_LONG64 @@ -300,27 +309,9 @@ FT_BEGIN_HEADER #define FT_INT64 long long int #define FT_UINT64 unsigned long long int -#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */ - - - /*************************************************************************/ - /* */ - /* A 64-bit data type will create compilation problems if you compile */ - /* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */ - /* is defined. You can however ignore this rule by defining the */ - /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ - /* */ -#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 ) - -#ifdef __STDC__ - - /* undefine the 64-bit macros in strict ANSI compilation mode */ -#undef FT_LONG64 -#undef FT_INT64 - -#endif /* __STDC__ */ +#endif /* _MSC_VER */ -#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */ +#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */ #ifdef FT_LONG64 typedef FT_INT64 FT_Int64; @@ -333,219 +324,6 @@ FT_BEGIN_HEADER #define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT -#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER - /* Provide assembler fragments for performance-critical functions. */ - /* These must be defined `static __inline__' with GCC. */ - -#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */ - -#define FT_MULFIX_ASSEMBLER FT_MulFix_arm - - /* documentation is in freetype.h */ - - static __inline FT_Int32 - FT_MulFix_arm( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 t, t2; - - - __asm - { - smull t2, t, b, a /* (lo=t2,hi=t) = a*b */ - mov a, t, asr #31 /* a = (hi >> 31) */ - add a, a, #0x8000 /* a += 0x8000 */ - adds t2, t2, a /* t2 += a */ - adc t, t, #0 /* t += carry */ - mov a, t2, lsr #16 /* a = t2 >> 16 */ - orr a, a, t, lsl #16 /* a |= t << 16 */ - } - return a; - } - -#endif /* __CC_ARM || __ARMCC__ */ - - -#ifdef __GNUC__ - -#if defined( __arm__ ) && \ - ( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \ - !( defined( __CC_ARM ) || defined( __ARMCC__ ) ) - -#define FT_MULFIX_ASSEMBLER FT_MulFix_arm - - /* documentation is in freetype.h */ - - static __inline__ FT_Int32 - FT_MulFix_arm( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 t, t2; - - - __asm__ __volatile__ ( - "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ - "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ -#if defined( __clang__ ) && defined( __thumb2__ ) - "add.w %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ -#else - "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ -#endif - "adds %1, %1, %0\n\t" /* %1 += %0 */ - "adc %2, %2, #0\n\t" /* %2 += carry */ - "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */ - "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */ - : "=r"(a), "=&r"(t2), "=&r"(t) - : "r"(a), "r"(b) - : "cc" ); - return a; - } - -#endif /* __arm__ && */ - /* ( __thumb2__ || !__thumb__ ) && */ - /* !( __CC_ARM || __ARMCC__ ) */ - - -#if defined( __i386__ ) - -#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 - - /* documentation is in freetype.h */ - - static __inline__ FT_Int32 - FT_MulFix_i386( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 result; - - - __asm__ __volatile__ ( - "imul %%edx\n" - "movl %%edx, %%ecx\n" - "sarl $31, %%ecx\n" - "addl $0x8000, %%ecx\n" - "addl %%ecx, %%eax\n" - "adcl $0, %%edx\n" - "shrl $16, %%eax\n" - "shll $16, %%edx\n" - "addl %%edx, %%eax\n" - : "=a"(result), "=d"(b) - : "a"(a), "d"(b) - : "%ecx", "cc" ); - return result; - } - -#endif /* i386 */ - -#endif /* __GNUC__ */ - - -#ifdef _MSC_VER /* Visual C++ */ - -#ifdef _M_IX86 - -#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 - - /* documentation is in freetype.h */ - - static __inline FT_Int32 - FT_MulFix_i386( FT_Int32 a, - FT_Int32 b ) - { - register FT_Int32 result; - - __asm - { - mov eax, a - mov edx, b - imul edx - mov ecx, edx - sar ecx, 31 - add ecx, 8000h - add eax, ecx - adc edx, 0 - shr eax, 16 - shl edx, 16 - add eax, edx - mov result, eax - } - return result; - } - -#endif /* _M_IX86 */ - -#endif /* _MSC_VER */ - - -#if defined( __GNUC__ ) && defined( __x86_64__ ) - -#define FT_MULFIX_ASSEMBLER FT_MulFix_x86_64 - - static __inline__ FT_Int32 - FT_MulFix_x86_64( FT_Int32 a, - FT_Int32 b ) - { - /* Temporarily disable the warning that C90 doesn't support */ - /* `long long'. */ -#if ( __GNUC__ > 4 ) || ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 6 ) ) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wlong-long" -#endif - -#if 1 - /* Technically not an assembly fragment, but GCC does a really good */ - /* job at inlining it and generating good machine code for it. */ - long long ret, tmp; - - - ret = (long long)a * b; - tmp = ret >> 63; - ret += 0x8000 + tmp; - - return (FT_Int32)( ret >> 16 ); -#else - - /* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine */ - /* code from the lines below. The main issue is that `wide_a' is not */ - /* properly initialized by sign-extending `a'. Instead, the generated */ - /* machine code assumes that the register that contains `a' on input */ - /* can be used directly as a 64-bit value, which is wrong most of the */ - /* time. */ - long long wide_a = (long long)a; - long long wide_b = (long long)b; - long long result; - - - __asm__ __volatile__ ( - "imul %2, %1\n" - "mov %1, %0\n" - "sar $63, %0\n" - "lea 0x8000(%1, %0), %0\n" - "sar $16, %0\n" - : "=&r"(result), "=&r"(wide_a) - : "r"(wide_b) - : "cc" ); - - return (FT_Int32)result; -#endif - -#if ( __GNUC__ > 4 ) || ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 6 ) ) -#pragma GCC diagnostic pop -#endif - } - -#endif /* __GNUC__ && __x86_64__ */ - -#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ - - -#ifdef FT_CONFIG_OPTION_INLINE_MULFIX -#ifdef FT_MULFIX_ASSEMBLER -#define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER -#endif -#endif - - #ifdef FT_MAKE_OPTION_SINGLE_OBJECT #define FT_LOCAL( x ) static x diff --git a/freetype/include/config/ftoption.h b/freetype/include/config/ftoption.h index 5b11f0e03..2b0b67e7a 100644 --- a/freetype/include/config/ftoption.h +++ b/freetype/include/config/ftoption.h @@ -4,7 +4,7 @@ /* */ /* User-selectable configuration macros (specification only). */ /* */ -/* Copyright 1996-2013 by */ +/* Copyright 1996-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -61,7 +61,7 @@ FT_BEGIN_HEADER /* that are statically linked to the library at compile time. By */ /* default, this file is . */ /* */ - /* We highly recommend using the third method whenever possible. */ + /* We highly recommend using the third method whenever possible. */ /* */ /*************************************************************************/ @@ -216,7 +216,7 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ - /* PNG bitmap support. */ + /* PNG bitmap support. */ /* */ /* FreeType now handles loading color bitmap glyphs in the PNG format. */ /* This requires help from the external libpng library. Uncompressed */ @@ -230,7 +230,7 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ - /* HarfBuzz support. */ + /* HarfBuzz support. */ /* */ /* FreeType uses the HarfBuzz library to improve auto-hinting of */ /* OpenType fonts. If available, many glyphs not directly addressable */ @@ -771,6 +771,30 @@ FT_BEGIN_HEADER /*************************************************************************/ + /*************************************************************************/ + /* */ + /* Using CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4} it is */ + /* possible to set up the default values of the four control points that */ + /* define the stem darkening behaviour of the (new) CFF engine. For */ + /* more details please read the documentation of the */ + /* `darkening-parameters' property of the cff driver module (file */ + /* `ftcffdrv.h'), which allows the control at run-time. */ + /* */ + /* Do *not* undefine these macros! */ + /* */ +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 500 +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 400 + +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 1000 +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 275 + +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 1667 +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 275 + +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 2333 +#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 0 + + /*************************************************************************/ /* */ /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */ @@ -820,8 +844,8 @@ FT_BEGIN_HEADER /* - * This macro is obsolete. Support has been removed in FreeType - * version 2.5. + * This macro is obsolete. Support has been removed in FreeType + * version 2.5. */ /* #define FT_CONFIG_OPTION_OLD_INTERNALS */ @@ -837,6 +861,35 @@ FT_BEGIN_HEADER #define TT_USE_BYTECODE_INTERPRETER #endif + + /* + * Check CFF darkening parameters. The checks are the same as in function + * `cff_property_set' in file `cffdrivr.c'. + */ +#if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0 || \ + \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0 || \ + \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 > \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 > \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 > \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 || \ + \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \ + CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500 +#error "Invalid CFF darkening parameters!" +#endif + FT_END_HEADER diff --git a/freetype/include/freetype.h b/freetype/include/freetype.h index fb62b625f..27fd44bfc 100644 --- a/freetype/include/freetype.h +++ b/freetype/include/freetype.h @@ -113,7 +113,8 @@ FT_BEGIN_HEADER /* The FreeType~2 base font interface. */ /* */ /* */ - /* This section describes the public high-level API of FreeType~2. */ + /* This section describes the most important public high-level API */ + /* functions of FreeType~2. */ /* */ /* */ /* FT_Library */ @@ -122,6 +123,7 @@ FT_BEGIN_HEADER /* FT_GlyphSlot */ /* FT_CharMap */ /* FT_Encoding */ + /* FT_ENC_TAG */ /* */ /* FT_FaceRec */ /* */ @@ -138,8 +140,22 @@ FT_BEGIN_HEADER /* FT_FACE_FLAG_MULTIPLE_MASTERS */ /* FT_FACE_FLAG_GLYPH_NAMES */ /* FT_FACE_FLAG_EXTERNAL_STREAM */ - /* FT_FACE_FLAG_FAST_GLYPHS */ /* FT_FACE_FLAG_HINTER */ + /* FT_FACE_FLAG_TRICKY */ + /* */ + /* FT_HAS_HORIZONTAL */ + /* FT_HAS_VERTICAL */ + /* FT_HAS_KERNING */ + /* FT_HAS_FIXED_SIZES */ + /* FT_HAS_GLYPH_NAMES */ + /* FT_HAS_MULTIPLE_MASTERS */ + /* FT_HAS_COLOR */ + /* */ + /* FT_IS_SFNT */ + /* FT_IS_SCALABLE */ + /* FT_IS_FIXED_WIDTH */ + /* FT_IS_CID_KEYED */ + /* FT_IS_TRICKY */ /* */ /* FT_STYLE_FLAG_BOLD */ /* FT_STYLE_FLAG_ITALIC */ @@ -158,6 +174,7 @@ FT_BEGIN_HEADER /* */ /* FT_New_Face */ /* FT_Done_Face */ + /* FT_Reference_Face */ /* FT_New_Memory_Face */ /* FT_Open_Face */ /* FT_Open_Args */ @@ -170,10 +187,13 @@ FT_BEGIN_HEADER /* FT_Request_Size */ /* FT_Select_Size */ /* FT_Size_Request_Type */ + /* FT_Size_RequestRec */ /* FT_Size_Request */ /* FT_Set_Transform */ /* FT_Load_Glyph */ /* FT_Get_Char_Index */ + /* FT_Get_First_Char */ + /* FT_Get_Next_Char */ /* FT_Get_Name_Index */ /* FT_Load_Char */ /* */ @@ -190,11 +210,11 @@ FT_BEGIN_HEADER /* FT_LOAD_NO_SCALE */ /* FT_LOAD_NO_HINTING */ /* FT_LOAD_NO_BITMAP */ - /* FT_LOAD_CROP_BITMAP */ + /* FT_LOAD_NO_AUTOHINT */ + /* FT_LOAD_COLOR */ /* */ /* FT_LOAD_VERTICAL_LAYOUT */ /* FT_LOAD_IGNORE_TRANSFORM */ - /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */ /* FT_LOAD_FORCE_AUTOHINT */ /* FT_LOAD_NO_RECURSE */ /* FT_LOAD_PEDANTIC */ @@ -205,6 +225,8 @@ FT_BEGIN_HEADER /* FT_LOAD_TARGET_LCD */ /* FT_LOAD_TARGET_LCD_V */ /* */ + /* FT_LOAD_TARGET_MODE */ + /* */ /* FT_Render_Glyph */ /* FT_Render_Mode */ /* FT_Get_Kerning */ @@ -218,14 +240,22 @@ FT_BEGIN_HEADER /* FT_Set_Charmap */ /* FT_Get_Charmap_Index */ /* */ - /* FT_FSTYPE_INSTALLABLE_EMBEDDING */ - /* FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING */ - /* FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING */ - /* FT_FSTYPE_EDITABLE_EMBEDDING */ - /* FT_FSTYPE_NO_SUBSETTING */ - /* FT_FSTYPE_BITMAP_EMBEDDING_ONLY */ - /* */ /* FT_Get_FSType_Flags */ + /* FT_Get_SubGlyph_Info */ + /* */ + /* FT_Face_Internal */ + /* FT_Size_Internal */ + /* FT_Slot_Internal */ + /* */ + /* FT_FACE_FLAG_XXX */ + /* FT_STYLE_FLAG_XXX */ + /* FT_OPEN_XXX */ + /* FT_LOAD_XXX */ + /* FT_LOAD_TARGET_XXX */ + /* FT_SUBGLYPH_FLAG_XXX */ + /* FT_FSTYPE_XXX */ + /* */ + /* FT_HAS_FAST_GLYPHS */ /* */ /*************************************************************************/ @@ -376,6 +406,13 @@ FT_BEGIN_HEADER typedef struct FT_LibraryRec_ *FT_Library; + /*************************************************************************/ + /* */ + /*
                  */ + /* module_management */ + /* */ + /*************************************************************************/ + /*************************************************************************/ /* */ /* */ @@ -415,6 +452,13 @@ FT_BEGIN_HEADER typedef struct FT_RendererRec_* FT_Renderer; + /*************************************************************************/ + /* */ + /*
                  */ + /* base_interface */ + /* */ + /*************************************************************************/ + /*************************************************************************/ /* */ /* */ @@ -727,15 +771,8 @@ FT_BEGIN_HEADER } FT_Encoding; - /*************************************************************************/ - /* */ - /* */ - /* ft_encoding_xxx */ - /* */ - /* */ - /* These constants are deprecated; use the corresponding @FT_Encoding */ - /* values instead. */ - /* */ + /* these constants are deprecated; use the corresponding `FT_Encoding' */ + /* values instead */ #define ft_encoding_none FT_ENCODING_NONE #define ft_encoding_unicode FT_ENCODING_UNICODE #define ft_encoding_symbol FT_ENCODING_MS_SYMBOL @@ -1570,15 +1607,15 @@ FT_BEGIN_HEADER /* change between calls of @FT_Load_Glyph and a */ /* few other functions. */ /* */ - /* bitmap_left :: This is the bitmap's left bearing expressed */ - /* in integer pixels. Of course, this is only */ - /* valid if the format is */ - /* @FT_GLYPH_FORMAT_BITMAP. */ + /* bitmap_left :: The bitmap's left bearing expressed in */ + /* integer pixels. Only valid if the format is */ + /* @FT_GLYPH_FORMAT_BITMAP, this is, if the */ + /* glyph slot contains a bitmap. */ /* */ - /* bitmap_top :: This is the bitmap's top bearing expressed in */ - /* integer pixels. Remember that this is the */ - /* distance from the baseline to the top-most */ - /* glyph scanline, upwards y~coordinates being */ + /* bitmap_top :: The bitmap's top bearing expressed in integer */ + /* pixels. Remember that this is the distance */ + /* from the baseline to the top-most glyph */ + /* scanline, upwards y~coordinates being */ /* *positive*. */ /* */ /* outline :: The outline descriptor for the current glyph */ @@ -1592,7 +1629,6 @@ FT_BEGIN_HEADER /* This field is only valid for the composite */ /* glyph format that should normally only be */ /* loaded with the @FT_LOAD_NO_RECURSE flag. */ - /* For now this is internal to FreeType. */ /* */ /* subglyphs :: An array of subglyph descriptors for */ /* composite glyphs. There are `num_subglyphs' */ @@ -1783,16 +1819,6 @@ FT_BEGIN_HEADER /* */ /* FT_OPEN_PARAMS :: Use the `num_params' and `params' fields. */ /* */ - /* ft_open_memory :: Deprecated; use @FT_OPEN_MEMORY instead. */ - /* */ - /* ft_open_stream :: Deprecated; use @FT_OPEN_STREAM instead. */ - /* */ - /* ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead. */ - /* */ - /* ft_open_driver :: Deprecated; use @FT_OPEN_DRIVER instead. */ - /* */ - /* ft_open_params :: Deprecated; use @FT_OPEN_PARAMS instead. */ - /* */ /* */ /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */ /* flags are mutually exclusive. */ @@ -1803,11 +1829,14 @@ FT_BEGIN_HEADER #define FT_OPEN_DRIVER 0x8 #define FT_OPEN_PARAMS 0x10 -#define ft_open_memory FT_OPEN_MEMORY /* deprecated */ -#define ft_open_stream FT_OPEN_STREAM /* deprecated */ -#define ft_open_pathname FT_OPEN_PATHNAME /* deprecated */ -#define ft_open_driver FT_OPEN_DRIVER /* deprecated */ -#define ft_open_params FT_OPEN_PARAMS /* deprecated */ + + /* these constants are deprecated; use the corresponding `FT_OPEN_XXX' */ + /* values instead */ +#define ft_open_memory FT_OPEN_MEMORY +#define ft_open_stream FT_OPEN_STREAM +#define ft_open_pathname FT_OPEN_PATHNAME +#define ft_open_driver FT_OPEN_DRIVER +#define ft_open_params FT_OPEN_PARAMS /*************************************************************************/ @@ -1872,22 +1901,22 @@ FT_BEGIN_HEADER /* The stream type is determined by the contents of `flags' that */ /* are tested in the following order by @FT_Open_Face: */ /* */ - /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */ + /* If the @FT_OPEN_MEMORY bit is set, assume that this is a */ /* memory file of `memory_size' bytes, located at `memory_address'. */ /* The data are are not copied, and the client is responsible for */ /* releasing and destroying them _after_ the corresponding call to */ /* @FT_Done_Face. */ /* */ - /* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */ + /* Otherwise, if the @FT_OPEN_STREAM bit is set, assume that a */ /* custom input stream `stream' is used. */ /* */ - /* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */ + /* Otherwise, if the @FT_OPEN_PATHNAME bit is set, assume that this */ /* is a normal file and use `pathname' to open it. */ /* */ - /* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to */ + /* If the @FT_OPEN_DRIVER bit is set, @FT_Open_Face only tries to */ /* open the file with the driver whose handler is in `driver'. */ /* */ - /* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */ + /* If the @FT_OPEN_PARAMS bit is set, the parameters given by */ /* `num_params' and `params' is used. They are ignored otherwise. */ /* */ /* Ideally, both the `pathname' and `params' fields should be tagged */ @@ -2541,11 +2570,6 @@ FT_BEGIN_HEADER * Indicates that the auto-hinter is preferred over the font's native * hinter. See also the note below. * - * FT_LOAD_CROP_BITMAP :: - * Indicates that the font driver should crop the loaded bitmap glyph - * (i.e., remove all space around its black bits). Not all drivers - * implement this. - * * FT_LOAD_PEDANTIC :: * Indicates that the font driver should perform pedantic verifications * during glyph loading. This is mostly used to detect broken glyphs @@ -2556,18 +2580,12 @@ FT_BEGIN_HEADER * result in partially hinted or distorted glyphs in case a glyph's * bytecode is buggy. * - * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH :: - * Ignored. Deprecated. - * * FT_LOAD_NO_RECURSE :: - * This flag is only used internally. It merely indicates that the - * font driver should not load composite glyphs recursively. Instead, - * it should set the `num_subglyph' and `subglyphs' values of the - * glyph slot accordingly, and set `glyph->format' to - * @FT_GLYPH_FORMAT_COMPOSITE. - * - * The description of sub-glyphs is not available to client - * applications for now. + * Indicate that the font driver should not load composite glyphs + * recursively. Instead, it should set the `num_subglyph' and + * `subglyphs' values of the glyph slot accordingly, and set + * `glyph->format' to @FT_GLYPH_FORMAT_COMPOSITE. The description of + * subglyphs can then be accessed with @FT_Get_SubGlyph_Info. * * This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM. * @@ -2600,6 +2618,12 @@ FT_BEGIN_HEADER * bitmaps transparently. Those bitmaps will be in the * @FT_PIXEL_MODE_GRAY format. * + * FT_LOAD_CROP_BITMAP :: + * Ignored. Deprecated. + * + * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH :: + * Ignored. Deprecated. + * * @note: * By default, hinting is enabled and the font's native hinter (see * @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter. You can @@ -2836,19 +2860,8 @@ FT_BEGIN_HEADER } FT_Render_Mode; - /*************************************************************************/ - /* */ - /* */ - /* ft_render_mode_xxx */ - /* */ - /* */ - /* These constants are deprecated. Use the corresponding */ - /* @FT_Render_Mode values instead. */ - /* */ - /* */ - /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */ - /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */ - /* */ + /* these constants are deprecated; use the corresponding */ + /* `FT_Render_Mode' values instead */ #define ft_render_mode_normal FT_RENDER_MODE_NORMAL #define ft_render_mode_mono FT_RENDER_MODE_MONO @@ -2912,39 +2925,10 @@ FT_BEGIN_HEADER } FT_Kerning_Mode; - /*************************************************************************/ - /* */ - /* */ - /* ft_kerning_default */ - /* */ - /* */ - /* This constant is deprecated. Please use @FT_KERNING_DEFAULT */ - /* instead. */ - /* */ + /* these constants are deprecated; use the corresponding */ + /* `FT_Kerning_Mode' values instead */ #define ft_kerning_default FT_KERNING_DEFAULT - - - /*************************************************************************/ - /* */ - /* */ - /* ft_kerning_unfitted */ - /* */ - /* */ - /* This constant is deprecated. Please use @FT_KERNING_UNFITTED */ - /* instead. */ - /* */ #define ft_kerning_unfitted FT_KERNING_UNFITTED - - - /*************************************************************************/ - /* */ - /* */ - /* ft_kerning_unscaled */ - /* */ - /* */ - /* This constant is deprecated. Please use @FT_KERNING_UNSCALED */ - /* instead. */ - /* */ #define ft_kerning_unscaled FT_KERNING_UNSCALED @@ -3065,9 +3049,8 @@ FT_BEGIN_HEADER /* glyph index~0 always corresponds to the `missing glyph' (called */ /* `.notdef'). */ /* */ - /* This function is not compiled within the library if the config */ - /* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */ - /* `ftoptions.h'. */ + /* This function always returns an error if the config macro */ + /* `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is not defined in `ftoptions.h'. */ /* */ FT_EXPORT( FT_Error ) FT_Get_Glyph_Name( FT_Face face, @@ -3515,8 +3498,8 @@ FT_BEGIN_HEADER /* */ /* http://www.unicode.org/reports/tr37/ */ /* */ - /* To date (November 2012), the character with the most variants is */ - /* U+9089, having 31 such IVS. */ + /* To date (November 2014), the character with the most variants is */ + /* U+9089, having 32 such IVS. */ /* */ /* Adobe and MS decided to support IVS with a new cmap subtable */ /* (format~14). It is an odd subtable because it is not a mapping of */ @@ -3767,12 +3750,6 @@ FT_BEGIN_HEADER FT_Long c ); - /* */ - - /* The following #if 0 ... #endif is for the documentation formatter, */ - /* hiding the internal `FT_MULFIX_INLINED' macro. */ - -#if 0 /*************************************************************************/ /* */ /* */ @@ -3806,17 +3783,6 @@ FT_BEGIN_HEADER FT_MulFix( FT_Long a, FT_Long b ); - /* */ -#endif - -#ifdef FT_MULFIX_INLINED -#define FT_MulFix( a, b ) FT_MULFIX_INLINED( a, b ) -#else - FT_EXPORT( FT_Long ) - FT_MulFix( FT_Long a, - FT_Long b ); -#endif - /*************************************************************************/ /* */ @@ -3829,18 +3795,12 @@ FT_BEGIN_HEADER /* used to divide a given value by a 16.16 fixed-point factor. */ /* */ /* */ - /* a :: The first multiplier. */ - /* b :: The second multiplier. Use a 16.16 factor here whenever */ - /* possible (see note below). */ + /* a :: The numerator. */ + /* b :: The denominator. Use a 16.16 factor here. */ /* */ /* */ /* The result of `(a*0x10000)/b'. */ /* */ - /* */ - /* The optimization for FT_DivFix() is simple: If (a~<<~16) fits in */ - /* 32~bits, then the division is computed directly. Otherwise, we */ - /* use a specialized version of @FT_MulDiv. */ - /* */ FT_EXPORT( FT_Long ) FT_DivFix( FT_Long a, FT_Long b ); @@ -3940,6 +3900,18 @@ FT_BEGIN_HEADER /* even a new release of FreeType with only documentation changes */ /* increases the version number. */ /* */ + /* */ + /* FT_Library_Version */ + /* */ + /* FREETYPE_MAJOR */ + /* FREETYPE_MINOR */ + /* FREETYPE_PATCH */ + /* */ + /* FT_Face_CheckTrueTypePatents */ + /* FT_Face_SetUnpatentedHinting */ + /* */ + /* FREETYPE_XXX */ + /* */ /*************************************************************************/ @@ -3965,7 +3937,7 @@ FT_BEGIN_HEADER */ #define FREETYPE_MAJOR 2 #define FREETYPE_MINOR 5 -#define FREETYPE_PATCH 3 +#define FREETYPE_PATCH 5 /*************************************************************************/ diff --git a/freetype/include/ftadvanc.h b/freetype/include/ftadvanc.h index 8f7e2fce5..955f93fa1 100644 --- a/freetype/include/ftadvanc.h +++ b/freetype/include/ftadvanc.h @@ -4,7 +4,7 @@ /* */ /* Quick computation of advance widths (specification only). */ /* */ -/* Copyright 2008, 2013 by */ +/* Copyright 2008, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -48,6 +48,11 @@ FT_BEGIN_HEADER * @description: * This section contains functions to quickly extract advance values * without handling glyph outlines, if possible. + * + * @order: + * FT_Get_Advance + * FT_Get_Advances + * */ @@ -171,7 +176,7 @@ FT_BEGIN_HEADER FT_Int32 load_flags, FT_Fixed *padvances ); -/* */ + /* */ FT_END_HEADER diff --git a/freetype/include/ftautoh.h b/freetype/include/ftautoh.h index 936791e72..59191abbf 100644 --- a/freetype/include/ftautoh.h +++ b/freetype/include/ftautoh.h @@ -245,12 +245,12 @@ FT_BEGIN_HEADER * The data exchange structure for the @glyph-to-script-map property. * */ - typedef struct FT_Prop_GlyphToScriptMap_ - { - FT_Face face; - FT_Byte* map; + typedef struct FT_Prop_GlyphToScriptMap_ + { + FT_Face face; + FT_Byte* map; - } FT_Prop_GlyphToScriptMap; + } FT_Prop_GlyphToScriptMap; /************************************************************************** @@ -384,15 +384,15 @@ FT_BEGIN_HEADER * The data exchange structure for the @increase-x-height property. * */ - typedef struct FT_Prop_IncreaseXHeight_ - { - FT_Face face; - FT_UInt limit; + typedef struct FT_Prop_IncreaseXHeight_ + { + FT_Face face; + FT_UInt limit; - } FT_Prop_IncreaseXHeight; + } FT_Prop_IncreaseXHeight; + /* */ - /* */ FT_END_HEADER diff --git a/freetype/include/ftbbox.h b/freetype/include/ftbbox.h index 8938841a6..d6800e240 100644 --- a/freetype/include/ftbbox.h +++ b/freetype/include/ftbbox.h @@ -85,7 +85,6 @@ FT_BEGIN_HEADER FT_Outline_Get_BBox( FT_Outline* outline, FT_BBox *abbox ); - /* */ diff --git a/freetype/include/ftbdf.h b/freetype/include/ftbdf.h index 8b3c41115..6d262e414 100644 --- a/freetype/include/ftbdf.h +++ b/freetype/include/ftbdf.h @@ -53,7 +53,7 @@ FT_BEGIN_HEADER /********************************************************************** * * @enum: - * FT_PropertyType + * BDF_PropertyType * * @description: * A list of BDF property types. @@ -200,7 +200,7 @@ FT_BEGIN_HEADER const char* prop_name, BDF_PropertyRec *aproperty ); - /* */ + /* */ FT_END_HEADER diff --git a/freetype/include/ftbitmap.h b/freetype/include/ftbitmap.h index 7dbf5ba3f..eae716904 100644 --- a/freetype/include/ftbitmap.h +++ b/freetype/include/ftbitmap.h @@ -4,7 +4,7 @@ /* */ /* FreeType utility functions for bitmaps (specification). */ /* */ -/* Copyright 2004-2006, 2008, 2013 by */ +/* Copyright 2004-2006, 2008, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -45,7 +45,9 @@ FT_BEGIN_HEADER /* Handling FT_Bitmap objects. */ /* */ /* */ - /* This section contains functions for converting FT_Bitmap objects. */ + /* This section contains functions for handling @FT_Bitmap objects. */ + /* Note that none of the functions changes the bitmap's `flow' (as */ + /* indicated by the sign of the `pitch' field in `FT_Bitmap'). */ /* */ /*************************************************************************/ @@ -122,6 +124,9 @@ FT_BEGIN_HEADER /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */ /* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */ /* */ + /* Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format */ + /* are converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp). */ + /* */ FT_EXPORT( FT_Error ) FT_Bitmap_Embolden( FT_Library library, FT_Bitmap* bitmap, diff --git a/freetype/include/ftbzip2.h b/freetype/include/ftbzip2.h index 1bf81b15e..4dce161fd 100644 --- a/freetype/include/ftbzip2.h +++ b/freetype/include/ftbzip2.h @@ -91,7 +91,7 @@ FT_BEGIN_HEADER FT_Stream_OpenBzip2( FT_Stream stream, FT_Stream source ); - /* */ + /* */ FT_END_HEADER diff --git a/freetype/include/ftcache.h b/freetype/include/ftcache.h index a5d7100a3..a30e925cc 100644 --- a/freetype/include/ftcache.h +++ b/freetype/include/ftcache.h @@ -4,7 +4,7 @@ /* */ /* FreeType Cache subsystem (specification). */ /* */ -/* Copyright 1996-2008, 2010, 2013 by */ +/* Copyright 1996-2008, 2010, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -209,10 +209,10 @@ FT_BEGIN_HEADER typedef FT_Error (*FTC_Face_Requester)( FTC_FaceID face_id, FT_Library library, - FT_Pointer request_data, + FT_Pointer req_data, FT_Face* aface ); - /* */ + /* */ /*************************************************************************/ @@ -1046,8 +1046,8 @@ FT_BEGIN_HEADER FTC_SBit *sbit, FTC_Node *anode ); + /* */ - /* */ FT_END_HEADER diff --git a/freetype/include/ftcffdrv.h b/freetype/include/ftcffdrv.h index e4d039d02..f7031bc88 100644 --- a/freetype/include/ftcffdrv.h +++ b/freetype/include/ftcffdrv.h @@ -4,7 +4,7 @@ /* */ /* FreeType API for controlling the CFF driver (specification only). */ /* */ -/* Copyright 2013 by */ +/* Copyright 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -108,6 +108,12 @@ FT_BEGIN_HEADER * in one of four ways, top edge up or down, bottom edge up or down. * Unless there are conflicting hstems, the smallest movement is taken * to minimize distortion. + * + * @order: + * hinting-engine + * no-stem-darkening + * darkening-parameters + * */ @@ -212,9 +218,11 @@ FT_BEGIN_HEADER * stem width >= 2.333px: darkening amount = 0px * } * - * and piecewise linear in-between. Using the `darkening-parameters' - * property, these four control points can be changed, as the following - * example demonstrates. + * and piecewise linear in-between. At configuration time, these four + * control points can be set with the macro + * `CFF_CONFIG_OPTION_DARKENING_PARAMETERS'. At runtime, the control + * points can be changed using the `darkening-parameters' property, as + * the following example demonstrates. * * { * FT_Library library; @@ -242,8 +250,8 @@ FT_BEGIN_HEADER * */ + /* */ - /* */ FT_END_HEADER diff --git a/freetype/include/ftcid.h b/freetype/include/ftcid.h index 203a30caf..17550d87b 100644 --- a/freetype/include/ftcid.h +++ b/freetype/include/ftcid.h @@ -156,7 +156,8 @@ FT_BEGIN_HEADER FT_UInt glyph_index, FT_UInt *cid ); - /* */ + /* */ + FT_END_HEADER diff --git a/freetype/include/fterrdef.h b/freetype/include/fterrdef.h index 76c7b9e36..99b2fadec 100644 --- a/freetype/include/fterrdef.h +++ b/freetype/include/fterrdef.h @@ -31,218 +31,218 @@ /* generic errors */ - FT_NOERRORDEF_( Ok, 0x00, \ + FT_NOERRORDEF_( Ok, 0x00, "no error" ) - FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \ + FT_ERRORDEF_( Cannot_Open_Resource, 0x01, "cannot open resource" ) - FT_ERRORDEF_( Unknown_File_Format, 0x02, \ + FT_ERRORDEF_( Unknown_File_Format, 0x02, "unknown file format" ) - FT_ERRORDEF_( Invalid_File_Format, 0x03, \ + FT_ERRORDEF_( Invalid_File_Format, 0x03, "broken file" ) - FT_ERRORDEF_( Invalid_Version, 0x04, \ + FT_ERRORDEF_( Invalid_Version, 0x04, "invalid FreeType version" ) - FT_ERRORDEF_( Lower_Module_Version, 0x05, \ + FT_ERRORDEF_( Lower_Module_Version, 0x05, "module version is too low" ) - FT_ERRORDEF_( Invalid_Argument, 0x06, \ + FT_ERRORDEF_( Invalid_Argument, 0x06, "invalid argument" ) - FT_ERRORDEF_( Unimplemented_Feature, 0x07, \ + FT_ERRORDEF_( Unimplemented_Feature, 0x07, "unimplemented feature" ) - FT_ERRORDEF_( Invalid_Table, 0x08, \ + FT_ERRORDEF_( Invalid_Table, 0x08, "broken table" ) - FT_ERRORDEF_( Invalid_Offset, 0x09, \ + FT_ERRORDEF_( Invalid_Offset, 0x09, "broken offset within table" ) - FT_ERRORDEF_( Array_Too_Large, 0x0A, \ + FT_ERRORDEF_( Array_Too_Large, 0x0A, "array allocation size too large" ) - FT_ERRORDEF_( Missing_Module, 0x0B, \ + FT_ERRORDEF_( Missing_Module, 0x0B, "missing module" ) - FT_ERRORDEF_( Missing_Property, 0x0C, \ + FT_ERRORDEF_( Missing_Property, 0x0C, "missing property" ) /* glyph/character errors */ - FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \ + FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, "invalid glyph index" ) - FT_ERRORDEF_( Invalid_Character_Code, 0x11, \ + FT_ERRORDEF_( Invalid_Character_Code, 0x11, "invalid character code" ) - FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \ + FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, "unsupported glyph image format" ) - FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \ + FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, "cannot render this glyph format" ) - FT_ERRORDEF_( Invalid_Outline, 0x14, \ + FT_ERRORDEF_( Invalid_Outline, 0x14, "invalid outline" ) - FT_ERRORDEF_( Invalid_Composite, 0x15, \ + FT_ERRORDEF_( Invalid_Composite, 0x15, "invalid composite glyph" ) - FT_ERRORDEF_( Too_Many_Hints, 0x16, \ + FT_ERRORDEF_( Too_Many_Hints, 0x16, "too many hints" ) - FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \ + FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, "invalid pixel size" ) /* handle errors */ - FT_ERRORDEF_( Invalid_Handle, 0x20, \ + FT_ERRORDEF_( Invalid_Handle, 0x20, "invalid object handle" ) - FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \ + FT_ERRORDEF_( Invalid_Library_Handle, 0x21, "invalid library handle" ) - FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \ + FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, "invalid module handle" ) - FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \ + FT_ERRORDEF_( Invalid_Face_Handle, 0x23, "invalid face handle" ) - FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \ + FT_ERRORDEF_( Invalid_Size_Handle, 0x24, "invalid size handle" ) - FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \ + FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, "invalid glyph slot handle" ) - FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \ + FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, "invalid charmap handle" ) - FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \ + FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, "invalid cache manager handle" ) - FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \ + FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, "invalid stream handle" ) /* driver errors */ - FT_ERRORDEF_( Too_Many_Drivers, 0x30, \ + FT_ERRORDEF_( Too_Many_Drivers, 0x30, "too many modules" ) - FT_ERRORDEF_( Too_Many_Extensions, 0x31, \ + FT_ERRORDEF_( Too_Many_Extensions, 0x31, "too many extensions" ) /* memory errors */ - FT_ERRORDEF_( Out_Of_Memory, 0x40, \ + FT_ERRORDEF_( Out_Of_Memory, 0x40, "out of memory" ) - FT_ERRORDEF_( Unlisted_Object, 0x41, \ + FT_ERRORDEF_( Unlisted_Object, 0x41, "unlisted object" ) /* stream errors */ - FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \ + FT_ERRORDEF_( Cannot_Open_Stream, 0x51, "cannot open stream" ) - FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \ + FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, "invalid stream seek" ) - FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \ + FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, "invalid stream skip" ) - FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \ + FT_ERRORDEF_( Invalid_Stream_Read, 0x54, "invalid stream read" ) - FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \ + FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, "invalid stream operation" ) - FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \ + FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, "invalid frame operation" ) - FT_ERRORDEF_( Nested_Frame_Access, 0x57, \ + FT_ERRORDEF_( Nested_Frame_Access, 0x57, "nested frame access" ) - FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \ + FT_ERRORDEF_( Invalid_Frame_Read, 0x58, "invalid frame read" ) /* raster errors */ - FT_ERRORDEF_( Raster_Uninitialized, 0x60, \ + FT_ERRORDEF_( Raster_Uninitialized, 0x60, "raster uninitialized" ) - FT_ERRORDEF_( Raster_Corrupted, 0x61, \ + FT_ERRORDEF_( Raster_Corrupted, 0x61, "raster corrupted" ) - FT_ERRORDEF_( Raster_Overflow, 0x62, \ + FT_ERRORDEF_( Raster_Overflow, 0x62, "raster overflow" ) - FT_ERRORDEF_( Raster_Negative_Height, 0x63, \ + FT_ERRORDEF_( Raster_Negative_Height, 0x63, "negative height while rastering" ) /* cache errors */ - FT_ERRORDEF_( Too_Many_Caches, 0x70, \ + FT_ERRORDEF_( Too_Many_Caches, 0x70, "too many registered caches" ) /* TrueType and SFNT errors */ - FT_ERRORDEF_( Invalid_Opcode, 0x80, \ + FT_ERRORDEF_( Invalid_Opcode, 0x80, "invalid opcode" ) - FT_ERRORDEF_( Too_Few_Arguments, 0x81, \ + FT_ERRORDEF_( Too_Few_Arguments, 0x81, "too few arguments" ) - FT_ERRORDEF_( Stack_Overflow, 0x82, \ + FT_ERRORDEF_( Stack_Overflow, 0x82, "stack overflow" ) - FT_ERRORDEF_( Code_Overflow, 0x83, \ + FT_ERRORDEF_( Code_Overflow, 0x83, "code overflow" ) - FT_ERRORDEF_( Bad_Argument, 0x84, \ + FT_ERRORDEF_( Bad_Argument, 0x84, "bad argument" ) - FT_ERRORDEF_( Divide_By_Zero, 0x85, \ + FT_ERRORDEF_( Divide_By_Zero, 0x85, "division by zero" ) - FT_ERRORDEF_( Invalid_Reference, 0x86, \ + FT_ERRORDEF_( Invalid_Reference, 0x86, "invalid reference" ) - FT_ERRORDEF_( Debug_OpCode, 0x87, \ + FT_ERRORDEF_( Debug_OpCode, 0x87, "found debug opcode" ) - FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \ + FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, "found ENDF opcode in execution stream" ) - FT_ERRORDEF_( Nested_DEFS, 0x89, \ + FT_ERRORDEF_( Nested_DEFS, 0x89, "nested DEFS" ) - FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \ + FT_ERRORDEF_( Invalid_CodeRange, 0x8A, "invalid code range" ) - FT_ERRORDEF_( Execution_Too_Long, 0x8B, \ + FT_ERRORDEF_( Execution_Too_Long, 0x8B, "execution context too long" ) - FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \ + FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, "too many function definitions" ) - FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \ + FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, "too many instruction definitions" ) - FT_ERRORDEF_( Table_Missing, 0x8E, \ + FT_ERRORDEF_( Table_Missing, 0x8E, "SFNT font table missing" ) - FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \ + FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, "horizontal header (hhea) table missing" ) - FT_ERRORDEF_( Locations_Missing, 0x90, \ + FT_ERRORDEF_( Locations_Missing, 0x90, "locations (loca) table missing" ) - FT_ERRORDEF_( Name_Table_Missing, 0x91, \ + FT_ERRORDEF_( Name_Table_Missing, 0x91, "name table missing" ) - FT_ERRORDEF_( CMap_Table_Missing, 0x92, \ + FT_ERRORDEF_( CMap_Table_Missing, 0x92, "character map (cmap) table missing" ) - FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \ + FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, "horizontal metrics (hmtx) table missing" ) - FT_ERRORDEF_( Post_Table_Missing, 0x94, \ + FT_ERRORDEF_( Post_Table_Missing, 0x94, "PostScript (post) table missing" ) - FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \ + FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, "invalid horizontal metrics" ) - FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \ + FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, "invalid character map (cmap) format" ) - FT_ERRORDEF_( Invalid_PPem, 0x97, \ + FT_ERRORDEF_( Invalid_PPem, 0x97, "invalid ppem value" ) - FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \ + FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, "invalid vertical metrics" ) - FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \ + FT_ERRORDEF_( Could_Not_Find_Context, 0x99, "could not find context" ) - FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \ + FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, "invalid PostScript (post) table format" ) - FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \ + FT_ERRORDEF_( Invalid_Post_Table, 0x9B, "invalid PostScript (post) table" ) /* CFF, CID, and Type 1 errors */ - FT_ERRORDEF_( Syntax_Error, 0xA0, \ + FT_ERRORDEF_( Syntax_Error, 0xA0, "opcode syntax error" ) - FT_ERRORDEF_( Stack_Underflow, 0xA1, \ + FT_ERRORDEF_( Stack_Underflow, 0xA1, "argument stack underflow" ) - FT_ERRORDEF_( Ignore, 0xA2, \ + FT_ERRORDEF_( Ignore, 0xA2, "ignore" ) - FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \ + FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, "no Unicode glyph name found" ) - FT_ERRORDEF_( Glyph_Too_Big, 0xA4, \ + FT_ERRORDEF_( Glyph_Too_Big, 0xA4, "glyph to big for hinting" ) /* BDF errors */ - FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \ + FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, "`STARTFONT' field missing" ) - FT_ERRORDEF_( Missing_Font_Field, 0xB1, \ + FT_ERRORDEF_( Missing_Font_Field, 0xB1, "`FONT' field missing" ) - FT_ERRORDEF_( Missing_Size_Field, 0xB2, \ + FT_ERRORDEF_( Missing_Size_Field, 0xB2, "`SIZE' field missing" ) - FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \ + FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, "`FONTBOUNDINGBOX' field missing" ) - FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \ + FT_ERRORDEF_( Missing_Chars_Field, 0xB4, "`CHARS' field missing" ) - FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \ + FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, "`STARTCHAR' field missing" ) - FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \ + FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, "`ENCODING' field missing" ) - FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \ + FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, "`BBX' field missing" ) - FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \ + FT_ERRORDEF_( Bbx_Too_Big, 0xB8, "`BBX' too big" ) - FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \ + FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, "Font header corrupted or missing fields" ) - FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \ + FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, "Font glyphs corrupted or missing fields" ) diff --git a/freetype/include/ftgasp.h b/freetype/include/ftgasp.h index 453d4fa42..3f3d76546 100644 --- a/freetype/include/ftgasp.h +++ b/freetype/include/ftgasp.h @@ -120,7 +120,8 @@ FT_Get_Gasp( FT_Face face, FT_UInt ppem ); -/* */ + /* */ + #endif /* _FT_GASP_H_ */ diff --git a/freetype/include/ftglyph.h b/freetype/include/ftglyph.h index 2d30ed9de..15fa6a995 100644 --- a/freetype/include/ftglyph.h +++ b/freetype/include/ftglyph.h @@ -4,7 +4,7 @@ /* */ /* FreeType convenience functions to handle glyphs (specification). */ /* */ -/* Copyright 1996-2003, 2006, 2008, 2009, 2011, 2013 by */ +/* Copyright 1996-2003, 2006, 2008, 2009, 2011, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -325,22 +325,8 @@ FT_BEGIN_HEADER } FT_Glyph_BBox_Mode; - /*************************************************************************/ - /* */ - /* */ - /* ft_glyph_bbox_xxx */ - /* */ - /* */ - /* These constants are deprecated. Use the corresponding */ - /* @FT_Glyph_BBox_Mode values instead. */ - /* */ - /* */ - /* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */ - /* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */ - /* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */ - /* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */ - /* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */ - /* */ + /* these constants are deprecated; use the corresponding */ + /* `FT_Glyph_BBox_Mode' values instead */ #define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED #define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS #define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT @@ -603,7 +589,6 @@ FT_BEGIN_HEADER FT_EXPORT( FT_Error ) FT_Matrix_Invert( FT_Matrix* matrix ); - /* */ diff --git a/freetype/include/ftgxval.h b/freetype/include/ftgxval.h index 6d38e327a..88c3d9375 100644 --- a/freetype/include/ftgxval.h +++ b/freetype/include/ftgxval.h @@ -57,9 +57,19 @@ FT_BEGIN_HEADER /* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */ /* trak, prop, lcar). */ /* */ + /* */ + /* FT_TrueTypeGX_Validate */ + /* FT_TrueTypeGX_Free */ + /* */ + /* FT_ClassicKern_Validate */ + /* FT_ClassicKern_Free */ + /* */ + /* FT_VALIDATE_GX_LENGTH */ + /* FT_VALIDATE_GXXXX */ + /* FT_VALIDATE_CKERNXXX */ + /* */ /*************************************************************************/ - /*************************************************************************/ /* */ /* */ @@ -171,8 +181,6 @@ FT_BEGIN_HEADER FT_VALIDATE_lcar ) - /* */ - /********************************************************************** * * @function: @@ -221,8 +229,6 @@ FT_BEGIN_HEADER FT_UInt table_length ); - /* */ - /********************************************************************** * * @function: @@ -248,8 +254,6 @@ FT_BEGIN_HEADER FT_Bytes table ); - /* */ - /********************************************************************** * * @enum: @@ -277,8 +281,6 @@ FT_BEGIN_HEADER #define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE ) - /* */ - /********************************************************************** * * @function: @@ -320,8 +322,6 @@ FT_BEGIN_HEADER FT_Bytes *ckern_table ); - /* */ - /********************************************************************** * * @function: @@ -346,8 +346,7 @@ FT_BEGIN_HEADER FT_ClassicKern_Free( FT_Face face, FT_Bytes table ); - - /* */ + /* */ FT_END_HEADER diff --git a/freetype/include/ftgzip.h b/freetype/include/ftgzip.h index 78e726999..eb346c6dc 100644 --- a/freetype/include/ftgzip.h +++ b/freetype/include/ftgzip.h @@ -137,8 +137,7 @@ FT_BEGIN_HEADER const FT_Byte* input, FT_ULong input_len ); - - /* */ + /* */ FT_END_HEADER diff --git a/freetype/include/ftimage.h b/freetype/include/ftimage.h index ea71a78ef..2f7ca2aaf 100644 --- a/freetype/include/ftimage.h +++ b/freetype/include/ftimage.h @@ -5,7 +5,7 @@ /* FreeType glyph image formats and default raster interface */ /* (specification). */ /* */ -/* Copyright 1996-2010, 2013 by */ +/* Copyright 1996-2010, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -193,67 +193,14 @@ FT_BEGIN_HEADER } FT_Pixel_Mode; - /*************************************************************************/ - /* */ - /* */ - /* ft_pixel_mode_xxx */ - /* */ - /* */ - /* A list of deprecated constants. Use the corresponding */ - /* @FT_Pixel_Mode values instead. */ - /* */ - /* */ - /* ft_pixel_mode_none :: See @FT_PIXEL_MODE_NONE. */ - /* ft_pixel_mode_mono :: See @FT_PIXEL_MODE_MONO. */ - /* ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY. */ - /* ft_pixel_mode_pal2 :: See @FT_PIXEL_MODE_GRAY2. */ - /* ft_pixel_mode_pal4 :: See @FT_PIXEL_MODE_GRAY4. */ - /* */ + /* these constants are deprecated; use the corresponding `FT_Pixel_Mode' */ + /* values instead. */ #define ft_pixel_mode_none FT_PIXEL_MODE_NONE #define ft_pixel_mode_mono FT_PIXEL_MODE_MONO #define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY #define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2 #define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4 - /* */ - -#if 0 - - /*************************************************************************/ - /* */ - /* */ - /* FT_Palette_Mode */ - /* */ - /* */ - /* THIS TYPE IS DEPRECATED. DO NOT USE IT! */ - /* */ - /* An enumeration type to describe the format of a bitmap palette, */ - /* used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */ - /* */ - /* */ - /* ft_palette_mode_rgb :: The palette is an array of 3-byte RGB */ - /* records. */ - /* */ - /* ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA */ - /* records. */ - /* */ - /* */ - /* As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by */ - /* FreeType, these types are not handled by the library itself. */ - /* */ - typedef enum FT_Palette_Mode_ - { - ft_palette_mode_rgb = 0, - ft_palette_mode_rgba, - - ft_palette_mode_max /* do not remove */ - - } FT_Palette_Mode; - - /* */ - -#endif - /*************************************************************************/ /* */ @@ -318,13 +265,13 @@ FT_BEGIN_HEADER /* */ typedef struct FT_Bitmap_ { - int rows; - int width; + unsigned int rows; + unsigned int width; int pitch; unsigned char* buffer; - short num_grays; - char pixel_mode; - char palette_mode; + unsigned short num_grays; + unsigned char pixel_mode; + unsigned char palette_mode; void* palette; } FT_Bitmap; @@ -381,7 +328,7 @@ FT_BEGIN_HEADER /* */ /* flags :: A set of bit flags used to characterize the outline */ /* and give hints to the scan-converter and hinter on */ - /* how to convert/grid-fit it. See @FT_OUTLINE_FLAGS. */ + /* how to convert/grid-fit it. See @FT_OUTLINE_XXX. */ /* */ /* */ /* The B/W rasterizer only checks bit~2 in the `tags' array for the */ @@ -402,6 +349,8 @@ FT_BEGIN_HEADER } FT_Outline; + /* */ + /* Following limits must be consistent with */ /* FT_Outline.{n_contours,n_points} */ #define FT_OUTLINE_CONTOURS_MAX SHRT_MAX @@ -411,7 +360,7 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ /* */ - /* FT_OUTLINE_FLAGS */ + /* FT_OUTLINE_XXX */ /* */ /* */ /* A list of bit-field constants use for the flags in an outline's */ @@ -492,24 +441,8 @@ FT_BEGIN_HEADER #define FT_OUTLINE_SINGLE_PASS 0x200 - /************************************************************************* - * - * @enum: - * ft_outline_flags - * - * @description: - * These constants are deprecated. Please use the corresponding - * @FT_OUTLINE_FLAGS values. - * - * @values: - * ft_outline_none :: See @FT_OUTLINE_NONE. - * ft_outline_owner :: See @FT_OUTLINE_OWNER. - * ft_outline_even_odd_fill :: See @FT_OUTLINE_EVEN_ODD_FILL. - * ft_outline_reverse_fill :: See @FT_OUTLINE_REVERSE_FILL. - * ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS. - * ft_outline_high_precision :: See @FT_OUTLINE_HIGH_PRECISION. - * ft_outline_single_pass :: See @FT_OUTLINE_SINGLE_PASS. - */ + /* these constants are deprecated; use the corresponding */ + /* `FT_OUTLINE_XXX' values instead */ #define ft_outline_none FT_OUTLINE_NONE #define ft_outline_owner FT_OUTLINE_OWNER #define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL @@ -796,22 +729,8 @@ FT_BEGIN_HEADER } FT_Glyph_Format; - /*************************************************************************/ - /* */ - /* */ - /* ft_glyph_format_xxx */ - /* */ - /* */ - /* A list of deprecated constants. Use the corresponding */ - /* @FT_Glyph_Format values instead. */ - /* */ - /* */ - /* ft_glyph_format_none :: See @FT_GLYPH_FORMAT_NONE. */ - /* ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE. */ - /* ft_glyph_format_bitmap :: See @FT_GLYPH_FORMAT_BITMAP. */ - /* ft_glyph_format_outline :: See @FT_GLYPH_FORMAT_OUTLINE. */ - /* ft_glyph_format_plotter :: See @FT_GLYPH_FORMAT_PLOTTER. */ - /* */ + /* these constants are deprecated; use the corresponding */ + /* `FT_Glyph_Format' values instead. */ #define ft_glyph_format_none FT_GLYPH_FORMAT_NONE #define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE #define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP @@ -856,6 +775,21 @@ FT_BEGIN_HEADER /* */ /* This section contains technical definitions. */ /* */ + /* */ + /* FT_Raster */ + /* FT_Span */ + /* FT_SpanFunc */ + /* */ + /* FT_Raster_Params */ + /* FT_RASTER_FLAG_XXX */ + /* */ + /* FT_Raster_NewFunc */ + /* FT_Raster_DoneFunc */ + /* FT_Raster_ResetFunc */ + /* FT_Raster_SetModeFunc */ + /* FT_Raster_RenderFunc */ + /* FT_Raster_Funcs */ + /* */ /*************************************************************************/ @@ -865,8 +799,8 @@ FT_BEGIN_HEADER /* FT_Raster */ /* */ /* */ - /* A handle (pointer) to a raster object. Each object can be used */ - /* independently to convert an outline into a bitmap or pixmap. */ + /* An opaque handle (pointer) to a raster object. Each object can be */ + /* used independently to convert an outline into a bitmap or pixmap. */ /* */ typedef struct FT_RasterRec_* FT_Raster; @@ -877,8 +811,8 @@ FT_BEGIN_HEADER /* FT_Span */ /* */ /* */ - /* A structure used to model a single span of gray (or black) pixels */ - /* when rendering a monochrome or anti-aliased bitmap. */ + /* A structure used to model a single span of gray pixels when */ + /* rendering an anti-aliased bitmap. */ /* */ /* */ /* x :: The span's horizontal start position. */ @@ -886,8 +820,7 @@ FT_BEGIN_HEADER /* len :: The span's length in pixels. */ /* */ /* coverage :: The span color/coverage, ranging from 0 (background) */ - /* to 255 (foreground). Only used for anti-aliased */ - /* rendering. */ + /* to 255 (foreground). */ /* */ /* */ /* This structure is used by the span drawing callback type named */ @@ -957,22 +890,7 @@ FT_BEGIN_HEADER /* FT_Raster_BitTest_Func */ /* */ /* */ - /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */ - /* */ - /* A function used as a call-back by the monochrome scan-converter */ - /* to test whether a given target pixel is already set to the drawing */ - /* `color'. These tests are crucial to implement drop-out control */ - /* per-se the TrueType spec. */ - /* */ - /* */ - /* y :: The pixel's y~coordinate. */ - /* */ - /* x :: The pixel's x~coordinate. */ - /* */ - /* user :: User-supplied data that is passed to the callback. */ - /* */ - /* */ - /* 1~if the pixel is `set', 0~otherwise. */ + /* Deprecated, unimplemented. */ /* */ typedef int (*FT_Raster_BitTest_Func)( int y, @@ -986,21 +904,7 @@ FT_BEGIN_HEADER /* FT_Raster_BitSet_Func */ /* */ /* */ - /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */ - /* */ - /* A function used as a call-back by the monochrome scan-converter */ - /* to set an individual target pixel. This is crucial to implement */ - /* drop-out control according to the TrueType specification. */ - /* */ - /* */ - /* y :: The pixel's y~coordinate. */ - /* */ - /* x :: The pixel's x~coordinate. */ - /* */ - /* user :: User-supplied data that is passed to the callback. */ - /* */ - /* */ - /* 1~if the pixel is `set', 0~otherwise. */ + /* Deprecated, unimplemented. */ /* */ typedef void (*FT_Raster_BitSet_Func)( int y, @@ -1034,8 +938,8 @@ FT_BEGIN_HEADER /* pixmap's buffer _must_ be zeroed before */ /* rendering. */ /* */ - /* Note that for now, direct rendering is */ - /* only possible with anti-aliased glyphs. */ + /* Direct rendering is only possible with */ + /* anti-aliased glyphs. */ /* */ /* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */ /* rendering mode. If set, the output will */ @@ -1053,7 +957,8 @@ FT_BEGIN_HEADER #define FT_RASTER_FLAG_DIRECT 0x2 #define FT_RASTER_FLAG_CLIP 0x4 - /* deprecated */ + /* these constants are deprecated; use the corresponding */ + /* `FT_RASTER_FLAG_XXX' values instead */ #define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT #define ft_raster_flag_aa FT_RASTER_FLAG_AA #define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT @@ -1079,11 +984,11 @@ FT_BEGIN_HEADER /* */ /* gray_spans :: The gray span drawing callback. */ /* */ - /* black_spans :: The black span drawing callback. UNIMPLEMENTED! */ + /* black_spans :: Unused. */ /* */ - /* bit_test :: The bit test callback. UNIMPLEMENTED! */ + /* bit_test :: Unused. */ /* */ - /* bit_set :: The bit set callback. UNIMPLEMENTED! */ + /* bit_set :: Unused. */ /* */ /* user :: User-supplied data that is passed to each drawing */ /* callback. */ @@ -1100,15 +1005,9 @@ FT_BEGIN_HEADER /* */ /* If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */ /* raster will call the `gray_spans' callback to draw gray pixel */ - /* spans, in the case of an aa glyph bitmap, it will call */ - /* `black_spans', and `bit_test' and `bit_set' in the case of a */ - /* monochrome bitmap. This allows direct composition over a */ - /* pre-existing bitmap through user-provided callbacks to perform the */ - /* span drawing/composition. */ - /* */ - /* Note that the `bit_test' and `bit_set' callbacks are required when */ - /* rendering a monochrome bitmap, as they are crucial to implement */ - /* correct drop-out control as defined in the TrueType specification. */ + /* spans. This allows direct composition over a pre-existing bitmap */ + /* through user-provided callbacks to perform the span drawing and */ + /* composition. Not supported by the monochrome rasterizer. */ /* */ typedef struct FT_Raster_Params_ { @@ -1116,9 +1015,9 @@ FT_BEGIN_HEADER const void* source; int flags; FT_SpanFunc gray_spans; - FT_SpanFunc black_spans; /* doesn't work! */ - FT_Raster_BitTest_Func bit_test; /* doesn't work! */ - FT_Raster_BitSet_Func bit_set; /* doesn't work! */ + FT_SpanFunc black_spans; /* unused */ + FT_Raster_BitTest_Func bit_test; /* unused */ + FT_Raster_BitSet_Func bit_set; /* unused */ void* user; FT_BBox clip_box; @@ -1305,7 +1204,6 @@ FT_BEGIN_HEADER } FT_Raster_Funcs; - /* */ diff --git a/freetype/include/ftincrem.h b/freetype/include/ftincrem.h index aaf689ff1..4c0246c5d 100644 --- a/freetype/include/ftincrem.h +++ b/freetype/include/ftincrem.h @@ -4,7 +4,7 @@ /* */ /* FreeType incremental loading (specification). */ /* */ -/* Copyright 2002, 2003, 2006, 2007, 2008, 2010 by */ +/* Copyright 2002, 2003, 2006-2008, 2010, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -45,7 +45,7 @@ FT_BEGIN_HEADER * @description: * This section contains various functions used to perform so-called * `incremental' glyph loading. This is a mode where all glyphs loaded - * from a given @FT_Face are provided by the client application, + * from a given @FT_Face are provided by the client application. * * Apart from that, all other tables are loaded normally from the font * file. This mode is useful when FreeType is used within another @@ -345,6 +345,7 @@ FT_BEGIN_HEADER /* */ + FT_END_HEADER #endif /* __FTINCREM_H__ */ diff --git a/freetype/include/ftlcdfil.h b/freetype/include/ftlcdfil.h index 39206f019..e8679c1a3 100644 --- a/freetype/include/ftlcdfil.h +++ b/freetype/include/ftlcdfil.h @@ -5,7 +5,7 @@ /* FreeType API for color filtering of subpixel bitmap glyphs */ /* (specification). */ /* */ -/* Copyright 2006-2008, 2010, 2013 by */ +/* Copyright 2006-2008, 2010, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -56,7 +56,7 @@ FT_BEGIN_HEADER * * FreeType generates alpha coverage maps, which are linear by nature. * For instance, the value 0x80 in bitmap representation means that - * (within numerical precision) 0x80/0xff fraction of that pixel is + * (within numerical precision) 0x80/0xFF fraction of that pixel is * covered by the glyph's outline. The blending function for placing * text over a background is * diff --git a/freetype/include/ftlist.h b/freetype/include/ftlist.h index 241e21e55..9950a2799 100644 --- a/freetype/include/ftlist.h +++ b/freetype/include/ftlist.h @@ -4,7 +4,7 @@ /* */ /* Generic list support for FreeType (specification). */ /* */ -/* Copyright 1996-2001, 2003, 2007, 2010, 2013 by */ +/* Copyright 1996-2001, 2003, 2007, 2010, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -248,7 +248,7 @@ FT_BEGIN_HEADER /* list :: A handle to the list. */ /* */ /* destroy :: A list destructor that will be applied to each element */ - /* of the list. */ + /* of the list. Set this to NULL if not needed. */ /* */ /* memory :: The current memory object that handles deallocation. */ /* */ @@ -265,7 +265,6 @@ FT_BEGIN_HEADER FT_Memory memory, void* user ); - /* */ diff --git a/freetype/include/ftlzw.h b/freetype/include/ftlzw.h index 00d40169a..857c0c52b 100644 --- a/freetype/include/ftlzw.h +++ b/freetype/include/ftlzw.h @@ -88,7 +88,7 @@ FT_BEGIN_HEADER FT_Stream_OpenLZW( FT_Stream stream, FT_Stream source ); - /* */ + /* */ FT_END_HEADER diff --git a/freetype/include/ftmm.h b/freetype/include/ftmm.h index 837975a0b..2dcfd678d 100644 --- a/freetype/include/ftmm.h +++ b/freetype/include/ftmm.h @@ -218,9 +218,6 @@ FT_BEGIN_HEADER } FT_MM_Var; - /* */ - - /*************************************************************************/ /* */ /* */ @@ -365,7 +362,6 @@ FT_BEGIN_HEADER FT_UInt num_coords, FT_Fixed* coords ); - /* */ diff --git a/freetype/include/ftmodapi.h b/freetype/include/ftmodapi.h index 22878f8c6..980f15d3d 100644 --- a/freetype/include/ftmodapi.h +++ b/freetype/include/ftmodapi.h @@ -75,6 +75,33 @@ FT_BEGIN_HEADER /* */ /* Note that the FreeType Cache sub-system is not a FreeType module. */ /* */ + /* */ + /* FT_Module */ + /* FT_Module_Constructor */ + /* FT_Module_Destructor */ + /* FT_Module_Requester */ + /* FT_Module_Class */ + /* */ + /* FT_Add_Module */ + /* FT_Get_Module */ + /* FT_Remove_Module */ + /* FT_Add_Default_Modules */ + /* */ + /* FT_Property_Set */ + /* FT_Property_Get */ + /* */ + /* FT_New_Library */ + /* FT_Done_Library */ + /* FT_Reference_Library */ + /* */ + /* FT_Renderer */ + /* FT_Renderer_Class */ + /* */ + /* FT_Get_Renderer */ + /* FT_Set_Renderer */ + /* */ + /* FT_Set_Debug_Hook */ + /* */ /*************************************************************************/ @@ -491,7 +518,7 @@ FT_BEGIN_HEADER FT_EXPORT( FT_Error ) FT_Done_Library( FT_Library library ); -/* */ + /* */ typedef void (*FT_DebugHook_Func)( void* arg ); @@ -629,7 +656,6 @@ FT_BEGIN_HEADER FT_EXPORT( FT_TrueTypeEngineType ) FT_Get_TrueType_Engine_Type( FT_Library library ); - /* */ diff --git a/freetype/include/ftotval.h b/freetype/include/ftotval.h index bb52dc4a0..75ba03ee8 100644 --- a/freetype/include/ftotval.h +++ b/freetype/include/ftotval.h @@ -4,7 +4,7 @@ /* */ /* FreeType API for validating OpenType tables (specification). */ /* */ -/* Copyright 2004-2007, 2013 by */ +/* Copyright 2004-2007, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -58,6 +58,12 @@ FT_BEGIN_HEADER /* This section contains the declaration of functions to validate */ /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */ /* */ + /* */ + /* FT_OpenType_Validate */ + /* FT_OpenType_Free */ + /* */ + /* FT_VALIDATE_OTXXX */ + /* */ /*************************************************************************/ @@ -107,8 +113,6 @@ FT_BEGIN_HEADER FT_VALIDATE_JSTF | \ FT_VALIDATE_MATH - /* */ - /********************************************************************** * * @function: @@ -165,8 +169,6 @@ FT_BEGIN_HEADER FT_Bytes *GSUB_table, FT_Bytes *JSTF_table ); - /* */ - /********************************************************************** * * @function: @@ -191,8 +193,7 @@ FT_BEGIN_HEADER FT_OpenType_Free( FT_Face face, FT_Bytes table ); - - /* */ + /* */ FT_END_HEADER diff --git a/freetype/include/ftoutln.h b/freetype/include/ftoutln.h index 6c6d3f94b..d3b8fbd26 100644 --- a/freetype/include/ftoutln.h +++ b/freetype/include/ftoutln.h @@ -52,7 +52,6 @@ FT_BEGIN_HEADER /* */ /* */ /* FT_Outline */ - /* FT_OUTLINE_FLAGS */ /* FT_Outline_New */ /* FT_Outline_Done */ /* FT_Outline_Copy */ @@ -68,13 +67,17 @@ FT_BEGIN_HEADER /* */ /* FT_Outline_Get_Bitmap */ /* FT_Outline_Render */ - /* */ /* FT_Outline_Decompose */ /* FT_Outline_Funcs */ - /* FT_Outline_MoveTo_Func */ - /* FT_Outline_LineTo_Func */ - /* FT_Outline_ConicTo_Func */ - /* FT_Outline_CubicTo_Func */ + /* FT_Outline_MoveToFunc */ + /* FT_Outline_LineToFunc */ + /* FT_Outline_ConicToFunc */ + /* FT_Outline_CubicToFunc */ + /* */ + /* FT_Orientation */ + /* FT_Outline_Get_Orientation */ + /* */ + /* FT_OUTLINE_XXX */ /* */ /*************************************************************************/ @@ -535,7 +538,7 @@ FT_BEGIN_HEADER * * @description: * This function analyzes a glyph outline and tries to compute its - * fill orientation (see @FT_Orientation). This is done by integrating + * fill orientation (see @FT_Orientation). This is done by integrating * the total area covered by the outline. The positive integral * corresponds to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT * is returned. The negative integral corresponds to the counter-clockwise @@ -555,7 +558,6 @@ FT_BEGIN_HEADER FT_EXPORT( FT_Orientation ) FT_Outline_Get_Orientation( FT_Outline* outline ); - /* */ diff --git a/freetype/include/ftpfr.h b/freetype/include/ftpfr.h index 0b7b7d427..7d5035396 100644 --- a/freetype/include/ftpfr.h +++ b/freetype/include/ftpfr.h @@ -161,7 +161,7 @@ FT_BEGIN_HEADER FT_UInt gindex, FT_Pos *aadvance ); - /* */ + /* */ FT_END_HEADER diff --git a/freetype/include/ftrender.h b/freetype/include/ftrender.h index dd0229b81..e8d36363c 100644 --- a/freetype/include/ftrender.h +++ b/freetype/include/ftrender.h @@ -226,7 +226,6 @@ FT_BEGIN_HEADER FT_UInt num_params, FT_Parameter* parameters ); - /* */ diff --git a/freetype/include/ftstroke.h b/freetype/include/ftstroke.h index a498e4a88..bd311709f 100644 --- a/freetype/include/ftstroke.h +++ b/freetype/include/ftstroke.h @@ -4,7 +4,7 @@ /* */ /* FreeType path stroker (specification). */ /* */ -/* Copyright 2002-2006, 2008, 2009, 2011-2012 by */ +/* Copyright 2002-2006, 2008, 2009, 2011-2012, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -46,6 +46,38 @@ FT_BEGIN_HEADER * This can be useful to generate `bordered' glyph, i.e., glyphs * displayed with a coloured (and anti-aliased) border around their * shape. + * + * @order: + * FT_Stroker + * + * FT_Stroker_LineJoin + * FT_Stroker_LineCap + * FT_StrokerBorder + * + * FT_Outline_GetInsideBorder + * FT_Outline_GetOutsideBorder + * + * FT_Glyph_Stroke + * FT_Glyph_StrokeBorder + * + * FT_Stroker_New + * FT_Stroker_Set + * FT_Stroker_Rewind + * FT_Stroker_ParseOutline + * FT_Stroker_Done + * + * FT_Stroker_BeginSubPath + * FT_Stroker_EndSubPath + * + * FT_Stroker_LineTo + * FT_Stroker_ConicTo + * FT_Stroker_CubicTo + * + * FT_Stroker_GetBorderCounts + * FT_Stroker_ExportBorder + * FT_Stroker_GetCounts + * FT_Stroker_Export + * */ @@ -55,7 +87,7 @@ FT_BEGIN_HEADER * FT_Stroker * * @description: - * Opaque handler to a path stroker object. + * Opaque handle to a path stroker object. */ typedef struct FT_StrokerRec_* FT_Stroker; @@ -276,6 +308,8 @@ FT_BEGIN_HEADER * @note: * The radius is expressed in the same units as the outline * coordinates. + * + * This function calls @FT_Stroker_Rewind automatically. */ FT_EXPORT( void ) FT_Stroker_Set( FT_Stroker stroker, @@ -570,10 +604,10 @@ FT_BEGIN_HEADER * receive all new data. * * When an outline, or a sub-path, is `closed', the stroker generates - * two independent `border' outlines, named `left' and `right' + * two independent `border' outlines, named `left' and `right'. * * When the outline, or a sub-path, is `opened', the stroker merges - * the `border' outlines with caps. The `left' border receives all + * the `border' outlines with caps. The `left' border receives all * points, while the `right' border becomes empty. * * Use the function @FT_Stroker_Export instead if you want to @@ -736,7 +770,7 @@ FT_BEGIN_HEADER FT_Bool inside, FT_Bool destroy ); - /* */ + /* */ FT_END_HEADER diff --git a/freetype/include/ftsynth.h b/freetype/include/ftsynth.h index 839ab5e40..d0ea73087 100644 --- a/freetype/include/ftsynth.h +++ b/freetype/include/ftsynth.h @@ -73,6 +73,7 @@ FT_BEGIN_HEADER /* */ + FT_END_HEADER #endif /* __FTSYNTH_H__ */ diff --git a/freetype/include/ftsystem.h b/freetype/include/ftsystem.h index e07460c55..7436ed267 100644 --- a/freetype/include/ftsystem.h +++ b/freetype/include/ftsystem.h @@ -4,7 +4,7 @@ /* */ /* FreeType low-level system interface definition (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2005, 2010 by */ +/* Copyright 1996-2001, 2002, 2005, 2010, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -192,6 +192,10 @@ FT_BEGIN_HEADER * @description: * A handle to an input stream. * + * @also: + * See @FT_StreamRec for the publicly accessible fields of a given + * stream object. + * */ typedef struct FT_StreamRec_* FT_Stream; @@ -285,6 +289,11 @@ FT_BEGIN_HEADER * size :: * The stream size in bytes. * + * In case of compressed streams where the size is unknown before + * actually doing the decompression, the value is set to 0x7FFFFFFF. + * (Note that this size value can occur for normal streams also; it is + * thus just a hint.) + * * pos :: * The current position within the stream. * @@ -335,7 +344,6 @@ FT_BEGIN_HEADER } FT_StreamRec; - /* */ diff --git a/freetype/include/fttrigon.h b/freetype/include/fttrigon.h index 65143cb8c..9c7b54324 100644 --- a/freetype/include/fttrigon.h +++ b/freetype/include/fttrigon.h @@ -237,7 +237,7 @@ FT_BEGIN_HEADER * * @input: * angle :: - * The address of angle. + * The input angle. * */ FT_EXPORT( void ) @@ -259,7 +259,7 @@ FT_BEGIN_HEADER * * @input: * angle :: - * The address of angle. + * The input angle. * */ FT_EXPORT( void ) diff --git a/freetype/include/ftttdrv.h b/freetype/include/ftttdrv.h index 70ad3d583..358841397 100644 --- a/freetype/include/ftttdrv.h +++ b/freetype/include/ftttdrv.h @@ -158,9 +158,9 @@ FT_BEGIN_HEADER #define TT_INTERPRETER_VERSION_35 35 #define TT_INTERPRETER_VERSION_38 38 - /* */ + FT_END_HEADER diff --git a/freetype/include/fttypes.h b/freetype/include/fttypes.h index bd944a493..2c01e8737 100644 --- a/freetype/include/fttypes.h +++ b/freetype/include/fttypes.h @@ -4,7 +4,7 @@ /* */ /* FreeType simple types definitions (specification only). */ /* */ -/* Copyright 1996-2002, 2004, 2006-2009, 2012, 2013 by */ +/* Copyright 1996-2002, 2004, 2006-2009, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -57,6 +57,8 @@ FT_BEGIN_HEADER /* FT_UInt16 */ /* FT_Int32 */ /* FT_UInt32 */ + /* FT_Int64 */ + /* FT_UInt64 */ /* FT_Short */ /* FT_UShort */ /* FT_Long */ @@ -78,7 +80,9 @@ FT_BEGIN_HEADER /* FT_F2Dot14 */ /* FT_UnitVector */ /* FT_F26Dot6 */ + /* FT_Data */ /* */ + /* FT_MAKE_TAG */ /* */ /* FT_Generic */ /* FT_Generic_Finalizer */ @@ -567,9 +571,9 @@ FT_BEGIN_HEADER } FT_ListRec; - /* */ + #define FT_IS_EMPTY( list ) ( (list).head == 0 ) #define FT_BOOL( x ) ( (FT_Bool)( x ) ) diff --git a/freetype/include/ftwinfnt.h b/freetype/include/ftwinfnt.h index 0b6735179..50261581a 100644 --- a/freetype/include/ftwinfnt.h +++ b/freetype/include/ftwinfnt.h @@ -259,9 +259,9 @@ FT_BEGIN_HEADER FT_Get_WinFNT_Header( FT_Face face, FT_WinFNT_HeaderRec *aheader ); - /* */ + FT_END_HEADER #endif /* __FTWINFNT_H__ */ diff --git a/freetype/include/ftxf86.h b/freetype/include/ftxf86.h index 493cccdd0..89d1993e1 100644 --- a/freetype/include/ftxf86.h +++ b/freetype/include/ftxf86.h @@ -76,7 +76,8 @@ FT_BEGIN_HEADER FT_EXPORT( const char* ) FT_Get_X11_Font_Format( FT_Face face ); - /* */ + /* */ + FT_END_HEADER diff --git a/freetype/include/internal/ftcalc.h b/freetype/include/internal/ftcalc.h index 03bd68eb1..14ec37b9c 100644 --- a/freetype/include/internal/ftcalc.h +++ b/freetype/include/internal/ftcalc.h @@ -4,7 +4,7 @@ /* */ /* Arithmetic computations (specification). */ /* */ -/* Copyright 1996-2006, 2008, 2009, 2012-2013 by */ +/* Copyright 1996-2006, 2008, 2009, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -27,36 +27,223 @@ FT_BEGIN_HEADER -#if 0 - /*************************************************************************/ /* */ - /* */ - /* FT_SqrtFixed */ - /* */ - /* */ - /* Computes the square root of a 16.16 fixed-point value. */ - /* */ - /* */ - /* x :: The value to compute the root for. */ - /* */ - /* */ - /* The result of `sqrt(x)'. */ - /* */ - /* */ - /* This function is not very fast. */ + /* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */ /* */ - FT_BASE( FT_Int32 ) - FT_SqrtFixed( FT_Int32 x ); + /*************************************************************************/ -#endif /* 0 */ +#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER + /* Provide assembler fragments for performance-critical functions. */ + /* These must be defined `static __inline__' with GCC. */ +#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */ - /*************************************************************************/ - /* */ - /* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */ - /* */ - /*************************************************************************/ +#define FT_MULFIX_ASSEMBLER FT_MulFix_arm + + /* documentation is in freetype.h */ + + static __inline FT_Int32 + FT_MulFix_arm( FT_Int32 a, + FT_Int32 b ) + { + register FT_Int32 t, t2; + + + __asm + { + smull t2, t, b, a /* (lo=t2,hi=t) = a*b */ + mov a, t, asr #31 /* a = (hi >> 31) */ + add a, a, #0x8000 /* a += 0x8000 */ + adds t2, t2, a /* t2 += a */ + adc t, t, #0 /* t += carry */ + mov a, t2, lsr #16 /* a = t2 >> 16 */ + orr a, a, t, lsl #16 /* a |= t << 16 */ + } + return a; + } + +#endif /* __CC_ARM || __ARMCC__ */ + + +#ifdef __GNUC__ + +#if defined( __arm__ ) && \ + ( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \ + !( defined( __CC_ARM ) || defined( __ARMCC__ ) ) + +#define FT_MULFIX_ASSEMBLER FT_MulFix_arm + + /* documentation is in freetype.h */ + + static __inline__ FT_Int32 + FT_MulFix_arm( FT_Int32 a, + FT_Int32 b ) + { + register FT_Int32 t, t2; + + + __asm__ __volatile__ ( + "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ + "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ +#if defined( __clang__ ) && defined( __thumb2__ ) + "add.w %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ +#else + "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ +#endif + "adds %1, %1, %0\n\t" /* %1 += %0 */ + "adc %2, %2, #0\n\t" /* %2 += carry */ + "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */ + "orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */ + : "=r"(a), "=&r"(t2), "=&r"(t) + : "r"(a), "r"(b) + : "cc" ); + return a; + } + +#endif /* __arm__ && */ + /* ( __thumb2__ || !__thumb__ ) && */ + /* !( __CC_ARM || __ARMCC__ ) */ + + +#if defined( __i386__ ) + +#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 + + /* documentation is in freetype.h */ + + static __inline__ FT_Int32 + FT_MulFix_i386( FT_Int32 a, + FT_Int32 b ) + { + register FT_Int32 result; + + + __asm__ __volatile__ ( + "imul %%edx\n" + "movl %%edx, %%ecx\n" + "sarl $31, %%ecx\n" + "addl $0x8000, %%ecx\n" + "addl %%ecx, %%eax\n" + "adcl $0, %%edx\n" + "shrl $16, %%eax\n" + "shll $16, %%edx\n" + "addl %%edx, %%eax\n" + : "=a"(result), "=d"(b) + : "a"(a), "d"(b) + : "%ecx", "cc" ); + return result; + } + +#endif /* i386 */ + +#endif /* __GNUC__ */ + + +#ifdef _MSC_VER /* Visual C++ */ + +#ifdef _M_IX86 + +#define FT_MULFIX_ASSEMBLER FT_MulFix_i386 + + /* documentation is in freetype.h */ + + static __inline FT_Int32 + FT_MulFix_i386( FT_Int32 a, + FT_Int32 b ) + { + register FT_Int32 result; + + __asm + { + mov eax, a + mov edx, b + imul edx + mov ecx, edx + sar ecx, 31 + add ecx, 8000h + add eax, ecx + adc edx, 0 + shr eax, 16 + shl edx, 16 + add eax, edx + mov result, eax + } + return result; + } + +#endif /* _M_IX86 */ + +#endif /* _MSC_VER */ + + +#if defined( __GNUC__ ) && defined( __x86_64__ ) + +#define FT_MULFIX_ASSEMBLER FT_MulFix_x86_64 + + static __inline__ FT_Int32 + FT_MulFix_x86_64( FT_Int32 a, + FT_Int32 b ) + { + /* Temporarily disable the warning that C90 doesn't support */ + /* `long long'. */ +#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 ) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" +#endif + +#if 1 + /* Technically not an assembly fragment, but GCC does a really good */ + /* job at inlining it and generating good machine code for it. */ + long long ret, tmp; + + + ret = (long long)a * b; + tmp = ret >> 63; + ret += 0x8000 + tmp; + + return (FT_Int32)( ret >> 16 ); +#else + + /* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine */ + /* code from the lines below. The main issue is that `wide_a' is not */ + /* properly initialized by sign-extending `a'. Instead, the generated */ + /* machine code assumes that the register that contains `a' on input */ + /* can be used directly as a 64-bit value, which is wrong most of the */ + /* time. */ + long long wide_a = (long long)a; + long long wide_b = (long long)b; + long long result; + + + __asm__ __volatile__ ( + "imul %2, %1\n" + "mov %1, %0\n" + "sar $63, %0\n" + "lea 0x8000(%1, %0), %0\n" + "sar $16, %0\n" + : "=&r"(result), "=&r"(wide_a) + : "r"(wide_b) + : "cc" ); + + return (FT_Int32)result; +#endif + +#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 ) +#pragma GCC diagnostic pop +#endif + } + +#endif /* __GNUC__ && __x86_64__ */ + +#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ + + +#ifdef FT_CONFIG_OPTION_INLINE_MULFIX +#ifdef FT_MULFIX_ASSEMBLER +#define FT_MulFix( a, b ) FT_MULFIX_ASSEMBLER( (FT_Int32)(a), (FT_Int32)(b) ) +#endif +#endif /*************************************************************************/ @@ -124,10 +311,11 @@ FT_BEGIN_HEADER FT_Pos out_x, FT_Pos out_y ); + /* * Return TRUE if a corner is flat or nearly flat. This is equivalent to - * saying that the angle difference between the `in' and `out' vectors is - * very small. + * saying that the corner point is close to its neighbors, or inside an + * ellipse defined by the neighbor focal points to be more precise. */ FT_BASE( FT_Int ) ft_corner_is_flat( FT_Pos in_x, @@ -139,9 +327,31 @@ FT_BEGIN_HEADER /* * Return the most significant bit index. */ + +#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER +#if defined( __GNUC__ ) && \ + ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) ) + +#if FT_SIZEOF_INT == 4 + +#define FT_MSB( x ) ( 31 - __builtin_clz( x ) ) + +#elif FT_SIZEOF_LONG == 4 + +#define FT_MSB( x ) ( 31 - __builtin_clzl( x ) ) + +#endif + +#endif /* __GNUC__ */ +#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ + +#ifndef FT_MSB + FT_BASE( FT_Int ) FT_MSB( FT_UInt32 z ); +#endif + /* * Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses @@ -152,6 +362,31 @@ FT_BEGIN_HEADER FT_Fixed y ); +#if 0 + + /*************************************************************************/ + /* */ + /* */ + /* FT_SqrtFixed */ + /* */ + /* */ + /* Computes the square root of a 16.16 fixed-point value. */ + /* */ + /* */ + /* x :: The value to compute the root for. */ + /* */ + /* */ + /* The result of `sqrt(x)'. */ + /* */ + /* */ + /* This function is not very fast. */ + /* */ + FT_BASE( FT_Int32 ) + FT_SqrtFixed( FT_Int32 x ); + +#endif /* 0 */ + + #define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 ) #define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 ) #define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 ) diff --git a/freetype/include/internal/ftgloadr.h b/freetype/include/internal/ftgloadr.h index ce4dc6c9c..f70774f74 100644 --- a/freetype/include/internal/ftgloadr.h +++ b/freetype/include/internal/ftgloadr.h @@ -121,20 +121,22 @@ FT_BEGIN_HEADER FT_UInt n_contours ); -#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \ - ( (_count) == 0 || ((_loader)->base.outline.n_points + \ - (_loader)->current.outline.n_points + \ - (unsigned long)(_count)) <= (_loader)->max_points ) - -#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \ - ( (_count) == 0 || ((_loader)->base.outline.n_contours + \ - (_loader)->current.outline.n_contours + \ - (unsigned long)(_count)) <= (_loader)->max_contours ) - -#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours ) \ - ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \ - FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \ - ? 0 \ +#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \ + ( (_count) == 0 || \ + ( (_loader)->base.outline.n_points + \ + (_loader)->current.outline.n_points + \ + (unsigned long)(_count) ) <= (_loader)->max_points ) + +#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \ + ( (_count) == 0 || \ + ( (_loader)->base.outline.n_contours + \ + (_loader)->current.outline.n_contours + \ + (unsigned long)(_count)) <= (_loader)->max_contours ) + +#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points, _contours ) \ + ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \ + FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \ + ? 0 \ : FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) ) diff --git a/freetype/include/internal/ftobjs.h b/freetype/include/internal/ftobjs.h index 701c850eb..b45a5ed81 100644 --- a/freetype/include/internal/ftobjs.h +++ b/freetype/include/internal/ftobjs.h @@ -72,6 +72,16 @@ FT_BEGIN_HEADER #define FT_ABS( a ) ( (a) < 0 ? -(a) : (a) ) + /* + * Approximate sqrt(x*x+y*y) using the `alpha max plus beta min' + * algorithm. We use alpha = 1, beta = 3/8, giving us results with a + * largest error less than 7% compared to the exact value. + */ +#define FT_HYPOT( x, y ) \ + ( x = FT_ABS( x ), \ + y = FT_ABS( y ), \ + x > y ? x + ( 3 * y >> 3 ) \ + : y + ( 3 * x >> 3 ) ) #define FT_PAD_FLOOR( x, n ) ( (x) & ~((n)-1) ) #define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + ((n)/2), n ) @@ -82,14 +92,6 @@ FT_BEGIN_HEADER #define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 ) - /* - * Return the highest power of 2 that is <= value; this correspond to - * the highest bit in a given 32-bit value. - */ - FT_BASE( FT_UInt32 ) - ft_highpow2( FT_UInt32 value ); - - /* * character classification functions -- since these are used to parse * font files, we must not use those in which are diff --git a/freetype/include/internal/ftvalid.h b/freetype/include/internal/ftvalid.h index 12ad03685..c281b1424 100644 --- a/freetype/include/internal/ftvalid.h +++ b/freetype/include/internal/ftvalid.h @@ -4,7 +4,7 @@ /* */ /* FreeType validation support (specification). */ /* */ -/* Copyright 2004, 2013 by */ +/* Copyright 2004, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -87,13 +87,13 @@ FT_BEGIN_HEADER /* validator structure */ typedef struct FT_ValidatorRec_ { + ft_jmp_buf jump_buffer; /* used for exception handling */ + const FT_Byte* base; /* address of table in memory */ const FT_Byte* limit; /* `base' + sizeof(table) in memory */ FT_ValidationLevel level; /* validation level */ FT_Error error; /* error returned. 0 means success */ - ft_jmp_buf jump_buffer; /* used for exception handling */ - } FT_ValidatorRec; #if defined( _MSC_VER ) @@ -126,31 +126,29 @@ FT_BEGIN_HEADER /* Calls ft_validate_error. Assumes that the `valid' local variable */ /* holds a pointer to the current validator object. */ /* */ - /* Use preprocessor prescan to pass FT_ERR_PREFIX. */ - /* */ -#define FT_INVALID( _prefix, _error ) FT_INVALID_( _prefix, _error ) -#define FT_INVALID_( _prefix, _error ) \ - ft_validator_error( valid, _prefix ## _error ) +#define FT_INVALID( _error ) FT_INVALID_( _error ) +#define FT_INVALID_( _error ) \ + ft_validator_error( valid, FT_THROW( _error ) ) /* called when a broken table is detected */ #define FT_INVALID_TOO_SHORT \ - FT_INVALID( FT_ERR_PREFIX, Invalid_Table ) + FT_INVALID( Invalid_Table ) /* called when an invalid offset is detected */ #define FT_INVALID_OFFSET \ - FT_INVALID( FT_ERR_PREFIX, Invalid_Offset ) + FT_INVALID( Invalid_Offset ) /* called when an invalid format/value is detected */ #define FT_INVALID_FORMAT \ - FT_INVALID( FT_ERR_PREFIX, Invalid_Table ) + FT_INVALID( Invalid_Table ) /* called when an invalid glyph index is detected */ #define FT_INVALID_GLYPH_ID \ - FT_INVALID( FT_ERR_PREFIX, Invalid_Glyph_Index ) + FT_INVALID( Invalid_Glyph_Index ) /* called when an invalid field value is detected */ #define FT_INVALID_DATA \ - FT_INVALID( FT_ERR_PREFIX, Invalid_Table ) + FT_INVALID( Invalid_Table ) FT_END_HEADER diff --git a/freetype/include/internal/pshints.h b/freetype/include/internal/pshints.h index 3fb18dc2d..f05ea6863 100644 --- a/freetype/include/internal/pshints.h +++ b/freetype/include/internal/pshints.h @@ -6,7 +6,7 @@ /* recorders (specification only). These are used to support native */ /* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */ /* */ -/* Copyright 2001-2003, 2005-2007, 2009, 2012 by */ +/* Copyright 2001-2003, 2005-2007, 2009, 2012, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -45,7 +45,7 @@ FT_BEGIN_HEADER T1_Private* private_dict, PSH_Globals* aglobals ); - typedef FT_Error + typedef void (*PSH_Globals_SetScaleFunc)( PSH_Globals globals, FT_Fixed x_scale, FT_Fixed y_scale, diff --git a/freetype/include/internal/sfnt.h b/freetype/include/internal/sfnt.h index 6b5e41f1a..d558e869b 100644 --- a/freetype/include/internal/sfnt.h +++ b/freetype/include/internal/sfnt.h @@ -4,7 +4,7 @@ /* */ /* High-level `sfnt' driver interface (specification). */ /* */ -/* Copyright 1996-2006, 2009, 2012-2013 by */ +/* Copyright 1996-2006, 2009, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -405,14 +405,18 @@ FT_BEGIN_HEADER /* */ /* face :: A handle to the target face object. */ /* */ - /* stream :: The input stream. */ - /* */ /* vertical :: A boolean flag. If set, load vertical metrics. */ /* */ - /* */ - /* FreeType error code. 0 means success. */ + /* gindex :: The glyph index. */ /* */ - typedef FT_Error + /* */ + /* abearing :: The horizontal (or vertical) bearing. Set to zero in */ + /* case of error. */ + /* */ + /* aadvance :: The horizontal (or vertical) advance. Set to zero in */ + /* case of error. */ + /* */ + typedef void (*TT_Get_Metrics_Func)( TT_Face face, FT_Bool vertical, FT_UInt gindex, diff --git a/freetype/include/t1tables.h b/freetype/include/t1tables.h index a14255e5f..61aefdd54 100644 --- a/freetype/include/t1tables.h +++ b/freetype/include/t1tables.h @@ -5,7 +5,7 @@ /* Basic Type 1/Type 2 tables definitions and interface (specification */ /* only). */ /* */ -/* Copyright 1996-2004, 2006, 2008, 2009, 2011 by */ +/* Copyright 1996-2004, 2006, 2008, 2009, 2011, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -49,6 +49,26 @@ FT_BEGIN_HEADER /* This section contains the definition of Type 1-specific tables, */ /* including structures related to other PostScript font formats. */ /* */ + /* */ + /* PS_FontInfoRec */ + /* PS_FontInfo */ + /* PS_PrivateRec */ + /* PS_Private */ + /* */ + /* CID_FaceDictRec */ + /* CID_FaceDict */ + /* CID_FaceInfoRec */ + /* CID_FaceInfo */ + /* */ + /* FT_Has_PS_Glyph_Names */ + /* FT_Get_PS_Font_Info */ + /* FT_Get_PS_Font_Private */ + /* FT_Get_PS_Font_Value */ + /* */ + /* T1_Blend_Flags */ + /* T1_EncodingType */ + /* PS_Dict_Keys */ + /* */ /*************************************************************************/ @@ -190,14 +210,30 @@ FT_BEGIN_HEADER /* given blend dictionary (font info or private). Used to support */ /* Multiple Masters fonts. */ /* */ + /* */ + /* T1_BLEND_UNDERLINE_POSITION :: */ + /* T1_BLEND_UNDERLINE_THICKNESS :: */ + /* T1_BLEND_ITALIC_ANGLE :: */ + /* T1_BLEND_BLUE_VALUES :: */ + /* T1_BLEND_OTHER_BLUES :: */ + /* T1_BLEND_STANDARD_WIDTH :: */ + /* T1_BLEND_STANDARD_HEIGHT :: */ + /* T1_BLEND_STEM_SNAP_WIDTHS :: */ + /* T1_BLEND_STEM_SNAP_HEIGHTS :: */ + /* T1_BLEND_BLUE_SCALE :: */ + /* T1_BLEND_BLUE_SHIFT :: */ + /* T1_BLEND_FAMILY_BLUES :: */ + /* T1_BLEND_FAMILY_OTHER_BLUES :: */ + /* T1_BLEND_FORCE_BOLD :: */ + /* */ typedef enum T1_Blend_Flags_ { - /*# required fields in a FontInfo blend dictionary */ + /* required fields in a FontInfo blend dictionary */ T1_BLEND_UNDERLINE_POSITION = 0, T1_BLEND_UNDERLINE_THICKNESS, T1_BLEND_ITALIC_ANGLE, - /*# required fields in a Private blend dictionary */ + /* required fields in a Private blend dictionary */ T1_BLEND_BLUE_VALUES, T1_BLEND_OTHER_BLUES, T1_BLEND_STANDARD_WIDTH, @@ -210,15 +246,13 @@ FT_BEGIN_HEADER T1_BLEND_FAMILY_OTHER_BLUES, T1_BLEND_FORCE_BOLD, - /*# never remove */ - T1_BLEND_MAX + T1_BLEND_MAX /* do not remove */ } T1_Blend_Flags; - /* */ - - /*# backwards compatible definitions */ + /* these constants are deprecated; use the corresponding */ + /* `T1_Blend_Flags' values instead */ #define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION #define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS #define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE @@ -235,6 +269,8 @@ FT_BEGIN_HEADER #define t1_blend_force_bold T1_BLEND_FORCE_BOLD #define t1_blend_max T1_BLEND_MAX + /* */ + /* maximum number of Multiple Masters designs, as defined in the spec */ #define T1_MAX_MM_DESIGNS 16 @@ -333,10 +369,17 @@ FT_BEGIN_HEADER /* */ typedef struct CID_FaceDictRec_* CID_FaceDict; - /* */ - - /* backwards-compatible definition */ + /*************************************************************************/ + /* */ + /* */ + /* CID_FontDict */ + /* */ + /* */ + /* This type is equivalent to @CID_FaceDictRec. It is deprecated but */ + /* kept to maintain source compatibility between various versions of */ + /* FreeType. */ + /* */ typedef CID_FaceDictRec CID_FontDict; @@ -503,6 +546,13 @@ FT_BEGIN_HEADER /* An enumeration describing the `Encoding' entry in a Type 1 */ /* dictionary. */ /* */ + /* */ + /* T1_ENCODING_TYPE_NONE :: */ + /* T1_ENCODING_TYPE_ARRAY :: */ + /* T1_ENCODING_TYPE_STANDARD :: */ + /* T1_ENCODING_TYPE_ISOLATIN1 :: */ + /* T1_ENCODING_TYPE_EXPERT :: */ + /* */ typedef enum T1_EncodingType_ { T1_ENCODING_TYPE_NONE = 0, @@ -523,6 +573,54 @@ FT_BEGIN_HEADER /* An enumeration used in calls to @FT_Get_PS_Font_Value to identify */ /* the Type~1 dictionary entry to retrieve. */ /* */ + /* */ + /* PS_DICT_FONT_TYPE :: */ + /* PS_DICT_FONT_MATRIX :: */ + /* PS_DICT_FONT_BBOX :: */ + /* PS_DICT_PAINT_TYPE :: */ + /* PS_DICT_FONT_NAME :: */ + /* PS_DICT_UNIQUE_ID :: */ + /* PS_DICT_NUM_CHAR_STRINGS :: */ + /* PS_DICT_CHAR_STRING_KEY :: */ + /* PS_DICT_CHAR_STRING :: */ + /* PS_DICT_ENCODING_TYPE :: */ + /* PS_DICT_ENCODING_ENTRY :: */ + /* PS_DICT_NUM_SUBRS :: */ + /* PS_DICT_SUBR :: */ + /* PS_DICT_STD_HW :: */ + /* PS_DICT_STD_VW :: */ + /* PS_DICT_NUM_BLUE_VALUES :: */ + /* PS_DICT_BLUE_VALUE :: */ + /* PS_DICT_BLUE_FUZZ :: */ + /* PS_DICT_NUM_OTHER_BLUES :: */ + /* PS_DICT_OTHER_BLUE :: */ + /* PS_DICT_NUM_FAMILY_BLUES :: */ + /* PS_DICT_FAMILY_BLUE :: */ + /* PS_DICT_NUM_FAMILY_OTHER_BLUES :: */ + /* PS_DICT_FAMILY_OTHER_BLUE :: */ + /* PS_DICT_BLUE_SCALE :: */ + /* PS_DICT_BLUE_SHIFT :: */ + /* PS_DICT_NUM_STEM_SNAP_H :: */ + /* PS_DICT_STEM_SNAP_H :: */ + /* PS_DICT_NUM_STEM_SNAP_V :: */ + /* PS_DICT_STEM_SNAP_V :: */ + /* PS_DICT_FORCE_BOLD :: */ + /* PS_DICT_RND_STEM_UP :: */ + /* PS_DICT_MIN_FEATURE :: */ + /* PS_DICT_LEN_IV :: */ + /* PS_DICT_PASSWORD :: */ + /* PS_DICT_LANGUAGE_GROUP :: */ + /* PS_DICT_VERSION :: */ + /* PS_DICT_NOTICE :: */ + /* PS_DICT_FULL_NAME :: */ + /* PS_DICT_FAMILY_NAME :: */ + /* PS_DICT_WEIGHT :: */ + /* PS_DICT_IS_FIXED_PITCH :: */ + /* PS_DICT_UNDERLINE_POSITION :: */ + /* PS_DICT_UNDERLINE_THICKNESS :: */ + /* PS_DICT_FS_TYPE :: */ + /* PS_DICT_ITALIC_ANGLE :: */ + /* */ typedef enum PS_Dict_Keys_ { /* conventionally in the font dictionary */ diff --git a/freetype/include/ttnameid.h b/freetype/include/ttnameid.h index 9711d1d94..e65b55812 100644 --- a/freetype/include/ttnameid.h +++ b/freetype/include/ttnameid.h @@ -4,7 +4,7 @@ /* */ /* TrueType name ID definitions (specification only). */ /* */ -/* Copyright 1996-2004, 2006-2008, 2012, 2013 by */ +/* Copyright 1996-2004, 2006-2008, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -470,26 +470,26 @@ FT_BEGIN_HEADER #define TT_MS_LANGID_ARABIC_GENERAL 0x0001 #define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401 #define TT_MS_LANGID_ARABIC_IRAQ 0x0801 -#define TT_MS_LANGID_ARABIC_EGYPT 0x0c01 +#define TT_MS_LANGID_ARABIC_EGYPT 0x0C01 #define TT_MS_LANGID_ARABIC_LIBYA 0x1001 #define TT_MS_LANGID_ARABIC_ALGERIA 0x1401 #define TT_MS_LANGID_ARABIC_MOROCCO 0x1801 -#define TT_MS_LANGID_ARABIC_TUNISIA 0x1c01 +#define TT_MS_LANGID_ARABIC_TUNISIA 0x1C01 #define TT_MS_LANGID_ARABIC_OMAN 0x2001 #define TT_MS_LANGID_ARABIC_YEMEN 0x2401 #define TT_MS_LANGID_ARABIC_SYRIA 0x2801 -#define TT_MS_LANGID_ARABIC_JORDAN 0x2c01 +#define TT_MS_LANGID_ARABIC_JORDAN 0x2C01 #define TT_MS_LANGID_ARABIC_LEBANON 0x3001 #define TT_MS_LANGID_ARABIC_KUWAIT 0x3401 #define TT_MS_LANGID_ARABIC_UAE 0x3801 -#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3c01 +#define TT_MS_LANGID_ARABIC_BAHRAIN 0x3C01 #define TT_MS_LANGID_ARABIC_QATAR 0x4001 #define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402 #define TT_MS_LANGID_CATALAN_SPAIN 0x0403 #define TT_MS_LANGID_CHINESE_GENERAL 0x0004 #define TT_MS_LANGID_CHINESE_TAIWAN 0x0404 #define TT_MS_LANGID_CHINESE_PRC 0x0804 -#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0c04 +#define TT_MS_LANGID_CHINESE_HONG_KONG 0x0C04 #define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004 #if 1 /* this looks like the correct value */ @@ -507,7 +507,7 @@ FT_BEGIN_HEADER #define TT_MS_LANGID_DANISH_DENMARK 0x0406 #define TT_MS_LANGID_GERMAN_GERMANY 0x0407 #define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807 -#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0c07 +#define TT_MS_LANGID_GERMAN_AUSTRIA 0x0C07 #define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007 #define TT_MS_LANGID_GERMAN_LIECHTENSTEI 0x1407 #define TT_MS_LANGID_GREEK_GREECE 0x0408 @@ -520,69 +520,69 @@ FT_BEGIN_HEADER #define TT_MS_LANGID_ENGLISH_GENERAL 0x0009 #define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409 #define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809 -#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0c09 +#define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0C09 #define TT_MS_LANGID_ENGLISH_CANADA 0x1009 #define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409 #define TT_MS_LANGID_ENGLISH_IRELAND 0x1809 -#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1c09 +#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1C09 #define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009 #define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409 #define TT_MS_LANGID_ENGLISH_BELIZE 0x2809 -#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2c09 +#define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2C09 #define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009 #define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409 #define TT_MS_LANGID_ENGLISH_INDONESIA 0x3809 -#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3c09 +#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3C09 #define TT_MS_LANGID_ENGLISH_INDIA 0x4009 #define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409 #define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809 -#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040a -#define TT_MS_LANGID_SPANISH_MEXICO 0x080a -#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0c0a -#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100a -#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140a -#define TT_MS_LANGID_SPANISH_PANAMA 0x180a -#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1c0a -#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200a -#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240a -#define TT_MS_LANGID_SPANISH_PERU 0x280a -#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2c0a -#define TT_MS_LANGID_SPANISH_ECUADOR 0x300a -#define TT_MS_LANGID_SPANISH_CHILE 0x340a -#define TT_MS_LANGID_SPANISH_URUGUAY 0x380a -#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3c0a -#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400a -#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440a -#define TT_MS_LANGID_SPANISH_HONDURAS 0x480a -#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4c0a -#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500a -#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540a +#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040A +#define TT_MS_LANGID_SPANISH_MEXICO 0x080A +#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT 0x0C0A +#define TT_MS_LANGID_SPANISH_GUATEMALA 0x100A +#define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140A +#define TT_MS_LANGID_SPANISH_PANAMA 0x180A +#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1C0A +#define TT_MS_LANGID_SPANISH_VENEZUELA 0x200A +#define TT_MS_LANGID_SPANISH_COLOMBIA 0x240A +#define TT_MS_LANGID_SPANISH_PERU 0x280A +#define TT_MS_LANGID_SPANISH_ARGENTINA 0x2C0A +#define TT_MS_LANGID_SPANISH_ECUADOR 0x300A +#define TT_MS_LANGID_SPANISH_CHILE 0x340A +#define TT_MS_LANGID_SPANISH_URUGUAY 0x380A +#define TT_MS_LANGID_SPANISH_PARAGUAY 0x3C0A +#define TT_MS_LANGID_SPANISH_BOLIVIA 0x400A +#define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440A +#define TT_MS_LANGID_SPANISH_HONDURAS 0x480A +#define TT_MS_LANGID_SPANISH_NICARAGUA 0x4C0A +#define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500A +#define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540A /* The following ID blatantly violate MS specs by using a */ /* sublanguage > 0x1F. */ -#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40aU -#define TT_MS_LANGID_FINNISH_FINLAND 0x040b -#define TT_MS_LANGID_FRENCH_FRANCE 0x040c -#define TT_MS_LANGID_FRENCH_BELGIUM 0x080c -#define TT_MS_LANGID_FRENCH_CANADA 0x0c0c -#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100c -#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140c -#define TT_MS_LANGID_FRENCH_MONACO 0x180c -#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1c0c -#define TT_MS_LANGID_FRENCH_REUNION 0x200c -#define TT_MS_LANGID_FRENCH_CONGO 0x240c +#define TT_MS_LANGID_SPANISH_LATIN_AMERICA 0xE40AU +#define TT_MS_LANGID_FINNISH_FINLAND 0x040B +#define TT_MS_LANGID_FRENCH_FRANCE 0x040C +#define TT_MS_LANGID_FRENCH_BELGIUM 0x080C +#define TT_MS_LANGID_FRENCH_CANADA 0x0C0C +#define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100C +#define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140C +#define TT_MS_LANGID_FRENCH_MONACO 0x180C +#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1C0C +#define TT_MS_LANGID_FRENCH_REUNION 0x200C +#define TT_MS_LANGID_FRENCH_CONGO 0x240C /* which was formerly: */ #define TT_MS_LANGID_FRENCH_ZAIRE TT_MS_LANGID_FRENCH_CONGO -#define TT_MS_LANGID_FRENCH_SENEGAL 0x280c -#define TT_MS_LANGID_FRENCH_CAMEROON 0x2c0c -#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300c -#define TT_MS_LANGID_FRENCH_MALI 0x340c -#define TT_MS_LANGID_FRENCH_MOROCCO 0x380c -#define TT_MS_LANGID_FRENCH_HAITI 0x3c0c - /* and another violation of the spec (see 0xE40aU) */ -#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40cU -#define TT_MS_LANGID_HEBREW_ISRAEL 0x040d -#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040e -#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040f +#define TT_MS_LANGID_FRENCH_SENEGAL 0x280C +#define TT_MS_LANGID_FRENCH_CAMEROON 0x2C0C +#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300C +#define TT_MS_LANGID_FRENCH_MALI 0x340C +#define TT_MS_LANGID_FRENCH_MOROCCO 0x380C +#define TT_MS_LANGID_FRENCH_HAITI 0x3C0C + /* and another violation of the spec (see 0xE40AU) */ +#define TT_MS_LANGID_FRENCH_NORTH_AFRICA 0xE40CU +#define TT_MS_LANGID_HEBREW_ISRAEL 0x040D +#define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040E +#define TT_MS_LANGID_ICELANDIC_ICELAND 0x040F #define TT_MS_LANGID_ITALIAN_ITALY 0x0410 #define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810 #define TT_MS_LANGID_JAPANESE_JAPAN 0x0411 @@ -600,27 +600,27 @@ FT_BEGIN_HEADER #define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA 0x0818 #define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419 #define TT_MS_LANGID_RUSSIAN_MOLDAVIA 0x0819 -#define TT_MS_LANGID_CROATIAN_CROATIA 0x041a -#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081a -#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0c1a +#define TT_MS_LANGID_CROATIAN_CROATIA 0x041A +#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081A +#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0C1A #if 0 /* this used to be this value, but it looks like we were wrong */ -#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x101a +#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x101A #else /* current sources say */ -#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101a -#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141a +#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101A +#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141A /* and XPsp2 Platform SDK added (2004-07-26) */ /* Names are shortened to be significant within 40 chars. */ -#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181a -#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x181a +#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181A +#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x181A #endif -#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041b -#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041c -#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041d -#define TT_MS_LANGID_SWEDISH_FINLAND 0x081d -#define TT_MS_LANGID_THAI_THAILAND 0x041e -#define TT_MS_LANGID_TURKISH_TURKEY 0x041f +#define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041B +#define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041C +#define TT_MS_LANGID_SWEDISH_SWEDEN 0x041D +#define TT_MS_LANGID_SWEDISH_FINLAND 0x081D +#define TT_MS_LANGID_THAI_THAILAND 0x041E +#define TT_MS_LANGID_TURKISH_TURKEY 0x041F #define TT_MS_LANGID_URDU_PAKISTAN 0x0420 #define TT_MS_LANGID_URDU_INDIA 0x0820 #define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421 @@ -633,13 +633,13 @@ FT_BEGIN_HEADER #define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827 #define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428 #define TT_MS_LANGID_FARSI_IRAN 0x0429 -#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042a -#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042b -#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042c -#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082c -#define TT_MS_LANGID_BASQUE_SPAIN 0x042d -#define TT_MS_LANGID_SORBIAN_GERMANY 0x042e -#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042f +#define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042A +#define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042B +#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042C +#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082C +#define TT_MS_LANGID_BASQUE_SPAIN 0x042D +#define TT_MS_LANGID_SORBIAN_GERMANY 0x042E +#define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042F #define TT_MS_LANGID_SUTU_SOUTH_AFRICA 0x0430 #define TT_MS_LANGID_TSONGA_SOUTH_AFRICA 0x0431 #define TT_MS_LANGID_TSWANA_SOUTH_AFRICA 0x0432 @@ -650,32 +650,32 @@ FT_BEGIN_HEADER #define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437 #define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438 #define TT_MS_LANGID_HINDI_INDIA 0x0439 -#define TT_MS_LANGID_MALTESE_MALTA 0x043a +#define TT_MS_LANGID_MALTESE_MALTA 0x043A /* Added by XPsp2 Platform SDK (2004-07-26) */ -#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043b -#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083b -#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3b -#define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103b -#define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143b -#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183b -#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3b -#define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203b -#define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243b +#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043B +#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083B +#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3B +#define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103B +#define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143B +#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183B +#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3B +#define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203B +#define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243B /* ... and we also keep our old identifier... */ -#define TT_MS_LANGID_SAAMI_LAPONIA 0x043b +#define TT_MS_LANGID_SAAMI_LAPONIA 0x043B #if 0 /* this seems to be a previous inversion */ -#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c -#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c +#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043C +#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083C #else -#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c -#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c +#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083C +#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043C #endif -#define TT_MS_LANGID_YIDDISH_GERMANY 0x043d -#define TT_MS_LANGID_MALAY_MALAYSIA 0x043e -#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083e -#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043f +#define TT_MS_LANGID_YIDDISH_GERMANY 0x043D +#define TT_MS_LANGID_MALAY_MALAYSIA 0x043E +#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E +#define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043F #define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440 /* alias declared in Windows 2000 */ #define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \ @@ -693,12 +693,12 @@ FT_BEGIN_HEADER #define TT_MS_LANGID_GUJARATI_INDIA 0x0447 #define TT_MS_LANGID_ORIYA_INDIA 0x0448 #define TT_MS_LANGID_TAMIL_INDIA 0x0449 -#define TT_MS_LANGID_TELUGU_INDIA 0x044a -#define TT_MS_LANGID_KANNADA_INDIA 0x044b -#define TT_MS_LANGID_MALAYALAM_INDIA 0x044c -#define TT_MS_LANGID_ASSAMESE_INDIA 0x044d -#define TT_MS_LANGID_MARATHI_INDIA 0x044e -#define TT_MS_LANGID_SANSKRIT_INDIA 0x044f +#define TT_MS_LANGID_TELUGU_INDIA 0x044A +#define TT_MS_LANGID_KANNADA_INDIA 0x044B +#define TT_MS_LANGID_MALAYALAM_INDIA 0x044C +#define TT_MS_LANGID_ASSAMESE_INDIA 0x044D +#define TT_MS_LANGID_MARATHI_INDIA 0x044E +#define TT_MS_LANGID_SANSKRIT_INDIA 0x044F #define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450 #define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN 0x0850 #define TT_MS_LANGID_TIBETAN_CHINA 0x0451 @@ -732,13 +732,13 @@ FT_BEGIN_HEADER #define TT_MS_LANGID_SINDHI_INDIA /* Arabic */ 0x0459 #define TT_MS_LANGID_SINDHI_PAKISTAN 0x0859 /* Missing a LCID for Sindhi in Devanagari script */ -#define TT_MS_LANGID_SYRIAC_SYRIA 0x045a -#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045b -#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045c -#define TT_MS_LANGID_INUKTITUT_CANADA 0x045d -#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045e -#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045f -#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085f +#define TT_MS_LANGID_SYRIAC_SYRIA 0x045A +#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045B +#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045C +#define TT_MS_LANGID_INUKTITUT_CANADA 0x045D +#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045E +#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */ 0x045F +#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085F /* Missing a LCID for Tifinagh script */ #define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */ 0x0460 /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */ @@ -758,15 +758,15 @@ FT_BEGIN_HEADER #define TT_MS_LANGID_FULFULDE_NIGERIA 0x0467 #define TT_MS_LANGID_HAUSA_NIGERIA 0x0468 #define TT_MS_LANGID_IBIBIO_NIGERIA 0x0469 -#define TT_MS_LANGID_YORUBA_NIGERIA 0x046a -#define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046b -#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086b -#define TT_MS_LANGID_QUECHUA_PERU 0x0c6b -#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 0x046c +#define TT_MS_LANGID_YORUBA_NIGERIA 0x046A +#define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046B +#define TT_MS_LANGID_QUECHUA_ECUADOR 0x086B +#define TT_MS_LANGID_QUECHUA_PERU 0x0C6B +#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA 0x046C /* Also spelled by XPsp2 Platform SDK (2004-07-26) */ #define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \ TT_MS_LANGID_SEPEDI_SOUTH_AFRICA - /* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */ + /* language codes 0x046D, 0x046E and 0x046F are (still) unknown. */ #define TT_MS_LANGID_IGBO_NIGERIA 0x0470 #define TT_MS_LANGID_KANURI_NIGERIA 0x0471 #define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472 @@ -783,12 +783,12 @@ FT_BEGIN_HEADER /* studying). */ #define TT_MS_LANGID_YI_CHINA 0x0478 #define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES 0x0479 - /* language codes from 0x047a to 0x047f are (still) unknown. */ + /* language codes from 0x047A to 0x047F are (still) unknown. */ #define TT_MS_LANGID_UIGHUR_CHINA 0x0480 #define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481 #if 0 /* not deemed useful for fonts */ -#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE 0x04ff +#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE 0x04FF #endif diff --git a/freetype/include/tttables.h b/freetype/include/tttables.h index bb49dc0da..e1d8b05e7 100644 --- a/freetype/include/tttables.h +++ b/freetype/include/tttables.h @@ -5,7 +5,7 @@ /* Basic SFNT/TrueType tables definitions and interface */ /* (specification only). */ /* */ -/* Copyright 1996-2005, 2008-2013 by */ +/* Copyright 1996-2005, 2008-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -48,6 +48,25 @@ FT_BEGIN_HEADER /* This section contains the definition of TrueType-specific tables */ /* as well as some routines used to access and process them. */ /* */ + /* */ + /* TT_Header */ + /* TT_HoriHeader */ + /* TT_VertHeader */ + /* TT_OS2 */ + /* TT_Postscript */ + /* TT_PCLT */ + /* TT_MaxProfile */ + /* */ + /* FT_Sfnt_Tag */ + /* FT_Get_Sfnt_Table */ + /* FT_Load_Sfnt_Table */ + /* FT_Sfnt_Table_Info */ + /* */ + /* FT_Get_CMap_Language_ID */ + /* FT_Get_CMap_Format */ + /* */ + /* FT_PARAM_TAG_UNPATENTED_HINTING */ + /* */ /*************************************************************************/ @@ -559,21 +578,44 @@ FT_BEGIN_HEADER /* An enumeration used to specify the index of an SFNT table. */ /* Used in the @FT_Get_Sfnt_Table API function. */ /* */ + /* */ + /* FT_SFNT_HEAD :: To access the font's @TT_Header structure. */ + /* */ + /* FT_SFNT_MAXP :: To access the font's @TT_MaxProfile structure. */ + /* */ + /* FT_SFNT_OS2 :: To access the font's @TT_OS2 structure. */ + /* */ + /* FT_SFNT_HHEA :: To access the font's @TT_HoriHeader structure. */ + /* */ + /* FT_SFNT_VHEA :: To access the font's @TT_VertHeader struture. */ + /* */ + /* FT_SFNT_POST :: To access the font's @TT_Postscript structure. */ + /* */ + /* FT_SFNT_PCLT :: To access the font's @TT_PCLT structure. */ + /* */ typedef enum FT_Sfnt_Tag_ { - ft_sfnt_head = 0, /* TT_Header */ - ft_sfnt_maxp = 1, /* TT_MaxProfile */ - ft_sfnt_os2 = 2, /* TT_OS2 */ - ft_sfnt_hhea = 3, /* TT_HoriHeader */ - ft_sfnt_vhea = 4, /* TT_VertHeader */ - ft_sfnt_post = 5, /* TT_Postscript */ - ft_sfnt_pclt = 6, /* TT_PCLT */ + FT_SFNT_HEAD, + FT_SFNT_MAXP, + FT_SFNT_OS2, + FT_SFNT_HHEA, + FT_SFNT_VHEA, + FT_SFNT_POST, + FT_SFNT_PCLT, - sfnt_max /* internal end mark */ + FT_SFNT_MAX } FT_Sfnt_Tag; - /* */ + /* these constants are deprecated; use the corresponding `FT_Sfnt_Tag' */ + /* values instead */ +#define ft_sfnt_head FT_SFNT_HEAD +#define ft_sfnt_maxp FT_SFNT_MAXP +#define ft_sfnt_os2 FT_SFNT_OS2 +#define ft_sfnt_hhea FT_SFNT_HHEA +#define ft_sfnt_vhea FT_SFNT_VHEA +#define ft_sfnt_post FT_SFNT_POST +#define ft_sfnt_pclt FT_SFNT_PCLT /*************************************************************************/ @@ -611,7 +653,7 @@ FT_BEGIN_HEADER /* */ /* */ /* vert_header = */ - /* (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea ); */ + /* (TT_VertHeader*)FT_Get_Sfnt_Table( face, FT_SFNT_VHEA ); */ /* } */ /* */ FT_EXPORT( void* ) diff --git a/freetype/include/ttunpat.h b/freetype/include/ttunpat.h index a0162759b..bf53ddd52 100644 --- a/freetype/include/ttunpat.h +++ b/freetype/include/ttunpat.h @@ -48,7 +48,8 @@ FT_BEGIN_HEADER */ #define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' ) - /* */ + /* */ + FT_END_HEADER diff --git a/freetype/src/autofit/afangles.c b/freetype/src/autofit/afangles.c index b44a5ba2c..f8b095bef 100644 --- a/freetype/src/autofit/afangles.c +++ b/freetype/src/autofit/afangles.c @@ -20,66 +20,6 @@ #include "aftypes.h" -#if 0 - - FT_LOCAL_DEF( FT_Int ) - af_corner_is_flat( FT_Pos x_in, - FT_Pos y_in, - FT_Pos x_out, - FT_Pos y_out ) - { - FT_Pos ax = x_in; - FT_Pos ay = y_in; - - FT_Pos d_in, d_out, d_corner; - - - if ( ax < 0 ) - ax = -ax; - if ( ay < 0 ) - ay = -ay; - d_in = ax + ay; - - ax = x_out; - if ( ax < 0 ) - ax = -ax; - ay = y_out; - if ( ay < 0 ) - ay = -ay; - d_out = ax + ay; - - ax = x_out + x_in; - if ( ax < 0 ) - ax = -ax; - ay = y_out + y_in; - if ( ay < 0 ) - ay = -ay; - d_corner = ax + ay; - - return ( d_in + d_out - d_corner ) < ( d_corner >> 4 ); - } - - - FT_LOCAL_DEF( FT_Int ) - af_corner_orientation( FT_Pos x_in, - FT_Pos y_in, - FT_Pos x_out, - FT_Pos y_out ) - { - FT_Pos delta; - - - delta = x_in * y_out - y_in * x_out; - - if ( delta == 0 ) - return 0; - else - return 1 - 2 * ( delta < 0 ); - } - -#endif /* 0 */ - - /* * We are not using `af_angle_atan' anymore, but we keep the source * code below just in case... diff --git a/freetype/src/autofit/afblue.c b/freetype/src/autofit/afblue.c index 6e214c872..811226eac 100644 --- a/freetype/src/autofit/afblue.c +++ b/freetype/src/autofit/afblue.c @@ -26,15 +26,21 @@ af_blue_strings[] = { /* */ - 'T', 'H', 'E', 'Z', 'O', 'C', 'Q', 'S', /* THEZOCQS */ + '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\x9F', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕПЗОСЭ */ '\0', - 'H', 'E', 'Z', 'L', 'O', 'C', 'U', 'S', /* HEZLOCUS */ + '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\xA8', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕШЗОСЭ */ '\0', - 'f', 'i', 'j', 'k', 'd', 'b', 'h', /* fijkdbh */ + '\xD1', '\x85', '\xD0', '\xBF', '\xD0', '\xBD', '\xD1', '\x88', '\xD0', '\xB5', '\xD0', '\xB7', '\xD0', '\xBE', '\xD1', '\x81', /* хпншезос */ '\0', - 'x', 'z', 'r', 'o', 'e', 's', 'c', /* xzroesc */ + '\xD1', '\x80', '\xD1', '\x83', '\xD1', '\x84', /* руф */ '\0', - 'p', 'q', 'g', 'j', 'y', /* pqgjy */ + '\xE0', '\xA4', '\x95', '\xE0', '\xA4', '\xAE', '\xE0', '\xA4', '\x85', '\xE0', '\xA4', '\x86', '\xE0', '\xA4', '\xA5', '\xE0', '\xA4', '\xA7', '\xE0', '\xA4', '\xAD', '\xE0', '\xA4', '\xB6', /* क म अ आ थ ध भ श */ + '\0', + '\xE0', '\xA4', '\x88', '\xE0', '\xA4', '\x90', '\xE0', '\xA4', '\x93', '\xE0', '\xA4', '\x94', '\xE0', '\xA4', '\xBF', '\xE0', '\xA5', '\x80', '\xE0', '\xA5', '\x8B', '\xE0', '\xA5', '\x8C', /* ई ऐ ओ औ ि ी ो ौ */ + '\0', + '\xE0', '\xA4', '\x95', '\xE0', '\xA4', '\xAE', '\xE0', '\xA4', '\x85', '\xE0', '\xA4', '\x86', '\xE0', '\xA4', '\xA5', '\xE0', '\xA4', '\xA7', '\xE0', '\xA4', '\xAD', '\xE0', '\xA4', '\xB6', /* क म अ आ थ ध भ श */ + '\0', + '\xE0', '\xA5', '\x81', '\xE0', '\xA5', '\x83', /* ु ृ */ '\0', '\xCE', '\x93', '\xCE', '\x92', '\xCE', '\x95', '\xCE', '\x96', '\xCE', '\x98', '\xCE', '\x9F', '\xCE', '\xA9', /* ΓΒΕΖΘΟΩ */ '\0', @@ -46,26 +52,31 @@ '\0', '\xCE', '\xB2', '\xCE', '\xB3', '\xCE', '\xB7', '\xCE', '\xBC', '\xCF', '\x81', '\xCF', '\x86', '\xCF', '\x87', '\xCF', '\x88', /* βγημρφχψ */ '\0', - '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\x9F', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕПЗОСЭ */ + '\xD7', '\x91', '\xD7', '\x93', '\xD7', '\x94', '\xD7', '\x97', '\xD7', '\x9A', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1', /* בדהחךכםס */ '\0', - '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\xA8', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕШЗОСЭ */ + '\xD7', '\x91', '\xD7', '\x98', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1', '\xD7', '\xA6', /* בטכםסצ */ '\0', - '\xD1', '\x85', '\xD0', '\xBF', '\xD0', '\xBD', '\xD1', '\x88', '\xD0', '\xB5', '\xD0', '\xB7', '\xD0', '\xBE', '\xD1', '\x81', /* хпншезос */ + '\xD7', '\xA7', '\xD7', '\x9A', '\xD7', '\x9F', '\xD7', '\xA3', '\xD7', '\xA5', /* קךןףץ */ '\0', - '\xD1', '\x80', '\xD1', '\x83', '\xD1', '\x84', /* руф */ + 'T', 'H', 'E', 'Z', 'O', 'C', 'Q', 'S', /* THEZOCQS */ '\0', - '\xD7', '\x91', '\xD7', '\x93', '\xD7', '\x94', '\xD7', '\x97', '\xD7', '\x9A', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1', /* בדהחךכםס */ + 'H', 'E', 'Z', 'L', 'O', 'C', 'U', 'S', /* HEZLOCUS */ '\0', - '\xD7', '\x91', '\xD7', '\x98', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1', '\xD7', '\xA6', /* בטכםסצ */ + 'f', 'i', 'j', 'k', 'd', 'b', 'h', /* fijkdbh */ '\0', - '\xD7', '\xA7', '\xD7', '\x9A', '\xD7', '\x9F', '\xD7', '\xA3', '\xD7', '\xA5', /* קךןףץ */ + 'x', 'z', 'r', 'o', 'e', 's', 'c', /* xzroesc */ + '\0', + 'p', 'q', 'g', 'j', 'y', /* pqgjy */ + '\0', + '\xE0', '\xB0', '\x87', '\xE0', '\xB0', '\x8C', '\xE0', '\xB0', '\x99', '\xE0', '\xB0', '\x9E', '\xE0', '\xB0', '\xA3', '\xE0', '\xB0', '\xB1', '\xE0', '\xB1', '\xAF', /* ఇ ఌ ఙ ఞ ణ ఱ ౯ */ + '\0', + '\xE0', '\xB0', '\x85', '\xE0', '\xB0', '\x95', '\xE0', '\xB0', '\x9A', '\xE0', '\xB0', '\xB0', '\xE0', '\xB0', '\xBD', '\xE0', '\xB1', '\xA8', '\xE0', '\xB1', '\xAC', /* అ క చ ర ఽ ౨ ౬ */ #ifdef AF_CONFIG_OPTION_CJK '\0', '\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0', /* 他们你來們到和地 */ '\xE5', '\xAF', '\xB9', '\xE5', '\xB0', '\x8D', '\xE5', '\xB0', '\xB1', '\xE5', '\xB8', '\xAD', '\xE6', '\x88', '\x91', '\xE6', '\x97', '\xB6', '\xE6', '\x99', '\x82', '\xE6', '\x9C', '\x83', /* 对對就席我时時會 */ '\xE6', '\x9D', '\xA5', '\xE7', '\x82', '\xBA', '\xE8', '\x83', '\xBD', '\xE8', '\x88', '\xB0', '\xE8', '\xAA', '\xAA', '\xE8', '\xAF', '\xB4', '\xE8', '\xBF', '\x99', '\xE9', '\x80', '\x99', /* 来為能舰說说这這 */ - '\xE9', '\xBD', '\x8A', /* 齊 */ - '\0', + '\xE9', '\xBD', '\x8A', '|', /* 齊 | */ '\xE5', '\x86', '\x9B', '\xE5', '\x90', '\x8C', '\xE5', '\xB7', '\xB2', '\xE6', '\x84', '\xBF', '\xE6', '\x97', '\xA2', '\xE6', '\x98', '\x9F', '\xE6', '\x98', '\xAF', '\xE6', '\x99', '\xAF', /* 军同已愿既星是景 */ '\xE6', '\xB0', '\x91', '\xE7', '\x85', '\xA7', '\xE7', '\x8E', '\xB0', '\xE7', '\x8F', '\xBE', '\xE7', '\x90', '\x86', '\xE7', '\x94', '\xA8', '\xE7', '\xBD', '\xAE', '\xE8', '\xA6', '\x81', /* 民照现現理用置要 */ '\xE8', '\xBB', '\x8D', '\xE9', '\x82', '\xA3', '\xE9', '\x85', '\x8D', '\xE9', '\x87', '\x8C', '\xE9', '\x96', '\x8B', '\xE9', '\x9B', '\xB7', '\xE9', '\x9C', '\xB2', '\xE9', '\x9D', '\xA2', /* 軍那配里開雷露面 */ @@ -74,8 +85,7 @@ '\xE4', '\xB8', '\xAA', '\xE4', '\xB8', '\xBA', '\xE4', '\xBA', '\xBA', '\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xA5', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', /* 个为人他以们你來 */ '\xE5', '\x80', '\x8B', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\xA4', '\xA7', '\xE5', '\xAF', '\xB9', '\xE5', '\xB0', '\x8D', '\xE5', '\xB0', '\xB1', /* 個們到和大对對就 */ '\xE6', '\x88', '\x91', '\xE6', '\x97', '\xB6', '\xE6', '\x99', '\x82', '\xE6', '\x9C', '\x89', '\xE6', '\x9D', '\xA5', '\xE7', '\x82', '\xBA', '\xE8', '\xA6', '\x81', '\xE8', '\xAA', '\xAA', /* 我时時有来為要說 */ - '\xE8', '\xAF', '\xB4', /* 说 */ - '\0', + '\xE8', '\xAF', '\xB4', '|', /* 说 | */ '\xE4', '\xB8', '\xBB', '\xE4', '\xBA', '\x9B', '\xE5', '\x9B', '\xA0', '\xE5', '\xAE', '\x83', '\xE6', '\x83', '\xB3', '\xE6', '\x84', '\x8F', '\xE7', '\x90', '\x86', '\xE7', '\x94', '\x9F', /* 主些因它想意理生 */ '\xE7', '\x95', '\xB6', '\xE7', '\x9C', '\x8B', '\xE7', '\x9D', '\x80', '\xE7', '\xBD', '\xAE', '\xE8', '\x80', '\x85', '\xE8', '\x87', '\xAA', '\xE8', '\x91', '\x97', '\xE8', '\xA3', '\xA1', /* 當看着置者自著裡 */ '\xE8', '\xBF', '\x87', '\xE8', '\xBF', '\x98', '\xE8', '\xBF', '\x9B', '\xE9', '\x80', '\xB2', '\xE9', '\x81', '\x8E', '\xE9', '\x81', '\x93', '\xE9', '\x82', '\x84', '\xE9', '\x87', '\x8C', /* 过还进進過道還里 */ @@ -85,8 +95,7 @@ '\xE4', '\xBA', '\x9B', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0', /* 些们你來們到和地 */ '\xE5', '\xA5', '\xB9', '\xE5', '\xB0', '\x86', '\xE5', '\xB0', '\x87', '\xE5', '\xB0', '\xB1', '\xE5', '\xB9', '\xB4', '\xE5', '\xBE', '\x97', '\xE6', '\x83', '\x85', '\xE6', '\x9C', '\x80', /* 她将將就年得情最 */ '\xE6', '\xA0', '\xB7', '\xE6', '\xA8', '\xA3', '\xE7', '\x90', '\x86', '\xE8', '\x83', '\xBD', '\xE8', '\xAA', '\xAA', '\xE8', '\xAF', '\xB4', '\xE8', '\xBF', '\x99', '\xE9', '\x80', '\x99', /* 样樣理能說说这這 */ - '\xE9', '\x80', '\x9A', /* 通 */ - '\0', + '\xE9', '\x80', '\x9A', '|', /* 通 | */ '\xE5', '\x8D', '\xB3', '\xE5', '\x90', '\x97', '\xE5', '\x90', '\xA7', '\xE5', '\x90', '\xAC', '\xE5', '\x91', '\xA2', '\xE5', '\x93', '\x81', '\xE5', '\x93', '\x8D', '\xE5', '\x97', '\x8E', /* 即吗吧听呢品响嗎 */ '\xE5', '\xB8', '\x88', '\xE5', '\xB8', '\xAB', '\xE6', '\x94', '\xB6', '\xE6', '\x96', '\xAD', '\xE6', '\x96', '\xB7', '\xE6', '\x98', '\x8E', '\xE7', '\x9C', '\xBC', '\xE9', '\x96', '\x93', /* 师師收断斷明眼間 */ '\xE9', '\x97', '\xB4', '\xE9', '\x99', '\x85', '\xE9', '\x99', '\x88', '\xE9', '\x99', '\x90', '\xE9', '\x99', '\xA4', '\xE9', '\x99', '\xB3', '\xE9', '\x9A', '\x8F', '\xE9', '\x9A', '\x9B', /* 间际陈限除陳随際 */ @@ -95,8 +104,7 @@ '\xE4', '\xBA', '\x8B', '\xE5', '\x89', '\x8D', '\xE5', '\xAD', '\xB8', '\xE5', '\xB0', '\x86', '\xE5', '\xB0', '\x87', '\xE6', '\x83', '\x85', '\xE6', '\x83', '\xB3', '\xE6', '\x88', '\x96', /* 事前學将將情想或 */ '\xE6', '\x94', '\xBF', '\xE6', '\x96', '\xAF', '\xE6', '\x96', '\xB0', '\xE6', '\xA0', '\xB7', '\xE6', '\xA8', '\xA3', '\xE6', '\xB0', '\x91', '\xE6', '\xB2', '\x92', '\xE6', '\xB2', '\xA1', /* 政斯新样樣民沒没 */ '\xE7', '\x84', '\xB6', '\xE7', '\x89', '\xB9', '\xE7', '\x8E', '\xB0', '\xE7', '\x8F', '\xBE', '\xE7', '\x90', '\x83', '\xE7', '\xAC', '\xAC', '\xE7', '\xB6', '\x93', '\xE8', '\xB0', '\x81', /* 然特现現球第經谁 */ - '\xE8', '\xB5', '\xB7', /* 起 */ - '\0', + '\xE8', '\xB5', '\xB7', '|', /* 起 | */ '\xE4', '\xBE', '\x8B', '\xE5', '\x88', '\xA5', '\xE5', '\x88', '\xAB', '\xE5', '\x88', '\xB6', '\xE5', '\x8A', '\xA8', '\xE5', '\x8B', '\x95', '\xE5', '\x90', '\x97', '\xE5', '\x97', '\x8E', /* 例別别制动動吗嗎 */ '\xE5', '\xA2', '\x9E', '\xE6', '\x8C', '\x87', '\xE6', '\x98', '\x8E', '\xE6', '\x9C', '\x9D', '\xE6', '\x9C', '\x9F', '\xE6', '\x9E', '\x84', '\xE7', '\x89', '\xA9', '\xE7', '\xA1', '\xAE', /* 增指明朝期构物确 */ '\xE7', '\xA7', '\x8D', '\xE8', '\xAA', '\xBF', '\xE8', '\xB0', '\x83', '\xE8', '\xB2', '\xBB', '\xE8', '\xB4', '\xB9', '\xE9', '\x82', '\xA3', '\xE9', '\x83', '\xBD', '\xE9', '\x96', '\x93', /* 种調调費费那都間 */ @@ -113,14 +121,21 @@ af_blue_stringsets[] = { /* */ - { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 }, - { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_LATIN_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_LATIN_SMALL, 0 }, - { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 }, + { AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_CYRILLIC_SMALL, 0 }, + { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_DEVANAGARI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_DEVANAGARI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_DEVANAGARI_BASE, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_NEUTRAL | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_DEVANAGARI_BASE, 0 }, + { AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 }, { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, @@ -129,35 +144,31 @@ { AF_BLUE_STRING_GREEK_SMALL, 0 }, { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 }, - { AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_CYRILLIC_SMALL, 0 }, - { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 }, - { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_HEBREW_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_LONG }, { AF_BLUE_STRING_HEBREW_BOTTOM, 0 }, { AF_BLUE_STRING_HEBREW_DESCENDER, 0 }, { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 }, + { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_LATIN_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_LATIN_SMALL, 0 }, + { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_TELUGU_BOTTOM, 0 }, + { AF_BLUE_STRING_MAX, 0 }, #ifdef AF_CONFIG_OPTION_CJK - { AF_BLUE_STRING_CJK_TOP_FILL, AF_BLUE_PROPERTY_CJK_TOP | - AF_BLUE_PROPERTY_CJK_FILL }, - { AF_BLUE_STRING_CJK_TOP_UNFILL, AF_BLUE_PROPERTY_CJK_TOP }, - { AF_BLUE_STRING_CJK_BOTTOM_FILL, AF_BLUE_PROPERTY_CJK_FILL }, - { AF_BLUE_STRING_CJK_BOTTOM_UNFILL, 0 }, + { AF_BLUE_STRING_CJK_TOP, AF_BLUE_PROPERTY_CJK_TOP }, + { AF_BLUE_STRING_CJK_BOTTOM, 0 }, #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT - { AF_BLUE_STRING_CJK_LEFT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ | - AF_BLUE_PROPERTY_CJK_FILL }, - { AF_BLUE_STRING_CJK_LEFT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ }, - { AF_BLUE_STRING_CJK_RIGHT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ | - AF_BLUE_PROPERTY_CJK_RIGHT | - AF_BLUE_PROPERTY_CJK_FILL }, - { AF_BLUE_STRING_CJK_RIGHT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ | - AF_BLUE_PROPERTY_CJK_RIGHT }, + { AF_BLUE_STRING_CJK_LEFT, AF_BLUE_PROPERTY_CJK_HORIZ }, + { AF_BLUE_STRING_CJK_RIGHT, AF_BLUE_PROPERTY_CJK_HORIZ | + AF_BLUE_PROPERTY_CJK_RIGHT }, #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ - { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_MAX, 0 }, #endif /* AF_CONFIG_OPTION_CJK */ }; diff --git a/freetype/src/autofit/afblue.dat b/freetype/src/autofit/afblue.dat index d488f3fae..3f98c13b2 100644 --- a/freetype/src/autofit/afblue.dat +++ b/freetype/src/autofit/afblue.dat @@ -2,7 +2,7 @@ // // Auto-fitter data for blue strings. // -// Copyright 2013 by +// Copyright 2013, 2014 by // David Turner, Robert Wilhelm, and Werner Lemberg. // // This file is part of the FreeType project, and may only be used, @@ -34,11 +34,11 @@ // using C syntax. There can be only one string per line, thus the // starting and ending double quote must be the first and last character // in the line, respectively, ignoring whitespace before and after the -// string. If there are multiple strings (in multiple lines), they are -// concatenated to a single string. In the output, a string gets -// represented as a series of singles bytes, followed by a zero byte. The -// enumeration values simply hold byte offsets to the start of the -// corresponding strings. +// string. Space characters within the string are ignored too. If there +// are multiple strings (in multiple lines), they are concatenated to a +// single string. In the output, a string gets represented as a series of +// singles bytes, followed by a zero byte. The enumeration values simply +// hold byte offsets to the start of the corresponding strings. // // - Data blocks enclosed in balanced braces, which get copied verbatim and // which can span multiple lines. The opening brace of a block must be @@ -63,18 +63,32 @@ // characters, not bytes. +// The blue zone string data, to be used in the blue stringsets below. + AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: - AF_BLUE_STRING_LATIN_CAPITAL_TOP - "THEZOCQS" - AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM - "HEZLOCUS" - AF_BLUE_STRING_LATIN_SMALL_F_TOP - "fijkdbh" - AF_BLUE_STRING_LATIN_SMALL - "xzroesc" - AF_BLUE_STRING_LATIN_SMALL_DESCENDER - "pqgjy" + AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP + "БВЕПЗОСЭ" + AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM + "БВЕШЗОСЭ" + AF_BLUE_STRING_CYRILLIC_SMALL + "хпншезос" + AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER + "руф" + + // we separate the letters with spaces to avoid ligatures; + // this is just for convenience to simplify reading + AF_BLUE_STRING_DEVANAGARI_BASE + "क म अ आ थ ध भ श" + AF_BLUE_STRING_DEVANAGARI_TOP + "ई ऐ ओ औ ि ी ो ौ" + // note that some fonts have extreme variation in the height of the + // round head elements; for this reason we also define the `base' + // blue zone, which must be always present + AF_BLUE_STRING_DEVANAGARI_HEAD + "क म अ आ थ ध भ श" + AF_BLUE_STRING_DEVANAGARI_BOTTOM + "ु ृ" AF_BLUE_STRING_GREEK_CAPITAL_TOP "ΓΒΕΖΘΟΩ" @@ -87,15 +101,6 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRING_GREEK_SMALL_DESCENDER "βγημρφχψ" - AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP - "БВЕПЗОСЭ" - AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM - "БВЕШЗОСЭ" - AF_BLUE_STRING_CYRILLIC_SMALL - "хпншезос" - AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER - "руф" - AF_BLUE_STRING_HEBREW_TOP "בדהחךכםס" AF_BLUE_STRING_HEBREW_BOTTOM @@ -103,24 +108,41 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRING_HEBREW_DESCENDER "קךןףץ" + AF_BLUE_STRING_LATIN_CAPITAL_TOP + "THEZOCQS" + AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM + "HEZLOCUS" + AF_BLUE_STRING_LATIN_SMALL_F_TOP + "fijkdbh" + AF_BLUE_STRING_LATIN_SMALL + "xzroesc" + AF_BLUE_STRING_LATIN_SMALL_DESCENDER + "pqgjy" + + // we separate the letters with spaces to avoid ligatures; + // this is just for convenience to simplify reading + AF_BLUE_STRING_TELUGU_TOP + "ఇ ఌ ఙ ఞ ణ ఱ ౯" + + AF_BLUE_STRING_TELUGU_BOTTOM + "అ క చ ర ఽ ౨ ౬" + #ifdef AF_CONFIG_OPTION_CJK - AF_BLUE_STRING_CJK_TOP_FILL + AF_BLUE_STRING_CJK_TOP "他们你來們到和地" "对對就席我时時會" "来為能舰說说这這" - "齊" - AF_BLUE_STRING_CJK_TOP_UNFILL + "齊 |" "军同已愿既星是景" "民照现現理用置要" "軍那配里開雷露面" "顾" - AF_BLUE_STRING_CJK_BOTTOM_FILL + AF_BLUE_STRING_CJK_BOTTOM "个为人他以们你來" "個們到和大对對就" "我时時有来為要說" - "说" - AF_BLUE_STRING_CJK_BOTTOM_UNFILL + "说 |" "主些因它想意理生" "當看着置者自著裡" "过还进進過道還里" @@ -128,22 +150,20 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT - AF_BLUE_STRING_CJK_LEFT_FILL + AF_BLUE_STRING_CJK_LEFT "些们你來們到和地" "她将將就年得情最" "样樣理能說说这這" - "通" - AF_BLUE_STRING_CJK_LEFT_UNFILL + "通 |" "即吗吧听呢品响嗎" "师師收断斷明眼間" "间际陈限除陳随際" "隨" - AF_BLUE_STRING_CJK_RIGHT_FILL + AF_BLUE_STRING_CJK_RIGHT "事前學将將情想或" "政斯新样樣民沒没" "然特现現球第經谁" - "起" - AF_BLUE_STRING_CJK_RIGHT_UNFILL + "起 |" "例別别制动動吗嗎" "增指明朝期构物确" "种調调費费那都間" @@ -154,17 +174,118 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: #endif /* AF_CONFIG_OPTION_CJK */ +// The blue zone stringsets, as used in the script styles, cf. `afstyles.h'. +// +// The AF_BLUE_PROPERTY_XXX flags are defined in `afblue.h'; here some +// explanations. +// +// A blue zone in general is defined by a reference and an overshoot line. +// During the hinting process, all coordinate values between those two lines +// are set equal to the reference value, provided that the blue zone is not +// wider than 0.75 pixels (otherwise the blue zone gets ignored). All +// entries must have `AF_BLUE_STRING_MAX' as the final line. +// +// During the glyph analysis, edges are sorted from bottom to top, and then +// sequentially checked, edge by edge, against the blue zones in the order +// given below. +// +// +// latin auto-hinter +// ----------------- +// +// Characters in a blue string are automatically classified as having a flat +// (reference) or a round (overshoot) extremum. The blue zone is then set +// up by the mean values of all flat extrema and all round extrema, +// respectively. Only horizontal blue zones (i.e., adjusting vertical +// coordinate values) are supported. +// +// For the latin auto-hinter, the overshoot should be larger than the +// reference for top zones, and vice versa for bottom zones. +// +// LATIN_TOP +// Take the maximum flat and round coordinate values of the blue string +// characters for computing the blue zone's reference and overshoot +// values. +// +// If not set, take the minimum values. +// +// LATIN_NEUTRAL +// Ignore round extrema and define the blue zone with flat values only. +// Both top and bottom of contours can match. This is useful for +// scripts like Devanagari where vowel signs attach to the base +// character and are implemented as components of composite glyphs. +// +// If not set, both round and flat extrema are taken into account. +// Additionally, only the top or the bottom of a contour can match, +// depending on the LATIN_TOP flag. +// +// Neutral blue zones should always follow non-neutral blue zones. +// +// LATIN_X_HEIGHT +// Scale all glyphs vertically from the corresponding script to make the +// reference line of this blue zone align on the grid. The scaling +// takes place before all other blue zones get aligned to the grid. +// Only one blue character string of a script style can have this flag. +// +// LATIN_LONG +// Apply an additional constraint for blue zone values: Don't +// necessarily use the extremum as-is but a segment of the topmost (or +// bottommost) contour that is longer than a heuristic threshold, and +// which is not too far away vertically from the real extremum. This +// ensures that small bumps in the outline are ignored (for example, the +// `vertical serifs' found in many Hebrew glyph designs). +// +// The segment must be at least EM/25 font units long, and the distance +// to the extremum must be smaller than EM/4. +// +// +// cjk auto-hinter +// --------------- +// +// Characters in a blue string are *not* automatically classified. Instead, +// first come the characters used for the overshoot value, then the +// character `|', then the characters used for the reference value. The +// blue zone is then set up by the mean values of all reference values and +// all overshoot values, respectively. Both horizontal and vertical blue +// zones (i.e., adjusting vertical and horizontal coordinate values, +// respectively) are supported. +// +// For the cjk auto-hinter, the overshoot should be smaller than the +// reference for top zones, and vice versa for bottom zones. +// +// CJK_TOP +// Take the maximum flat and round coordinate values of the blue string +// characters. If not set, take the minimum values. +// +// CJK_RIGHT +// A synonym for CJK_TOP. If CJK_HORIZ is set, this flag indicates the +// right blue zone, taking horizontal maximum values. +// +// CJK_HORIZ +// Define a blue zone for horizontal hinting (i.e., vertical blue +// zones). If not set, this is a blue zone for vertical hinting. + + AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: - AF_BLUE_STRINGSET_LATN - { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_LATIN_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_LATIN_SMALL, 0 } - { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_CYRL + { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_CYRILLIC_SMALL, 0 } + { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_DEVA + { AF_BLUE_STRING_DEVANAGARI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_DEVANAGARI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_DEVANAGARI_BASE, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_NEUTRAL | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_DEVANAGARI_BASE, 0 } + { AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_GREK { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } @@ -176,15 +297,6 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 } { AF_BLUE_STRING_MAX, 0 } - AF_BLUE_STRINGSET_CYRL - { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 } - { AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_CYRILLIC_SMALL, 0 } - { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 } - { AF_BLUE_STRING_MAX, 0 } - AF_BLUE_STRINGSET_HEBR { AF_BLUE_STRING_HEBREW_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_LONG } @@ -192,25 +304,32 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_HEBREW_DESCENDER, 0 } { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_LATN + { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_LATIN_SMALL, 0 } + { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_TELU + { AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_TELUGU_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRINGSET_HANI - { AF_BLUE_STRING_CJK_TOP_FILL, AF_BLUE_PROPERTY_CJK_TOP | - AF_BLUE_PROPERTY_CJK_FILL } - { AF_BLUE_STRING_CJK_TOP_UNFILL, AF_BLUE_PROPERTY_CJK_TOP } - { AF_BLUE_STRING_CJK_BOTTOM_FILL, AF_BLUE_PROPERTY_CJK_FILL } - { AF_BLUE_STRING_CJK_BOTTOM_UNFILL, 0 } + { AF_BLUE_STRING_CJK_TOP, AF_BLUE_PROPERTY_CJK_TOP } + { AF_BLUE_STRING_CJK_BOTTOM, 0 } #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT - { AF_BLUE_STRING_CJK_LEFT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ | - AF_BLUE_PROPERTY_CJK_FILL } - { AF_BLUE_STRING_CJK_LEFT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ } - { AF_BLUE_STRING_CJK_RIGHT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ | - AF_BLUE_PROPERTY_CJK_RIGHT | - AF_BLUE_PROPERTY_CJK_FILL } - { AF_BLUE_STRING_CJK_RIGHT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ | - AF_BLUE_PROPERTY_CJK_RIGHT } + { AF_BLUE_STRING_CJK_LEFT, AF_BLUE_PROPERTY_CJK_HORIZ } + { AF_BLUE_STRING_CJK_RIGHT, AF_BLUE_PROPERTY_CJK_HORIZ | + AF_BLUE_PROPERTY_CJK_RIGHT } #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ - { AF_BLUE_STRING_MAX, 0 } + { AF_BLUE_STRING_MAX, 0 } #endif /* AF_CONFIG_OPTION_CJK */ diff --git a/freetype/src/autofit/afblue.h b/freetype/src/autofit/afblue.h index 6f336abc0..a86184191 100644 --- a/freetype/src/autofit/afblue.h +++ b/freetype/src/autofit/afblue.h @@ -7,7 +7,7 @@ /* */ /* Auto-fitter data for blue strings (specification). */ /* */ -/* Copyright 2013 by */ +/* Copyright 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -67,42 +67,44 @@ FT_BEGIN_HEADER /* At the bottommost level, we define strings for finding blue zones. */ -#define AF_BLUE_STRING_MAX_LEN 25 +#define AF_BLUE_STRING_MAX_LEN 51 /* The AF_Blue_String enumeration values are offsets into the */ /* `af_blue_strings' array. */ typedef enum AF_Blue_String_ { - AF_BLUE_STRING_LATIN_CAPITAL_TOP = 0, - AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 9, - AF_BLUE_STRING_LATIN_SMALL_F_TOP = 18, - AF_BLUE_STRING_LATIN_SMALL = 26, - AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 34, - AF_BLUE_STRING_GREEK_CAPITAL_TOP = 40, - AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 55, - AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 68, - AF_BLUE_STRING_GREEK_SMALL = 81, - AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 98, - AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 115, - AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 132, - AF_BLUE_STRING_CYRILLIC_SMALL = 149, - AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 166, - AF_BLUE_STRING_HEBREW_TOP = 173, - AF_BLUE_STRING_HEBREW_BOTTOM = 190, - AF_BLUE_STRING_HEBREW_DESCENDER = 203, - af_blue_1_1 = 213, + AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 0, + AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 17, + AF_BLUE_STRING_CYRILLIC_SMALL = 34, + AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 51, + AF_BLUE_STRING_DEVANAGARI_BASE = 58, + AF_BLUE_STRING_DEVANAGARI_TOP = 83, + AF_BLUE_STRING_DEVANAGARI_HEAD = 108, + AF_BLUE_STRING_DEVANAGARI_BOTTOM = 133, + AF_BLUE_STRING_GREEK_CAPITAL_TOP = 140, + AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 155, + AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 168, + AF_BLUE_STRING_GREEK_SMALL = 181, + AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 198, + AF_BLUE_STRING_HEBREW_TOP = 215, + AF_BLUE_STRING_HEBREW_BOTTOM = 232, + AF_BLUE_STRING_HEBREW_DESCENDER = 245, + AF_BLUE_STRING_LATIN_CAPITAL_TOP = 256, + AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 265, + AF_BLUE_STRING_LATIN_SMALL_F_TOP = 274, + AF_BLUE_STRING_LATIN_SMALL = 282, + AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 290, + AF_BLUE_STRING_TELUGU_TOP = 296, + AF_BLUE_STRING_TELUGU_BOTTOM = 318, + af_blue_1_1 = 339, #ifdef AF_CONFIG_OPTION_CJK - AF_BLUE_STRING_CJK_TOP_FILL = af_blue_1_1 + 1, - AF_BLUE_STRING_CJK_TOP_UNFILL = af_blue_1_1 + 77, - AF_BLUE_STRING_CJK_BOTTOM_FILL = af_blue_1_1 + 153, - AF_BLUE_STRING_CJK_BOTTOM_UNFILL = af_blue_1_1 + 229, + AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1, + AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 153, af_blue_1_1_1 = af_blue_1_1 + 304, #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT - AF_BLUE_STRING_CJK_LEFT_FILL = af_blue_1_1_1 + 1, - AF_BLUE_STRING_CJK_LEFT_UNFILL = af_blue_1_1_1 + 77, - AF_BLUE_STRING_CJK_RIGHT_FILL = af_blue_1_1_1 + 153, - AF_BLUE_STRING_CJK_RIGHT_UNFILL = af_blue_1_1_1 + 229, + AF_BLUE_STRING_CJK_LEFT = af_blue_1_1_1 + 1, + AF_BLUE_STRING_CJK_RIGHT = af_blue_1_1_1 + 153, af_blue_1_1_2 = af_blue_1_1_1 + 304, #else af_blue_1_1_2 = af_blue_1_1_1 + 0, @@ -136,33 +138,35 @@ FT_BEGIN_HEADER /* Properties are specific to a writing system. We assume that a given */ /* blue string can't be used in more than a single writing system, which */ /* is a safe bet. */ -#define AF_BLUE_PROPERTY_LATIN_TOP ( 1 << 0 ) -#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1 << 1 ) -#define AF_BLUE_PROPERTY_LATIN_LONG ( 1 << 2 ) +#define AF_BLUE_PROPERTY_LATIN_TOP ( 1 << 0 ) /* must have value 1 */ +#define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1 << 1 ) +#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1 << 2 ) +#define AF_BLUE_PROPERTY_LATIN_LONG ( 1 << 3 ) -#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 0 ) -#define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 1 ) -#define AF_BLUE_PROPERTY_CJK_FILL ( 1 << 2 ) +#define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 0 ) /* must have value 1 */ +#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 1 ) /* must have value 2 */ #define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP -#define AF_BLUE_STRINGSET_MAX_LEN 9 +#define AF_BLUE_STRINGSET_MAX_LEN 7 /* The AF_Blue_Stringset enumeration values are offsets into the */ /* `af_blue_stringsets' array. */ typedef enum AF_Blue_Stringset_ { - AF_BLUE_STRINGSET_LATN = 0, - AF_BLUE_STRINGSET_GREK = 7, - AF_BLUE_STRINGSET_CYRL = 14, - AF_BLUE_STRINGSET_HEBR = 20, - af_blue_2_1 = 24, + AF_BLUE_STRINGSET_CYRL = 0, + AF_BLUE_STRINGSET_DEVA = 6, + AF_BLUE_STRINGSET_GREK = 12, + AF_BLUE_STRINGSET_HEBR = 19, + AF_BLUE_STRINGSET_LATN = 23, + AF_BLUE_STRINGSET_TELU = 30, + af_blue_2_1 = 33, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0, - af_blue_2_1_1 = af_blue_2_1 + 4, + af_blue_2_1_1 = af_blue_2_1 + 2, #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT - af_blue_2_1_2 = af_blue_2_1_1 + 4, + af_blue_2_1_2 = af_blue_2_1_1 + 2, #else af_blue_2_1_2 = af_blue_2_1_1 + 0, #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ diff --git a/freetype/src/autofit/afblue.hin b/freetype/src/autofit/afblue.hin index 4fc991755..0b4b48d7f 100644 --- a/freetype/src/autofit/afblue.hin +++ b/freetype/src/autofit/afblue.hin @@ -4,7 +4,7 @@ /* */ /* Auto-fitter data for blue strings (specification). */ /* */ -/* Copyright 2013 by */ +/* Copyright 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -96,13 +96,13 @@ FT_BEGIN_HEADER /* Properties are specific to a writing system. We assume that a given */ /* blue string can't be used in more than a single writing system, which */ /* is a safe bet. */ -#define AF_BLUE_PROPERTY_LATIN_TOP ( 1 << 0 ) -#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1 << 1 ) -#define AF_BLUE_PROPERTY_LATIN_LONG ( 1 << 2 ) +#define AF_BLUE_PROPERTY_LATIN_TOP ( 1 << 0 ) /* must have value 1 */ +#define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1 << 1 ) +#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1 << 2 ) +#define AF_BLUE_PROPERTY_LATIN_LONG ( 1 << 3 ) -#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 0 ) -#define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 1 ) -#define AF_BLUE_PROPERTY_CJK_FILL ( 1 << 2 ) +#define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 0 ) /* must have value 1 */ +#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 1 ) /* must have value 2 */ #define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP diff --git a/freetype/src/autofit/afcjk.c b/freetype/src/autofit/afcjk.c index 3a65fc561..048e0e7d0 100644 --- a/freetype/src/autofit/afcjk.c +++ b/freetype/src/autofit/afcjk.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for CJK writing system (body). */ /* */ -/* Copyright 2006-2013 by */ +/* Copyright 2006-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -178,6 +178,8 @@ goto Exit; af_latin_hints_link_segments( hints, + 0, + NULL, (AF_Dimension)dim ); seg = axhints->segments; @@ -261,6 +263,8 @@ FT_Int num_fills; FT_Int num_flats; + FT_Bool fill; + AF_CJKBlue blue; FT_Error error; AF_CJKAxis axis; @@ -271,22 +275,6 @@ AF_Blue_Stringset bss = sc->blue_stringset; const AF_Blue_StringRec* bs = &af_blue_stringsets[bss]; -#ifdef FT_DEBUG_LEVEL_TRACE - FT_String* cjk_blue_name[4] = - { - (FT_String*)"bottom", /* -- , -- */ - (FT_String*)"top", /* -- , TOP */ - (FT_String*)"left", /* HORIZ, -- */ - (FT_String*)"right" /* HORIZ, TOP */ - }; - - FT_String* cjk_blue_type_name[2] = - { - (FT_String*)"unfilled", /* -- */ - (FT_String*)"filled" /* FILL */ - }; -#endif - /* we walk over the blue character strings as specified in the */ /* style's entry in the `af_blue_stringset' array, computing its */ @@ -308,15 +296,29 @@ else axis = &metrics->axis[AF_DIMENSION_VERT]; - FT_TRACE5(( "blue zone %d:\n", axis->blue_count )); +#ifdef FT_DEBUG_LEVEL_TRACE + { + FT_String* cjk_blue_name[4] = + { + (FT_String*)"bottom", /* -- , -- */ + (FT_String*)"top", /* -- , TOP */ + (FT_String*)"left", /* HORIZ, -- */ + (FT_String*)"right" /* HORIZ, TOP */ + }; + + + FT_TRACE5(( "blue zone %d (%s):\n", + axis->blue_count, + cjk_blue_name[AF_CJK_IS_HORIZ_BLUE( bs ) | + AF_CJK_IS_TOP_BLUE( bs ) ] )); + } +#endif /* FT_DEBUG_LEVEL_TRACE */ num_fills = 0; num_flats = 0; - FT_TRACE5(( " cjk blue %s/%s\n", - cjk_blue_name[AF_CJK_IS_HORIZ_BLUE( bs ) | - AF_CJK_IS_TOP_BLUE( bs ) ], - cjk_blue_type_name[!!AF_CJK_IS_FILLED_BLUE( bs )] )); + fill = 1; /* start with characters that define fill values */ + FT_TRACE5(( " [overshoot values]\n" )); while ( *p ) { @@ -330,6 +332,14 @@ GET_UTF8_CHAR( ch, p ); + /* switch to characters that define flat values */ + if ( ch == '|' ) + { + fill = 0; + FT_TRACE5(( " [reference values]\n" )); + continue; + } + /* load the character in the face -- skip unknown or empty ones */ af_get_char_index( &metrics->root, ch, &glyph_index, &y_offset ); if ( glyph_index == 0 ) @@ -417,7 +427,7 @@ FT_TRACE5(( " U+%04lX: best_pos = %5ld\n", ch, best_pos )); } - if ( AF_CJK_IS_FILLED_BLUE( bs ) ) + if ( fill ) fills[num_fills++] = best_pos; else flats[num_flats++] = best_pos; @@ -429,15 +439,15 @@ * we couldn't find a single glyph to compute this blue zone, * we will simply ignore it then */ - FT_TRACE5(( " empty\n" )); + FT_TRACE5(( " empty\n" )); continue; } - /* we have computed the contents of the `fill' and `flats' tables, */ - /* now determine the reference position of the blue zone -- */ - /* we simply take the median value after a simple sort */ - af_sort_pos( num_flats, flats ); + /* we have computed the contents of the `fill' and `flats' tables, */ + /* now determine the reference and overshoot position of the blue -- */ + /* we simply take the median value after a simple sort */ af_sort_pos( num_fills, fills ); + af_sort_pos( num_flats, flats ); blue = &axis->blues[axis->blue_count]; blue_ref = &blue->ref.org; @@ -476,7 +486,7 @@ *blue_ref = *blue_shoot = ( shoot + ref ) / 2; - FT_TRACE5(( " [overshoot smaller than reference," + FT_TRACE5(( " [reference smaller than overshoot," " taking mean value]\n" )); } } @@ -755,10 +765,6 @@ /* now compare each segment to the others */ for ( seg1 = segments; seg1 < segment_limit; seg1++ ) { - /* the fake segments are for metrics hinting only */ - if ( seg1->first == seg1->last ) - continue; - if ( seg1->dir != major_dir ) continue; @@ -1018,10 +1024,11 @@ edge->first = seg; edge->last = seg; + edge->dir = seg->dir; edge->fpos = seg->pos; - edge->opos = edge->pos = FT_MulFix( seg->pos, scale ); + edge->opos = FT_MulFix( seg->pos, scale ); + edge->pos = edge->opos; seg->edge_next = seg; - edge->dir = seg->dir; } else { @@ -1230,8 +1237,10 @@ /* zone, check for left edges */ /* */ /* of course, that's for TrueType */ - is_top_right_blue = FT_BOOL( blue->flags & AF_CJK_BLUE_TOP ); - is_major_dir = FT_BOOL( edge->dir == axis->major_dir ); + is_top_right_blue = + (FT_Byte)( ( blue->flags & AF_CJK_BLUE_TOP ) != 0 ); + is_major_dir = + FT_BOOL( edge->dir == axis->major_dir ); /* if it is a top zone, the edge must be against the major */ /* direction; if it is a bottom zone, it must be in the major */ @@ -1528,6 +1537,12 @@ stem_edge->pos = base_edge->pos + fitted_width; + + FT_TRACE5(( " CJKLINK: edge %d @%d (opos=%.2f) linked to %.2f," + " dist was %.2f, now %.2f\n", + stem_edge - hints->axis[dim].edges, stem_edge->fpos, + stem_edge->opos / 64.0, stem_edge->pos / 64.0, + dist / 64.0, fitted_width / 64.0 )); } diff --git a/freetype/src/autofit/afcjk.h b/freetype/src/autofit/afcjk.h index a260b0911..4dd4f3917 100644 --- a/freetype/src/autofit/afcjk.h +++ b/freetype/src/autofit/afcjk.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for CJK writing system (specification). */ /* */ -/* Copyright 2006, 2007, 2011-2013 by */ +/* Copyright 2006, 2007, 2011-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -50,8 +50,6 @@ FT_BEGIN_HEADER ( (b)->properties & AF_BLUE_PROPERTY_CJK_TOP ) #define AF_CJK_IS_HORIZ_BLUE( b ) \ ( (b)->properties & AF_BLUE_PROPERTY_CJK_HORIZ ) -#define AF_CJK_IS_FILLED_BLUE( b ) \ - ( (b)->properties & AF_BLUE_PROPERTY_CJK_FILL ) #define AF_CJK_IS_RIGHT_BLUE AF_CJK_IS_TOP_BLUE #define AF_CJK_MAX_WIDTHS 16 diff --git a/freetype/src/autofit/afglobal.c b/freetype/src/autofit/afglobal.c index 7aa2e1102..a54c20c02 100644 --- a/freetype/src/autofit/afglobal.c +++ b/freetype/src/autofit/afglobal.c @@ -138,7 +138,7 @@ FT_Byte* gstyles = globals->glyph_styles; FT_UInt ss; FT_UInt i; - FT_UInt dflt = -1; + FT_UInt dflt = ~0U; /* a non-valid value */ /* the value AF_STYLE_UNASSIGNED means `uncovered glyph' */ @@ -176,7 +176,8 @@ */ if ( style_class->coverage == AF_COVERAGE_DEFAULT ) { - if ( style_class->script == globals->module->default_script ) + if ( (FT_UInt)style_class->script == + globals->module->default_script ) dflt = ss; for ( range = script_class->script_uni_ranges; @@ -332,8 +333,8 @@ af_face_globals_free( globals ); globals = NULL; } - - globals->increase_x_height = AF_PROP_INCREASE_X_HEIGHT_MAX; + else + globals->increase_x_height = AF_PROP_INCREASE_X_HEIGHT_MAX; Exit: *aglobals = globals; diff --git a/freetype/src/autofit/afglobal.h b/freetype/src/autofit/afglobal.h index d2da40e3c..38d8d6952 100644 --- a/freetype/src/autofit/afglobal.h +++ b/freetype/src/autofit/afglobal.h @@ -66,16 +66,16 @@ FT_BEGIN_HEADER /* index of fallback style in `af_style_classes' */ #ifdef AF_CONFIG_OPTION_CJK -#define AF_STYLE_FALLBACK AF_STYLE_HANI_DFLT +#define AF_STYLE_FALLBACK AF_STYLE_HANI_DFLT #else -#define AF_STYLE_FALLBACK AF_STYLE_NONE_DFLT +#define AF_STYLE_FALLBACK AF_STYLE_NONE_DFLT #endif /* default script for OpenType; ignored if HarfBuzz isn't used */ -#define AF_SCRIPT_DEFAULT AF_SCRIPT_LATN +#define AF_SCRIPT_DEFAULT AF_SCRIPT_LATN /* a bit mask indicating an uncovered glyph */ #define AF_STYLE_UNASSIGNED 0x7F /* if this flag is set, we have an ASCII digit */ -#define AF_DIGIT 0x80 +#define AF_DIGIT 0x80 /* `increase-x-height' property */ #define AF_PROP_INCREASE_X_HEIGHT_MIN 6 diff --git a/freetype/src/autofit/afhints.c b/freetype/src/autofit/afhints.c index 270a06bca..f3cc50f20 100644 --- a/freetype/src/autofit/afhints.c +++ b/freetype/src/autofit/afhints.c @@ -74,7 +74,8 @@ } - /* Get new edge for given axis, direction, and position. */ + /* Get new edge for given axis, direction, and position, */ + /* without initializing the edge itself. */ FT_LOCAL( FT_Error ) af_axis_hints_new_edge( AF_AxisHints axis, @@ -130,10 +131,6 @@ axis->num_edges++; - FT_ZERO( edge ); - edge->fpos = (FT_Short)fpos; - edge->dir = (FT_Char)dir; - Exit: *anedge = edge; return error; @@ -183,7 +180,7 @@ } -#define AF_INDEX_NUM( ptr, base ) ( (ptr) ? ( (ptr) - (base) ) : -1 ) +#define AF_INDEX_NUM( ptr, base ) (int)( (ptr) ? ( (ptr) - (base) ) : -1 ) #ifdef __cplusplus @@ -204,20 +201,15 @@ for ( point = points; point < limit; point++ ) AF_DUMP(( " [ %5d | %5d | %5d | %6.2f | %6.2f" - " | %5.2f | %5.2f | %c%c%c%c%c%c ]\n", - point - points, + " | %5.2f | %5.2f | %c ]\n", + AF_INDEX_NUM( point, points ), point->fx, point->fy, point->ox / 64.0, point->oy / 64.0, point->x / 64.0, point->y / 64.0, - ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ? 'w' : ' ', - ( point->flags & AF_FLAG_INFLECTION ) ? 'i' : ' ', - ( point->flags & AF_FLAG_EXTREMA_X ) ? '<' : ' ', - ( point->flags & AF_FLAG_EXTREMA_Y ) ? 'v' : ' ', - ( point->flags & AF_FLAG_ROUND_X ) ? '(' : ' ', - ( point->flags & AF_FLAG_ROUND_Y ) ? 'u' : ' ')); + ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ? 'w' : ' ')); AF_DUMP(( "\n" )); } #ifdef __cplusplus @@ -289,7 +281,7 @@ AF_DUMP(( " [ %5d | %5.2g | %5s | %4d" " | %4d | %4d | %5d | %4d" " | %6d | %5d | %11s ]\n", - seg - segments, + AF_INDEX_NUM( seg, segments ), dimension == AF_DIMENSION_HORZ ? (int)seg->first->ox / 64.0 : (int)seg->first->oy / 64.0, @@ -420,7 +412,7 @@ for ( edge = edges; edge < limit; edge++ ) AF_DUMP(( " [ %5d | %5.2g | %5s | %4d" " | %5d | %c | %5.2f | %5.2f | %11s ]\n", - edge - edges, + AF_INDEX_NUM( edge, edges ), (int)edge->opos / 64.0, af_dir_str( (AF_Direction)edge->dir ), AF_INDEX_NUM( edge->link, edges ), @@ -651,6 +643,9 @@ for ( point = points; point < point_limit; point++, vec++, tag++ ) { + point->in_dir = (FT_Char)AF_DIR_NONE; + point->out_dir = (FT_Char)AF_DIR_NONE; + point->fx = (FT_Short)vec->x; point->fy = (FT_Short)vec->y; point->ox = point->x = FT_MulFix( vec->x, x_scale ) + x_delta; @@ -698,91 +693,186 @@ } } - /* compute directions of in & out vectors */ { - AF_Point first = points; - AF_Point prev = NULL; - FT_Pos in_x = 0; - FT_Pos in_y = 0; - AF_Direction in_dir = AF_DIR_NONE; - - FT_Pos last_good_in_x = 0; - FT_Pos last_good_in_y = 0; - + /* + * Compute directions of `in' and `out' vectors. + * + * Note that distances between points that are very near to each + * other are accumulated. In other words, the auto-hinter + * prepends the small vectors between near points to the first + * non-near vector. All intermediate points are tagged as + * weak; the directions are adjusted also to be equal to the + * accumulated one. + */ + + /* value 20 in `near_limit' is heuristic */ FT_UInt units_per_em = hints->metrics->scaler.face->units_per_EM; FT_Int near_limit = 20 * units_per_em / 2048; + FT_Int near_limit2 = 2 * near_limit - 1; + AF_Point* contour; + AF_Point* contour_limit = hints->contours + hints->num_contours; - for ( point = points; point < point_limit; point++ ) + + for ( contour = hints->contours; contour < contour_limit; contour++ ) { - AF_Point next; - FT_Pos out_x, out_y; + AF_Point first = *contour; + AF_Point next, prev, curr; + + FT_Pos out_x, out_y; + FT_Bool is_first; - if ( point == first ) + + /* since the first point of a contour could be part of a */ + /* series of near points, go backwards to find the first */ + /* non-near point and adjust `first' */ + + point = first; + prev = first->prev; + + while ( prev != first ) { - prev = first->prev; + out_x = point->fx - prev->fx; + out_y = point->fy - prev->fy; + + /* + * We use Taxicab metrics to measure the vector length. + * + * Note that the accumulated distances so far could have the + * opposite direction of the distance measured here. For this + * reason we use `near_limit2' for the comparison to get a + * non-near point even in the worst case. + */ + if ( FT_ABS( out_x ) + FT_ABS( out_y ) >= near_limit2 ) + break; + + point = prev; + prev = prev->prev; + } - in_x = first->fx - prev->fx; - in_y = first->fy - prev->fy; + /* adjust first point */ + first = point; - last_good_in_x = in_x; - last_good_in_y = in_y; + /* now loop over all points of the contour to get */ + /* `in' and `out' vector directions */ - if ( FT_ABS( in_x ) + FT_ABS( in_y ) < near_limit ) - { - /* search first non-near point to get a good `in_dir' value */ + curr = first; - AF_Point point_ = prev; + /* + * We abuse the `u' and `v' fields to store index deltas to the + * next and previous non-near point, respectively. + * + * To avoid problems with not having non-near points, we point to + * `first' by default as the next non-near point. + * + */ + curr->u = (FT_Pos)( first - curr ); + first->v = -curr->u; + out_x = 0; + out_y = 0; - while ( point_ != first ) - { - AF_Point prev_ = point_->prev; + is_first = 1; - FT_Pos in_x_ = point_->fx - prev_->fx; - FT_Pos in_y_ = point_->fy - prev_->fy; + for ( point = first; + point != first || is_first; + point = point->next ) + { + AF_Direction out_dir; - if ( FT_ABS( in_x_ ) + FT_ABS( in_y_ ) >= near_limit ) - { - last_good_in_x = in_x_; - last_good_in_y = in_y_; + is_first = 0; - break; - } + next = point->next; - point_ = prev_; - } + out_x += next->fx - point->fx; + out_y += next->fy - point->fy; + + if ( FT_ABS( out_x ) + FT_ABS( out_y ) < near_limit ) + { + next->flags |= AF_FLAG_WEAK_INTERPOLATION; + continue; + } + + curr->u = (FT_Pos)( next - curr ); + next->v = -curr->u; + + out_dir = af_direction_compute( out_x, out_y ); + + /* adjust directions for all points inbetween; */ + /* the loop also updates position of `curr' */ + curr->out_dir = (FT_Char)out_dir; + for ( curr = curr->next; curr != next; curr = curr->next ) + { + curr->in_dir = (FT_Char)out_dir; + curr->out_dir = (FT_Char)out_dir; } + next->in_dir = (FT_Char)out_dir; - in_dir = af_direction_compute( in_x, in_y ); - first = prev + 1; + curr->u = (FT_Pos)( first - curr ); + first->v = -curr->u; + + out_x = 0; + out_y = 0; } + } - point->in_dir = (FT_Char)in_dir; + /* + * The next step is to `simplify' an outline's topology so that we + * can identify local extrema more reliably: A series of + * non-horizontal or non-vertical vectors pointing into the same + * quadrant are handled as a single, long vector. From a + * topological point of the view, the intermediate points are of no + * interest and thus tagged as weak. + */ - /* check whether the current point is near to the previous one */ - /* (value 20 in `near_limit' is heuristic; we use Taxicab */ - /* metrics for the test) */ + for ( point = points; point < point_limit; point++ ) + { + if ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) + continue; - if ( FT_ABS( in_x ) + FT_ABS( in_y ) < near_limit ) - point->flags |= AF_FLAG_NEAR; - else + if ( point->in_dir == AF_DIR_NONE && + point->out_dir == AF_DIR_NONE ) { - last_good_in_x = in_x; - last_good_in_y = in_y; - } + /* check whether both vectors point into the same quadrant */ + + FT_Pos in_x, in_y; + FT_Pos out_x, out_y; + + AF_Point next_u = point + point->u; + AF_Point prev_v = point + point->v; + - next = point->next; - out_x = next->fx - point->fx; - out_y = next->fy - point->fy; + in_x = point->fx - prev_v->fx; + in_y = point->fy - prev_v->fy; + + out_x = next_u->fx - point->fx; + out_y = next_u->fy - point->fy; + + if ( ( in_x ^ out_x ) >= 0 && ( in_y ^ out_y ) >= 0 ) + { + /* yes, so tag current point as weak */ + /* and update index deltas */ + + point->flags |= AF_FLAG_WEAK_INTERPOLATION; + + prev_v->u = (FT_Pos)( next_u - prev_v ); + next_u->v = -prev_v->u; + } + } + } - in_dir = af_direction_compute( out_x, out_y ); - point->out_dir = (FT_Char)in_dir; + /* + * Finally, check for remaining weak points. Everything else not + * collected in edges so far is then implicitly classified as strong + * points. + */ - /* Check for weak points. The remaining points not collected */ - /* in edges are then implicitly classified as strong points. */ + for ( point = points; point < point_limit; point++ ) + { + if ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) + continue; if ( point->flags & AF_FLAG_CONTROL ) { @@ -799,18 +889,25 @@ goto Is_Weak_Point; } - /* test whether `in' and `out' direction is approximately */ - /* the same (and use the last good `in' vector in case */ - /* the current point is near to the previous one) */ - if ( ft_corner_is_flat( - point->flags & AF_FLAG_NEAR ? last_good_in_x : in_x, - point->flags & AF_FLAG_NEAR ? last_good_in_y : in_y, - out_x, - out_y ) ) { - /* current point lies on a straight, diagonal line */ - /* (more or less) */ - goto Is_Weak_Point; + AF_Point next_u = point + point->u; + AF_Point prev_v = point + point->v; + + + if ( ft_corner_is_flat( point->fx - prev_v->fx, + point->fy - prev_v->fy, + next_u->fx - point->fx, + next_u->fy - point->fy ) ) + { + /* either the `in' or the `out' vector is much more */ + /* dominant than the other one, so tag current point */ + /* as weak and update index deltas */ + + prev_v->u = (FT_Pos)( next_u - prev_v ); + next_u->v = -prev_v->u; + + goto Is_Weak_Point; + } } } else if ( point->in_dir == -point->out_dir ) @@ -818,9 +915,6 @@ /* current point forms a spike */ goto Is_Weak_Point; } - - in_x = out_x; - in_y = out_y; } } } @@ -977,8 +1071,7 @@ /* if this point is candidate to weak interpolation, we */ /* interpolate it after all strong points have been processed */ - if ( ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) && - !( point->flags & AF_FLAG_INFLECTION ) ) + if ( ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ) continue; if ( dim == AF_DIMENSION_VERT ) diff --git a/freetype/src/autofit/afhints.h b/freetype/src/autofit/afhints.h index 5f1507f80..92101de7c 100644 --- a/freetype/src/autofit/afhints.h +++ b/freetype/src/autofit/afhints.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines (specification). */ /* */ -/* Copyright 2003-2008, 2010-2012 by */ +/* Copyright 2003-2008, 2010-2012, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -72,13 +72,9 @@ FT_BEGIN_HEADER * `af_{cjk,latin,...}_hints_compute_segments' are the functions to * find segments in an outline. * - * A segment is a series of consecutive points that are approximately - * aligned along a coordinate axis. The analysis to do so is specific - * to a writing system. - * - * A segment must have at least two points, except in the case of - * `fake' segments that are generated to hint metrics appropriately, - * and which consist of a single point. + * A segment is a series of at least two consecutive points that are + * approximately aligned along a coordinate axis. The analysis to do + * so is specific to a writing system. * * * Edges @@ -148,7 +144,7 @@ FT_BEGIN_HEADER * Serifs are detected by `af_{cjk,latin,...}_hint_edges'. * * In comparison to a stem, a serif (as handled by the auto-hinter - * module which takes care of the `latin' writing system) has + * module that takes care of the `latin' writing system) has * * best segment_1 = segment_2 && best segment_2 != segment_1 * @@ -178,19 +174,19 @@ FT_BEGIN_HEADER * * Strong Points * - * Experience has shown that points which are not part of an edge need - * to be interpolated linearly between their two closest edges, even if - * these are not part of the contour of those particular points. - * Typical candidates for this are + * Experience has shown that points not part of an edge need to be + * interpolated linearly between their two closest edges, even if these + * are not part of the contour of those particular points. Typical + * candidates for this are * * - angle points (i.e., points where the `in' and `out' direction * differ greatly) * * - inflection points (i.e., where the `in' and `out' angles are the * same, but the curvature changes sign) [currently, such points - * aren't handled in the auto-hinter] + * aren't handled specially in the auto-hinter] * - * `af_glyph_hints_align_strong_points' is the function which takes + * `af_glyph_hints_align_strong_points' is the function that takes * care of such situations; it is equivalent to the TrueType `IP' * hinting instruction. * @@ -220,26 +216,12 @@ FT_BEGIN_HEADER AF_FLAG_CUBIC = 1 << 1, AF_FLAG_CONTROL = AF_FLAG_CONIC | AF_FLAG_CUBIC, - /* point extremum flags */ - AF_FLAG_EXTREMA_X = 1 << 2, - AF_FLAG_EXTREMA_Y = 1 << 3, - - /* point roundness flags */ - AF_FLAG_ROUND_X = 1 << 4, - AF_FLAG_ROUND_Y = 1 << 5, - /* point touch flags */ - AF_FLAG_TOUCH_X = 1 << 6, - AF_FLAG_TOUCH_Y = 1 << 7, + AF_FLAG_TOUCH_X = 1 << 2, + AF_FLAG_TOUCH_Y = 1 << 3, /* candidates for weak interpolation have this flag set */ - AF_FLAG_WEAK_INTERPOLATION = 1 << 8, - - /* all inflection points in the outline have this flag set */ - AF_FLAG_INFLECTION = 1 << 9, - - /* the current point is very near to another one */ - AF_FLAG_NEAR = 1 << 10 + AF_FLAG_WEAK_INTERPOLATION = 1 << 4 } AF_Flags; @@ -247,10 +229,11 @@ FT_BEGIN_HEADER /* edge hint flags */ typedef enum AF_Edge_Flags_ { - AF_EDGE_NORMAL = 0, - AF_EDGE_ROUND = 1 << 0, - AF_EDGE_SERIF = 1 << 1, - AF_EDGE_DONE = 1 << 2 + AF_EDGE_NORMAL = 0, + AF_EDGE_ROUND = 1 << 0, + AF_EDGE_SERIF = 1 << 1, + AF_EDGE_DONE = 1 << 2, + AF_EDGE_NEUTRAL = 1 << 3 /* set if edge aligns to a neutral blue zone */ } AF_Edge_Flags; diff --git a/freetype/src/autofit/aflatin.c b/freetype/src/autofit/aflatin.c index e3a7742f4..36a36896f 100644 --- a/freetype/src/autofit/aflatin.c +++ b/freetype/src/autofit/aflatin.c @@ -171,7 +171,15 @@ if ( error ) goto Exit; + /* + * We assume that the glyphs selected for the stem width + * computation are `featureless' enough so that the linking + * algorithm works fine without adjustments of its scoring + * function. + */ af_latin_hints_link_segments( hints, + 0, + NULL, (AF_Dimension)dim ); seg = axhints->segments; @@ -298,6 +306,14 @@ have_flag = 1; } + if ( AF_LATIN_IS_NEUTRAL_BLUE( bs ) ) + { + if ( have_flag ) + FT_TRACE5(( ", " )); + FT_TRACE5(( "neutral" )); + have_flag = 1; + } + if ( AF_LATIN_IS_X_HEIGHT_BLUE( bs ) ) { if ( have_flag ) @@ -520,6 +536,13 @@ FT_Int last; FT_Bool hit; + /* we intentionally declare these two variables */ + /* outside of the loop since various compilers emit */ + /* incorrect warning messages otherwise, talking about */ + /* `possibly uninitialized variables' */ + FT_Int p_first = 0; /* make compiler happy */ + FT_Int p_last = 0; + FT_Bool left2right; @@ -552,7 +575,6 @@ { FT_Bool l2r; FT_Pos d; - FT_Int p_first, p_last; if ( !hit ) @@ -688,6 +710,13 @@ FT_CURVE_TAG( outline.tags[best_segment_last] ) != FT_CURVE_TAG_ON ); + if ( round && AF_LATIN_IS_NEUTRAL_BLUE( bs ) ) + { + /* only use flat segments for a neutral blue zone */ + FT_TRACE5(( " (round, skipped)\n" )); + continue; + } + FT_TRACE5(( " (%s)\n", round ? "round" : "flat" )); } @@ -758,6 +787,8 @@ blue->flags = 0; if ( AF_LATIN_IS_TOP_BLUE( bs ) ) blue->flags |= AF_LATIN_BLUE_TOP; + if ( AF_LATIN_IS_NEUTRAL_BLUE( bs ) ) + blue->flags |= AF_LATIN_BLUE_NEUTRAL; /* * The following flag is used later to adjust the y and x scales @@ -1262,17 +1293,19 @@ /* this is the start of a new segment! */ segment_dir = (AF_Direction)point->out_dir; - /* clear all segment fields */ error = af_axis_hints_new_segment( axis, memory, &segment ); if ( error ) goto Exit; - segment[0] = seg0; + /* clear all segment fields */ + segment[0] = seg0; + segment->dir = (FT_Char)segment_dir; min_pos = max_pos = point->u; segment->first = point; segment->last = point; - on_edge = 1; + + on_edge = 1; } point = point->next; @@ -1296,9 +1329,6 @@ FT_Pos last_v = last->v; - if ( first == last ) - continue; - if ( first_v < last_v ) { AF_Point p; @@ -1337,31 +1367,44 @@ } - /* Link segments to form stems and serifs. */ + /* Link segments to form stems and serifs. If `width_count' and */ + /* `widths' are non-zero, use them to fine-tune the scoring function. */ FT_LOCAL_DEF( void ) af_latin_hints_link_segments( AF_GlyphHints hints, + FT_UInt width_count, + AF_WidthRec* widths, AF_Dimension dim ) { AF_AxisHints axis = &hints->axis[dim]; AF_Segment segments = axis->segments; AF_Segment segment_limit = segments + axis->num_segments; - FT_Pos len_threshold, len_score; + FT_Pos len_threshold, len_score, dist_score, max_width; AF_Segment seg1, seg2; + if ( width_count ) + max_width = widths[width_count - 1].org; + else + max_width = 0; + + /* a heuristic value to set up a minimum value for overlapping */ len_threshold = AF_LATIN_CONSTANT( hints->metrics, 8 ); if ( len_threshold == 0 ) len_threshold = 1; + /* a heuristic value to weight lengths */ len_score = AF_LATIN_CONSTANT( hints->metrics, 6000 ); + /* a heuristic value to weight distances (no call to */ + /* AF_LATIN_CONSTANT needed, since we work on multiples */ + /* of the stem width) */ + dist_score = 3000; + /* now compare each segment to the others */ for ( seg1 = segments; seg1 < segment_limit; seg1++ ) { - /* the fake segments are introduced to hint the metrics -- */ - /* we must never link them to anything */ - if ( seg1->dir != axis->major_dir || seg1->first == seg1->last ) + if ( seg1->dir != axis->major_dir ) continue; /* search for stems having opposite directions, */ @@ -1375,10 +1418,9 @@ if ( seg1->dir + seg2->dir == 0 && pos2 > pos1 ) { /* compute distance between the two segments */ - FT_Pos dist = pos2 - pos1; - FT_Pos min = seg1->min_coord; - FT_Pos max = seg1->max_coord; - FT_Pos len, score; + FT_Pos min = seg1->min_coord; + FT_Pos max = seg1->max_coord; + FT_Pos len; if ( min < seg2->min_coord ) @@ -1388,15 +1430,49 @@ max = seg2->max_coord; /* compute maximum coordinate difference of the two segments */ + /* (this is, how much they overlap) */ len = max - min; if ( len >= len_threshold ) { - /* small coordinate differences cause a higher score, and */ - /* segments with a greater distance cause a higher score also */ - score = dist + len_score / len; + /* + * The score is the sum of two demerits indicating the + * `badness' of a fit, measured along the segments' main axis + * and orthogonal to it, respectively. + * + * o The less overlapping along the main axis, the worse it + * is, causing a larger demerit. + * + * o The nearer the orthogonal distance to a stem width, the + * better it is, causing a smaller demerit. For simplicity, + * however, we only increase the demerit for values that + * exceed the largest stem width. + */ + + FT_Pos dist = pos2 - pos1; + + FT_Pos dist_demerit, score; + + + if ( max_width ) + { + /* distance demerits are based on multiples of `max_width'; */ + /* we scale by 1024 for getting more precision */ + FT_Pos delta = ( dist << 10 ) / max_width - ( 1 << 10 ); + + + if ( delta > 10000 ) + dist_demerit = 32000; + else if ( delta > 0 ) + dist_demerit = delta * delta / dist_score; + else + dist_demerit = 0; + } + else + dist_demerit = dist; /* default if no widths available */ + + score = dist_demerit + len_score / len; /* and we search for the smallest score */ - /* of the sum of the two values */ if ( score < seg1->score ) { seg1->score = score; @@ -1728,6 +1804,8 @@ FT_LOCAL_DEF( FT_Error ) af_latin_hints_detect_features( AF_GlyphHints hints, + FT_UInt width_count, + AF_WidthRec* widths, AF_Dimension dim ) { FT_Error error; @@ -1736,7 +1814,7 @@ error = af_latin_hints_compute_segments( hints, dim ); if ( !error ) { - af_latin_hints_link_segments( hints, dim ); + af_latin_hints_link_segments( hints, width_count, widths, dim ); error = af_latin_hints_compute_edges( hints, dim ); } @@ -1765,8 +1843,9 @@ for ( ; edge < edge_limit; edge++ ) { FT_UInt bb; - AF_Width best_blue = NULL; - FT_Pos best_dist; /* initial threshold */ + AF_Width best_blue = NULL; + FT_Bool best_blue_is_neutral = 0; + FT_Pos best_dist; /* initial threshold */ /* compute the initial threshold as a fraction of the EM size */ @@ -1780,24 +1859,26 @@ for ( bb = 0; bb < latin->blue_count; bb++ ) { AF_LatinBlue blue = latin->blues + bb; - FT_Bool is_top_blue, is_major_dir; + FT_Bool is_top_blue, is_neutral_blue, is_major_dir; /* skip inactive blue zones (i.e., those that are too large) */ if ( !( blue->flags & AF_LATIN_BLUE_ACTIVE ) ) continue; - /* if it is a top zone, check for right edges -- if it is a bottom */ - /* zone, check for left edges */ - /* */ - /* of course, that's for TrueType */ - is_top_blue = (FT_Byte)( ( blue->flags & AF_LATIN_BLUE_TOP ) != 0 ); - is_major_dir = FT_BOOL( edge->dir == axis->major_dir ); - - /* if it is a top zone, the edge must be against the major */ - /* direction; if it is a bottom zone, it must be in the major */ - /* direction */ - if ( is_top_blue ^ is_major_dir ) + /* if it is a top zone, check for right edges (against the major */ + /* direction); if it is a bottom zone, check for left edges (in */ + /* the major direction) -- this assumes the TrueType convention */ + /* for the orientation of contours */ + is_top_blue = + (FT_Byte)( ( blue->flags & AF_LATIN_BLUE_TOP ) != 0 ); + is_neutral_blue = + (FT_Byte)( ( blue->flags & AF_LATIN_BLUE_NEUTRAL ) != 0); + is_major_dir = + FT_BOOL( edge->dir == axis->major_dir ); + + /* neutral blue zones are handled for both directions */ + if ( is_top_blue ^ is_major_dir || is_neutral_blue ) { FT_Pos dist; @@ -1810,15 +1891,19 @@ dist = FT_MulFix( dist, scale ); if ( dist < best_dist ) { - best_dist = dist; - best_blue = &blue->ref; + best_dist = dist; + best_blue = &blue->ref; + best_blue_is_neutral = is_neutral_blue; } /* now compare it to the overshoot position and check whether */ /* the edge is rounded, and whether the edge is over the */ /* reference position of a top zone, or under the reference */ - /* position of a bottom zone */ - if ( edge->flags & AF_EDGE_ROUND && dist != 0 ) + /* position of a bottom zone (provided we don't have a */ + /* neutral blue zone) */ + if ( edge->flags & AF_EDGE_ROUND && + dist != 0 && + !is_neutral_blue ) { FT_Bool is_under_ref = FT_BOOL( edge->fpos < blue->ref.org ); @@ -1832,8 +1917,9 @@ dist = FT_MulFix( dist, scale ); if ( dist < best_dist ) { - best_dist = dist; - best_blue = &blue->shoot; + best_dist = dist; + best_blue = &blue->shoot; + best_blue_is_neutral = is_neutral_blue; } } } @@ -1841,7 +1927,11 @@ } if ( best_blue ) + { edge->blue_edge = best_blue; + if ( best_blue_is_neutral ) + edge->flags |= AF_EDGE_NEUTRAL; + } } } @@ -2159,7 +2249,7 @@ FT_TRACE5(( " LINK: edge %d (opos=%.2f) linked to %.2f," " dist was %.2f, now %.2f\n", - stem_edge-hints->axis[dim].edges, stem_edge->opos / 64.0, + stem_edge - hints->axis[dim].edges, stem_edge->opos / 64.0, stem_edge->pos / 64.0, dist / 64.0, fitted_width / 64.0 )); } @@ -2226,14 +2316,41 @@ if ( edge->flags & AF_EDGE_DONE ) continue; - blue = edge->blue_edge; edge1 = NULL; edge2 = edge->link; + /* + * If a stem contains both a neutral and a non-neutral blue zone, + * skip the neutral one. Otherwise, outlines with different + * directions might be incorrectly aligned at the same vertical + * position. + * + * If we have two neutral blue zones, skip one of them. + * + */ + if ( edge->blue_edge && edge2 && edge2->blue_edge ) + { + FT_Byte neutral = edge->flags & AF_EDGE_NEUTRAL; + FT_Byte neutral2 = edge2->flags & AF_EDGE_NEUTRAL; + + + if ( ( neutral && neutral2 ) || neutral2 ) + { + edge2->blue_edge = NULL; + edge2->flags &= ~AF_EDGE_NEUTRAL; + } + else if ( neutral ) + { + edge->blue_edge = NULL; + edge->flags &= ~AF_EDGE_NEUTRAL; + } + } + + blue = edge->blue_edge; if ( blue ) edge1 = edge; - /* flip edges if the other stem is aligned to a blue zone */ + /* flip edges if the other edge is aligned to a blue zone */ else if ( edge2 && edge2->blue_edge ) { blue = edge2->blue_edge; @@ -2300,7 +2417,7 @@ /* this should not happen, but it's better to be safe */ if ( edge2->blue_edge ) { - FT_TRACE5(( " ASSERTION FAILED for edge %d\n", edge2-edges )); + FT_TRACE5(( " ASSERTION FAILED for edge %d\n", edge2 - edges )); af_latin_align_linked_edge( hints, dim, edge2, edge ); edge->flags |= AF_EDGE_DONE; @@ -2689,6 +2806,8 @@ FT_Error error; int dim; + AF_LatinAxis axis; + error = af_glyph_hints_reload( hints, outline ); if ( error ) @@ -2702,14 +2821,22 @@ if ( AF_HINTS_DO_HORIZONTAL( hints ) ) #endif { - error = af_latin_hints_detect_features( hints, AF_DIMENSION_HORZ ); + axis = &metrics->axis[AF_DIMENSION_HORZ]; + error = af_latin_hints_detect_features( hints, + axis->width_count, + axis->widths, + AF_DIMENSION_HORZ ); if ( error ) goto Exit; } if ( AF_HINTS_DO_VERTICAL( hints ) ) { - error = af_latin_hints_detect_features( hints, AF_DIMENSION_VERT ); + axis = &metrics->axis[AF_DIMENSION_VERT]; + error = af_latin_hints_detect_features( hints, + axis->width_count, + axis->widths, + AF_DIMENSION_VERT ); if ( error ) goto Exit; diff --git a/freetype/src/autofit/aflatin.h b/freetype/src/autofit/aflatin.h index a958af36a..2c0bfca18 100644 --- a/freetype/src/autofit/aflatin.h +++ b/freetype/src/autofit/aflatin.h @@ -5,7 +5,7 @@ /* Auto-fitter hinting routines for latin writing system */ /* (specification). */ /* */ -/* Copyright 2003-2007, 2009, 2011-2013 by */ +/* Copyright 2003-2007, 2009, 2011-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -53,6 +53,8 @@ FT_BEGIN_HEADER #define AF_LATIN_IS_TOP_BLUE( b ) \ ( (b)->properties & AF_BLUE_PROPERTY_LATIN_TOP ) +#define AF_LATIN_IS_NEUTRAL_BLUE( b ) \ + ( (b)->properties & AF_BLUE_PROPERTY_LATIN_NEUTRAL ) #define AF_LATIN_IS_X_HEIGHT_BLUE( b ) \ ( (b)->properties & AF_BLUE_PROPERTY_LATIN_X_HEIGHT ) #define AF_LATIN_IS_LONG_BLUE( b ) \ @@ -63,10 +65,11 @@ FT_BEGIN_HEADER enum { - AF_LATIN_BLUE_ACTIVE = 1 << 0, /* set if zone height is <= 3/4px */ - AF_LATIN_BLUE_TOP = 1 << 1, /* result of AF_LATIN_IS_TOP_BLUE */ - AF_LATIN_BLUE_ADJUSTMENT = 1 << 2, /* used for scale adjustment */ - /* optimization */ + AF_LATIN_BLUE_ACTIVE = 1 << 0, /* set if zone height is <= 3/4px */ + AF_LATIN_BLUE_TOP = 1 << 1, /* set if we have a top blue zone */ + AF_LATIN_BLUE_NEUTRAL = 1 << 2, /* set if we have neutral blue zone */ + AF_LATIN_BLUE_ADJUSTMENT = 1 << 3, /* used for scale adjustment */ + /* optimization */ AF_LATIN_BLUE_FLAG_MAX }; @@ -169,6 +172,8 @@ FT_BEGIN_HEADER FT_LOCAL( void ) af_latin_hints_link_segments( AF_GlyphHints hints, + FT_UInt width_count, + AF_WidthRec* widths, AF_Dimension dim ); FT_LOCAL( FT_Error ) @@ -177,6 +182,8 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) af_latin_hints_detect_features( AF_GlyphHints hints, + FT_UInt width_count, + AF_WidthRec* widths, AF_Dimension dim ); /* */ diff --git a/freetype/src/autofit/aflatin2.c b/freetype/src/autofit/aflatin2.c index 930fa9834..07590b380 100644 --- a/freetype/src/autofit/aflatin2.c +++ b/freetype/src/autofit/aflatin2.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for latin writing system (body). */ /* */ -/* Copyright 2003-2013 by */ +/* Copyright 2003-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -890,9 +890,6 @@ FT_Pos last_v = last->v; - if ( first == last ) - continue; - if ( first_v < last_v ) { p = first->prev; @@ -984,7 +981,7 @@ #ifdef AF_SORT_SEGMENTS for ( seg1 = segments; seg1 < segment_mid; seg1++ ) { - if ( seg1->dir != axis->major_dir || seg1->first == seg1->last ) + if ( seg1->dir != axis->major_dir ) continue; for ( seg2 = segment_mid; seg2 < segment_limit; seg2++ ) @@ -992,9 +989,7 @@ /* now compare each segment to the others */ for ( seg1 = segments; seg1 < segment_limit; seg1++ ) { - /* the fake segments are introduced to hint the metrics -- */ - /* we must never link them to anything */ - if ( seg1->dir != axis->major_dir || seg1->first == seg1->last ) + if ( seg1->dir != axis->major_dir ) continue; for ( seg2 = segments; seg2 < segment_limit; seg2++ ) @@ -1194,9 +1189,10 @@ edge->first = seg; edge->last = seg; - edge->fpos = seg->pos; edge->dir = seg->dir; - edge->opos = edge->pos = FT_MulFix( seg->pos, scale ); + edge->fpos = seg->pos; + edge->opos = FT_MulFix( seg->pos, scale ); + edge->pos = edge->opos; seg->edge_next = seg; } else diff --git a/freetype/src/autofit/afloader.c b/freetype/src/autofit/afloader.c index 0fa3c1278..fb15c87f0 100644 --- a/freetype/src/autofit/afloader.c +++ b/freetype/src/autofit/afloader.c @@ -131,8 +131,8 @@ loader->trans_delta = internal->glyph_delta; inverse = loader->trans_matrix; - FT_Matrix_Invert( &inverse ); - FT_Vector_Transform( &loader->trans_delta, &inverse ); + if ( !FT_Matrix_Invert( &inverse ) ) + FT_Vector_Transform( &loader->trans_delta, &inverse ); } switch ( slot->format ) @@ -508,7 +508,7 @@ if ( !size ) - return FT_THROW( Invalid_Argument ); + return FT_THROW( Invalid_Size_Handle ); FT_ZERO( &scaler ); diff --git a/freetype/src/autofit/afmodule.c b/freetype/src/autofit/afmodule.c index 73bf832b1..641e03ea2 100644 --- a/freetype/src/autofit/afmodule.c +++ b/freetype/src/autofit/afmodule.c @@ -55,7 +55,7 @@ if ( !face ) - return FT_THROW( Invalid_Argument ); + return FT_THROW( Invalid_Face_Handle ); globals = (AF_FaceGlobals)face->autohint.data; if ( !globals ) @@ -103,8 +103,8 @@ AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss]; - if ( style_class->script == *fallback_script && - style_class->coverage == AF_COVERAGE_DEFAULT ) + if ( (FT_UInt)style_class->script == *fallback_script && + style_class->coverage == AF_COVERAGE_DEFAULT ) { module->fallback_style = ss; break; @@ -226,7 +226,7 @@ af_get_interface( FT_Module module, const char* module_interface ) { - /* AF_SERVICES_GET derefers `library' in PIC mode */ + /* AF_SERVICES_GET dereferences `library' in PIC mode */ #ifdef FT_CONFIG_OPTION_PIC FT_Library library; diff --git a/freetype/src/autofit/afranges.c b/freetype/src/autofit/afranges.c index 3d919b5a4..b2c504d42 100644 --- a/freetype/src/autofit/afranges.c +++ b/freetype/src/autofit/afranges.c @@ -21,51 +21,69 @@ const AF_Script_UniRangeRec af_cyrl_uniranges[] = { - AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */ + AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */ AF_UNIRANGE_REC( 0x0500UL, 0x052FUL ), /* Cyrillic Supplement */ AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ), /* Cyrillic Extended-A */ AF_UNIRANGE_REC( 0xA640UL, 0xA69FUL ), /* Cyrillic Extended-B */ AF_UNIRANGE_REC( 0UL, 0UL ) }; + /* there are some characters in the Devanagari Unicode block that are */ + /* generic to Indic scripts; we omit them so that their presence doesn't */ + /* trigger Devanagari */ + + const AF_Script_UniRangeRec af_deva_uniranges[] = + { + AF_UNIRANGE_REC( 0x0900UL, 0x093BUL ), /* Devanagari */ + /* omitting U+093C nukta */ + AF_UNIRANGE_REC( 0x093DUL, 0x0950UL ), + /* omitting U+0951 udatta, U+0952 anudatta */ + AF_UNIRANGE_REC( 0x0953UL, 0x0963UL ), + /* omitting U+0964 danda, U+0965 double danda */ + AF_UNIRANGE_REC( 0x0966UL, 0x097FUL ), + AF_UNIRANGE_REC( 0x20B9UL, 0x20B9UL ), /* (new) Rupee sign */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + const AF_Script_UniRangeRec af_grek_uniranges[] = { AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */ - AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */ + AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */ AF_UNIRANGE_REC( 0UL, 0UL ) }; const AF_Script_UniRangeRec af_hebr_uniranges[] = { - AF_UNIRANGE_REC( 0x0590UL, 0x05FFUL ), /* Hebrew */ + AF_UNIRANGE_REC( 0x0590UL, 0x05FFUL ), /* Hebrew */ AF_UNIRANGE_REC( 0xFB1DUL, 0xFB4FUL ), /* Alphab. Present. Forms (Hebrew) */ AF_UNIRANGE_REC( 0UL, 0UL ) }; const AF_Script_UniRangeRec af_latn_uniranges[] = { - AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ), /* Basic Latin (no control chars) */ - AF_UNIRANGE_REC( 0x00A0UL, 0x00FFUL ), /* Latin-1 Supplement (no control chars) */ - AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ), /* Latin Extended-A */ - AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ), /* Latin Extended-B */ - AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */ - AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ), /* Spacing Modifier Letters */ - AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */ - AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ), /* Phonetic Extensions */ - AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ), /* Phonetic Extensions Supplement */ + AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ), /* Basic Latin (no control chars) */ + AF_UNIRANGE_REC( 0x00A0UL, 0x00FFUL ), /* Latin-1 Supplement (no control chars) */ + AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ), /* Latin Extended-A */ + AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ), /* Latin Extended-B */ + AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */ + AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ), /* Spacing Modifier Letters */ + AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */ + AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ), /* Phonetic Extensions */ + AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ), /* Phonetic Extensions Supplement */ AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), /* Combining Diacritical Marks Supplement */ - AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */ - AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */ - AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ), /* Superscripts and Subscripts */ - AF_UNIRANGE_REC( 0x20A0UL, 0x20CFUL ), /* Currency Symbols */ - AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */ - AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ), /* Enclosed Alphanumerics */ - AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ), /* Latin Extended-C */ - AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */ - AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ), /* Latin Extended-D */ - AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */ - AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */ - AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ), /* Enclosed Alphanumeric Supplement */ + AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */ + AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */ + AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ), /* Superscripts and Subscripts */ + AF_UNIRANGE_REC( 0x20A0UL, 0x20B8UL ), /* Currency Symbols ... */ + AF_UNIRANGE_REC( 0x20BAUL, 0x20CFUL ), /* ... except new Rupee sign */ + AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */ + AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ), /* Enclosed Alphanumerics */ + AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ), /* Latin Extended-C */ + AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */ + AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ), /* Latin Extended-D */ + AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */ + AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */ + AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ), /* Enclosed Alphanumeric Supplement */ AF_UNIRANGE_REC( 0UL, 0UL ) }; @@ -74,17 +92,17 @@ AF_UNIRANGE_REC( 0UL, 0UL ) }; -#ifdef AF_CONFIG_OPTION_INDIC - - const AF_Script_UniRangeRec af_beng_uniranges[] = + const AF_Script_UniRangeRec af_telu_uniranges[] = { - AF_UNIRANGE_REC( 0x0980UL, 0x09FFUL ), /* Bengali */ + AF_UNIRANGE_REC( 0x0C00UL, 0x0C7FUL ), /* Telugu */ AF_UNIRANGE_REC( 0UL, 0UL ) }; - const AF_Script_UniRangeRec af_deva_uniranges[] = +#ifdef AF_CONFIG_OPTION_INDIC + + const AF_Script_UniRangeRec af_beng_uniranges[] = { - AF_UNIRANGE_REC( 0x0900UL, 0x097FUL ), /* Devanagari */ + AF_UNIRANGE_REC( 0x0980UL, 0x09FFUL ), /* Bengali */ AF_UNIRANGE_REC( 0UL, 0UL ) }; @@ -148,12 +166,6 @@ AF_UNIRANGE_REC( 0UL, 0UL ) }; - const AF_Script_UniRangeRec af_telu_uniranges[] = - { - AF_UNIRANGE_REC( 0x0C00UL, 0x0C7FUL ), /* Telugu */ - AF_UNIRANGE_REC( 0UL, 0UL ) - }; - const AF_Script_UniRangeRec af_tibt_uniranges[] = { AF_UNIRANGE_REC( 0x0F00UL, 0x0FFFUL ), /* Tibetan */ diff --git a/freetype/src/autofit/afscript.h b/freetype/src/autofit/afscript.h index ae209322e..efe8754df 100644 --- a/freetype/src/autofit/afscript.h +++ b/freetype/src/autofit/afscript.h @@ -31,6 +31,11 @@ HB_SCRIPT_CYRILLIC, 0x43E, 0x41E, 0x0 ) /* оО */ + SCRIPT( deva, DEVA, + "Devanagari", + HB_SCRIPT_DEVANAGARI, + 0x920, 0x935, 0x91F ) /* ठ व ट */ + SCRIPT( grek, GREK, "Greek", HB_SCRIPT_GREEK, @@ -51,6 +56,12 @@ HB_SCRIPT_INVALID, 0x0, 0x0, 0x0 ) + /* there are no simple forms for letters; we thus use two digit shapes */ + SCRIPT( telu, TELU, + "Telugu", + HB_SCRIPT_TELUGU, + 0xC66, 0xC67, 0x0 ) /* ౦ ౧ */ + #ifdef AF_CONFIG_OPTION_INDIC SCRIPT( beng, BENG, @@ -58,11 +69,6 @@ HB_SCRIPT_BENGALI, 'o', 0x0, 0x0 ) /* XXX */ - SCRIPT( deva, DEVA, - "Devanagari", - HB_SCRIPT_DEVANAGARI, - 'o', 0x0, 0x0 ) /* XXX */ - SCRIPT( gujr, GUJR, "Gujarati", HB_SCRIPT_GUJARATI, @@ -113,11 +119,6 @@ HB_SCRIPT_TAMIL, 'o', 0x0, 0x0 ) /* XXX */ - SCRIPT( telu, TELU, - "Telugu", - HB_SCRIPT_TELUGU, - 'o', 0x0, 0x0 ) /* XXX */ - SCRIPT( tibt, TIBT, "Tibetan", HB_SCRIPT_TIBETAN, diff --git a/freetype/src/autofit/afstyles.h b/freetype/src/autofit/afstyles.h index 429da7664..f14d354cc 100644 --- a/freetype/src/autofit/afstyles.h +++ b/freetype/src/autofit/afstyles.h @@ -81,7 +81,9 @@ DEFAULT ) META_STYLE_LATIN( cyrl, CYRL, "Cyrillic" ) + META_STYLE_LATIN( grek, GREK, "Greek" ) + STYLE( hebr_dflt, HEBR_DFLT, "Hebrew default style", AF_WRITING_SYSTEM_LATIN, @@ -90,6 +92,13 @@ AF_COVERAGE_DEFAULT ) META_STYLE_LATIN( latn, LATN, "Latin" ) + STYLE( deva_dflt, DEVA_DFLT, + "Devanagari default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_DEVA, + AF_BLUE_STRINGSET_DEVA, + AF_COVERAGE_DEFAULT ) + #ifdef FT_OPTION_AUTOFIT2 STYLE( ltn2_dflt, LTN2_DFLT, "Latin 2 default style", @@ -106,6 +115,13 @@ (AF_Blue_Stringset)0, AF_COVERAGE_DEFAULT ) + STYLE( telu_dflt, TELU_DFLT, + "Telugu default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_TELU, + AF_BLUE_STRINGSET_TELU, + AF_COVERAGE_DEFAULT ) + #ifdef AF_CONFIG_OPTION_INDIC /* no blue stringset support for the Indic writing system yet */ @@ -119,7 +135,6 @@ AF_COVERAGE_DEFAULT ) STYLE_DEFAULT_INDIC( beng, BENG, "Bengali" ) - STYLE_DEFAULT_INDIC( deva, DEVA, "Devanagari" ) STYLE_DEFAULT_INDIC( gujr, GUJR, "Gujarati" ) STYLE_DEFAULT_INDIC( guru, GURU, "Gurmukhi" ) STYLE_DEFAULT_INDIC( knda, KNDA, "Kannada" ) @@ -130,7 +145,6 @@ STYLE_DEFAULT_INDIC( sund, SUND, "Sundanese" ) STYLE_DEFAULT_INDIC( sylo, SYLO, "Syloti Nagri" ) STYLE_DEFAULT_INDIC( taml, TAML, "Tamil" ) - STYLE_DEFAULT_INDIC( telu, TELU, "Telugu" ) STYLE_DEFAULT_INDIC( tibt, TIBT, "Tibetan" ) #endif /* AF_CONFIG_OPTION_INDIC */ diff --git a/freetype/src/autofit/hbshim.c b/freetype/src/autofit/hbshim.c index 11fb743e8..a705cef00 100644 --- a/freetype/src/autofit/hbshim.c +++ b/freetype/src/autofit/hbshim.c @@ -247,6 +247,7 @@ * (this is, not a single character is covered), we skip this coverage. * */ + if ( style_class->coverage != AF_COVERAGE_DEFAULT ) { AF_Blue_Stringset bss = style_class->blue_stringset; const AF_Blue_StringRec* bs = &af_blue_stringsets[bss]; @@ -328,8 +329,15 @@ * out whether a glyph gets shifted vertically, but this is something I * would like to avoid if not really necessary. * + * Note that we don't follow this logic for the default coverage. + * Complex scripts like Devanagari have mandatory GPOS features to + * position many glyph elements, using mark-to-base or mark-to-ligature + * tables; the number of glyphs missed due to condition (b) would be far + * too large. + * */ - hb_set_subtract( gsub_glyphs, gpos_glyphs ); + if ( style_class->coverage != AF_COVERAGE_DEFAULT ) + hb_set_subtract( gsub_glyphs, gpos_glyphs ); #ifdef FT_DEBUG_LEVEL_TRACE FT_TRACE4(( " glyphs without GPOS data (`*' means already assigned)" )); @@ -347,6 +355,12 @@ count++; #endif + /* glyph indices returned by `hb_ot_layout_lookup_collect_glyphs' */ + /* can be arbitrary: some fonts use fake indices for processing */ + /* internal to GSUB or GPOS, which is fully valid */ + if ( idx >= (hb_codepoint_t)globals->glyph_count ) + continue; + if ( gstyles[idx] == AF_STYLE_UNASSIGNED ) gstyles[idx] = (FT_Byte)style_class->style; #ifdef FT_DEBUG_LEVEL_TRACE diff --git a/freetype/src/base/ftadvanc.c b/freetype/src/base/ftadvanc.c index 52078478d..18884efe1 100644 --- a/freetype/src/base/ftadvanc.c +++ b/freetype/src/base/ftadvanc.c @@ -4,7 +4,7 @@ /* */ /* Quick computation of advance widths (body). */ /* */ -/* Copyright 2008, 2009, 2011, 2013 by */ +/* Copyright 2008, 2009, 2011, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -80,6 +80,9 @@ if ( !face ) return FT_THROW( Invalid_Face_Handle ); + if ( !padvance ) + return FT_THROW( Invalid_Argument ); + if ( gindex >= (FT_UInt)face->num_glyphs ) return FT_THROW( Invalid_Glyph_Index ); @@ -118,6 +121,9 @@ if ( !face ) return FT_THROW( Invalid_Face_Handle ); + if ( !padvances ) + return FT_THROW( Invalid_Argument ); + num = (FT_UInt)face->num_glyphs; end = start + count; if ( start >= num || end < start || end > num ) diff --git a/freetype/src/base/ftbbox.c b/freetype/src/base/ftbbox.c index 8d3f383b4..f9a17517e 100644 --- a/freetype/src/base/ftbbox.c +++ b/freetype/src/base/ftbbox.c @@ -4,7 +4,7 @@ /* */ /* FreeType bbox computation (body). */ /* */ -/* Copyright 1996-2002, 2004, 2006, 2010, 2013 by */ +/* Copyright 1996-2002, 2004, 2006, 2010, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -42,16 +42,35 @@ } TBBox_Rec; +#define FT_UPDATE_BBOX( p, bbox ) \ + FT_BEGIN_STMNT \ + if ( p->x < bbox.xMin ) \ + bbox.xMin = p->x; \ + if ( p->x > bbox.xMax ) \ + bbox.xMax = p->x; \ + if ( p->y < bbox.yMin ) \ + bbox.yMin = p->y; \ + if ( p->y > bbox.yMax ) \ + bbox.yMax = p->y; \ + FT_END_STMNT + +#define CHECK_X( p, bbox ) \ + ( p->x < bbox.xMin || p->x > bbox.xMax ) + +#define CHECK_Y( p, bbox ) \ + ( p->y < bbox.yMin || p->y > bbox.yMax ) + + /*************************************************************************/ /* */ /* */ /* BBox_Move_To */ /* */ /* */ - /* This function is used as a `move_to' and `line_to' emitter during */ + /* This function is used as a `move_to' emitter during */ /* FT_Outline_Decompose(). It simply records the destination point */ - /* in `user->last'; no further computations are necessary since we */ - /* use the cbox as the starting bbox which must be refined. */ + /* in `user->last'. We also update bbox in case contour starts with */ + /* an implicit `on' point. */ /* */ /* */ /* to :: A pointer to the destination vector. */ @@ -66,17 +85,42 @@ BBox_Move_To( FT_Vector* to, TBBox_Rec* user ) { + FT_UPDATE_BBOX( to, user->bbox ); + user->last = *to; return 0; } -#define CHECK_X( p, bbox ) \ - ( p->x < bbox.xMin || p->x > bbox.xMax ) + /*************************************************************************/ + /* */ + /* */ + /* BBox_Line_To */ + /* */ + /* */ + /* This function is used as a `line_to' emitter during */ + /* FT_Outline_Decompose(). It simply records the destination point */ + /* in `user->last'; no further computations are necessary because */ + /* bbox already contains both explicit ends of the line segment. */ + /* */ + /* */ + /* to :: A pointer to the destination vector. */ + /* */ + /* */ + /* user :: A pointer to the current walk context. */ + /* */ + /* */ + /* Always 0. Needed for the interface only. */ + /* */ + static int + BBox_Line_To( FT_Vector* to, + TBBox_Rec* user ) + { + user->last = *to; -#define CHECK_Y( p, bbox ) \ - ( p->y < bbox.yMin || p->y > bbox.yMax ) + return 0; + } /*************************************************************************/ @@ -155,8 +199,8 @@ FT_Vector* to, TBBox_Rec* user ) { - /* we don't need to check `to' since it is always an `on' point, thus */ - /* within the bbox */ + /* in case `to' is implicit and not included in bbox yet */ + FT_UPDATE_BBOX( to, user->bbox ); if ( CHECK_X( control, user->bbox ) ) BBox_Conic_Check( user->last.x, @@ -203,15 +247,48 @@ /* max :: The address of the current maximum. */ /* */ static FT_Pos - update_cubic_max( FT_Pos q1, - FT_Pos q2, - FT_Pos q3, - FT_Pos q4, - FT_Pos max ) + cubic_peak( FT_Pos q1, + FT_Pos q2, + FT_Pos q3, + FT_Pos q4 ) { - /* for a cubic segment to possibly reach new maximum, at least */ - /* one of its off-points must stay above the current value */ - while ( q2 > max || q3 > max ) + FT_Pos peak = 0; + FT_Int shift; + + /* This function finds a peak of a cubic segment if it is above 0 */ + /* using iterative bisection of the segment, or returns 0. */ + /* The fixed-point arithmetic of bisection is inherently stable */ + /* but may loose accuracy in the two lowest bits. To compensate, */ + /* we upscale the segment if there is room. Large values may need */ + /* to be downscaled to avoid overflows during bisection. */ + /* It is called with either q2 or q3 positive, which is necessary */ + /* for the peak to exist and avoids undefined FT_MSB. */ + + shift = 27 - + FT_MSB( FT_ABS( q1 ) | FT_ABS( q2 ) | FT_ABS( q3 ) | FT_ABS( q4 ) ); + + if ( shift > 0 ) + { + /* upscaling too much just wastes time */ + if ( shift > 2 ) + shift = 2; + + q1 <<= shift; + q2 <<= shift; + q3 <<= shift; + q4 <<= shift; + } + else + { + q1 >>= -shift; + q2 >>= -shift; + q3 >>= -shift; + q4 >>= -shift; + } + + /* for a peak to exist above 0, the cubic segment must have */ + /* at least one of its control off-points above 0. */ + while ( q2 > 0 || q3 > 0 ) { /* determine which half contains the maximum and split */ if ( q1 + q2 > q3 + q4 ) /* first half */ @@ -240,17 +317,22 @@ /* check whether either end reached the maximum */ if ( q1 == q2 && q1 >= q3 ) { - max = q1; + peak = q1; break; } if ( q3 == q4 && q2 <= q4 ) { - max = q4; + peak = q4; break; } } - return max; + if ( shift > 0 ) + peak >>= shift; + else + peak <<= -shift; + + return peak; } @@ -262,65 +344,17 @@ FT_Pos* min, FT_Pos* max ) { - FT_Pos nmin, nmax; - FT_Int shift; - - /* This function is only called when a control off-point is outside */ - /* the bbox that contains all on-points. It finds a local extremum */ - /* within the segment using iterative bisection of the segment. */ - /* The fixed-point arithmetic of bisection is inherently stable */ - /* but may loose accuracy in the two lowest bits. To compensate, */ - /* we upscale the segment if there is room. Large values may need */ - /* to be downscaled to avoid overflows during bisection. */ - /* The control off-point outside the bbox is likely to have the top */ - /* absolute value among arguments. */ - - shift = 27 - FT_MSB( FT_ABS( p2 ) | FT_ABS( p3 ) ); - - if ( shift > 0 ) - { - /* upscaling too much just wastes time */ - if ( shift > 2 ) - shift = 2; - - p1 <<= shift; - p2 <<= shift; - p3 <<= shift; - p4 <<= shift; - nmin = *min << shift; - nmax = *max << shift; - } - else - { - p1 >>= -shift; - p2 >>= -shift; - p3 >>= -shift; - p4 >>= -shift; - nmin = *min >> -shift; - nmax = *max >> -shift; - } + /* the bbox that contains all on-points. So at least one of the */ + /* conditions below holds and cubic_peak is called with at least one */ + /* non-zero argument. */ - nmax = update_cubic_max( p1, p2, p3, p4, nmax ); + if ( p2 > *max || p3 > *max ) + *max += cubic_peak( p1 - *max, p2 - *max, p3 - *max, p4 - *max ); /* now flip the signs to update the minimum */ - nmin = -update_cubic_max( -p1, -p2, -p3, -p4, -nmin ); - - if ( shift > 0 ) - { - nmin >>= shift; - nmax >>= shift; - } - else - { - nmin <<= -shift; - nmax <<= -shift; - } - - if ( nmin < *min ) - *min = nmin; - if ( nmax > *max ) - *max = nmax; + if ( p2 < *min || p3 < *min ) + *min -= cubic_peak( *min - p1, *min - p2, *min - p3, *min - p4 ); } @@ -385,22 +419,26 @@ return 0; } -FT_DEFINE_OUTLINE_FUNCS(bbox_interface, + + FT_DEFINE_OUTLINE_FUNCS(bbox_interface, (FT_Outline_MoveTo_Func) BBox_Move_To, - (FT_Outline_LineTo_Func) BBox_Move_To, + (FT_Outline_LineTo_Func) BBox_Line_To, (FT_Outline_ConicTo_Func)BBox_Conic_To, (FT_Outline_CubicTo_Func)BBox_Cubic_To, 0, 0 ) + /* documentation is in ftbbox.h */ FT_EXPORT_DEF( FT_Error ) FT_Outline_Get_BBox( FT_Outline* outline, FT_BBox *abbox ) { - FT_BBox cbox; - FT_BBox bbox; + FT_BBox cbox = { 0x7FFFFFFFL, 0x7FFFFFFFL, + -0x7FFFFFFFL, -0x7FFFFFFFL }; + FT_BBox bbox = { 0x7FFFFFFFL, 0x7FFFFFFFL, + -0x7FFFFFFFL, -0x7FFFFFFFL }; FT_Vector* vec; FT_UShort n; @@ -424,32 +462,13 @@ FT_DEFINE_OUTLINE_FUNCS(bbox_interface, /* coincide, we exit immediately. */ vec = outline->points; - bbox.xMin = bbox.xMax = cbox.xMin = cbox.xMax = vec->x; - bbox.yMin = bbox.yMax = cbox.yMin = cbox.yMax = vec->y; - vec++; - for ( n = 1; n < outline->n_points; n++ ) + for ( n = 0; n < outline->n_points; n++ ) { - FT_Pos x = vec->x; - FT_Pos y = vec->y; - - - /* update control box */ - if ( x < cbox.xMin ) cbox.xMin = x; - if ( x > cbox.xMax ) cbox.xMax = x; - - if ( y < cbox.yMin ) cbox.yMin = y; - if ( y > cbox.yMax ) cbox.yMax = y; + FT_UPDATE_BBOX( vec, cbox); if ( FT_CURVE_TAG( outline->tags[n] ) == FT_CURVE_TAG_ON ) - { - /* update bbox for `on' points only */ - if ( x < bbox.xMin ) bbox.xMin = x; - if ( x > bbox.xMax ) bbox.xMax = x; - - if ( y < bbox.yMin ) bbox.yMin = y; - if ( y > bbox.yMax ) bbox.yMax = y; - } + FT_UPDATE_BBOX( vec, bbox); vec++; } diff --git a/freetype/src/base/ftbdf.c b/freetype/src/base/ftbdf.c index 5755f8558..d9dcbad5e 100644 --- a/freetype/src/base/ftbdf.c +++ b/freetype/src/base/ftbdf.c @@ -4,7 +4,7 @@ /* */ /* FreeType API for accessing BDF-specific strings (body). */ /* */ -/* Copyright 2002-2004, 2013 by */ +/* Copyright 2002-2004, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -17,6 +17,8 @@ #include +#include FT_INTERNAL_DEBUG_H + #include FT_INTERNAL_OBJECTS_H #include FT_SERVICE_BDF_H @@ -32,19 +34,18 @@ const char* encoding = NULL; const char* registry = NULL; + FT_Service_BDF service; - error = FT_ERR( Invalid_Argument ); - - if ( face ) - { - FT_Service_BDF service; + if ( !face ) + return FT_THROW( Invalid_Face_Handle ); - FT_FACE_FIND_SERVICE( face, service, BDF ); + FT_FACE_FIND_SERVICE( face, service, BDF ); - if ( service && service->get_charset_id ) - error = service->get_charset_id( face, &encoding, ®istry ); - } + if ( service && service->get_charset_id ) + error = service->get_charset_id( face, &encoding, ®istry ); + else + error = FT_THROW( Invalid_Argument ); if ( acharset_encoding ) *acharset_encoding = encoding; @@ -65,23 +66,25 @@ { FT_Error error; + FT_Service_BDF service; - error = FT_ERR( Invalid_Argument ); - aproperty->type = BDF_PROPERTY_TYPE_NONE; + if ( !face ) + return FT_THROW( Invalid_Face_Handle ); - if ( face ) - { - FT_Service_BDF service; + if ( !aproperty ) + return FT_THROW( Invalid_Argument ); + aproperty->type = BDF_PROPERTY_TYPE_NONE; - FT_FACE_FIND_SERVICE( face, service, BDF ); + FT_FACE_FIND_SERVICE( face, service, BDF ); - if ( service && service->get_property ) - error = service->get_property( face, prop_name, aproperty ); - } + if ( service && service->get_property ) + error = service->get_property( face, prop_name, aproperty ); + else + error = FT_THROW( Invalid_Argument ); - return error; + return error; } diff --git a/freetype/src/base/ftbitmap.c b/freetype/src/base/ftbitmap.c index 5606745be..19a1a8079 100644 --- a/freetype/src/base/ftbitmap.c +++ b/freetype/src/base/ftbitmap.c @@ -33,7 +33,8 @@ FT_EXPORT_DEF( void ) FT_Bitmap_New( FT_Bitmap *abitmap ) { - *abitmap = null_bitmap; + if ( abitmap ) + *abitmap = null_bitmap; } @@ -44,25 +45,42 @@ const FT_Bitmap *source, FT_Bitmap *target) { - FT_Memory memory = library->memory; + FT_Memory memory; FT_Error error = FT_Err_Ok; - FT_Int pitch = source->pitch; - FT_ULong size; + FT_Int pitch; + FT_ULong size; + + FT_Int source_pitch_sign, target_pitch_sign; + + + if ( !library ) + return FT_THROW( Invalid_Library_Handle ); + + if ( !source || !target ) + return FT_THROW( Invalid_Argument ); if ( source == target ) return FT_Err_Ok; + source_pitch_sign = source->pitch < 0 ? -1 : 1; + target_pitch_sign = target->pitch < 0 ? -1 : 1; + if ( source->buffer == NULL ) { *target = *source; + if ( source_pitch_sign != target_pitch_sign ) + target->pitch = -target->pitch; return FT_Err_Ok; } + memory = library->memory; + pitch = source->pitch; + if ( pitch < 0 ) pitch = -pitch; - size = (FT_ULong)( pitch * source->rows ); + size = (FT_ULong)pitch * source->rows; if ( target->buffer ) { @@ -70,9 +88,9 @@ FT_ULong target_size; - if ( target_pitch < 0 ) + if ( target_pitch < 0 ) target_pitch = -target_pitch; - target_size = (FT_ULong)( target_pitch * target->rows ); + target_size = (FT_ULong)target_pitch * target->rows; if ( target_size != size ) (void)FT_QREALLOC( target->buffer, target_size, size ); @@ -89,13 +107,35 @@ *target = *source; target->buffer = p; - FT_MEM_COPY( target->buffer, source->buffer, size ); + if ( source_pitch_sign == target_pitch_sign ) + FT_MEM_COPY( target->buffer, source->buffer, size ); + else + { + /* take care of bitmap flow */ + FT_UInt i; + FT_Byte* s = source->buffer; + FT_Byte* t = target->buffer; + + + t += pitch * ( target->rows - 1 ); + + for ( i = target->rows; i > 0; i-- ) + { + FT_ARRAY_COPY( t, s, pitch ); + + s += pitch; + t -= pitch; + } + } } return error; } + /* Enlarge `bitmap' horizontally and vertically by `xpixels' */ + /* and `ypixels', respectively. */ + static FT_Error ft_bitmap_assure_buffer( FT_Memory memory, FT_Bitmap* bitmap, @@ -106,7 +146,7 @@ int pitch; int new_pitch; FT_UInt bpp; - FT_Int i, width, height; + FT_UInt i, width, height; unsigned char* buffer = NULL; @@ -144,17 +184,17 @@ if ( ypixels == 0 && new_pitch <= pitch ) { /* zero the padding */ - FT_Int bit_width = pitch * 8; - FT_Int bit_last = ( width + xpixels ) * bpp; + FT_UInt bit_width = pitch * 8; + FT_UInt bit_last = ( width + xpixels ) * bpp; if ( bit_last < bit_width ) { FT_Byte* line = bitmap->buffer + ( bit_last >> 3 ); FT_Byte* end = bitmap->buffer + pitch; - FT_Int shift = bit_last & 7; + FT_UInt shift = bit_last & 7; FT_UInt mask = 0xFF00U >> shift; - FT_Int count = height; + FT_UInt count = height; for ( ; count > 0; count--, line += pitch, end += pitch ) @@ -168,19 +208,22 @@ write++; } if ( write < end ) - FT_MEM_ZERO( write, end-write ); + FT_MEM_ZERO( write, end - write ); } } return FT_Err_Ok; } + /* otherwise allocate new buffer */ if ( FT_QALLOC_MULT( buffer, new_pitch, bitmap->rows + ypixels ) ) return error; + /* new rows get added at the top of the bitmap, */ + /* thus take care of the flow direction */ if ( bitmap->pitch > 0 ) { - FT_Int len = ( width * bpp + 7 ) >> 3; + FT_UInt len = ( width * bpp + 7 ) >> 3; for ( i = 0; i < bitmap->rows; i++ ) @@ -189,7 +232,7 @@ } else { - FT_Int len = ( width * bpp + 7 ) >> 3; + FT_UInt len = ( width * bpp + 7 ) >> 3; for ( i = 0; i < bitmap->rows; i++ ) @@ -220,7 +263,8 @@ { FT_Error error; unsigned char* p; - FT_Int i, x, y, pitch; + FT_Int i, x, pitch; + FT_UInt y; FT_Int xstr, ystr; @@ -248,17 +292,11 @@ case FT_PIXEL_MODE_GRAY4: { FT_Bitmap tmp; - FT_Int align; - - if ( bitmap->pixel_mode == FT_PIXEL_MODE_GRAY2 ) - align = ( bitmap->width + xstr + 3 ) / 4; - else - align = ( bitmap->width + xstr + 1 ) / 2; + /* convert to 8bpp */ FT_Bitmap_New( &tmp ); - - error = FT_Bitmap_Convert( library, bitmap, &tmp, align ); + error = FT_Bitmap_Convert( library, bitmap, &tmp, 1 ); if ( error ) return error; @@ -289,6 +327,7 @@ if ( error ) return error; + /* take care of bitmap flow */ pitch = bitmap->pitch; if ( pitch > 0 ) p = bitmap->buffer + pitch * ystr; @@ -309,7 +348,7 @@ */ for ( x = pitch - 1; x >= 0; x-- ) { - unsigned char tmp; + unsigned char tmp; tmp = p[x]; @@ -324,7 +363,7 @@ p[x] |= p[x - 1] << ( 8 - i ); #if 0 - if ( p[x] == 0xff ) + if ( p[x] == 0xFF ) break; #endif } @@ -334,12 +373,12 @@ { if ( p[x] + p[x - i] > bitmap->num_grays - 1 ) { - p[x] = (unsigned char)(bitmap->num_grays - 1); + p[x] = (unsigned char)( bitmap->num_grays - 1 ); break; } else { - p[x] = (unsigned char)(p[x] + p[x-i]); + p[x] = (unsigned char)( p[x] + p[x - i] ); if ( p[x] == bitmap->num_grays - 1 ) break; } @@ -378,14 +417,11 @@ static FT_Byte ft_gray_for_premultiplied_srgb_bgra( const FT_Byte* bgra ) { - FT_Long a = bgra[3]; - FT_Long b = bgra[0]; - FT_Long g = bgra[1]; - FT_Long r = bgra[2]; - FT_Long l; + FT_UInt a = bgra[3]; + FT_UInt l; - /* Short-circuit transparent color to avoid div-by-zero. */ + /* Short-circuit transparent color to avoid division by zero. */ if ( !a ) return 0; @@ -395,40 +431,32 @@ * A gamma of 2.2 is fair to assume. And then, we need to * undo the premultiplication too. * - * http://accessibility.kde.org/hsl-adjusted.php + * http://accessibility.kde.org/hsl-adjusted.php + * + * We do the computation with integers only, applying a gamma of 2.0. + * We guarantee 32-bit arithmetic to avoid overflow but the resulting + * luminosity fits into 16 bits. * - * We do the computation with integers only. */ - /* Undo premultification, get the number in a 16.16 form. */ - b = FT_MulDiv( b, 65536, a ); - g = FT_MulDiv( g, 65536, a ); - r = FT_MulDiv( r, 65536, a ); - a = a * 256; - - /* Apply gamma of 2.0 instead of 2.2. */ - b = FT_MulFix( b, b ); - g = FT_MulFix( g, g ); - r = FT_MulFix( r, r ); - - /* Apply coefficients. */ - b = FT_MulFix( b, 4731 /* 0.0722 * 65536 */ ); - g = FT_MulFix( g, 46871 /* 0.7152 * 65536 */ ); - r = FT_MulFix( r, 13933 /* 0.2126 * 65536 */ ); - - l = r + g + b; + l = ( 4732UL /* 0.0722 * 65536 */ * bgra[0] * bgra[0] + + 46871UL /* 0.7152 * 65536 */ * bgra[1] * bgra[1] + + 13933UL /* 0.2126 * 65536 */ * bgra[2] * bgra[2] ) >> 16; /* - * Final transparency can be determined this way: + * Final transparency can be determined as follows. * * - If alpha is zero, we want 0. * - If alpha is zero and luminosity is zero, we want 255. * - If alpha is zero and luminosity is one, we want 0. * - * So the formula is a * (1 - l). + * So the formula is a * (1 - l) = a - l * a. + * + * We still need to undo premultiplication by dividing l by a*a. + * */ - return (FT_Byte)( FT_MulFix( 65535 - l, a ) >> 8 ); + return (FT_Byte)( a - l / a ); } @@ -443,10 +471,16 @@ FT_Error error = FT_Err_Ok; FT_Memory memory; + FT_Byte* s; + FT_Byte* t; + if ( !library ) return FT_THROW( Invalid_Library_Handle ); + if ( !source || !target ) + return FT_THROW( Invalid_Argument ); + memory = library->memory; switch ( source->pixel_mode ) @@ -459,13 +493,15 @@ case FT_PIXEL_MODE_LCD_V: case FT_PIXEL_MODE_BGRA: { - FT_Int pad; - FT_Long old_size; + FT_Int pad, old_target_pitch, target_pitch; + FT_ULong old_size; - old_size = target->rows * target->pitch; - if ( old_size < 0 ) - old_size = -old_size; + old_target_pitch = target->pitch; + if ( old_target_pitch < 0 ) + old_target_pitch = -old_target_pitch; + + old_size = target->rows * old_target_pitch; target->pixel_mode = FT_PIXEL_MODE_GRAY; target->rows = source->rows; @@ -479,16 +515,18 @@ pad = alignment - pad; } - target->pitch = source->width + pad; + target_pitch = source->width + pad; - if ( target->pitch > 0 && - (FT_ULong)target->rows > FT_ULONG_MAX / target->pitch ) + if ( target_pitch > 0 && + (FT_ULong)target->rows > FT_ULONG_MAX / target_pitch ) return FT_THROW( Invalid_Argument ); - if ( target->rows * target->pitch > old_size && + if ( target->rows * target_pitch > old_size && FT_QREALLOC( target->buffer, - old_size, target->rows * target->pitch ) ) + old_size, target->rows * target_pitch ) ) return error; + + target->pitch = target->pitch < 0 ? -target_pitch : target_pitch; } break; @@ -496,13 +534,20 @@ error = FT_THROW( Invalid_Argument ); } + s = source->buffer; + t = target->buffer; + + /* take care of bitmap flow */ + if ( source->pitch < 0 ) + s -= source->pitch * ( source->rows - 1 ); + if ( target->pitch < 0 ) + t -= target->pitch * ( target->rows - 1 ); + switch ( source->pixel_mode ) { case FT_PIXEL_MODE_MONO: { - FT_Byte* s = source->buffer; - FT_Byte* t = target->buffer; - FT_Int i; + FT_UInt i; target->num_grays = 2; @@ -511,7 +556,7 @@ { FT_Byte* ss = s; FT_Byte* tt = t; - FT_Int j; + FT_UInt j; /* get the full bytes */ @@ -559,12 +604,8 @@ case FT_PIXEL_MODE_LCD: case FT_PIXEL_MODE_LCD_V: { - FT_Int width = source->width; - FT_Byte* s = source->buffer; - FT_Byte* t = target->buffer; - FT_Int s_pitch = source->pitch; - FT_Int t_pitch = target->pitch; - FT_Int i; + FT_Int width = source->width; + FT_UInt i; target->num_grays = 256; @@ -573,8 +614,8 @@ { FT_ARRAY_COPY( t, s, width ); - s += s_pitch; - t += t_pitch; + s += source->pitch; + t += target->pitch; } } break; @@ -582,9 +623,7 @@ case FT_PIXEL_MODE_GRAY2: { - FT_Byte* s = source->buffer; - FT_Byte* t = target->buffer; - FT_Int i; + FT_UInt i; target->num_grays = 4; @@ -593,7 +632,7 @@ { FT_Byte* ss = s; FT_Byte* tt = t; - FT_Int j; + FT_UInt j; /* get the full bytes */ @@ -634,9 +673,7 @@ case FT_PIXEL_MODE_GRAY4: { - FT_Byte* s = source->buffer; - FT_Byte* t = target->buffer; - FT_Int i; + FT_UInt i; target->num_grays = 16; @@ -645,7 +682,7 @@ { FT_Byte* ss = s; FT_Byte* tt = t; - FT_Int j; + FT_UInt j; /* get the full bytes */ @@ -670,13 +707,10 @@ } break; + case FT_PIXEL_MODE_BGRA: { - FT_Byte* s = source->buffer; - FT_Byte* t = target->buffer; - FT_Int s_pitch = source->pitch; - FT_Int t_pitch = target->pitch; - FT_Int i; + FT_UInt i; target->num_grays = 256; @@ -685,7 +719,7 @@ { FT_Byte* ss = s; FT_Byte* tt = t; - FT_Int j; + FT_UInt j; for ( j = source->width; j > 0; j-- ) @@ -696,8 +730,8 @@ tt += 1; } - s += s_pitch; - t += t_pitch; + s += source->pitch; + t += target->pitch; } } break; diff --git a/freetype/src/base/ftcalc.c b/freetype/src/base/ftcalc.c index 6e655832f..57f796803 100644 --- a/freetype/src/base/ftcalc.c +++ b/freetype/src/base/ftcalc.c @@ -39,7 +39,8 @@ #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_OBJECTS_H -#ifdef FT_MULFIX_INLINED + +#ifdef FT_MULFIX_ASSEMBLER #undef FT_MulFix #endif @@ -67,6 +68,16 @@ #define FT_COMPONENT trace_calc + /* transfer sign leaving a positive number */ +#define FT_MOVE_SIGN( x, s ) \ + FT_BEGIN_STMNT \ + if ( x < 0 ) \ + { \ + x = -x; \ + s = -s; \ + } \ + FT_END_STMNT + /* The following three functions are available regardless of whether */ /* FT_LONG64 is defined. */ @@ -75,8 +86,8 @@ FT_EXPORT_DEF( FT_Fixed ) FT_RoundFix( FT_Fixed a ) { - return ( a >= 0 ) ? ( a + 0x8000L ) & ~0xFFFFL - : -((-a + 0x8000L ) & ~0xFFFFL ); + return a >= 0 ? ( a + 0x8000L ) & ~0xFFFFL + : -((-a + 0x8000L ) & ~0xFFFFL ); } @@ -85,8 +96,8 @@ FT_EXPORT_DEF( FT_Fixed ) FT_CeilFix( FT_Fixed a ) { - return ( a >= 0 ) ? ( a + 0xFFFFL ) & ~0xFFFFL - : -((-a + 0xFFFFL ) & ~0xFFFFL ); + return a >= 0 ? ( a + 0xFFFFL ) & ~0xFFFFL + : -((-a + 0xFFFFL ) & ~0xFFFFL ); } @@ -95,38 +106,40 @@ FT_EXPORT_DEF( FT_Fixed ) FT_FloorFix( FT_Fixed a ) { - return ( a >= 0 ) ? a & ~0xFFFFL - : -((-a) & ~0xFFFFL ); + return a >= 0 ? a & ~0xFFFFL + : -((-a) & ~0xFFFFL ); } +#ifndef FT_MSB FT_BASE_DEF ( FT_Int ) FT_MSB( FT_UInt32 z ) { - FT_Int shift = 0; + FT_Int shift = 0; + /* determine msb bit index in `shift' */ - if ( z >= ( 1L << 16 ) ) + if ( z & 0xFFFF0000UL ) { z >>= 16; shift += 16; } - if ( z >= ( 1L << 8 ) ) + if ( z & 0x0000FF00UL ) { z >>= 8; shift += 8; } - if ( z >= ( 1L << 4 ) ) + if ( z & 0x000000F0UL ) { z >>= 4; shift += 4; } - if ( z >= ( 1L << 2 ) ) + if ( z & 0x0000000CUL ) { z >>= 2; shift += 2; } - if ( z >= ( 1L << 1 ) ) + if ( z & 0x00000002UL ) { /* z >>= 1; */ shift += 1; @@ -135,6 +148,8 @@ return shift; } +#endif /* !FT_MSB */ + /* documentation is in ftcalc.h */ @@ -162,19 +177,18 @@ FT_Long b, FT_Long c ) { - FT_Int s; + FT_Int s = 1; FT_Long d; - s = 1; - if ( a < 0 ) { a = -a; s = -1; } - if ( b < 0 ) { b = -b; s = -s; } - if ( c < 0 ) { c = -c; s = -s; } + FT_MOVE_SIGN( a, s ); + FT_MOVE_SIGN( b, s ); + FT_MOVE_SIGN( c, s ); d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c : 0x7FFFFFFFL ); - return ( s > 0 ) ? d : -d; + return s < 0 ? -d : d; } @@ -185,19 +199,18 @@ FT_Long b, FT_Long c ) { - FT_Int s; + FT_Int s = 1; FT_Long d; - s = 1; - if ( a < 0 ) { a = -a; s = -1; } - if ( b < 0 ) { b = -b; s = -s; } - if ( c < 0 ) { c = -c; s = -s; } + FT_MOVE_SIGN( a, s ); + FT_MOVE_SIGN( b, s ); + FT_MOVE_SIGN( c, s ); d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c : 0x7FFFFFFFL ); - return ( s > 0 ) ? d : -d; + return s < 0 ? -d : d; } @@ -217,21 +230,12 @@ FT_Long c; - if ( a < 0 ) - { - a = -a; - s = -1; - } - - if ( b < 0 ) - { - b = -b; - s = -s; - } + FT_MOVE_SIGN( a, s ); + FT_MOVE_SIGN( b, s ); c = (FT_Long)( ( (FT_Int64)a * b + 0x8000L ) >> 16 ); - return ( s > 0 ) ? c : -c; + return s < 0 ? -c : c; #endif /* FT_MULFIX_ASSEMBLER */ } @@ -243,30 +247,17 @@ FT_DivFix( FT_Long a, FT_Long b ) { - FT_Int32 s; - FT_UInt32 q; + FT_Int s = 1; + FT_Long q; - s = 1; - if ( a < 0 ) - { - a = -a; - s = -1; - } - if ( b < 0 ) - { - b = -b; - s = -s; - } + FT_MOVE_SIGN( a, s ); + FT_MOVE_SIGN( b, s ); - if ( b == 0 ) - /* check for division by 0 */ - q = 0x7FFFFFFFL; - else - /* compute result directly */ - q = (FT_UInt32)( ( ( (FT_UInt64)a << 16 ) + ( b >> 1 ) ) / b ); + q = (FT_Long)( b > 0 ? ( ( (FT_UInt64)a << 16 ) + ( b >> 1 ) ) / b + : 0x7FFFFFFFL ); - return ( s < 0 ? -(FT_Long)q : (FT_Long)q ); + return s < 0 ? -q : q; } @@ -314,25 +305,30 @@ FT_Int i; - q = 0; - r = hi; - - if ( r >= y ) + if ( hi >= y ) return (FT_UInt32)0x7FFFFFFFL; - i = 32; + /* We shift as many bits as we can into the high register, perform */ + /* 32-bit division with modulo there, then work through the remaining */ + /* bits with long division. This optimization is especially noticeable */ + /* for smaller dividends that barely use the high register. */ + + i = 31 - FT_MSB( hi ); + r = ( hi << i ) | ( lo >> ( 32 - i ) ); lo <<= i; /* left 64-bit shift */ + q = r / y; + r -= q * y; /* remainder */ + + i = 32 - i; /* bits remaining in low register */ do { - r <<= 1; q <<= 1; - r |= lo >> 31; + r = ( r << 1 ) | ( lo >> 31 ); lo <<= 1; if ( r >= y ) { r -= y; q |= 1; } - lo <<= 1; } while ( --i ); return q; @@ -344,7 +340,7 @@ FT_Int64* y, FT_Int64 *z ) { - register FT_UInt32 lo, hi; + FT_UInt32 lo, hi; lo = x->lo + y->lo; @@ -355,60 +351,95 @@ } - /* documentation is in freetype.h */ - - /* The FT_MulDiv function has been optimized thanks to ideas from */ - /* Graham Asher. The trick is to optimize computation when everything */ - /* fits within 32-bits (a rather common case). */ + /* The FT_MulDiv function has been optimized thanks to ideas from */ + /* Graham Asher and Alexei Podtelezhnikov. The trick is to optimize */ + /* a rather common case when everything fits within 32-bits. */ + /* */ + /* We compute 'a*b+c/2', then divide it by 'c' (all positive values). */ + /* */ + /* The product of two positive numbers never exceeds the square of */ + /* its mean values. Therefore, we always avoid the overflow by */ + /* imposing */ /* */ - /* we compute 'a*b+c/2', then divide it by 'c'. (positive values) */ + /* (a + b) / 2 <= sqrt(X - c/2) , */ /* */ - /* 46340 is FLOOR(SQRT(2^31-1)). */ + /* where X = 2^32 - 1, the maximum unsigned 32-bit value, and using */ + /* unsigned arithmetic. Now we replace `sqrt' with a linear function */ + /* that is smaller or equal for all values of c in the interval */ + /* [0;X/2]; it should be equal to sqrt(X) and sqrt(3X/4) at the */ + /* endpoints. Substituting the linear solution and explicit numbers */ + /* we get */ /* */ - /* if ( a <= 46340 && b <= 46340 ) then ( a*b <= 0x7FFEA810 ) */ + /* a + b <= 131071.99 - c / 122291.84 . */ /* */ - /* 0x7FFFFFFF - 0x7FFEA810 = 0x157F0 */ + /* In practice, we should use a faster and even stronger inequality */ /* */ - /* if ( c < 0x157F0*2 ) then ( a*b+c/2 <= 0x7FFFFFFF ) */ + /* a + b <= 131071 - (c >> 16) */ /* */ - /* and 2*0x157F0 = 176096 */ + /* or, alternatively, */ /* */ + /* a + b <= 129894 - (c >> 17) . */ + /* */ + /* FT_MulFix, on the other hand, is optimized for a small value of */ + /* the first argument, when the second argument can be much larger. */ + /* This can be achieved by scaling the second argument and the limit */ + /* in the above inequalities. For example, */ + /* */ + /* a + (b >> 8) <= (131071 >> 4) */ + /* */ + /* covers the practical range of use. The actual test below is a bit */ + /* tighter to avoid the border case overflows. */ + /* */ + /* In the case of FT_DivFix, the exact overflow check */ + /* */ + /* a << 16 <= X - c/2 */ + /* */ + /* is scaled down by 2^16 and we use */ + /* */ + /* a <= 65535 - (c >> 17) . */ + + /* documentation is in freetype.h */ FT_EXPORT_DEF( FT_Long ) FT_MulDiv( FT_Long a, FT_Long b, FT_Long c ) { - long s; + FT_Int s = 1; /* XXX: this function does not allow 64-bit arguments */ if ( a == 0 || b == c ) return a; - s = a; a = FT_ABS( a ); - s ^= b; b = FT_ABS( b ); - s ^= c; c = FT_ABS( c ); + FT_MOVE_SIGN( a, s ); + FT_MOVE_SIGN( b, s ); + FT_MOVE_SIGN( c, s ); + + if ( c == 0 ) + a = 0x7FFFFFFFL; - if ( a <= 46340L && b <= 46340L && c <= 176095L && c > 0 ) - a = ( a * b + ( c >> 1 ) ) / c; + else if ( (FT_ULong)a + b <= 129894UL - ( c >> 17 ) ) + a = ( (FT_ULong)a * b + ( c >> 1 ) ) / c; - else if ( (FT_Int32)c > 0 ) + else { FT_Int64 temp, temp2; - ft_multo64( (FT_Int32)a, (FT_Int32)b, &temp ); + ft_multo64( a, b, &temp ); temp2.hi = 0; - temp2.lo = (FT_UInt32)(c >> 1); + temp2.lo = c >> 1; + FT_Add64( &temp, &temp2, &temp ); - a = ft_div64by32( temp.hi, temp.lo, (FT_Int32)c ); + + /* last attempt to ditch long division */ + a = temp.hi == 0 ? temp.lo / c + : ft_div64by32( temp.hi, temp.lo, c ); } - else - a = 0x7FFFFFFFL; - return ( s < 0 ? -a : a ); + return s < 0 ? -a : a; } @@ -417,31 +448,35 @@ FT_Long b, FT_Long c ) { - long s; + FT_Int s = 1; if ( a == 0 || b == c ) return a; - s = a; a = FT_ABS( a ); - s ^= b; b = FT_ABS( b ); - s ^= c; c = FT_ABS( c ); + FT_MOVE_SIGN( a, s ); + FT_MOVE_SIGN( b, s ); + FT_MOVE_SIGN( c, s ); + + if ( c == 0 ) + a = 0x7FFFFFFFL; - if ( a <= 46340L && b <= 46340L && c > 0 ) - a = a * b / c; + else if ( (FT_ULong)a + b <= 131071UL ) + a = (FT_ULong)a * b / c; - else if ( (FT_Int32)c > 0 ) + else { FT_Int64 temp; - ft_multo64( (FT_Int32)a, (FT_Int32)b, &temp ); - a = ft_div64by32( temp.hi, temp.lo, (FT_Int32)c ); + ft_multo64( a, b, &temp ); + + /* last attempt to ditch long division */ + a = temp.hi == 0 ? temp.lo / c + : ft_div64by32( temp.hi, temp.lo, c ); } - else - a = 0x7FFFFFFFL; - return ( s < 0 ? -a : a ); + return s < 0 ? -a : a; } @@ -497,7 +532,7 @@ ua = (FT_ULong)a; ub = (FT_ULong)b; - if ( ua <= 2048 && ub <= 1048576L ) + if ( ua + ( ub >> 8 ) <= 8190UL ) ua = ( ua * ub + 0x8000U ) >> 16; else { @@ -515,20 +550,20 @@ #else /* 0 */ - FT_Long s; + FT_Int s = 1; FT_ULong ua, ub; if ( a == 0 || b == 0x10000L ) return a; - s = a; a = FT_ABS( a ); - s ^= b; b = FT_ABS( b ); + FT_MOVE_SIGN( a, s ); + FT_MOVE_SIGN( b, s ); ua = (FT_ULong)a; ub = (FT_ULong)b; - if ( ua <= 2048 && ub <= 1048576L ) + if ( ua + ( ub >> 8 ) <= 8190UL ) ua = ( ua * ub + 0x8000UL ) >> 16; else { @@ -539,7 +574,7 @@ ( ( al * ( ub & 0xFFFFUL ) + 0x8000UL ) >> 16 ); } - return ( s < 0 ? -(FT_Long)ua : (FT_Long)ua ); + return s < 0 ? -(FT_Long)ua : (FT_Long)ua; #endif /* 0 */ @@ -552,23 +587,24 @@ FT_DivFix( FT_Long a, FT_Long b ) { - FT_Int32 s; - FT_UInt32 q; + FT_Int s = 1; + FT_Long q; /* XXX: this function does not allow 64-bit arguments */ - s = (FT_Int32)a; a = FT_ABS( a ); - s ^= (FT_Int32)b; b = FT_ABS( b ); - if ( (FT_UInt32)b == 0 ) + FT_MOVE_SIGN( a, s ); + FT_MOVE_SIGN( b, s ); + + if ( b == 0 ) { /* check for division by 0 */ - q = (FT_UInt32)0x7FFFFFFFL; + q = 0x7FFFFFFFL; } - else if ( ( a >> 16 ) == 0 ) + else if ( a <= 65535L - ( b >> 17 ) ) { /* compute result directly */ - q = (FT_UInt32)( ( (FT_ULong)a << 16 ) + ( b >> 1 ) ) / (FT_UInt32)b; + q = (FT_Long)( ( ( (FT_ULong)a << 16 ) + ( b >> 1 ) ) / b ); } else { @@ -576,138 +612,18 @@ FT_Int64 temp, temp2; - temp.hi = (FT_Int32)( a >> 16 ); - temp.lo = (FT_UInt32)a << 16; + temp.hi = a >> 16; + temp.lo = a << 16; temp2.hi = 0; - temp2.lo = (FT_UInt32)( b >> 1 ); - FT_Add64( &temp, &temp2, &temp ); - q = ft_div64by32( temp.hi, temp.lo, (FT_Int32)b ); - } - - return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q ); - } + temp2.lo = b >> 1; - -#if 0 - - /* documentation is in ftcalc.h */ - - FT_EXPORT_DEF( void ) - FT_MulTo64( FT_Int32 x, - FT_Int32 y, - FT_Int64 *z ) - { - FT_Int32 s; - - - s = x; x = FT_ABS( x ); - s ^= y; y = FT_ABS( y ); - - ft_multo64( x, y, z ); - - if ( s < 0 ) - { - z->lo = (FT_UInt32)-(FT_Int32)z->lo; - z->hi = ~z->hi + !( z->lo ); - } - } - - - /* apparently, the second version of this code is not compiled correctly */ - /* on Mac machines with the MPW C compiler.. tsk, tsk, tsk... */ - -#if 1 - - FT_EXPORT_DEF( FT_Int32 ) - FT_Div64by32( FT_Int64* x, - FT_Int32 y ) - { - FT_Int32 s; - FT_UInt32 q, r, i, lo; - - - s = x->hi; - if ( s < 0 ) - { - x->lo = (FT_UInt32)-(FT_Int32)x->lo; - x->hi = ~x->hi + !x->lo; - } - s ^= y; y = FT_ABS( y ); - - /* Shortcut */ - if ( x->hi == 0 ) - { - if ( y > 0 ) - q = x->lo / y; - else - q = 0x7FFFFFFFL; - - return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q ); - } - - r = x->hi; - lo = x->lo; - - if ( r >= (FT_UInt32)y ) /* we know y is to be treated as unsigned here */ - return ( s < 0 ? 0x80000001UL : 0x7FFFFFFFUL ); - /* Return Max/Min Int32 if division overflow. */ - /* This includes division by zero! */ - q = 0; - for ( i = 0; i < 32; i++ ) - { - r <<= 1; - q <<= 1; - r |= lo >> 31; - - if ( r >= (FT_UInt32)y ) - { - r -= y; - q |= 1; - } - lo <<= 1; - } - - return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q ); - } - -#else /* 0 */ - - FT_EXPORT_DEF( FT_Int32 ) - FT_Div64by32( FT_Int64* x, - FT_Int32 y ) - { - FT_Int32 s; - FT_UInt32 q; - - - s = x->hi; - if ( s < 0 ) - { - x->lo = (FT_UInt32)-(FT_Int32)x->lo; - x->hi = ~x->hi + !x->lo; - } - s ^= y; y = FT_ABS( y ); - - /* Shortcut */ - if ( x->hi == 0 ) - { - if ( y > 0 ) - q = ( x->lo + ( y >> 1 ) ) / y; - else - q = 0x7FFFFFFFL; - - return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q ); + FT_Add64( &temp, &temp2, &temp ); + q = (FT_Long)ft_div64by32( temp.hi, temp.lo, b ); } - q = ft_div64by32( x->hi, x->lo, y ); - - return ( s < 0 ? -(FT_Int32)q : (FT_Int32)q ); + return s < 0 ? -q : q; } -#endif /* 0 */ - -#endif /* 0 */ - #endif /* FT_LONG64 */ @@ -943,55 +859,40 @@ FT_Pos out_x, FT_Pos out_y ) { - FT_Pos ax = in_x; - FT_Pos ay = in_y; - - FT_Pos d_in, d_out, d_corner; - - - /* We approximate the Euclidean metric (sqrt(x^2 + y^2)) with */ - /* the Taxicab metric (|x| + |y|), which can be computed much */ - /* faster. If one of the two vectors is much longer than the */ - /* other one, the direction of the shorter vector doesn't */ - /* influence the result any more. */ - /* */ - /* corner */ - /* x---------------------------x */ - /* \ / */ - /* \ / */ - /* in \ / out */ - /* \ / */ - /* o */ - /* Point */ - /* */ - - if ( ax < 0 ) - ax = -ax; - if ( ay < 0 ) - ay = -ay; - d_in = ax + ay; /* d_in = || in || */ - - ax = out_x; - if ( ax < 0 ) - ax = -ax; - ay = out_y; - if ( ay < 0 ) - ay = -ay; - d_out = ax + ay; /* d_out = || out || */ - - ax = out_x + in_x; - if ( ax < 0 ) - ax = -ax; - ay = out_y + in_y; - if ( ay < 0 ) - ay = -ay; - d_corner = ax + ay; /* d_corner = || in + out || */ + FT_Pos ax = in_x + out_x; + FT_Pos ay = in_y + out_y; + + FT_Pos d_in, d_out, d_hypot; + + + /* The idea of this function is to compare the length of the */ + /* hypotenuse with the `in' and `out' length. The `corner' */ + /* represented by `in' and `out' is flat if the hypotenuse's */ + /* length isn't too large. */ + /* */ + /* This approach has the advantage that the angle between */ + /* `in' and `out' is not checked. In case one of the two */ + /* vectors is `dominant', this is, much larger than the */ + /* other vector, we thus always have a flat corner. */ + /* */ + /* hypotenuse */ + /* x---------------------------x */ + /* \ / */ + /* \ / */ + /* in \ / out */ + /* \ / */ + /* o */ + /* Point */ + + d_in = FT_HYPOT( in_x, in_y ); + d_out = FT_HYPOT( out_x, out_y ); + d_hypot = FT_HYPOT( ax, ay ); /* now do a simple length comparison: */ /* */ - /* d_in + d_out < 17/16 d_corner */ + /* d_in + d_out < 17/16 d_hypot */ - return ( d_in + d_out - d_corner ) < ( d_corner >> 4 ); + return ( d_in + d_out - d_hypot ) < ( d_hypot >> 4 ); } diff --git a/freetype/src/base/ftfstype.c b/freetype/src/base/ftfstype.c index d0ef7b7c1..6b49ef837 100644 --- a/freetype/src/base/ftfstype.c +++ b/freetype/src/base/ftfstype.c @@ -4,7 +4,7 @@ /* */ /* FreeType utility file to access FSType data (body). */ /* */ -/* Copyright 2008, 2009 by */ +/* Copyright 2008, 2009, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -51,7 +51,7 @@ /* look at FSType before fsType for Type42 */ - if ( ( os2 = (TT_OS2*)FT_Get_Sfnt_Table( face, ft_sfnt_os2 ) ) != NULL && + if ( ( os2 = (TT_OS2*)FT_Get_Sfnt_Table( face, FT_SFNT_OS2 ) ) != NULL && os2->version != 0xFFFFU ) return os2->fsType; diff --git a/freetype/src/base/ftglyph.c b/freetype/src/base/ftglyph.c index c62b3db0c..ac178c41b 100644 --- a/freetype/src/base/ftglyph.c +++ b/freetype/src/base/ftglyph.c @@ -4,7 +4,7 @@ /* */ /* FreeType convenience functions to handle glyphs (body). */ /* */ -/* Copyright 1996-2005, 2007, 2008, 2010, 2012, 2013 by */ +/* Copyright 1996-2005, 2007, 2008, 2010, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -314,13 +314,13 @@ /* check arguments */ - if ( !target ) + if ( !target || !source || !source->clazz ) { error = FT_THROW( Invalid_Argument ); goto Exit; } - *target = 0; + *target = NULL; if ( !source || !source->clazz ) { @@ -359,7 +359,7 @@ FT_Error error; FT_Glyph glyph; - const FT_Glyph_Class* clazz = 0; + const FT_Glyph_Class* clazz = NULL; if ( !slot ) @@ -512,7 +512,7 @@ FT_BitmapGlyph bitmap = NULL; const FT_Glyph_Class* clazz; - /* FT_BITMAP_GLYPH_CLASS_GET derefers `library' in PIC mode */ + /* FT_BITMAP_GLYPH_CLASS_GET dereferences `library' in PIC mode */ FT_Library library; diff --git a/freetype/src/base/ftgxval.c b/freetype/src/base/ftgxval.c index a8ec44ac0..a65f4c879 100644 --- a/freetype/src/base/ftgxval.c +++ b/freetype/src/base/ftgxval.c @@ -4,7 +4,7 @@ /* */ /* FreeType API for validating TrueTyepGX/AAT tables (body). */ /* */ -/* Copyright 2004-2006, 2010, 2013 by */ +/* Copyright 2004-2006, 2010, 2013, 2014 by */ /* Masatake YAMATO, Redhat K.K, */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ @@ -50,7 +50,7 @@ goto Exit; } - if ( tables == NULL ) + if ( !tables ) { error = FT_THROW( Invalid_Argument ); goto Exit; @@ -102,7 +102,7 @@ goto Exit; } - if ( ckern_table == NULL ) + if ( !ckern_table ) { error = FT_THROW( Invalid_Argument ); goto Exit; diff --git a/freetype/src/base/ftinit.c b/freetype/src/base/ftinit.c index 6176273f0..c4c88201a 100644 --- a/freetype/src/base/ftinit.c +++ b/freetype/src/base/ftinit.c @@ -4,7 +4,7 @@ /* */ /* FreeType initialization layer (body). */ /* */ -/* Copyright 1996-2002, 2005, 2007, 2009, 2012, 2013 by */ +/* Copyright 1996-2002, 2005, 2007, 2009, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -235,6 +235,8 @@ FT_Memory memory; + /* check of `alibrary' delayed to `FT_New_Library' */ + /* First of all, allocate a new system object -- this function is part */ /* of the system-specific component, i.e. `ftsystem.c'. */ @@ -263,17 +265,19 @@ FT_EXPORT_DEF( FT_Error ) FT_Done_FreeType( FT_Library library ) { - if ( library ) - { - FT_Memory memory = library->memory; + FT_Memory memory; - /* Discard the library object */ - FT_Done_Library( library ); + if ( !library ) + return FT_THROW( Invalid_Library_Handle ); - /* discard memory manager */ - FT_Done_Memory( memory ); - } + memory = library->memory; + + /* Discard the library object */ + FT_Done_Library( library ); + + /* discard memory manager */ + FT_Done_Memory( memory ); return FT_Err_Ok; } diff --git a/freetype/src/base/ftlcdfil.c b/freetype/src/base/ftlcdfil.c index 852fb3298..d8bcbbf1d 100644 --- a/freetype/src/base/ftlcdfil.c +++ b/freetype/src/base/ftlcdfil.c @@ -4,7 +4,7 @@ /* */ /* FreeType API for color filtering of subpixel bitmap glyphs (body). */ /* */ -/* Copyright 2006, 2008-2010, 2013 by */ +/* Copyright 2006, 2008-2010, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -46,9 +46,16 @@ FT_Byte* line = bitmap->buffer; + /* take care of bitmap flow */ + if ( bitmap->pitch < 0 ) + line -= bitmap->pitch * ( bitmap->rows - 1 ); + + /* `fir' and `pix' must be at least 32 bit wide, since the sum of */ + /* the values in `weights' can exceed 0xFF */ + for ( ; height > 0; height--, line += bitmap->pitch ) { - FT_UInt fir[5]; + FT_UInt fir[4]; /* below, `pix' is used as the 5th element */ FT_UInt val1, xx; @@ -57,7 +64,6 @@ fir[1] = weights[3] * val1; fir[2] = weights[4] * val1; fir[3] = 0; - fir[4] = 0; val1 = line[1]; fir[0] += weights[1] * val1; @@ -78,7 +84,7 @@ fir[3] = weights[4] * val; pix >>= 8; - pix |= -( pix >> 8 ); + pix |= (FT_UInt)-(FT_Int)( pix >> 8 ); line[xx - 2] = (FT_Byte)pix; } @@ -87,11 +93,11 @@ pix = fir[0] >> 8; - pix |= -( pix >> 8 ); + pix |= (FT_UInt)-(FT_Int)( pix >> 8 ); line[xx - 2] = (FT_Byte)pix; pix = fir[1] >> 8; - pix |= -( pix >> 8 ); + pix |= (FT_UInt)-(FT_Int)( pix >> 8 ); line[xx - 1] = (FT_Byte)pix; } } @@ -104,10 +110,14 @@ FT_Int pitch = bitmap->pitch; + /* take care of bitmap flow */ + if ( bitmap->pitch < 0 ) + column -= bitmap->pitch * ( bitmap->rows - 1 ); + for ( ; width > 0; width--, column++ ) { FT_Byte* col = column; - FT_UInt fir[5]; + FT_UInt fir[4]; /* below, `pix' is used as the 5th element */ FT_UInt val1, yy; @@ -116,7 +126,6 @@ fir[1] = weights[3] * val1; fir[2] = weights[4] * val1; fir[3] = 0; - fir[4] = 0; col += pitch; val1 = col[0]; @@ -139,7 +148,7 @@ fir[3] = weights[4] * val; pix >>= 8; - pix |= -( pix >> 8 ); + pix |= (FT_UInt)-(FT_Int)( pix >> 8 ); col[-2 * pitch] = (FT_Byte)pix; col += pitch; } @@ -149,11 +158,11 @@ pix = fir[0] >> 8; - pix |= -( pix >> 8 ); + pix |= (FT_UInt)-(FT_Int)( pix >> 8 ); col[-2 * pitch] = (FT_Byte)pix; pix = fir[1] >> 8; - pix |= -( pix >> 8 ); + pix |= (FT_UInt)-(FT_Int)( pix >> 8 ); col[-pitch] = (FT_Byte)pix; } } @@ -189,6 +198,10 @@ FT_Byte* line = bitmap->buffer; + /* take care of bitmap flow */ + if ( bitmap->pitch < 0 ) + line -= bitmap->pitch * ( bitmap->rows - 1 ); + for ( ; height > 0; height--, line += pitch ) { FT_UInt xx; @@ -228,6 +241,10 @@ FT_Byte* column = bitmap->buffer; + /* take care of bitmap flow */ + if ( bitmap->pitch < 0 ) + column -= bitmap->pitch * ( bitmap->rows - 1 ); + for ( ; width > 0; width--, column++ ) { FT_Byte* col = column; @@ -272,7 +289,10 @@ FT_Library_SetLcdFilterWeights( FT_Library library, unsigned char *weights ) { - if ( !library || !weights ) + if ( !library ) + return FT_THROW( Invalid_Library_Handle ); + + if ( !weights ) return FT_THROW( Invalid_Argument ); ft_memcpy( library->lcd_weights, weights, 5 ); @@ -294,7 +314,7 @@ if ( !library ) - return FT_THROW( Invalid_Argument ); + return FT_THROW( Invalid_Library_Handle ); switch ( filter ) { diff --git a/freetype/src/base/ftmac.c b/freetype/src/base/ftmac.c index 9b49da814..5301ab44f 100644 --- a/freetype/src/base/ftmac.c +++ b/freetype/src/base/ftmac.c @@ -8,7 +8,7 @@ /* This file is for Mac OS X only; see builds/mac/ftoldmac.c for */ /* classic platforms built by MPW. */ /* */ -/* Copyright 1996-2009, 2013 by */ +/* Copyright 1996-2009, 2013, 2014 by */ /* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -227,6 +227,9 @@ FT_Error err; + if ( !fontName || !face_index ) + return FT_THROW( Invalid_Argument) ; + err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index ); if ( err ) return err; @@ -256,6 +259,9 @@ FT_Error err; + if ( !fontName || !face_index ) + return FT_THROW( Invalid_Argument ); + err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index ); if ( err ) return err; @@ -440,9 +446,10 @@ style = (StyleTable*)p; p += sizeof ( StyleTable ); string_count = EndianS16_BtoN( *(short*)(p) ); + string_count = FT_MIN( 64, string_count ); p += sizeof ( short ); - for ( i = 0; i < string_count && i < 64; i++ ) + for ( i = 0; i < string_count; i++ ) { names[i] = p; p += names[i][0]; @@ -459,7 +466,7 @@ ps_name[ps_name_len] = 0; } if ( style->indexes[face_index] > 1 && - style->indexes[face_index] <= FT_MIN( string_count, 64 ) ) + style->indexes[face_index] <= string_count ) { unsigned char* suffixes = names[style->indexes[face_index] - 1]; @@ -852,6 +859,8 @@ FT_Error error = FT_Err_Ok; + /* check of `library' and `aface' delayed to `FT_New_Face_From_XXX' */ + GetResInfo( fond, &fond_id, &fond_type, fond_name ); if ( ResError() != noErr || fond_type != TTAG_FOND ) return FT_THROW( Invalid_File_Format ); @@ -997,10 +1006,14 @@ { FT_Error error; FT_Open_Args args; - OSErr err; - UInt8 pathname[PATH_MAX]; + + OSErr err; + UInt8 pathname[PATH_MAX]; + /* check of `library' and `aface' delayed to */ + /* `FT_New_Face_From_Resource' */ + if ( !ref ) return FT_THROW( Invalid_Argument ); @@ -1047,6 +1060,8 @@ FSRef ref; + /* check of `library' and `aface' delayed to `FT_New_Face_From_FSRef' */ + if ( !spec || FSpMakeFSRef( spec, &ref ) != noErr ) return FT_THROW( Invalid_Argument ); else diff --git a/freetype/src/base/ftmm.c b/freetype/src/base/ftmm.c index 18ff879bf..056680bd6 100644 --- a/freetype/src/base/ftmm.c +++ b/freetype/src/base/ftmm.c @@ -4,7 +4,7 @@ /* */ /* Multiple Master font support (body). */ /* */ -/* Copyright 1996-2001, 2003, 2004, 2009, 2013 by */ +/* Copyright 1996-2001, 2003, 2004, 2009, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -72,6 +72,11 @@ FT_Service_MultiMasters service; + /* check of `face' delayed to `ft_face_get_mm_service' */ + + if ( !amaster ) + return FT_THROW( Invalid_Argument ); + error = ft_face_get_mm_service( face, &service ); if ( !error ) { @@ -94,6 +99,11 @@ FT_Service_MultiMasters service; + /* check of `face' delayed to `ft_face_get_mm_service' */ + + if ( !amaster ) + return FT_THROW( Invalid_Argument ); + error = ft_face_get_mm_service( face, &service ); if ( !error ) { @@ -117,6 +127,11 @@ FT_Service_MultiMasters service; + /* check of `face' delayed to `ft_face_get_mm_service' */ + + if ( !coords ) + return FT_THROW( Invalid_Argument ); + error = ft_face_get_mm_service( face, &service ); if ( !error ) { @@ -140,6 +155,11 @@ FT_Service_MultiMasters service; + /* check of `face' delayed to `ft_face_get_mm_service' */ + + if ( !coords ) + return FT_THROW( Invalid_Argument ); + error = ft_face_get_mm_service( face, &service ); if ( !error ) { @@ -163,6 +183,11 @@ FT_Service_MultiMasters service; + /* check of `face' delayed to `ft_face_get_mm_service' */ + + if ( !coords ) + return FT_THROW( Invalid_Argument ); + error = ft_face_get_mm_service( face, &service ); if ( !error ) { @@ -189,6 +214,11 @@ FT_Service_MultiMasters service; + /* check of `face' delayed to `ft_face_get_mm_service' */ + + if ( !coords ) + return FT_THROW( Invalid_Argument ); + error = ft_face_get_mm_service( face, &service ); if ( !error ) { diff --git a/freetype/src/base/ftobjs.c b/freetype/src/base/ftobjs.c index 6f323362a..ee15a016c 100644 --- a/freetype/src/base/ftobjs.c +++ b/freetype/src/base/ftobjs.c @@ -408,7 +408,10 @@ FT_GlyphSlot slot = NULL; - if ( !face || !face->driver ) + if ( !face ) + return FT_THROW( Invalid_Face_Handle ); + + if ( !face->driver ) return FT_THROW( Invalid_Argument ); driver = face->driver; @@ -508,6 +511,7 @@ internal->transform_matrix.xy = 0; internal->transform_matrix.yx = 0; internal->transform_matrix.yy = 0x10000L; + matrix = &internal->transform_matrix; } else @@ -523,6 +527,7 @@ { internal->transform_delta.x = 0; internal->transform_delta.y = 0; + delta = &internal->transform_delta; } else @@ -1040,14 +1045,6 @@ ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE && cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32 ) ) { -#ifdef FT_MAX_CHARMAP_CACHEABLE - if ( cur - first > FT_MAX_CHARMAP_CACHEABLE ) - { - FT_ERROR(( "find_unicode_charmap: UCS-4 cmap is found " - "at too late position (%d)\n", cur - first )); - continue; - } -#endif face->charmap = cur[0]; return FT_Err_Ok; } @@ -1062,14 +1059,6 @@ { if ( cur[0]->encoding == FT_ENCODING_UNICODE ) { -#ifdef FT_MAX_CHARMAP_CACHEABLE - if ( cur - first > FT_MAX_CHARMAP_CACHEABLE ) - { - FT_ERROR(( "find_unicode_charmap: UCS-2 cmap is found " - "at too late position (%d)\n", cur - first )); - continue; - } -#endif face->charmap = cur[0]; return FT_Err_Ok; } @@ -1111,17 +1100,7 @@ if ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE && cur[0]->encoding_id == TT_APPLE_ID_VARIANT_SELECTOR && FT_Get_CMap_Format( cur[0] ) == 14 ) - { -#ifdef FT_MAX_CHARMAP_CACHEABLE - if ( cur - first > FT_MAX_CHARMAP_CACHEABLE ) - { - FT_ERROR(( "find_unicode_charmap: UVS cmap is found " - "at too late position (%d)\n", cur - first )); - continue; - } -#endif return cur[0]; - } } return NULL; @@ -1243,7 +1222,7 @@ FT_Open_Args args; - /* test for valid `library' and `aface' delayed to FT_Open_Face() */ + /* test for valid `library' and `aface' delayed to `FT_Open_Face' */ if ( !pathname ) return FT_THROW( Invalid_Argument ); @@ -1269,7 +1248,7 @@ FT_Open_Args args; - /* test for valid `library' and `face' delayed to FT_Open_Face() */ + /* test for valid `library' and `face' delayed to `FT_Open_Face' */ if ( !file_base ) return FT_THROW( Invalid_Argument ); @@ -1583,9 +1562,9 @@ FT_Memory memory = library->memory; FT_Byte* pfb_data = NULL; int i, type, flags; - FT_Long len; - FT_Long pfb_len, pfb_pos, pfb_lenpos; - FT_Long rlen, temp; + FT_ULong len; + FT_ULong pfb_len, pfb_pos, pfb_lenpos; + FT_ULong rlen, temp; if ( face_index == -1 ) @@ -1601,11 +1580,34 @@ error = FT_Stream_Seek( stream, offsets[i] ); if ( error ) goto Exit; - if ( FT_READ_LONG( temp ) ) + if ( FT_READ_ULONG( temp ) ) + goto Exit; + + /* FT2 allocator takes signed long buffer length, + * too large value causing overflow should be checked + */ + FT_TRACE4(( " POST fragment #%d: length=0x%08x\n", + i, temp)); + if ( 0x7FFFFFFFUL < temp || pfb_len + temp + 6 < pfb_len ) + { + FT_TRACE2(( " too long fragment length makes" + " pfb_len confused: temp=0x%08x\n", temp )); + error = FT_THROW( Invalid_Offset ); goto Exit; + } + pfb_len += temp + 6; } + FT_TRACE2(( " total buffer size to concatenate %d" + " POST fragments: 0x%08x\n", + resource_cnt, pfb_len + 2)); + if ( pfb_len + 2 < 6 ) { + FT_TRACE2(( " too long fragment length makes" + " pfb_len confused: pfb_len=0x%08x\n", pfb_len )); + error = FT_THROW( Array_Too_Large ); + goto Exit; + } if ( FT_ALLOC( pfb_data, (FT_Long)pfb_len + 2 ) ) goto Exit; @@ -1625,16 +1627,30 @@ error = FT_Stream_Seek( stream, offsets[i] ); if ( error ) goto Exit2; - if ( FT_READ_LONG( rlen ) ) - goto Exit; + if ( FT_READ_ULONG( rlen ) ) + goto Exit2; + + /* FT2 allocator takes signed long buffer length, + * too large fragment length causing overflow should be checked + */ + if ( 0x7FFFFFFFUL < rlen ) + { + error = FT_THROW( Invalid_Offset ); + goto Exit2; + } + if ( FT_READ_USHORT( flags ) ) - goto Exit; + goto Exit2; FT_TRACE3(( "POST fragment[%d]: offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n", i, offsets[i], rlen, flags )); + error = FT_ERR( Array_Too_Large ); /* postpone the check of rlen longer than buffer until FT_Stream_Read() */ if ( ( flags >> 8 ) == 0 ) /* Comment, should not be loaded */ + { + FT_TRACE3(( " Skip POST fragment #%d because it is a comment\n", i )); continue; + } /* the flags are part of the resource, so rlen >= 2. */ /* but some fonts declare rlen = 0 for empty fragment */ @@ -1647,6 +1663,8 @@ len += rlen; else { + FT_TRACE3(( " Write POST fragment #%d header (4-byte) to buffer" + " 0x%p + 0x%08x\n", i, pfb_data, pfb_lenpos )); if ( pfb_lenpos + 3 > pfb_len + 2 ) goto Exit2; pfb_data[pfb_lenpos ] = (FT_Byte)( len ); @@ -1657,6 +1675,8 @@ if ( ( flags >> 8 ) == 5 ) /* End of font mark */ break; + FT_TRACE3(( " Write POST fragment #%d header (6-byte) to buffer" + " 0x%p + 0x%08x\n", i, pfb_data, pfb_pos )); if ( pfb_pos + 6 > pfb_len + 2 ) goto Exit2; pfb_data[pfb_pos++] = 0x80; @@ -1672,16 +1692,18 @@ pfb_data[pfb_pos++] = 0; } - error = FT_ERR( Cannot_Open_Resource ); if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len ) goto Exit2; + FT_TRACE3(( " Load POST fragment #%d (%d byte) to buffer" + " 0x%p + 0x%08x\n", i, rlen, pfb_data, pfb_pos )); error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen ); if ( error ) goto Exit2; pfb_pos += rlen; } + error = FT_ERR( Array_Too_Large ); if ( pfb_pos + 2 > pfb_len + 2 ) goto Exit2; pfb_data[pfb_pos++] = 0x80; @@ -1702,6 +1724,13 @@ aface ); Exit2: + if ( error == FT_ERR( Array_Too_Large ) ) + FT_TRACE2(( " Abort due to too-short buffer to store" + " all POST fragments\n" )); + else if ( error == FT_ERR( Invalid_Offset ) ) + FT_TRACE2(( " Abort due to invalid offset in a POST fragment\n" )); + if ( error ) + error = FT_ERR( Cannot_Open_Resource ); FT_FREE( pfb_data ); Exit: @@ -1881,7 +1910,7 @@ rlen = ( header[0x57] << 24 ) | ( header[0x58] << 16 ) | ( header[0x59] << 8 ) | - header[0x5a]; + header[0x5A]; #endif /* 0 */ offset = 128 + ( ( dlen + 127 ) & ~127 ); @@ -2049,8 +2078,7 @@ FT_Module* limit; - /* test for valid `library' delayed to */ - /* FT_Stream_New() */ + /* test for valid `library' delayed to `FT_Stream_New' */ if ( ( !aface && face_index >= 0 ) || !args ) return FT_THROW( Invalid_Argument ); @@ -2297,7 +2325,7 @@ FT_Open_Args open; - /* test for valid `face' delayed to FT_Attach_Stream() */ + /* test for valid `face' delayed to `FT_Attach_Stream' */ if ( !filepathname ) return FT_THROW( Invalid_Argument ); @@ -2323,7 +2351,7 @@ FT_Driver_Class clazz; - /* test for valid `parameters' delayed to FT_Stream_New() */ + /* test for valid `parameters' delayed to `FT_Stream_New' */ if ( !face ) return FT_THROW( Invalid_Face_Handle ); @@ -2359,6 +2387,9 @@ FT_EXPORT_DEF( FT_Error ) FT_Reference_Face( FT_Face face ) { + if ( !face ) + return FT_THROW( Invalid_Face_Handle ); + face->internal->refcount++; return FT_Err_Ok; @@ -2425,7 +2456,7 @@ return FT_THROW( Invalid_Face_Handle ); if ( !asize ) - return FT_THROW( Invalid_Size_Handle ); + return FT_THROW( Invalid_Argument ); if ( !face->driver ) return FT_THROW( Invalid_Driver_Handle ); @@ -2934,6 +2965,8 @@ FT_Size_RequestRec req; + /* check of `face' delayed to `FT_Request_Size' */ + if ( !char_width ) char_width = char_height; else if ( !char_height ) @@ -2972,6 +3005,8 @@ FT_Size_RequestRec req; + /* check of `face' delayed to `FT_Request_Size' */ + if ( pixel_width == 0 ) pixel_width = pixel_height; else if ( pixel_height == 0 ) @@ -3122,15 +3157,6 @@ { if ( cur[0]->encoding == encoding ) { -#ifdef FT_MAX_CHARMAP_CACHEABLE - if ( cur - face->charmaps > FT_MAX_CHARMAP_CACHEABLE ) - { - FT_ERROR(( "FT_Select_Charmap: requested charmap is found (%d), " - "but in too late position to cache\n", - cur - face->charmaps )); - continue; - } -#endif face->charmap = cur[0]; return 0; } @@ -3154,8 +3180,9 @@ return FT_THROW( Invalid_Face_Handle ); cur = face->charmaps; - if ( !cur ) + if ( !cur || !charmap ) return FT_THROW( Invalid_CharMap_Handle ); + if ( FT_Get_CMap_Format( charmap ) == 14 ) return FT_THROW( Invalid_Argument ); @@ -3165,19 +3192,11 @@ { if ( cur[0] == charmap ) { -#ifdef FT_MAX_CHARMAP_CACHEABLE - if ( cur - face->charmaps > FT_MAX_CHARMAP_CACHEABLE ) - { - FT_ERROR(( "FT_Set_Charmap: requested charmap is found (%d), " - "but in too late position to cache\n", - cur - face->charmaps )); - continue; - } -#endif face->charmap = cur[0]; - return 0; + return FT_Err_Ok; } } + return FT_THROW( Invalid_Argument ); } @@ -3199,15 +3218,6 @@ FT_ASSERT( i < charmap->face->num_charmaps ); -#ifdef FT_MAX_CHARMAP_CACHEABLE - if ( i > FT_MAX_CHARMAP_CACHEABLE ) - { - FT_ERROR(( "FT_Get_Charmap_Index: requested charmap is found (%d), " - "but in too late position to cache\n", - i )); - return -i; - } -#endif return i; } @@ -3418,8 +3428,9 @@ FT_UInt result = 0; - if ( face && face->charmap && - face->charmap->encoding == FT_ENCODING_UNICODE ) + if ( face && + face->charmap && + face->charmap->encoding == FT_ENCODING_UNICODE ) { FT_CharMap charmap = find_variant_selector_charmap( face ); FT_CMap ucmap = FT_CMAP( face->charmap ); @@ -3597,7 +3608,9 @@ FT_UInt result = 0; - if ( face && FT_HAS_GLYPH_NAMES( face ) ) + if ( face && + FT_HAS_GLYPH_NAMES( face ) && + glyph_name ) { FT_Service_GlyphDict service; @@ -3622,27 +3635,30 @@ FT_Pointer buffer, FT_UInt buffer_max ) { - FT_Error error = FT_ERR( Invalid_Argument ); + FT_Error error; + FT_Service_GlyphDict service; - /* clean up buffer */ - if ( buffer && buffer_max > 0 ) - ((FT_Byte*)buffer)[0] = 0; + if ( !face ) + return FT_THROW( Invalid_Face_Handle ); - if ( face && - (FT_Long)glyph_index <= face->num_glyphs && - FT_HAS_GLYPH_NAMES( face ) ) - { - FT_Service_GlyphDict service; + if ( !buffer || buffer_max == 0 ) + return FT_THROW( Invalid_Argument ); + /* clean up buffer */ + ((FT_Byte*)buffer)[0] = '\0'; - FT_FACE_LOOKUP_SERVICE( face, - service, - GLYPH_DICT ); + if ( (FT_Long)glyph_index >= face->num_glyphs ) + return FT_THROW( Invalid_Glyph_Index ); - if ( service && service->get_name ) - error = service->get_name( face, glyph_index, buffer, buffer_max ); - } + if ( !FT_HAS_GLYPH_NAMES( face ) ) + return FT_THROW( Invalid_Argument ); + + FT_FACE_LOOKUP_SERVICE( face, service, GLYPH_DICT ); + if ( service && service->get_name ) + error = service->get_name( face, glyph_index, buffer, buffer_max ); + else + error = FT_THROW( Invalid_Argument ); return error; } @@ -3683,7 +3699,7 @@ FT_Get_Sfnt_Table( FT_Face face, FT_Sfnt_Tag tag ) { - void* table = 0; + void* table = NULL; FT_Service_SFNT_Table service; @@ -3733,6 +3749,8 @@ FT_ULong offset; + /* test for valid `length' delayed to `service->table_info' */ + if ( !face || !FT_IS_SFNT( face ) ) return FT_THROW( Invalid_Face_Handle ); @@ -3800,12 +3818,12 @@ FT_Face face; - if ( size == NULL ) - return FT_THROW( Invalid_Argument ); + if ( !size ) + return FT_THROW( Invalid_Size_Handle ); face = size->face; - if ( face == NULL || face->driver == NULL ) - return FT_THROW( Invalid_Argument ); + if ( !face || !face->driver ) + return FT_THROW( Invalid_Face_Handle ); /* we don't need anything more complex than that; all size objects */ /* are already listed by the face */ @@ -3984,7 +4002,7 @@ FT_Get_Renderer( FT_Library library, FT_Glyph_Format format ) { - /* test for valid `library' delayed to FT_Lookup_Renderer() */ + /* test for valid `library' delayed to `FT_Lookup_Renderer' */ return FT_Lookup_Renderer( library, format, 0 ); } @@ -4001,12 +4019,26 @@ FT_ListNode node; FT_Error error = FT_Err_Ok; + FT_Renderer_SetModeFunc set_mode; + if ( !library ) - return FT_THROW( Invalid_Library_Handle ); + { + error = FT_THROW( Invalid_Library_Handle ); + goto Exit; + } if ( !renderer ) - return FT_THROW( Invalid_Argument ); + { + error = FT_THROW( Invalid_Argument ); + goto Exit; + } + + if ( num_params > 0 && !parameters ) + { + error = FT_THROW( Invalid_Argument ); + goto Exit; + } node = FT_List_Find( &library->renderers, renderer ); if ( !node ) @@ -4020,18 +4052,14 @@ if ( renderer->glyph_format == FT_GLYPH_FORMAT_OUTLINE ) library->cur_renderer = renderer; - if ( num_params > 0 ) - { - FT_Renderer_SetModeFunc set_mode = renderer->clazz->set_mode; - + set_mode = renderer->clazz->set_mode; - for ( ; num_params > 0; num_params-- ) - { - error = set_mode( renderer, parameters->tag, parameters->data ); - if ( error ) - break; - parameters++; - } + for ( ; num_params > 0; num_params-- ) + { + error = set_mode( renderer, parameters->tag, parameters->data ); + if ( error ) + break; + parameters++; } Exit: @@ -4090,7 +4118,11 @@ /* if we changed the current renderer for the glyph image format */ /* we need to select it as the next current one */ if ( !error && update && renderer ) - FT_Set_Renderer( library, renderer, 0, 0 ); + { + error = FT_Set_Renderer( library, renderer, 0, 0 ); + if ( error ) + break; + } } } @@ -4100,6 +4132,7 @@ #define FT_COMPONENT trace_bitmap /* we convert to a single bitmap format for computing the checksum */ + if ( !error ) { FT_Bitmap bitmap; FT_Error err; @@ -4107,6 +4140,7 @@ FT_Bitmap_New( &bitmap ); + /* this also converts the bitmap flow to `down' (i.e., pitch > 0) */ err = FT_Bitmap_Convert( library, &slot->bitmap, &bitmap, 1 ); if ( !err ) { @@ -4348,7 +4382,7 @@ FT_Get_Module( FT_Library library, const char* module_name ) { - FT_Module result = 0; + FT_Module result = NULL; FT_Module* cur; FT_Module* limit; @@ -4603,6 +4637,9 @@ FT_EXPORT_DEF( FT_Error ) FT_Reference_Library( FT_Library library ) { + if ( !library ) + return FT_THROW( Invalid_Library_Handle ); + library->refcount++; return FT_Err_Ok; @@ -4619,7 +4656,7 @@ FT_Error error; - if ( !memory ) + if ( !memory || !alibrary ) return FT_THROW( Invalid_Argument ); #ifdef FT_DEBUG_LEVEL_ERROR @@ -4881,6 +4918,8 @@ *p_arg1 = subg->arg1; *p_arg2 = subg->arg2; *p_transform = subg->transform; + + error = FT_Err_Ok; } return error; diff --git a/freetype/src/base/ftoutln.c b/freetype/src/base/ftoutln.c index 4a39dcd7c..8749d64ce 100644 --- a/freetype/src/base/ftoutln.c +++ b/freetype/src/base/ftoutln.c @@ -73,7 +73,10 @@ FT_Pos delta; - if ( !outline || !func_interface ) + if ( !outline ) + return FT_THROW( Invalid_Outline ); + + if ( !func_interface ) return FT_THROW( Invalid_Argument ); shift = func_interface->shift; @@ -362,7 +365,7 @@ /* empty glyph? */ if ( n_points == 0 && n_contours == 0 ) - return 0; + return FT_Err_Ok; /* check point and contour counts */ if ( n_points <= 0 || n_contours <= 0 ) @@ -384,7 +387,7 @@ goto Bad; /* XXX: check the tags array */ - return 0; + return FT_Err_Ok; } Bad: @@ -401,8 +404,10 @@ FT_Int is_owner; - if ( !source || !target || - source->n_points != target->n_points || + if ( !source || !target ) + return FT_THROW( Invalid_Outline ); + + if ( source->n_points != target->n_points || source->n_contours != target->n_contours ) return FT_THROW( Invalid_Argument ); @@ -430,20 +435,21 @@ FT_Outline_Done_Internal( FT_Memory memory, FT_Outline* outline ) { - if ( memory && outline ) - { - if ( outline->flags & FT_OUTLINE_OWNER ) - { - FT_FREE( outline->points ); - FT_FREE( outline->tags ); - FT_FREE( outline->contours ); - } - *outline = null_outline; + if ( !outline ) + return FT_THROW( Invalid_Outline ); - return FT_Err_Ok; - } - else + if ( !memory ) return FT_THROW( Invalid_Argument ); + + if ( outline->flags & FT_OUTLINE_OWNER ) + { + FT_FREE( outline->points ); + FT_FREE( outline->tags ); + FT_FREE( outline->contours ); + } + *outline = null_outline; + + return FT_Err_Ok; } @@ -614,7 +620,10 @@ if ( !library ) return FT_THROW( Invalid_Library_Handle ); - if ( !outline || !params ) + if ( !outline ) + return FT_THROW( Invalid_Outline ); + + if ( !params ) return FT_THROW( Invalid_Argument ); renderer = library->cur_renderer; @@ -643,7 +652,7 @@ /* if we changed the current renderer for the glyph image format */ /* we need to select it as the next current one */ if ( !error && update && renderer ) - FT_Set_Renderer( library, renderer, 0, 0 ); + error = FT_Set_Renderer( library, renderer, 0, 0 ); return error; } @@ -662,7 +671,7 @@ if ( !abitmap ) return FT_THROW( Invalid_Argument ); - /* other checks are delayed to FT_Outline_Render() */ + /* other checks are delayed to `FT_Outline_Render' */ params.target = abitmap; params.flags = 0; @@ -911,7 +920,7 @@ if ( !outline ) - return FT_THROW( Invalid_Argument ); + return FT_THROW( Invalid_Outline ); xstrength /= 2; ystrength /= 2; @@ -1045,6 +1054,10 @@ FT_Outline_Get_CBox( outline, &cbox ); + /* Handle collapsed outlines to avoid undefined FT_MSB. */ + if ( cbox.xMin == cbox.xMax || cbox.yMin == cbox.yMax ) + return FT_ORIENTATION_NONE; + xshift = FT_MSB( FT_ABS( cbox.xMax ) | FT_ABS( cbox.xMin ) ) - 14; xshift = FT_MAX( xshift, 0 ); diff --git a/freetype/src/base/ftpfr.c b/freetype/src/base/ftpfr.c index 0ba955f01..7425abe33 100644 --- a/freetype/src/base/ftpfr.c +++ b/freetype/src/base/ftpfr.c @@ -4,7 +4,7 @@ /* */ /* FreeType API for accessing PFR-specific data (body). */ /* */ -/* Copyright 2002-2004, 2008, 2010, 2013 by */ +/* Copyright 2002-2004, 2008, 2010, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -50,7 +50,7 @@ if ( !face ) - return FT_THROW( Invalid_Argument ); + return FT_THROW( Invalid_Face_Handle ); service = ft_pfr_check( face ); if ( service ) @@ -106,6 +106,9 @@ if ( !face ) + return FT_THROW( Invalid_Face_Handle ); + + if ( !avector ) return FT_THROW( Invalid_Argument ); service = ft_pfr_check( face ); @@ -130,11 +133,15 @@ FT_Service_PfrMetrics service; + if ( !face ) + return FT_THROW( Invalid_Face_Handle ); + + if ( !aadvance ) + return FT_THROW( Invalid_Argument ); + service = ft_pfr_check( face ); if ( service ) - { error = service->get_advance( face, gindex, aadvance ); - } else /* XXX: TODO: PROVIDE ADVANCE-LOADING METHOD TO ALL FONT DRIVERS */ error = FT_THROW( Invalid_Argument ); diff --git a/freetype/src/base/ftrfork.c b/freetype/src/base/ftrfork.c index 535297038..efe24d6ee 100644 --- a/freetype/src/base/ftrfork.c +++ b/freetype/src/base/ftrfork.c @@ -182,10 +182,10 @@ return error; FT_TRACE2(( "Resource tags: %c%c%c%c\n", - (char)( 0xff & ( tag_internal >> 24 ) ), - (char)( 0xff & ( tag_internal >> 16 ) ), - (char)( 0xff & ( tag_internal >> 8 ) ), - (char)( 0xff & ( tag_internal >> 0 ) ) )); + (char)( 0xFF & ( tag_internal >> 24 ) ), + (char)( 0xFF & ( tag_internal >> 16 ) ), + (char)( 0xFF & ( tag_internal >> 8 ) ), + (char)( 0xFF & ( tag_internal >> 0 ) ) )); FT_TRACE3(( " : subcount=%d, suboffset=0x%04x\n", subcnt, rpos )); diff --git a/freetype/src/base/ftstream.c b/freetype/src/base/ftstream.c index d965333da..759fd8fc0 100644 --- a/freetype/src/base/ftstream.c +++ b/freetype/src/base/ftstream.c @@ -728,9 +728,12 @@ FT_Byte* cursor; - if ( !fields || !stream ) + if ( !fields ) return FT_THROW( Invalid_Argument ); + if ( !stream ) + return FT_THROW( Invalid_Stream_Handle ); + cursor = stream->cursor; error = FT_Err_Ok; diff --git a/freetype/src/base/ftstroke.c b/freetype/src/base/ftstroke.c index ee61ceca0..5fc41fc8f 100644 --- a/freetype/src/base/ftstroke.c +++ b/freetype/src/base/ftstroke.c @@ -4,7 +4,7 @@ /* */ /* FreeType path stroker (body). */ /* */ -/* Copyright 2002-2006, 2008-2011, 2013 by */ +/* Copyright 2002-2006, 2008-2011, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -795,6 +795,9 @@ if ( !library ) + return FT_THROW( Invalid_Library_Handle ); + + if ( !astroker ) return FT_THROW( Invalid_Argument ); memory = library->memory; @@ -822,14 +825,17 @@ FT_Stroker_LineJoin line_join, FT_Fixed miter_limit ) { + if ( !stroker ) + return; + stroker->radius = radius; stroker->line_cap = line_cap; stroker->line_join = line_join; stroker->miter_limit = miter_limit; /* ensure miter limit has sensible value */ - if ( stroker->miter_limit < 0x10000 ) - stroker->miter_limit = 0x10000; + if ( stroker->miter_limit < 0x10000L ) + stroker->miter_limit = 0x10000L; /* save line join style: */ /* line join style can be temporarily changed when stroking curves */ @@ -1002,7 +1008,8 @@ FT_Tan( theta ) ) ); - intersect = FT_BOOL( stroker->line_length >= min_length && + intersect = FT_BOOL( min_length && + stroker->line_length >= min_length && line_length >= min_length ); } @@ -1287,6 +1294,9 @@ FT_Fixed line_length; + if ( !stroker || !to ) + return FT_THROW( Invalid_Argument ); + delta.x = to->x - stroker->center.x; delta.y = to->y - stroker->center.y; @@ -1360,6 +1370,12 @@ FT_Bool first_arc = TRUE; + if ( !stroker || !control || !to ) + { + error = FT_THROW( Invalid_Argument ); + goto Exit; + } + /* if all control points are coincident, this is a no-op; */ /* avoid creating a spurious corner */ if ( FT_IS_SMALL( stroker->center.x - control->x ) && @@ -1556,6 +1572,12 @@ FT_Bool first_arc = TRUE; + if ( !stroker || !control1 || !control2 || !to ) + { + error = FT_THROW( Invalid_Argument ); + goto Exit; + } + /* if all control points are coincident, this is a no-op; */ /* avoid creating a spurious corner */ if ( FT_IS_SMALL( stroker->center.x - control1->x ) && @@ -1758,6 +1780,9 @@ FT_Vector* to, FT_Bool open ) { + if ( !stroker || !to ) + return FT_THROW( Invalid_Argument ); + /* We cannot process the first point, because there is not enough */ /* information regarding its corner/cap. The latter will be processed */ /* in the `FT_Stroker_EndSubPath' routine. */ @@ -1858,6 +1883,12 @@ FT_Error error = FT_Err_Ok; + if ( !stroker ) + { + error = FT_THROW( Invalid_Argument ); + goto Exit; + } + if ( stroker->subpath_open ) { FT_StrokeBorder right = stroker->borders; @@ -1983,6 +2014,12 @@ FT_Error error; + if ( !stroker ) + { + error = FT_THROW( Invalid_Argument ); + goto Exit; + } + error = ft_stroke_border_get_counts( stroker->borders + 0, &count1, &count2 ); if ( error ) @@ -1997,8 +2034,12 @@ num_contours = count2 + count4; Exit: - *anum_points = num_points; - *anum_contours = num_contours; + if ( anum_points ) + *anum_points = num_points; + + if ( anum_contours ) + *anum_contours = num_contours; + return error; } @@ -2010,6 +2051,9 @@ FT_StrokerBorder border, FT_Outline* outline ) { + if ( !stroker || !outline ) + return; + if ( border == FT_STROKER_BORDER_LEFT || border == FT_STROKER_BORDER_RIGHT ) { @@ -2059,7 +2103,10 @@ FT_Int tag; /* current point's state */ - if ( !outline || !stroker ) + if ( !outline ) + return FT_THROW( Invalid_Outline ); + + if ( !stroker ) return FT_THROW( Invalid_Argument ); FT_Stroker_Rewind( stroker ); @@ -2258,18 +2305,20 @@ FT_Stroker stroker, FT_Bool destroy ) { - FT_Error error = FT_ERR( Invalid_Argument ); - FT_Glyph glyph = NULL; + FT_Error error = FT_ERR( Invalid_Argument ); + FT_Glyph glyph = NULL; + + /* for FT_OUTLINE_GLYPH_CLASS_GET (in PIC mode) */ FT_Library library = stroker->library; FT_UNUSED( library ); - if ( pglyph == NULL ) + if ( !pglyph ) goto Exit; glyph = *pglyph; - if ( glyph == NULL || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET ) + if ( !glyph || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET ) goto Exit; { @@ -2293,7 +2342,7 @@ if ( error ) goto Fail; - (void)FT_Stroker_GetCounts( stroker, &num_points, &num_contours ); + FT_Stroker_GetCounts( stroker, &num_points, &num_contours ); FT_Outline_Done( glyph->library, outline ); @@ -2334,18 +2383,20 @@ FT_Bool inside, FT_Bool destroy ) { - FT_Error error = FT_ERR( Invalid_Argument ); - FT_Glyph glyph = NULL; + FT_Error error = FT_ERR( Invalid_Argument ); + FT_Glyph glyph = NULL; + + /* for FT_OUTLINE_GLYPH_CLASS_GET (in PIC mode) */ FT_Library library = stroker->library; FT_UNUSED( library ); - if ( pglyph == NULL ) + if ( !pglyph ) goto Exit; glyph = *pglyph; - if ( glyph == NULL || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET ) + if ( !glyph || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET ) goto Exit; { @@ -2379,8 +2430,8 @@ if ( error ) goto Fail; - (void)FT_Stroker_GetBorderCounts( stroker, border, - &num_points, &num_contours ); + FT_Stroker_GetBorderCounts( stroker, border, + &num_points, &num_contours ); FT_Outline_Done( glyph->library, outline ); diff --git a/freetype/src/base/ftsynth.c b/freetype/src/base/ftsynth.c index 3098a60fa..0567bd537 100644 --- a/freetype/src/base/ftsynth.c +++ b/freetype/src/base/ftsynth.c @@ -4,7 +4,7 @@ /* */ /* FreeType synthesizing code for emboldening and slanting (body). */ /* */ -/* Copyright 2000-2006, 2010, 2012, 2013 by */ +/* Copyright 2000-2006, 2010, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -48,9 +48,14 @@ FT_GlyphSlot_Oblique( FT_GlyphSlot slot ) { FT_Matrix transform; - FT_Outline* outline = &slot->outline; + FT_Outline* outline; + if ( !slot ) + return; + + outline = &slot->outline; + /* only oblique outline glyphs */ if ( slot->format != FT_GLYPH_FORMAT_OUTLINE ) return; @@ -84,12 +89,18 @@ FT_EXPORT_DEF( void ) FT_GlyphSlot_Embolden( FT_GlyphSlot slot ) { - FT_Library library = slot->library; - FT_Face face = slot->face; + FT_Library library; + FT_Face face; FT_Error error; FT_Pos xstr, ystr; + if ( !slot ) + return; + + library = slot->library; + face = slot->face; + if ( slot->format != FT_GLYPH_FORMAT_OUTLINE && slot->format != FT_GLYPH_FORMAT_BITMAP ) return; @@ -100,10 +111,8 @@ ystr = xstr; if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) - { - /* ignore error */ - (void)FT_Outline_EmboldenXY( &slot->outline, xstr, ystr ); - } + FT_Outline_EmboldenXY( &slot->outline, xstr, ystr ); + else /* slot->format == FT_GLYPH_FORMAT_BITMAP */ { /* round to full pixels */ diff --git a/freetype/src/base/fttrigon.c b/freetype/src/base/fttrigon.c index 4ffdcb77f..22b7ecf1b 100644 --- a/freetype/src/base/fttrigon.c +++ b/freetype/src/base/fttrigon.c @@ -4,7 +4,7 @@ /* */ /* FreeType trigonometric functions (body). */ /* */ -/* Copyright 2001-2005, 2012-2013 by */ +/* Copyright 2001-2005, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -45,7 +45,7 @@ /* this table was generated for FT_PI = 180L << 16, i.e. degrees */ #define FT_TRIG_MAX_ITERS 23 - static const FT_Fixed + static const FT_Angle ft_trig_arctan_table[] = { 1740967L, 919879L, 466945L, 234379L, 117304L, 58666L, 29335L, @@ -60,17 +60,20 @@ static FT_Fixed ft_trig_downscale( FT_Fixed val ) { - FT_Fixed s; - FT_Int64 v; + FT_Int s = 1; - s = val; - val = FT_ABS( val ); + if ( val < 0 ) + { + val = -val; + s = -1; + } - v = ( val * (FT_Int64)FT_TRIG_SCALE ) + 0x100000000UL; - val = (FT_Fixed)( v >> 32 ); + /* 0x40000000 comes from regression analysis between true */ + /* and CORDIC hypotenuse, so it minimizes the error */ + val = (FT_Fixed)( ( (FT_Int64)val * FT_TRIG_SCALE + 0x40000000UL ) >> 32 ); - return ( s >= 0 ) ? val : -val; + return s < 0 ? -val : val; } #else /* !FT_LONG64 */ @@ -79,38 +82,53 @@ static FT_Fixed ft_trig_downscale( FT_Fixed val ) { - FT_Fixed s; - FT_UInt32 v1, v2, k1, k2, hi, lo1, lo2, lo3; + FT_Int s = 1; + FT_UInt32 lo1, hi1, lo2, hi2, lo, hi, i1, i2; + + + if ( val < 0 ) + { + val = -val; + s = -1; + } + lo1 = val & 0x0000FFFFU; + hi1 = val >> 16; + lo2 = FT_TRIG_SCALE & 0x0000FFFFU; + hi2 = FT_TRIG_SCALE >> 16; - s = val; - val = FT_ABS( val ); + lo = lo1 * lo2; + i1 = lo1 * hi2; + i2 = lo2 * hi1; + hi = hi1 * hi2; - v1 = (FT_UInt32)val >> 16; - v2 = (FT_UInt32)( val & 0xFFFFL ); + /* Check carry overflow of i1 + i2 */ + i1 += i2; + hi += (FT_UInt32)( i1 < i2 ) << 16; - k1 = (FT_UInt32)FT_TRIG_SCALE >> 16; /* constant */ - k2 = (FT_UInt32)( FT_TRIG_SCALE & 0xFFFFL ); /* constant */ + hi += i1 >> 16; + i1 = i1 << 16; - hi = k1 * v1; - lo1 = k1 * v2 + k2 * v1; /* can't overflow */ + /* Check carry overflow of i1 + lo */ + lo += i1; + hi += ( lo < i1 ); - lo2 = ( k2 * v2 ) >> 16; - lo3 = FT_MAX( lo1, lo2 ); - lo1 += lo2; + /* 0x40000000 comes from regression analysis between true */ + /* and CORDIC hypotenuse, so it minimizes the error */ - hi += lo1 >> 16; - if ( lo1 < lo3 ) - hi += (FT_UInt32)0x10000UL; + /* Check carry overflow of lo + 0x40000000 */ + lo += 0x40000000UL; + hi += ( lo < 0x40000000UL ); val = (FT_Fixed)hi; - return ( s >= 0 ) ? val : -val; + return s < 0 ? -val : val; } #endif /* !FT_LONG64 */ + /* undefined and never called for zero vector */ static FT_Int ft_trig_prenorm( FT_Vector* vec ) { @@ -147,7 +165,7 @@ { FT_Int i; FT_Fixed x, y, xtemp, b; - const FT_Fixed *arctanptr; + const FT_Angle *arctanptr; x = vec->x; @@ -202,7 +220,7 @@ FT_Angle theta; FT_Int i; FT_Fixed x, y, xtemp, b; - const FT_Fixed *arctanptr; + const FT_Angle *arctanptr; x = vec->x; @@ -261,11 +279,12 @@ } } - /* round theta */ + /* round theta to acknowledge its error that mostly comes */ + /* from accumulated rounding errors in the arctan table */ if ( theta >= 0 ) - theta = FT_PAD_ROUND( theta, 32 ); + theta = FT_PAD_ROUND( theta, 16 ); else - theta = -FT_PAD_ROUND( -theta, 32 ); + theta = -FT_PAD_ROUND( -theta, 16 ); vec->x = x; vec->y = theta; @@ -340,6 +359,9 @@ FT_Vector_Unit( FT_Vector* vec, FT_Angle angle ) { + if ( !vec ) + return; + vec->x = FT_TRIG_SCALE >> 8; vec->y = 0; ft_trig_pseudo_rotate( vec, angle ); @@ -366,6 +388,9 @@ FT_Vector v; + if ( !vec ) + return; + v.x = vec->x; v.y = vec->y; @@ -403,6 +428,9 @@ FT_Vector v; + if ( !vec ) + return 0; + v = *vec; /* handle trivial cases */ @@ -439,6 +467,9 @@ FT_Vector v; + if ( !vec || !length || !angle ) + return; + v = *vec; if ( v.x == 0 && v.y == 0 ) @@ -449,8 +480,8 @@ v.x = ft_trig_downscale( v.x ); - *length = ( shift >= 0 ) ? ( v.x >> shift ) - : (FT_Fixed)( (FT_UInt32)v.x << -shift ); + *length = shift >= 0 ? ( v.x >> shift ) + : (FT_Fixed)( (FT_UInt32)v.x << -shift ); *angle = v.y; } @@ -462,6 +493,9 @@ FT_Fixed length, FT_Angle angle ) { + if ( !vec ) + return; + vec->x = length; vec->y = 0; diff --git a/freetype/src/base/fttype1.c b/freetype/src/base/fttype1.c index c1f9931db..47af19afb 100644 --- a/freetype/src/base/fttype1.c +++ b/freetype/src/base/fttype1.c @@ -4,7 +4,7 @@ /* */ /* FreeType utility file for PS names support (body). */ /* */ -/* Copyright 2002-2004, 2011 by */ +/* Copyright 2002-2004, 2011, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -17,6 +17,7 @@ #include +#include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_SERVICE_H #include FT_SERVICE_POSTSCRIPT_INFO_H @@ -28,19 +29,22 @@ FT_Get_PS_Font_Info( FT_Face face, PS_FontInfoRec* afont_info ) { - FT_Error error = FT_ERR( Invalid_Argument ); + FT_Error error; + FT_Service_PsInfo service; - if ( face ) - { - FT_Service_PsInfo service = NULL; + if ( !face ) + return FT_THROW( Invalid_Face_Handle ); + if ( !afont_info ) + return FT_THROW( Invalid_Argument ); - FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO ); + FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO ); - if ( service && service->ps_get_font_info ) - error = service->ps_get_font_info( face, afont_info ); - } + if ( service && service->ps_get_font_info ) + error = service->ps_get_font_info( face, afont_info ); + else + error = FT_THROW( Invalid_Argument ); return error; } @@ -51,8 +55,8 @@ FT_EXPORT_DEF( FT_Int ) FT_Has_PS_Glyph_Names( FT_Face face ) { - FT_Int result = 0; - FT_Service_PsInfo service = NULL; + FT_Int result = 0; + FT_Service_PsInfo service; if ( face ) @@ -73,19 +77,22 @@ FT_Get_PS_Font_Private( FT_Face face, PS_PrivateRec* afont_private ) { - FT_Error error = FT_ERR( Invalid_Argument ); + FT_Error error; + FT_Service_PsInfo service; - if ( face ) - { - FT_Service_PsInfo service = NULL; + if ( !face ) + return FT_THROW( Invalid_Face_Handle ); + if ( !afont_private ) + return FT_THROW( Invalid_Argument ); - FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO ); + FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO ); - if ( service && service->ps_get_font_private ) - error = service->ps_get_font_private( face, afont_private ); - } + if ( service && service->ps_get_font_private ) + error = service->ps_get_font_private( face, afont_private ); + else + error = FT_THROW( Invalid_Argument ); return error; } diff --git a/freetype/src/base/ftutil.c b/freetype/src/base/ftutil.c index 879d02752..56e2800eb 100644 --- a/freetype/src/base/ftutil.c +++ b/freetype/src/base/ftutil.c @@ -245,6 +245,9 @@ FT_ListNode cur; + if ( !list ) + return NULL; + cur = list->head; while ( cur ) { @@ -254,7 +257,7 @@ cur = cur->next; } - return (FT_ListNode)0; + return NULL; } @@ -264,8 +267,13 @@ FT_List_Add( FT_List list, FT_ListNode node ) { - FT_ListNode before = list->tail; + FT_ListNode before; + + + if ( !list || !node ) + return; + before = list->tail; node->next = 0; node->prev = before; @@ -285,8 +293,13 @@ FT_List_Insert( FT_List list, FT_ListNode node ) { - FT_ListNode after = list->head; + FT_ListNode after; + + + if ( !list || !node ) + return; + after = list->head; node->next = after; node->prev = 0; @@ -309,6 +322,9 @@ FT_ListNode before, after; + if ( !list || !node ) + return; + before = node->prev; after = node->next; @@ -333,6 +349,9 @@ FT_ListNode before, after; + if ( !list || !node ) + return; + before = node->prev; after = node->next; @@ -357,14 +376,19 @@ /* documentation is in ftlist.h */ FT_EXPORT_DEF( FT_Error ) - FT_List_Iterate( FT_List list, - FT_List_Iterator iterator, - void* user ) + FT_List_Iterate( FT_List list, + FT_List_Iterator iterator, + void* user ) { - FT_ListNode cur = list->head; + FT_ListNode cur; FT_Error error = FT_Err_Ok; + if ( !list || !iterator ) + return FT_THROW( Invalid_Argument ); + + cur = list->head; + while ( cur ) { FT_ListNode next = cur->next; @@ -392,6 +416,9 @@ FT_ListNode cur; + if ( !list || !memory ) + return; + cur = list->head; while ( cur ) { @@ -411,26 +438,4 @@ } - FT_BASE_DEF( FT_UInt32 ) - ft_highpow2( FT_UInt32 value ) - { - FT_UInt32 value2; - - - /* - * We simply clear the lowest bit in each iteration. When - * we reach 0, we know that the previous value was our result. - */ - for ( ;; ) - { - value2 = value & (value - 1); /* clear lowest bit */ - if ( value2 == 0 ) - break; - - value = value2; - } - return value; - } - - /* END */ diff --git a/freetype/src/base/ftwinfnt.c b/freetype/src/base/ftwinfnt.c index 463ae761d..8e337fbe5 100644 --- a/freetype/src/base/ftwinfnt.c +++ b/freetype/src/base/ftwinfnt.c @@ -4,7 +4,7 @@ /* */ /* FreeType API for accessing Windows FNT specific info (body). */ /* */ -/* Copyright 2003, 2004 by */ +/* Copyright 2003, 2004, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -17,6 +17,7 @@ #include +#include FT_INTERNAL_DEBUG_H #include FT_WINFONTS_H #include FT_INTERNAL_OBJECTS_H #include FT_SERVICE_WINFNT_H @@ -32,17 +33,18 @@ FT_Error error; - error = FT_ERR( Invalid_Argument ); + if ( !face ) + return FT_THROW( Invalid_Face_Handle ); - if ( face != NULL ) - { - FT_FACE_LOOKUP_SERVICE( face, service, WINFNT ); + if ( !header ) + return FT_THROW( Invalid_Argument ); - if ( service != NULL ) - { - error = service->get_header( face, header ); - } - } + FT_FACE_LOOKUP_SERVICE( face, service, WINFNT ); + + if ( service ) + error = service->get_header( face, header ); + else + error = FT_THROW( Invalid_Argument ); return error; } diff --git a/freetype/src/bdf/bdfdrivr.c b/freetype/src/bdf/bdfdrivr.c index 5a1c296fd..55a428c1b 100644 --- a/freetype/src/bdf/bdfdrivr.c +++ b/freetype/src/bdf/bdfdrivr.c @@ -182,7 +182,7 @@ THE SOFTWARE. } - FT_CALLBACK_TABLE_DEF + static const FT_CMap_ClassRec bdf_cmap_class = { sizeof ( BDF_CMapRec ), @@ -384,7 +384,7 @@ THE SOFTWARE. BDF_Face_Done( bdfface ); return FT_THROW( Invalid_Argument ); } - + { bdf_property_t* prop = NULL; @@ -679,7 +679,13 @@ THE SOFTWARE. FT_UNUSED( load_flags ); - if ( !face || glyph_index >= (FT_UInt)face->num_glyphs ) + if ( !face ) + { + error = FT_THROW( Invalid_Face_Handle ); + goto Exit; + } + + if ( glyph_index >= (FT_UInt)face->num_glyphs ) { error = FT_THROW( Invalid_Argument ); goto Exit; diff --git a/freetype/src/bdf/bdflib.c b/freetype/src/bdf/bdflib.c index 2eda11cd9..abcfdee7b 100644 --- a/freetype/src/bdf/bdflib.c +++ b/freetype/src/bdf/bdflib.c @@ -169,6 +169,18 @@ sizeof ( _bdf_properties[0] ); + /* An auxiliary macro to parse properties, to be used in conditionals. */ + /* It behaves like `strncmp' but also tests the following character */ + /* whether it is a whitespace or NULL. */ + /* `property' is a constant string of length `n' to compare with. */ +#define _bdf_strncmp( name, property, n ) \ + ( ft_strncmp( name, property, n ) || \ + !( name[n] == ' ' || \ + name[n] == '\0' || \ + name[n] == '\n' || \ + name[n] == '\r' || \ + name[n] == '\t' ) ) + /* Auto correction messages. */ #define ACMSG1 "FONT_ASCENT property missing. " \ "Added `FONT_ASCENT %hd'.\n" @@ -769,8 +781,8 @@ hold = buf[end]; buf[end] = 0; - /* XXX: Use encoding independent value for 0x1a */ - if ( buf[start] != '#' && buf[start] != 0x1a && end > start ) + /* XXX: Use encoding independent value for 0x1A */ + if ( buf[start] != '#' && buf[start] != 0x1A && end > start ) { error = (*cb)( buf + start, (unsigned long)( end - start ), lineno, (void*)&cb, client_data ); @@ -811,17 +823,17 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static const unsigned char odigits[32] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -829,7 +841,7 @@ static const unsigned char ddigits[32] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -837,8 +849,8 @@ static const unsigned char hdigits[32] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, - 0x7e, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03, + 0x7E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; @@ -1408,7 +1420,7 @@ /* If the property happens to be a comment, then it doesn't need */ /* to be added to the internal hash table. */ - if ( ft_strncmp( name, "COMMENT", 7 ) != 0 ) + if ( _bdf_strncmp( name, "COMMENT", 7 ) != 0 ) { /* Add the property to the font property table. */ error = hash_insert( fp->name, @@ -1426,13 +1438,13 @@ /* FONT_ASCENT and FONT_DESCENT need to be assigned if they are */ /* present, and the SPACING property should override the default */ /* spacing. */ - if ( ft_strncmp( name, "DEFAULT_CHAR", 12 ) == 0 ) + if ( _bdf_strncmp( name, "DEFAULT_CHAR", 12 ) == 0 ) font->default_char = fp->value.l; - else if ( ft_strncmp( name, "FONT_ASCENT", 11 ) == 0 ) + else if ( _bdf_strncmp( name, "FONT_ASCENT", 11 ) == 0 ) font->font_ascent = fp->value.l; - else if ( ft_strncmp( name, "FONT_DESCENT", 12 ) == 0 ) + else if ( _bdf_strncmp( name, "FONT_DESCENT", 12 ) == 0 ) font->font_descent = fp->value.l; - else if ( ft_strncmp( name, "SPACING", 7 ) == 0 ) + else if ( _bdf_strncmp( name, "SPACING", 7 ) == 0 ) { if ( !fp->value.atom ) { @@ -1490,7 +1502,7 @@ memory = font->memory; /* Check for a comment. */ - if ( ft_strncmp( line, "COMMENT", 7 ) == 0 ) + if ( _bdf_strncmp( line, "COMMENT", 7 ) == 0 ) { linelen -= 7; @@ -1507,7 +1519,7 @@ /* The very first thing expected is the number of glyphs. */ if ( !( p->flags & _BDF_GLYPHS ) ) { - if ( ft_strncmp( line, "CHARS", 5 ) != 0 ) + if ( _bdf_strncmp( line, "CHARS", 5 ) != 0 ) { FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "CHARS" )); error = FT_THROW( Missing_Chars_Field ); @@ -1541,8 +1553,16 @@ } /* Check for the ENDFONT field. */ - if ( ft_strncmp( line, "ENDFONT", 7 ) == 0 ) + if ( _bdf_strncmp( line, "ENDFONT", 7 ) == 0 ) { + if ( p->flags & _BDF_GLYPH_BITS ) + { + /* Missing ENDCHAR field. */ + FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENDCHAR" )); + error = FT_THROW( Corrupted_Font_Glyphs ); + goto Exit; + } + /* Sort the glyphs by encoding. */ ft_qsort( (char *)font->glyphs, font->glyphs_used, @@ -1555,7 +1575,7 @@ } /* Check for the ENDCHAR field. */ - if ( ft_strncmp( line, "ENDCHAR", 7 ) == 0 ) + if ( _bdf_strncmp( line, "ENDCHAR", 7 ) == 0 ) { p->glyph_enc = 0; p->flags &= ~_BDF_GLYPH_BITS; @@ -1571,7 +1591,7 @@ goto Exit; /* Check for the STARTCHAR field. */ - if ( ft_strncmp( line, "STARTCHAR", 9 ) == 0 ) + if ( _bdf_strncmp( line, "STARTCHAR", 9 ) == 0 ) { /* Set the character name in the parse info first until the */ /* encoding can be checked for an unencoded character. */ @@ -1605,7 +1625,7 @@ } /* Check for the ENCODING field. */ - if ( ft_strncmp( line, "ENCODING", 8 ) == 0 ) + if ( _bdf_strncmp( line, "ENCODING", 8 ) == 0 ) { if ( !( p->flags & _BDF_GLYPH ) ) { @@ -1791,7 +1811,7 @@ } /* Expect the SWIDTH (scalable width) field next. */ - if ( ft_strncmp( line, "SWIDTH", 6 ) == 0 ) + if ( _bdf_strncmp( line, "SWIDTH", 6 ) == 0 ) { if ( !( p->flags & _BDF_ENCODING ) ) goto Missing_Encoding; @@ -1807,7 +1827,7 @@ } /* Expect the DWIDTH (scalable width) field next. */ - if ( ft_strncmp( line, "DWIDTH", 6 ) == 0 ) + if ( _bdf_strncmp( line, "DWIDTH", 6 ) == 0 ) { if ( !( p->flags & _BDF_ENCODING ) ) goto Missing_Encoding; @@ -1835,7 +1855,7 @@ } /* Expect the BBX field next. */ - if ( ft_strncmp( line, "BBX", 3 ) == 0 ) + if ( _bdf_strncmp( line, "BBX", 3 ) == 0 ) { if ( !( p->flags & _BDF_ENCODING ) ) goto Missing_Encoding; @@ -1903,7 +1923,7 @@ } /* And finally, gather up the bitmap. */ - if ( ft_strncmp( line, "BITMAP", 6 ) == 0 ) + if ( _bdf_strncmp( line, "BITMAP", 6 ) == 0 ) { unsigned long bitmap_size; @@ -1978,7 +1998,7 @@ p = (_bdf_parse_t *) client_data; /* Check for the end of the properties. */ - if ( ft_strncmp( line, "ENDPROPERTIES", 13 ) == 0 ) + if ( _bdf_strncmp( line, "ENDPROPERTIES", 13 ) == 0 ) { /* If the FONT_ASCENT or FONT_DESCENT properties have not been */ /* encountered yet, then make sure they are added as properties and */ @@ -2019,12 +2039,12 @@ } /* Ignore the _XFREE86_GLYPH_RANGES properties. */ - if ( ft_strncmp( line, "_XFREE86_GLYPH_RANGES", 21 ) == 0 ) + if ( _bdf_strncmp( line, "_XFREE86_GLYPH_RANGES", 21 ) == 0 ) goto Exit; /* Handle COMMENT fields and properties in a special way to preserve */ /* the spacing. */ - if ( ft_strncmp( line, "COMMENT", 7 ) == 0 ) + if ( _bdf_strncmp( line, "COMMENT", 7 ) == 0 ) { name = value = line; value += 7; @@ -2088,7 +2108,7 @@ /* Check for a comment. This is done to handle those fonts that have */ /* comments before the STARTFONT line for some reason. */ - if ( ft_strncmp( line, "COMMENT", 7 ) == 0 ) + if ( _bdf_strncmp( line, "COMMENT", 7 ) == 0 ) { if ( p->opts->keep_comments != 0 && p->font != 0 ) { @@ -2114,7 +2134,7 @@ { memory = p->memory; - if ( ft_strncmp( line, "STARTFONT", 9 ) != 0 ) + if ( _bdf_strncmp( line, "STARTFONT", 9 ) != 0 ) { /* we don't emit an error message since this code gets */ /* explicitly caught one level higher */ @@ -2162,7 +2182,7 @@ } /* Check for the start of the properties. */ - if ( ft_strncmp( line, "STARTPROPERTIES", 15 ) == 0 ) + if ( _bdf_strncmp( line, "STARTPROPERTIES", 15 ) == 0 ) { if ( !( p->flags & _BDF_FONT_BBX ) ) { @@ -2191,7 +2211,7 @@ } /* Check for the FONTBOUNDINGBOX field. */ - if ( ft_strncmp( line, "FONTBOUNDINGBOX", 15 ) == 0 ) + if ( _bdf_strncmp( line, "FONTBOUNDINGBOX", 15 ) == 0 ) { if ( !( p->flags & _BDF_SIZE ) ) { @@ -2222,7 +2242,7 @@ } /* The next thing to check for is the FONT field. */ - if ( ft_strncmp( line, "FONT", 4 ) == 0 ) + if ( _bdf_strncmp( line, "FONT", 4 ) == 0 ) { error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); if ( error ) @@ -2257,7 +2277,7 @@ } /* Check for the SIZE field. */ - if ( ft_strncmp( line, "SIZE", 4 ) == 0 ) + if ( _bdf_strncmp( line, "SIZE", 4 ) == 0 ) { if ( !( p->flags & _BDF_FONT_NAME ) ) { @@ -2311,7 +2331,7 @@ } /* Check for the CHARS field -- font properties are optional */ - if ( ft_strncmp( line, "CHARS", 5 ) == 0 ) + if ( _bdf_strncmp( line, "CHARS", 5 ) == 0 ) { char nbuf[128]; diff --git a/freetype/src/bzip2/ftbzip2.c b/freetype/src/bzip2/ftbzip2.c index 749413027..7e406b161 100644 --- a/freetype/src/bzip2/ftbzip2.c +++ b/freetype/src/bzip2/ftbzip2.c @@ -8,7 +8,7 @@ /* parse compressed PCF fonts, as found with many X11 server */ /* distributions. */ /* */ -/* Copyright 2010, 2012, 2013 by */ +/* Copyright 2010, 2012-2014 by */ /* Joel Klinghed. */ /* */ /* Based on src/gzip/ftgzip.c, Copyright 2002 - 2010 by */ @@ -131,7 +131,7 @@ /* head[0] && head[1] are the magic numbers; */ /* head[2] is the version, and head[3] the blocksize */ if ( head[0] != 0x42 || - head[1] != 0x5a || + head[1] != 0x5A || head[2] != 0x68 ) /* only support bzip2 (huffman) */ { error = FT_THROW( Invalid_File_Format ); @@ -456,10 +456,18 @@ FT_Stream source ) { FT_Error error; - FT_Memory memory = source->memory; + FT_Memory memory; FT_BZip2File zip = NULL; + if ( !stream || !source ) + { + error = FT_THROW( Invalid_Stream_Handle ); + goto Exit; + } + + memory = source->memory; + /* * check the header right now; this prevents allocating unnecessary * objects when we don't need them diff --git a/freetype/src/cache/ftcbasic.c b/freetype/src/cache/ftcbasic.c index 84d336d5d..6bad39d91 100644 --- a/freetype/src/cache/ftcbasic.c +++ b/freetype/src/cache/ftcbasic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType basic cache interface (body). */ /* */ -/* Copyright 2003-2007, 2009-2011, 2013 by */ +/* Copyright 2003-2007, 2009-2011, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -110,10 +110,9 @@ return result; if ( (FT_ULong)face->num_glyphs > FT_UINT_MAX || 0 > face->num_glyphs ) - { - FT_TRACE1(( "ftc_basic_family_get_count: too large number of glyphs " )); - FT_TRACE1(( "in this face, truncated\n", face->num_glyphs )); - } + FT_TRACE1(( "ftc_basic_family_get_count:" + " too large number of glyphs in this face, truncated\n", + face->num_glyphs )); if ( !error ) result = (FT_UInt)face->num_glyphs; @@ -229,7 +228,7 @@ * */ - FT_CALLBACK_TABLE_DEF + static const FTC_IFamilyClassRec ftc_basic_image_family_class = { { @@ -243,7 +242,7 @@ }; - FT_CALLBACK_TABLE_DEF + static const FTC_GCacheClassRec ftc_basic_image_cache_class = { { @@ -287,7 +286,7 @@ FT_PtrDist hash; - /* some argument checks are delayed to FTC_Cache_Lookup */ + /* some argument checks are delayed to `FTC_Cache_Lookup' */ if ( !aglyph ) { error = FT_THROW( Invalid_Argument ); @@ -298,18 +297,15 @@ if ( anode ) *anode = NULL; - { - if ( (FT_ULong)(type->flags - FT_INT_MIN) > FT_UINT_MAX ) - { - FT_TRACE1(( "FTC_ImageCache_Lookup: higher bits in load_flags" )); - FT_TRACE1(( "0x%x are dropped\n", (type->flags & ~((FT_ULong)FT_UINT_MAX)) )); - } + if ( (FT_ULong)( type->flags - FT_INT_MIN ) > FT_UINT_MAX ) + FT_TRACE1(( "FTC_ImageCache_Lookup:" + " higher bits in load_flags 0x%x are dropped\n", + type->flags & ~((FT_ULong)FT_UINT_MAX) )); - query.attrs.scaler.face_id = type->face_id; - query.attrs.scaler.width = type->width; - query.attrs.scaler.height = type->height; - query.attrs.load_flags = (FT_UInt)type->flags; - } + query.attrs.scaler.face_id = type->face_id; + query.attrs.scaler.width = type->width; + query.attrs.scaler.height = type->height; + query.attrs.load_flags = (FT_UInt)type->flags; query.attrs.scaler.pixel = 1; query.attrs.scaler.x_res = 0; /* make compilers happy */ @@ -363,7 +359,7 @@ FT_PtrDist hash; - /* some argument checks are delayed to FTC_Cache_Lookup */ + /* some argument checks are delayed to `FTC_Cache_Lookup' */ if ( !aglyph || !scaler ) { error = FT_THROW( Invalid_Argument ); @@ -374,12 +370,11 @@ if ( anode ) *anode = NULL; - /* FT_Load_Glyph(), FT_Load_Char() take FT_UInt flags */ + /* `FT_Load_Glyph' and `FT_Load_Char' take FT_UInt flags */ if ( load_flags > FT_UINT_MAX ) - { - FT_TRACE1(( "FTC_ImageCache_LookupScaler: higher bits in load_flags" )); - FT_TRACE1(( "0x%x are dropped\n", (load_flags & ~((FT_ULong)FT_UINT_MAX)) )); - } + FT_TRACE1(( "FTC_ImageCache_LookupScaler:" + " higher bits in load_flags 0x%x are dropped\n", + load_flags & ~((FT_ULong)FT_UINT_MAX) )); query.attrs.scaler = scaler[0]; query.attrs.load_flags = (FT_UInt)load_flags; @@ -415,7 +410,7 @@ * */ - FT_CALLBACK_TABLE_DEF + static const FTC_SFamilyClassRec ftc_basic_sbit_family_class = { { @@ -430,7 +425,7 @@ }; - FT_CALLBACK_TABLE_DEF + static const FTC_GCacheClassRec ftc_basic_sbit_cache_class = { { @@ -477,24 +472,21 @@ if ( anode ) *anode = NULL; - /* other argument checks delayed to FTC_Cache_Lookup */ + /* other argument checks delayed to `FTC_Cache_Lookup' */ if ( !ansbit ) return FT_THROW( Invalid_Argument ); *ansbit = NULL; - { - if ( (FT_ULong)(type->flags - FT_INT_MIN) > FT_UINT_MAX ) - { - FT_TRACE1(( "FTC_ImageCache_Lookup: higher bits in load_flags" )); - FT_TRACE1(( "0x%x are dropped\n", (type->flags & ~((FT_ULong)FT_UINT_MAX)) )); - } + if ( (FT_ULong)( type->flags - FT_INT_MIN ) > FT_UINT_MAX ) + FT_TRACE1(( "FTC_ImageCache_Lookup:" + " higher bits in load_flags 0x%x are dropped\n", + type->flags & ~((FT_ULong)FT_UINT_MAX) )); - query.attrs.scaler.face_id = type->face_id; - query.attrs.scaler.width = type->width; - query.attrs.scaler.height = type->height; - query.attrs.load_flags = (FT_UInt)type->flags; - } + query.attrs.scaler.face_id = type->face_id; + query.attrs.scaler.width = type->width; + query.attrs.scaler.height = type->height; + query.attrs.load_flags = (FT_UInt)type->flags; query.attrs.scaler.pixel = 1; query.attrs.scaler.x_res = 0; /* make compilers happy */ @@ -555,18 +547,17 @@ if ( anode ) *anode = NULL; - /* other argument checks delayed to FTC_Cache_Lookup */ + /* other argument checks delayed to `FTC_Cache_Lookup' */ if ( !ansbit || !scaler ) return FT_THROW( Invalid_Argument ); *ansbit = NULL; - /* FT_Load_Glyph(), FT_Load_Char() take FT_UInt flags */ + /* `FT_Load_Glyph' and `FT_Load_Char' take FT_UInt flags */ if ( load_flags > FT_UINT_MAX ) - { - FT_TRACE1(( "FTC_ImageCache_LookupScaler: higher bits in load_flags" )); - FT_TRACE1(( "0x%x are dropped\n", (load_flags & ~((FT_ULong)FT_UINT_MAX)) )); - } + FT_TRACE1(( "FTC_ImageCache_LookupScaler:" + " higher bits in load_flags 0x%x are dropped\n", + load_flags & ~((FT_ULong)FT_UINT_MAX) )); query.attrs.scaler = scaler[0]; query.attrs.load_flags = (FT_UInt)load_flags; diff --git a/freetype/src/cache/ftccmap.c b/freetype/src/cache/ftccmap.c index 848349be2..ab223663b 100644 --- a/freetype/src/cache/ftccmap.c +++ b/freetype/src/cache/ftccmap.c @@ -4,7 +4,7 @@ /* */ /* FreeType CharMap cache (body) */ /* */ -/* Copyright 2000-2013 by */ +/* Copyright 2000-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -202,7 +202,7 @@ /*************************************************************************/ - FT_CALLBACK_TABLE_DEF + static const FTC_CacheClassRec ftc_cmap_cache_class = { ftc_cmap_node_new, @@ -263,6 +263,9 @@ return 0; } + if ( !face_id ) + return 0; + query.face_id = face_id; query.cmap_index = (FT_UInt)cmap_index; query.char_code = char_code; @@ -301,12 +304,6 @@ if ( error ) goto Exit; -#ifdef FT_MAX_CHARMAP_CACHEABLE - /* something rotten can happen with rogue clients */ - if ( cmap_index > FT_MAX_CHARMAP_CACHEABLE ) - return 0; /* XXX: should return appropriate error */ -#endif - if ( (FT_UInt)cmap_index < (FT_UInt)face->num_charmaps ) { FT_CharMap old, cmap = NULL; diff --git a/freetype/src/cache/ftcmanag.c b/freetype/src/cache/ftcmanag.c index 4eb2c5bfd..fff7a0882 100644 --- a/freetype/src/cache/ftcmanag.c +++ b/freetype/src/cache/ftcmanag.c @@ -4,7 +4,7 @@ /* */ /* FreeType Cache Manager (body). */ /* */ -/* Copyright 2000-2006, 2008-2010, 2013 by */ +/* Copyright 2000-2006, 2008-2010, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -151,7 +151,7 @@ } - FT_CALLBACK_TABLE_DEF + static const FTC_MruListClassRec ftc_size_list_class = { sizeof ( FTC_SizeNodeRec ), @@ -186,7 +186,7 @@ FTC_MruNode mrunode; - if ( asize == NULL ) + if ( !asize || !scaler ) return FT_THROW( Invalid_Argument ); *asize = NULL; @@ -290,7 +290,7 @@ } - FT_CALLBACK_TABLE_DEF + static const FTC_MruListClassRec ftc_face_list_class = { sizeof ( FTC_FaceNodeRec), @@ -313,7 +313,7 @@ FTC_MruNode mrunode; - if ( aface == NULL ) + if ( !aface || !face_id ) return FT_THROW( Invalid_Argument ); *aface = NULL; @@ -366,6 +366,9 @@ if ( !library ) return FT_THROW( Invalid_Library_Handle ); + if ( !amanager || !requester ) + return FT_THROW( Invalid_Argument ); + memory = library->memory; if ( FT_NEW( manager ) ) @@ -451,11 +454,11 @@ FT_EXPORT_DEF( void ) FTC_Manager_Reset( FTC_Manager manager ) { - if ( manager ) - { - FTC_MruList_Reset( &manager->sizes ); - FTC_MruList_Reset( &manager->faces ); - } + if ( !manager ) + return; + + FTC_MruList_Reset( &manager->sizes ); + FTC_MruList_Reset( &manager->faces ); FTC_Manager_FlushN( manager, manager->num_nodes ); } @@ -667,6 +670,10 @@ { FT_UInt nn; + + if ( !manager || !face_id ) + return; + /* this will remove all FTC_SizeNode that correspond to * the face_id as well */ @@ -685,7 +692,9 @@ FTC_Node_Unref( FTC_Node node, FTC_Manager manager ) { - if ( node && (FT_UInt)node->cache_index < manager->num_caches ) + if ( node && + manager && + (FT_UInt)node->cache_index < manager->num_caches ) node->ref_count--; } diff --git a/freetype/src/cache/ftcsbits.c b/freetype/src/cache/ftcsbits.c index 6df1c1993..59727d16e 100644 --- a/freetype/src/cache/ftcsbits.c +++ b/freetype/src/cache/ftcsbits.c @@ -4,7 +4,7 @@ /* */ /* FreeType sbits manager (body). */ /* */ -/* Copyright 2000-2006, 2009-2011, 2013 by */ +/* Copyright 2000-2006, 2009-2011, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -142,12 +142,12 @@ goto BadGlyph; } - /* Check that our values fit into 8-bit containers! */ + /* Check whether our values fit into 8-bit containers! */ /* If this is not the case, our bitmap is too large */ /* and we will leave it as `missing' with sbit.buffer = 0 */ -#define CHECK_CHAR( d ) ( temp = (FT_Char)d, temp == d ) -#define CHECK_BYTE( d ) ( temp = (FT_Byte)d, temp == d ) +#define CHECK_CHAR( d ) ( temp = (FT_Char)d, (FT_Int) temp == (FT_Int) d ) +#define CHECK_BYTE( d ) ( temp = (FT_Byte)d, (FT_UInt)temp == (FT_UInt)d ) /* horizontal advance in pixels */ xadvance = ( slot->advance.x + 32 ) >> 6; diff --git a/freetype/src/cff/cf2font.c b/freetype/src/cff/cf2font.c index 6e99dc2f0..83fd348f2 100644 --- a/freetype/src/cff/cf2font.c +++ b/freetype/src/cff/cf2font.c @@ -36,6 +36,9 @@ /***************************************************************************/ +#include +#include FT_INTERNAL_CALC_H + #include "cf2ft.h" #include "cf2glue.h" @@ -105,6 +108,7 @@ /* adjusting for emRatio converts darkenAmount to character */ /* space (font units). */ CF2_Fixed stemWidthPer1000, scaledStem; + FT_Int logBase2; *darkenAmount = 0; @@ -131,26 +135,33 @@ /* convert from true character space to 1000 unit character space; */ /* add synthetic emboldening effect */ - /* we have to assure that the computation of `scaledStem' */ - /* and `stemWidthPer1000' don't overflow */ + /* `stemWidthPer1000' will not overflow for a legitimate font */ stemWidthPer1000 = FT_MulFix( stemWidth + boldenAmount, emRatio ); - if ( emRatio > CF2_FIXED_ONE && - stemWidthPer1000 <= ( stemWidth + boldenAmount ) ) - { - stemWidthPer1000 = 0; /* to pacify compiler */ - scaledStem = cf2_intToFixed( x4 ); - } + /* `scaledStem' can easily overflow, so we must clamp its maximum */ + /* value; the test doesn't need to be precise, but must be */ + /* conservative. The clamp value (default 2333) where */ + /* `darkenAmount' is zero is well below the overflow value of */ + /* 32767. */ + /* */ + /* FT_MSB computes the integer part of the base 2 logarithm. The */ + /* number of bits for the product is 1 or 2 more than the sum of */ + /* logarithms; remembering that the 16 lowest bits of the fraction */ + /* are dropped this is correct to within a factor of almost 4. */ + /* For example, 0x80.0000 * 0x80.0000 = 0x4000.0000 is 23+23 and */ + /* is flagged as possible overflow because 0xFF.FFFF * 0xFF.FFFF = */ + /* 0xFFFF.FE00 is also 23+23. */ + + logBase2 = FT_MSB( (FT_UInt32)stemWidthPer1000 ) + + FT_MSB( (FT_UInt32)ppem ); + + if ( logBase2 >= 46 ) + /* possible overflow */ + scaledStem = cf2_intToFixed( x4 ); else - { scaledStem = FT_MulFix( stemWidthPer1000, ppem ); - if ( ppem > CF2_FIXED_ONE && - scaledStem <= stemWidthPer1000 ) - scaledStem = cf2_intToFixed( x4 ); - } - /* now apply the darkening parameters */ if ( scaledStem < cf2_intToFixed( x1 ) ) diff --git a/freetype/src/cff/cf2ft.c b/freetype/src/cff/cf2ft.c index cb8d31c53..ebba4694c 100644 --- a/freetype/src/cff/cf2ft.c +++ b/freetype/src/cff/cf2ft.c @@ -142,6 +142,8 @@ cf2_builder_lineTo( CF2_OutlineCallbacks callbacks, const CF2_CallbackParams params ) { + FT_Error error; + /* downcast the object pointer */ CF2_Outline outline = (CF2_Outline)callbacks; CFF_Builder* builder; @@ -156,15 +158,27 @@ { /* record the move before the line; also check points and set */ /* `path_begun' */ - cff_builder_start_point( builder, - params->pt0.x, - params->pt0.y ); + error = cff_builder_start_point( builder, + params->pt0.x, + params->pt0.y ); + if ( error ) + { + if ( !*callbacks->error ) + *callbacks->error = error; + return; + } } /* `cff_builder_add_point1' includes a check_points call for one point */ - cff_builder_add_point1( builder, - params->pt1.x, - params->pt1.y ); + error = cff_builder_add_point1( builder, + params->pt1.x, + params->pt1.y ); + if ( error ) + { + if ( !*callbacks->error ) + *callbacks->error = error; + return; + } } @@ -172,6 +186,8 @@ cf2_builder_cubeTo( CF2_OutlineCallbacks callbacks, const CF2_CallbackParams params ) { + FT_Error error; + /* downcast the object pointer */ CF2_Outline outline = (CF2_Outline)callbacks; CFF_Builder* builder; @@ -186,13 +202,25 @@ { /* record the move before the line; also check points and set */ /* `path_begun' */ - cff_builder_start_point( builder, - params->pt0.x, - params->pt0.y ); + error = cff_builder_start_point( builder, + params->pt0.x, + params->pt0.y ); + if ( error ) + { + if ( !*callbacks->error ) + *callbacks->error = error; + return; + } } /* prepare room for 3 points: 2 off-curve, 1 on-curve */ - cff_check_points( builder, 3 ); + error = cff_check_points( builder, 3 ); + if ( error ) + { + if ( !*callbacks->error ) + *callbacks->error = error; + return; + } cff_builder_add_point( builder, params->pt1.x, diff --git a/freetype/src/cff/cf2hints.c b/freetype/src/cff/cf2hints.c index 5853d7758..040d193f3 100644 --- a/freetype/src/cff/cf2hints.c +++ b/freetype/src/cff/cf2hints.c @@ -304,9 +304,6 @@ cf2_hintmap_map( CF2_HintMap hintmap, CF2_Fixed csCoord ) { - FT_ASSERT( hintmap->isValid ); /* must call Build before Map */ - FT_ASSERT( hintmap->lastIndex < CF2_MAX_HINT_EDGES ); - if ( hintmap->count == 0 || ! hintmap->hinted ) { /* there are no hints; use uniform scale and zero offset */ @@ -317,6 +314,7 @@ /* start linear search from last hit */ CF2_UInt i = hintmap->lastIndex; + FT_ASSERT( hintmap->lastIndex < CF2_MAX_HINT_EDGES ); /* search up */ while ( i < hintmap->count - 1 && @@ -794,9 +792,12 @@ maskPtr = cf2_hintmask_getMaskPtr( &tempHintMask ); /* use the hStem hints only, which are first in the mask */ - /* TODO: compare this to cffhintmaskGetBitCount */ bitCount = cf2_arrstack_size( hStemHintArray ); + /* Defense-in-depth. Should never return here. */ + if ( bitCount > hintMask->bitCount ) + return; + /* synthetic embox hints get highest priority */ if ( font->blues.doEmBoxHints ) { @@ -1560,7 +1561,7 @@ { /* -y */ *x = -glyphpath->xOffset; - *y = glyphpath->xOffset; + *y = glyphpath->yOffset; } else { @@ -1691,7 +1692,8 @@ if ( glyphpath->elemIsQueued ) { - FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) ); + FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) || + glyphpath->hintMap.count == 0 ); cf2_glyphpath_pushPrevElem( glyphpath, &glyphpath->hintMap, @@ -1777,7 +1779,8 @@ if ( glyphpath->elemIsQueued ) { - FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) ); + FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) || + glyphpath->hintMap.count == 0 ); cf2_glyphpath_pushPrevElem( glyphpath, &glyphpath->hintMap, diff --git a/freetype/src/cff/cf2intrp.c b/freetype/src/cff/cf2intrp.c index 5610917cc..a26960669 100644 --- a/freetype/src/cff/cf2intrp.c +++ b/freetype/src/cff/cf2intrp.c @@ -4,7 +4,7 @@ /* */ /* Adobe's CFF Interpreter (body). */ /* */ -/* Copyright 2007-2013 Adobe Systems Incorporated. */ +/* Copyright 2007-2014 Adobe Systems Incorporated. */ /* */ /* This software, and all works of authorship, whether in source or */ /* object code form as indicated by the copyright notice(s) included */ @@ -593,8 +593,11 @@ /* never add hints after the mask is computed */ if ( cf2_hintmask_isValid( &hintMask ) ) + { FT_TRACE4(( "cf2_interpT2CharString:" " invalid horizontal hint mask\n" )); + break; + } cf2_doStems( font, opStack, @@ -614,8 +617,11 @@ /* never add hints after the mask is computed */ if ( cf2_hintmask_isValid( &hintMask ) ) + { FT_TRACE4(( "cf2_interpT2CharString:" " invalid vertical hint mask\n" )); + break; + } cf2_doStems( font, opStack, @@ -1141,15 +1147,16 @@ /* `cf2_hintmask_read' (which also traces the mask bytes) */ FT_TRACE4(( op1 == cf2_cmdCNTRMASK ? " cntrmask" : " hintmask" )); - /* if there are arguments on the stack, there this is an */ - /* implied cf2_cmdVSTEMHM */ - if ( cf2_stack_count( opStack ) != 0 ) + /* never add hints after the mask is computed */ + if ( cf2_stack_count( opStack ) > 1 && + cf2_hintmask_isValid( &hintMask ) ) { - /* never add hints after the mask is computed */ - if ( cf2_hintmask_isValid( &hintMask ) ) - FT_TRACE4(( "cf2_interpT2CharString: invalid hint mask\n" )); + FT_TRACE4(( "cf2_interpT2CharString: invalid hint mask\n" )); + break; } + /* if there are arguments on the stack, there this is an */ + /* implied cf2_cmdVSTEMHM */ cf2_doStems( font, opStack, &vStemHintArray, diff --git a/freetype/src/cff/cffcmap.c b/freetype/src/cff/cffcmap.c index f6e03c642..52248b2b9 100644 --- a/freetype/src/cff/cffcmap.c +++ b/freetype/src/cff/cffcmap.c @@ -33,12 +33,15 @@ /*************************************************************************/ FT_CALLBACK_DEF( FT_Error ) - cff_cmap_encoding_init( CFF_CMapStd cmap ) + cff_cmap_encoding_init( CFF_CMapStd cmap, + FT_Pointer pointer ) { TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); CFF_Font cff = (CFF_Font)face->extra.data; CFF_Encoding encoding = &cff->encoding; + FT_UNUSED( pointer ); + cmap->gids = encoding->codes; @@ -135,7 +138,8 @@ FT_CALLBACK_DEF( FT_Error ) - cff_cmap_unicode_init( PS_Unicodes unicodes ) + cff_cmap_unicode_init( PS_Unicodes unicodes, + FT_Pointer pointer ) { TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes ); FT_Memory memory = FT_FACE_MEMORY( face ); @@ -143,6 +147,8 @@ CFF_Charset charset = &cff->charset; FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; + FT_UNUSED( pointer ); + /* can't build Unicode map for CID-keyed font */ /* because we don't know glyph names. */ diff --git a/freetype/src/cff/cffdrivr.c b/freetype/src/cff/cffdrivr.c index dde7d4488..3e8898e34 100644 --- a/freetype/src/cff/cffdrivr.c +++ b/freetype/src/cff/cffdrivr.c @@ -4,7 +4,7 @@ /* */ /* OpenType font driver implementation (body). */ /* */ -/* Copyright 1996-2013 by */ +/* Copyright 1996-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -753,7 +753,7 @@ FT_Module_Interface result; - /* CFF_SERVICES_GET derefers `library' in PIC mode */ + /* CFF_SERVICES_GET dereferences `library' in PIC mode */ #ifdef FT_CONFIG_OPTION_PIC if ( !driver ) return NULL; diff --git a/freetype/src/cff/cffgload.c b/freetype/src/cff/cffgload.c index c8e9f9124..758a3d3bb 100644 --- a/freetype/src/cff/cffgload.c +++ b/freetype/src/cff/cffgload.c @@ -4,7 +4,7 @@ /* */ /* OpenType Glyph Loader (body). */ /* */ -/* Copyright 1996-2013 by */ +/* Copyright 1996-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -703,7 +703,7 @@ /* callback function. */ if ( face->root.internal->incremental_interface ) { - FT_Data data; + FT_Data data; data.pointer = *pointer; @@ -1989,9 +1989,6 @@ } else { - if ( !error ) - error = FT_Err_Ok; - cff_builder_close_contour( builder ); /* close hints recording session */ @@ -2002,10 +1999,12 @@ goto Syntax_Error; /* apply hints to the loaded glyph outline now */ - hinter->apply( hinter->hints, - builder->current, - (PSH_Globals)builder->hints_globals, - decoder->hint_mode ); + error = hinter->apply( hinter->hints, + builder->current, + (PSH_Globals)builder->hints_globals, + decoder->hint_mode ); + if ( error ) + goto Fail; } /* add current outline to the glyph slot */ @@ -2711,10 +2710,10 @@ /* compute linear advance widths */ - ( (SFNT_Service)face->sfnt )->get_metrics( face, 0, - glyph_index, - &dummy, - &advance ); + (void)( (SFNT_Service)face->sfnt )->get_metrics( face, 0, + glyph_index, + &dummy, + &advance ); glyph->root.linearHoriAdvance = advance; has_vertical_info = FT_BOOL( @@ -2724,10 +2723,10 @@ /* get the vertical metrics from the vtmx table if we have one */ if ( has_vertical_info ) { - ( (SFNT_Service)face->sfnt )->get_metrics( face, 1, - glyph_index, - &dummy, - &advance ); + (void)( (SFNT_Service)face->sfnt )->get_metrics( face, 1, + glyph_index, + &dummy, + &advance ); glyph->root.linearVertAdvance = advance; } else @@ -2964,10 +2963,10 @@ FT_UShort vertAdvance = 0; - ( (SFNT_Service)face->sfnt )->get_metrics( face, 1, - glyph_index, - &vertBearingY, - &vertAdvance ); + (void)( (SFNT_Service)face->sfnt )->get_metrics( face, 1, + glyph_index, + &vertBearingY, + &vertAdvance ); metrics->vertBearingY = vertBearingY; metrics->vertAdvance = vertAdvance; } diff --git a/freetype/src/cff/cffobjs.c b/freetype/src/cff/cffobjs.c index cac4ac2bd..da3d0190f 100644 --- a/freetype/src/cff/cffobjs.c +++ b/freetype/src/cff/cffobjs.c @@ -4,7 +4,7 @@ /* */ /* OpenType objects manager (body). */ /* */ -/* Copyright 1996-2013 by */ +/* Copyright 1996-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -943,16 +943,6 @@ if ( pure_cff && cff->top_font.font_dict.cid_registry != 0xFFFFU ) goto Exit; -#ifdef FT_MAX_CHARMAP_CACHEABLE - if ( nn + 1 > FT_MAX_CHARMAP_CACHEABLE ) - { - FT_ERROR(( "cff_face_init: no Unicode cmap is found, " - "and too many subtables (%d) to add synthesized cmap\n", - nn )); - goto Exit; - } -#endif - /* we didn't find a Unicode charmap -- synthesize one */ cmaprec.face = cffface; cmaprec.platform_id = TT_PLATFORM_MICROSOFT; @@ -973,15 +963,6 @@ cffface->charmap = cffface->charmaps[nn]; Skip_Unicode: -#ifdef FT_MAX_CHARMAP_CACHEABLE - if ( nn > FT_MAX_CHARMAP_CACHEABLE ) - { - FT_ERROR(( "cff_face_init: Unicode cmap is found, " - "but too many preceding subtables (%d) to access\n", - nn - 1 )); - goto Exit; - } -#endif if ( encoding->count > 0 ) { FT_CMap_Class clazz; @@ -1055,22 +1036,23 @@ CFF_Driver driver = (CFF_Driver)module; - /* set default property values, cf `ftcffdrv.h' */ + /* set default property values, cf. `ftcffdrv.h' */ #ifdef CFF_CONFIG_OPTION_OLD_ENGINE - driver->hinting_engine = FT_CFF_HINTING_FREETYPE; + driver->hinting_engine = FT_CFF_HINTING_FREETYPE; #else - driver->hinting_engine = FT_CFF_HINTING_ADOBE; + driver->hinting_engine = FT_CFF_HINTING_ADOBE; #endif + driver->no_stem_darkening = FALSE; - driver->darken_params[0] = 500; - driver->darken_params[1] = 400; - driver->darken_params[2] = 1000; - driver->darken_params[3] = 275; - driver->darken_params[4] = 1667; - driver->darken_params[5] = 275; - driver->darken_params[6] = 2333; - driver->darken_params[7] = 0; + driver->darken_params[0] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1; + driver->darken_params[1] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1; + driver->darken_params[2] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2; + driver->darken_params[3] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2; + driver->darken_params[4] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3; + driver->darken_params[5] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3; + driver->darken_params[6] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4; + driver->darken_params[7] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4; return FT_Err_Ok; } diff --git a/freetype/src/cff/cffparse.c b/freetype/src/cff/cffparse.c index 91bd5326c..c79ab623d 100644 --- a/freetype/src/cff/cffparse.c +++ b/freetype/src/cff/cffparse.c @@ -188,7 +188,7 @@ } /* Read fraction part, if any. */ - if ( nib == 0xa ) + if ( nib == 0xA ) for (;;) { /* If we entered this iteration with phase == 4, we need */ diff --git a/freetype/src/gxvalid/gxvbsln.c b/freetype/src/gxvalid/gxvbsln.c index 3d1003156..d16511876 100644 --- a/freetype/src/gxvalid/gxvbsln.c +++ b/freetype/src/gxvalid/gxvbsln.c @@ -72,10 +72,10 @@ static void gxv_bsln_LookupValue_validate( FT_UShort glyph, GXV_LookupValueCPtr value_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { - FT_UShort v = value_p->u; - FT_UShort* ctlPoints; + FT_UShort v = value_p->u; + FT_UShort* ctlPoints; FT_UNUSED( glyph ); @@ -124,7 +124,7 @@ gxv_bsln_LookupFmt4_transit( FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p; FT_Bytes limit; @@ -135,7 +135,7 @@ offset = (FT_UShort)( base_value_p->u + ( relative_gindex * sizeof ( FT_UShort ) ) ); - p = valid->lookuptbl_head + offset; + p = gxvalid->lookuptbl_head + offset; limit = lookuptbl_limit; GXV_LIMIT_CHECK( 2 ); @@ -148,7 +148,7 @@ static void gxv_bsln_parts_fmt0_validate( FT_Bytes tables, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = tables; @@ -158,7 +158,7 @@ /* deltas */ GXV_LIMIT_CHECK( 2 * GXV_BSLN_VALUE_COUNT ); - valid->table_data = NULL; /* No ctlPoints here. */ + gxvalid->table_data = NULL; /* No ctlPoints here. */ GXV_EXIT; } @@ -167,7 +167,7 @@ static void gxv_bsln_parts_fmt1_validate( FT_Bytes tables, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = tables; @@ -175,15 +175,15 @@ GXV_NAME_ENTER( "parts format 1" ); /* deltas */ - gxv_bsln_parts_fmt0_validate( p, limit, valid ); + gxv_bsln_parts_fmt0_validate( p, limit, gxvalid ); /* mappingData */ - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_bsln_LookupValue_validate; - valid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit; + gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + gxvalid->lookupval_func = gxv_bsln_LookupValue_validate; + gxvalid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit; gxv_LookupTable_validate( p + 2 * GXV_BSLN_VALUE_COUNT, limit, - valid ); + gxvalid ); GXV_EXIT; } @@ -192,7 +192,7 @@ static void gxv_bsln_parts_fmt2_validate( FT_Bytes tables, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = tables; @@ -211,7 +211,7 @@ stdGlyph = FT_NEXT_USHORT( p ); GXV_TRACE(( " (stdGlyph = %u)\n", stdGlyph )); - gxv_glyphid_validate( stdGlyph, valid ); + gxv_glyphid_validate( stdGlyph, gxvalid ); /* Record the position of ctlPoints */ GXV_BSLN_DATA( ctlPoints_p ) = p; @@ -226,7 +226,7 @@ FT_INVALID_DATA; } else - gxv_ctlPoint_validate( stdGlyph, (FT_Short)ctlPoint, valid ); + gxv_ctlPoint_validate( stdGlyph, (FT_Short)ctlPoint, gxvalid ); } GXV_EXIT; @@ -236,7 +236,7 @@ static void gxv_bsln_parts_fmt3_validate( FT_Bytes tables, FT_Bytes limit, - GXV_Validator valid) + GXV_Validator gxvalid) { FT_Bytes p = tables; @@ -244,15 +244,15 @@ GXV_NAME_ENTER( "parts format 3" ); /* stdGlyph + ctlPoints */ - gxv_bsln_parts_fmt2_validate( p, limit, valid ); + gxv_bsln_parts_fmt2_validate( p, limit, gxvalid ); /* mappingData */ - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_bsln_LookupValue_validate; - valid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit; + gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + gxvalid->lookupval_func = gxv_bsln_LookupValue_validate; + gxvalid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit; gxv_LookupTable_validate( p + ( 2 + 2 * GXV_BSLN_VALUE_COUNT ), limit, - valid ); + gxvalid ); GXV_EXIT; } @@ -271,8 +271,8 @@ FT_Face face, FT_Validator ftvalid ) { - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; + GXV_ValidatorRec gxvalidrec; + GXV_Validator gxvalid = &gxvalidrec; GXV_bsln_DataRec bslnrec; GXV_bsln_Data bsln = &bslnrec; @@ -293,9 +293,9 @@ }; - valid->root = ftvalid; - valid->table_data = bsln; - valid->face = face; + gxvalid->root = ftvalid; + gxvalid->table_data = bsln; + gxvalid->face = face; FT_TRACE3(( "validating `bsln' table\n" )); GXV_INIT; @@ -320,7 +320,7 @@ bsln->defaultBaseline = defaultBaseline; - fmt_funcs_table[format]( p, limit, valid ); + fmt_funcs_table[format]( p, limit, gxvalid ); FT_TRACE4(( "\n" )); } diff --git a/freetype/src/gxvalid/gxvcommn.c b/freetype/src/gxvalid/gxvcommn.c index 7af52342b..8e72a72f4 100644 --- a/freetype/src/gxvalid/gxvcommn.c +++ b/freetype/src/gxvalid/gxvcommn.c @@ -65,7 +65,7 @@ FT_UShort* buff, FT_UInt nmemb, FT_UShort limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UInt i; @@ -130,7 +130,7 @@ FT_ULong* buff, FT_UInt nmemb, FT_ULong limit, - GXV_Validator valid) + GXV_Validator gxvalid) { FT_UInt i; @@ -182,7 +182,7 @@ FT_Bytes limit, FT_Byte* min, FT_Byte* max, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -202,7 +202,7 @@ *max = (FT_Byte)FT_MAX( *max, val ); } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; } @@ -211,7 +211,7 @@ FT_Bytes limit, FT_UShort* min, FT_UShort* max, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -231,7 +231,7 @@ *max = (FT_Byte)FT_MAX( *max, val ); } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; } @@ -256,7 +256,7 @@ static void gxv_BinSrchHeader_check_consistency( GXV_BinSrchHeader* binSrchHeader, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UShort searchRange; FT_UShort entrySelector; @@ -329,7 +329,7 @@ FT_Bytes limit, FT_UShort* unitSize_p, FT_UShort* nUnits_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; GXV_BinSrchHeader binSrchHeader; @@ -359,7 +359,7 @@ binSrchHeader.rangeShift = FT_NEXT_USHORT( p ); GXV_TRACE(( "nUnits %d\n", binSrchHeader.nUnits )); - gxv_BinSrchHeader_check_consistency( &binSrchHeader, valid ); + gxv_BinSrchHeader_check_consistency( &binSrchHeader, gxvalid ); if ( *unitSize_p == 0 ) *unitSize_p = binSrchHeader.unitSize; @@ -367,7 +367,7 @@ if ( *nUnits_p == 0 ) *nUnits_p = binSrchHeader.nUnits; - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -422,7 +422,7 @@ static void gxv_LookupTable_fmt0_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort i; @@ -432,24 +432,24 @@ GXV_NAME_ENTER( "LookupTable format 0" ); - GXV_LIMIT_CHECK( 2 * valid->face->num_glyphs ); + GXV_LIMIT_CHECK( 2 * gxvalid->face->num_glyphs ); - for ( i = 0; i < valid->face->num_glyphs; i++ ) + for ( i = 0; i < gxvalid->face->num_glyphs; i++ ) { GXV_LIMIT_CHECK( 2 ); if ( p + 2 >= limit ) /* some fonts have too-short fmt0 array */ { GXV_TRACE(( "too short, glyphs %d - %d are missing\n", - i, valid->face->num_glyphs )); + i, gxvalid->face->num_glyphs )); GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID ); break; } - value = GXV_LOOKUP_VALUE_LOAD( p, valid->lookupval_sign ); - valid->lookupval_func( i, &value, valid ); + value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign ); + gxvalid->lookupval_func( i, &value, gxvalid ); } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -473,12 +473,12 @@ static void gxv_LookupTable_fmt2_skip_endmarkers( FT_Bytes table, FT_UShort unitSize, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; - while ( ( p + 4 ) < valid->root->limit ) + while ( ( p + 4 ) < gxvalid->root->limit ) { if ( p[0] != 0xFF || p[1] != 0xFF || /* lastGlyph */ p[2] != 0xFF || p[3] != 0xFF ) /* firstGlyph */ @@ -486,14 +486,14 @@ p += unitSize; } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; } static void gxv_LookupTable_fmt2_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort gid; @@ -509,8 +509,8 @@ GXV_NAME_ENTER( "LookupTable format 2" ); unitSize = nUnits = 0; - gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, valid ); - p += valid->subtable_length; + gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, gxvalid ); + p += gxvalid->subtable_length; GXV_UNITSIZE_VALIDATE( "format2", unitSize, nUnits, 6 ); @@ -519,10 +519,10 @@ GXV_LIMIT_CHECK( 2 + 2 + 2 ); lastGlyph = FT_NEXT_USHORT( p ); firstGlyph = FT_NEXT_USHORT( p ); - value = GXV_LOOKUP_VALUE_LOAD( p, valid->lookupval_sign ); + value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign ); - gxv_glyphid_validate( firstGlyph, valid ); - gxv_glyphid_validate( lastGlyph, valid ); + gxv_glyphid_validate( firstGlyph, gxvalid ); + gxv_glyphid_validate( lastGlyph, gxvalid ); if ( lastGlyph < gid ) { @@ -539,7 +539,7 @@ unit, lastGlyph, firstGlyph )); GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID ); - if ( valid->root->level == FT_VALIDATE_TIGHT ) + if ( gxvalid->root->level == FT_VALIDATE_TIGHT ) continue; /* ftxvalidator silently skips such an entry */ FT_TRACE4(( "continuing with exchanged values\n" )); @@ -549,13 +549,13 @@ } for ( gid = firstGlyph; gid <= lastGlyph; gid++ ) - valid->lookupval_func( gid, &value, valid ); + gxvalid->lookupval_func( gid, &value, gxvalid ); } - gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, valid ); - p += valid->subtable_length; + gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, gxvalid ); + p += gxvalid->subtable_length; - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -564,7 +564,7 @@ static void gxv_LookupTable_fmt4_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort unit; @@ -581,8 +581,8 @@ GXV_NAME_ENTER( "LookupTable format 4" ); unitSize = nUnits = 0; - gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, valid ); - p += valid->subtable_length; + gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, gxvalid ); + p += gxvalid->subtable_length; GXV_UNITSIZE_VALIDATE( "format4", unitSize, nUnits, 6 ); @@ -592,8 +592,8 @@ lastGlyph = FT_NEXT_USHORT( p ); firstGlyph = FT_NEXT_USHORT( p ); - gxv_glyphid_validate( firstGlyph, valid ); - gxv_glyphid_validate( lastGlyph, valid ); + gxv_glyphid_validate( firstGlyph, gxvalid ); + gxv_glyphid_validate( lastGlyph, gxvalid ); if ( lastGlyph < gid ) { @@ -610,7 +610,7 @@ unit, lastGlyph, firstGlyph )); GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID ); - if ( valid->root->level == FT_VALIDATE_TIGHT ) + if ( gxvalid->root->level == FT_VALIDATE_TIGHT ) continue; /* ftxvalidator silently skips such an entry */ FT_TRACE4(( "continuing with exchanged values\n" )); @@ -624,19 +624,19 @@ for ( gid = firstGlyph; gid <= lastGlyph; gid++ ) { - value = valid->lookupfmt4_trans( (FT_UShort)( gid - firstGlyph ), + value = gxvalid->lookupfmt4_trans( (FT_UShort)( gid - firstGlyph ), &base_value, limit, - valid ); + gxvalid ); - valid->lookupval_func( gid, &value, valid ); + gxvalid->lookupval_func( gid, &value, gxvalid ); } } - gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, valid ); - p += valid->subtable_length; + gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, gxvalid ); + p += gxvalid->subtable_length; - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -645,26 +645,26 @@ static void gxv_LookupTable_fmt6_skip_endmarkers( FT_Bytes table, FT_UShort unitSize, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; - while ( p < valid->root->limit ) + while ( p < gxvalid->root->limit ) { if ( p[0] != 0xFF || p[1] != 0xFF ) break; p += unitSize; } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; } static void gxv_LookupTable_fmt6_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort unit; @@ -679,8 +679,8 @@ GXV_NAME_ENTER( "LookupTable format 6" ); unitSize = nUnits = 0; - gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, valid ); - p += valid->subtable_length; + gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, gxvalid ); + p += gxvalid->subtable_length; GXV_UNITSIZE_VALIDATE( "format6", unitSize, nUnits, 4 ); @@ -688,9 +688,9 @@ { GXV_LIMIT_CHECK( 2 + 2 ); glyph = FT_NEXT_USHORT( p ); - value = GXV_LOOKUP_VALUE_LOAD( p, valid->lookupval_sign ); + value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign ); - if ( gxv_glyphid_validate( glyph, valid ) ) + if ( gxv_glyphid_validate( glyph, gxvalid ) ) GXV_TRACE(( " endmarker found within defined range" " (entry %d < nUnits=%d)\n", unit, nUnits )); @@ -703,13 +703,13 @@ } prev_glyph = glyph; - valid->lookupval_func( glyph, &value, valid ); + gxvalid->lookupval_func( glyph, &value, gxvalid ); } - gxv_LookupTable_fmt6_skip_endmarkers( p, unitSize, valid ); - p += valid->subtable_length; + gxv_LookupTable_fmt6_skip_endmarkers( p, unitSize, gxvalid ); + p += gxvalid->subtable_length; - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -718,7 +718,7 @@ static void gxv_LookupTable_fmt8_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort i; @@ -735,18 +735,18 @@ firstGlyph = FT_NEXT_USHORT( p ); glyphCount = FT_NEXT_USHORT( p ); - gxv_glyphid_validate( firstGlyph, valid ); - gxv_glyphid_validate( (FT_UShort)( firstGlyph + glyphCount ), valid ); + gxv_glyphid_validate( firstGlyph, gxvalid ); + gxv_glyphid_validate( (FT_UShort)( firstGlyph + glyphCount ), gxvalid ); /* valueArray */ for ( i = 0; i < glyphCount; i++ ) { GXV_LIMIT_CHECK( 2 ); - value = GXV_LOOKUP_VALUE_LOAD( p, valid->lookupval_sign ); - valid->lookupval_func( (FT_UShort)( firstGlyph + i ), &value, valid ); + value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign ); + gxvalid->lookupval_func( (FT_UShort)( firstGlyph + i ), &value, gxvalid ); } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -754,7 +754,7 @@ FT_LOCAL_DEF( void ) gxv_LookupTable_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort format; @@ -778,7 +778,7 @@ GXV_NAME_ENTER( "LookupTable" ); /* lookuptbl_head may be used in fmt4 transit function. */ - valid->lookuptbl_head = table; + gxvalid->lookuptbl_head = table; /* format */ GXV_LIMIT_CHECK( 2 ); @@ -792,10 +792,10 @@ if ( func == NULL ) FT_INVALID_FORMAT; - func( p, limit, valid ); - p += valid->subtable_length; + func( p, limit, gxvalid ); + p += gxvalid->subtable_length; - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -811,7 +811,7 @@ FT_LOCAL_DEF( FT_Int ) gxv_glyphid_validate( FT_UShort gid, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Face face; @@ -822,7 +822,7 @@ return 1; } - face = valid->face; + face = gxvalid->face; if ( face->num_glyphs < gid ) { GXV_TRACE(( " gxv_glyphid_check() gid overflow: num_glyphs %d < %d\n", @@ -845,7 +845,7 @@ FT_LOCAL_DEF( void ) gxv_ctlPoint_validate( FT_UShort gid, FT_Short ctl_point, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Face face; FT_Error error; @@ -855,7 +855,7 @@ short n_points; - face = valid->face; + face = gxvalid->face; error = FT_Load_Glyph( face, gid, @@ -885,7 +885,7 @@ gxv_sfntName_validate( FT_UShort name_index, FT_UShort min_index, FT_UShort max_index, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_SfntName name; FT_UInt i; @@ -897,10 +897,10 @@ if ( name_index < min_index || max_index < name_index ) FT_INVALID_FORMAT; - nnames = FT_Get_Sfnt_Name_Count( valid->face ); + nnames = FT_Get_Sfnt_Name_Count( gxvalid->face ); for ( i = 0; i < nnames; i++ ) { - if ( FT_Get_Sfnt_Name( valid->face, i, &name ) != FT_Err_Ok ) + if ( FT_Get_Sfnt_Name( gxvalid->face, i, &name ) != FT_Err_Ok ) continue ; if ( name.name_id == name_index ) @@ -944,7 +944,7 @@ FT_UShort* length_p, FT_UShort stateSize, FT_Byte* maxClassID_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_Bytes limit = table + *length_p; @@ -965,7 +965,7 @@ if ( !nGlyphs ) goto Out; - gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs ), valid ); + gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs ), gxvalid ); { FT_Byte nGlyphInClass[256]; @@ -1022,9 +1022,9 @@ FT_UShort stateSize, FT_Byte* maxState_p, FT_Byte* maxEntry_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { - FT_Bytes p = table; + FT_Bytes p = table; FT_Bytes limit = table + *length_p; FT_Byte clazz; FT_Byte entry; @@ -1076,7 +1076,7 @@ FT_Byte maxClassID, FT_Bytes statetable_table, FT_Bytes statetable_limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_Bytes limit = table + *length_p; @@ -1166,13 +1166,13 @@ goto Exit; } - if ( NULL != valid->statetable.entry_validate_func ) - valid->statetable.entry_validate_func( state, - flags, - &glyphOffset, - statetable_table, - statetable_limit, - valid ); + if ( NULL != gxvalid->statetable.entry_validate_func ) + gxvalid->statetable.entry_validate_func( state, + flags, + &glyphOffset, + statetable_table, + statetable_limit, + gxvalid ); } Exit: @@ -1192,7 +1192,7 @@ FT_UShort* classTable_length_p, FT_UShort* stateArray_length_p, FT_UShort* entryTable_length_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UShort o[3]; FT_UShort* l[3]; @@ -1206,14 +1206,14 @@ l[1] = stateArray_length_p; l[2] = entryTable_length_p; - gxv_set_length_by_ushort_offset( o, l, buff, 3, table_size, valid ); + gxv_set_length_by_ushort_offset( o, l, buff, 3, table_size, gxvalid ); } FT_LOCAL_DEF( void ) gxv_StateTable_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UShort stateSize; FT_UShort classTable; /* offset to Class(Sub)Table */ @@ -1250,11 +1250,11 @@ if ( stateSize > 0xFF ) FT_INVALID_DATA; - if ( valid->statetable.optdata_load_func != NULL ) - valid->statetable.optdata_load_func( p, limit, valid ); + if ( gxvalid->statetable.optdata_load_func != NULL ) + gxvalid->statetable.optdata_load_func( p, limit, gxvalid ); - if ( valid->statetable.subtable_setup_func != NULL) - setup_func = valid->statetable.subtable_setup_func; + if ( gxvalid->statetable.subtable_setup_func != NULL) + setup_func = gxvalid->statetable.subtable_setup_func; else setup_func = gxv_StateTable_subtable_setup; @@ -1265,7 +1265,7 @@ &classTable_length, &stateArray_length, &entryTable_length, - valid ); + gxvalid ); GXV_TRACE(( "StateTable Subtables\n" )); @@ -1274,7 +1274,7 @@ &classTable_length, stateSize, &maxClassID, - valid ); + gxvalid ); else maxClassID = (FT_Byte)( stateSize - 1 ); @@ -1285,7 +1285,7 @@ stateSize, &maxState, &maxEntry, - valid ); + gxvalid ); else { #if 0 @@ -1306,7 +1306,7 @@ maxClassID, table, limit, - valid ); + gxvalid ); GXV_EXIT; } @@ -1322,7 +1322,7 @@ FT_ULong* classTable_length_p, FT_ULong* stateArray_length_p, FT_ULong* entryTable_length_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_ULong o[3]; FT_ULong* l[3]; @@ -1336,21 +1336,21 @@ l[1] = stateArray_length_p; l[2] = entryTable_length_p; - gxv_set_length_by_ulong_offset( o, l, buff, 3, table_size, valid ); + gxv_set_length_by_ulong_offset( o, l, buff, 3, table_size, gxvalid ); } static void gxv_XClassTable_lookupval_validate( FT_UShort glyph, GXV_LookupValueCPtr value_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UNUSED( glyph ); - if ( value_p->u >= valid->xstatetable.nClasses ) + if ( value_p->u >= gxvalid->xstatetable.nClasses ) FT_INVALID_DATA; - if ( value_p->u > valid->xstatetable.maxClassID ) - valid->xstatetable.maxClassID = value_p->u; + if ( value_p->u > gxvalid->xstatetable.maxClassID ) + gxvalid->xstatetable.maxClassID = value_p->u; } @@ -1384,7 +1384,7 @@ gxv_XClassTable_lookupfmt4_transit( FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p; FT_Bytes limit; @@ -1395,7 +1395,7 @@ offset = (FT_UShort)( base_value_p->u + relative_gindex * sizeof ( FT_UShort ) ); - p = valid->lookuptbl_head + offset; + p = gxvalid->lookuptbl_head + offset; limit = lookuptbl_limit; GXV_LIMIT_CHECK ( 2 ); @@ -1412,7 +1412,7 @@ FT_ULong stateSize, FT_UShort* maxState_p, FT_UShort* maxEntry_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_Bytes limit = table + *length_p; @@ -1463,7 +1463,7 @@ FT_UShort maxClassID, FT_Bytes xstatetable_table, FT_Bytes xstatetable_limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_Bytes limit = table + *length_p; @@ -1540,13 +1540,13 @@ goto Exit; } - if ( NULL != valid->xstatetable.entry_validate_func ) - valid->xstatetable.entry_validate_func( state, - flags, - &glyphOffset, - xstatetable_table, - xstatetable_limit, - valid ); + if ( NULL != gxvalid->xstatetable.entry_validate_func ) + gxvalid->xstatetable.entry_validate_func( state, + flags, + &glyphOffset, + xstatetable_table, + xstatetable_limit, + gxvalid ); } Exit: @@ -1559,7 +1559,7 @@ FT_LOCAL_DEF( void ) gxv_XStateTable_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { /* StateHeader members */ FT_ULong classTable; /* offset to Class(Sub)Table */ @@ -1582,26 +1582,26 @@ GXV_TRACE(( "XStateTable header\n" )); GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 ); - valid->xstatetable.nClasses = FT_NEXT_ULONG( p ); + gxvalid->xstatetable.nClasses = FT_NEXT_ULONG( p ); classTable = FT_NEXT_ULONG( p ); stateArray = FT_NEXT_ULONG( p ); entryTable = FT_NEXT_ULONG( p ); - GXV_TRACE(( "nClasses =0x%08x\n", valid->xstatetable.nClasses )); + GXV_TRACE(( "nClasses =0x%08x\n", gxvalid->xstatetable.nClasses )); GXV_TRACE(( "offset to classTable=0x%08x\n", classTable )); GXV_TRACE(( "offset to stateArray=0x%08x\n", stateArray )); GXV_TRACE(( "offset to entryTable=0x%08x\n", entryTable )); - if ( valid->xstatetable.nClasses > 0xFFFFU ) + if ( gxvalid->xstatetable.nClasses > 0xFFFFU ) FT_INVALID_DATA; GXV_TRACE(( "StateTable Subtables\n" )); - if ( valid->xstatetable.optdata_load_func != NULL ) - valid->xstatetable.optdata_load_func( p, limit, valid ); + if ( gxvalid->xstatetable.optdata_load_func != NULL ) + gxvalid->xstatetable.optdata_load_func( p, limit, gxvalid ); - if ( valid->xstatetable.subtable_setup_func != NULL ) - setup_func = valid->xstatetable.subtable_setup_func; + if ( gxvalid->xstatetable.subtable_setup_func != NULL ) + setup_func = gxvalid->xstatetable.subtable_setup_func; else setup_func = gxv_XStateTable_subtable_setup; @@ -1612,37 +1612,37 @@ &classTable_length, &stateArray_length, &entryTable_length, - valid ); + gxvalid ); if ( classTable != 0 ) { - valid->xstatetable.maxClassID = 0; - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_XClassTable_lookupval_validate; - valid->lookupfmt4_trans = gxv_XClassTable_lookupfmt4_transit; + gxvalid->xstatetable.maxClassID = 0; + gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + gxvalid->lookupval_func = gxv_XClassTable_lookupval_validate; + gxvalid->lookupfmt4_trans = gxv_XClassTable_lookupfmt4_transit; gxv_LookupTable_validate( table + classTable, table + classTable + classTable_length, - valid ); + gxvalid ); #if 0 - if ( valid->subtable_length < classTable_length ) - classTable_length = valid->subtable_length; + if ( gxvalid->subtable_length < classTable_length ) + classTable_length = gxvalid->subtable_length; #endif } else { /* XXX: check range? */ - valid->xstatetable.maxClassID = - (FT_UShort)( valid->xstatetable.nClasses - 1 ); + gxvalid->xstatetable.maxClassID = + (FT_UShort)( gxvalid->xstatetable.nClasses - 1 ); } if ( stateArray != 0 ) gxv_XStateArray_validate( table + stateArray, &stateArray_length, - valid->xstatetable.maxClassID, - valid->xstatetable.nClasses, + gxvalid->xstatetable.maxClassID, + gxvalid->xstatetable.nClasses, &maxState, &maxEntry, - valid ); + gxvalid ); else { #if 0 @@ -1659,10 +1659,10 @@ &entryTable_length, maxEntry, stateArray_length, - valid->xstatetable.maxClassID, + gxvalid->xstatetable.maxClassID, table, limit, - valid ); + gxvalid ); GXV_EXIT; } @@ -1719,7 +1719,7 @@ FT_LOCAL_DEF( void ) gxv_odtect_validate( GXV_odtect_Range odtect, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UInt i, j; diff --git a/freetype/src/gxvalid/gxvcommn.h b/freetype/src/gxvalid/gxvcommn.h index 1ff87e442..f1143457f 100644 --- a/freetype/src/gxvalid/gxvcommn.h +++ b/freetype/src/gxvalid/gxvcommn.h @@ -4,7 +4,7 @@ /* */ /* TrueTypeGX/AAT common tables validation (specification). */ /* */ -/* Copyright 2004, 2005, 2012 */ +/* Copyright 2004, 2005, 2012, 2014 */ /* by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ @@ -62,7 +62,7 @@ FT_BEGIN_HEADER #undef GXV_LOAD_UNUSED_VARS /* debug purpose */ -#define IS_PARANOID_VALIDATION ( valid->root->level >= FT_VALIDATE_PARANOID ) +#define IS_PARANOID_VALIDATION ( gxvalid->root->level >= FT_VALIDATE_PARANOID ) #define GXV_SET_ERR_IF_PARANOID( err ) { if ( IS_PARANOID_VALIDATION ) ( err ); } /*************************************************************************/ @@ -81,7 +81,7 @@ FT_BEGIN_HEADER typedef void (*GXV_Validate_Func)( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); /* ====================== LookupTable Validator ======================== */ @@ -106,13 +106,13 @@ FT_BEGIN_HEADER typedef void (*GXV_Lookup_Value_Validate_Func)( FT_UShort glyph, GXV_LookupValueCPtr value_p, - GXV_Validator valid ); + GXV_Validator gxvalid ); typedef GXV_LookupValueDesc (*GXV_Lookup_Fmt4_Transit_Func)( FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); /* ====================== StateTable Validator ========================= */ @@ -131,10 +131,10 @@ FT_BEGIN_HEADER #define GXV_GLYPHOFFSET_FMT( table ) \ - ( valid->table.entry_glyphoffset_fmt ) + ( gxvalid->table.entry_glyphoffset_fmt ) #define GXV_GLYPHOFFSET_SIZE( table ) \ - ( valid->table.entry_glyphoffset_fmt / 2 ) + ( gxvalid->table.entry_glyphoffset_fmt / 2 ) /* ----------------------- 16bit StateTable ---------------------------- */ @@ -160,7 +160,7 @@ FT_BEGIN_HEADER FT_UShort* classTable_length_p, FT_UShort* stateArray_length_p, FT_UShort* entryTable_length_p, - GXV_Validator valid ); + GXV_Validator gxvalid ); typedef void (*GXV_StateTable_Entry_Validate_Func)( @@ -169,12 +169,12 @@ FT_BEGIN_HEADER GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes statetable_table, FT_Bytes statetable_limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); typedef void (*GXV_StateTable_OptData_Load_Func)( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); typedef struct GXV_StateTable_ValidatorRec_ { @@ -202,7 +202,7 @@ FT_BEGIN_HEADER FT_ULong* classTable_length_p, FT_ULong* stateArray_length_p, FT_ULong* entryTable_length_p, - GXV_Validator valid ); + GXV_Validator gxvalid ); typedef void (*GXV_XStateTable_Entry_Validate_Func)( @@ -211,7 +211,7 @@ FT_BEGIN_HEADER GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes xstatetable_table, FT_Bytes xstatetable_limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); typedef GXV_StateTable_OptData_Load_Func GXV_XStateTable_OptData_Load_Func; @@ -263,35 +263,35 @@ FT_BEGIN_HEADER #define GXV_TABLE_DATA( tag, field ) \ - ( ( (GXV_ ## tag ## _Data)valid->table_data )->field ) + ( ( (GXV_ ## tag ## _Data)gxvalid->table_data )->field ) #undef FT_INVALID_ -#define FT_INVALID_( _prefix, _error ) \ - ft_validator_error( valid->root, _prefix ## _error ) +#define FT_INVALID_( _error ) \ + ft_validator_error( gxvalid->root, FT_THROW( _error ) ) #define GXV_LIMIT_CHECK( _count ) \ FT_BEGIN_STMNT \ - if ( p + _count > ( limit? limit : valid->root->limit ) ) \ + if ( p + _count > ( limit? limit : gxvalid->root->limit ) ) \ FT_INVALID_TOO_SHORT; \ FT_END_STMNT #ifdef FT_DEBUG_LEVEL_TRACE -#define GXV_INIT valid->debug_indent = 0 +#define GXV_INIT gxvalid->debug_indent = 0 #define GXV_NAME_ENTER( name ) \ FT_BEGIN_STMNT \ - valid->debug_indent += 2; \ - FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ + gxvalid->debug_indent += 2; \ + FT_TRACE4(( "%*.s", gxvalid->debug_indent, 0 )); \ FT_TRACE4(( "%s table\n", name )); \ FT_END_STMNT -#define GXV_EXIT valid->debug_indent -= 2 +#define GXV_EXIT gxvalid->debug_indent -= 2 #define GXV_TRACE( s ) \ FT_BEGIN_STMNT \ - FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ + FT_TRACE4(( "%*.s", gxvalid->debug_indent, 0 )); \ FT_TRACE4( s ); \ FT_END_STMNT @@ -318,7 +318,7 @@ FT_BEGIN_HEADER FT_BEGIN_STMNT \ { \ if ( (a) & 3 ) \ - FT_INVALID_OFFSET ; \ + FT_INVALID_OFFSET; \ } \ FT_END_STMNT @@ -349,7 +349,7 @@ FT_BEGIN_HEADER \ \ for ( b = p; b < (FT_Bytes)p + len; b++ ) \ - if ( 0x40 < *b && *b < 0x7e ) \ + if ( 0x40 < *b && *b < 0x7E ) \ FT_TRACE1(("%c", *b)) ; \ else \ FT_TRACE1(("\\x%02x", *b)) ; \ @@ -373,12 +373,12 @@ FT_BEGIN_HEADER FT_Bytes limit, FT_UShort* unitSize_p, FT_UShort* nUnits_p, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_LookupTable_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); /*************************************************************************/ @@ -391,7 +391,7 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Int ) gxv_glyphid_validate( FT_UShort gid, - GXV_Validator valid ); + GXV_Validator gxvalid ); /*************************************************************************/ @@ -405,7 +405,7 @@ FT_BEGIN_HEADER FT_LOCAL( void ) gxv_ctlPoint_validate( FT_UShort gid, FT_Short ctl_point, - GXV_Validator valid ); + GXV_Validator gxvalid ); /*************************************************************************/ @@ -420,7 +420,7 @@ FT_BEGIN_HEADER gxv_sfntName_validate( FT_UShort name_index, FT_UShort min_index, FT_UShort max_index, - GXV_Validator valid ); + GXV_Validator gxvalid ); /*************************************************************************/ @@ -439,7 +439,7 @@ FT_BEGIN_HEADER FT_UShort* classTable_length_p, FT_UShort* stateArray_length_p, FT_UShort* entryTable_length_p, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_XStateTable_subtable_setup( FT_ULong table_size, @@ -449,17 +449,17 @@ FT_BEGIN_HEADER FT_ULong* classTable_length_p, FT_ULong* stateArray_length_p, FT_ULong* entryTable_length_p, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_StateTable_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_XStateTable_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); /*************************************************************************/ @@ -475,14 +475,14 @@ FT_BEGIN_HEADER FT_Bytes limit, FT_Byte* min, FT_Byte* max, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_array_getlimits_ushort( FT_Bytes table, FT_Bytes limit, FT_UShort* min, FT_UShort* max, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_set_length_by_ushort_offset( FT_UShort* offset, @@ -490,7 +490,7 @@ FT_BEGIN_HEADER FT_UShort* buff, FT_UInt nmemb, FT_UShort limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_set_length_by_ulong_offset( FT_ULong* offset, @@ -498,19 +498,19 @@ FT_BEGIN_HEADER FT_ULong* buff, FT_UInt nmemb, FT_ULong limit, - GXV_Validator valid); + GXV_Validator gxvalid); #define GXV_SUBTABLE_OFFSET_CHECK( _offset ) \ FT_BEGIN_STMNT \ - if ( (_offset) > valid->subtable_length ) \ + if ( (_offset) > gxvalid->subtable_length ) \ FT_INVALID_OFFSET; \ FT_END_STMNT #define GXV_SUBTABLE_LIMIT_CHECK( _count ) \ FT_BEGIN_STMNT \ - if ( ( p + (_count) - valid->subtable_start ) > \ - valid->subtable_length ) \ + if ( ( p + (_count) - gxvalid->subtable_start ) > \ + gxvalid->subtable_length ) \ FT_INVALID_TOO_SHORT; \ FT_END_STMNT @@ -556,7 +556,7 @@ FT_BEGIN_HEADER FT_LOCAL( void ) gxv_odtect_validate( GXV_odtect_Range odtect, - GXV_Validator valid ); + GXV_Validator gxvalid ); #define GXV_ODTECT( n, odtect ) \ diff --git a/freetype/src/gxvalid/gxvfeat.c b/freetype/src/gxvalid/gxvfeat.c index 6f7565099..69298b286 100644 --- a/freetype/src/gxvalid/gxvfeat.c +++ b/freetype/src/gxvalid/gxvfeat.c @@ -82,7 +82,7 @@ gxv_feat_registry_validate( FT_UShort feature, FT_UShort nSettings, FT_Bool exclusive, - GXV_Validator valid ) + GXV_Validator gxvalid ) { GXV_NAME_ENTER( "feature in registry" ); @@ -108,7 +108,7 @@ { /* Don't use here. Apple is reserved. */ GXV_TRACE(( "feature number %d is reserved by Apple\n", feature )); - if ( valid->root->level >= FT_VALIDATE_TIGHT ) + if ( gxvalid->root->level >= FT_VALIDATE_TIGHT ) FT_INVALID_DATA; } @@ -117,7 +117,7 @@ GXV_TRACE(( "feature %d: nSettings %d != defined nSettings %d\n", feature, nSettings, gxv_feat_registry[feature].nSettings )); - if ( valid->root->level >= FT_VALIDATE_TIGHT ) + if ( gxvalid->root->level >= FT_VALIDATE_TIGHT ) FT_INVALID_DATA; } @@ -125,7 +125,7 @@ { GXV_TRACE(( "exclusive flag %d differs from predefined value\n", exclusive )); - if ( valid->root->level >= FT_VALIDATE_TIGHT ) + if ( gxvalid->root->level >= FT_VALIDATE_TIGHT ) FT_INVALID_DATA; } @@ -137,7 +137,7 @@ static void gxv_feat_name_index_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -153,7 +153,7 @@ gxv_sfntName_validate( (FT_UShort)nameIndex, 255, 32768U, - valid ); + gxvalid ); GXV_EXIT; } @@ -163,7 +163,7 @@ gxv_feat_setting_validate( FT_Bytes table, FT_Bytes limit, FT_Bool exclusive, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort setting; @@ -179,7 +179,7 @@ if ( exclusive && ( setting & 1 ) == 0 ) FT_INVALID_DATA; - gxv_feat_name_index_validate( p, limit, valid ); + gxv_feat_name_index_validate( p, limit, gxvalid ); GXV_FEAT_DATA( setting ) = setting; @@ -190,7 +190,7 @@ static void gxv_feat_name_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UInt reserved_size = GXV_FEAT_DATA( reserved_size ); @@ -240,14 +240,14 @@ FT_INVALID_FORMAT; } - gxv_feat_registry_validate( feature, nSettings, exclusive, valid ); + gxv_feat_registry_validate( feature, nSettings, exclusive, gxvalid ); - gxv_feat_name_index_validate( p, limit, valid ); + gxv_feat_name_index_validate( p, limit, gxvalid ); - p = valid->root->base + settingTable; + p = gxvalid->root->base + settingTable; for ( last_setting = -1, i = 0; i < nSettings; i++ ) { - gxv_feat_setting_validate( p, limit, exclusive, valid ); + gxv_feat_setting_validate( p, limit, exclusive, gxvalid ); if ( (FT_Int)GXV_FEAT_DATA( setting ) <= last_setting ) GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT ); @@ -274,8 +274,8 @@ FT_Face face, FT_Validator ftvalid ) { - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; + GXV_ValidatorRec gxvalidrec; + GXV_Validator gxvalid = &gxvalidrec; GXV_feat_DataRec featrec; GXV_feat_Data feat = &featrec; @@ -289,9 +289,9 @@ FT_Int last_feature; - valid->root = ftvalid; - valid->table_data = feat; - valid->face = face; + gxvalid->root = ftvalid; + gxvalid->table_data = feat; + gxvalid->face = face; FT_TRACE3(( "validating `feat' table\n" )); GXV_INIT; @@ -323,7 +323,7 @@ for ( last_feature = -1, i = 0; i < featureNameCount; i++ ) { - gxv_feat_name_validate( p, limit, valid ); + gxv_feat_name_validate( p, limit, gxvalid ); if ( (FT_Int)GXV_FEAT_DATA( feature ) <= last_feature ) GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT ); diff --git a/freetype/src/gxvalid/gxvjust.c b/freetype/src/gxvalid/gxvjust.c index 7816e0b7f..24c26a565 100644 --- a/freetype/src/gxvalid/gxvjust.c +++ b/freetype/src/gxvalid/gxvjust.c @@ -4,7 +4,7 @@ /* */ /* TrueTypeGX/AAT just table validation (body). */ /* */ -/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* Copyright 2005, 2014 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -69,14 +69,14 @@ static void gxv_just_check_max_gid( FT_UShort gid, const FT_String* msg_tag, - GXV_Validator valid ) + GXV_Validator gxvalid ) { - if ( gid < valid->face->num_glyphs ) + if ( gid < gxvalid->face->num_glyphs ) return; GXV_TRACE(( "just table includes too large %s" " GID=%d > %d (in maxp)\n", - msg_tag, gid, valid->face->num_glyphs )); + msg_tag, gid, gxvalid->face->num_glyphs )); GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID ); } @@ -84,7 +84,7 @@ static void gxv_just_wdp_entry_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_ULong justClass; @@ -112,7 +112,7 @@ #endif /* According to Apple spec, only 7bits in justClass is used */ - if ( ( justClass & 0xFFFFFF80 ) != 0 ) + if ( ( justClass & 0xFFFFFF80UL ) != 0 ) { GXV_TRACE(( "just table includes non-zero value" " in unused justClass higher bits" @@ -120,14 +120,14 @@ GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA ); } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; } static void gxv_just_wdc_entry_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_ULong count, i; @@ -138,18 +138,18 @@ for ( i = 0; i < count; i++ ) { GXV_TRACE(( "validating wdc pair %d/%d\n", i + 1, count )); - gxv_just_wdp_entry_validate( p, limit, valid ); - p += valid->subtable_length; + gxv_just_wdp_entry_validate( p, limit, gxvalid ); + p += gxvalid->subtable_length; } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; } static void gxv_just_widthDeltaClusters_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table ; FT_Bytes wdc_end = table + GXV_JUST_DATA( wdc_offset_max ); @@ -163,11 +163,11 @@ for ( i = 0; p <= wdc_end; i++ ) { - gxv_just_wdc_entry_validate( p, limit, valid ); - p += valid->subtable_length; + gxv_just_wdc_entry_validate( p, limit, gxvalid ); + p += gxvalid->subtable_length; } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -176,7 +176,7 @@ static void gxv_just_actSubrecord_type0_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -214,17 +214,17 @@ GXV_LIMIT_CHECK( 2 ); glyphs = FT_NEXT_USHORT( p ); - gxv_just_check_max_gid( glyphs, "type0:glyphs", valid ); + gxv_just_check_max_gid( glyphs, "type0:glyphs", gxvalid ); } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; } static void gxv_just_actSubrecord_type1_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort addGlyph; @@ -233,20 +233,20 @@ GXV_LIMIT_CHECK( 2 ); addGlyph = FT_NEXT_USHORT( p ); - gxv_just_check_max_gid( addGlyph, "type1:addGlyph", valid ); + gxv_just_check_max_gid( addGlyph, "type1:addGlyph", gxvalid ); - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; } static void gxv_just_actSubrecord_type2_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; #ifdef GXV_LOAD_UNUSED_VARS - FT_Fixed substThreshhold; /* Apple misspelled "Threshhold" */ + FT_Fixed substThreshhold; /* Apple misspelled "Threshhold" */ #endif FT_UShort addGlyph; FT_UShort substGlyph; @@ -262,18 +262,18 @@ substGlyph = FT_NEXT_USHORT( p ); if ( addGlyph != 0xFFFF ) - gxv_just_check_max_gid( addGlyph, "type2:addGlyph", valid ); + gxv_just_check_max_gid( addGlyph, "type2:addGlyph", gxvalid ); - gxv_just_check_max_gid( substGlyph, "type2:substGlyph", valid ); + gxv_just_check_max_gid( substGlyph, "type2:substGlyph", gxvalid ); - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; } static void gxv_just_actSubrecord_type4_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_ULong variantsAxis; @@ -288,9 +288,9 @@ noStretchValue = FT_NEXT_ULONG( p ); maximumLimit = FT_NEXT_ULONG( p ); - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; - if ( variantsAxis != 0x64756374 ) /* 'duct' */ + if ( variantsAxis != 0x64756374L ) /* 'duct' */ GXV_TRACE(( "variantsAxis 0x%08x is non default value", variantsAxis )); @@ -310,7 +310,7 @@ static void gxv_just_actSubrecord_type5_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort flags; @@ -324,9 +324,9 @@ if ( flags ) GXV_TRACE(( "type5: nonzero value 0x%04x in unused flags\n", flags )); - gxv_just_check_max_gid( glyph, "type5:glyph", valid ); + gxv_just_check_max_gid( glyph, "type5:glyph", gxvalid ); - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; } @@ -334,7 +334,7 @@ static void gxv_just_actSubrecord_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort actionClass; @@ -354,21 +354,21 @@ GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA ); if ( actionType == 0 ) - gxv_just_actSubrecord_type0_validate( p, limit, valid ); + gxv_just_actSubrecord_type0_validate( p, limit, gxvalid ); else if ( actionType == 1 ) - gxv_just_actSubrecord_type1_validate( p, limit, valid ); + gxv_just_actSubrecord_type1_validate( p, limit, gxvalid ); else if ( actionType == 2 ) - gxv_just_actSubrecord_type2_validate( p, limit, valid ); + gxv_just_actSubrecord_type2_validate( p, limit, gxvalid ); else if ( actionType == 3 ) ; /* Stretch glyph action: no actionData */ else if ( actionType == 4 ) - gxv_just_actSubrecord_type4_validate( p, limit, valid ); + gxv_just_actSubrecord_type4_validate( p, limit, gxvalid ); else if ( actionType == 5 ) - gxv_just_actSubrecord_type5_validate( p, limit, valid ); + gxv_just_actSubrecord_type5_validate( p, limit, gxvalid ); else FT_INVALID_DATA; - valid->subtable_length = actionLength; + gxvalid->subtable_length = actionLength; GXV_EXIT; } @@ -377,7 +377,7 @@ static void gxv_just_pcActionRecord_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_ULong actionCount; @@ -390,11 +390,11 @@ for ( i = 0; i < actionCount; i++ ) { - gxv_just_actSubrecord_validate( p, limit, valid ); - p += valid->subtable_length; + gxv_just_actSubrecord_validate( p, limit, gxvalid ); + p += gxvalid->subtable_length; } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -403,7 +403,7 @@ static void gxv_just_pcTable_LookupValue_entry_validate( FT_UShort glyph, GXV_LookupValueCPtr value_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UNUSED( glyph ); @@ -417,19 +417,19 @@ static void gxv_just_pcLookupTable_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { - FT_Bytes p = table; + FT_Bytes p = table; GXV_NAME_ENTER( "just pcLookupTable" ); GXV_JUST_DATA( pc_offset_max ) = 0x0000; GXV_JUST_DATA( pc_offset_min ) = 0xFFFFU; - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_just_pcTable_LookupValue_entry_validate; + gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + gxvalid->lookupval_func = gxv_just_pcTable_LookupValue_entry_validate; - gxv_LookupTable_validate( p, limit, valid ); + gxv_LookupTable_validate( p, limit, gxvalid ); /* subtable_length is set by gxv_LookupTable_validate() */ @@ -440,20 +440,20 @@ static void gxv_just_postcompTable_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; GXV_NAME_ENTER( "just postcompTable" ); - gxv_just_pcLookupTable_validate( p, limit, valid ); - p += valid->subtable_length; + gxv_just_pcLookupTable_validate( p, limit, gxvalid ); + p += gxvalid->subtable_length; - gxv_just_pcActionRecord_validate( p, limit, valid ); - p += valid->subtable_length; + gxv_just_pcActionRecord_validate( p, limit, gxvalid ); + p += gxvalid->subtable_length; - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -466,7 +466,7 @@ GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { #ifdef GXV_LOAD_UNUSED_VARS /* TODO: validate markClass & currentClass */ @@ -480,7 +480,7 @@ FT_UNUSED( glyphOffset_p ); FT_UNUSED( table ); FT_UNUSED( limit ); - FT_UNUSED( valid ); + FT_UNUSED( gxvalid ); #ifndef GXV_LOAD_UNUSED_VARS FT_UNUSED( flags ); @@ -496,7 +496,7 @@ static void gxv_just_justClassTable_validate ( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort length; @@ -521,14 +521,14 @@ GXV_TRACE(( " justClassTable: nonzero value (0x%08x)" " in unused subFeatureFlags\n", subFeatureFlags )); - valid->statetable.optdata = NULL; - valid->statetable.optdata_load_func = NULL; - valid->statetable.subtable_setup_func = NULL; - valid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE; - valid->statetable.entry_validate_func = + gxvalid->statetable.optdata = NULL; + gxvalid->statetable.optdata_load_func = NULL; + gxvalid->statetable.subtable_setup_func = NULL; + gxvalid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE; + gxvalid->statetable.entry_validate_func = gxv_just_classTable_entry_validate; - gxv_StateTable_validate( p, table + length, valid ); + gxv_StateTable_validate( p, table + length, gxvalid ); /* subtable_length is set by gxv_LookupTable_validate() */ @@ -539,7 +539,7 @@ static void gxv_just_wdcTable_LookupValue_validate( FT_UShort glyph, GXV_LookupValueCPtr value_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UNUSED( glyph ); @@ -553,7 +553,7 @@ static void gxv_just_justData_lookuptable_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -561,10 +561,10 @@ GXV_JUST_DATA( wdc_offset_max ) = 0x0000; GXV_JUST_DATA( wdc_offset_min ) = 0xFFFFU; - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_just_wdcTable_LookupValue_validate; + gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + gxvalid->lookupval_func = gxv_just_wdcTable_LookupValue_validate; - gxv_LookupTable_validate( p, limit, valid ); + gxv_LookupTable_validate( p, limit, gxvalid ); /* subtable_length is set by gxv_LookupTable_validate() */ @@ -578,7 +578,7 @@ static void gxv_just_justData_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { /* * following 3 offsets are measured from the start of `just' @@ -604,36 +604,36 @@ GXV_TRACE(( " (wdcTableOffset = 0x%04x)\n", wdcTableOffset )); GXV_TRACE(( " (pcTableOffset = 0x%04x)\n", pcTableOffset )); - gxv_just_justData_lookuptable_validate( p, limit, valid ); - gxv_odtect_add_range( p, valid->subtable_length, + gxv_just_justData_lookuptable_validate( p, limit, gxvalid ); + gxv_odtect_add_range( p, gxvalid->subtable_length, "just_LookupTable", odtect ); if ( wdcTableOffset ) { gxv_just_widthDeltaClusters_validate( - valid->root->base + wdcTableOffset, limit, valid ); - gxv_odtect_add_range( valid->root->base + wdcTableOffset, - valid->subtable_length, "just_wdcTable", odtect ); + gxvalid->root->base + wdcTableOffset, limit, gxvalid ); + gxv_odtect_add_range( gxvalid->root->base + wdcTableOffset, + gxvalid->subtable_length, "just_wdcTable", odtect ); } if ( pcTableOffset ) { - gxv_just_postcompTable_validate( valid->root->base + pcTableOffset, - limit, valid ); - gxv_odtect_add_range( valid->root->base + pcTableOffset, - valid->subtable_length, "just_pcTable", odtect ); + gxv_just_postcompTable_validate( gxvalid->root->base + pcTableOffset, + limit, gxvalid ); + gxv_odtect_add_range( gxvalid->root->base + pcTableOffset, + gxvalid->subtable_length, "just_pcTable", odtect ); } if ( justClassTableOffset ) { gxv_just_justClassTable_validate( - valid->root->base + justClassTableOffset, limit, valid ); - gxv_odtect_add_range( valid->root->base + justClassTableOffset, - valid->subtable_length, "just_justClassTable", + gxvalid->root->base + justClassTableOffset, limit, gxvalid ); + gxv_odtect_add_range( gxvalid->root->base + justClassTableOffset, + gxvalid->subtable_length, "just_justClassTable", odtect ); } - gxv_odtect_validate( odtect, valid ); + gxv_odtect_validate( odtect, gxvalid ); GXV_EXIT; } @@ -647,8 +647,8 @@ FT_Bytes p = table; FT_Bytes limit = 0; - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; + GXV_ValidatorRec gxvalidrec; + GXV_Validator gxvalid = &gxvalidrec; GXV_just_DataRec justrec; GXV_just_Data just = &justrec; @@ -662,14 +662,14 @@ GXV_ODTECT_INIT( odtect ); - valid->root = ftvalid; - valid->table_data = just; - valid->face = face; + gxvalid->root = ftvalid; + gxvalid->table_data = just; + gxvalid->face = face; FT_TRACE3(( "validating `just' table\n" )); GXV_INIT; - limit = valid->root->limit; + limit = gxvalid->root->limit; GXV_LIMIT_CHECK( 4 + 2 + 2 + 2 ); version = FT_NEXT_ULONG( p ); @@ -696,19 +696,19 @@ /* validate justData */ if ( 0 < horizOffset ) { - gxv_just_justData_validate( table + horizOffset, limit, valid ); - gxv_odtect_add_range( table + horizOffset, valid->subtable_length, + gxv_just_justData_validate( table + horizOffset, limit, gxvalid ); + gxv_odtect_add_range( table + horizOffset, gxvalid->subtable_length, "horizJustData", odtect ); } if ( 0 < vertOffset ) { - gxv_just_justData_validate( table + vertOffset, limit, valid ); - gxv_odtect_add_range( table + vertOffset, valid->subtable_length, + gxv_just_justData_validate( table + vertOffset, limit, gxvalid ); + gxv_odtect_add_range( table + vertOffset, gxvalid->subtable_length, "vertJustData", odtect ); } - gxv_odtect_validate( odtect, valid ); + gxv_odtect_validate( odtect, gxvalid ); FT_TRACE4(( "\n" )); } diff --git a/freetype/src/gxvalid/gxvkern.c b/freetype/src/gxvalid/gxvkern.c index 557c5f1fe..787e3db83 100644 --- a/freetype/src/gxvalid/gxvkern.c +++ b/freetype/src/gxvalid/gxvkern.c @@ -79,20 +79,20 @@ #define GXV_KERN_DATA( field ) GXV_TABLE_DATA( kern, field ) -#define KERN_IS_CLASSIC( valid ) \ +#define KERN_IS_CLASSIC( gxvalid ) \ ( KERN_VERSION_CLASSIC == GXV_KERN_DATA( version ) ) -#define KERN_IS_NEW( valid ) \ +#define KERN_IS_NEW( gxvalid ) \ ( KERN_VERSION_NEW == GXV_KERN_DATA( version ) ) -#define KERN_DIALECT( valid ) \ +#define KERN_DIALECT( gxvalid ) \ GXV_KERN_DATA( dialect_request ) -#define KERN_ALLOWS_MS( valid ) \ - ( KERN_DIALECT( valid ) & KERN_DIALECT_MS ) -#define KERN_ALLOWS_APPLE( valid ) \ - ( KERN_DIALECT( valid ) & KERN_DIALECT_APPLE ) +#define KERN_ALLOWS_MS( gxvalid ) \ + ( KERN_DIALECT( gxvalid ) & KERN_DIALECT_MS ) +#define KERN_ALLOWS_APPLE( gxvalid ) \ + ( KERN_DIALECT( gxvalid ) & KERN_DIALECT_APPLE ) -#define GXV_KERN_HEADER_SIZE ( KERN_IS_NEW( valid ) ? 8 : 4 ) -#define GXV_KERN_SUBTABLE_HEADER_SIZE ( KERN_IS_NEW( valid ) ? 8 : 6 ) +#define GXV_KERN_HEADER_SIZE ( KERN_IS_NEW( gxvalid ) ? 8 : 4 ) +#define GXV_KERN_SUBTABLE_HEADER_SIZE ( KERN_IS_NEW( gxvalid ) ? 8 : 6 ) /*************************************************************************/ @@ -110,7 +110,7 @@ gxv_kern_subtable_fmt0_pairs_validate( FT_Bytes table, FT_Bytes limit, FT_UShort nPairs, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort i; @@ -134,11 +134,11 @@ /* left */ gid_left = FT_NEXT_USHORT( p ); - gxv_glyphid_validate( gid_left, valid ); + gxv_glyphid_validate( gid_left, gxvalid ); /* right */ gid_right = FT_NEXT_USHORT( p ); - gxv_glyphid_validate( gid_right, valid ); + gxv_glyphid_validate( gid_right, gxvalid ); /* Pairs of left and right GIDs must be unique and sorted. */ GXV_TRACE(( "left gid = %u, right gid = %u\n", gid_left, gid_right )); @@ -171,7 +171,7 @@ static void gxv_kern_subtable_fmt0_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table + GXV_KERN_SUBTABLE_HEADER_SIZE; @@ -186,10 +186,10 @@ /* nPairs, searchRange, entrySelector, rangeShift */ GXV_LIMIT_CHECK( 2 + 2 + 2 + 2 ); - gxv_BinSrchHeader_validate( p, limit, &unitSize, &nPairs, valid ); + gxv_BinSrchHeader_validate( p, limit, &unitSize, &nPairs, gxvalid ); p += 2 + 2 + 2 + 2; - gxv_kern_subtable_fmt0_pairs_validate( p, limit, nPairs, valid ); + gxv_kern_subtable_fmt0_pairs_validate( p, limit, nPairs, gxvalid ); GXV_EXIT; } @@ -209,11 +209,11 @@ static void gxv_kern_subtable_fmt1_valueTable_load( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; GXV_kern_fmt1_StateOptRecData optdata = - (GXV_kern_fmt1_StateOptRecData)valid->statetable.optdata; + (GXV_kern_fmt1_StateOptRecData)gxvalid->statetable.optdata; GXV_LIMIT_CHECK( 2 ); @@ -232,14 +232,14 @@ FT_UShort* classTable_length_p, FT_UShort* stateArray_length_p, FT_UShort* entryTable_length_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UShort o[4]; FT_UShort *l[4]; FT_UShort buff[5]; GXV_kern_fmt1_StateOptRecData optdata = - (GXV_kern_fmt1_StateOptRecData)valid->statetable.optdata; + (GXV_kern_fmt1_StateOptRecData)gxvalid->statetable.optdata; o[0] = classTable; @@ -251,7 +251,7 @@ l[2] = entryTable_length_p; l[3] = &(optdata->valueTable_length); - gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, valid ); + gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, gxvalid ); } @@ -265,7 +265,7 @@ GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { #ifdef GXV_LOAD_UNUSED_VARS FT_UShort push; @@ -289,7 +289,7 @@ { GXV_kern_fmt1_StateOptRecData vt_rec = - (GXV_kern_fmt1_StateOptRecData)valid->statetable.optdata; + (GXV_kern_fmt1_StateOptRecData)gxvalid->statetable.optdata; FT_Bytes p; @@ -311,7 +311,7 @@ static void gxv_kern_subtable_fmt1_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; GXV_kern_fmt1_StateOptRec vt_rec; @@ -319,18 +319,18 @@ GXV_NAME_ENTER( "kern subtable format 1" ); - valid->statetable.optdata = + gxvalid->statetable.optdata = &vt_rec; - valid->statetable.optdata_load_func = + gxvalid->statetable.optdata_load_func = gxv_kern_subtable_fmt1_valueTable_load; - valid->statetable.subtable_setup_func = + gxvalid->statetable.subtable_setup_func = gxv_kern_subtable_fmt1_subtable_setup; - valid->statetable.entry_glyphoffset_fmt = + gxvalid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE; - valid->statetable.entry_validate_func = + gxvalid->statetable.entry_validate_func = gxv_kern_subtable_fmt1_entry_validate; - gxv_StateTable_validate( p, limit, valid ); + gxv_StateTable_validate( p, limit, gxvalid ); GXV_EXIT; } @@ -373,7 +373,7 @@ gxv_kern_subtable_fmt2_clstbl_validate( FT_Bytes table, FT_Bytes limit, GXV_kern_ClassSpec spec, - GXV_Validator valid ) + GXV_Validator gxvalid ) { const FT_String* tag = GXV_KERN_FMT2_DATA( class_tag[spec] ); GXV_odtect_Range odtect = GXV_KERN_FMT2_DATA( odtect ); @@ -391,13 +391,13 @@ GXV_TRACE(( " %s firstGlyph=%d, nGlyphs=%d\n", tag, firstGlyph, nGlyphs )); - gxv_glyphid_validate( firstGlyph, valid ); - gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs - 1 ), valid ); + gxv_glyphid_validate( firstGlyph, gxvalid ); + gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs - 1 ), gxvalid ); gxv_array_getlimits_ushort( p, p + ( 2 * nGlyphs ), &( GXV_KERN_FMT2_DATA( offset_min[spec] ) ), &( GXV_KERN_FMT2_DATA( offset_max[spec] ) ), - valid ); + gxvalid ); gxv_odtect_add_range( table, 2 * nGlyphs, tag, odtect ); @@ -408,7 +408,7 @@ static void gxv_kern_subtable_fmt2_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { GXV_ODTECT( 3, odtect ); GXV_kern_subtable_fmt2_DataRec fmt2_rec = @@ -439,10 +439,10 @@ GXV_LIMIT_CHECK( GXV_KERN_FMT2_DATA( array ) ); gxv_kern_subtable_fmt2_clstbl_validate( table + leftOffsetTable, limit, - GXV_KERN_CLS_L, valid ); + GXV_KERN_CLS_L, gxvalid ); gxv_kern_subtable_fmt2_clstbl_validate( table + rightOffsetTable, limit, - GXV_KERN_CLS_R, valid ); + GXV_KERN_CLS_R, gxvalid ); if ( GXV_KERN_FMT2_DATA( offset_min[GXV_KERN_CLS_L] ) + GXV_KERN_FMT2_DATA( offset_min[GXV_KERN_CLS_R] ) @@ -455,7 +455,7 @@ - GXV_KERN_FMT2_DATA( array ), "array", odtect ); - gxv_odtect_validate( odtect, valid ); + gxv_odtect_validate( odtect, gxvalid ); GXV_EXIT; } @@ -466,7 +466,7 @@ static void gxv_kern_subtable_fmt3_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table + GXV_KERN_SUBTABLE_HEADER_SIZE; FT_UShort glyphCount; @@ -485,10 +485,10 @@ rightClassCount = FT_NEXT_BYTE( p ); flags = FT_NEXT_BYTE( p ); - if ( valid->face->num_glyphs != glyphCount ) + if ( gxvalid->face->num_glyphs != glyphCount ) { GXV_TRACE(( "maxGID=%d, but glyphCount=%d\n", - valid->face->num_glyphs, glyphCount )); + gxvalid->face->num_glyphs, glyphCount )); GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID ); } @@ -509,8 +509,8 @@ GXV_LIMIT_CHECK( glyphCount ); - gxv_array_getlimits_byte( p, p + glyphCount, &min, &max, valid ); - p += valid->subtable_length; + gxv_array_getlimits_byte( p, p + glyphCount, &min, &max, gxvalid ); + p += gxvalid->subtable_length; if ( leftClassCount < max ) FT_INVALID_DATA; @@ -524,8 +524,8 @@ GXV_LIMIT_CHECK( glyphCount ); - gxv_array_getlimits_byte( p, p + glyphCount, &min, &max, valid ); - p += valid->subtable_length; + gxv_array_getlimits_byte( p, p + glyphCount, &min, &max, gxvalid ); + p += gxvalid->subtable_length; if ( rightClassCount < max ) FT_INVALID_DATA; @@ -549,7 +549,7 @@ } } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -558,7 +558,7 @@ static FT_Bool gxv_kern_coverage_new_apple_validate( FT_UShort coverage, FT_UShort* format, - GXV_Validator valid ) + GXV_Validator gxvalid ) { /* new Apple-dialect */ #ifdef GXV_LOAD_TRACE_VARS @@ -567,7 +567,7 @@ FT_Bool kernVariation; #endif - FT_UNUSED( valid ); + FT_UNUSED( gxvalid ); /* reserved bits = 0 */ @@ -595,7 +595,7 @@ static FT_Bool gxv_kern_coverage_classic_apple_validate( FT_UShort coverage, FT_UShort* format, - GXV_Validator valid ) + GXV_Validator gxvalid ) { /* classic Apple-dialect */ #ifdef GXV_LOAD_TRACE_VARS @@ -605,7 +605,7 @@ /* check expected flags, but don't check if MS-dialect is impossible */ - if ( !( coverage & 0xFD00 ) && KERN_ALLOWS_MS( valid ) ) + if ( !( coverage & 0xFD00 ) && KERN_ALLOWS_MS( gxvalid ) ) return FALSE; /* reserved bits = 0 */ @@ -636,7 +636,7 @@ static FT_Bool gxv_kern_coverage_classic_microsoft_validate( FT_UShort coverage, FT_UShort* format, - GXV_Validator valid ) + GXV_Validator gxvalid ) { /* classic Microsoft-dialect */ #ifdef GXV_LOAD_TRACE_VARS @@ -646,7 +646,7 @@ FT_Bool override; #endif - FT_UNUSED( valid ); + FT_UNUSED( gxvalid ); /* reserved bits = 0 */ @@ -686,7 +686,7 @@ static GXV_kern_Dialect gxv_kern_coverage_validate( FT_UShort coverage, FT_UShort* format, - GXV_Validator valid ) + GXV_Validator gxvalid ) { GXV_kern_Dialect result = KERN_DIALECT_UNKNOWN; @@ -695,33 +695,33 @@ GXV_TRACE(( "interprete coverage 0x%04x by Apple style\n", coverage )); - if ( KERN_IS_NEW( valid ) ) + if ( KERN_IS_NEW( gxvalid ) ) { if ( gxv_kern_coverage_new_apple_validate( coverage, format, - valid ) ) + gxvalid ) ) { result = KERN_DIALECT_APPLE; goto Exit; } } - if ( KERN_IS_CLASSIC( valid ) && KERN_ALLOWS_APPLE( valid ) ) + if ( KERN_IS_CLASSIC( gxvalid ) && KERN_ALLOWS_APPLE( gxvalid ) ) { if ( gxv_kern_coverage_classic_apple_validate( coverage, format, - valid ) ) + gxvalid ) ) { result = KERN_DIALECT_APPLE; goto Exit; } } - if ( KERN_IS_CLASSIC( valid ) && KERN_ALLOWS_MS( valid ) ) + if ( KERN_IS_CLASSIC( gxvalid ) && KERN_ALLOWS_MS( gxvalid ) ) { if ( gxv_kern_coverage_classic_microsoft_validate( coverage, format, - valid ) ) + gxvalid ) ) { result = KERN_DIALECT_MS; goto Exit; @@ -739,7 +739,7 @@ static void gxv_kern_subtable_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; #ifdef GXV_LOAD_TRACE_VARS @@ -761,7 +761,7 @@ u16[1] = FT_NEXT_USHORT( p ); /* Apple: length_lo MS: length */ coverage = FT_NEXT_USHORT( p ); - switch ( gxv_kern_coverage_validate( coverage, &format, valid ) ) + switch ( gxv_kern_coverage_validate( coverage, &format, gxvalid ) ) { case KERN_DIALECT_MS: #ifdef GXV_LOAD_TRACE_VARS @@ -785,7 +785,7 @@ #endif GXV_TRACE(( "Subtable length = %d\n", length )); - if ( KERN_IS_NEW( valid ) ) + if ( KERN_IS_NEW( gxvalid ) ) { GXV_LIMIT_CHECK( 2 ); #ifdef GXV_LOAD_TRACE_VARS @@ -806,18 +806,18 @@ /* formats 1, 2, 3 require the position of the start of this subtable */ if ( format == 0 ) - gxv_kern_subtable_fmt0_validate( table, table + length, valid ); + gxv_kern_subtable_fmt0_validate( table, table + length, gxvalid ); else if ( format == 1 ) - gxv_kern_subtable_fmt1_validate( table, table + length, valid ); + gxv_kern_subtable_fmt1_validate( table, table + length, gxvalid ); else if ( format == 2 ) - gxv_kern_subtable_fmt2_validate( table, table + length, valid ); + gxv_kern_subtable_fmt2_validate( table, table + length, gxvalid ); else if ( format == 3 ) - gxv_kern_subtable_fmt3_validate( table, table + length, valid ); + gxv_kern_subtable_fmt3_validate( table, table + length, gxvalid ); else FT_INVALID_DATA; Exit: - valid->subtable_length = length; + gxvalid->subtable_length = length; GXV_EXIT; } @@ -837,8 +837,8 @@ GXV_kern_Dialect dialect_request, FT_Validator ftvalid ) { - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; + GXV_ValidatorRec gxvalidrec; + GXV_Validator gxvalid = &gxvalidrec; GXV_kern_DataRec kernrec; GXV_kern_Data kern = &kernrec; @@ -850,13 +850,13 @@ FT_UInt i; - valid->root = ftvalid; - valid->table_data = kern; - valid->face = face; + gxvalid->root = ftvalid; + gxvalid->table_data = kern; + gxvalid->face = face; FT_TRACE3(( "validating `kern' table\n" )); GXV_INIT; - KERN_DIALECT( valid ) = dialect_request; + KERN_DIALECT( gxvalid ) = dialect_request; GXV_LIMIT_CHECK( 2 ); GXV_KERN_DATA( version ) = (GXV_kern_Version)FT_NEXT_USHORT( p ); @@ -865,12 +865,12 @@ if ( 0x0001 < GXV_KERN_DATA( version ) ) FT_INVALID_FORMAT; - else if ( KERN_IS_CLASSIC( valid ) ) + else if ( KERN_IS_CLASSIC( gxvalid ) ) { GXV_LIMIT_CHECK( 2 ); nTables = FT_NEXT_USHORT( p ); } - else if ( KERN_IS_NEW( valid ) ) + else if ( KERN_IS_NEW( gxvalid ) ) { if ( classic_only ) FT_INVALID_FORMAT; @@ -886,8 +886,8 @@ { GXV_TRACE(( "validating subtable %d/%d\n", i, nTables )); /* p should be 32bit-aligned? */ - gxv_kern_subtable_validate( p, 0, valid ); - p += valid->subtable_length; + gxv_kern_subtable_validate( p, 0, gxvalid ); + p += gxvalid->subtable_length; } FT_TRACE4(( "\n" )); diff --git a/freetype/src/gxvalid/gxvlcar.c b/freetype/src/gxvalid/gxvlcar.c index f14fa5b13..48308b024 100644 --- a/freetype/src/gxvalid/gxvlcar.c +++ b/freetype/src/gxvalid/gxvlcar.c @@ -67,14 +67,14 @@ static void gxv_lcar_partial_validate( FT_UShort partial, FT_UShort glyph, - GXV_Validator valid ) + GXV_Validator gxvalid ) { GXV_NAME_ENTER( "partial" ); if ( GXV_LCAR_DATA( format ) != 1 ) goto Exit; - gxv_ctlPoint_validate( glyph, partial, valid ); + gxv_ctlPoint_validate( glyph, partial, gxvalid ); Exit: GXV_EXIT; @@ -84,10 +84,10 @@ static void gxv_lcar_LookupValue_validate( FT_UShort glyph, GXV_LookupValueCPtr value_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { - FT_Bytes p = valid->root->base + value_p->u; - FT_Bytes limit = valid->root->limit; + FT_Bytes p = gxvalid->root->base + value_p->u; + FT_Bytes limit = gxvalid->root->limit; FT_UShort count; FT_Short partial; FT_UShort i; @@ -102,7 +102,7 @@ for ( i = 0; i < count; i++ ) { partial = FT_NEXT_SHORT( p ); - gxv_lcar_partial_validate( partial, glyph, valid ); + gxv_lcar_partial_validate( partial, glyph, gxvalid ); } GXV_EXIT; @@ -148,7 +148,7 @@ gxv_lcar_LookupFmt4_transit( FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p; FT_Bytes limit; @@ -160,8 +160,8 @@ /* XXX: check range? */ offset = (FT_UShort)( base_value_p->u + relative_gindex * sizeof ( FT_UShort ) ); - p = valid->root->base + offset; - limit = valid->root->limit; + p = gxvalid->root->base + offset; + limit = gxvalid->root->limit; GXV_LIMIT_CHECK ( 2 ); value.u = FT_NEXT_USHORT( p ); @@ -185,8 +185,8 @@ { FT_Bytes p = table; FT_Bytes limit = 0; - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; + GXV_ValidatorRec gxvalidrec; + GXV_Validator gxvalid = &gxvalidrec; GXV_lcar_DataRec lcarrec; GXV_lcar_Data lcar = &lcarrec; @@ -194,9 +194,9 @@ FT_Fixed version; - valid->root = ftvalid; - valid->table_data = lcar; - valid->face = face; + gxvalid->root = ftvalid; + gxvalid->table_data = lcar; + gxvalid->face = face; FT_TRACE3(( "validating `lcar' table\n" )); GXV_INIT; @@ -211,10 +211,10 @@ if ( GXV_LCAR_DATA( format ) > 1 ) FT_INVALID_FORMAT; - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_lcar_LookupValue_validate; - valid->lookupfmt4_trans = gxv_lcar_LookupFmt4_transit; - gxv_LookupTable_validate( p, limit, valid ); + gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + gxvalid->lookupval_func = gxv_lcar_LookupValue_validate; + gxvalid->lookupfmt4_trans = gxv_lcar_LookupFmt4_transit; + gxv_LookupTable_validate( p, limit, gxvalid ); FT_TRACE4(( "\n" )); } diff --git a/freetype/src/gxvalid/gxvmort.c b/freetype/src/gxvalid/gxvmort.c index c4d49b32d..55ff5a851 100644 --- a/freetype/src/gxvalid/gxvmort.c +++ b/freetype/src/gxvalid/gxvmort.c @@ -40,7 +40,7 @@ static void gxv_mort_feature_validate( GXV_mort_feature f, - GXV_Validator valid ) + GXV_Validator gxvalid ) { if ( f->featureType >= gxv_feat_registry_length ) { @@ -89,7 +89,7 @@ gxv_mort_featurearray_validate( FT_Bytes table, FT_Bytes limit, FT_ULong nFeatureFlags, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_ULong i; @@ -106,22 +106,22 @@ f.enableFlags = FT_NEXT_ULONG( p ); f.disableFlags = FT_NEXT_ULONG( p ); - gxv_mort_feature_validate( &f, valid ); + gxv_mort_feature_validate( &f, gxvalid ); } if ( !IS_GXV_MORT_FEATURE_OFF( f ) ) FT_INVALID_DATA; - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } FT_LOCAL_DEF( void ) gxv_mort_coverage_validate( FT_UShort coverage, - GXV_Validator valid ) + GXV_Validator gxvalid ) { - FT_UNUSED( valid ); + FT_UNUSED( gxvalid ); #ifdef FT_DEBUG_LEVEL_TRACE if ( coverage & 0x8000U ) @@ -150,7 +150,7 @@ gxv_mort_subtables_validate( FT_Bytes table, FT_Bytes limit, FT_UShort nSubtables, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -198,7 +198,7 @@ rest = length - ( 2 + 2 + 4 ); GXV_LIMIT_CHECK( rest ); - gxv_mort_coverage_validate( coverage, valid ); + gxv_mort_coverage_validate( coverage, gxvalid ); if ( type > 5 ) FT_INVALID_FORMAT; @@ -207,13 +207,13 @@ if ( func == NULL ) GXV_TRACE(( "morx type %d is reserved\n", type )); - func( p, p + rest, valid ); + func( p, p + rest, gxvalid ); p += rest; /* TODO: validate subFeatureFlags */ } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -222,7 +222,7 @@ static void gxv_mort_chain_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; #ifdef GXV_LOAD_UNUSED_VARS @@ -246,10 +246,10 @@ nSubtables = FT_NEXT_USHORT( p ); gxv_mort_featurearray_validate( p, table + chainLength, - nFeatureFlags, valid ); - p += valid->subtable_length; - gxv_mort_subtables_validate( p, table + chainLength, nSubtables, valid ); - valid->subtable_length = chainLength; + nFeatureFlags, gxvalid ); + p += gxvalid->subtable_length; + gxv_mort_subtables_validate( p, table + chainLength, nSubtables, gxvalid ); + gxvalid->subtable_length = chainLength; /* TODO: validate defaultFlags */ GXV_EXIT; @@ -261,8 +261,8 @@ FT_Face face, FT_Validator ftvalid ) { - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; + GXV_ValidatorRec gxvalidrec; + GXV_Validator gxvalid = &gxvalidrec; FT_Bytes p = table; FT_Bytes limit = 0; FT_ULong version; @@ -270,9 +270,9 @@ FT_ULong i; - valid->root = ftvalid; - valid->face = face; - limit = valid->root->limit; + gxvalid->root = ftvalid; + gxvalid->face = face; + limit = gxvalid->root->limit; FT_TRACE3(( "validating `mort' table\n" )); GXV_INIT; @@ -288,8 +288,8 @@ { GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains )); GXV_32BIT_ALIGNMENT_VALIDATE( p - table ); - gxv_mort_chain_validate( p, limit, valid ); - p += valid->subtable_length; + gxv_mort_chain_validate( p, limit, gxvalid ); + p += gxvalid->subtable_length; } FT_TRACE4(( "\n" )); diff --git a/freetype/src/gxvalid/gxvmort.h b/freetype/src/gxvalid/gxvmort.h index 1e5a1f5ab..8e62e52db 100644 --- a/freetype/src/gxvalid/gxvmort.h +++ b/freetype/src/gxvalid/gxvmort.h @@ -55,36 +55,36 @@ gxv_mort_featurearray_validate( FT_Bytes table, FT_Bytes limit, FT_ULong nFeatureFlags, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_mort_coverage_validate( FT_UShort coverage, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_mort_subtable_type0_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_mort_subtable_type1_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_mort_subtable_type2_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_mort_subtable_type4_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_mort_subtable_type5_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); #endif /* __GXVMORT_H__ */ diff --git a/freetype/src/gxvalid/gxvmort0.c b/freetype/src/gxvalid/gxvmort0.c index b136ceda2..f19016efd 100644 --- a/freetype/src/gxvalid/gxvmort0.c +++ b/freetype/src/gxvalid/gxvmort0.c @@ -67,7 +67,7 @@ GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UShort markFirst; FT_UShort dontAdvance; @@ -125,7 +125,7 @@ FT_LOCAL_DEF( void ) gxv_mort_subtable_type0_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -135,14 +135,14 @@ GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE ); - valid->statetable.optdata = NULL; - valid->statetable.optdata_load_func = NULL; - valid->statetable.subtable_setup_func = NULL; - valid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE; - valid->statetable.entry_validate_func = + gxvalid->statetable.optdata = NULL; + gxvalid->statetable.optdata_load_func = NULL; + gxvalid->statetable.subtable_setup_func = NULL; + gxvalid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE; + gxvalid->statetable.entry_validate_func = gxv_mort_subtable_type0_entry_validate; - gxv_StateTable_validate( p, limit, valid ); + gxv_StateTable_validate( p, limit, gxvalid ); GXV_EXIT; } diff --git a/freetype/src/gxvalid/gxvmort1.c b/freetype/src/gxvalid/gxvmort1.c index 1c17a5d92..0189504ed 100644 --- a/freetype/src/gxvalid/gxvmort1.c +++ b/freetype/src/gxvalid/gxvmort1.c @@ -53,12 +53,12 @@ static void gxv_mort_subtable_type1_substitutionTable_load( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; GXV_mort_subtable_type1_StateOptRecData optdata = - (GXV_mort_subtable_type1_StateOptRecData)valid->statetable.optdata; + (GXV_mort_subtable_type1_StateOptRecData)gxvalid->statetable.optdata; GXV_LIMIT_CHECK( 2 ); @@ -74,14 +74,14 @@ FT_UShort* classTable_length_p, FT_UShort* stateArray_length_p, FT_UShort* entryTable_length_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UShort o[4]; FT_UShort *l[4]; FT_UShort buff[5]; GXV_mort_subtable_type1_StateOptRecData optdata = - (GXV_mort_subtable_type1_StateOptRecData)valid->statetable.optdata; + (GXV_mort_subtable_type1_StateOptRecData)gxvalid->statetable.optdata; o[0] = classTable; @@ -93,7 +93,7 @@ l[2] = entryTable_length_p; l[3] = &( optdata->substitutionTable_length ); - gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, valid ); + gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, gxvalid ); } @@ -102,7 +102,7 @@ FT_Short wordOffset, const FT_String* tag, FT_Byte state, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UShort substTable; FT_UShort substTable_limit; @@ -113,16 +113,16 @@ substTable = ((GXV_mort_subtable_type1_StateOptRec *) - (valid->statetable.optdata))->substitutionTable; + (gxvalid->statetable.optdata))->substitutionTable; substTable_limit = (FT_UShort)( substTable + ((GXV_mort_subtable_type1_StateOptRec *) - (valid->statetable.optdata))->substitutionTable_length ); + (gxvalid->statetable.optdata))->substitutionTable_length ); - valid->min_gid = (FT_UShort)( ( substTable - wordOffset * 2 ) / 2 ); - valid->max_gid = (FT_UShort)( ( substTable_limit - wordOffset * 2 ) / 2 ); - valid->max_gid = (FT_UShort)( FT_MAX( valid->max_gid, - valid->face->num_glyphs ) ); + gxvalid->min_gid = (FT_UShort)( ( substTable - wordOffset * 2 ) / 2 ); + gxvalid->max_gid = (FT_UShort)( ( substTable_limit - wordOffset * 2 ) / 2 ); + gxvalid->max_gid = (FT_UShort)( FT_MAX( gxvalid->max_gid, + gxvalid->face->num_glyphs ) ); /* XXX: check range? */ @@ -137,7 +137,7 @@ GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { #ifdef GXV_LOAD_UNUSED_VARS FT_UShort setMark; @@ -169,24 +169,24 @@ gxv_mort_subtable_type1_offset_to_subst_validate( markOffset, "markOffset", state, - valid ); + gxvalid ); gxv_mort_subtable_type1_offset_to_subst_validate( currentOffset, "currentOffset", state, - valid ); + gxvalid ); } static void gxv_mort_subtable_type1_substTable_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort num_gids = (FT_UShort)( ((GXV_mort_subtable_type1_StateOptRec *) - (valid->statetable.optdata))->substitutionTable_length / 2 ); + (gxvalid->statetable.optdata))->substitutionTable_length / 2 ); FT_UShort i; @@ -202,11 +202,11 @@ if ( dst_gid >= 0xFFFFU ) continue; - if ( dst_gid < valid->min_gid || valid->max_gid < dst_gid ) + if ( dst_gid < gxvalid->min_gid || gxvalid->max_gid < dst_gid ) { GXV_TRACE(( "substTable include a strange gid[%d]=%d >" " out of define range (%d..%d)\n", - i, dst_gid, valid->min_gid, valid->max_gid )); + i, dst_gid, gxvalid->min_gid, gxvalid->max_gid )); GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID ); } } @@ -223,7 +223,7 @@ FT_LOCAL_DEF( void ) gxv_mort_subtable_type1_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -234,23 +234,23 @@ GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE ); - valid->statetable.optdata = + gxvalid->statetable.optdata = &st_rec; - valid->statetable.optdata_load_func = + gxvalid->statetable.optdata_load_func = gxv_mort_subtable_type1_substitutionTable_load; - valid->statetable.subtable_setup_func = + gxvalid->statetable.subtable_setup_func = gxv_mort_subtable_type1_subtable_setup; - valid->statetable.entry_glyphoffset_fmt = + gxvalid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_ULONG; - valid->statetable.entry_validate_func = + gxvalid->statetable.entry_validate_func = gxv_mort_subtable_type1_entry_validate; - gxv_StateTable_validate( p, limit, valid ); + gxv_StateTable_validate( p, limit, gxvalid ); gxv_mort_subtable_type1_substTable_validate( table + st_rec.substitutionTable, table + st_rec.substitutionTable + st_rec.substitutionTable_length, - valid ); + gxvalid ); GXV_EXIT; } diff --git a/freetype/src/gxvalid/gxvmort2.c b/freetype/src/gxvalid/gxvmort2.c index 9e08fb792..099ffd48c 100644 --- a/freetype/src/gxvalid/gxvmort2.c +++ b/freetype/src/gxvalid/gxvmort2.c @@ -57,11 +57,11 @@ static void gxv_mort_subtable_type2_opttable_load( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { - FT_Bytes p = table; + FT_Bytes p = table; GXV_mort_subtable_type2_StateOptRecData optdata = - (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata; + (GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata; GXV_LIMIT_CHECK( 2 + 2 + 2 ); @@ -86,14 +86,14 @@ FT_UShort *classTable_length_p, FT_UShort *stateArray_length_p, FT_UShort *entryTable_length_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UShort o[6]; FT_UShort *l[6]; FT_UShort buff[7]; GXV_mort_subtable_type2_StateOptRecData optdata = - (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata; + (GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata; GXV_NAME_ENTER( "subtable boundaries setup" ); @@ -111,7 +111,7 @@ l[4] = &(optdata->componentTable_length); l[5] = &(optdata->ligatureTable_length); - gxv_set_length_by_ushort_offset( o, l, buff, 6, table_size, valid ); + gxv_set_length_by_ushort_offset( o, l, buff, 6, table_size, gxvalid ); GXV_TRACE(( "classTable: offset=0x%04x length=0x%04x\n", classTable, *classTable_length_p )); @@ -137,11 +137,11 @@ gxv_mort_subtable_type2_ligActionOffset_validate( FT_Bytes table, FT_UShort ligActionOffset, - GXV_Validator valid ) + GXV_Validator gxvalid ) { /* access ligActionTable */ GXV_mort_subtable_type2_StateOptRecData optdata = - (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata; + (GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata; FT_Bytes lat_base = table + optdata->ligActionTable; FT_Bytes p = table + ligActionOffset; @@ -214,7 +214,7 @@ GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { #ifdef GXV_LOAD_UNUSED_VARS FT_UShort setComponent; @@ -236,16 +236,16 @@ if ( 0 < offset ) gxv_mort_subtable_type2_ligActionOffset_validate( table, offset, - valid ); + gxvalid ); } static void gxv_mort_subtable_type2_ligatureTable_validate( FT_Bytes table, - GXV_Validator valid ) + GXV_Validator gxvalid ) { GXV_mort_subtable_type2_StateOptRecData optdata = - (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata; + (GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata; FT_Bytes p = table + optdata->ligatureTable; FT_Bytes limit = table + optdata->ligatureTable @@ -264,7 +264,7 @@ GXV_LIMIT_CHECK( 2 ); lig_gid = FT_NEXT_USHORT( p ); - if ( valid->face->num_glyphs < lig_gid ) + if ( gxvalid->face->num_glyphs < lig_gid ) GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID ); } } @@ -275,7 +275,7 @@ FT_LOCAL_DEF( void ) gxv_mort_subtable_type2_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -286,23 +286,23 @@ GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE ); - valid->statetable.optdata = + gxvalid->statetable.optdata = &lig_rec; - valid->statetable.optdata_load_func = + gxvalid->statetable.optdata_load_func = gxv_mort_subtable_type2_opttable_load; - valid->statetable.subtable_setup_func = + gxvalid->statetable.subtable_setup_func = gxv_mort_subtable_type2_subtable_setup; - valid->statetable.entry_glyphoffset_fmt = + gxvalid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE; - valid->statetable.entry_validate_func = + gxvalid->statetable.entry_validate_func = gxv_mort_subtable_type2_entry_validate; - gxv_StateTable_validate( p, limit, valid ); + gxv_StateTable_validate( p, limit, gxvalid ); - p += valid->subtable_length; - gxv_mort_subtable_type2_ligatureTable_validate( table, valid ); + p += gxvalid->subtable_length; + gxv_mort_subtable_type2_ligatureTable_validate( table, gxvalid ); - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } diff --git a/freetype/src/gxvalid/gxvmort4.c b/freetype/src/gxvalid/gxvmort4.c index 83470988c..9e86af4dd 100644 --- a/freetype/src/gxvalid/gxvmort4.c +++ b/freetype/src/gxvalid/gxvmort4.c @@ -41,11 +41,11 @@ static void gxv_mort_subtable_type4_lookupval_validate( FT_UShort glyph, GXV_LookupValueCPtr value_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UNUSED( glyph ); - gxv_glyphid_validate( value_p->u, valid ); + gxv_glyphid_validate( value_p->u, gxvalid ); } /* @@ -80,7 +80,7 @@ FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p; FT_Bytes limit; @@ -91,7 +91,7 @@ offset = (FT_UShort)( base_value_p->u + relative_gindex * sizeof ( FT_UShort ) ); - p = valid->lookuptbl_head + offset; + p = gxvalid->lookuptbl_head + offset; limit = lookuptbl_limit; GXV_LIMIT_CHECK( 2 ); @@ -104,7 +104,7 @@ FT_LOCAL_DEF( void ) gxv_mort_subtable_type4_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -112,11 +112,11 @@ GXV_NAME_ENTER( "mort chain subtable type4 " "(Non-Contextual Glyph Substitution)" ); - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_mort_subtable_type4_lookupval_validate; - valid->lookupfmt4_trans = gxv_mort_subtable_type4_lookupfmt4_transit; + gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + gxvalid->lookupval_func = gxv_mort_subtable_type4_lookupval_validate; + gxvalid->lookupfmt4_trans = gxv_mort_subtable_type4_lookupfmt4_transit; - gxv_LookupTable_validate( p, limit, valid ); + gxv_LookupTable_validate( p, limit, gxvalid ); GXV_EXIT; } diff --git a/freetype/src/gxvalid/gxvmort5.c b/freetype/src/gxvalid/gxvmort5.c index 32cfb0363..9498b1085 100644 --- a/freetype/src/gxvalid/gxvmort5.c +++ b/freetype/src/gxvalid/gxvmort5.c @@ -70,10 +70,10 @@ FT_UShort* classTable_length_p, FT_UShort* stateArray_length_p, FT_UShort* entryTable_length_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { GXV_mort_subtable_type5_StateOptRecData optdata = - (GXV_mort_subtable_type5_StateOptRecData)valid->statetable.optdata; + (GXV_mort_subtable_type5_StateOptRecData)gxvalid->statetable.optdata; gxv_StateTable_subtable_setup( table_size, @@ -83,7 +83,7 @@ classTable_length_p, stateArray_length_p, entryTable_length_p, - valid ); + gxvalid ); optdata->classTable = classTable; optdata->stateArray = stateArray; @@ -100,7 +100,7 @@ FT_UShort count, FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { /* * We don't know the range of insertion-glyph-list. @@ -109,7 +109,7 @@ FT_Bytes p = table + offset; GXV_mort_subtable_type5_StateOptRecData optdata = - (GXV_mort_subtable_type5_StateOptRecData)valid->statetable.optdata; + (GXV_mort_subtable_type5_StateOptRecData)gxvalid->statetable.optdata; if ( optdata->classTable < offset && offset < optdata->classTable + *(optdata->classTable_length_p) ) @@ -145,7 +145,7 @@ GXV_StateTable_GlyphOffsetCPtr glyphOffset, FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { #ifdef GXV_LOAD_UNUSED_VARS FT_Bool setMark; @@ -184,7 +184,7 @@ currentInsertCount, table, limit, - valid ); + gxvalid ); } if ( 0 != markedInsertList && 0 != markedInsertCount ) @@ -193,7 +193,7 @@ markedInsertCount, table, limit, - valid ); + gxvalid ); } } @@ -201,7 +201,7 @@ FT_LOCAL_DEF( void ) gxv_mort_subtable_type5_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -213,18 +213,18 @@ GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE5_HEADER_SIZE ); - valid->statetable.optdata = + gxvalid->statetable.optdata = et; - valid->statetable.optdata_load_func = + gxvalid->statetable.optdata_load_func = NULL; - valid->statetable.subtable_setup_func = + gxvalid->statetable.subtable_setup_func = gxv_mort_subtable_type5_subtable_setup; - valid->statetable.entry_glyphoffset_fmt = + gxvalid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_ULONG; - valid->statetable.entry_validate_func = + gxvalid->statetable.entry_validate_func = gxv_mort_subtable_type5_entry_validate; - gxv_StateTable_validate( p, limit, valid ); + gxv_StateTable_validate( p, limit, gxvalid ); GXV_EXIT; } diff --git a/freetype/src/gxvalid/gxvmorx.c b/freetype/src/gxvalid/gxvmorx.c index 5ae04d321..96dba631c 100644 --- a/freetype/src/gxvalid/gxvmorx.c +++ b/freetype/src/gxvalid/gxvmorx.c @@ -42,7 +42,7 @@ gxv_morx_subtables_validate( FT_Bytes table, FT_Bytes limit, FT_UShort nSubtables, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -93,7 +93,7 @@ /* morx coverage consists of mort_coverage & 16bit padding */ gxv_mort_coverage_validate( (FT_UShort)( ( coverage >> 16 ) | coverage ), - valid ); + gxvalid ); if ( type > 5 ) FT_INVALID_FORMAT; @@ -101,13 +101,13 @@ if ( func == NULL ) GXV_TRACE(( "morx type %d is reserved\n", type )); - func( p, p + rest, valid ); + func( p, p + rest, gxvalid ); /* TODO: subFeatureFlags should be unique in a table? */ p += rest; } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -116,7 +116,7 @@ static void gxv_morx_chain_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; #ifdef GXV_LOAD_UNUSED_VARS @@ -140,16 +140,16 @@ nSubtables = FT_NEXT_ULONG( p ); /* feature-array of morx is same with that of mort */ - gxv_mort_featurearray_validate( p, limit, nFeatureFlags, valid ); - p += valid->subtable_length; + gxv_mort_featurearray_validate( p, limit, nFeatureFlags, gxvalid ); + p += gxvalid->subtable_length; if ( nSubtables >= 0x10000L ) FT_INVALID_DATA; gxv_morx_subtables_validate( p, table + chainLength, - (FT_UShort)nSubtables, valid ); + (FT_UShort)nSubtables, gxvalid ); - valid->subtable_length = chainLength; + gxvalid->subtable_length = chainLength; /* TODO: defaultFlags should be compared with the flags in tables */ @@ -162,8 +162,8 @@ FT_Face face, FT_Validator ftvalid ) { - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; + GXV_ValidatorRec gxvalidrec; + GXV_Validator gxvalid = &gxvalidrec; FT_Bytes p = table; FT_Bytes limit = 0; FT_ULong version; @@ -171,8 +171,8 @@ FT_ULong i; - valid->root = ftvalid; - valid->face = face; + gxvalid->root = ftvalid; + gxvalid->face = face; FT_TRACE3(( "validating `morx' table\n" )); GXV_INIT; @@ -188,8 +188,8 @@ { GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains )); GXV_32BIT_ALIGNMENT_VALIDATE( p - table ); - gxv_morx_chain_validate( p, limit, valid ); - p += valid->subtable_length; + gxv_morx_chain_validate( p, limit, gxvalid ); + p += gxvalid->subtable_length; } FT_TRACE4(( "\n" )); diff --git a/freetype/src/gxvalid/gxvmorx.h b/freetype/src/gxvalid/gxvmorx.h index 28c1a44f6..9ed907acd 100644 --- a/freetype/src/gxvalid/gxvmorx.h +++ b/freetype/src/gxvalid/gxvmorx.h @@ -38,27 +38,27 @@ FT_LOCAL( void ) gxv_morx_subtable_type0_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_morx_subtable_type1_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_morx_subtable_type2_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_morx_subtable_type4_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); FT_LOCAL( void ) gxv_morx_subtable_type5_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ); + GXV_Validator gxvalid ); #endif /* __GXVMORX_H__ */ diff --git a/freetype/src/gxvalid/gxvmorx0.c b/freetype/src/gxvalid/gxvmorx0.c index 6a736c177..db165f4e8 100644 --- a/freetype/src/gxvalid/gxvmorx0.c +++ b/freetype/src/gxvalid/gxvmorx0.c @@ -45,7 +45,7 @@ GXV_XStateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { #ifdef GXV_LOAD_UNUSED_VARS FT_UShort markFirst; @@ -85,7 +85,7 @@ FT_LOCAL_DEF( void ) gxv_morx_subtable_type0_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -95,14 +95,14 @@ GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE ); - valid->xstatetable.optdata = NULL; - valid->xstatetable.optdata_load_func = NULL; - valid->xstatetable.subtable_setup_func = NULL; - valid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE; - valid->xstatetable.entry_validate_func = + gxvalid->xstatetable.optdata = NULL; + gxvalid->xstatetable.optdata_load_func = NULL; + gxvalid->xstatetable.subtable_setup_func = NULL; + gxvalid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE; + gxvalid->xstatetable.entry_validate_func = gxv_morx_subtable_type0_entry_validate; - gxv_XStateTable_validate( p, limit, valid ); + gxv_XStateTable_validate( p, limit, gxvalid ); GXV_EXIT; } diff --git a/freetype/src/gxvalid/gxvmorx1.c b/freetype/src/gxvalid/gxvmorx1.c index ce0009a16..49f53d185 100644 --- a/freetype/src/gxvalid/gxvmorx1.c +++ b/freetype/src/gxvalid/gxvmorx1.c @@ -55,12 +55,12 @@ static void gxv_morx_subtable_type1_substitutionTable_load( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; GXV_morx_subtable_type1_StateOptRecData optdata = - (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata; + (GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata; GXV_LIMIT_CHECK( 2 ); @@ -76,14 +76,14 @@ FT_ULong* classTable_length_p, FT_ULong* stateArray_length_p, FT_ULong* entryTable_length_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_ULong o[4]; FT_ULong *l[4]; FT_ULong buff[5]; GXV_morx_subtable_type1_StateOptRecData optdata = - (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata; + (GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata; o[0] = classTable; @@ -95,7 +95,7 @@ l[2] = entryTable_length_p; l[3] = &(optdata->substitutionTable_length); - gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, valid ); + gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, gxvalid ); } @@ -106,7 +106,7 @@ GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { #ifdef GXV_LOAD_TRACE_VARS FT_UShort setMark; @@ -117,7 +117,7 @@ FT_Short currentIndex; GXV_morx_subtable_type1_StateOptRecData optdata = - (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata; + (GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata; FT_UNUSED( state ); FT_UNUSED( table ); @@ -159,13 +159,13 @@ static void gxv_morx_subtable_type1_LookupValue_validate( FT_UShort glyph, GXV_LookupValueCPtr value_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_UNUSED( glyph ); /* for the non-debugging case */ GXV_TRACE(( "morx subtable type1 subst.: %d -> %d\n", glyph, value_p->u )); - if ( value_p->u > valid->face->num_glyphs ) + if ( value_p->u > gxvalid->face->num_glyphs ) FT_INVALID_GLYPH_ID; } @@ -175,7 +175,7 @@ FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p; FT_Bytes limit; @@ -186,7 +186,7 @@ offset = (FT_UShort)( base_value_p->u + relative_gindex * sizeof ( FT_UShort ) ); - p = valid->lookuptbl_head + offset; + p = gxvalid->lookuptbl_head + offset; limit = lookuptbl_limit; GXV_LIMIT_CHECK ( 2 ); @@ -202,19 +202,19 @@ static void gxv_morx_subtable_type1_substitutionTable_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort i; GXV_morx_subtable_type1_StateOptRecData optdata = - (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata; + (GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata; /* TODO: calculate offset/length for each lookupTables */ - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_morx_subtable_type1_LookupValue_validate; - valid->lookupfmt4_trans = gxv_morx_subtable_type1_LookupFmt4_transit; + gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + gxvalid->lookupval_func = gxv_morx_subtable_type1_LookupValue_validate; + gxvalid->lookupfmt4_trans = gxv_morx_subtable_type1_LookupFmt4_transit; for ( i = 0; i < optdata->substitutionTable_num_lookupTables; i++ ) { @@ -224,7 +224,7 @@ GXV_LIMIT_CHECK( 4 ); offset = FT_NEXT_ULONG( p ); - gxv_LookupTable_validate( table + offset, limit, valid ); + gxv_LookupTable_validate( table + offset, limit, gxvalid ); } /* TODO: overlapping of lookupTables in substitutionTable */ @@ -239,7 +239,7 @@ FT_LOCAL_DEF( void ) gxv_morx_subtable_type1_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -252,23 +252,23 @@ st_rec.substitutionTable_num_lookupTables = 0; - valid->xstatetable.optdata = + gxvalid->xstatetable.optdata = &st_rec; - valid->xstatetable.optdata_load_func = + gxvalid->xstatetable.optdata_load_func = gxv_morx_subtable_type1_substitutionTable_load; - valid->xstatetable.subtable_setup_func = + gxvalid->xstatetable.subtable_setup_func = gxv_morx_subtable_type1_subtable_setup; - valid->xstatetable.entry_glyphoffset_fmt = + gxvalid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_ULONG; - valid->xstatetable.entry_validate_func = + gxvalid->xstatetable.entry_validate_func = gxv_morx_subtable_type1_entry_validate; - gxv_XStateTable_validate( p, limit, valid ); + gxv_XStateTable_validate( p, limit, gxvalid ); gxv_morx_subtable_type1_substitutionTable_validate( table + st_rec.substitutionTable, table + st_rec.substitutionTable + st_rec.substitutionTable_length, - valid ); + gxvalid ); GXV_EXIT; } diff --git a/freetype/src/gxvalid/gxvmorx2.c b/freetype/src/gxvalid/gxvmorx2.c index 95b8ea40b..e44445d14 100644 --- a/freetype/src/gxvalid/gxvmorx2.c +++ b/freetype/src/gxvalid/gxvmorx2.c @@ -58,12 +58,12 @@ static void gxv_morx_subtable_type2_opttable_load( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; GXV_morx_subtable_type2_StateOptRecData optdata = - (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata; + (GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata; GXV_LIMIT_CHECK( 4 + 4 + 4 ); @@ -88,14 +88,14 @@ FT_ULong* classTable_length_p, FT_ULong* stateArray_length_p, FT_ULong* entryTable_length_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_ULong o[6]; FT_ULong* l[6]; FT_ULong buff[7]; GXV_morx_subtable_type2_StateOptRecData optdata = - (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata; + (GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata; GXV_NAME_ENTER( "subtable boundaries setup" ); @@ -113,7 +113,7 @@ l[4] = &(optdata->componentTable_length); l[5] = &(optdata->ligatureTable_length); - gxv_set_length_by_ulong_offset( o, l, buff, 6, table_size, valid ); + gxv_set_length_by_ulong_offset( o, l, buff, 6, table_size, gxvalid ); GXV_TRACE(( "classTable: offset=0x%08x length=0x%08x\n", classTable, *classTable_length_p )); @@ -142,11 +142,11 @@ gxv_morx_subtable_type2_ligActionIndex_validate( FT_Bytes table, FT_UShort ligActionIndex, - GXV_Validator valid ) + GXV_Validator gxvalid ) { /* access ligActionTable */ GXV_morx_subtable_type2_StateOptRecData optdata = - (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata; + (GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata; FT_Bytes lat_base = table + optdata->ligActionTable; FT_Bytes p = lat_base + @@ -188,7 +188,7 @@ /* it is different from the location offset in mort */ if ( ( offset & 0x3FFF0000UL ) == 0x3FFF0000UL ) { /* negative offset */ - gid_limit = valid->face->num_glyphs - ( offset & 0x0000FFFFUL ); + gid_limit = gxvalid->face->num_glyphs - ( offset & 0x0000FFFFUL ); if ( gid_limit > 0 ) return; @@ -198,9 +198,9 @@ offset & 0xFFFFU )); GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET ); } - else if ( ( offset & 0x3FFF0000UL ) == 0x0000000UL ) + else if ( ( offset & 0x3FFF0000UL ) == 0x00000000UL ) { /* positive offset */ - if ( (FT_Long)offset < valid->face->num_glyphs ) + if ( (FT_Long)offset < gxvalid->face->num_glyphs ) return; GXV_TRACE(( "ligature action table includes" @@ -225,7 +225,7 @@ GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { #ifdef GXV_LOAD_UNUSED_VARS FT_UShort setComponent; @@ -253,16 +253,16 @@ if ( 0 < ligActionIndex ) gxv_morx_subtable_type2_ligActionIndex_validate( - table, ligActionIndex, valid ); + table, ligActionIndex, gxvalid ); } static void gxv_morx_subtable_type2_ligatureTable_validate( FT_Bytes table, - GXV_Validator valid ) + GXV_Validator gxvalid ) { GXV_morx_subtable_type2_StateOptRecData optdata = - (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata; + (GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata; FT_Bytes p = table + optdata->ligatureTable; FT_Bytes limit = table + optdata->ligatureTable @@ -281,7 +281,7 @@ GXV_LIMIT_CHECK( 2 ); lig_gid = FT_NEXT_USHORT( p ); - if ( lig_gid < valid->face->num_glyphs ) + if ( lig_gid < gxvalid->face->num_glyphs ) GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID ); } } @@ -293,7 +293,7 @@ FT_LOCAL_DEF( void ) gxv_morx_subtable_type2_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -304,23 +304,23 @@ GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE ); - valid->xstatetable.optdata = + gxvalid->xstatetable.optdata = &lig_rec; - valid->xstatetable.optdata_load_func = + gxvalid->xstatetable.optdata_load_func = gxv_morx_subtable_type2_opttable_load; - valid->xstatetable.subtable_setup_func = + gxvalid->xstatetable.subtable_setup_func = gxv_morx_subtable_type2_subtable_setup; - valid->xstatetable.entry_glyphoffset_fmt = + gxvalid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_USHORT; - valid->xstatetable.entry_validate_func = + gxvalid->xstatetable.entry_validate_func = gxv_morx_subtable_type2_entry_validate; - gxv_XStateTable_validate( p, limit, valid ); + gxv_XStateTable_validate( p, limit, gxvalid ); #if 0 - p += valid->subtable_length; + p += gxvalid->subtable_length; #endif - gxv_morx_subtable_type2_ligatureTable_validate( table, valid ); + gxv_morx_subtable_type2_ligatureTable_validate( table, gxvalid ); GXV_EXIT; } diff --git a/freetype/src/gxvalid/gxvmorx4.c b/freetype/src/gxvalid/gxvmorx4.c index c0d2f78e3..68ab67849 100644 --- a/freetype/src/gxvalid/gxvmorx4.c +++ b/freetype/src/gxvalid/gxvmorx4.c @@ -41,12 +41,12 @@ FT_LOCAL_DEF( void ) gxv_morx_subtable_type4_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { GXV_NAME_ENTER( "morx chain subtable type4 " "(Non-Contextual Glyph Substitution)" ); - gxv_mort_subtable_type4_validate( table, limit, valid ); + gxv_mort_subtable_type4_validate( table, limit, gxvalid ); GXV_EXIT; } diff --git a/freetype/src/gxvalid/gxvmorx5.c b/freetype/src/gxvalid/gxvmorx5.c index d8cf70079..5e095dd38 100644 --- a/freetype/src/gxvalid/gxvmorx5.c +++ b/freetype/src/gxvalid/gxvmorx5.c @@ -64,12 +64,12 @@ static void gxv_morx_subtable_type5_insertionGlyphList_load( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; GXV_morx_subtable_type5_StateOptRecData optdata = - (GXV_morx_subtable_type5_StateOptRecData)valid->xstatetable.optdata; + (GXV_morx_subtable_type5_StateOptRecData)gxvalid->xstatetable.optdata; GXV_LIMIT_CHECK( 4 ); @@ -85,14 +85,14 @@ FT_ULong* classTable_length_p, FT_ULong* stateArray_length_p, FT_ULong* entryTable_length_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_ULong o[4]; FT_ULong* l[4]; FT_ULong buff[5]; GXV_morx_subtable_type5_StateOptRecData optdata = - (GXV_morx_subtable_type5_StateOptRecData)valid->xstatetable.optdata; + (GXV_morx_subtable_type5_StateOptRecData)gxvalid->xstatetable.optdata; o[0] = classTable; @@ -104,7 +104,7 @@ l[2] = entryTable_length_p; l[3] = &(optdata->insertionGlyphList_length); - gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, valid ); + gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, gxvalid ); } @@ -113,9 +113,9 @@ FT_UShort count, FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { - FT_Bytes p = table + table_index * 2; + FT_Bytes p = table + table_index * 2; #ifndef GXV_LOAD_TRACE_VARS @@ -143,7 +143,7 @@ GXV_StateTable_GlyphOffsetCPtr glyphOffset_p, FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { #ifdef GXV_LOAD_UNUSED_VARS FT_Bool setMark; @@ -180,20 +180,20 @@ gxv_morx_subtable_type5_InsertList_validate( currentInsertList, currentInsertCount, table, limit, - valid ); + gxvalid ); if ( markedInsertList && 0 != markedInsertCount ) gxv_morx_subtable_type5_InsertList_validate( markedInsertList, markedInsertCount, table, limit, - valid ); + gxvalid ); } FT_LOCAL_DEF( void ) gxv_morx_subtable_type5_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; @@ -205,18 +205,18 @@ GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE5_HEADER_SIZE ); - valid->xstatetable.optdata = + gxvalid->xstatetable.optdata = et; - valid->xstatetable.optdata_load_func = + gxvalid->xstatetable.optdata_load_func = gxv_morx_subtable_type5_insertionGlyphList_load; - valid->xstatetable.subtable_setup_func = + gxvalid->xstatetable.subtable_setup_func = gxv_morx_subtable_type5_subtable_setup; - valid->xstatetable.entry_glyphoffset_fmt = + gxvalid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_ULONG; - valid->xstatetable.entry_validate_func = + gxvalid->xstatetable.entry_validate_func = gxv_morx_subtable_type5_entry_validate; - gxv_XStateTable_validate( p, limit, valid ); + gxv_XStateTable_validate( p, limit, gxvalid ); GXV_EXIT; } diff --git a/freetype/src/gxvalid/gxvopbd.c b/freetype/src/gxvalid/gxvopbd.c index e12506094..ab0cd72bf 100644 --- a/freetype/src/gxvalid/gxvopbd.c +++ b/freetype/src/gxvalid/gxvopbd.c @@ -68,11 +68,11 @@ static void gxv_opbd_LookupValue_validate( FT_UShort glyph, GXV_LookupValueCPtr value_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { /* offset in LookupTable is measured from the head of opbd table */ - FT_Bytes p = valid->root->base + value_p->u; - FT_Bytes limit = valid->root->limit; + FT_Bytes p = gxvalid->root->base + value_p->u; + FT_Bytes limit = gxvalid->root->limit; FT_Short delta_value; int i; @@ -90,7 +90,7 @@ if ( delta_value == -1 ) continue; - gxv_ctlPoint_validate( glyph, delta_value, valid ); + gxv_ctlPoint_validate( glyph, delta_value, gxvalid ); } else /* format 0, value is distance */ continue; @@ -134,12 +134,12 @@ gxv_opbd_LookupFmt4_transit( FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { GXV_LookupValueDesc value; FT_UNUSED( lookuptbl_limit ); - FT_UNUSED( valid ); + FT_UNUSED( gxvalid ); /* XXX: check range? */ value.u = (FT_UShort)( base_value_p->u + @@ -162,8 +162,8 @@ FT_Face face, FT_Validator ftvalid ) { - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; + GXV_ValidatorRec gxvalidrec; + GXV_Validator gxvalid = &gxvalidrec; GXV_opbd_DataRec opbdrec; GXV_opbd_Data opbd = &opbdrec; FT_Bytes p = table; @@ -172,9 +172,9 @@ FT_ULong version; - valid->root = ftvalid; - valid->table_data = opbd; - valid->face = face; + gxvalid->root = ftvalid; + gxvalid->table_data = opbd; + gxvalid->face = face; FT_TRACE3(( "validating `opbd' table\n" )); GXV_INIT; @@ -196,12 +196,12 @@ if ( 0x0001 < GXV_OPBD_DATA( format ) ) FT_INVALID_FORMAT; - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_opbd_LookupValue_validate; - valid->lookupfmt4_trans = gxv_opbd_LookupFmt4_transit; + gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + gxvalid->lookupval_func = gxv_opbd_LookupValue_validate; + gxvalid->lookupfmt4_trans = gxv_opbd_LookupFmt4_transit; - gxv_LookupTable_validate( p, limit, valid ); - p += valid->subtable_length; + gxv_LookupTable_validate( p, limit, gxvalid ); + p += gxvalid->subtable_length; if ( p > table + GXV_OPBD_DATA( valueOffset_min ) ) { diff --git a/freetype/src/gxvalid/gxvprop.c b/freetype/src/gxvalid/gxvprop.c index 0be21336f..aa5c8eed3 100644 --- a/freetype/src/gxvalid/gxvprop.c +++ b/freetype/src/gxvalid/gxvprop.c @@ -75,7 +75,7 @@ static void gxv_prop_zero_advance_validate( FT_UShort gid, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Face face; FT_Error error; @@ -84,7 +84,7 @@ GXV_NAME_ENTER( "zero advance" ); - face = valid->face; + face = gxvalid->face; error = FT_Load_Glyph( face, gid, @@ -109,10 +109,10 @@ static void gxv_prop_property_validate( FT_UShort property, FT_UShort glyph, - GXV_Validator valid ) + GXV_Validator gxvalid ) { if ( glyph != 0 && ( property & GXV_PROP_FLOATER ) ) - gxv_prop_zero_advance_validate( glyph, valid ); + gxv_prop_zero_advance_validate( glyph, gxvalid ); if ( property & GXV_PROP_USE_COMPLEMENTARY_BRACKET ) { @@ -145,7 +145,7 @@ else { /* The gid for complement must be the face. */ - gxv_glyphid_validate( (FT_UShort)( glyph + complement ), valid ); + gxv_glyphid_validate( (FT_UShort)( glyph + complement ), gxvalid ); } } else @@ -187,9 +187,9 @@ static void gxv_prop_LookupValue_validate( FT_UShort glyph, GXV_LookupValueCPtr value_p, - GXV_Validator valid ) + GXV_Validator gxvalid ) { - gxv_prop_property_validate( value_p->u, glyph, valid ); + gxv_prop_property_validate( value_p->u, glyph, gxvalid ); } @@ -224,7 +224,7 @@ gxv_prop_LookupFmt4_transit( FT_UShort relative_gindex, GXV_LookupValueCPtr base_value_p, FT_Bytes lookuptbl_limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p; FT_Bytes limit; @@ -234,7 +234,7 @@ /* XXX: check range? */ offset = (FT_UShort)( base_value_p->u + relative_gindex * sizeof ( FT_UShort ) ); - p = valid->lookuptbl_head + offset; + p = gxvalid->lookuptbl_head + offset; limit = lookuptbl_limit; GXV_LIMIT_CHECK ( 2 ); @@ -259,8 +259,8 @@ { FT_Bytes p = table; FT_Bytes limit = 0; - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; + GXV_ValidatorRec gxvalidrec; + GXV_Validator gxvalid = &gxvalidrec; GXV_prop_DataRec proprec; GXV_prop_Data prop = &proprec; @@ -270,9 +270,9 @@ FT_UShort defaultProp; - valid->root = ftvalid; - valid->table_data = prop; - valid->face = face; + gxvalid->root = ftvalid; + gxvalid->table_data = prop; + gxvalid->face = face; FT_TRACE3(( "validating `prop' table\n" )); GXV_INIT; @@ -303,7 +303,7 @@ FT_INVALID_FORMAT; } - gxv_prop_property_validate( defaultProp, 0, valid ); + gxv_prop_property_validate( defaultProp, 0, gxvalid ); if ( format == 0 ) { @@ -315,11 +315,11 @@ /* format == 1 */ GXV_PROP_DATA( version ) = version; - valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; - valid->lookupval_func = gxv_prop_LookupValue_validate; - valid->lookupfmt4_trans = gxv_prop_LookupFmt4_transit; + gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED; + gxvalid->lookupval_func = gxv_prop_LookupValue_validate; + gxvalid->lookupfmt4_trans = gxv_prop_LookupFmt4_transit; - gxv_LookupTable_validate( p, limit, valid ); + gxv_LookupTable_validate( p, limit, gxvalid ); Exit: FT_TRACE4(( "\n" )); diff --git a/freetype/src/gxvalid/gxvtrak.c b/freetype/src/gxvalid/gxvtrak.c index 11fbd7ccf..3ec1a5673 100644 --- a/freetype/src/gxvalid/gxvtrak.c +++ b/freetype/src/gxvalid/gxvtrak.c @@ -93,9 +93,9 @@ gxv_trak_trackTable_validate( FT_Bytes table, FT_Bytes limit, FT_UShort nTracks, - GXV_Validator valid ) + GXV_Validator gxvalid ) { - FT_Bytes p = table; + FT_Bytes p = table; FT_Fixed track, t; FT_UShort nameIndex; @@ -122,7 +122,7 @@ if ( offset > GXV_TRAK_DATA( trackValueOffset_max ) ) GXV_TRAK_DATA( trackValueOffset_max ) = offset; - gxv_sfntName_validate( nameIndex, 256, 32767, valid ); + gxv_sfntName_validate( nameIndex, 256, 32767, gxvalid ); for ( j = i; j < nTracks; j ++ ) { @@ -134,7 +134,7 @@ } } - valid->subtable_length = p - table; + gxvalid->subtable_length = p - table; GXV_EXIT; } @@ -142,7 +142,7 @@ static void gxv_trak_trackData_validate( FT_Bytes table, FT_Bytes limit, - GXV_Validator valid ) + GXV_Validator gxvalid ) { FT_Bytes p = table; FT_UShort nTracks; @@ -164,31 +164,31 @@ gxv_odtect_add_range( table, p - table, "trackData header", odtect ); /* validate trackTable */ - gxv_trak_trackTable_validate( p, limit, nTracks, valid ); - gxv_odtect_add_range( p, valid->subtable_length, + gxv_trak_trackTable_validate( p, limit, nTracks, gxvalid ); + gxv_odtect_add_range( p, gxvalid->subtable_length, "trackTable", odtect ); /* sizeTable is array of FT_Fixed, don't check contents */ - p = valid->root->base + sizeTableOffset; + p = gxvalid->root->base + sizeTableOffset; GXV_LIMIT_CHECK( nSizes * 4 ); gxv_odtect_add_range( p, nSizes * 4, "sizeTable", odtect ); /* validate trackValueOffet */ - p = valid->root->base + GXV_TRAK_DATA( trackValueOffset_min ); + p = gxvalid->root->base + GXV_TRAK_DATA( trackValueOffset_min ); if ( limit - p < nTracks * nSizes * 2 ) GXV_TRACE(( "too short trackValue array\n" )); - p = valid->root->base + GXV_TRAK_DATA( trackValueOffset_max ); + p = gxvalid->root->base + GXV_TRAK_DATA( trackValueOffset_max ); GXV_LIMIT_CHECK( nSizes * 2 ); - gxv_odtect_add_range( valid->root->base + gxv_odtect_add_range( gxvalid->root->base + GXV_TRAK_DATA( trackValueOffset_min ), GXV_TRAK_DATA( trackValueOffset_max ) - GXV_TRAK_DATA( trackValueOffset_min ) + nSizes * 2, "trackValue array", odtect ); - gxv_odtect_validate( odtect, valid ); + gxv_odtect_validate( odtect, gxvalid ); GXV_EXIT; } @@ -210,8 +210,8 @@ FT_Bytes p = table; FT_Bytes limit = 0; - GXV_ValidatorRec validrec; - GXV_Validator valid = &validrec; + GXV_ValidatorRec gxvalidrec; + GXV_Validator gxvalid = &gxvalidrec; GXV_trak_DataRec trakrec; GXV_trak_Data trak = &trakrec; @@ -225,11 +225,11 @@ GXV_ODTECT( 3, odtect ); GXV_ODTECT_INIT( odtect ); - valid->root = ftvalid; - valid->table_data = trak; - valid->face = face; + gxvalid->root = ftvalid; + gxvalid->table_data = trak; + gxvalid->face = face; - limit = valid->root->limit; + limit = gxvalid->root->limit; FT_TRACE3(( "validating `trak' table\n" )); GXV_INIT; @@ -265,19 +265,19 @@ /* validate trackData */ if ( 0 < horizOffset ) { - gxv_trak_trackData_validate( table + horizOffset, limit, valid ); - gxv_odtect_add_range( table + horizOffset, valid->subtable_length, + gxv_trak_trackData_validate( table + horizOffset, limit, gxvalid ); + gxv_odtect_add_range( table + horizOffset, gxvalid->subtable_length, "horizJustData", odtect ); } if ( 0 < vertOffset ) { - gxv_trak_trackData_validate( table + vertOffset, limit, valid ); - gxv_odtect_add_range( table + vertOffset, valid->subtable_length, + gxv_trak_trackData_validate( table + vertOffset, limit, gxvalid ); + gxv_odtect_add_range( table + vertOffset, gxvalid->subtable_length, "vertJustData", odtect ); } - gxv_odtect_validate( odtect, valid ); + gxv_odtect_validate( odtect, gxvalid ); FT_TRACE4(( "\n" )); } diff --git a/freetype/src/gzip/ftgzip.c b/freetype/src/gzip/ftgzip.c index 2c60b6c57..2d4200d9f 100644 --- a/freetype/src/gzip/ftgzip.c +++ b/freetype/src/gzip/ftgzip.c @@ -8,7 +8,7 @@ /* parse compressed PCF fonts, as found with many X11 server */ /* distributions. */ /* */ -/* Copyright 2002-2006, 2009-2013 by */ +/* Copyright 2002-2006, 2009-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -208,8 +208,8 @@ /* head[0] && head[1] are the magic numbers; */ /* head[2] is the method, and head[3] the flags */ - if ( head[0] != 0x1f || - head[1] != 0x8b || + if ( head[0] != 0x1F || + head[1] != 0x8B || head[2] != Z_DEFLATED || (head[3] & FT_GZIP_RESERVED) ) { @@ -603,10 +603,18 @@ FT_Stream source ) { FT_Error error; - FT_Memory memory = source->memory; + FT_Memory memory; FT_GZipFile zip = NULL; + if ( !stream || !source ) + { + error = FT_THROW( Invalid_Stream_Handle ); + goto Exit; + } + + memory = source->memory; + /* * check the header right now; this prevents allocating un-necessary * objects when we don't need them @@ -700,6 +708,11 @@ int err; + /* check for `input' delayed to `inflate' */ + + if ( !memory || ! output_len || !output ) + return FT_THROW( Invalid_Argument ); + /* this function is modeled after zlib's `uncompress' function */ stream.next_in = (Bytef*)input; diff --git a/freetype/src/gzip/inftrees.c b/freetype/src/gzip/inftrees.c index ef5365216..56f52b170 100644 --- a/freetype/src/gzip/inftrees.c +++ b/freetype/src/gzip/inftrees.c @@ -115,16 +115,16 @@ uIntf *v /* working area: values in order of bit length */ uInt f; /* i repeats in table every f entries */ int g; /* maximum code length */ int h; /* table level */ - register uInt i; /* counter, current code */ - register uInt j; /* counter */ - register int k; /* number of bits in current code */ + uInt i; /* counter, current code */ + uInt j; /* counter */ + int k; /* number of bits in current code */ int l; /* bits per table (returned in m) */ uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */ - register uIntf *p; /* pointer into c[], b[], or v[] */ + uIntf *p; /* pointer into c[], b[], or v[] */ inflate_huft *q; /* points to current table */ struct inflate_huft_s r; /* table entry for structure assignment */ inflate_huft *u[BMAX]; /* table stack */ - register int w; /* bits before this table == (l * h) */ + int w; /* bits before this table == (l * h) */ uInt x[BMAX+1]; /* bit offsets, then code stack */ uIntf *xp; /* pointer into x */ int y; /* number of dummy codes added */ diff --git a/freetype/src/lzw/ftlzw.c b/freetype/src/lzw/ftlzw.c index 82e6c0070..e1b3564a5 100644 --- a/freetype/src/lzw/ftlzw.c +++ b/freetype/src/lzw/ftlzw.c @@ -8,7 +8,7 @@ /* be used to parse compressed PCF fonts, as found with many X11 server */ /* distributions. */ /* */ -/* Copyright 2004-2006, 2009, 2010, 2012, 2013 by */ +/* Copyright 2004-2006, 2009, 2010, 2012-2014 by */ /* Albert Chin-A-Young. */ /* */ /* Based on code in src/gzip/ftgzip.c, Copyright 2004 by */ @@ -96,8 +96,8 @@ goto Exit; /* head[0] && head[1] are the magic numbers */ - if ( head[0] != 0x1f || - head[1] != 0x9d ) + if ( head[0] != 0x1F || + head[1] != 0x9D ) error = FT_THROW( Invalid_File_Format ); Exit: @@ -349,10 +349,18 @@ FT_Stream source ) { FT_Error error; - FT_Memory memory = source->memory; + FT_Memory memory; FT_LZWFile zip = NULL; + if ( !stream || !source ) + { + error = FT_THROW( Invalid_Stream_Handle ); + goto Exit; + } + + memory = source->memory; + /* * Check the header right now; this prevents allocation of a huge * LZWFile object (400 KByte of heap memory) if not necessary. diff --git a/freetype/src/lzw/ftzopen.h b/freetype/src/lzw/ftzopen.h index f7d2936be..cdc8fd7c1 100644 --- a/freetype/src/lzw/ftzopen.h +++ b/freetype/src/lzw/ftzopen.h @@ -41,7 +41,7 @@ #define LZW_CLEAR 256 #define LZW_FIRST 257 -#define LZW_BIT_MASK 0x1f +#define LZW_BIT_MASK 0x1F #define LZW_BLOCK_MASK 0x80 #define LZW_MASK( n ) ( ( 1U << (n) ) - 1U ) diff --git a/freetype/src/otvalid/otvbase.c b/freetype/src/otvalid/otvbase.c index d742d2dc9..4f9d2fa25 100644 --- a/freetype/src/otvalid/otvbase.c +++ b/freetype/src/otvalid/otvbase.c @@ -32,7 +32,7 @@ static void otv_BaseCoord_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt BaseCoordFormat; @@ -58,7 +58,7 @@ case 3: /* BaseCoordFormat3 */ OTV_LIMIT_CHECK( 2 ); /* DeviceTable */ - otv_Device_validate( table + FT_NEXT_USHORT( p ), valid ); + otv_Device_validate( table + FT_NEXT_USHORT( p ), otvalid ); break; default: @@ -71,7 +71,7 @@ static void otv_BaseTagList_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt BaseTagCount; @@ -93,7 +93,7 @@ static void otv_BaseValues_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt BaseCoordCount; @@ -112,7 +112,7 @@ /* BaseCoord */ for ( ; BaseCoordCount > 0; BaseCoordCount-- ) - otv_BaseCoord_validate( table + FT_NEXT_USHORT( p ), valid ); + otv_BaseCoord_validate( table + FT_NEXT_USHORT( p ), otvalid ); OTV_EXIT; } @@ -120,7 +120,7 @@ static void otv_MinMax_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt table_size; @@ -144,11 +144,11 @@ OTV_SIZE_CHECK( MinCoord ); if ( MinCoord ) - otv_BaseCoord_validate( table + MinCoord, valid ); + otv_BaseCoord_validate( table + MinCoord, otvalid ); OTV_SIZE_CHECK( MaxCoord ); if ( MaxCoord ) - otv_BaseCoord_validate( table + MaxCoord, valid ); + otv_BaseCoord_validate( table + MaxCoord, otvalid ); OTV_LIMIT_CHECK( FeatMinMaxCount * 8 ); @@ -162,11 +162,11 @@ OTV_SIZE_CHECK( MinCoord ); if ( MinCoord ) - otv_BaseCoord_validate( table + MinCoord, valid ); + otv_BaseCoord_validate( table + MinCoord, otvalid ); OTV_SIZE_CHECK( MaxCoord ); if ( MaxCoord ) - otv_BaseCoord_validate( table + MaxCoord, valid ); + otv_BaseCoord_validate( table + MaxCoord, otvalid ); } OTV_EXIT; @@ -175,7 +175,7 @@ static void otv_BaseScript_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt table_size; @@ -198,11 +198,11 @@ OTV_SIZE_CHECK( BaseValues ); if ( BaseValues ) - otv_BaseValues_validate( table + BaseValues, valid ); + otv_BaseValues_validate( table + BaseValues, otvalid ); OTV_SIZE_CHECK( DefaultMinMax ); if ( DefaultMinMax ) - otv_MinMax_validate( table + DefaultMinMax, valid ); + otv_MinMax_validate( table + DefaultMinMax, otvalid ); OTV_LIMIT_CHECK( BaseLangSysCount * 6 ); @@ -211,7 +211,7 @@ { p += 4; /* skip BaseLangSysTag */ - otv_MinMax_validate( table + FT_NEXT_USHORT( p ), valid ); + otv_MinMax_validate( table + FT_NEXT_USHORT( p ), otvalid ); } OTV_EXIT; @@ -220,7 +220,7 @@ static void otv_BaseScriptList_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt BaseScriptCount; @@ -241,7 +241,7 @@ p += 4; /* skip BaseScriptTag */ /* BaseScript */ - otv_BaseScript_validate( table + FT_NEXT_USHORT( p ), valid ); + otv_BaseScript_validate( table + FT_NEXT_USHORT( p ), otvalid ); } OTV_EXIT; @@ -250,7 +250,7 @@ static void otv_Axis_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt table_size; @@ -267,10 +267,10 @@ OTV_SIZE_CHECK( BaseTagList ); if ( BaseTagList ) - otv_BaseTagList_validate( table + BaseTagList, valid ); + otv_BaseTagList_validate( table + BaseTagList, otvalid ); /* BaseScriptList */ - otv_BaseScriptList_validate( table + FT_NEXT_USHORT( p ), valid ); + otv_BaseScriptList_validate( table + FT_NEXT_USHORT( p ), otvalid ); OTV_EXIT; } @@ -280,16 +280,16 @@ otv_BASE_validate( FT_Bytes table, FT_Validator ftvalid ) { - OTV_ValidatorRec validrec; - OTV_Validator valid = &validrec; - FT_Bytes p = table; + OTV_ValidatorRec otvalidrec; + OTV_Validator otvalid = &otvalidrec; + FT_Bytes p = table; FT_UInt table_size; OTV_OPTIONAL_TABLE( HorizAxis ); OTV_OPTIONAL_TABLE( VertAxis ); - valid->root = ftvalid; + otvalid->root = ftvalid; FT_TRACE3(( "validating BASE table\n" )); OTV_INIT; @@ -304,12 +304,12 @@ OTV_OPTIONAL_OFFSET( HorizAxis ); OTV_SIZE_CHECK( HorizAxis ); if ( HorizAxis ) - otv_Axis_validate( table + HorizAxis, valid ); + otv_Axis_validate( table + HorizAxis, otvalid ); OTV_OPTIONAL_OFFSET( VertAxis ); OTV_SIZE_CHECK( VertAxis ); if ( VertAxis ) - otv_Axis_validate( table + VertAxis, valid ); + otv_Axis_validate( table + VertAxis, otvalid ); FT_TRACE4(( "\n" )); } diff --git a/freetype/src/otvalid/otvcommn.c b/freetype/src/otvalid/otvcommn.c index a4f885b51..3c3de63ca 100644 --- a/freetype/src/otvalid/otvcommn.c +++ b/freetype/src/otvalid/otvcommn.c @@ -39,7 +39,7 @@ FT_LOCAL_DEF( void ) otv_Coverage_validate( FT_Bytes table, - OTV_Validator valid, + OTV_Validator otvalid, FT_Int expected_count ) { FT_Bytes p = table; @@ -74,7 +74,7 @@ gid = FT_NEXT_USHORT( p ); - if ( gid >= valid->glyph_count ) + if ( gid >= otvalid->glyph_count ) FT_INVALID_GLYPH_ID; } @@ -104,7 +104,7 @@ if ( Start > End || StartCoverageIndex != total ) FT_INVALID_DATA; - if ( End >= valid->glyph_count ) + if ( End >= otvalid->glyph_count ) FT_INVALID_GLYPH_ID; if ( n > 0 && Start <= last ) @@ -219,7 +219,7 @@ FT_LOCAL_DEF( void ) otv_ClassDef_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt ClassFormat; @@ -249,7 +249,7 @@ OTV_LIMIT_CHECK( GlyphCount * 2 ); /* ClassValueArray */ - if ( StartGlyph + GlyphCount - 1 >= valid->glyph_count ) + if ( StartGlyph + GlyphCount - 1 >= otvalid->glyph_count ) FT_INVALID_GLYPH_ID; } break; @@ -276,7 +276,7 @@ if ( Start > End || ( n > 0 && Start <= last ) ) FT_INVALID_DATA; - if ( End >= valid->glyph_count ) + if ( End >= otvalid->glyph_count ) FT_INVALID_GLYPH_ID; last = End; @@ -305,7 +305,7 @@ FT_LOCAL_DEF( void ) otv_Device_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt StartSize, EndSize, DeltaFormat, count; @@ -339,12 +339,12 @@ /*************************************************************************/ /*************************************************************************/ - /* uses valid->type_count */ - /* uses valid->type_funcs */ + /* uses otvalid->type_count */ + /* uses otvalid->type_funcs */ FT_LOCAL_DEF( void ) otv_Lookup_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt LookupType, SubTableCount; @@ -360,10 +360,10 @@ OTV_TRACE(( " (type %d)\n", LookupType )); - if ( LookupType == 0 || LookupType > valid->type_count ) + if ( LookupType == 0 || LookupType > otvalid->type_count ) FT_INVALID_DATA; - validate = valid->type_funcs[LookupType - 1]; + validate = otvalid->type_funcs[LookupType - 1]; OTV_TRACE(( " (SubTableCount = %d)\n", SubTableCount )); @@ -371,7 +371,7 @@ /* SubTable */ for ( ; SubTableCount > 0; SubTableCount-- ) - validate( table + FT_NEXT_USHORT( p ), valid ); + validate( table + FT_NEXT_USHORT( p ), otvalid ); OTV_EXIT; } @@ -381,7 +381,7 @@ FT_LOCAL_DEF( void ) otv_LookupList_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt LookupCount; @@ -396,11 +396,11 @@ OTV_LIMIT_CHECK( LookupCount * 2 ); - valid->lookup_count = LookupCount; + otvalid->lookup_count = LookupCount; /* Lookup */ for ( ; LookupCount > 0; LookupCount-- ) - otv_Lookup_validate( table + FT_NEXT_USHORT( p ), valid ); + otv_Lookup_validate( table + FT_NEXT_USHORT( p ), otvalid ); OTV_EXIT; } @@ -421,11 +421,11 @@ /*************************************************************************/ /*************************************************************************/ - /* uses valid->lookup_count */ + /* uses otvalid->lookup_count */ FT_LOCAL_DEF( void ) otv_Feature_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt LookupCount; @@ -443,7 +443,7 @@ /* LookupListIndex */ for ( ; LookupCount > 0; LookupCount-- ) - if ( FT_NEXT_USHORT( p ) >= valid->lookup_count ) + if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count ) FT_INVALID_DATA; OTV_EXIT; @@ -457,12 +457,12 @@ } - /* sets valid->lookup_count */ + /* sets otvalid->lookup_count */ FT_LOCAL_DEF( void ) otv_FeatureList_validate( FT_Bytes table, FT_Bytes lookups, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt FeatureCount; @@ -477,7 +477,7 @@ OTV_LIMIT_CHECK( FeatureCount * 2 ); - valid->lookup_count = otv_LookupList_get_count( lookups ); + otvalid->lookup_count = otv_LookupList_get_count( lookups ); /* FeatureRecord */ for ( ; FeatureCount > 0; FeatureCount-- ) @@ -485,7 +485,7 @@ p += 4; /* skip FeatureTag */ /* Feature */ - otv_Feature_validate( table + FT_NEXT_USHORT( p ), valid ); + otv_Feature_validate( table + FT_NEXT_USHORT( p ), otvalid ); } OTV_EXIT; @@ -501,11 +501,11 @@ /*************************************************************************/ - /* uses valid->extra1 (number of features) */ + /* uses otvalid->extra1 (number of features) */ FT_LOCAL_DEF( void ) otv_LangSys_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt ReqFeatureIndex; @@ -522,14 +522,14 @@ OTV_TRACE(( " (ReqFeatureIndex = %d)\n", ReqFeatureIndex )); OTV_TRACE(( " (FeatureCount = %d)\n", FeatureCount )); - if ( ReqFeatureIndex != 0xFFFFU && ReqFeatureIndex >= valid->extra1 ) + if ( ReqFeatureIndex != 0xFFFFU && ReqFeatureIndex >= otvalid->extra1 ) FT_INVALID_DATA; OTV_LIMIT_CHECK( FeatureCount * 2 ); /* FeatureIndex */ for ( ; FeatureCount > 0; FeatureCount-- ) - if ( FT_NEXT_USHORT( p ) >= valid->extra1 ) + if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 ) FT_INVALID_DATA; OTV_EXIT; @@ -546,7 +546,7 @@ FT_LOCAL_DEF( void ) otv_Script_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_UInt DefaultLangSys, LangSysCount; FT_Bytes p = table; @@ -561,7 +561,7 @@ OTV_TRACE(( " (LangSysCount = %d)\n", LangSysCount )); if ( DefaultLangSys != 0 ) - otv_LangSys_validate( table + DefaultLangSys, valid ); + otv_LangSys_validate( table + DefaultLangSys, otvalid ); OTV_LIMIT_CHECK( LangSysCount * 6 ); @@ -571,19 +571,19 @@ p += 4; /* skip LangSysTag */ /* LangSys */ - otv_LangSys_validate( table + FT_NEXT_USHORT( p ), valid ); + otv_LangSys_validate( table + FT_NEXT_USHORT( p ), otvalid ); } OTV_EXIT; } - /* sets valid->extra1 (number of features) */ + /* sets otvalid->extra1 (number of features) */ FT_LOCAL_DEF( void ) otv_ScriptList_validate( FT_Bytes table, FT_Bytes features, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_UInt ScriptCount; FT_Bytes p = table; @@ -598,14 +598,14 @@ OTV_LIMIT_CHECK( ScriptCount * 6 ); - valid->extra1 = otv_Feature_get_count( features ); + otvalid->extra1 = otv_Feature_get_count( features ); /* ScriptRecord */ for ( ; ScriptCount > 0; ScriptCount-- ) { p += 4; /* skip ScriptTag */ - otv_Script_validate( table + FT_NEXT_USHORT( p ), valid ); /* Script */ + otv_Script_validate( table + FT_NEXT_USHORT( p ), otvalid ); /* Script */ } OTV_EXIT; @@ -640,7 +640,7 @@ FT_LOCAL_DEF( void ) otv_x_Ox( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt Count; @@ -656,13 +656,13 @@ OTV_LIMIT_CHECK( Count * 2 ); - valid->nesting_level++; - func = valid->func[valid->nesting_level]; + otvalid->nesting_level++; + func = otvalid->func[otvalid->nesting_level]; for ( ; Count > 0; Count-- ) - func( table + FT_NEXT_USHORT( p ), valid ); + func( table + FT_NEXT_USHORT( p ), otvalid ); - valid->nesting_level--; + otvalid->nesting_level--; OTV_EXIT; } @@ -670,7 +670,7 @@ FT_LOCAL_DEF( void ) otv_u_C_x_Ox( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt Count, Coverage; @@ -687,27 +687,27 @@ OTV_TRACE(( " (Count = %d)\n", Count )); - otv_Coverage_validate( table + Coverage, valid, Count ); + otv_Coverage_validate( table + Coverage, otvalid, Count ); OTV_LIMIT_CHECK( Count * 2 ); - valid->nesting_level++; - func = valid->func[valid->nesting_level]; + otvalid->nesting_level++; + func = otvalid->func[otvalid->nesting_level]; for ( ; Count > 0; Count-- ) - func( table + FT_NEXT_USHORT( p ), valid ); + func( table + FT_NEXT_USHORT( p ), otvalid ); - valid->nesting_level--; + otvalid->nesting_level--; OTV_EXIT; } - /* uses valid->extra1 (if > 0: array value limit) */ + /* uses otvalid->extra1 (if > 0: array value limit) */ FT_LOCAL_DEF( void ) otv_x_ux( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt Count; @@ -722,10 +722,10 @@ OTV_LIMIT_CHECK( Count * 2 ); - if ( valid->extra1 ) + if ( otvalid->extra1 ) { for ( ; Count > 0; Count-- ) - if ( FT_NEXT_USHORT( p ) >= valid->extra1 ) + if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 ) FT_INVALID_DATA; } @@ -736,11 +736,11 @@ /* `ux' in the function's name is not really correct since only x-1 */ /* elements are tested */ - /* uses valid->extra1 (array value limit) */ + /* uses otvalid->extra1 (array value limit) */ FT_LOCAL_DEF( void ) otv_x_y_ux_sy( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt Count1, Count2; @@ -766,7 +766,7 @@ if ( FT_NEXT_USHORT( p ) >= Count1 ) FT_INVALID_DATA; - if ( FT_NEXT_USHORT( p ) >= valid->extra1 ) + if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 ) FT_INVALID_DATA; } @@ -777,11 +777,11 @@ /* `uy' in the function's name is not really correct since only y-1 */ /* elements are tested */ - /* uses valid->extra1 (array value limit) */ + /* uses otvalid->extra1 (array value limit) */ FT_LOCAL_DEF( void ) otv_x_ux_y_uy_z_uz_p_sp( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt BacktrackCount, InputCount, LookaheadCount; @@ -825,7 +825,7 @@ if ( FT_NEXT_USHORT( p ) >= InputCount ) FT_INVALID_DATA; - if ( FT_NEXT_USHORT( p ) >= valid->extra1 ) + if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 ) FT_INVALID_DATA; } @@ -833,11 +833,11 @@ } - /* sets valid->extra1 (valid->lookup_count) */ + /* sets otvalid->extra1 (valid->lookup_count) */ FT_LOCAL_DEF( void ) otv_u_O_O_x_Onx( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt Coverage, ClassDef, ClassSetCount; @@ -855,14 +855,14 @@ OTV_TRACE(( " (ClassSetCount = %d)\n", ClassSetCount )); - otv_Coverage_validate( table + Coverage, valid, -1 ); - otv_ClassDef_validate( table + ClassDef, valid ); + otv_Coverage_validate( table + Coverage, otvalid, -1 ); + otv_ClassDef_validate( table + ClassDef, otvalid ); OTV_LIMIT_CHECK( ClassSetCount * 2 ); - valid->nesting_level++; - func = valid->func[valid->nesting_level]; - valid->extra1 = valid->lookup_count; + otvalid->nesting_level++; + func = otvalid->func[otvalid->nesting_level]; + otvalid->extra1 = otvalid->lookup_count; for ( ; ClassSetCount > 0; ClassSetCount-- ) { @@ -870,20 +870,20 @@ if ( offset ) - func( table + offset, valid ); + func( table + offset, otvalid ); } - valid->nesting_level--; + otvalid->nesting_level--; OTV_EXIT; } - /* uses valid->lookup_count */ + /* uses otvalid->lookup_count */ FT_LOCAL_DEF( void ) otv_u_x_y_Ox_sy( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt GlyphCount, Count, count1; @@ -903,14 +903,14 @@ OTV_LIMIT_CHECK( GlyphCount * 2 + Count * 4 ); for ( count1 = GlyphCount; count1 > 0; count1-- ) - otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid, -1 ); + otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 ); for ( ; Count > 0; Count-- ) { if ( FT_NEXT_USHORT( p ) >= GlyphCount ) FT_INVALID_DATA; - if ( FT_NEXT_USHORT( p ) >= valid->lookup_count ) + if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count ) FT_INVALID_DATA; } @@ -918,11 +918,11 @@ } - /* sets valid->extra1 (valid->lookup_count) */ + /* sets otvalid->extra1 (valid->lookup_count) */ FT_LOCAL_DEF( void ) otv_u_O_O_O_O_x_Onx( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt Coverage; @@ -944,17 +944,17 @@ OTV_TRACE(( " (ChainClassSetCount = %d)\n", ChainClassSetCount )); - otv_Coverage_validate( table + Coverage, valid, -1 ); + otv_Coverage_validate( table + Coverage, otvalid, -1 ); - otv_ClassDef_validate( table + BacktrackClassDef, valid ); - otv_ClassDef_validate( table + InputClassDef, valid ); - otv_ClassDef_validate( table + LookaheadClassDef, valid ); + otv_ClassDef_validate( table + BacktrackClassDef, otvalid ); + otv_ClassDef_validate( table + InputClassDef, otvalid ); + otv_ClassDef_validate( table + LookaheadClassDef, otvalid ); OTV_LIMIT_CHECK( ChainClassSetCount * 2 ); - valid->nesting_level++; - func = valid->func[valid->nesting_level]; - valid->extra1 = valid->lookup_count; + otvalid->nesting_level++; + func = otvalid->func[otvalid->nesting_level]; + otvalid->extra1 = otvalid->lookup_count; for ( ; ChainClassSetCount > 0; ChainClassSetCount-- ) { @@ -962,20 +962,20 @@ if ( offset ) - func( table + offset, valid ); + func( table + offset, otvalid ); } - valid->nesting_level--; + otvalid->nesting_level--; OTV_EXIT; } - /* uses valid->lookup_count */ + /* uses otvalid->lookup_count */ FT_LOCAL_DEF( void ) otv_u_x_Ox_y_Oy_z_Oz_p_sp( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt BacktrackGlyphCount, InputGlyphCount, LookaheadGlyphCount; @@ -994,7 +994,7 @@ OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 ); for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- ) - otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid, -1 ); + otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 ); InputGlyphCount = FT_NEXT_USHORT( p ); @@ -1003,7 +1003,7 @@ OTV_LIMIT_CHECK( InputGlyphCount * 2 + 2 ); for ( count1 = InputGlyphCount; count1 > 0; count1-- ) - otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid, -1 ); + otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 ); LookaheadGlyphCount = FT_NEXT_USHORT( p ); @@ -1012,7 +1012,7 @@ OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 ); for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- ) - otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid, -1 ); + otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 ); count2 = FT_NEXT_USHORT( p ); @@ -1025,7 +1025,7 @@ if ( FT_NEXT_USHORT( p ) >= InputGlyphCount ) FT_INVALID_DATA; - if ( FT_NEXT_USHORT( p ) >= valid->lookup_count ) + if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count ) FT_INVALID_DATA; } diff --git a/freetype/src/otvalid/otvcommn.h b/freetype/src/otvalid/otvcommn.h index 898887fc9..5c93ba7ef 100644 --- a/freetype/src/otvalid/otvcommn.h +++ b/freetype/src/otvalid/otvcommn.h @@ -4,7 +4,7 @@ /* */ /* OpenType common tables validation (specification). */ /* */ -/* Copyright 2004, 2005, 2007, 2009 by */ +/* Copyright 2004, 2005, 2007, 2009, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -39,7 +39,7 @@ FT_BEGIN_HEADER typedef struct OTV_ValidatorRec_* OTV_Validator; typedef void (*OTV_Validate_Func)( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); typedef struct OTV_ValidatorRec_ { @@ -67,8 +67,8 @@ FT_BEGIN_HEADER #undef FT_INVALID_ -#define FT_INVALID_( _prefix, _error ) \ - ft_validator_error( valid->root, _prefix ## _error ) +#define FT_INVALID_( _error ) \ + ft_validator_error( otvalid->root, FT_THROW( _error ) ) #define OTV_OPTIONAL_TABLE( _table ) FT_UShort _table; \ FT_Bytes _table ## _p @@ -81,7 +81,7 @@ FT_BEGIN_HEADER #define OTV_LIMIT_CHECK( _count ) \ FT_BEGIN_STMNT \ - if ( p + (_count) > valid->root->limit ) \ + if ( p + (_count) > otvalid->root->limit ) \ FT_INVALID_TOO_SHORT; \ FT_END_STMNT @@ -89,7 +89,7 @@ FT_BEGIN_HEADER FT_BEGIN_STMNT \ if ( _size > 0 && _size < table_size ) \ { \ - if ( valid->root->level == FT_VALIDATE_PARANOID ) \ + if ( otvalid->root->level == FT_VALIDATE_PARANOID ) \ FT_INVALID_OFFSET; \ else \ { \ @@ -117,79 +117,79 @@ FT_BEGIN_HEADER #ifdef FT_DEBUG_LEVEL_TRACE -#define OTV_NEST1( x ) \ - FT_BEGIN_STMNT \ - valid->nesting_level = 0; \ - valid->func[0] = OTV_FUNC( x ); \ - valid->debug_function_name[0] = OTV_NAME( x ); \ +#define OTV_NEST1( x ) \ + FT_BEGIN_STMNT \ + otvalid->nesting_level = 0; \ + otvalid->func[0] = OTV_FUNC( x ); \ + otvalid->debug_function_name[0] = OTV_NAME( x ); \ FT_END_STMNT -#define OTV_NEST2( x, y ) \ - FT_BEGIN_STMNT \ - valid->nesting_level = 0; \ - valid->func[0] = OTV_FUNC( x ); \ - valid->func[1] = OTV_FUNC( y ); \ - valid->debug_function_name[0] = OTV_NAME( x ); \ - valid->debug_function_name[1] = OTV_NAME( y ); \ +#define OTV_NEST2( x, y ) \ + FT_BEGIN_STMNT \ + otvalid->nesting_level = 0; \ + otvalid->func[0] = OTV_FUNC( x ); \ + otvalid->func[1] = OTV_FUNC( y ); \ + otvalid->debug_function_name[0] = OTV_NAME( x ); \ + otvalid->debug_function_name[1] = OTV_NAME( y ); \ FT_END_STMNT -#define OTV_NEST3( x, y, z ) \ - FT_BEGIN_STMNT \ - valid->nesting_level = 0; \ - valid->func[0] = OTV_FUNC( x ); \ - valid->func[1] = OTV_FUNC( y ); \ - valid->func[2] = OTV_FUNC( z ); \ - valid->debug_function_name[0] = OTV_NAME( x ); \ - valid->debug_function_name[1] = OTV_NAME( y ); \ - valid->debug_function_name[2] = OTV_NAME( z ); \ +#define OTV_NEST3( x, y, z ) \ + FT_BEGIN_STMNT \ + otvalid->nesting_level = 0; \ + otvalid->func[0] = OTV_FUNC( x ); \ + otvalid->func[1] = OTV_FUNC( y ); \ + otvalid->func[2] = OTV_FUNC( z ); \ + otvalid->debug_function_name[0] = OTV_NAME( x ); \ + otvalid->debug_function_name[1] = OTV_NAME( y ); \ + otvalid->debug_function_name[2] = OTV_NAME( z ); \ FT_END_STMNT -#define OTV_INIT valid->debug_indent = 0 +#define OTV_INIT otvalid->debug_indent = 0 -#define OTV_ENTER \ - FT_BEGIN_STMNT \ - valid->debug_indent += 2; \ - FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ - FT_TRACE4(( "%s table\n", \ - valid->debug_function_name[valid->nesting_level] )); \ +#define OTV_ENTER \ + FT_BEGIN_STMNT \ + otvalid->debug_indent += 2; \ + FT_TRACE4(( "%*.s", otvalid->debug_indent, 0 )); \ + FT_TRACE4(( "%s table\n", \ + otvalid->debug_function_name[otvalid->nesting_level] )); \ FT_END_STMNT -#define OTV_NAME_ENTER( name ) \ - FT_BEGIN_STMNT \ - valid->debug_indent += 2; \ - FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ - FT_TRACE4(( "%s table\n", name )); \ +#define OTV_NAME_ENTER( name ) \ + FT_BEGIN_STMNT \ + otvalid->debug_indent += 2; \ + FT_TRACE4(( "%*.s", otvalid->debug_indent, 0 )); \ + FT_TRACE4(( "%s table\n", name )); \ FT_END_STMNT -#define OTV_EXIT valid->debug_indent -= 2 +#define OTV_EXIT otvalid->debug_indent -= 2 -#define OTV_TRACE( s ) \ - FT_BEGIN_STMNT \ - FT_TRACE4(( "%*.s", valid->debug_indent, 0 )); \ - FT_TRACE4( s ); \ +#define OTV_TRACE( s ) \ + FT_BEGIN_STMNT \ + FT_TRACE4(( "%*.s", otvalid->debug_indent, 0 )); \ + FT_TRACE4( s ); \ FT_END_STMNT #else /* !FT_DEBUG_LEVEL_TRACE */ -#define OTV_NEST1( x ) \ - FT_BEGIN_STMNT \ - valid->nesting_level = 0; \ - valid->func[0] = OTV_FUNC( x ); \ +#define OTV_NEST1( x ) \ + FT_BEGIN_STMNT \ + otvalid->nesting_level = 0; \ + otvalid->func[0] = OTV_FUNC( x ); \ FT_END_STMNT -#define OTV_NEST2( x, y ) \ - FT_BEGIN_STMNT \ - valid->nesting_level = 0; \ - valid->func[0] = OTV_FUNC( x ); \ - valid->func[1] = OTV_FUNC( y ); \ +#define OTV_NEST2( x, y ) \ + FT_BEGIN_STMNT \ + otvalid->nesting_level = 0; \ + otvalid->func[0] = OTV_FUNC( x ); \ + otvalid->func[1] = OTV_FUNC( y ); \ FT_END_STMNT -#define OTV_NEST3( x, y, z ) \ - FT_BEGIN_STMNT \ - valid->nesting_level = 0; \ - valid->func[0] = OTV_FUNC( x ); \ - valid->func[1] = OTV_FUNC( y ); \ - valid->func[2] = OTV_FUNC( z ); \ +#define OTV_NEST3( x, y, z ) \ + FT_BEGIN_STMNT \ + otvalid->nesting_level = 0; \ + otvalid->func[0] = OTV_FUNC( x ); \ + otvalid->func[1] = OTV_FUNC( y ); \ + otvalid->func[2] = OTV_FUNC( z ); \ FT_END_STMNT #define OTV_INIT do { } while ( 0 ) @@ -202,7 +202,7 @@ FT_BEGIN_HEADER #endif /* !FT_DEBUG_LEVEL_TRACE */ -#define OTV_RUN valid->func[0] +#define OTV_RUN otvalid->func[0] /*************************************************************************/ @@ -215,7 +215,7 @@ FT_BEGIN_HEADER FT_LOCAL( void ) otv_Coverage_validate( FT_Bytes table, - OTV_Validator valid, + OTV_Validator otvalid, FT_Int expected_count ); /* return first covered glyph */ @@ -241,7 +241,7 @@ FT_BEGIN_HEADER FT_LOCAL( void ) otv_ClassDef_validate( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); /*************************************************************************/ @@ -254,7 +254,7 @@ FT_BEGIN_HEADER FT_LOCAL( void ) otv_Device_validate( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); /*************************************************************************/ @@ -267,11 +267,11 @@ FT_BEGIN_HEADER FT_LOCAL( void ) otv_Lookup_validate( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); FT_LOCAL( void ) otv_LookupList_validate( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); /*************************************************************************/ @@ -284,13 +284,13 @@ FT_BEGIN_HEADER FT_LOCAL( void ) otv_Feature_validate( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); /* lookups must already be validated */ FT_LOCAL( void ) otv_FeatureList_validate( FT_Bytes table, FT_Bytes lookups, - OTV_Validator valid ); + OTV_Validator otvalid ); /*************************************************************************/ @@ -303,7 +303,7 @@ FT_BEGIN_HEADER FT_LOCAL( void ) otv_LangSys_validate( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); /*************************************************************************/ @@ -316,13 +316,13 @@ FT_BEGIN_HEADER FT_LOCAL( void ) otv_Script_validate( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); /* features must already be validated */ FT_LOCAL( void ) otv_ScriptList_validate( FT_Bytes table, FT_Bytes features, - OTV_Validator valid ); + OTV_Validator otvalid ); /*************************************************************************/ @@ -349,7 +349,7 @@ FT_BEGIN_HEADER FT_LOCAL( void ) otv_x_Ox ( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); #define AlternateSubstFormat1Func otv_u_C_x_Ox #define ChainContextPosFormat1Func otv_u_C_x_Ox @@ -361,7 +361,7 @@ FT_BEGIN_HEADER FT_LOCAL( void ) otv_u_C_x_Ox( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); #define AlternateSetFunc otv_x_ux #define AttachPointFunc otv_x_ux @@ -372,7 +372,7 @@ FT_BEGIN_HEADER FT_LOCAL( void ) otv_x_ux( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); #define PosClassRuleFunc otv_x_y_ux_sy #define PosRuleFunc otv_x_y_ux_sy @@ -381,7 +381,7 @@ FT_BEGIN_HEADER FT_LOCAL( void ) otv_x_y_ux_sy( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); #define ChainPosClassRuleFunc otv_x_ux_y_uy_z_uz_p_sp #define ChainPosRuleFunc otv_x_ux_y_uy_z_uz_p_sp @@ -390,35 +390,35 @@ FT_BEGIN_HEADER FT_LOCAL( void ) otv_x_ux_y_uy_z_uz_p_sp( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); #define ContextPosFormat2Func otv_u_O_O_x_Onx #define ContextSubstFormat2Func otv_u_O_O_x_Onx FT_LOCAL( void ) otv_u_O_O_x_Onx( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); #define ContextPosFormat3Func otv_u_x_y_Ox_sy #define ContextSubstFormat3Func otv_u_x_y_Ox_sy FT_LOCAL( void ) otv_u_x_y_Ox_sy( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); #define ChainContextPosFormat2Func otv_u_O_O_O_O_x_Onx #define ChainContextSubstFormat2Func otv_u_O_O_O_O_x_Onx FT_LOCAL( void ) otv_u_O_O_O_O_x_Onx( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); #define ChainContextPosFormat3Func otv_u_x_Ox_y_Oy_z_Oz_p_sp #define ChainContextSubstFormat3Func otv_u_x_Ox_y_Oy_z_Oz_p_sp FT_LOCAL( void ) otv_u_x_Ox_y_Oy_z_Oz_p_sp( FT_Bytes table, - OTV_Validator valid ); + OTV_Validator otvalid ); FT_LOCAL( FT_UInt ) diff --git a/freetype/src/otvalid/otvgdef.c b/freetype/src/otvalid/otvgdef.c index 3633ad0de..e60ef363d 100644 --- a/freetype/src/otvalid/otvgdef.c +++ b/freetype/src/otvalid/otvgdef.c @@ -45,7 +45,7 @@ static void otv_O_x_Ox( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_Bytes Coverage; @@ -61,20 +61,20 @@ OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); - otv_Coverage_validate( Coverage, valid, GlyphCount ); + otv_Coverage_validate( Coverage, otvalid, GlyphCount ); if ( GlyphCount != otv_Coverage_get_count( Coverage ) ) FT_INVALID_DATA; OTV_LIMIT_CHECK( GlyphCount * 2 ); - valid->nesting_level++; - func = valid->func[valid->nesting_level]; - valid->extra1 = 0; + otvalid->nesting_level++; + func = otvalid->func[otvalid->nesting_level]; + otvalid->extra1 = 0; for ( ; GlyphCount > 0; GlyphCount-- ) - func( table + FT_NEXT_USHORT( p ), valid ); + func( table + FT_NEXT_USHORT( p ), otvalid ); - valid->nesting_level--; + otvalid->nesting_level--; OTV_EXIT; } @@ -92,7 +92,7 @@ static void otv_CaretValue_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt CaretValueFormat; @@ -122,7 +122,7 @@ OTV_LIMIT_CHECK( 2 ); /* DeviceTable */ - otv_Device_validate( table + FT_NEXT_USHORT( p ), valid ); + otv_Device_validate( table + FT_NEXT_USHORT( p ), otvalid ); break; default: @@ -141,7 +141,7 @@ /*************************************************************************/ /*************************************************************************/ - /* sets valid->glyph_count */ + /* sets otvalid->glyph_count */ FT_LOCAL_DEF( void ) otv_GDEF_validate( FT_Bytes table, @@ -150,8 +150,8 @@ FT_UInt glyph_count, FT_Validator ftvalid ) { - OTV_ValidatorRec validrec; - OTV_Validator valid = &validrec; + OTV_ValidatorRec otvalidrec; + OTV_Validator otvalid = &otvalidrec; FT_Bytes p = table; FT_UInt table_size; FT_Bool need_MarkAttachClassDef; @@ -162,7 +162,7 @@ OTV_OPTIONAL_TABLE( MarkAttachClassDef ); - valid->root = ftvalid; + otvalid->root = ftvalid; FT_TRACE3(( "validating GDEF table\n" )); OTV_INIT; @@ -186,19 +186,19 @@ else table_size = 10; /* OpenType < 1.2 */ - valid->glyph_count = glyph_count; + otvalid->glyph_count = glyph_count; OTV_OPTIONAL_OFFSET( GlyphClassDef ); OTV_SIZE_CHECK( GlyphClassDef ); if ( GlyphClassDef ) - otv_ClassDef_validate( table + GlyphClassDef, valid ); + otv_ClassDef_validate( table + GlyphClassDef, otvalid ); OTV_OPTIONAL_OFFSET( AttachListOffset ); OTV_SIZE_CHECK( AttachListOffset ); if ( AttachListOffset ) { OTV_NEST2( AttachList, AttachPoint ); - OTV_RUN( table + AttachListOffset, valid ); + OTV_RUN( table + AttachListOffset, otvalid ); } OTV_OPTIONAL_OFFSET( LigCaretListOffset ); @@ -206,7 +206,7 @@ if ( LigCaretListOffset ) { OTV_NEST3( LigCaretList, LigGlyph, CaretValue ); - OTV_RUN( table + LigCaretListOffset, valid ); + OTV_RUN( table + LigCaretListOffset, otvalid ); } if ( need_MarkAttachClassDef ) @@ -214,7 +214,7 @@ OTV_OPTIONAL_OFFSET( MarkAttachClassDef ); OTV_SIZE_CHECK( MarkAttachClassDef ); if ( MarkAttachClassDef ) - otv_ClassDef_validate( table + MarkAttachClassDef, valid ); + otv_ClassDef_validate( table + MarkAttachClassDef, otvalid ); } FT_TRACE4(( "\n" )); diff --git a/freetype/src/otvalid/otvgpos.c b/freetype/src/otvalid/otvgpos.c index 49b46183a..1a9dbaaa0 100644 --- a/freetype/src/otvalid/otvgpos.c +++ b/freetype/src/otvalid/otvgpos.c @@ -57,7 +57,7 @@ static void otv_x_sxy( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt Count, count1, table_size; @@ -71,26 +71,26 @@ OTV_TRACE(( " (Count = %d)\n", Count )); - OTV_LIMIT_CHECK( Count * valid->extra1 * 2 ); + OTV_LIMIT_CHECK( Count * otvalid->extra1 * 2 ); - table_size = Count * valid->extra1 * 2 + 2; + table_size = Count * otvalid->extra1 * 2 + 2; for ( ; Count > 0; Count-- ) - for ( count1 = valid->extra1; count1 > 0; count1-- ) + for ( count1 = otvalid->extra1; count1 > 0; count1-- ) { OTV_OPTIONAL_TABLE( anchor_offset ); OTV_OPTIONAL_OFFSET( anchor_offset ); - if ( valid->extra2 ) + if ( otvalid->extra2 ) { OTV_SIZE_CHECK( anchor_offset ); if ( anchor_offset ) - otv_Anchor_validate( table + anchor_offset, valid ); + otv_Anchor_validate( table + anchor_offset, otvalid ); } else - otv_Anchor_validate( table + anchor_offset, valid ); + otv_Anchor_validate( table + anchor_offset, otvalid ); } OTV_EXIT; @@ -101,11 +101,11 @@ #define MarkLigPosFormat1Func otv_u_O_O_u_O_O #define MarkMarkPosFormat1Func otv_u_O_O_u_O_O - /* sets valid->extra1 (class count) */ + /* sets otvalid->extra1 (class count) */ static void otv_u_O_O_u_O_O( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt Coverage1, Coverage2, ClassCount; @@ -124,18 +124,18 @@ Array1 = FT_NEXT_USHORT( p ); Array2 = FT_NEXT_USHORT( p ); - otv_Coverage_validate( table + Coverage1, valid, -1 ); - otv_Coverage_validate( table + Coverage2, valid, -1 ); + otv_Coverage_validate( table + Coverage1, otvalid, -1 ); + otv_Coverage_validate( table + Coverage2, otvalid, -1 ); - otv_MarkArray_validate( table + Array1, valid ); + otv_MarkArray_validate( table + Array1, otvalid ); - valid->nesting_level++; - func = valid->func[valid->nesting_level]; - valid->extra1 = ClassCount; + otvalid->nesting_level++; + func = otvalid->func[otvalid->nesting_level]; + otvalid->extra1 = ClassCount; - func( table + Array2, valid ); + func( table + Array2, otvalid ); - valid->nesting_level--; + otvalid->nesting_level--; OTV_EXIT; } @@ -163,12 +163,12 @@ } - /* uses valid->extra3 (pointer to base table) */ + /* uses otvalid->extra3 (pointer to base table) */ static void otv_ValueRecord_validate( FT_Bytes table, FT_UInt format, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt count; @@ -222,11 +222,11 @@ /* ValueRecord is part of an array -- getting the correct table */ /* size is probably not worth the trouble */ - table_size = p - valid->extra3; + table_size = p - otvalid->extra3; OTV_SIZE_CHECK( device ); if ( device ) - otv_Device_validate( valid->extra3 + device, valid ); + otv_Device_validate( otvalid->extra3 + device, otvalid ); } format >>= 1; } @@ -245,7 +245,7 @@ static void otv_Anchor_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt AnchorFormat; @@ -285,11 +285,11 @@ OTV_SIZE_CHECK( XDeviceTable ); if ( XDeviceTable ) - otv_Device_validate( table + XDeviceTable, valid ); + otv_Device_validate( table + XDeviceTable, otvalid ); OTV_SIZE_CHECK( YDeviceTable ); if ( YDeviceTable ) - otv_Device_validate( table + YDeviceTable, valid ); + otv_Device_validate( table + YDeviceTable, otvalid ); } break; @@ -311,7 +311,7 @@ static void otv_MarkArray_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt MarkCount; @@ -331,7 +331,7 @@ { p += 2; /* skip Class */ /* MarkAnchor */ - otv_Anchor_validate( table + FT_NEXT_USHORT( p ), valid ); + otv_Anchor_validate( table + FT_NEXT_USHORT( p ), otvalid ); } OTV_EXIT; @@ -346,11 +346,11 @@ /*************************************************************************/ /*************************************************************************/ - /* sets valid->extra3 (pointer to base table) */ + /* sets otvalid->extra3 (pointer to base table) */ static void otv_SinglePos_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt PosFormat; @@ -363,7 +363,7 @@ OTV_TRACE(( " (format %d)\n", PosFormat )); - valid->extra3 = table; + otvalid->extra3 = table; switch ( PosFormat ) { @@ -376,8 +376,8 @@ Coverage = FT_NEXT_USHORT( p ); ValueFormat = FT_NEXT_USHORT( p ); - otv_Coverage_validate( table + Coverage, valid, -1 ); - otv_ValueRecord_validate( p, ValueFormat, valid ); /* Value */ + otv_Coverage_validate( table + Coverage, otvalid, -1 ); + otv_ValueRecord_validate( p, ValueFormat, otvalid ); /* Value */ } break; @@ -395,14 +395,14 @@ len_value = otv_value_length( ValueFormat ); - otv_Coverage_validate( table + Coverage, valid, ValueCount ); + otv_Coverage_validate( table + Coverage, otvalid, ValueCount ); OTV_LIMIT_CHECK( ValueCount * len_value ); /* Value */ for ( ; ValueCount > 0; ValueCount-- ) { - otv_ValueRecord_validate( p, ValueFormat, valid ); + otv_ValueRecord_validate( p, ValueFormat, otvalid ); p += len_value; } } @@ -428,7 +428,7 @@ otv_PairSet_validate( FT_Bytes table, FT_UInt format1, FT_UInt format2, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt value_len1, value_len2, PairValueCount; @@ -452,11 +452,11 @@ p += 2; /* skip SecondGlyph */ if ( format1 ) - otv_ValueRecord_validate( p, format1, valid ); /* Value1 */ + otv_ValueRecord_validate( p, format1, otvalid ); /* Value1 */ p += value_len1; if ( format2 ) - otv_ValueRecord_validate( p, format2, valid ); /* Value2 */ + otv_ValueRecord_validate( p, format2, otvalid ); /* Value2 */ p += value_len2; } @@ -464,11 +464,11 @@ } - /* sets valid->extra3 (pointer to base table) */ + /* sets otvalid->extra3 (pointer to base table) */ static void otv_PairPos_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt PosFormat; @@ -481,7 +481,7 @@ OTV_TRACE(( " (format %d)\n", PosFormat )); - valid->extra3 = table; + otvalid->extra3 = table; switch ( PosFormat ) { @@ -498,14 +498,14 @@ OTV_TRACE(( " (PairSetCount = %d)\n", PairSetCount )); - otv_Coverage_validate( table + Coverage, valid, -1 ); + otv_Coverage_validate( table + Coverage, otvalid, -1 ); OTV_LIMIT_CHECK( PairSetCount * 2 ); /* PairSetOffset */ for ( ; PairSetCount > 0; PairSetCount-- ) otv_PairSet_validate( table + FT_NEXT_USHORT( p ), - ValueFormat1, ValueFormat2, valid ); + ValueFormat1, ValueFormat2, otvalid ); } break; @@ -530,9 +530,9 @@ len_value1 = otv_value_length( ValueFormat1 ); len_value2 = otv_value_length( ValueFormat2 ); - otv_Coverage_validate( table + Coverage, valid, -1 ); - otv_ClassDef_validate( table + ClassDef1, valid ); - otv_ClassDef_validate( table + ClassDef2, valid ); + otv_Coverage_validate( table + Coverage, otvalid, -1 ); + otv_ClassDef_validate( table + ClassDef1, otvalid ); + otv_ClassDef_validate( table + ClassDef2, otvalid ); OTV_LIMIT_CHECK( ClassCount1 * ClassCount2 * ( len_value1 + len_value2 ) ); @@ -545,12 +545,12 @@ { if ( ValueFormat1 ) /* Value1 */ - otv_ValueRecord_validate( p, ValueFormat1, valid ); + otv_ValueRecord_validate( p, ValueFormat1, otvalid ); p += len_value1; if ( ValueFormat2 ) /* Value2 */ - otv_ValueRecord_validate( p, ValueFormat2, valid ); + otv_ValueRecord_validate( p, ValueFormat2, otvalid ); p += len_value2; } } @@ -575,7 +575,7 @@ static void otv_CursivePos_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt PosFormat; @@ -605,7 +605,7 @@ OTV_TRACE(( " (EntryExitCount = %d)\n", EntryExitCount )); - otv_Coverage_validate( table + Coverage, valid, EntryExitCount ); + otv_Coverage_validate( table + Coverage, otvalid, EntryExitCount ); OTV_LIMIT_CHECK( EntryExitCount * 4 ); @@ -619,11 +619,11 @@ OTV_SIZE_CHECK( EntryAnchor ); if ( EntryAnchor ) - otv_Anchor_validate( table + EntryAnchor, valid ); + otv_Anchor_validate( table + EntryAnchor, otvalid ); OTV_SIZE_CHECK( ExitAnchor ); if ( ExitAnchor ) - otv_Anchor_validate( table + ExitAnchor, valid ); + otv_Anchor_validate( table + ExitAnchor, otvalid ); } } break; @@ -647,11 +647,11 @@ /* UNDOCUMENTED (in OpenType 1.5): */ /* BaseRecord tables can contain NULL pointers. */ - /* sets valid->extra2 (1) */ + /* sets otvalid->extra2 (1) */ static void otv_MarkBasePos_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt PosFormat; @@ -667,9 +667,9 @@ switch ( PosFormat ) { case 1: - valid->extra2 = 1; + otvalid->extra2 = 1; OTV_NEST2( MarkBasePosFormat1, BaseArray ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; default: @@ -688,11 +688,11 @@ /*************************************************************************/ /*************************************************************************/ - /* sets valid->extra2 (1) */ + /* sets otvalid->extra2 (1) */ static void otv_MarkLigPos_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt PosFormat; @@ -708,9 +708,9 @@ switch ( PosFormat ) { case 1: - valid->extra2 = 1; + otvalid->extra2 = 1; OTV_NEST3( MarkLigPosFormat1, LigatureArray, LigatureAttach ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; default: @@ -729,11 +729,11 @@ /*************************************************************************/ /*************************************************************************/ - /* sets valid->extra2 (0) */ + /* sets otvalid->extra2 (0) */ static void otv_MarkMarkPos_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt PosFormat; @@ -749,9 +749,9 @@ switch ( PosFormat ) { case 1: - valid->extra2 = 0; + otvalid->extra2 = 0; OTV_NEST2( MarkMarkPosFormat1, Mark2Array ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; default: @@ -770,11 +770,11 @@ /*************************************************************************/ /*************************************************************************/ - /* sets valid->extra1 (lookup count) */ + /* sets otvalid->extra1 (lookup count) */ static void otv_ContextPos_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt PosFormat; @@ -794,9 +794,9 @@ /* context rules since even invalid glyph indices/classes return */ /* meaningful results */ - valid->extra1 = valid->lookup_count; + otvalid->extra1 = otvalid->lookup_count; OTV_NEST3( ContextPosFormat1, PosRuleSet, PosRule ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; case 2: @@ -805,12 +805,12 @@ /* meaningful results */ OTV_NEST3( ContextPosFormat2, PosClassSet, PosClassRule ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; case 3: OTV_NEST1( ContextPosFormat3 ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; default: @@ -829,11 +829,11 @@ /*************************************************************************/ /*************************************************************************/ - /* sets valid->extra1 (lookup count) */ + /* sets otvalid->extra1 (lookup count) */ static void otv_ChainContextPos_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt PosFormat; @@ -853,10 +853,10 @@ /* context rules since even invalid glyph indices/classes return */ /* meaningful results */ - valid->extra1 = valid->lookup_count; + otvalid->extra1 = otvalid->lookup_count; OTV_NEST3( ChainContextPosFormat1, ChainPosRuleSet, ChainPosRule ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; case 2: @@ -866,12 +866,12 @@ OTV_NEST3( ChainContextPosFormat2, ChainPosClassSet, ChainPosClassRule ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; case 3: OTV_NEST1( ChainContextPosFormat3 ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; default: @@ -890,11 +890,11 @@ /*************************************************************************/ /*************************************************************************/ - /* uses valid->type_funcs */ + /* uses otvalid->type_funcs */ static void otv_ExtensionPos_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt PosFormat; @@ -923,8 +923,8 @@ if ( ExtensionLookupType == 0 || ExtensionLookupType >= 9 ) FT_INVALID_DATA; - validate = valid->type_funcs[ExtensionLookupType - 1]; - validate( table + ExtensionOffset, valid ); + validate = otvalid->type_funcs[ExtensionLookupType - 1]; + validate( table + ExtensionOffset, otvalid ); } break; @@ -950,17 +950,17 @@ }; - /* sets valid->type_count */ - /* sets valid->type_funcs */ + /* sets otvalid->type_count */ + /* sets otvalid->type_funcs */ FT_LOCAL_DEF( void ) otv_GPOS_subtable_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { - valid->type_count = 9; - valid->type_funcs = (OTV_Validate_Func*)otv_gpos_validate_funcs; + otvalid->type_count = 9; + otvalid->type_funcs = (OTV_Validate_Func*)otv_gpos_validate_funcs; - otv_Lookup_validate( table, valid ); + otv_Lookup_validate( table, otvalid ); } @@ -972,7 +972,7 @@ /*************************************************************************/ /*************************************************************************/ - /* sets valid->glyph_count */ + /* sets otvalid->glyph_count */ FT_LOCAL_DEF( void ) otv_GPOS_validate( FT_Bytes table, @@ -980,12 +980,12 @@ FT_Validator ftvalid ) { OTV_ValidatorRec validrec; - OTV_Validator valid = &validrec; + OTV_Validator otvalid = &validrec; FT_Bytes p = table; FT_UInt ScriptList, FeatureList, LookupList; - valid->root = ftvalid; + otvalid->root = ftvalid; FT_TRACE3(( "validating GPOS table\n" )); OTV_INIT; @@ -999,16 +999,16 @@ FeatureList = FT_NEXT_USHORT( p ); LookupList = FT_NEXT_USHORT( p ); - valid->type_count = 9; - valid->type_funcs = (OTV_Validate_Func*)otv_gpos_validate_funcs; - valid->glyph_count = glyph_count; + otvalid->type_count = 9; + otvalid->type_funcs = (OTV_Validate_Func*)otv_gpos_validate_funcs; + otvalid->glyph_count = glyph_count; otv_LookupList_validate( table + LookupList, - valid ); + otvalid ); otv_FeatureList_validate( table + FeatureList, table + LookupList, - valid ); + otvalid ); otv_ScriptList_validate( table + ScriptList, table + FeatureList, - valid ); + otvalid ); FT_TRACE4(( "\n" )); } diff --git a/freetype/src/otvalid/otvgsub.c b/freetype/src/otvalid/otvgsub.c index ed499d1e9..024b8ca68 100644 --- a/freetype/src/otvalid/otvgsub.c +++ b/freetype/src/otvalid/otvgsub.c @@ -38,11 +38,11 @@ /*************************************************************************/ /*************************************************************************/ - /* uses valid->glyph_count */ + /* uses otvalid->glyph_count */ static void otv_SingleSubst_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt SubstFormat; @@ -68,14 +68,14 @@ Coverage = table + FT_NEXT_USHORT( p ); DeltaGlyphID = FT_NEXT_SHORT( p ); - otv_Coverage_validate( Coverage, valid, -1 ); + otv_Coverage_validate( Coverage, otvalid, -1 ); idx = otv_Coverage_get_first( Coverage ) + DeltaGlyphID; if ( idx < 0 ) FT_INVALID_DATA; idx = otv_Coverage_get_last( Coverage ) + DeltaGlyphID; - if ( (FT_UInt)idx >= valid->glyph_count ) + if ( (FT_UInt)idx >= otvalid->glyph_count ) FT_INVALID_DATA; } break; @@ -91,13 +91,13 @@ OTV_TRACE(( " (GlyphCount = %d)\n", GlyphCount )); - otv_Coverage_validate( table + Coverage, valid, GlyphCount ); + otv_Coverage_validate( table + Coverage, otvalid, GlyphCount ); OTV_LIMIT_CHECK( GlyphCount * 2 ); /* Substitute */ for ( ; GlyphCount > 0; GlyphCount-- ) - if ( FT_NEXT_USHORT( p ) >= valid->glyph_count ) + if ( FT_NEXT_USHORT( p ) >= otvalid->glyph_count ) FT_INVALID_GLYPH_ID; } break; @@ -118,11 +118,11 @@ /*************************************************************************/ /*************************************************************************/ - /* sets valid->extra1 (glyph count) */ + /* sets otvalid->extra1 (glyph count) */ static void otv_MultipleSubst_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt SubstFormat; @@ -138,9 +138,9 @@ switch ( SubstFormat ) { case 1: - valid->extra1 = valid->glyph_count; + otvalid->extra1 = otvalid->glyph_count; OTV_NEST2( MultipleSubstFormat1, Sequence ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; default: @@ -159,11 +159,11 @@ /*************************************************************************/ /*************************************************************************/ - /* sets valid->extra1 (glyph count) */ + /* sets otvalid->extra1 (glyph count) */ static void otv_AlternateSubst_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt SubstFormat; @@ -179,9 +179,9 @@ switch ( SubstFormat ) { case 1: - valid->extra1 = valid->glyph_count; + otvalid->extra1 = otvalid->glyph_count; OTV_NEST2( AlternateSubstFormat1, AlternateSet ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; default: @@ -202,11 +202,11 @@ #define LigatureFunc otv_Ligature_validate - /* uses valid->glyph_count */ + /* uses otvalid->glyph_count */ static void otv_Ligature_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt LigatureGlyph, CompCount; @@ -216,7 +216,7 @@ OTV_LIMIT_CHECK( 4 ); LigatureGlyph = FT_NEXT_USHORT( p ); - if ( LigatureGlyph >= valid->glyph_count ) + if ( LigatureGlyph >= otvalid->glyph_count ) FT_INVALID_DATA; CompCount = FT_NEXT_USHORT( p ); @@ -238,7 +238,7 @@ static void otv_LigatureSubst_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt SubstFormat; @@ -255,7 +255,7 @@ { case 1: OTV_NEST3( LigatureSubstFormat1, LigatureSet, Ligature ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; default: @@ -274,11 +274,11 @@ /*************************************************************************/ /*************************************************************************/ - /* sets valid->extra1 (lookup count) */ + /* sets otvalid->extra1 (lookup count) */ static void otv_ContextSubst_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt SubstFormat; @@ -298,9 +298,9 @@ /* context rules since even invalid glyph indices/classes return */ /* meaningful results */ - valid->extra1 = valid->lookup_count; + otvalid->extra1 = otvalid->lookup_count; OTV_NEST3( ContextSubstFormat1, SubRuleSet, SubRule ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; case 2: @@ -309,12 +309,12 @@ /* meaningful results */ OTV_NEST3( ContextSubstFormat2, SubClassSet, SubClassRule ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; case 3: OTV_NEST1( ContextSubstFormat3 ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; default: @@ -333,11 +333,11 @@ /*************************************************************************/ /*************************************************************************/ - /* sets valid->extra1 (lookup count) */ + /* sets otvalid->extra1 (lookup count) */ static void otv_ChainContextSubst_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt SubstFormat; @@ -357,10 +357,10 @@ /* context rules since even invalid glyph indices/classes return */ /* meaningful results */ - valid->extra1 = valid->lookup_count; + otvalid->extra1 = otvalid->lookup_count; OTV_NEST3( ChainContextSubstFormat1, ChainSubRuleSet, ChainSubRule ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; case 2: @@ -370,12 +370,12 @@ OTV_NEST3( ChainContextSubstFormat2, ChainSubClassSet, ChainSubClassRule ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; case 3: OTV_NEST1( ChainContextSubstFormat3 ); - OTV_RUN( table, valid ); + OTV_RUN( table, otvalid ); break; default: @@ -394,11 +394,11 @@ /*************************************************************************/ /*************************************************************************/ - /* uses valid->type_funcs */ + /* uses otvalid->type_funcs */ static void otv_ExtensionSubst_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt SubstFormat; @@ -429,8 +429,8 @@ ExtensionLookupType > 8 ) FT_INVALID_DATA; - validate = valid->type_funcs[ExtensionLookupType - 1]; - validate( table + ExtensionOffset, valid ); + validate = otvalid->type_funcs[ExtensionLookupType - 1]; + validate( table + ExtensionOffset, otvalid ); } break; @@ -450,11 +450,11 @@ /*************************************************************************/ /*************************************************************************/ - /* uses valid->glyph_count */ + /* uses otvalid->glyph_count */ static void otv_ReverseChainSingleSubst_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table, Coverage; FT_UInt SubstFormat; @@ -477,12 +477,12 @@ OTV_TRACE(( " (BacktrackGlyphCount = %d)\n", BacktrackGlyphCount )); - otv_Coverage_validate( Coverage, valid, -1 ); + otv_Coverage_validate( Coverage, otvalid, -1 ); OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 ); for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- ) - otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid, -1 ); + otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 ); LookaheadGlyphCount = FT_NEXT_USHORT( p ); @@ -491,7 +491,7 @@ OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 ); for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- ) - otv_Coverage_validate( table + FT_NEXT_USHORT( p ), valid, -1 ); + otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 ); GlyphCount = FT_NEXT_USHORT( p ); @@ -504,7 +504,7 @@ /* Substitute */ for ( ; GlyphCount > 0; GlyphCount-- ) - if ( FT_NEXT_USHORT( p ) >= valid->glyph_count ) + if ( FT_NEXT_USHORT( p ) >= otvalid->glyph_count ) FT_INVALID_DATA; break; @@ -538,22 +538,22 @@ /*************************************************************************/ /*************************************************************************/ - /* sets valid->type_count */ - /* sets valid->type_funcs */ - /* sets valid->glyph_count */ + /* sets otvalid->type_count */ + /* sets otvalid->type_funcs */ + /* sets otvalid->glyph_count */ FT_LOCAL_DEF( void ) otv_GSUB_validate( FT_Bytes table, FT_UInt glyph_count, FT_Validator ftvalid ) { - OTV_ValidatorRec validrec; - OTV_Validator valid = &validrec; - FT_Bytes p = table; + OTV_ValidatorRec otvalidrec; + OTV_Validator otvalid = &otvalidrec; + FT_Bytes p = table; FT_UInt ScriptList, FeatureList, LookupList; - valid->root = ftvalid; + otvalid->root = ftvalid; FT_TRACE3(( "validating GSUB table\n" )); OTV_INIT; @@ -567,16 +567,16 @@ FeatureList = FT_NEXT_USHORT( p ); LookupList = FT_NEXT_USHORT( p ); - valid->type_count = 8; - valid->type_funcs = (OTV_Validate_Func*)otv_gsub_validate_funcs; - valid->glyph_count = glyph_count; + otvalid->type_count = 8; + otvalid->type_funcs = (OTV_Validate_Func*)otv_gsub_validate_funcs; + otvalid->glyph_count = glyph_count; otv_LookupList_validate( table + LookupList, - valid ); + otvalid ); otv_FeatureList_validate( table + FeatureList, table + LookupList, - valid ); + otvalid ); otv_ScriptList_validate( table + ScriptList, table + FeatureList, - valid ); + otvalid ); FT_TRACE4(( "\n" )); } diff --git a/freetype/src/otvalid/otvjstf.c b/freetype/src/otvalid/otvjstf.c index a616a2343..f273be8bb 100644 --- a/freetype/src/otvalid/otvjstf.c +++ b/freetype/src/otvalid/otvjstf.c @@ -34,13 +34,13 @@ #define JstfPriorityFunc otv_JstfPriority_validate #define JstfLookupFunc otv_GPOS_subtable_validate - /* uses valid->extra1 (GSUB lookup count) */ - /* uses valid->extra2 (GPOS lookup count) */ - /* sets valid->extra1 (counter) */ + /* uses otvalid->extra1 (GSUB lookup count) */ + /* uses otvalid->extra2 (GPOS lookup count) */ + /* sets otvalid->extra1 (counter) */ static void otv_JstfPriority_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt table_size; @@ -63,34 +63,34 @@ OTV_LIMIT_CHECK( 20 ); - gsub_lookup_count = valid->extra1; - gpos_lookup_count = valid->extra2; + gsub_lookup_count = otvalid->extra1; + gpos_lookup_count = otvalid->extra2; table_size = 20; - valid->extra1 = gsub_lookup_count; + otvalid->extra1 = gsub_lookup_count; OTV_OPTIONAL_OFFSET( ShrinkageEnableGSUB ); OTV_SIZE_CHECK( ShrinkageEnableGSUB ); if ( ShrinkageEnableGSUB ) - otv_x_ux( table + ShrinkageEnableGSUB, valid ); + otv_x_ux( table + ShrinkageEnableGSUB, otvalid ); OTV_OPTIONAL_OFFSET( ShrinkageDisableGSUB ); OTV_SIZE_CHECK( ShrinkageDisableGSUB ); if ( ShrinkageDisableGSUB ) - otv_x_ux( table + ShrinkageDisableGSUB, valid ); + otv_x_ux( table + ShrinkageDisableGSUB, otvalid ); - valid->extra1 = gpos_lookup_count; + otvalid->extra1 = gpos_lookup_count; OTV_OPTIONAL_OFFSET( ShrinkageEnableGPOS ); OTV_SIZE_CHECK( ShrinkageEnableGPOS ); if ( ShrinkageEnableGPOS ) - otv_x_ux( table + ShrinkageEnableGPOS, valid ); + otv_x_ux( table + ShrinkageEnableGPOS, otvalid ); OTV_OPTIONAL_OFFSET( ShrinkageDisableGPOS ); OTV_SIZE_CHECK( ShrinkageDisableGPOS ); if ( ShrinkageDisableGPOS ) - otv_x_ux( table + ShrinkageDisableGPOS, valid ); + otv_x_ux( table + ShrinkageDisableGPOS, otvalid ); OTV_OPTIONAL_OFFSET( ShrinkageJstfMax ); OTV_SIZE_CHECK( ShrinkageJstfMax ); @@ -98,32 +98,32 @@ { /* XXX: check lookup types? */ OTV_NEST2( JstfMax, JstfLookup ); - OTV_RUN( table + ShrinkageJstfMax, valid ); + OTV_RUN( table + ShrinkageJstfMax, otvalid ); } - valid->extra1 = gsub_lookup_count; + otvalid->extra1 = gsub_lookup_count; OTV_OPTIONAL_OFFSET( ExtensionEnableGSUB ); OTV_SIZE_CHECK( ExtensionEnableGSUB ); if ( ExtensionEnableGSUB ) - otv_x_ux( table + ExtensionEnableGSUB, valid ); + otv_x_ux( table + ExtensionEnableGSUB, otvalid ); OTV_OPTIONAL_OFFSET( ExtensionDisableGSUB ); OTV_SIZE_CHECK( ExtensionDisableGSUB ); if ( ExtensionDisableGSUB ) - otv_x_ux( table + ExtensionDisableGSUB, valid ); + otv_x_ux( table + ExtensionDisableGSUB, otvalid ); - valid->extra1 = gpos_lookup_count; + otvalid->extra1 = gpos_lookup_count; OTV_OPTIONAL_OFFSET( ExtensionEnableGPOS ); OTV_SIZE_CHECK( ExtensionEnableGPOS ); if ( ExtensionEnableGPOS ) - otv_x_ux( table + ExtensionEnableGPOS, valid ); + otv_x_ux( table + ExtensionEnableGPOS, otvalid ); OTV_OPTIONAL_OFFSET( ExtensionDisableGPOS ); OTV_SIZE_CHECK( ExtensionDisableGPOS ); if ( ExtensionDisableGPOS ) - otv_x_ux( table + ExtensionDisableGPOS, valid ); + otv_x_ux( table + ExtensionDisableGPOS, otvalid ); OTV_OPTIONAL_OFFSET( ExtensionJstfMax ); OTV_SIZE_CHECK( ExtensionJstfMax ); @@ -131,22 +131,22 @@ { /* XXX: check lookup types? */ OTV_NEST2( JstfMax, JstfLookup ); - OTV_RUN( table + ExtensionJstfMax, valid ); + OTV_RUN( table + ExtensionJstfMax, otvalid ); } - valid->extra1 = gsub_lookup_count; - valid->extra2 = gpos_lookup_count; + otvalid->extra1 = gsub_lookup_count; + otvalid->extra2 = gpos_lookup_count; OTV_EXIT; } - /* sets valid->extra (glyph count) */ - /* sets valid->func1 (otv_JstfPriority_validate) */ + /* sets otvalid->extra (glyph count) */ + /* sets otvalid->func1 (otv_JstfPriority_validate) */ static void otv_JstfScript_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt table_size; @@ -170,16 +170,16 @@ OTV_SIZE_CHECK( ExtGlyph ); if ( ExtGlyph ) { - valid->extra1 = valid->glyph_count; + otvalid->extra1 = otvalid->glyph_count; OTV_NEST1( ExtenderGlyph ); - OTV_RUN( table + ExtGlyph, valid ); + OTV_RUN( table + ExtGlyph, otvalid ); } OTV_SIZE_CHECK( DefJstfLangSys ); if ( DefJstfLangSys ) { OTV_NEST2( JstfLangSys, JstfPriority ); - OTV_RUN( table + DefJstfLangSys, valid ); + OTV_RUN( table + DefJstfLangSys, otvalid ); } OTV_LIMIT_CHECK( 6 * JstfLangSysCount ); @@ -190,16 +190,16 @@ { p += 4; /* skip JstfLangSysTag */ - OTV_RUN( table + FT_NEXT_USHORT( p ), valid ); + OTV_RUN( table + FT_NEXT_USHORT( p ), otvalid ); } OTV_EXIT; } - /* sets valid->extra1 (GSUB lookup count) */ - /* sets valid->extra2 (GPOS lookup count) */ - /* sets valid->glyph_count */ + /* sets otvalid->extra1 (GSUB lookup count) */ + /* sets otvalid->extra2 (GPOS lookup count) */ + /* sets otvalid->glyph_count */ FT_LOCAL_DEF( void ) otv_JSTF_validate( FT_Bytes table, @@ -208,13 +208,14 @@ FT_UInt glyph_count, FT_Validator ftvalid ) { - OTV_ValidatorRec validrec; - OTV_Validator valid = &validrec; + OTV_ValidatorRec otvalidrec; + OTV_Validator otvalid = &otvalidrec; FT_Bytes p = table; FT_UInt JstfScriptCount; - valid->root = ftvalid; + otvalid->root = ftvalid; + FT_TRACE3(( "validating JSTF table\n" )); OTV_INIT; @@ -231,16 +232,16 @@ OTV_LIMIT_CHECK( JstfScriptCount * 6 ); if ( gsub ) - valid->extra1 = otv_GSUBGPOS_get_Lookup_count( gsub ); + otvalid->extra1 = otv_GSUBGPOS_get_Lookup_count( gsub ); else - valid->extra1 = 0; + otvalid->extra1 = 0; if ( gpos ) - valid->extra2 = otv_GSUBGPOS_get_Lookup_count( gpos ); + otvalid->extra2 = otv_GSUBGPOS_get_Lookup_count( gpos ); else - valid->extra2 = 0; + otvalid->extra2 = 0; - valid->glyph_count = glyph_count; + otvalid->glyph_count = glyph_count; /* JstfScriptRecord */ for ( ; JstfScriptCount > 0; JstfScriptCount-- ) @@ -248,7 +249,7 @@ p += 4; /* skip JstfScriptTag */ /* JstfScript */ - otv_JstfScript_validate( table + FT_NEXT_USHORT( p ), valid ); + otv_JstfScript_validate( table + FT_NEXT_USHORT( p ), otvalid ); } FT_TRACE4(( "\n" )); diff --git a/freetype/src/otvalid/otvmath.c b/freetype/src/otvalid/otvmath.c index 96f841f2a..d1791f8de 100644 --- a/freetype/src/otvalid/otvmath.c +++ b/freetype/src/otvalid/otvmath.c @@ -44,7 +44,7 @@ static void otv_MathConstants_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt i; @@ -66,7 +66,7 @@ OTV_OPTIONAL_OFFSET( DeviceTableOffset ); OTV_SIZE_CHECK( DeviceTableOffset ); if ( DeviceTableOffset ) - otv_Device_validate( table + DeviceTableOffset, valid ); + otv_Device_validate( table + DeviceTableOffset, otvalid ); } OTV_EXIT; @@ -84,7 +84,7 @@ static void otv_MathItalicsCorrectionInfo_validate( FT_Bytes table, - OTV_Validator valid, + OTV_Validator otvalid, FT_Int isItalic ) { FT_Bytes p = table; @@ -108,7 +108,7 @@ table_size = 4 + 4 * cnt; OTV_SIZE_CHECK( Coverage ); - otv_Coverage_validate( table + Coverage, valid, cnt ); + otv_Coverage_validate( table + Coverage, otvalid, cnt ); for ( i = 0; i < cnt; ++i ) { @@ -116,7 +116,7 @@ OTV_OPTIONAL_OFFSET( DeviceTableOffset ); OTV_SIZE_CHECK( DeviceTableOffset ); if ( DeviceTableOffset ) - otv_Device_validate( table + DeviceTableOffset, valid ); + otv_Device_validate( table + DeviceTableOffset, otvalid ); } OTV_EXIT; @@ -133,7 +133,7 @@ static void otv_MathKern_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt i, cnt, table_size; @@ -157,7 +157,7 @@ OTV_OPTIONAL_OFFSET( DeviceTableOffset ); OTV_SIZE_CHECK( DeviceTableOffset ); if ( DeviceTableOffset ) - otv_Device_validate( table + DeviceTableOffset, valid ); + otv_Device_validate( table + DeviceTableOffset, otvalid ); } /* One more Kerning value */ @@ -167,7 +167,7 @@ OTV_OPTIONAL_OFFSET( DeviceTableOffset ); OTV_SIZE_CHECK( DeviceTableOffset ); if ( DeviceTableOffset ) - otv_Device_validate( table + DeviceTableOffset, valid ); + otv_Device_validate( table + DeviceTableOffset, otvalid ); } OTV_EXIT; @@ -176,7 +176,7 @@ static void otv_MathKernInfo_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt i, j, cnt, table_size; @@ -196,7 +196,7 @@ table_size = 4 + 8 * cnt; OTV_SIZE_CHECK( Coverage ); - otv_Coverage_validate( table + Coverage, valid, cnt ); + otv_Coverage_validate( table + Coverage, otvalid, cnt ); for ( i = 0; i < cnt; ++i ) { @@ -205,7 +205,7 @@ OTV_OPTIONAL_OFFSET( MKRecordOffset ); OTV_SIZE_CHECK( MKRecordOffset ); if ( MKRecordOffset ) - otv_MathKern_validate( table + MKRecordOffset, valid ); + otv_MathKern_validate( table + MKRecordOffset, otvalid ); } } @@ -223,7 +223,7 @@ static void otv_MathGlyphInfo_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt MathItalicsCorrectionInfo, MathTopAccentAttachment; @@ -241,22 +241,22 @@ if ( MathItalicsCorrectionInfo ) otv_MathItalicsCorrectionInfo_validate( - table + MathItalicsCorrectionInfo, valid, TRUE ); + table + MathItalicsCorrectionInfo, otvalid, TRUE ); /* Italic correction and Top Accent Attachment have the same format */ if ( MathTopAccentAttachment ) otv_MathItalicsCorrectionInfo_validate( - table + MathTopAccentAttachment, valid, FALSE ); + table + MathTopAccentAttachment, otvalid, FALSE ); if ( ExtendedShapeCoverage ) { OTV_NAME_ENTER( "ExtendedShapeCoverage" ); - otv_Coverage_validate( table + ExtendedShapeCoverage, valid, -1 ); + otv_Coverage_validate( table + ExtendedShapeCoverage, otvalid, -1 ); OTV_EXIT; } if ( MathKernInfo ) - otv_MathKernInfo_validate( table + MathKernInfo, valid ); + otv_MathKernInfo_validate( table + MathKernInfo, otvalid ); OTV_EXIT; } @@ -272,7 +272,7 @@ static void otv_GlyphAssembly_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt pcnt, table_size; @@ -294,7 +294,7 @@ OTV_SIZE_CHECK( DeviceTableOffset ); if ( DeviceTableOffset ) - otv_Device_validate( table + DeviceTableOffset, valid ); + otv_Device_validate( table + DeviceTableOffset, otvalid ); for ( i = 0; i < pcnt; ++i ) { @@ -302,7 +302,7 @@ gid = FT_NEXT_USHORT( p ); - if ( gid >= valid->glyph_count ) + if ( gid >= otvalid->glyph_count ) FT_INVALID_GLYPH_ID; p += 2*4; /* skip the Start, End, Full, and Flags fields */ } @@ -313,7 +313,7 @@ static void otv_MathGlyphConstruction_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt vcnt, table_size; @@ -338,14 +338,14 @@ gid = FT_NEXT_USHORT( p ); - if ( gid >= valid->glyph_count ) + if ( gid >= otvalid->glyph_count ) FT_INVALID_GLYPH_ID; p += 2; /* skip the size */ } OTV_SIZE_CHECK( GlyphAssembly ); if ( GlyphAssembly ) - otv_GlyphAssembly_validate( table+GlyphAssembly, valid ); + otv_GlyphAssembly_validate( table+GlyphAssembly, otvalid ); /* OTV_EXIT; */ } @@ -353,7 +353,7 @@ static void otv_MathVariants_validate( FT_Bytes table, - OTV_Validator valid ) + OTV_Validator otvalid ) { FT_Bytes p = table; FT_UInt vcnt, hcnt, i, table_size; @@ -378,24 +378,24 @@ OTV_SIZE_CHECK( VCoverage ); if ( VCoverage ) - otv_Coverage_validate( table + VCoverage, valid, vcnt ); + otv_Coverage_validate( table + VCoverage, otvalid, vcnt ); OTV_SIZE_CHECK( HCoverage ); if ( HCoverage ) - otv_Coverage_validate( table + HCoverage, valid, hcnt ); + otv_Coverage_validate( table + HCoverage, otvalid, hcnt ); for ( i = 0; i < vcnt; ++i ) { OTV_OPTIONAL_OFFSET( Offset ); OTV_SIZE_CHECK( Offset ); - otv_MathGlyphConstruction_validate( table + Offset, valid ); + otv_MathGlyphConstruction_validate( table + Offset, otvalid ); } for ( i = 0; i < hcnt; ++i ) { OTV_OPTIONAL_OFFSET( Offset ); OTV_SIZE_CHECK( Offset ); - otv_MathGlyphConstruction_validate( table + Offset, valid ); + otv_MathGlyphConstruction_validate( table + Offset, otvalid ); } OTV_EXIT; @@ -410,20 +410,20 @@ /*************************************************************************/ /*************************************************************************/ - /* sets valid->glyph_count */ + /* sets otvalid->glyph_count */ FT_LOCAL_DEF( void ) otv_MATH_validate( FT_Bytes table, FT_UInt glyph_count, FT_Validator ftvalid ) { - OTV_ValidatorRec validrec; - OTV_Validator valid = &validrec; - FT_Bytes p = table; + OTV_ValidatorRec otvalidrec; + OTV_Validator otvalid = &otvalidrec; + FT_Bytes p = table; FT_UInt MathConstants, MathGlyphInfo, MathVariants; - valid->root = ftvalid; + otvalid->root = ftvalid; FT_TRACE3(( "validating MATH table\n" )); OTV_INIT; @@ -437,14 +437,14 @@ MathGlyphInfo = FT_NEXT_USHORT( p ); MathVariants = FT_NEXT_USHORT( p ); - valid->glyph_count = glyph_count; + otvalid->glyph_count = glyph_count; otv_MathConstants_validate( table + MathConstants, - valid ); + otvalid ); otv_MathGlyphInfo_validate( table + MathGlyphInfo, - valid ); + otvalid ); otv_MathVariants_validate ( table + MathVariants, - valid ); + otvalid ); FT_TRACE4(( "\n" )); } diff --git a/freetype/src/pcf/README b/freetype/src/pcf/README index 8858d68ca..10eff15fb 100644 --- a/freetype/src/pcf/README +++ b/freetype/src/pcf/README @@ -33,7 +33,7 @@ Encodings Use `FT_Get_BDF_Charset_ID' to access the encoding and registry. -The driver always exports `ft_encoding_none' as face->charmap.encoding. +The driver always exports `ft_encoding_none' as face->charmap.encoding. FT_Get_Char_Index() behavior is unmodified, that is, it converts the ULong value given as argument into the corresponding glyph number. diff --git a/freetype/src/pcf/pcfdrivr.c b/freetype/src/pcf/pcfdrivr.c index 748cbca8f..96f6912ba 100644 --- a/freetype/src/pcf/pcfdrivr.c +++ b/freetype/src/pcf/pcfdrivr.c @@ -2,7 +2,7 @@ FreeType font driver for pcf files - Copyright (C) 2000-2004, 2006-2011, 2013 by + Copyright (C) 2000-2004, 2006-2011, 2013, 2014 by Francesco Zappa Nardelli Permission is hereby granted, free of charge, to any person obtaining a copy @@ -189,7 +189,7 @@ THE SOFTWARE. } - FT_CALLBACK_TABLE_DEF + static const FT_CMap_ClassRec pcf_cmap_class = { sizeof ( PCF_CMapRec ), @@ -494,7 +494,13 @@ THE SOFTWARE. FT_TRACE1(( "PCF_Glyph_Load: glyph index %d\n", glyph_index )); - if ( !face || glyph_index >= (FT_UInt)face->root.num_glyphs ) + if ( !face ) + { + error = FT_THROW( Invalid_Face_Handle ); + goto Exit; + } + + if ( glyph_index >= (FT_UInt)face->root.num_glyphs ) { error = FT_THROW( Invalid_Argument ); goto Exit; diff --git a/freetype/src/pcf/pcfread.c b/freetype/src/pcf/pcfread.c index d936c5805..a29a9e371 100644 --- a/freetype/src/pcf/pcfread.c +++ b/freetype/src/pcf/pcfread.c @@ -2,7 +2,7 @@ FreeType font driver for pcf fonts - Copyright 2000-2010, 2012, 2013 by + Copyright 2000-2010, 2012-2014 by Francesco Zappa Nardelli Permission is hereby granted, free of charge, to any person obtaining a copy @@ -78,7 +78,7 @@ THE SOFTWARE. FT_FRAME_START( 16 ), FT_FRAME_ULONG_LE( type ), FT_FRAME_ULONG_LE( format ), - FT_FRAME_ULONG_LE( size ), + FT_FRAME_ULONG_LE( size ), /* rounded up to a multiple of 4 */ FT_FRAME_ULONG_LE( offset ), FT_FRAME_END }; @@ -95,9 +95,11 @@ THE SOFTWARE. FT_Memory memory = FT_FACE( face )->memory; FT_UInt n; + FT_ULong size; - if ( FT_STREAM_SEEK ( 0 ) || - FT_STREAM_READ_FIELDS ( pcf_toc_header, toc ) ) + + if ( FT_STREAM_SEEK( 0 ) || + FT_STREAM_READ_FIELDS( pcf_toc_header, toc ) ) return FT_THROW( Cannot_Open_Resource ); if ( toc->version != PCF_FILE_VERSION || @@ -144,13 +146,62 @@ THE SOFTWARE. if ( ( tables[i].size > tables[i + 1].offset ) || ( tables[i].offset > tables[i + 1].offset - tables[i].size ) ) - return FT_THROW( Invalid_Offset ); + { + error = FT_THROW( Invalid_Offset ); + goto Exit; + } } if ( !have_change ) break; } + /* + * We now check whether the `size' and `offset' values are reasonable: + * `offset' + `size' must not exceed the stream size. + * + * Note, however, that X11's `pcfWriteFont' routine (used by the + * `bdftopcf' program to create PDF font files) has two special + * features. + * + * - It always assigns the accelerator table a size of 100 bytes in the + * TOC, regardless of its real size, which can vary between 34 and 72 + * bytes. + * + * - Due to the way the routine is designed, it ships out the last font + * table with its real size, ignoring the TOC's size value. Since + * the TOC size values are always rounded up to a multiple of 4, the + * difference can be up to three bytes for all tables except the + * accelerator table, for which the difference can be as large as 66 + * bytes. + * + */ + + tables = face->toc.tables; + size = stream->size; + + for ( n = 0; n < toc->count - 1; n++ ) + { + /* we need two checks to avoid overflow */ + if ( ( tables->size > size ) || + ( tables->offset > size - tables->size ) ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + tables++; + } + + /* only check `tables->offset' for last table element ... */ + if ( ( tables->offset > size ) ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + /* ... and adjust `tables->size' to the real value if necessary */ + if ( tables->size > size - tables->offset ) + tables->size = size - tables->offset; + #ifdef FT_DEBUG_LEVEL_TRACE { @@ -631,24 +682,40 @@ THE SOFTWARE. return FT_THROW( Out_Of_Memory ); metrics = face->metrics; - for ( i = 0; i < nmetrics; i++ ) + for ( i = 0; i < nmetrics; i++, metrics++ ) { - error = pcf_get_metric( stream, format, metrics + i ); + error = pcf_get_metric( stream, format, metrics ); - metrics[i].bits = 0; + metrics->bits = 0; FT_TRACE5(( " idx %d: width=%d, " "lsb=%d, rsb=%d, ascent=%d, descent=%d, swidth=%d\n", i, - ( metrics + i )->characterWidth, - ( metrics + i )->leftSideBearing, - ( metrics + i )->rightSideBearing, - ( metrics + i )->ascent, - ( metrics + i )->descent, - ( metrics + i )->attributes )); + metrics->characterWidth, + metrics->leftSideBearing, + metrics->rightSideBearing, + metrics->ascent, + metrics->descent, + metrics->attributes )); if ( error ) break; + + /* sanity checks -- those values are used in `PCF_Glyph_Load' to */ + /* compute a glyph's bitmap dimensions, thus setting them to zero in */ + /* case of an error disables this particular glyph only */ + if ( metrics->rightSideBearing < metrics->leftSideBearing || + metrics->ascent + metrics->descent < 0 ) + { + metrics->characterWidth = 0; + metrics->leftSideBearing = 0; + metrics->rightSideBearing = 0; + metrics->ascent = 0; + metrics->descent = 0; + + FT_TRACE0(( "pcf_get_metrics:" + " invalid metrics for glyph %d\n", i )); + } } if ( error ) @@ -699,8 +766,8 @@ THE SOFTWARE. FT_TRACE4(( " number of bitmaps: %d\n", nbitmaps )); - /* XXX: PCF_Face->nmetrics is singed FT_Long, see pcf.h */ - if ( face->nmetrics < 0 || nbitmaps != ( FT_ULong )face->nmetrics ) + /* XXX: PCF_Face->nmetrics is signed FT_Long, see pcf.h */ + if ( face->nmetrics < 0 || nbitmaps != (FT_ULong)face->nmetrics ) return FT_THROW( Invalid_File_Format ); if ( FT_NEW_ARRAY( offsets, nbitmaps ) ) @@ -812,6 +879,15 @@ THE SOFTWARE. if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) return FT_THROW( Invalid_File_Format ); + /* sanity checks */ + if ( firstCol < 0 || + firstCol > lastCol || + lastCol > 0xFF || + firstRow < 0 || + firstRow > lastRow || + lastRow > 0xFF ) + return FT_THROW( Invalid_Table ); + FT_TRACE4(( "pdf_get_encodings:\n" )); FT_TRACE4(( " firstCol %d, lastCol %d, firstRow %d, lastRow %d\n", diff --git a/freetype/src/pfr/pfrcmap.c b/freetype/src/pfr/pfrcmap.c index 1f05640cc..90ba0105e 100644 --- a/freetype/src/pfr/pfrcmap.c +++ b/freetype/src/pfr/pfrcmap.c @@ -25,11 +25,14 @@ FT_CALLBACK_DEF( FT_Error ) - pfr_cmap_init( PFR_CMap cmap ) + pfr_cmap_init( PFR_CMap cmap, + FT_Pointer pointer ) { FT_Error error = FT_Err_Ok; PFR_Face face = (PFR_Face)FT_CMAP_FACE( cmap ); + FT_UNUSED( pointer ); + cmap->num_chars = face->phy_font.num_chars; cmap->chars = face->phy_font.chars; diff --git a/freetype/src/pfr/pfrdrivr.c b/freetype/src/pfr/pfrdrivr.c index 4c43947bf..db66281ac 100644 --- a/freetype/src/pfr/pfrdrivr.c +++ b/freetype/src/pfr/pfrdrivr.c @@ -4,7 +4,7 @@ /* */ /* FreeType PFR driver interface (body). */ /* */ -/* Copyright 2002-2004, 2006, 2008, 2010, 2011, 2013 by */ +/* Copyright 2002-2004, 2006, 2008, 2010, 2011, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -37,7 +37,7 @@ PFR_PhyFont phys = &face->phy_font; - pfr_face_get_kerning( pfrface, left, right, avector ); + (void)pfr_face_get_kerning( pfrface, left, right, avector ); /* convert from metrics to outline units when necessary */ if ( phys->outline_resolution != phys->metrics_resolution ) @@ -134,7 +134,7 @@ } - FT_CALLBACK_TABLE_DEF + static const FT_Service_PfrMetricsRec pfr_metrics_service_rec = { pfr_get_metrics, diff --git a/freetype/src/pfr/pfrgload.c b/freetype/src/pfr/pfrgload.c index 88b4d66a1..2ce093779 100644 --- a/freetype/src/pfr/pfrgload.c +++ b/freetype/src/pfr/pfrgload.c @@ -763,7 +763,7 @@ PFR_SubGlyph subglyph; - FT_TRACE4(( "subglyph %d:\n", n )); + FT_TRACE4(( " subglyph %d:\n", n )); subglyph = glyph->subs + old_count + n; old_points = base->n_points; diff --git a/freetype/src/pfr/pfrload.c b/freetype/src/pfr/pfrload.c index 97c130aad..f68d01639 100644 --- a/freetype/src/pfr/pfrload.c +++ b/freetype/src/pfr/pfrload.c @@ -179,7 +179,7 @@ if ( header->signature != 0x50465230L || /* "PFR0" */ header->version > 4 || header->header_size < 58 || - header->signature2 != 0x0d0a ) /* CR/LF */ + header->signature2 != 0x0D0A ) /* CR/LF */ { result = 0; } diff --git a/freetype/src/pfr/pfrobjs.c b/freetype/src/pfr/pfrobjs.c index 194d2df2d..0c89242c7 100644 --- a/freetype/src/pfr/pfrobjs.c +++ b/freetype/src/pfr/pfrobjs.c @@ -4,7 +4,7 @@ /* */ /* FreeType PFR object methods (body). */ /* */ -/* Copyright 2002-2008, 2010-2011, 2013 by */ +/* Copyright 2002-2008, 2010-2011, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -23,6 +23,7 @@ #include "pfrsbit.h" #include FT_OUTLINE_H #include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_CALC_H #include FT_TRUETYPE_IDS_H #include "pfrerror.h" @@ -515,7 +516,7 @@ { FT_UInt count = item->pair_count; FT_UInt size = item->pair_size; - FT_UInt power = (FT_UInt)ft_highpow2( (FT_UInt32)count ); + FT_UInt power = 1 << FT_MSB( count ); FT_UInt probe = power * size; FT_UInt extra = count - power; FT_Byte* base = stream->cursor; diff --git a/freetype/src/pfr/pfrsbit.c b/freetype/src/pfr/pfrsbit.c index 2da150070..979bf78a2 100644 --- a/freetype/src/pfr/pfrsbit.c +++ b/freetype/src/pfr/pfrsbit.c @@ -59,7 +59,7 @@ if ( !decreasing ) { - writer->line += writer->pitch * ( target->rows-1 ); + writer->line += writer->pitch * ( target->rows - 1 ); writer->pitch = -writer->pitch; } } @@ -636,7 +636,9 @@ * which causes a size truncation, because truncated * size properties makes bitmap glyph broken. */ - if ( xpos > FT_INT_MAX || ( ypos + ysize ) > FT_INT_MAX ) + if ( xpos > FT_INT_MAX || xpos < FT_INT_MIN || + ysize > FT_INT_MAX || ypos + ysize > FT_INT_MAX || + ypos + (FT_Long)ysize < FT_INT_MIN ) { FT_TRACE1(( "pfr_slot_load_bitmap:" )); FT_TRACE1(( "huge bitmap glyph %dx%d over FT_GlyphSlot\n", diff --git a/freetype/src/psaux/psconv.c b/freetype/src/psaux/psconv.c index d0d8861c2..22e8cf2d1 100644 --- a/freetype/src/psaux/psconv.c +++ b/freetype/src/psaux/psconv.c @@ -124,7 +124,7 @@ if ( IS_PS_SPACE( *p ) || *p OP 0x80 ) break; - c = ft_char_table[*p & 0x7f]; + c = ft_char_table[*p & 0x7F]; if ( c < 0 || c >= base ) break; @@ -245,12 +245,13 @@ if ( IS_PS_SPACE( *p ) || *p OP 0x80 ) break; - c = ft_char_table[*p & 0x7f]; + c = ft_char_table[*p & 0x7F]; if ( c < 0 || c >= 10 ) break; - if ( decimal < 0xCCCCCCCL ) + /* only add digit if we don't overflow */ + if ( divider < 0xCCCCCCCL && decimal < 0xCCCCCCCL ) { decimal = decimal * 10 + c; @@ -520,7 +521,7 @@ if ( *p OP 0x80 ) break; - c = ft_char_table[*p & 0x7f]; + c = ft_char_table[*p & 0x7F]; if ( (unsigned)c >= 16 ) break; diff --git a/freetype/src/psaux/psobjs.c b/freetype/src/psaux/psobjs.c index b4b7d45c3..7ec3b4cf5 100644 --- a/freetype/src/psaux/psobjs.c +++ b/freetype/src/psaux/psobjs.c @@ -1338,7 +1338,15 @@ { parser->cursor = token->start; parser->limit = token->limit; - ps_parser_load_field( parser, &fieldrec, objects, max_objects, 0 ); + + error = ps_parser_load_field( parser, + &fieldrec, + objects, + max_objects, + 0 ); + if ( error ) + break; + fieldrec.offset += fieldrec.size; } diff --git a/freetype/src/psaux/t1cmap.c b/freetype/src/psaux/t1cmap.c index 9e5bd34ff..fb1353ae0 100644 --- a/freetype/src/psaux/t1cmap.c +++ b/freetype/src/psaux/t1cmap.c @@ -120,8 +120,12 @@ FT_CALLBACK_DEF( FT_Error ) - t1_cmap_standard_init( T1_CMapStd cmap ) + t1_cmap_standard_init( T1_CMapStd cmap, + FT_Pointer pointer ) { + FT_UNUSED( pointer ); + + t1_cmap_std_init( cmap, 0 ); return 0; } @@ -142,8 +146,12 @@ FT_CALLBACK_DEF( FT_Error ) - t1_cmap_expert_init( T1_CMapStd cmap ) + t1_cmap_expert_init( T1_CMapStd cmap, + FT_Pointer pointer ) { + FT_UNUSED( pointer ); + + t1_cmap_std_init( cmap, 1 ); return 0; } @@ -172,11 +180,14 @@ FT_CALLBACK_DEF( FT_Error ) - t1_cmap_custom_init( T1_CMapCustom cmap ) + t1_cmap_custom_init( T1_CMapCustom cmap, + FT_Pointer pointer ) { T1_Face face = (T1_Face)FT_CMAP_FACE( cmap ); T1_Encoding encoding = &face->type1.encoding; + FT_UNUSED( pointer ); + cmap->first = encoding->code_first; cmap->count = (FT_UInt)( encoding->code_last - cmap->first ); @@ -272,12 +283,15 @@ FT_CALLBACK_DEF( FT_Error ) - t1_cmap_unicode_init( PS_Unicodes unicodes ) + t1_cmap_unicode_init( PS_Unicodes unicodes, + FT_Pointer pointer ) { T1_Face face = (T1_Face)FT_CMAP_FACE( unicodes ); FT_Memory memory = FT_FACE_MEMORY( face ); FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames; + FT_UNUSED( pointer ); + return psnames->unicodes_init( memory, unicodes, diff --git a/freetype/src/psaux/t1decode.c b/freetype/src/psaux/t1decode.c index 6ce370bfa..d67a05ebc 100644 --- a/freetype/src/psaux/t1decode.c +++ b/freetype/src/psaux/t1decode.c @@ -4,7 +4,7 @@ /* */ /* PostScript Type 1 decoding routines (body). */ /* */ -/* Copyright 2000-2013 by */ +/* Copyright 2000-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -1098,10 +1098,12 @@ goto Syntax_Error; /* apply hints to the loaded glyph outline now */ - hinter->apply( hinter->hints, - builder->current, - (PSH_Globals)builder->hints_globals, - decoder->hint_mode ); + error = hinter->apply( hinter->hints, + builder->current, + (PSH_Globals)builder->hints_globals, + decoder->hint_mode ); + if ( error ) + goto Fail; } /* add current outline to the glyph slot */ diff --git a/freetype/src/pshinter/pshglob.c b/freetype/src/pshinter/pshglob.c index f75bae451..1bcc481b9 100644 --- a/freetype/src/pshinter/pshglob.c +++ b/freetype/src/pshinter/pshglob.c @@ -5,7 +5,7 @@ /* PostScript hinter global hinting management (body). */ /* Inspired by the new auto-hinter module. */ /* */ -/* Copyright 2001-2004, 2006, 2010, 2012, 2013 by */ +/* Copyright 2001-2004, 2006, 2010, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -750,7 +750,7 @@ } - FT_LOCAL_DEF( FT_Error ) + FT_LOCAL_DEF( void ) psh_globals_set_scale( PSH_Globals globals, FT_Fixed x_scale, FT_Fixed y_scale, @@ -780,8 +780,6 @@ psh_globals_scale_widths( globals, 1 ); psh_blues_scale_zones( &globals->blues, y_scale, y_delta ); } - - return 0; } diff --git a/freetype/src/pshinter/pshglob.h b/freetype/src/pshinter/pshglob.h index c51162615..94d972a94 100644 --- a/freetype/src/pshinter/pshglob.h +++ b/freetype/src/pshinter/pshglob.h @@ -4,7 +4,7 @@ /* */ /* PostScript hinter global hinting management. */ /* */ -/* Copyright 2001, 2002, 2003 by */ +/* Copyright 2001, 2002, 2003, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -167,7 +167,7 @@ FT_BEGIN_HEADER FT_Int org_width ); #endif - FT_LOCAL( FT_Error ) + FT_LOCAL( void ) psh_globals_set_scale( PSH_Globals globals, FT_Fixed x_scale, FT_Fixed y_scale, diff --git a/freetype/src/pshinter/pshrec.c b/freetype/src/pshinter/pshrec.c index cd66ea869..73a18ffd6 100644 --- a/freetype/src/pshinter/pshrec.c +++ b/freetype/src/pshinter/pshrec.c @@ -4,7 +4,7 @@ /* */ /* FreeType PostScript hints recorder (body). */ /* */ -/* Copyright 2001-2004, 2007, 2009, 2013 by */ +/* Copyright 2001-2004, 2007, 2009, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -797,13 +797,12 @@ } - FT_LOCAL( FT_Error ) + FT_LOCAL( void ) ps_hints_init( PS_Hints hints, FT_Memory memory ) { FT_MEM_ZERO( hints, sizeof ( *hints ) ); hints->memory = memory; - return FT_Err_Ok; } diff --git a/freetype/src/pshinter/pshrec.h b/freetype/src/pshinter/pshrec.h index dcb3197f9..a88fe6e83 100644 --- a/freetype/src/pshinter/pshrec.h +++ b/freetype/src/pshinter/pshrec.h @@ -4,7 +4,7 @@ /* */ /* Postscript (Type1/Type2) hints recorder (specification). */ /* */ -/* Copyright 2001, 2002, 2003, 2006, 2008 by */ +/* Copyright 2001, 2002, 2003, 2006, 2008, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -141,7 +141,7 @@ FT_BEGIN_HEADER /* */ /* initialize hints recorder */ - FT_LOCAL( FT_Error ) + FT_LOCAL( void ) ps_hints_init( PS_Hints hints, FT_Memory memory ); diff --git a/freetype/src/psnames/psmodule.c b/freetype/src/psnames/psmodule.c index 0a5bcb7d2..42c9aff27 100644 --- a/freetype/src/psnames/psmodule.c +++ b/freetype/src/psnames/psmodule.c @@ -4,7 +4,7 @@ /* */ /* PSNames module implementation (body). */ /* */ -/* Copyright 1996-2003, 2005-2008, 2012, 2013 by */ +/* Copyright 1996-2003, 2005-2008, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -563,7 +563,7 @@ psnames_get_service( FT_Module module, const char* service_id ) { - /* PSCMAPS_SERVICES_GET derefers `library' in PIC mode */ + /* PSCMAPS_SERVICES_GET dereferences `library' in PIC mode */ #ifdef FT_CONFIG_OPTION_PIC FT_Library library; diff --git a/freetype/src/raster/ftraster.c b/freetype/src/raster/ftraster.c index ddecc809c..b06ac333d 100644 --- a/freetype/src/raster/ftraster.c +++ b/freetype/src/raster/ftraster.c @@ -2284,6 +2284,8 @@ Long e1, e2; Byte* target; + Int dropOutControl = left->flags & 7; + FT_UNUSED( y ); FT_UNUSED( left ); FT_UNUSED( right ); @@ -2293,7 +2295,8 @@ e1 = TRUNC( CEILING( x1 ) ); - if ( x2 - x1 - ras.precision <= ras.precision_jitter ) + if ( dropOutControl != 2 && + x2 - x1 - ras.precision <= ras.precision_jitter ) e2 = e1; else e2 = TRUNC( FLOOR( x2 ) ); @@ -2550,7 +2553,7 @@ e1 = TRUNC( e1 ); - if ( e1 >= 0 && e1 < ras.target.rows ) + if ( e1 >= 0 && (ULong)e1 < ras.target.rows ) { PByte p; @@ -2644,7 +2647,7 @@ /* bounding box instead */ if ( pxl < 0 ) pxl = e1; - else if ( TRUNC( pxl ) >= ras.target.rows ) + else if ( (ULong)( TRUNC( pxl ) ) >= ras.target.rows ) pxl = e2; /* check that the other pixel isn't set */ @@ -2659,9 +2662,9 @@ if ( ras.target.pitch > 0 ) bits += ( ras.target.rows - 1 ) * ras.target.pitch; - if ( e1 >= 0 && - e1 < ras.target.rows && - *bits & f1 ) + if ( e1 >= 0 && + (ULong)e1 < ras.target.rows && + *bits & f1 ) return; } else @@ -2673,7 +2676,7 @@ e1 = TRUNC( pxl ); - if ( e1 >= 0 && e1 < ras.target.rows ) + if ( e1 >= 0 && (ULong)e1 < ras.target.rows ) { bits -= e1 * ras.target.pitch; if ( ras.target.pitch > 0 ) @@ -3539,7 +3542,7 @@ } - static void + static int ft_black_set_mode( black_PRaster raster, unsigned long mode, const char* palette ) @@ -3563,6 +3566,8 @@ FT_UNUSED( palette ); #endif + + return 0; } diff --git a/freetype/src/sfnt/pngshim.c b/freetype/src/sfnt/pngshim.c index 878de1fef..9bfcc2a77 100644 --- a/freetype/src/sfnt/pngshim.c +++ b/freetype/src/sfnt/pngshim.c @@ -4,7 +4,7 @@ /* */ /* PNG Bitmap glyph support. */ /* */ -/* Copyright 2013 by Google, Inc. */ +/* Copyright 2013, 2014 by Google, Inc. */ /* Written by Stuart Gill and Behdad Esfahbod. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -129,7 +129,7 @@ *error = FT_THROW( Out_Of_Memory ); #ifdef PNG_SETJMP_SUPPORTED - longjmp( png_jmpbuf( png ), 1 ); + ft_longjmp( png_jmpbuf( png ), 1 ); #endif /* if we get here, then we have no choice but to abort ... */ } @@ -205,11 +205,11 @@ goto Exit; } - if ( !populate_map_and_metrics && - ( x_offset + metrics->width > map->width || - y_offset + metrics->height > map->rows || - pix_bits != 32 || - map->pixel_mode != FT_PIXEL_MODE_BGRA ) ) + if ( !populate_map_and_metrics && + ( (FT_UInt)x_offset + metrics->width > map->width || + (FT_UInt)y_offset + metrics->height > map->rows || + pix_bits != 32 || + map->pixel_mode != FT_PIXEL_MODE_BGRA ) ) { error = FT_THROW( Invalid_Argument ); goto Exit; @@ -269,6 +269,14 @@ map->pitch = map->width * 4; map->num_grays = 256; + /* reject too large bitmaps similarly to the rasterizer */ + if ( map->rows > 0x7FFF || map->width > 0x7FFF ) + { + error = FT_THROW( Array_Too_Large ); + goto DestroyExit; + } + + /* this doesn't overflow: 0x7FFF * 0x7FFF * 4 < 2^32 */ size = map->rows * map->pitch; error = ft_glyphslot_alloc_bitmap( slot, size ); diff --git a/freetype/src/sfnt/sfdriver.c b/freetype/src/sfnt/sfdriver.c index e4fcda5ec..badb159dc 100644 --- a/freetype/src/sfnt/sfdriver.c +++ b/freetype/src/sfnt/sfdriver.c @@ -75,36 +75,36 @@ switch ( tag ) { - case ft_sfnt_head: + case FT_SFNT_HEAD: table = &face->header; break; - case ft_sfnt_hhea: + case FT_SFNT_HHEA: table = &face->horizontal; break; - case ft_sfnt_vhea: - table = face->vertical_info ? &face->vertical : 0; + case FT_SFNT_VHEA: + table = face->vertical_info ? &face->vertical : NULL; break; - case ft_sfnt_os2: - table = face->os2.version == 0xFFFFU ? 0 : &face->os2; + case FT_SFNT_OS2: + table = face->os2.version == 0xFFFFU ? NULL : &face->os2; break; - case ft_sfnt_post: + case FT_SFNT_POST: table = &face->postscript; break; - case ft_sfnt_maxp: + case FT_SFNT_MAXP: table = &face->max_profile; break; - case ft_sfnt_pclt: - table = face->pclt.Version ? &face->pclt : 0; + case FT_SFNT_PCLT: + table = face->pclt.Version ? &face->pclt : NULL; break; default: - table = 0; + table = NULL; } return table; @@ -427,7 +427,7 @@ sfnt_get_interface( FT_Module module, const char* module_interface ) { - /* SFNT_SERVICES_GET derefers `library' in PIC mode */ + /* SFNT_SERVICES_GET dereferences `library' in PIC mode */ #ifdef FT_CONFIG_OPTION_PIC FT_Library library; diff --git a/freetype/src/sfnt/sfntpic.h b/freetype/src/sfnt/sfntpic.h index 35d0f449f..b09a9141e 100644 --- a/freetype/src/sfnt/sfntpic.h +++ b/freetype/src/sfnt/sfntpic.h @@ -72,26 +72,26 @@ FT_BEGIN_HEADER } sfntModulePIC; -#define GET_PIC( lib ) \ - ( (sfntModulePIC*)((lib)->pic_container.sfnt) ) +#define GET_PIC( lib ) \ + ( (sfntModulePIC*)( (lib)->pic_container.sfnt ) ) -#define SFNT_SERVICES_GET \ +#define SFNT_SERVICES_GET \ ( GET_PIC( library )->sfnt_services ) -#define SFNT_SERVICE_GLYPH_DICT_GET \ +#define SFNT_SERVICE_GLYPH_DICT_GET \ ( GET_PIC( library )->sfnt_service_glyph_dict ) -#define SFNT_SERVICE_PS_NAME_GET \ +#define SFNT_SERVICE_PS_NAME_GET \ ( GET_PIC( library )->sfnt_service_ps_name ) -#define TT_SERVICE_CMAP_INFO_GET \ +#define TT_SERVICE_CMAP_INFO_GET \ ( GET_PIC( library )->tt_service_get_cmap_info ) -#define SFNT_SERVICES_GET \ +#define SFNT_SERVICES_GET \ ( GET_PIC( library )->sfnt_services ) -#define TT_CMAP_CLASSES_GET \ +#define TT_CMAP_CLASSES_GET \ ( GET_PIC( library )->tt_cmap_classes ) -#define SFNT_SERVICE_SFNT_TABLE_GET \ +#define SFNT_SERVICE_SFNT_TABLE_GET \ ( GET_PIC( library )->sfnt_service_sfnt_table ) -#define SFNT_SERVICE_BDF_GET \ +#define SFNT_SERVICE_BDF_GET \ ( GET_PIC( library )->sfnt_service_bdf ) -#define SFNT_INTERFACE_GET \ +#define SFNT_INTERFACE_GET \ ( GET_PIC( library )->sfnt_interface ) diff --git a/freetype/src/sfnt/sfobjs.c b/freetype/src/sfnt/sfobjs.c index a31c77cbe..70b988d65 100644 --- a/freetype/src/sfnt/sfobjs.c +++ b/freetype/src/sfnt/sfobjs.c @@ -4,7 +4,7 @@ /* */ /* SFNT object management (base). */ /* */ -/* Copyright 1996-2008, 2010-2013 by */ +/* Copyright 1996-2008, 2010-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -348,29 +348,22 @@ } -#define WRITE_BYTE( p, v ) \ - do \ - { \ - *(p)++ = (v) >> 0; \ - \ +#define WRITE_USHORT( p, v ) \ + do \ + { \ + *(p)++ = (FT_Byte)( (v) >> 8 ); \ + *(p)++ = (FT_Byte)( (v) >> 0 ); \ + \ } while ( 0 ) -#define WRITE_USHORT( p, v ) \ - do \ - { \ - *(p)++ = (v) >> 8; \ - *(p)++ = (v) >> 0; \ - \ - } while ( 0 ) - -#define WRITE_ULONG( p, v ) \ - do \ - { \ - *(p)++ = (v) >> 24; \ - *(p)++ = (v) >> 16; \ - *(p)++ = (v) >> 8; \ - *(p)++ = (v) >> 0; \ - \ +#define WRITE_ULONG( p, v ) \ + do \ + { \ + *(p)++ = (FT_Byte)( (v) >> 24 ); \ + *(p)++ = (FT_Byte)( (v) >> 16 ); \ + *(p)++ = (FT_Byte)( (v) >> 8 ); \ + *(p)++ = (FT_Byte)( (v) >> 0 ); \ + \ } while ( 0 ) @@ -574,8 +567,10 @@ if ( table->Offset != woff_offset || - table->Offset + table->CompLength > woff.length || - sfnt_offset + table->OrigLength > woff.totalSfntSize || + table->CompLength > woff.length || + table->Offset > woff.length - table->CompLength || + table->OrigLength > woff.totalSfntSize || + sfnt_offset > woff.totalSfntSize - table->OrigLength || table->CompLength > table->OrigLength ) { error = FT_THROW( Invalid_Table ); @@ -661,6 +656,8 @@ } else { +#ifdef FT_CONFIG_OPTION_USE_ZLIB + /* Uncompress with zlib. */ FT_ULong output_len = table->OrigLength; @@ -675,6 +672,13 @@ error = FT_THROW( Invalid_Table ); goto Exit; } + +#else /* !FT_CONFIG_OPTION_USE_ZLIB */ + + error = FT_THROW( Unimplemented_Feature ); + goto Exit; + +#endif /* !FT_CONFIG_OPTION_USE_ZLIB */ } FT_FRAME_EXIT(); @@ -717,7 +721,6 @@ } -#undef WRITE_BYTE #undef WRITE_USHORT #undef WRITE_ULONG @@ -1015,7 +1018,6 @@ if ( is_apple_sbix ) has_outline = FALSE; - /* if this font doesn't contain outlines, we try to load */ /* a `bhed' table */ if ( !has_outline && sfnt->load_bhed ) diff --git a/freetype/src/sfnt/ttcmap.c b/freetype/src/sfnt/ttcmap.c index c717f5ffc..f54de7069 100644 --- a/freetype/src/sfnt/ttcmap.c +++ b/freetype/src/sfnt/ttcmap.c @@ -845,9 +845,6 @@ p = table + 2; /* skip format */ length = TT_NEXT_USHORT( p ); - if ( length < 16 ) - FT_INVALID_TOO_SHORT; - /* in certain fonts, the `length' field is invalid and goes */ /* out of bound. We try to correct this here... */ if ( table + length > valid->limit ) @@ -858,6 +855,9 @@ length = (FT_UInt)( valid->limit - table ); } + if ( length < 16 ) + FT_INVALID_TOO_SHORT; + p = table + 6; num_segs = TT_NEXT_USHORT( p ); /* read segCountX2 */ @@ -1669,7 +1669,8 @@ p = is32 + 8192; /* skip `is32' array */ num_groups = TT_NEXT_ULONG( p ); - if ( p + num_groups * 12 > valid->limit ) + /* p + num_groups * 12 > valid->limit ? */ + if ( num_groups > (FT_UInt32)( valid->limit - p ) / 12 ) FT_INVALID_TOO_SHORT; /* check groups, they must be in increasing order */ @@ -1694,7 +1695,12 @@ if ( valid->level >= FT_VALIDATE_TIGHT ) { - if ( start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) ) + FT_UInt32 d = end - start; + + + /* start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) ? */ + if ( d > TT_VALID_GLYPH_COUNT( valid ) || + start_id >= TT_VALID_GLYPH_COUNT( valid ) - d ) FT_INVALID_GLYPH_ID; count = (FT_UInt32)( end - start + 1 ); @@ -1892,7 +1898,9 @@ count = TT_NEXT_ULONG( p ); if ( length > (FT_ULong)( valid->limit - table ) || - length < 20 + count * 2 ) + /* length < 20 + count * 2 ? */ + length < 20 || + ( length - 20 ) / 2 < count ) FT_INVALID_TOO_SHORT; /* check glyph indices */ @@ -2079,7 +2087,9 @@ num_groups = TT_NEXT_ULONG( p ); if ( length > (FT_ULong)( valid->limit - table ) || - length < 16 + 12 * num_groups ) + /* length < 16 + 12 * num_groups ? */ + length < 16 || + ( length - 16 ) / 12 < num_groups ) FT_INVALID_TOO_SHORT; /* check groups, they must be in increasing order */ @@ -2101,7 +2111,12 @@ if ( valid->level >= FT_VALIDATE_TIGHT ) { - if ( start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) ) + FT_UInt32 d = end - start; + + + /* start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) ? */ + if ( d > TT_VALID_GLYPH_COUNT( valid ) || + start_id >= TT_VALID_GLYPH_COUNT( valid ) - d ) FT_INVALID_GLYPH_ID; } @@ -2401,7 +2416,9 @@ num_groups = TT_NEXT_ULONG( p ); if ( length > (FT_ULong)( valid->limit - table ) || - length < 16 + 12 * num_groups ) + /* length < 16 + 12 * num_groups ? */ + length < 16 || + ( length - 16 ) / 12 < num_groups ) FT_INVALID_TOO_SHORT; /* check groups, they must be in increasing order */ @@ -2787,7 +2804,9 @@ num_selectors = TT_NEXT_ULONG( p ); if ( length > (FT_ULong)( valid->limit - table ) || - length < 10 + 11 * num_selectors ) + /* length < 10 + 11 * num_selectors ? */ + length < 10 || + ( length - 10 ) / 11 < num_selectors ) FT_INVALID_TOO_SHORT; /* check selectors, they must be in increasing order */ @@ -2823,7 +2842,8 @@ FT_ULong lastBase = 0; - if ( defp + numRanges * 4 > valid->limit ) + /* defp + numRanges * 4 > valid->limit ? */ + if ( numRanges > (FT_ULong)( valid->limit - defp ) / 4 ) FT_INVALID_TOO_SHORT; for ( i = 0; i < numRanges; ++i ) @@ -2850,7 +2870,8 @@ FT_ULong i, lastUni = 0; - if ( numMappings * 4 > (FT_ULong)( valid->limit - ndp ) ) + /* numMappings * 4 > (FT_ULong)( valid->limit - ndp ) ? */ + if ( numMappings > ( (FT_ULong)( valid->limit - ndp ) ) / 4 ) FT_INVALID_TOO_SHORT; for ( i = 0; i < numMappings; ++i ) @@ -3473,23 +3494,14 @@ /* only recognize format 0 */ if ( TT_NEXT_USHORT( p ) != 0 ) { - p -= 2; FT_ERROR(( "tt_face_build_cmaps:" " unsupported `cmap' table format = %d\n", - TT_PEEK_USHORT( p ) )); + TT_PEEK_USHORT( p - 2 ) )); return FT_THROW( Invalid_Table ); } num_cmaps = TT_NEXT_USHORT( p ); -#ifdef FT_MAX_CHARMAP_CACHEABLE - if ( num_cmaps > FT_MAX_CHARMAP_CACHEABLE ) - FT_ERROR(( "tt_face_build_cmaps: too many cmap subtables (%d)\n" - " subtable #%d and higher are loaded" - " but cannot be searched\n", - num_cmaps, FT_MAX_CHARMAP_CACHEABLE + 1 )); -#endif - for ( ; num_cmaps > 0 && p + 8 <= limit; num_cmaps-- ) { FT_CharMapRec charmap; diff --git a/freetype/src/sfnt/ttkern.c b/freetype/src/sfnt/ttkern.c index 32c4008b2..455e7b5e3 100644 --- a/freetype/src/sfnt/ttkern.c +++ b/freetype/src/sfnt/ttkern.c @@ -99,7 +99,7 @@ length = FT_NEXT_USHORT( p ); coverage = FT_NEXT_USHORT( p ); - if ( length <= 6 ) + if ( length <= 6 + 8 ) break; p_next += length; diff --git a/freetype/src/sfnt/ttload.c b/freetype/src/sfnt/ttload.c index 0a3cd29db..8338150ab 100644 --- a/freetype/src/sfnt/ttload.c +++ b/freetype/src/sfnt/ttload.c @@ -5,7 +5,7 @@ /* Load the basic TrueType tables, i.e., tables that can be either in */ /* TTF or OTF fonts (body). */ /* */ -/* Copyright 1996-2010, 2012, 2013 by */ +/* Copyright 1996-2010, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -207,7 +207,10 @@ } /* we ignore invalid tables */ - if ( table.Offset + table.Length > stream->size ) + + /* table.Offset + table.Length > stream->size ? */ + if ( table.Length > stream->size || + table.Offset > stream->size - table.Length ) { FT_TRACE2(( "check_table_dir: table entry %d invalid\n", nn )); continue; @@ -395,7 +398,10 @@ entry->Length = FT_GET_ULONG(); /* ignore invalid tables */ - if ( entry->Offset + entry->Length > stream->size ) + + /* entry->Offset + entry->Length > stream->size ? */ + if ( entry->Length > stream->size || + entry->Offset > stream->size - entry->Length ) continue; else { diff --git a/freetype/src/sfnt/ttmtx.c b/freetype/src/sfnt/ttmtx.c index a8cc63a11..bb319577e 100644 --- a/freetype/src/sfnt/ttmtx.c +++ b/freetype/src/sfnt/ttmtx.c @@ -4,7 +4,7 @@ /* */ /* Load the metrics tables common to TTF and OTF fonts (body). */ /* */ -/* Copyright 2006-2009, 2011-2013 by */ +/* Copyright 2006-2009, 2011-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -201,7 +201,7 @@ /* aadvance :: The advance width or advance height, depending on */ /* the `vertical' flag. */ /* */ - FT_LOCAL_DEF( FT_Error ) + FT_LOCAL_DEF( void ) tt_face_get_metrics( TT_Face face, FT_Bool vertical, FT_UInt gindex, @@ -274,8 +274,6 @@ *abearing = 0; *aadvance = 0; } - - return FT_Err_Ok; } diff --git a/freetype/src/sfnt/ttmtx.h b/freetype/src/sfnt/ttmtx.h index 8b91a113d..fb040394c 100644 --- a/freetype/src/sfnt/ttmtx.h +++ b/freetype/src/sfnt/ttmtx.h @@ -4,7 +4,7 @@ /* */ /* Load the metrics tables common to TTF and OTF fonts (specification). */ /* */ -/* Copyright 2006 by */ +/* Copyright 2006, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -40,7 +40,7 @@ FT_BEGIN_HEADER FT_Bool vertical ); - FT_LOCAL( FT_Error ) + FT_LOCAL( void ) tt_face_get_metrics( TT_Face face, FT_Bool vertical, FT_UInt gindex, diff --git a/freetype/src/sfnt/ttpost.c b/freetype/src/sfnt/ttpost.c index 47a85c0c9..99d800549 100644 --- a/freetype/src/sfnt/ttpost.c +++ b/freetype/src/sfnt/ttpost.c @@ -5,7 +5,7 @@ /* Postcript name table processing for TrueType and OpenType fonts */ /* (body). */ /* */ -/* Copyright 1996-2003, 2006-2010, 2013 by */ +/* Copyright 1996-2003, 2006-2010, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -64,12 +64,12 @@ #define MAC_NAME( x ) ( (FT_String*)tt_post_default_names[x] ) - /* the 258 default Mac PS glyph names */ + /* the 258 default Mac PS glyph names; see file `tools/glnames.py' */ static const FT_String* const tt_post_default_names[258] = { /* 0 */ - ".notdef", ".null", "CR", "space", "exclam", + ".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", /* 10 */ "quotesingle", "parenleft", "parenright", "asterisk", "plus", @@ -120,7 +120,7 @@ "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", /* 170 */ - "guillemotright", "ellipsis", "nbspace", "Agrave", "Atilde", + "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", /* 180 */ "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", @@ -144,8 +144,8 @@ "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", "onequarter", "threequarters", "franc", "Gbreve", "gbreve", /* 250 */ - "Idot", "Scedilla", "scedilla", "Cacute", "cacute", - "Ccaron", "ccaron", "dmacron", + "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", + "Ccaron", "ccaron", "dcroat", }; diff --git a/freetype/src/sfnt/ttsbit.c b/freetype/src/sfnt/ttsbit.c index 8ff7b9d6a..c2db96c6d 100644 --- a/freetype/src/sfnt/ttsbit.c +++ b/freetype/src/sfnt/ttsbit.c @@ -150,12 +150,25 @@ error = FT_THROW( Unknown_File_Format ); goto Exit; } - if ( flags != 0x0001 || num_strikes >= 0x10000UL ) + + /* Bit 0 must always be `1'. */ + /* Bit 1 controls the overlay of bitmaps with outlines. */ + /* All other bits should be zero. */ + if ( !( flags == 1 || flags == 3 ) || + num_strikes >= 0x10000UL ) { error = FT_THROW( Invalid_File_Format ); goto Exit; } + /* we currently don't support bit 1; however, it is better to */ + /* draw at least something... */ + if ( flags == 3 ) + FT_TRACE1(( "tt_face_load_sbit_strikes:" + " sbix overlay not supported yet\n" + " " + " expect bad rendering results\n" )); + /* * Count the number of strikes available in the table. We are a bit * paranoid there and don't trust the data. @@ -256,7 +269,8 @@ case TT_SBIT_TABLE_TYPE_SBIX: { FT_Stream stream = face->root.stream; - FT_UInt offset, ppem, resolution, upem; + FT_UInt offset, upem; + FT_UShort ppem, resolution; TT_HoriHeader *hori; FT_ULong table_size; @@ -380,9 +394,11 @@ p += 34; decoder->bit_depth = *p; - if ( decoder->strike_index_array > face->sbit_table_size || - decoder->strike_index_array + 8 * decoder->strike_index_count > - face->sbit_table_size ) + /* decoder->strike_index_array + */ + /* 8 * decoder->strike_index_count > face->sbit_table_size ? */ + if ( decoder->strike_index_array > face->sbit_table_size || + decoder->strike_index_count > + ( face->sbit_table_size - decoder->strike_index_array ) / 8 ) error = FT_THROW( Invalid_File_Format ); } @@ -504,13 +520,20 @@ p += 3; } + else + { + /* avoid uninitialized data in case there is no vertical info -- */ + metrics->vertBearingX = 0; + metrics->vertBearingY = 0; + metrics->vertAdvance = 0; + } decoder->metrics_loaded = 1; *pp = p; return FT_Err_Ok; Fail: - FT_TRACE1(( "tt_sbit_decoder_load_metrics: broken table" )); + FT_TRACE1(( "tt_sbit_decoder_load_metrics: broken table\n" )); return FT_THROW( Invalid_Argument ); } @@ -800,12 +823,12 @@ FT_Error error = FT_Err_Ok; FT_UInt num_components, nn; - FT_Char horiBearingX = decoder->metrics->horiBearingX; - FT_Char horiBearingY = decoder->metrics->horiBearingY; - FT_Byte horiAdvance = decoder->metrics->horiAdvance; - FT_Char vertBearingX = decoder->metrics->vertBearingX; - FT_Char vertBearingY = decoder->metrics->vertBearingY; - FT_Byte vertAdvance = decoder->metrics->vertAdvance; + FT_Char horiBearingX = (FT_Char)decoder->metrics->horiBearingX; + FT_Char horiBearingY = (FT_Char)decoder->metrics->horiBearingY; + FT_Byte horiAdvance = (FT_Byte)decoder->metrics->horiAdvance; + FT_Char vertBearingX = (FT_Char)decoder->metrics->vertBearingX; + FT_Char vertBearingY = (FT_Char)decoder->metrics->vertBearingY; + FT_Byte vertAdvance = (FT_Byte)decoder->metrics->vertAdvance; if ( p + 2 > limit ) @@ -1147,7 +1170,8 @@ num_glyphs = FT_NEXT_ULONG( p ); /* overflow check for p + ( num_glyphs + 1 ) * 4 */ - if ( num_glyphs > (FT_ULong)( ( ( p_limit - p ) >> 2 ) - 1 ) ) + if ( p + 4 > p_limit || + num_glyphs > (FT_ULong)( ( ( p_limit - p ) >> 2 ) - 1 ) ) goto NoBitmap; for ( mm = 0; mm < num_glyphs; mm++ ) @@ -1334,6 +1358,7 @@ case FT_MAKE_TAG( 'j', 'p', 'g', ' ' ): case FT_MAKE_TAG( 't', 'i', 'f', 'f' ): + case FT_MAKE_TAG( 'r', 'g', 'b', 'l' ): /* used on iOS 7.1 */ error = FT_THROW( Unknown_File_Format ); break; @@ -1352,10 +1377,11 @@ tt_face_get_metrics( face, FALSE, glyph_index, &abearing, &aadvance ); - metrics->horiBearingX = originOffsetX; - metrics->horiBearingY = -originOffsetY + metrics->height; - metrics->horiAdvance = aadvance * face->root.size->metrics.x_ppem / - face->header.Units_Per_EM; + metrics->horiBearingX = (FT_Short)originOffsetX; + metrics->horiBearingY = (FT_Short)( -originOffsetY + metrics->height ); + metrics->horiAdvance = (FT_Short)( aadvance * + face->root.size->metrics.x_ppem / + face->header.Units_Per_EM ); } return error; diff --git a/freetype/src/smooth/ftgrays.c b/freetype/src/smooth/ftgrays.c index 425911a96..131ad27a0 100644 --- a/freetype/src/smooth/ftgrays.c +++ b/freetype/src/smooth/ftgrays.c @@ -98,6 +98,9 @@ #define FT_ERR_XCAT( x, y ) x ## y #define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y ) +#define FT_BEGIN_STMNT do { +#define FT_END_STMNT } while ( 0 ) + /* define this to dump debugging information */ /* #define FT_DEBUG_LEVEL_TRACE */ @@ -402,6 +405,8 @@ typedef ptrdiff_t FT_PtrDist; typedef struct gray_TWorker_ { + ft_jmp_buf jump_buffer; + TCoord ex, ey; TPos min_ex, max_ex; TPos min_ey, max_ey; @@ -437,8 +442,6 @@ typedef ptrdiff_t FT_PtrDist; int band_size; int band_shoot; - ft_jmp_buf jump_buffer; - void* buffer; long buffer_size; @@ -1088,37 +1091,10 @@ typedef ptrdiff_t FT_PtrDist; /* dx and dy are x and y components of the P0-P3 chord vector. */ - dx = arc[3].x - arc[0].x; - dy = arc[3].y - arc[0].y; - - /* L is an (under)estimate of the Euclidean distance P0-P3. */ - /* */ - /* If dx >= dy, then r = sqrt(dx^2 + dy^2) can be overestimated */ - /* with least maximum error by */ - /* */ - /* r_upperbound = dx + (sqrt(2) - 1) * dy , */ - /* */ - /* where sqrt(2) - 1 can be (over)estimated by 107/256, giving an */ - /* error of no more than 8.4%. */ - /* */ - /* Similarly, some elementary calculus shows that r can be */ - /* underestimated with least maximum error by */ - /* */ - /* r_lowerbound = sqrt(2 + sqrt(2)) / 2 * dx */ - /* + sqrt(2 - sqrt(2)) / 2 * dy . */ - /* */ - /* 236/256 and 97/256 are (under)estimates of the two algebraic */ - /* numbers, giving an error of no more than 8.1%. */ - - dx_ = FT_ABS( dx ); - dy_ = FT_ABS( dy ); - - /* This is the same as */ - /* */ - /* L = ( 236 * FT_MAX( dx_, dy_ ) */ - /* + 97 * FT_MIN( dx_, dy_ ) ) >> 8; */ - L = ( dx_ > dy_ ? 236 * dx_ + 97 * dy_ - : 97 * dx_ + 236 * dy_ ) >> 8; + dx = dx_ = arc[3].x - arc[0].x; + dy = dy_ = arc[3].y - arc[0].y; + + L = FT_HYPOT( dx_, dy_ ); /* Avoid possible arithmetic overflow below by splitting. */ if ( L > 32767 ) @@ -1539,7 +1515,10 @@ typedef ptrdiff_t FT_PtrDist; TPos delta; - if ( !outline || !func_interface ) + if ( !outline ) + return FT_THROW( Invalid_Outline ); + + if ( !func_interface ) return FT_THROW( Invalid_Argument ); shift = func_interface->shift; @@ -2121,12 +2100,26 @@ typedef ptrdiff_t FT_PtrDist; } + static int + gray_raster_set_mode( FT_Raster raster, + unsigned long mode, + void* args ) + { + FT_UNUSED( raster ); + FT_UNUSED( mode ); + FT_UNUSED( args ); + + + return 0; /* nothing to do */ + } + + FT_DEFINE_RASTER_FUNCS(ft_grays_raster, FT_GLYPH_FORMAT_OUTLINE, (FT_Raster_New_Func) gray_raster_new, (FT_Raster_Reset_Func) gray_raster_reset, - (FT_Raster_Set_Mode_Func)0, + (FT_Raster_Set_Mode_Func)gray_raster_set_mode, (FT_Raster_Render_Func) gray_raster_render, (FT_Raster_Done_Func) gray_raster_done ) diff --git a/freetype/src/smooth/ftsmooth.c b/freetype/src/smooth/ftsmooth.c index 89088cd09..4e2dee562 100644 --- a/freetype/src/smooth/ftsmooth.c +++ b/freetype/src/smooth/ftsmooth.c @@ -103,25 +103,24 @@ FT_Render_Mode required_mode ) { FT_Error error; - FT_Outline* outline = NULL; + FT_Outline* outline = &slot->outline; + FT_Bitmap* bitmap = &slot->bitmap; + FT_Memory memory = render->root.memory; FT_BBox cbox; + FT_Pos x_shift = 0; + FT_Pos y_shift = 0; + FT_Pos x_left, y_top; FT_Pos width, height, pitch; #ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING FT_Pos height_org, width_org; #endif - FT_Bitmap* bitmap = &slot->bitmap; - FT_Memory memory = render->root.memory; FT_Int hmul = mode == FT_RENDER_MODE_LCD; FT_Int vmul = mode == FT_RENDER_MODE_LCD_V; - FT_Pos x_shift = 0; - FT_Pos y_shift = 0; - FT_Pos x_left, y_top; FT_Raster_Params params; - FT_Bool have_translated_origin = FALSE; - FT_Bool have_outline_shifted = FALSE; - FT_Bool have_buffer = FALSE; + FT_Bool have_outline_shifted = FALSE; + FT_Bool have_buffer = FALSE; /* check glyph image format */ @@ -138,73 +137,45 @@ goto Exit; } - outline = &slot->outline; - - /* translate the outline to the new origin if needed */ if ( origin ) { - FT_Outline_Translate( outline, origin->x, origin->y ); - have_translated_origin = TRUE; + x_shift = origin->x; + y_shift = origin->y; } /* compute the control box, and grid fit it */ + /* taking into account the origin shift */ FT_Outline_Get_CBox( outline, &cbox ); - cbox.xMin = FT_PIX_FLOOR( cbox.xMin ); - cbox.yMin = FT_PIX_FLOOR( cbox.yMin ); - cbox.xMax = FT_PIX_CEIL( cbox.xMax ); - cbox.yMax = FT_PIX_CEIL( cbox.yMax ); + cbox.xMin = FT_PIX_FLOOR( cbox.xMin + x_shift ); + cbox.yMin = FT_PIX_FLOOR( cbox.yMin + y_shift ); + cbox.xMax = FT_PIX_CEIL( cbox.xMax + x_shift ); + cbox.yMax = FT_PIX_CEIL( cbox.yMax + y_shift ); - if ( cbox.xMin < 0 && cbox.xMax > FT_INT_MAX + cbox.xMin ) - { - FT_ERROR(( "ft_smooth_render_generic: glyph too large:" - " xMin = %d, xMax = %d\n", - cbox.xMin >> 6, cbox.xMax >> 6 )); - error = FT_THROW( Raster_Overflow ); - goto Exit; - } - else - width = ( cbox.xMax - cbox.xMin ) >> 6; + x_shift -= cbox.xMin; + y_shift -= cbox.yMin; - if ( cbox.yMin < 0 && cbox.yMax > FT_INT_MAX + cbox.yMin ) - { - FT_ERROR(( "ft_smooth_render_generic: glyph too large:" - " yMin = %d, yMax = %d\n", - cbox.yMin >> 6, cbox.yMax >> 6 )); - error = FT_THROW( Raster_Overflow ); - goto Exit; - } - else - height = ( cbox.yMax - cbox.yMin ) >> 6; + x_left = cbox.xMin >> 6; + y_top = cbox.yMax >> 6; + + width = (FT_ULong)( cbox.xMax - cbox.xMin ) >> 6; + height = (FT_ULong)( cbox.yMax - cbox.yMin ) >> 6; #ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING width_org = width; height_org = height; #endif - /* release old bitmap buffer */ - if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) - { - FT_FREE( bitmap->buffer ); - slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP; - } - - /* allocate new one */ pitch = width; if ( hmul ) { - width = width * 3; - pitch = FT_PAD_CEIL( width, 4 ); + width *= 3; + pitch = FT_PAD_CEIL( width, 4 ); } if ( vmul ) height *= 3; - x_shift = (FT_Int) cbox.xMin; - y_shift = (FT_Int) cbox.yMin; - x_left = (FT_Int)( cbox.xMin >> 6 ); - y_top = (FT_Int)( cbox.yMax >> 6 ); - #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING if ( slot->library->lcd_filter_func ) @@ -214,23 +185,32 @@ if ( hmul ) { - x_shift -= 64 * ( extra >> 1 ); + x_shift += 64 * ( extra >> 1 ); + x_left -= extra >> 1; width += 3 * extra; pitch = FT_PAD_CEIL( width, 4 ); - x_left -= extra >> 1; } if ( vmul ) { - y_shift -= 64 * ( extra >> 1 ); - height += 3 * extra; + y_shift += 64 * ( extra >> 1 ); y_top += extra >> 1; + height += 3 * extra; } } #endif -#if FT_UINT_MAX > 0xFFFFU + /* + * XXX: on 16bit system, we return an error for huge bitmap + * to prevent an overflow. + */ + if ( x_left > FT_INT_MAX || y_top > FT_INT_MAX || + x_left < FT_INT_MIN || y_top < FT_INT_MIN ) + { + error = FT_THROW( Invalid_Pixel_Size ); + goto Exit; + } /* Required check is (pitch * height < FT_ULONG_MAX), */ /* but we care realistic cases only. Always pitch <= width. */ @@ -242,7 +222,24 @@ goto Exit; } -#endif + /* release old bitmap buffer */ + if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) + { + FT_FREE( bitmap->buffer ); + slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP; + } + + /* allocate new one */ + if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) ) + goto Exit; + else + have_buffer = TRUE; + + slot->internal->flags |= FT_GLYPH_OWN_BITMAP; + + slot->format = FT_GLYPH_FORMAT_BITMAP; + slot->bitmap_left = (FT_Int)x_left; + slot->bitmap_top = (FT_Int)y_top; bitmap->pixel_mode = FT_PIXEL_MODE_GRAY; bitmap->num_grays = 256; @@ -251,15 +248,11 @@ bitmap->pitch = pitch; /* translate outline to render it into the bitmap */ - FT_Outline_Translate( outline, -x_shift, -y_shift ); - have_outline_shifted = TRUE; - - if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) ) - goto Exit; - else - have_buffer = TRUE; - - slot->internal->flags |= FT_GLYPH_OWN_BITMAP; + if ( x_shift || y_shift ) + { + FT_Outline_Translate( outline, x_shift, y_shift ); + have_outline_shifted = TRUE; + } /* set up parameters */ params.target = bitmap; @@ -366,20 +359,6 @@ #endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ - /* - * XXX: on 16bit system, we return an error for huge bitmap - * to prevent an overflow. - */ - if ( x_left > FT_INT_MAX || y_top > FT_INT_MAX ) - { - error = FT_THROW( Invalid_Pixel_Size ); - goto Exit; - } - - slot->format = FT_GLYPH_FORMAT_BITMAP; - slot->bitmap_left = (FT_Int)x_left; - slot->bitmap_top = (FT_Int)y_top; - /* everything is fine; don't deallocate buffer */ have_buffer = FALSE; @@ -387,9 +366,7 @@ Exit: if ( have_outline_shifted ) - FT_Outline_Translate( outline, x_shift, y_shift ); - if ( have_translated_origin ) - FT_Outline_Translate( outline, -origin->x, -origin->y ); + FT_Outline_Translate( outline, -x_shift, -y_shift ); if ( have_buffer ) { FT_FREE( bitmap->buffer ); diff --git a/freetype/src/tools/afblue.pl b/freetype/src/tools/afblue.pl index 58aa2a055..60fe6966a 100644 --- a/freetype/src/tools/afblue.pl +++ b/freetype/src/tools/afblue.pl @@ -63,8 +63,8 @@ my $enum_element_re = qr/ ^ \s* ( [A-Za-z0-9_]+ ) \s* $ /x; # '#' '\n' my $preprocessor_re = qr/ ^ \# /x; -# '/' '/' '\n' -my $comment_re = qr| ^ // |x; +# [] '/' '/' '\n' +my $comment_re = qr| ^ \s* // |x; # empty line my $whitespace_only_re = qr/ ^ \s* $ /x; @@ -159,6 +159,9 @@ sub convert_ascii_chars # A series of ASCII characters in the printable range. my $s = shift; + # We ignore spaces. + $s =~ s/ //g; + my $count = $s =~ s/\G(.)/'$1', /g; $curr_offset += $count; $curr_elem_size += $count; diff --git a/freetype/src/tools/docmaker/content.py b/freetype/src/tools/docmaker/content.py index 98025e67e..adea6f1d7 100644 --- a/freetype/src/tools/docmaker/content.py +++ b/freetype/src/tools/docmaker/content.py @@ -1,57 +1,81 @@ -# Content (c) 2002, 2004, 2006-2009, 2012, 2013 -# David Turner # -# This file contains routines used to parse the content of documentation -# comment blocks and build more structured objects out of them. +# content.py +# +# Parse comment blocks to build content blocks (library file). +# +# Copyright 2002, 2004, 2006-2009, 2012-2014 by +# David Turner. +# +# This file is part of the FreeType project, and may only be used, +# modified, and distributed under the terms of the FreeType project +# license, LICENSE.TXT. By continuing to use, modify, or distribute +# this file you indicate that you have read the license and +# understand and accept it fully. + +# +# This file contains routines to parse documentation comment blocks, +# building more structured objects out of them. # + from sources import * -from utils import * +from utils import * + import string, re -# this regular expression is used to detect code sequences. these -# are simply code fragments embedded in '{' and '}' like in: # -# { -# x = y + z; -# if ( zookoo == 2 ) -# { -# foobar(); -# } -# } +# Regular expressions to detect code sequences. `Code sequences' are simply +# code fragments embedded in '{' and '}', as demonstrated in the following +# example. +# +# { +# x = y + z; +# if ( zookoo == 2 ) +# { +# foobar(); +# } +# } # -# note that indentation of the starting and ending accolades must be -# exactly the same. the code sequence can contain accolades at greater -# indentation +# Note that the indentation of the first opening brace and the last closing +# brace must be exactly the same. The code sequence itself should have a +# larger indentation than the surrounding braces. # re_code_start = re.compile( r"(\s*){\s*$" ) re_code_end = re.compile( r"(\s*)}\s*$" ) -# this regular expression is used to isolate identifiers from -# other text # -re_identifier = re.compile( r'((?:\w|-)*)' ) - - -# we collect macros ending in `_H'; while outputting the object data, we use -# this info together with the object's file location to emit the appropriate -# header file macro and name before the object itself +# A regular expression to isolate identifiers from other text. # -re_header_macro = re.compile( r'^#define\s{1,}(\w{1,}_H)\s{1,}<(.*)>' ) +re_identifier = re.compile( r'((?:\w|-)*)' ) -############################################################################# # -# The DocCode class is used to store source code lines. +# We collect macro names ending in `_H' (group 1), as defined in +# `config/ftheader.h'. While outputting the object data, we use this info +# together with the object's file location (group 2) to emit the appropriate +# header file macro and its associated file name before the object itself. # -# 'self.lines' contains a set of source code lines that will be dumped as -# HTML in a
                   tag.
                  +# Example:
                   #
                  -#   The object is filled line by line by the parser; it strips the leading
                  -#   "margin" space from each input line before storing it in 'self.lines'.
                  +#   #define FT_FREETYPE_H 
                   #
                  +re_header_macro = re.compile( r'^#define\s{1,}(\w{1,}_H)\s{1,}<(.*)>' )
                  +
                  +
                  +################################################################
                  +##
                  +##  DOC CODE CLASS
                  +##
                  +##  The `DocCode' class is used to store source code lines.
                  +##
                  +##  `self.lines' contains a set of source code lines that will be dumped as
                  +##  HTML in a 
                   tag.
                  +##
                  +##  The object is filled line by line by the parser; it strips the leading
                  +##  `margin' space from each input line before storing it in `self.lines'.
                  +##
                   class  DocCode:
                   
                       def  __init__( self, margin, lines ):
                  @@ -77,12 +101,14 @@ class  DocCode:
                   
                   
                   
                  -#############################################################################
                  -#
                  -# The DocPara class is used to store "normal" text paragraph.
                  -#
                  -#   'self.words' contains the list of words that make up the paragraph
                  -#
                  +################################################################
                  +##
                  +##  DOC PARA CLASS
                  +##
                  +##  `Normal' text paragraphs are stored in the `DocPara' class.
                  +##
                  +##  `self.words' contains the list of words that make up the paragraph.
                  +##
                   class  DocPara:
                   
                       def  __init__( self, lines ):
                  @@ -123,17 +149,18 @@ class  DocPara:
                           return result
                   
                   
                  -
                  -#############################################################################
                  -#
                  -#  The DocField class is used to store a list containing either DocPara or
                  -#  DocCode objects. Each DocField also has an optional "name" which is used
                  -#  when the object corresponds to a field or value definition
                  -#
                  +################################################################
                  +##
                  +##  DOC FIELD CLASS
                  +##
                  +##  The `DocField' class stores a list containing either `DocPara' or
                  +##  `DocCode' objects.  Each DocField object also has an optional `name'
                  +##  that is used when the object corresponds to a field or value definition.
                  +##
                   class  DocField:
                   
                       def  __init__( self, name, lines ):
                  -        self.name  = name  # can be None for normal paragraphs/sources
                  +        self.name  = name  # can be `None' for normal paragraphs/sources
                           self.items = []    # list of items
                   
                           mode_none  = 0     # start parsing mode
                  @@ -143,14 +170,14 @@ class  DocField:
                           margin     = -1    # current code sequence indentation
                           cur_lines  = []
                   
                  -        # now analyze the markup lines to see if they contain paragraphs,
                  -        # code sequences or fields definitions
                  +        # analyze the markup lines to check whether they contain paragraphs,
                  +        # code sequences, or fields definitions
                           #
                           start = 0
                           mode  = mode_none
                   
                           for l in lines:
                  -            # are we parsing a code sequence ?
                  +            # are we parsing a code sequence?
                               if mode == mode_code:
                                   m = re_code_end.match( l )
                                   if m and len( m.group( 1 ) ) <= margin:
                  @@ -161,10 +188,10 @@ class  DocField:
                                       cur_lines = []
                                       mode      = mode_none
                                   else:
                  -                    # nope, continue the code sequence
                  +                    # otherwise continue the code sequence
                                       cur_lines.append( l[margin:] )
                               else:
                  -                # start of code sequence ?
                  +                # start of code sequence?
                                   m = re_code_start.match( l )
                                   if m:
                                       # save current lines
                  @@ -222,13 +249,29 @@ class  DocField:
                           return result
                   
                   
                  -
                  -# this regular expression is used to detect field definitions
                   #
                  -re_field = re.compile( r"\s*(\w*|\w(\w|\.)*\w)\s*::" )
                  -
                  -
                  -
                  +# A regular expression to detect field definitions.
                  +#
                  +# Examples:
                  +#
                  +#   foo     ::
                  +#   foo.bar ::
                  +#
                  +re_field = re.compile( r"""
                  +                         \s*
                  +                           (
                  +                             \w*
                  +                           |
                  +                             \w (\w | \.)* \w
                  +                           )
                  +                         \s* ::
                  +                       """, re.VERBOSE )
                  +
                  +
                  +################################################################
                  +##
                  +##  DOC MARKUP CLASS
                  +##
                   class  DocMarkup:
                   
                       def  __init__( self, tag, lines ):
                  @@ -242,7 +285,7 @@ class  DocMarkup:
                           for l in lines:
                               m = re_field.match( l )
                               if m:
                  -                # we detected the start of a new field definition
                  +                # We detected the start of a new field definition.
                   
                                   # first, save the current one
                                   if cur_lines:
                  @@ -275,7 +318,10 @@ class  DocMarkup:
                           print " " * margin + ""
                   
                   
                  -
                  +################################################################
                  +##
                  +##  DOC CHAPTER CLASS
                  +##
                   class  DocChapter:
                   
                       def  __init__( self, block ):
                  @@ -291,7 +337,10 @@ class  DocChapter:
                               self.order = []
                   
                   
                  -
                  +################################################################
                  +##
                  +##  DOC SECTION CLASS
                  +##
                   class  DocSection:
                   
                       def  __init__( self, name = "Other" ):
                  @@ -320,18 +369,21 @@ class  DocSection:
                                   self.title       = title
                                   self.abstract    = block.get_markup_words( "abstract" )
                                   self.description = block.get_markup_items( "description" )
                  -                self.order       = block.get_markup_words( "order" )
                  +                self.order       = block.get_markup_words_all( "order" )
                                   return
                   
                       def  reorder( self ):
                           self.block_names = sort_order_list( self.block_names, self.order )
                   
                   
                  -
                  +################################################################
                  +##
                  +##  CONTENT PROCESSOR CLASS
                  +##
                   class  ContentProcessor:
                   
                       def  __init__( self ):
                  -        """initialize a block content processor"""
                  +        """Initialize a block content processor."""
                           self.reset()
                   
                           self.sections = {}    # dictionary of documentation sections
                  @@ -342,8 +394,8 @@ class  ContentProcessor:
                           self.headers  = {}    # dictionary of header macros
                   
                       def  set_section( self, section_name ):
                  -        """set current section during parsing"""
                  -        if not self.sections.has_key( section_name ):
                  +        """Set current section during parsing."""
                  +        if not section_name in self.sections:
                               section = DocSection( section_name )
                               self.sections[section_name] = section
                               self.section                = section
                  @@ -354,15 +406,14 @@ class  ContentProcessor:
                           chapter = DocChapter( block )
                           self.chapters.append( chapter )
                   
                  -
                       def  reset( self ):
                  -        """reset the content processor for a new block"""
                  +        """Reset the content processor for a new block."""
                           self.markups      = []
                           self.markup       = None
                           self.markup_lines = []
                   
                       def  add_markup( self ):
                  -        """add a new markup section"""
                  +        """Add a new markup section."""
                           if self.markup and self.markup_lines:
                   
                               # get rid of last line of markup if it's empty
                  @@ -378,8 +429,8 @@ class  ContentProcessor:
                               self.markup_lines = []
                   
                       def  process_content( self, content ):
                  -        """process a block content and return a list of DocMarkup objects
                  -           corresponding to it"""
                  +        """Process a block content and return a list of DocMarkup objects
                  +           corresponding to it."""
                           markup       = None
                           markup_lines = []
                           first        = 1
                  @@ -437,7 +488,7 @@ class  ContentProcessor:
                           # listed there
                           for chap in self.chapters:
                               for sec in chap.order:
                  -                if self.sections.has_key( sec ):
                  +                if sec in self.sections:
                                       section = self.sections[sec]
                                       section.chapter = chap
                                       section.reorder()
                  @@ -452,6 +503,7 @@ class  ContentProcessor:
                           others = []
                           for sec in self.sections.values():
                               if not sec.chapter:
                  +                sec.reorder()
                                   others.append( sec )
                   
                           # create a new special chapter for all remaining sections
                  @@ -463,7 +515,10 @@ class  ContentProcessor:
                               self.chapters.append( chap )
                   
                   
                  -
                  +################################################################
                  +##
                  +##  DOC BLOCK CLASS
                  +##
                   class  DocBlock:
                   
                       def  __init__( self, source, follow, processor ):
                  @@ -540,7 +595,7 @@ class  DocBlock:
                           return self.source.location()
                   
                       def  get_markup( self, tag_name ):
                  -        """return the DocMarkup corresponding to a given tag in a block"""
                  +        """Return the DocMarkup corresponding to a given tag in a block."""
                           for m in self.markups:
                               if m.tag == string.lower( tag_name ):
                                   return m
                  @@ -553,6 +608,21 @@ class  DocBlock:
                           except:
                               return []
                   
                  +    def  get_markup_words_all( self, tag_name ):
                  +        try:
                  +            m = self.get_markup( tag_name )
                  +            words = []
                  +            for item in m.fields[0].items:
                  +                # We honour empty lines in an `' section element by
                  +                # adding the sentinel `/empty/'.  The formatter should then
                  +                # convert it to an appropriate representation in the
                  +                # `section_enter' function.
                  +                words += item.words
                  +                words.append( "/empty/" )
                  +            return words
                  +        except:
                  +            return []
                  +
                       def  get_markup_text( self, tag_name ):
                           result = self.get_markup_words( tag_name )
                           return string.join( result )
                  diff --git a/freetype/src/tools/docmaker/docmaker.py b/freetype/src/tools/docmaker/docmaker.py
                  index bf75c5d5f..4fb1abf23 100644
                  --- a/freetype/src/tools/docmaker/docmaker.py
                  +++ b/freetype/src/tools/docmaker/docmaker.py
                  @@ -1,16 +1,26 @@
                   #!/usr/bin/env python
                   #
                  -#  DocMaker (c) 2002, 2004, 2008, 2013 David Turner 
                  +#  docmaker.py
                   #
                  -# This program is a re-write of the original DocMaker tool used
                  -# to generate the API Reference of the FreeType font engine
                  -# by converting in-source comments into structured HTML.
                  +#    Convert source code markup to HTML documentation.
                   #
                  -# This new version is capable of outputting XML data, as well
                  -# as accepts more liberal formatting options.
                  +#  Copyright 2002, 2004, 2008, 2013, 2014 by
                  +#  David Turner.
                   #
                  -# It also uses regular expression matching and substitution
                  -# to speed things significantly.
                  +#  This file is part of the FreeType project, and may only be used,
                  +#  modified, and distributed under the terms of the FreeType project
                  +#  license, LICENSE.TXT.  By continuing to use, modify, or distribute
                  +#  this file you indicate that you have read the license and
                  +#  understand and accept it fully.
                  +
                  +#
                  +# This program is a re-write of the original DocMaker tool used to generate
                  +# the API Reference of the FreeType font rendering engine by converting
                  +# in-source comments into structured HTML.
                  +#
                  +# This new version is capable of outputting XML data as well as accepting
                  +# more liberal formatting options.  It also uses regular expression matching
                  +# and substitution to speed up operation significantly.
                   #
                   
                   from sources   import *
                  @@ -39,13 +49,13 @@ def  usage():
                   
                   
                   def  main( argv ):
                  -    """main program loop"""
                  +    """Main program loop."""
                   
                       global output_dir
                   
                       try:
                  -        opts, args = getopt.getopt( sys.argv[1:], \
                  -                                    "ht:o:p:",    \
                  +        opts, args = getopt.getopt( sys.argv[1:],
                  +                                    "ht:o:p:",
                                                       ["help", "title=", "output=", "prefix="] )
                       except getopt.GetoptError:
                           usage()
                  @@ -56,7 +66,6 @@ def  main( argv ):
                           sys.exit( 1 )
                   
                       # process options
                  -    #
                       project_title  = "Project"
                       project_prefix = None
                       output_dir     = None
                  @@ -90,7 +99,9 @@ def  main( argv ):
                       # process sections
                       content_processor.finish()
                   
                  -    formatter = HtmlFormatter( content_processor, project_title, project_prefix )
                  +    formatter = HtmlFormatter( content_processor,
                  +                               project_title,
                  +                               project_prefix )
                   
                       formatter.toc_dump()
                       formatter.index_dump()
                  @@ -98,9 +109,7 @@ def  main( argv ):
                   
                   
                   # if called from the command line
                  -#
                   if __name__ == '__main__':
                       main( sys.argv )
                   
                  -
                   # eof
                  diff --git a/freetype/src/tools/docmaker/formatter.py b/freetype/src/tools/docmaker/formatter.py
                  index f62ce676c..7152c019d 100644
                  --- a/freetype/src/tools/docmaker/formatter.py
                  +++ b/freetype/src/tools/docmaker/formatter.py
                  @@ -1,19 +1,37 @@
                  -#  Formatter (c) 2002, 2004, 2007, 2008 David Turner 
                   #
                  +#  formatter.py
                  +#
                  +#    Convert parsed content blocks to a structured document (library file).
                  +#
                  +#  Copyright 2002, 2004, 2007, 2008, 2014 by
                  +#  David Turner.
                  +#
                  +#  This file is part of the FreeType project, and may only be used,
                  +#  modified, and distributed under the terms of the FreeType project
                  +#  license, LICENSE.TXT.  By continuing to use, modify, or distribute
                  +#  this file you indicate that you have read the license and
                  +#  understand and accept it fully.
                  +
                  +#
                  +# This is the base Formatter class.  Its purpose is to convert a content
                  +# processor's data into specific documents (i.e., table of contents, global
                  +# index, and individual API reference indices).
                  +#
                  +# You need to sub-class it to output anything sensible.  For example, the
                  +# file `tohtml.py' contains the definition of the `HtmlFormatter' sub-class
                  +# to output HTML.
                  +#
                  +
                   
                   from sources import *
                   from content import *
                   from utils   import *
                   
                  -# This is the base Formatter class.  Its purpose is to convert
                  -# a content processor's data into specific documents (i.e., table of
                  -# contents, global index, and individual API reference indices).
                  -#
                  -# You need to sub-class it to output anything sensible.  For example,
                  -# the file tohtml.py contains the definition of the HtmlFormatter sub-class
                  -# used to output -- you guessed it -- HTML.
                  -#
                   
                  +################################################################
                  +##
                  +##  FORMATTER CLASS
                  +##
                   class  Formatter:
                   
                       def  __init__( self, processor ):
                  @@ -36,20 +54,22 @@ class  Formatter:
                                               self.add_identifier( field.name, block )
                   
                           self.block_index = self.identifiers.keys()
                  -        self.block_index.sort( index_sort )
                  +        self.block_index.sort( key = index_key )
                   
                       def  add_identifier( self, name, block ):
                  -        if self.identifiers.has_key( name ):
                  +        if name in self.identifiers:
                               # duplicate name!
                  -            sys.stderr.write(                                           \
                  -               "WARNING: duplicate definition for '" + name + "' in " + \
                  -               block.location() + ", previous definition in " +         \
                  -               self.identifiers[name].location() + "\n" )
                  +            sys.stderr.write( "WARNING: duplicate definition for"
                  +                              + " '" + name + "' "
                  +                              + "in " + block.location() + ", "
                  +                              + "previous definition in "
                  +                              + self.identifiers[name].location()
                  +                              + "\n" )
                           else:
                               self.identifiers[name] = block
                   
                       #
                  -    #  Formatting the table of contents
                  +    # formatting the table of contents
                       #
                       def  toc_enter( self ):
                           pass
                  @@ -97,7 +117,7 @@ class  Formatter:
                               close_output( output )
                   
                       #
                  -    #  Formatting the index
                  +    # formatting the index
                       #
                       def  index_enter( self ):
                           pass
                  @@ -128,7 +148,7 @@ class  Formatter:
                               close_output( output )
                   
                       #
                  -    #  Formatting a section
                  +    # formatting a section
                       #
                       def  section_enter( self, section ):
                           pass
                  @@ -162,7 +182,22 @@ class  Formatter:
                           self.section_enter( section )
                   
                           for name in section.block_names:
                  -            block = self.identifiers[name]
                  +            skip_entry = 0
                  +            try:
                  +                block = self.identifiers[name]
                  +                # `block_names' can contain field names also,
                  +                # which we filter out
                  +                for markup in block.markups:
                  +                    if markup.tag == 'values':
                  +                        for field in markup.fields:
                  +                            if field.name == name:
                  +                                skip_entry = 1
                  +            except:
                  +                skip_entry = 1   # this happens e.g. for `/empty/' entries
                  +
                  +            if skip_entry:
                  +              continue
                  +
                               self.block_enter( block )
                   
                               for markup in block.markups[1:]:   # always ignore first markup!
                  diff --git a/freetype/src/tools/docmaker/sources.py b/freetype/src/tools/docmaker/sources.py
                  index dab834978..61ecc22c4 100644
                  --- a/freetype/src/tools/docmaker/sources.py
                  +++ b/freetype/src/tools/docmaker/sources.py
                  @@ -1,62 +1,70 @@
                  -#  Sources (c) 2002-2004, 2006-2009, 2012, 2013
                  -#    David Turner 
                   #
                  +#  sources.py
                   #
                  -# this file contains definitions of classes needed to decompose
                  -# C sources files into a series of multi-line "blocks". There are
                  -# two kinds of blocks:
                  +#    Convert source code comments to multi-line blocks (library file).
                   #
                  -#   - normal blocks, which contain source code or ordinary comments
                  +#  Copyright 2002-2004, 2006-2009, 2012-2014 by
                  +#  David Turner.
                   #
                  -#   - documentation blocks, which have restricted formatting, and
                  -#     whose text always start with a documentation markup tag like
                  -#     "", "", etc..
                  +#  This file is part of the FreeType project, and may only be used,
                  +#  modified, and distributed under the terms of the FreeType project
                  +#  license, LICENSE.TXT.  By continuing to use, modify, or distribute
                  +#  this file you indicate that you have read the license and
                  +#  understand and accept it fully.
                  +
                  +#
                  +# This library file contains definitions of classes needed to decompose C
                  +# source code files into a series of multi-line `blocks'.  There are two
                  +# kinds of blocks.
                  +#
                  +#   - Normal blocks, which contain source code or ordinary comments.
                   #
                  -# the routines used to process the content of documentation blocks
                  -# are not contained here, but in "content.py"
                  +#   - Documentation blocks, which have restricted formatting, and whose text
                  +#     always start with a documentation markup tag like `',
                  +#     `', etc.
                   #
                  -# the classes and methods found here only deal with text parsing
                  -# and basic documentation block extraction
                  +# The routines to process the content of documentation blocks are contained
                  +# in file `content.py'; the classes and methods found here only deal with
                  +# text parsing and basic documentation block extraction.
                   #
                   
                  -import fileinput, re, sys, os, string
                   
                  +import fileinput, re, sys, os, string
                   
                   
                   ################################################################
                   ##
                  -##  BLOCK FORMAT PATTERN
                  +##  SOURCE BLOCK FORMAT CLASS
                  +##
                  +##  A simple class containing compiled regular expressions to detect
                  +##  potential documentation format block comments within C source code.
                   ##
                  -##   A simple class containing compiled regular expressions used
                  -##   to detect potential documentation format block comments within
                  -##   C source code
                  +##  The `column' pattern must contain a group to `unbox' the content of
                  +##  documentation comment blocks.
                   ##
                  -##   note that the 'column' pattern must contain a group that will
                  -##   be used to "unbox" the content of documentation comment blocks
                  +##  Later on, paragraphs are converted to long lines, which simplifies the
                  +##  regular expressions that act upon the text.
                   ##
                   class  SourceBlockFormat:
                   
                       def  __init__( self, id, start, column, end ):
                  -        """create a block pattern, used to recognize special documentation blocks"""
                  +        """Create a block pattern, used to recognize special documentation
                  +           blocks."""
                           self.id     = id
                           self.start  = re.compile( start, re.VERBOSE )
                           self.column = re.compile( column, re.VERBOSE )
                           self.end    = re.compile( end, re.VERBOSE )
                   
                   
                  -
                   #
                  -# format 1 documentation comment blocks look like the following:
                  +# Format 1 documentation comment blocks.
                   #
                  -#    /************************************/
                  +#    /************************************/ (at least 2 asterisks)
                   #    /*                                  */
                   #    /*                                  */
                   #    /*                                  */
                  -#    /************************************/
                  -#
                  -# we define a few regular expressions here to detect them
                  +#    /************************************/ (at least 2 asterisks)
                   #
                  -
                   start = r'''
                     \s*      # any number of whitespace
                     /\*{2,}/ # followed by '/' and at least two asterisks then '/'
                  @@ -75,16 +83,13 @@ re_source_block_format1 = SourceBlockFormat( 1, start, column, start )
                   
                   
                   #
                  -# format 2 documentation comment blocks look like the following:
                  +# Format 2 documentation comment blocks.
                   #
                   #    /************************************ (at least 2 asterisks)
                   #     *
                  +#     *                                    (1 asterisk)
                   #     *
                  -#     *
                  -#     *
                  -#     **/       (1 or more asterisks at the end)
                  -#
                  -# we define a few regular expressions here to detect them
                  +#     */                                   (1 or more asterisks)
                   #
                   start = r'''
                     \s*     # any number of whitespace
                  @@ -93,9 +98,9 @@ start = r'''
                   '''
                   
                   column = r'''
                  -  \s*        # any number of whitespace
                  -  \*{1}(?!/) # followed by precisely one asterisk not followed by `/'
                  -  (.*)       # then anything (group1)
                  +  \s*           # any number of whitespace
                  +  \*{1}(?![*/]) # followed by precisely one asterisk not followed by `/'
                  +  (.*)          # then anything (group1)
                   '''
                   
                   end = r'''
                  @@ -107,47 +112,56 @@ re_source_block_format2 = SourceBlockFormat( 2, start, column, end )
                   
                   
                   #
                  -# the list of supported documentation block formats, we could add new ones
                  -# relatively easily
                  +# The list of supported documentation block formats.  We could add new ones
                  +# quite easily.
                   #
                   re_source_block_formats = [re_source_block_format1, re_source_block_format2]
                   
                   
                   #
                  -# the following regular expressions corresponds to markup tags
                  -# within the documentation comment blocks. they're equivalent
                  -# despite their different syntax
                  +# The following regular expressions correspond to markup tags within the
                  +# documentation comment blocks.  They are equivalent despite their different
                  +# syntax.
                  +#
                  +# A markup tag consists of letters or character `-', to be found in group 1.
                   #
                  -# notice how each markup tag _must_ begin a new line
                  +# Notice that a markup tag _must_ begin a new paragraph.
                   #
                   re_markup_tag1 = re.compile( r'''\s*<((?:\w|-)*)>''' )  #  format
                   re_markup_tag2 = re.compile( r'''\s*@((?:\w|-)*):''' )  # @xxxx: format
                   
                   #
                  -# the list of supported markup tags, we could add new ones relatively
                  -# easily
                  +# The list of supported markup tags.  We could add new ones quite easily.
                   #
                   re_markup_tags = [re_markup_tag1, re_markup_tag2]
                   
                  +
                   #
                  -# used to detect a cross-reference, after markup tags have been stripped
                  +# A regular expression to detect a cross reference, after markup tags have
                  +# been stripped off.  Group 1 is the reference, group 2 the rest of the
                  +# line.
                  +#
                  +# A cross reference consists of letters, digits, or characters `-' and `_'.
                   #
                   re_crossref = re.compile( r'@((?:\w|-)*)(.*)' )    #  @foo
                   
                   #
                  -# used to detect italic and bold styles in paragraph text
                  +# Two regular expressions to detect italic and bold markup, respectively.
                  +# Group 1 is the markup, group 2 the rest of the line.
                  +#
                  +# Note that the markup is limited to words consisting of letters, digits,
                  +# the character `_', or an apostrophe (but not as the first character).
                   #
                  -re_italic = re.compile( r"_(\w(\w|')*)_(.*)" )     #  _italic_
                  -re_bold   = re.compile( r"\*(\w(\w|')*)\*(.*)" )   #  *bold*
                  +re_italic = re.compile( r"_(\w(?:\w|')*)_(.*)" )     #  _italic_
                  +re_bold   = re.compile( r"\*(\w(?:\w|')*)\*(.*)" )   #  *bold*
                   
                   #
                  -# this regular expression code to identify an URL has been taken from
                  +# This regular expression code to identify an URL has been taken from
                   #
                   #   http://mail.python.org/pipermail/tutor/2002-September/017228.html
                   #
                  -# (with slight modifications)
                  +# (with slight modifications).
                   #
                  -
                   urls = r'(?:https?|telnet|gopher|file|wais|ftp)'
                   ltrs = r'\w'
                   gunk = r'/#~:.?+=&%@!\-'
                  @@ -177,17 +191,22 @@ url  = r"""
                   re_url = re.compile( url, re.VERBOSE | re.MULTILINE )
                   
                   #
                  -# used to detect the end of commented source lines
                  +# A regular expression that stops collection of comments for the current
                  +# block.
                   #
                  -re_source_sep = re.compile( r'\s*/\*\s*\*/' )
                  +re_source_sep = re.compile( r'\s*/\*\s*\*/' )   #  /* */
                   
                   #
                  -# used to perform cross-reference within source output
                  +# A regular expression to find possible C identifiers while outputting
                  +# source code verbatim, covering things like `*foo' or `(bar'.  Group 1 is
                  +# the prefix, group 2 the identifier -- since we scan lines from left to
                  +# right, sequentially splitting the source code into prefix and identifier
                  +# is fully sufficient for our purposes.
                   #
                   re_source_crossref = re.compile( r'(\W*)(\w*)' )
                   
                   #
                  -# a list of reserved source keywords
                  +# A regular expression that matches a list of reserved C source keywords.
                   #
                   re_source_keywords = re.compile( '''\\b ( typedef   |
                                                             struct    |
                  @@ -215,24 +234,16 @@ re_source_keywords = re.compile( '''\\b ( typedef   |
                   ##
                   ##  SOURCE BLOCK CLASS
                   ##
                  -##   A SourceProcessor is in charge of reading a C source file
                  -##   and decomposing it into a series of different "SourceBlocks".
                  -##   each one of these blocks can be made of the following data:
                  -##
                  -##   - A documentation comment block that starts with "/**" and
                  -##     whose exact format will be discussed later
                  -##
                  -##   - normal sources lines, including comments
                  +##  There are two important fields in a `SourceBlock' object.
                   ##
                  -##   the important fields in a text block are the following ones:
                  +##    self.lines
                  +##      A list of text lines for the corresponding block.
                   ##
                  -##     self.lines   : a list of text lines for the corresponding block
                  -##
                  -##     self.content : for documentation comment blocks only, this is the
                  -##                    block content that has been "unboxed" from its
                  -##                    decoration. This is None for all other blocks
                  -##                    (i.e. sources or ordinary comments with no starting
                  -##                     markup tag)
                  +##    self.content
                  +##      For documentation comment blocks only, this is the block content
                  +##      that has been `unboxed' from its decoration.  This is `None' for all
                  +##      other blocks (i.e., sources or ordinary comments with no starting
                  +##      markup tag)
                   ##
                   class  SourceBlock:
                   
                  @@ -269,7 +280,7 @@ class  SourceBlock:
                       def  location( self ):
                           return "(" + self.filename + ":" + repr( self.lineno ) + ")"
                   
                  -    # debugging only - not used in normal operations
                  +    # debugging only -- not used in normal operations
                       def  dump( self ):
                           if self.content:
                               print "{{{content start---"
                  @@ -286,39 +297,38 @@ class  SourceBlock:
                               print line
                   
                   
                  -
                   ################################################################
                   ##
                   ##  SOURCE PROCESSOR CLASS
                   ##
                  -##   The SourceProcessor is in charge of reading a C source file
                  -##   and decomposing it into a series of different "SourceBlock"
                  -##   objects.
                  +##  The `SourceProcessor' is in charge of reading a C source file and
                  +##  decomposing it into a series of different `SourceBlock' objects.
                   ##
                  -##   each one of these blocks can be made of the following data:
                  +##  A SourceBlock object consists of the following data.
                   ##
                  -##   - A documentation comment block that starts with "/**" and
                  -##     whose exact format will be discussed later
                  +##    - A documentation comment block using one of the layouts above.  Its
                  +##      exact format will be discussed later.
                   ##
                  -##   - normal sources lines, include comments
                  +##    - Normal sources lines, including comments.
                   ##
                   ##
                   class  SourceProcessor:
                   
                       def  __init__( self ):
                  -        """initialize a source processor"""
                  +        """Initialize a source processor."""
                           self.blocks   = []
                           self.filename = None
                           self.format   = None
                           self.lines    = []
                   
                       def  reset( self ):
                  -        """reset a block processor, clean all its blocks"""
                  +        """Reset a block processor and clean up all its blocks."""
                           self.blocks = []
                           self.format = None
                   
                       def  parse_file( self, filename ):
                  -        """parse a C source file, and add its blocks to the processor's list"""
                  +        """Parse a C source file and add its blocks to the processor's
                  +           list."""
                           self.reset()
                   
                           self.filename = filename
                  @@ -337,16 +347,16 @@ class  SourceProcessor:
                                   self.process_normal_line( line )
                               else:
                                   if self.format.end.match( line ):
                  -                    # that's a normal block end, add it to 'lines' and
                  -                    # create a new block
                  +                    # A normal block end.  Add it to `lines' and create a
                  +                    # new block
                                       self.lines.append( line )
                                       self.add_block_lines()
                                   elif self.format.column.match( line ):
                  -                    # that's a normal column line, add it to 'lines'
                  +                    # A normal column line.  Add it to `lines'.
                                       self.lines.append( line )
                                   else:
                  -                    # humm.. this is an unexpected block end,
                  -                    # create a new block, but don't process the line
                  +                    # An unexpected block end.  Create a new block, but
                  +                    # don't process the line.
                                       self.add_block_lines()
                   
                                       # we need to process the line again
                  @@ -356,7 +366,8 @@ class  SourceProcessor:
                           self.add_block_lines()
                   
                       def  process_normal_line( self, line ):
                  -        """process a normal line and check whether it is the start of a new block"""
                  +        """Process a normal line and check whether it is the start of a new
                  +           block."""
                           for f in re_source_block_formats:
                               if f.start.match( line ):
                                   self.add_block_lines()
                  @@ -366,9 +377,12 @@ class  SourceProcessor:
                           self.lines.append( line )
                   
                       def  add_block_lines( self ):
                  -        """add the current accumulated lines and create a new block"""
                  +        """Add the current accumulated lines and create a new block."""
                           if self.lines != []:
                  -            block = SourceBlock( self, self.filename, self.lineno, self.lines )
                  +            block = SourceBlock( self,
                  +                                 self.filename,
                  +                                 self.lineno,
                  +                                 self.lines )
                   
                               self.blocks.append( block )
                               self.format = None
                  @@ -376,7 +390,7 @@ class  SourceProcessor:
                   
                       # debugging only, not used in normal operations
                       def  dump( self ):
                  -        """print all blocks in a processor"""
                  +        """Print all blocks in a processor."""
                           for b in self.blocks:
                               b.dump()
                   
                  diff --git a/freetype/src/tools/docmaker/tohtml.py b/freetype/src/tools/docmaker/tohtml.py
                  index 7944f1c99..05fc08a92 100644
                  --- a/freetype/src/tools/docmaker/tohtml.py
                  +++ b/freetype/src/tools/docmaker/tohtml.py
                  @@ -1,5 +1,19 @@
                  -#  ToHTML (c) 2002, 2003, 2005-2008, 2013
                  -#    David Turner 
                  +#
                  +#  tohtml.py
                  +#
                  +#    A sub-class container of the `Formatter' class to produce HTML.
                  +#
                  +#  Copyright 2002, 2003, 2005-2008, 2013, 2014 by
                  +#  David Turner.
                  +#
                  +#  This file is part of the FreeType project, and may only be used,
                  +#  modified, and distributed under the terms of the FreeType project
                  +#  license, LICENSE.TXT.  By continuing to use, modify, or distribute
                  +#  this file you indicate that you have read the license and
                  +#  understand and accept it fully.
                  +
                  +# The parent class is contained in file `formatter.py'.
                  +
                   
                   from sources import *
                   from content import *
                  @@ -8,7 +22,7 @@ from formatter import *
                   import time
                   
                   
                  -# The following defines the HTML header used by all generated pages.
                  +# The following strings define the HTML header used by all generated pages.
                   html_header_1 = """\
                   
                  @@ -21,62 +35,125 @@ html_header_1 = """\
                   html_header_2 = """\
                    API Reference
                   
                   
                   
                   """
                   
                  -html_header_3 = """
                  -
                  -
                  -
                  -
                  [
                  [
                  [
                  [Index][Index][TOC]
                  -

                  \ +html_header_5t = """\ +">TOC]

                  +

                  \ """ -html_header_5t = """\ -">Index]

                  -

                  \ +html_header_5i = """\ +">Index]

                  +

                  \ """ html_header_6 = """\ - API Reference

                  + API Reference """ @@ -87,8 +164,8 @@ html_footer = """\ """ # The header and footer used for each section. -section_title_header = "

                  " -section_title_footer = "

                  " +section_title_header = "

                  " +section_title_footer = "

                  " # The header and footer used for code segments. code_header = '
                  '
                  @@ -99,66 +176,65 @@ para_header = "

                  " para_footer = "

                  " # Block header and footer. -block_header = '
                  ' +block_header = '
                  ' block_footer_start = """\ -
                  -
                  - - -\ +\ +
                  [
                  [Index][Index][Top][TOC]
                  +">TOC]
                  """ # Description header/footer. -description_header = '
                  ' -description_footer = "

                  " +description_header = "" +description_footer = "" # Marker header/inter/footer combination. -marker_header = '
                  ' -marker_inter = "
                  " -marker_footer = "
                  " +marker_header = "

                  " +marker_inter = "

                  " +marker_footer = "" # Header location header/footer. -header_location_header = '
                  ' -header_location_footer = "

                  " +header_location_header = "

                  " +header_location_footer = "

                  " # Source code extracts header/footer. -source_header = '
                  \n'
                  -source_footer = "\n

                  " +source_header = "
                  "
                  +source_footer = "
                  " # Chapter header/inter/footer. -chapter_header = '

                  ' -chapter_inter = '

                  • ' -chapter_footer = '
                  ' +chapter_header = """\ +
                  +

                  \ +""" +chapter_inter = '

                  ' +chapter_footer = '
                  ' # Index footer. index_footer_start = """\
                  - -
                  [
                  [TOC]
                  +">TOC]
                  """ # TOC footer. toc_footer_start = """\
                  - - -
                  [
                  [Index]
                  +">Index]
                  """ -# source language keyword coloration/styling +# Source language keyword coloration and styling. keyword_prefix = '' keyword_suffix = '' @@ -166,66 +242,78 @@ section_synopsis_header = '

                  Synopsis

                  ' section_synopsis_footer = '' -# Translate a single line of source to HTML. This will convert -# a "<" into "<.", ">" into ">.", etc. +# Translate a single line of source to HTML. This converts `<', `>', and +# `&' into `<',`>', and `&'. +# def html_quote( line ): - result = string.replace( line, "&", "&" ) - result = string.replace( result, "<", "<" ) - result = string.replace( result, ">", ">" ) + result = string.replace( line, "&", "&" ) + result = string.replace( result, "<", "<" ) + result = string.replace( result, ">", ">" ) return result - +################################################################ +## +## HTML FORMATTER CLASS +## class HtmlFormatter( Formatter ): def __init__( self, processor, project_title, file_prefix ): Formatter.__init__( self, processor ) - global html_header_1, html_header_2, html_header_3 - global html_header_4, html_header_5, html_footer + global html_header_1 + global html_header_2 + global html_header_3l, html_header_3r + global html_header_4 + global html_header_5t, html_header_5i + global html_header_6 + global html_footer if file_prefix: file_prefix = file_prefix + "-" else: file_prefix = "" - self.headers = processor.headers - self.project_title = project_title - self.file_prefix = file_prefix - self.html_header = html_header_1 + project_title + \ - html_header_2 + \ - html_header_3 + file_prefix + "index.html" + \ - html_header_4 + file_prefix + "toc.html" + \ - html_header_5 + project_title + \ - html_header_6 - - self.html_index_header = html_header_1 + project_title + \ - html_header_2 + \ - html_header_3i + file_prefix + "toc.html" + \ - html_header_5 + project_title + \ - html_header_6 - - self.html_toc_header = html_header_1 + project_title + \ - html_header_2 + \ - html_header_3 + file_prefix + "index.html" + \ - html_header_5t + project_title + \ - html_header_6 - - self.html_footer = "
                  generated on " + \ - time.asctime( time.localtime( time.time() ) ) + \ - "
                  " + html_footer + self.headers = processor.headers + self.project_title = project_title + self.file_prefix = file_prefix + self.html_header = ( + html_header_1 + project_title + + html_header_2 + + html_header_3l + file_prefix + "index.html" + + html_header_4 + file_prefix + "toc.html" + + html_header_5t + project_title + + html_header_6 ) + self.html_index_header = ( + html_header_1 + project_title + + html_header_2 + + html_header_3r + file_prefix + "toc.html" + + html_header_5t + project_title + + html_header_6 ) + self.html_toc_header = ( + html_header_1 + project_title + + html_header_2 + + html_header_3l + file_prefix + "index.html" + + html_header_5i + project_title + + html_header_6 ) + self.html_footer = ( + '
                  generated on ' + + time.asctime( time.localtime( time.time() ) ) + + "
                  " + html_footer ) self.columns = 3 def make_section_url( self, section ): return self.file_prefix + section.name + ".html" - def make_block_url( self, block ): - return self.make_section_url( block.section ) + "#" + block.name + def make_block_url( self, block, name = None ): + if name == None: + name = block.name + return self.make_section_url( block.section ) + "#" + name def make_html_word( self, word ): - """analyze a simple word to detect cross-references and styling""" - # look for cross-references + """Analyze a simple word to detect cross-references and markup.""" + # handle cross-references m = re_crossref.match( word ) if m: try: @@ -236,27 +324,28 @@ class HtmlFormatter( Formatter ): return '' + name + '' + rest except: # we detected a cross-reference to an unknown item - sys.stderr.write( \ - "WARNING: undefined cross reference '" + name + "'.\n" ) + sys.stderr.write( "WARNING: undefined cross reference" + + " '" + name + "'.\n" ) return '?' + name + '?' + rest - # look for italics and bolds + # handle markup for italic and bold m = re_italic.match( word ) if m: name = m.group( 1 ) - rest = m.group( 3 ) + rest = m.group( 2 ) return '' + name + '' + rest m = re_bold.match( word ) if m: name = m.group( 1 ) - rest = m.group( 3 ) + rest = m.group( 2 ) return '' + name + '' + rest return html_quote( word ) def make_html_para( self, words ): - """ convert words of a paragraph into tagged HTML text, handle xrefs """ + """Convert words of a paragraph into tagged HTML text. Also handle + cross references.""" line = "" if words: line = self.make_html_word( words[0] ) @@ -265,8 +354,8 @@ class HtmlFormatter( Formatter ): # handle hyperlinks line = re_url.sub( r'\1', line ) # convert `...' quotations into real left and right single quotes - line = re.sub( r"(^|\W)`(.*?)'(\W|$)", \ - r'\1‘\2’\3', \ + line = re.sub( r"(^|\W)`(.*?)'(\W|$)", + r'\1‘\2’\3', line ) # convert tilde into non-breakable space line = string.replace( line, "~", " " ) @@ -274,7 +363,7 @@ class HtmlFormatter( Formatter ): return para_header + line + para_footer def make_html_code( self, lines ): - """ convert a code sequence to HTML """ + """Convert a code sequence to HTML.""" line = code_header + '\n' for l in lines: line = line + html_quote( l ) + '\n' @@ -282,7 +371,7 @@ class HtmlFormatter( Formatter ): return line + code_footer def make_html_items( self, items ): - """ convert a field's content into some valid HTML """ + """Convert a field's content into HTML.""" lines = [] for item in items: if item.lines: @@ -297,7 +386,9 @@ class HtmlFormatter( Formatter ): def print_html_field( self, field ): if field.name: - print "
                  " + field.name + "" + print( '
                  ' + + field.name + + "" ) print self.make_html_items( field.items ) @@ -318,12 +409,24 @@ class HtmlFormatter( Formatter ): result = result + prefix + '' + name + '' elif re_source_keywords.match( name ): # this is a C keyword - result = result + prefix + keyword_prefix + name + keyword_suffix - elif self.identifiers.has_key( name ): + result = ( result + prefix + + keyword_prefix + name + keyword_suffix ) + elif name in self.identifiers: # this is a known identifier block = self.identifiers[name] - result = result + prefix + '' + name + '' + id = block.name + + # link to a field ID if possible + for markup in block.markups: + if markup.tag == 'values': + for field in markup.fields: + if field.name: + id = name + + result = ( result + prefix + + '' + name + '' ) else: result = result + html_quote( line[:length] ) @@ -335,15 +438,11 @@ class HtmlFormatter( Formatter ): return result def print_html_field_list( self, fields ): - print "

                  " - print "" + print '
                  ' for field in fields: - if len( field.name ) > 22: - print "" - print "" print "
                  " + field.name + "
                  " - else: - print "
                  " + field.name + "" - + print ( '
                  ' + + field.name + + '' ) self.print_html_items( field.items ) print "
                  " @@ -352,10 +451,9 @@ class HtmlFormatter( Formatter ): table_fields = [] for field in markup.fields: if field.name: - # we begin a new series of field or value definitions, we - # will record them in the 'table_fields' list before outputting - # all of them as a single table - # + # We begin a new series of field or value definitions. We + # record them in the `table_fields' list before outputting + # all of them as a single table. table_fields.append( field ) else: if table_fields: @@ -368,7 +466,7 @@ class HtmlFormatter( Formatter ): self.print_html_field_list( table_fields ) # - # Formatting the index + # formatting the index # def index_enter( self ): print self.html_index_header @@ -380,11 +478,11 @@ class HtmlFormatter( Formatter ): self.index_items[name] = url def index_exit( self ): - # block_index already contains the sorted list of index names + # `block_index' already contains the sorted list of index names count = len( self.block_index ) - rows = ( count + self.columns - 1 ) / self.columns + rows = ( count + self.columns - 1 ) // self.columns - print "" + print '
                  ' for r in range( rows ): line = "" for c in range( self.columns ): @@ -392,7 +490,8 @@ class HtmlFormatter( Formatter ): if i < count: bname = self.block_index[r + c * rows] url = self.index_items[bname] - line = line + '' + line = ( line + '' ) else: line = line + '' line = line + "" @@ -400,9 +499,9 @@ class HtmlFormatter( Formatter ): print "
                  ' + bname + '' + + bname + '
                  " - print index_footer_start + \ - self.file_prefix + "toc.html" + \ - index_footer_end + print( index_footer_start + + self.file_prefix + "toc.html" + + index_footer_end ) print self.html_footer @@ -415,21 +514,20 @@ class HtmlFormatter( Formatter ): Formatter.index_dump( self, index_filename ) # - # Formatting the table of content + # formatting the table of contents # def toc_enter( self ): print self.html_toc_header - print "

                  Table of Contents

                  " + print "

                  Table of Contents

                  " def toc_chapter_enter( self, chapter ): - print chapter_header + string.join( chapter.title ) + chapter_inter - print "" + print chapter_header + string.join( chapter.title ) + chapter_inter + print '
                  ' def toc_section_enter( self, section ): - print '
                  ' - print '' + \ - section.title + '' - + print ( '
                  ' ) print self.make_html_para( section.abstract ) def toc_section_exit( self, section ): @@ -440,14 +538,14 @@ class HtmlFormatter( Formatter ): print chapter_footer def toc_index( self, index_filename ): - print chapter_header + \ - 'Global Index' + \ - chapter_inter + chapter_footer + print( chapter_header + + 'Global Index' + + chapter_inter + chapter_footer ) def toc_exit( self ): - print toc_footer_start + \ - self.file_prefix + "index.html" + \ - toc_footer_end + print( toc_footer_start + + self.file_prefix + "index.html" + + toc_footer_end ) print self.html_footer @@ -461,14 +559,12 @@ class HtmlFormatter( Formatter ): Formatter.toc_dump( self, toc_filename, index_filename ) # - # Formatting sections + # formatting sections # def section_enter( self, section ): print self.html_header - print section_title_header - print section.title - print section_title_footer + print section_title_header + section.title + section_title_footer maxwidth = 0 for b in section.blocks.values(): @@ -476,32 +572,43 @@ class HtmlFormatter( Formatter ): maxwidth = len( b.name ) width = 70 # XXX magic number - if maxwidth <> 0: + if maxwidth > 0: # print section synopsis print section_synopsis_header - print "" + print '
                  ' - columns = width / maxwidth + columns = width // maxwidth if columns < 1: columns = 1 count = len( section.block_names ) - rows = ( count + columns - 1 ) / columns + # don't handle last entry if it is empty + if section.block_names[-1] == "/empty/": + count -= 1 + rows = ( count + columns - 1 ) // columns for r in range( rows ): line = "" for c in range( columns ): i = r + c * rows - line = line + '' line = line + "" print line - print "
                  ' + line = line + '' if i < count: name = section.block_names[i] - line = line + '' + name + '' + if name == "/empty/": + # it can happen that a complete row is empty, and + # without a proper `filler' the browser might + # collapse the row to a much smaller height (or + # even omit it completely) + line = line + " " + else: + line = ( line + '' + + name + '' ) line = line + '


                  " + print "
                  " print section_synopsis_footer print description_header @@ -513,7 +620,7 @@ class HtmlFormatter( Formatter ): # place html anchor if needed if block.name: - print '

                  ' + block.name + '

                  ' + print( '

                  ' + block.name + '

                  ' ) # dump the block C source lines now if block.code: @@ -521,16 +628,17 @@ class HtmlFormatter( Formatter ): for f in self.headers.keys(): if block.source.filename.find( f ) >= 0: header = self.headers[f] + ' (' + f + ')' - break; + break # if not header: -# sys.stderr.write( \ -# 'WARNING: No header macro for ' + block.source.filename + '.\n' ) +# sys.stderr.write( +# "WARNING: No header macro for" +# + " '" + block.source.filename + "'.\n" ) if header: - print header_location_header - print 'Defined in ' + header + '.' - print header_location_footer + print ( header_location_header + + 'Defined in ' + header + '.' + + header_location_footer ) print source_header for l in block.code: @@ -552,15 +660,16 @@ class HtmlFormatter( Formatter ): print marker_footer def block_exit( self, block ): - print block_footer_start + self.file_prefix + "index.html" + \ - block_footer_middle + self.file_prefix + "toc.html" + \ - block_footer_end + print( block_footer_start + self.file_prefix + "index.html" + + block_footer_middle + self.file_prefix + "toc.html" + + block_footer_end ) def section_exit( self, section ): print html_footer def section_dump_all( self ): for section in self.sections: - self.section_dump( section, self.file_prefix + section.name + '.html' ) + self.section_dump( section, + self.file_prefix + section.name + '.html' ) # eof diff --git a/freetype/src/tools/docmaker/utils.py b/freetype/src/tools/docmaker/utils.py index 1d96658c7..b35823ab7 100644 --- a/freetype/src/tools/docmaker/utils.py +++ b/freetype/src/tools/docmaker/utils.py @@ -1,48 +1,42 @@ -# Utils (c) 2002, 2004, 2007, 2008 David Turner # - -import string, sys, os, glob - -# current output directory +# utils.py # -output_dir = None - - -# This function is used to sort the index. It is a simple lexicographical -# sort, except that it places capital letters before lowercase ones. +# Auxiliary functions for the `docmaker' tool (library file). # -def index_sort( s1, s2 ): - if not s1: - return -1 - - if not s2: - return 1 - - l1 = len( s1 ) - l2 = len( s2 ) - m1 = string.lower( s1 ) - m2 = string.lower( s2 ) +# Copyright 2002, 2004, 2007, 2008, 2014 by +# David Turner. +# +# This file is part of the FreeType project, and may only be used, +# modified, and distributed under the terms of the FreeType project +# license, LICENSE.TXT. By continuing to use, modify, or distribute +# this file you indicate that you have read the license and +# understand and accept it fully. - for i in range( l1 ): - if i >= l2 or m1[i] > m2[i]: - return 1 - if m1[i] < m2[i]: - return -1 +import string, sys, os, glob, itertools - if s1[i] < s2[i]: - return -1 - if s1[i] > s2[i]: - return 1 +# current output directory +# +output_dir = None - if l2 > l1: - return -1 - return 0 +# A function that generates a sorting key. We want lexicographical order +# (primary key) except that capital letters are sorted before lowercase +# ones (secondary key). +# +# The primary key is implemented by lowercasing the input. The secondary +# key is simply the original data appended, character by character. For +# example, the sort key for `FT_x' is `fFtT__xx', while the sort key for +# `ft_X' is `fftt__xX'. Since ASCII codes of uppercase letters are +# numerically smaller than the codes of lowercase letters, `fFtT__xx' gets +# sorted before `fftt__xX'. +# +def index_key( s ): + return string.join( itertools.chain( *zip( s.lower(), s ) ) ) -# Sort input_list, placing the elements of order_list in front. +# Sort `input_list', placing the elements of `order_list' in front. # def sort_order_list( input_list, order_list ): new_list = order_list[:] @@ -52,9 +46,9 @@ def sort_order_list( input_list, order_list ): return new_list -# Open the standard output to a given project documentation file. Use -# "output_dir" to determine the filename location if necessary and save the -# old stdout in a tuple that is returned by this function. +# Divert standard output to a given project documentation file. Use +# `output_dir' to determine the filename location if necessary and save the +# old stdout handle in a tuple that is returned by this function. # def open_output( filename ): global output_dir @@ -69,7 +63,7 @@ def open_output( filename ): return ( new_file, old_stdout ) -# Close the output that was returned by "close_output". +# Close the output that was returned by `open_output'. # def close_output( output ): output[0].close() @@ -83,15 +77,16 @@ def check_output(): if output_dir: if output_dir != "": if not os.path.isdir( output_dir ): - sys.stderr.write( "argument" + " '" + output_dir + "' " + \ - "is not a valid directory" ) + sys.stderr.write( "argument" + + " '" + output_dir + "' " + + "is not a valid directory" ) sys.exit( 2 ) else: output_dir = None def file_exists( pathname ): - """checks that a given file exists""" + """Check that a given file exists.""" result = 1 try: file = open( pathname, "r" ) @@ -104,12 +99,12 @@ def file_exists( pathname ): def make_file_list( args = None ): - """builds a list of input files from command-line arguments""" + """Build a list of input files from command-line arguments.""" file_list = [] # sys.stderr.write( repr( sys.argv[1 :] ) + '\n' ) if not args: - args = sys.argv[1 :] + args = sys.argv[1:] for pathname in args: if string.find( pathname, '*' ) >= 0: diff --git a/freetype/src/tools/ftrandom/README b/freetype/src/tools/ftrandom/README index c093f15e8..71bf05323 100644 --- a/freetype/src/tools/ftrandom/README +++ b/freetype/src/tools/ftrandom/README @@ -43,6 +43,6 @@ Arguments are: --rasterize Call FT_Render_Glyph as well as loading it. --result This is the directory in which test files are placed. - --test Run a single test on a pre-generated testcase. + --test Run a single test on a pre-generated testcase. Done in the current process so it can be debugged more easily. diff --git a/freetype/src/tools/ftrandom/ftrandom.c b/freetype/src/tools/ftrandom/ftrandom.c index 7c9795711..9a5b63267 100644 --- a/freetype/src/tools/ftrandom/ftrandom.c +++ b/freetype/src/tools/ftrandom/ftrandom.c @@ -449,9 +449,9 @@ fseek( new, getRandom( 0, item->len - 1 ), SEEK_SET ); if ( item->isbinary ) - putc( getRandom( 0, 0xff ), new ); + putc( getRandom( 0, 0xFF ), new ); else if ( item->isascii ) - putc( getRandom( 0x20, 0x7e ), new ); + putc( getRandom( 0x20, 0x7E ), new ); else { int hex = getRandom( 0, 15 ); diff --git a/freetype/src/tools/test_trig.c b/freetype/src/tools/test_trig.c index 49d927e36..99ac1cf17 100644 --- a/freetype/src/tools/test_trig.c +++ b/freetype/src/tools/test_trig.c @@ -20,7 +20,7 @@ int i; - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L ) { FT_Fixed f1, f2; double d2; @@ -46,7 +46,7 @@ int i; - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L ) { FT_Fixed f1, f2; double d2; @@ -72,7 +72,7 @@ int i; - for ( i = 0; i < FT_ANGLE_PI2-0x2000000; i += 0x10000 ) + for ( i = 0; i < FT_ANGLE_PI2 - 0x2000000L; i += 0x10000L ) { FT_Fixed f1, f2; double d2; @@ -98,7 +98,7 @@ int i; - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L ) { FT_Fixed c2, s2; double l, a, c1, s1; @@ -133,7 +133,7 @@ int i; - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L ) { FT_Vector v; double a, c1, s1; @@ -166,7 +166,7 @@ int i; - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L ) { FT_Vector v; FT_Fixed l, l2; @@ -193,7 +193,7 @@ int rotate; - for ( rotate = 0; rotate < FT_ANGLE_2PI; rotate += 0x10000 ) + for ( rotate = 0; rotate < FT_ANGLE_2PI; rotate += 0x10000L ) { double ra, cra, sra; int i; @@ -203,7 +203,7 @@ cra = cos( ra ); sra = sin( ra ); - for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000 ) + for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L ) { FT_Fixed c2, s2, c4, s4; FT_Vector v; diff --git a/freetype/src/truetype/ttdriver.c b/freetype/src/truetype/ttdriver.c index 36d23a282..ecf4cdcb4 100644 --- a/freetype/src/truetype/ttdriver.c +++ b/freetype/src/truetype/ttdriver.c @@ -4,7 +4,7 @@ /* */ /* TrueType font driver implementation (body). */ /* */ -/* Copyright 1996-2013 by */ +/* Copyright 1996-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -267,7 +267,7 @@ /* use the scaled metrics, even when tt_size_reset fails */ FT_Select_Metrics( size->face, strike_index ); - tt_size_reset( ttsize ); + tt_size_reset( ttsize ); /* ignore return value */ } else { @@ -370,7 +370,7 @@ return FT_THROW( Invalid_Size_Handle ); if ( !face ) - return FT_THROW( Invalid_Argument ); + return FT_THROW( Invalid_Face_Handle ); #ifdef FT_CONFIG_OPTION_INCREMENTAL if ( glyph_index >= (FT_UInt)face->num_glyphs && @@ -481,7 +481,7 @@ SFNT_Service sfnt; - /* TT_SERVICES_GET derefers `library' in PIC mode */ + /* TT_SERVICES_GET dereferences `library' in PIC mode */ #ifdef FT_CONFIG_OPTION_PIC if ( !driver ) return NULL; diff --git a/freetype/src/truetype/ttgload.c b/freetype/src/truetype/ttgload.c index 5f676a2ef..c5841c301 100644 --- a/freetype/src/truetype/ttgload.c +++ b/freetype/src/truetype/ttgload.c @@ -4,7 +4,7 @@ /* */ /* TrueType Glyph Loader (body). */ /* */ -/* Copyright 1996-2013 */ +/* Copyright 1996-2014 */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -99,13 +99,13 @@ else if ( face->os2.version != 0xFFFFU ) { - *tsb = face->os2.sTypoAscender - yMax; + *tsb = (FT_Short)( face->os2.sTypoAscender - yMax ); *ah = face->os2.sTypoAscender - face->os2.sTypoDescender; } else { - *tsb = face->horizontal.Ascender - yMax; + *tsb = (FT_Short)( face->horizontal.Ascender - yMax ); *ah = face->horizontal.Ascender - face->horizontal.Descender; } @@ -801,10 +801,8 @@ FT_Outline current_outline = gloader->current.outline; - error = TT_Set_CodeRange( loader->exec, tt_coderange_glyph, - loader->exec->glyphIns, n_ins ); - if ( error ) - return error; + TT_Set_CodeRange( loader->exec, tt_coderange_glyph, + loader->exec->glyphIns, n_ins ); loader->exec->is_composite = is_composite; loader->exec->pts = *zone; @@ -1789,8 +1787,12 @@ /* (1): exists from the beginning */ /* (2): components that have been loaded so far */ /* (3): the newly loaded component */ - TT_Process_Composite_Component( loader, subglyph, start_point, - num_base_points ); + error = TT_Process_Composite_Component( loader, + subglyph, + start_point, + num_base_points ); + if ( error ) + goto Exit; } loader->stream = old_stream; @@ -1799,16 +1801,17 @@ /* process the glyph */ loader->ins_pos = ins_pos; if ( IS_HINTED( loader->load_flags ) && - #ifdef TT_USE_BYTECODE_INTERPRETER - subglyph->flags & WE_HAVE_INSTR && - #endif - num_points > start_point ) - TT_Process_Composite_Glyph( loader, start_point, start_contour ); - + { + error = TT_Process_Composite_Glyph( loader, + start_point, + start_contour ); + if ( error ) + goto Exit; + } } } else @@ -2083,6 +2086,8 @@ FT_Int32 load_flags, FT_Bool glyf_table_only ) { + FT_Error error; + TT_Face face; FT_Stream stream; #ifdef TT_USE_BYTECODE_INTERPRETER @@ -2120,14 +2125,16 @@ FT_Bool reexecute = FALSE; - if ( !size->cvt_ready ) + if ( size->bytecode_ready < 0 || size->cvt_ready < 0 ) { - FT_Error error = tt_size_ready_bytecode( size, pedantic ); - - + error = tt_size_ready_bytecode( size, pedantic ); if ( error ) return error; } + else if ( size->bytecode_ready ) + return size->bytecode_ready; + else if ( size->cvt_ready ) + return size->cvt_ready; /* query new execution context */ exec = size->debug ? size->context @@ -2191,7 +2198,9 @@ FT_RENDER_MODE_MONO ); } - TT_Load_Context( exec, face, size ); + error = TT_Load_Context( exec, face, size ); + if ( error ) + return error; #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING @@ -2243,7 +2252,9 @@ for ( i = 0; i < size->cvt_size; i++ ) size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale ); - tt_size_run_prep( size, pedantic ); + error = tt_size_run_prep( size, pedantic ); + if ( error ) + return error; } /* see whether the cvt program has disabled hinting */ @@ -2274,8 +2285,7 @@ #endif { - FT_Error error = face->goto_table( face, TTAG_glyf, stream, 0 ); - + error = face->goto_table( face, TTAG_glyf, stream, 0 ); if ( FT_ERR_EQ( error, Table_Missing ) ) loader->glyf_offset = 0; @@ -2366,15 +2376,18 @@ (void)tt_loader_init( &loader, size, glyph, load_flags, TRUE ); (void)load_truetype_glyph( &loader, glyph_index, 0, TRUE ); glyph->linearHoriAdvance = loader.linear; - glyph->linearVertAdvance = loader.top_bearing + loader.bbox.yMax - - loader.vadvance; + glyph->linearVertAdvance = loader.vadvance; - /* sanity check: if `horiAdvance' in the sbit metric */ - /* structure isn't set, use `linearHoriAdvance' */ + /* sanity checks: if `xxxAdvance' in the sbit metric */ + /* structure isn't set, use `linearXXXAdvance' */ if ( !glyph->metrics.horiAdvance && glyph->linearHoriAdvance ) glyph->metrics.horiAdvance = FT_MulFix( glyph->linearHoriAdvance, size->root.metrics.x_scale ); + if ( !glyph->metrics.vertAdvance && glyph->linearVertAdvance ) + glyph->metrics.vertAdvance = + FT_MulFix( glyph->linearVertAdvance, + size->root.metrics.y_scale ); } return FT_Err_Ok; @@ -2454,7 +2467,7 @@ #endif /* TT_USE_BYTECODE_INTERPRETER */ - compute_glyph_metrics( &loader, glyph_index ); + error = compute_glyph_metrics( &loader, glyph_index ); } /* Set the `high precision' bit flag. */ diff --git a/freetype/src/truetype/ttgxvar.c b/freetype/src/truetype/ttgxvar.c index 7899d3671..1b35539fe 100644 --- a/freetype/src/truetype/ttgxvar.c +++ b/freetype/src/truetype/ttgxvar.c @@ -4,7 +4,7 @@ /* */ /* TrueType GX Font Variation loader */ /* */ -/* Copyright 2004-2013 by */ +/* Copyright 2004-2014 by */ /* David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -938,13 +938,13 @@ FT_FREE( face->cvt ); face->cvt = NULL; - tt_face_load_cvt( face, face->root.stream ); + error = tt_face_load_cvt( face, face->root.stream ); break; case mcvt_modify: /* The original cvt table is in memory. All we need to do is */ /* apply the `cvar' table (if any). */ - tt_face_vary_cvt( face, face->root.stream ); + error = tt_face_vary_cvt( face, face->root.stream ); break; case mcvt_retain: diff --git a/freetype/src/truetype/ttinterp.c b/freetype/src/truetype/ttinterp.c index 56e8fa7e2..eccd4aacc 100644 --- a/freetype/src/truetype/ttinterp.c +++ b/freetype/src/truetype/ttinterp.c @@ -172,6 +172,9 @@ #define CUR_Func_round( d, c ) \ CUR.func_round( EXEC_ARG_ d, c ) +#define CUR_Func_cur_ppem() \ + CUR.func_cur_ppem( EXEC_ARG ) + #define CUR_Func_read_cvt( index ) \ CUR.func_read_cvt( EXEC_ARG_ index ) @@ -184,12 +187,6 @@ #define CURRENT_Ratio() \ Current_Ratio( EXEC_ARG ) -#define CURRENT_Ppem() \ - Current_Ppem( EXEC_ARG ) - -#define CUR_Ppem() \ - Cur_PPEM( EXEC_ARG ) - #define INS_SxVTL( a, b, c, d ) \ Ins_SxVTL( EXEC_ARG_ a, b, c, d ) @@ -282,10 +279,7 @@ /* */ /* exec :: The target execution context. */ /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) + FT_LOCAL_DEF( void ) TT_Goto_CodeRange( TT_ExecContext exec, FT_Int range, FT_Long IP ) @@ -309,8 +303,6 @@ exec->codeSize = coderange->size; exec->IP = IP; exec->curRange = range; - - return FT_Err_Ok; } @@ -332,10 +324,7 @@ /* */ /* exec :: The target execution context. */ /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - FT_LOCAL_DEF( FT_Error ) + FT_LOCAL_DEF( void ) TT_Set_CodeRange( TT_ExecContext exec, FT_Int range, void* base, @@ -345,8 +334,6 @@ exec->codeRangeTable[range - 1].base = (FT_Byte*)base; exec->codeRangeTable[range - 1].size = length; - - return FT_Err_Ok; } @@ -364,13 +351,7 @@ /* */ /* exec :: The target execution context. */ /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - /* */ - /* Does not set the Error variable. */ - /* */ - FT_LOCAL_DEF( FT_Error ) + FT_LOCAL_DEF( void ) TT_Clear_CodeRange( TT_ExecContext exec, FT_Int range ) { @@ -378,8 +359,6 @@ exec->codeRangeTable[range - 1].base = NULL; exec->codeRangeTable[range - 1].size = 0; - - return FT_Err_Ok; } @@ -403,13 +382,10 @@ /* */ /* memory :: A handle to the parent memory object. */ /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ /* */ /* Only the glyph loader and debugger should call this function. */ /* */ - FT_LOCAL_DEF( FT_Error ) + FT_LOCAL_DEF( void ) TT_Done_Context( TT_ExecContext exec ) { FT_Memory memory = exec->memory; @@ -436,8 +412,6 @@ exec->face = NULL; FT_FREE( exec ); - - return FT_Err_Ok; } @@ -664,13 +638,10 @@ /* */ /* size :: A handle to the target size object. */ /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ /* */ /* Only the glyph loader and debugger should call this function. */ /* */ - FT_LOCAL_DEF( FT_Error ) + FT_LOCAL_DEF( void ) TT_Save_Context( TT_ExecContext exec, TT_Size size ) { @@ -688,8 +659,6 @@ for ( i = 0; i < TT_MAX_CODE_RANGES; i++ ) size->codeRangeTable[i] = exec->codeRangeTable[i]; - - return FT_Err_Ok; } @@ -721,12 +690,7 @@ TT_Run_Context( TT_ExecContext exec, FT_Bool debug ) { - FT_Error error; - - - if ( ( error = TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 ) ) - != FT_Err_Ok ) - return error; + TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 ); exec->zp0 = exec->pts; exec->zp1 = exec->pts; @@ -796,8 +760,13 @@ FT_EXPORT_DEF( TT_ExecContext ) TT_New_Context( TT_Driver driver ) { - FT_Memory memory = driver->root.root.memory; + FT_Memory memory; + + + if ( !driver ) + goto Fail; + memory = driver->root.root.memory; if ( !driver->context ) { @@ -1446,7 +1415,7 @@ TT_MulFix14_arm( FT_Int32 a, FT_Int b ) { - register FT_Int32 t, t2; + FT_Int32 t, t2; #if defined( __CC_ARM ) || defined( __ARMCC__ ) @@ -1706,8 +1675,15 @@ } - static FT_Long + FT_CALLBACK_DEF( FT_Long ) Current_Ppem( EXEC_OP ) + { + return CUR.tt_metrics.ppem; + } + + + FT_CALLBACK_DEF( FT_Long ) + Current_Ppem_Stretched( EXEC_OP ) { return FT_MulFix( CUR.tt_metrics.ppem, CURRENT_Ratio() ); } @@ -2047,7 +2023,7 @@ if ( distance >= 0 ) { val = distance + compensation; - if ( distance && val < 0 ) + if ( val < 0 ) val = 0; } else @@ -2087,10 +2063,8 @@ if ( distance >= 0 ) { - val = distance + compensation + 32; - if ( distance && val > 0 ) - val &= ~63; - else + val = FT_PIX_ROUND( distance + compensation ); + if ( val < 0 ) val = 0; } else @@ -2132,14 +2106,14 @@ if ( distance >= 0 ) { val = FT_PIX_FLOOR( distance + compensation ) + 32; - if ( distance && val < 0 ) - val = 0; + if ( val < 0 ) + val = 32; } else { val = -( FT_PIX_FLOOR( compensation - distance ) + 32 ); if ( val > 0 ) - val = 0; + val = -32; } return val; @@ -2173,15 +2147,13 @@ if ( distance >= 0 ) { - val = distance + compensation; - if ( distance && val > 0 ) - val &= ~63; - else + val = FT_PIX_FLOOR( distance + compensation ); + if ( val < 0 ) val = 0; } else { - val = -( ( compensation - distance ) & -64 ); + val = -FT_PIX_FLOOR( compensation - distance ); if ( val > 0 ) val = 0; } @@ -2217,10 +2189,8 @@ if ( distance >= 0 ) { - val = distance + compensation + 63; - if ( distance && val > 0 ) - val &= ~63; - else + val = FT_PIX_CEIL( distance + compensation ); + if ( val < 0 ) val = 0; } else @@ -2261,10 +2231,8 @@ if ( distance >= 0 ) { - val = distance + compensation + 16; - if ( distance && val > 0 ) - val &= ~31; - else + val = FT_PAD_ROUND( distance + compensation, 32 ); + if ( val < 0 ) val = 0; } else @@ -2311,17 +2279,17 @@ { val = ( distance - CUR.phase + CUR.threshold + compensation ) & -CUR.period; - if ( distance && val < 0 ) - val = 0; val += CUR.phase; + if ( val < 0 ) + val = CUR.phase; } else { val = -( ( CUR.threshold - CUR.phase - distance + compensation ) & -CUR.period ); - if ( val > 0 ) - val = 0; val -= CUR.phase; + if ( val > 0 ) + val = -CUR.phase; } return val; @@ -2359,17 +2327,17 @@ { val = ( ( distance - CUR.phase + CUR.threshold + compensation ) / CUR.period ) * CUR.period; - if ( distance && val < 0 ) - val = 0; val += CUR.phase; + if ( val < 0 ) + val = CUR.phase; } else { val = -( ( ( CUR.threshold - CUR.phase - distance + compensation ) / CUR.period ) * CUR.period ); - if ( val > 0 ) - val = 0; val -= CUR.phase; + if ( val > 0 ) + val = -CUR.phase; } return val; @@ -3077,19 +3045,22 @@ CUR.GS.auto_flip = FALSE; -#define DO_SDB \ - CUR.GS.delta_base = (FT_Short)args[0]; +#define DO_SDB \ + CUR.GS.delta_base = (FT_UShort)args[0]; -#define DO_SDS \ - CUR.GS.delta_shift = (FT_Short)args[0]; +#define DO_SDS \ + if ( (FT_ULong)args[0] > 6UL ) \ + CUR.error = FT_THROW( Bad_Argument ); \ + else \ + CUR.GS.delta_shift = (FT_UShort)args[0]; #define DO_MD /* nothing */ -#define DO_MPPEM \ - args[0] = CURRENT_Ppem(); +#define DO_MPPEM \ + args[0] = CUR_Func_cur_ppem(); /* Note: The pointSize should be irrelevant in a given font program; */ @@ -3101,8 +3072,8 @@ #else -#define DO_MPS \ - args[0] = CURRENT_Ppem(); +#define DO_MPS \ + args[0] = CUR_Func_cur_ppem(); #endif /* 0 */ @@ -5654,7 +5625,7 @@ /*************************************************************************/ /* */ /* INSTCTRL[]: INSTruction ConTRoL */ - /* Opcode range: 0x8e */ + /* Opcode range: 0x8E */ /* Stack: int32 int32 --> */ /* */ static void @@ -7487,9 +7458,9 @@ static void Ins_DELTAP( INS_ARG ) { - FT_ULong k, nump; + FT_ULong nump, k; FT_UShort A; - FT_ULong C; + FT_ULong C, P; FT_Long B; #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING FT_UShort B1, B2; @@ -7523,6 +7494,7 @@ } #endif + P = (FT_ULong)CUR_Func_cur_ppem(); nump = (FT_ULong)args[0]; /* some points theoretically may occur more than once, thus UShort isn't enough */ @@ -7567,12 +7539,12 @@ C += CUR.GS.delta_base; - if ( CURRENT_Ppem() == (FT_Long)C ) + if ( P == C ) { B = ( (FT_ULong)B & 0xF ) - 8; if ( B >= 0 ) B++; - B = B * 64 / ( 1L << CUR.GS.delta_shift ); + B *= 1L << ( 6 - CUR.GS.delta_shift ); #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING @@ -7581,42 +7553,33 @@ /* * Allow delta move if * - * - not using ignore_x_mode rendering - * - glyph is specifically set to allow it - * - glyph is composite and freedom vector is not subpixel - * vector + * - not using ignore_x_mode rendering, + * - glyph is specifically set to allow it, or + * - glyph is composite and freedom vector is not in subpixel + * direction. */ if ( !CUR.ignore_x_mode || ( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_DO_DELTAP ) || ( CUR.is_composite && CUR.GS.freeVector.y != 0 ) ) CUR_Func_move( &CUR.zp0, A, B ); - /* Otherwise apply subpixel hinting and */ - /* compatibility mode rules */ - else if ( CUR.ignore_x_mode ) + /* Otherwise, apply subpixel hinting and compatibility mode */ + /* rules, always skipping deltas in subpixel direction. */ + else if ( CUR.ignore_x_mode && CUR.GS.freeVector.y != 0 ) { - if ( CUR.GS.freeVector.y != 0 ) - B1 = CUR.zp0.cur[A].y; - else - B1 = CUR.zp0.cur[A].x; + /* save the y value of the point now; compare after move */ + B1 = (FT_UShort)CUR.zp0.cur[A].y; -#if 0 - /* Standard Subpixel Hinting: Allow y move. */ - /* This messes up dejavu and may not be needed... */ - if ( !CUR.face->sph_compatibility_mode && - CUR.GS.freeVector.y != 0 ) + /* Standard subpixel hinting: Allow y move for y-touched */ + /* points. This messes up DejaVu ... */ + if ( !CUR.face->sph_compatibility_mode && + ( CUR.zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) ) CUR_Func_move( &CUR.zp0, A, B ); - else -#endif /* 0 */ - /* Compatibility Mode: Allow x or y move if point touched in */ - /* Y direction. */ - if ( CUR.face->sph_compatibility_mode && - !( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) ) + /* compatibility mode */ + else if ( CUR.face->sph_compatibility_mode && + !( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) ) { - /* save the y value of the point now; compare after move */ - B1 = CUR.zp0.cur[A].y; - if ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) B = FT_PIX_ROUND( B1 + B ) - B1; @@ -7627,7 +7590,7 @@ CUR_Func_move( &CUR.zp0, A, B ); } - B2 = CUR.zp0.cur[A].y; + B2 = (FT_UShort)CUR.zp0.cur[A].y; /* Reverse this move if it results in a disallowed move */ if ( CUR.GS.freeVector.y != 0 && @@ -7667,7 +7630,7 @@ Ins_DELTAC( INS_ARG ) { FT_ULong nump, k; - FT_ULong A, C; + FT_ULong A, C, P; FT_Long B; @@ -7691,6 +7654,7 @@ } #endif + P = (FT_ULong)CUR_Func_cur_ppem(); nump = (FT_ULong)args[0]; for ( k = 1; k <= nump; k++ ) @@ -7736,12 +7700,12 @@ C += CUR.GS.delta_base; - if ( CURRENT_Ppem() == (FT_Long)C ) + if ( P == C ) { B = ( (FT_ULong)B & 0xF ) - 8; if ( B >= 0 ) B++; - B = B * 64 / ( 1L << CUR.GS.delta_shift ); + B *= 1L << ( 6 - CUR.GS.delta_shift ); CUR_Func_move_cvt( A, B ); } @@ -8262,6 +8226,9 @@ #ifdef TT_CONFIG_OPTION_STATIC_RASTER + if ( !exc ) + return FT_THROW( Invalid_Argument ); + cur = *exc; #endif @@ -8269,11 +8236,12 @@ CUR.iup_called = FALSE; #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ - /* set CVT functions */ + /* set PPEM and CVT functions */ CUR.tt_metrics.ratio = 0; if ( CUR.metrics.x_ppem != CUR.metrics.y_ppem ) { /* non-square pixels, use the stretched routines */ + CUR.func_cur_ppem = Current_Ppem_Stretched; CUR.func_read_cvt = Read_CVT_Stretched; CUR.func_write_cvt = Write_CVT_Stretched; CUR.func_move_cvt = Move_CVT_Stretched; @@ -8281,6 +8249,7 @@ else { /* square pixels, use normal routines */ + CUR.func_cur_ppem = Current_Ppem; CUR.func_read_cvt = Read_CVT; CUR.func_write_cvt = Write_CVT; CUR.func_move_cvt = Move_CVT; @@ -9035,10 +9004,13 @@ /* If any errors have occurred, function tables may be broken. */ /* Force a re-execution of `prep' and `fpgm' tables if no */ /* bytecode debugger is run. */ - if ( CUR.error && !CUR.instruction_trap ) + if ( CUR.error && + !CUR.instruction_trap && + CUR.curRange == tt_coderange_glyph ) { FT_TRACE1(( " The interpreter returned error 0x%x\n", CUR.error )); - exc->size->cvt_ready = FALSE; + exc->size->bytecode_ready = -1; + exc->size->cvt_ready = -1; } return CUR.error; diff --git a/freetype/src/truetype/ttinterp.h b/freetype/src/truetype/ttinterp.h index 1d8825d3b..333decc6a 100644 --- a/freetype/src/truetype/ttinterp.h +++ b/freetype/src/truetype/ttinterp.h @@ -4,7 +4,7 @@ /* */ /* TrueType bytecode interpreter (specification). */ /* */ -/* Copyright 1996-2007, 2010, 2012-2013 by */ +/* Copyright 1996-2007, 2010, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -81,6 +81,10 @@ FT_BEGIN_HEADER (*TT_Project_Func)( EXEC_OP_ FT_Pos dx, FT_Pos dy ); + /* getting current ppem. Take care of non-square pixels if necessary */ + typedef FT_Long + (*TT_Cur_Ppem_Func)( EXEC_OP ); + /* reading a cvt value. Take care of non-square pixels if necessary */ typedef FT_F26Dot6 (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong idx ); @@ -228,11 +232,6 @@ FT_BEGIN_HEADER FT_F26Dot6 phase; /* `SuperRounding' */ FT_F26Dot6 threshold; -#if 0 - /* this seems to be unused */ - FT_Int cur_ppem; /* ppem along the current proj vector */ -#endif - FT_Bool instruction_trap; /* If `True', the interpreter will */ /* exit after each instruction */ @@ -254,6 +253,8 @@ FT_BEGIN_HEADER TT_Move_Func func_move; /* current point move function */ TT_Move_Func func_move_orig; /* move original position function */ + TT_Cur_Ppem_Func func_cur_ppem; /* get current proj. ppem value */ + TT_Get_CVT_Func func_read_cvt; /* read a cvt entry */ TT_Set_CVT_Func func_write_cvt; /* write a cvt entry (in pixels) */ TT_Set_CVT_Func func_move_cvt; /* incr a cvt entry (in pixels) */ @@ -295,18 +296,18 @@ FT_BEGIN_HEADER #ifdef TT_USE_BYTECODE_INTERPRETER - FT_LOCAL( FT_Error ) + FT_LOCAL( void ) TT_Goto_CodeRange( TT_ExecContext exec, FT_Int range, FT_Long IP ); - FT_LOCAL( FT_Error ) + FT_LOCAL( void ) TT_Set_CodeRange( TT_ExecContext exec, FT_Int range, void* base, FT_Long length ); - FT_LOCAL( FT_Error ) + FT_LOCAL( void ) TT_Clear_CodeRange( TT_ExecContext exec, FT_Int range ); @@ -344,7 +345,7 @@ FT_BEGIN_HEADER #ifdef TT_USE_BYTECODE_INTERPRETER - FT_LOCAL( FT_Error ) + FT_LOCAL( void ) TT_Done_Context( TT_ExecContext exec ); FT_LOCAL( FT_Error ) @@ -352,7 +353,7 @@ FT_BEGIN_HEADER TT_Face face, TT_Size size ); - FT_LOCAL( FT_Error ) + FT_LOCAL( void ) TT_Save_Context( TT_ExecContext exec, TT_Size ins ); diff --git a/freetype/src/truetype/ttobjs.c b/freetype/src/truetype/ttobjs.c index 4adba58f7..4707dfe15 100644 --- a/freetype/src/truetype/ttobjs.c +++ b/freetype/src/truetype/ttobjs.c @@ -256,89 +256,89 @@ #define TRICK_SFNT_ID_prep 2 { /* MingLiU 1995 */ - { 0x05bcf058, 0x000002e4 }, /* cvt */ - { 0x28233bf1, 0x000087c4 }, /* fpgm */ - { 0xa344a1ea, 0x000001e1 } /* prep */ + { 0x05BCF058UL, 0x000002E4UL }, /* cvt */ + { 0x28233BF1UL, 0x000087C4UL }, /* fpgm */ + { 0xA344A1EAUL, 0x000001E1UL } /* prep */ }, { /* MingLiU 1996- */ - { 0x05bcf058, 0x000002e4 }, /* cvt */ - { 0x28233bf1, 0x000087c4 }, /* fpgm */ - { 0xa344a1eb, 0x000001e1 } /* prep */ + { 0x05BCF058UL, 0x000002E4UL }, /* cvt */ + { 0x28233BF1UL, 0x000087C4UL }, /* fpgm */ + { 0xA344A1EBUL, 0x000001E1UL } /* prep */ }, { /* DFKaiShu */ - { 0x11e5ead4, 0x00000350 }, /* cvt */ - { 0x5a30ca3b, 0x00009063 }, /* fpgm */ - { 0x13a42602, 0x0000007e } /* prep */ + { 0x11E5EAD4UL, 0x00000350UL }, /* cvt */ + { 0x5A30CA3BUL, 0x00009063UL }, /* fpgm */ + { 0x13A42602UL, 0x0000007EUL } /* prep */ }, { /* HuaTianKaiTi */ - { 0xfffbfffc, 0x00000008 }, /* cvt */ - { 0x9c9e48b8, 0x0000bea2 }, /* fpgm */ - { 0x70020112, 0x00000008 } /* prep */ + { 0xFFFBFFFCUL, 0x00000008UL }, /* cvt */ + { 0x9C9E48B8UL, 0x0000BEA2UL }, /* fpgm */ + { 0x70020112UL, 0x00000008UL } /* prep */ }, { /* HuaTianSongTi */ - { 0xfffbfffc, 0x00000008 }, /* cvt */ - { 0x0a5a0483, 0x00017c39 }, /* fpgm */ - { 0x70020112, 0x00000008 } /* prep */ + { 0xFFFBFFFCUL, 0x00000008UL }, /* cvt */ + { 0x0A5A0483UL, 0x00017C39UL }, /* fpgm */ + { 0x70020112UL, 0x00000008UL } /* prep */ }, { /* NEC fadpop7.ttf */ - { 0x00000000, 0x00000000 }, /* cvt */ - { 0x40c92555, 0x000000e5 }, /* fpgm */ - { 0xa39b58e3, 0x0000117c } /* prep */ + { 0x00000000UL, 0x00000000UL }, /* cvt */ + { 0x40C92555UL, 0x000000E5UL }, /* fpgm */ + { 0xA39B58E3UL, 0x0000117CUL } /* prep */ }, { /* NEC fadrei5.ttf */ - { 0x00000000, 0x00000000 }, /* cvt */ - { 0x33c41652, 0x000000e5 }, /* fpgm */ - { 0x26d6c52a, 0x00000f6a } /* prep */ + { 0x00000000UL, 0x00000000UL }, /* cvt */ + { 0x33C41652UL, 0x000000E5UL }, /* fpgm */ + { 0x26D6C52AUL, 0x00000F6AUL } /* prep */ }, { /* NEC fangot7.ttf */ - { 0x00000000, 0x00000000 }, /* cvt */ - { 0x6db1651d, 0x0000019d }, /* fpgm */ - { 0x6c6e4b03, 0x00002492 } /* prep */ + { 0x00000000UL, 0x00000000UL }, /* cvt */ + { 0x6DB1651DUL, 0x0000019DUL }, /* fpgm */ + { 0x6C6E4B03UL, 0x00002492UL } /* prep */ }, { /* NEC fangyo5.ttf */ - { 0x00000000, 0x00000000 }, /* cvt */ - { 0x40c92555, 0x000000e5 }, /* fpgm */ - { 0xde51fad0, 0x0000117c } /* prep */ + { 0x00000000UL, 0x00000000UL }, /* cvt */ + { 0x40C92555UL, 0x000000E5UL }, /* fpgm */ + { 0xDE51FAD0UL, 0x0000117CUL } /* prep */ }, { /* NEC fankyo5.ttf */ - { 0x00000000, 0x00000000 }, /* cvt */ - { 0x85e47664, 0x000000e5 }, /* fpgm */ - { 0xa6c62831, 0x00001caa } /* prep */ + { 0x00000000UL, 0x00000000UL }, /* cvt */ + { 0x85E47664UL, 0x000000E5UL }, /* fpgm */ + { 0xA6C62831UL, 0x00001CAAUL } /* prep */ }, { /* NEC fanrgo5.ttf */ - { 0x00000000, 0x00000000 }, /* cvt */ - { 0x2d891cfd, 0x0000019d }, /* fpgm */ - { 0xa0604633, 0x00001de8 } /* prep */ + { 0x00000000UL, 0x00000000UL }, /* cvt */ + { 0x2D891CFDUL, 0x0000019DUL }, /* fpgm */ + { 0xA0604633UL, 0x00001DE8UL } /* prep */ }, { /* NEC fangot5.ttc */ - { 0x00000000, 0x00000000 }, /* cvt */ - { 0x40aa774c, 0x000001cb }, /* fpgm */ - { 0x9b5caa96, 0x00001f9a } /* prep */ + { 0x00000000UL, 0x00000000UL }, /* cvt */ + { 0x40AA774CUL, 0x000001CBUL }, /* fpgm */ + { 0x9B5CAA96UL, 0x00001F9AUL } /* prep */ }, { /* NEC fanmin3.ttc */ - { 0x00000000, 0x00000000 }, /* cvt */ - { 0x0d3de9cb, 0x00000141 }, /* fpgm */ - { 0xd4127766, 0x00002280 } /* prep */ + { 0x00000000UL, 0x00000000UL }, /* cvt */ + { 0x0D3DE9CBUL, 0x00000141UL }, /* fpgm */ + { 0xD4127766UL, 0x00002280UL } /* prep */ }, { /* NEC FA-Gothic, 1996 */ - { 0x00000000, 0x00000000 }, /* cvt */ - { 0x4a692698, 0x000001f0 }, /* fpgm */ - { 0x340d4346, 0x00001fca } /* prep */ + { 0x00000000UL, 0x00000000UL }, /* cvt */ + { 0x4A692698UL, 0x000001F0UL }, /* fpgm */ + { 0x340D4346UL, 0x00001FCAUL } /* prep */ }, { /* NEC FA-Minchou, 1996 */ - { 0x00000000, 0x00000000 }, /* cvt */ - { 0xcd34c604, 0x00000166 }, /* fpgm */ - { 0x6cf31046, 0x000022b0 } /* prep */ + { 0x00000000UL, 0x00000000UL }, /* cvt */ + { 0xCD34C604UL, 0x00000166UL }, /* fpgm */ + { 0x6CF31046UL, 0x000022B0UL } /* prep */ }, { /* NEC FA-RoundGothicB, 1996 */ - { 0x00000000, 0x00000000 }, /* cvt */ - { 0x5da75315, 0x0000019d }, /* fpgm */ - { 0x40745a5f, 0x000022e0 } /* prep */ + { 0x00000000UL, 0x00000000UL }, /* cvt */ + { 0x5DA75315UL, 0x0000019DUL }, /* fpgm */ + { 0x40745A5FUL, 0x000022E0UL } /* prep */ }, { /* NEC FA-RoundGothicM, 1996 */ - { 0x00000000, 0x00000000 }, /* cvt */ - { 0xf055fc48, 0x000001c2 }, /* fpgm */ - { 0x3900ded3, 0x00001e18 } /* prep */ + { 0x00000000UL, 0x00000000UL }, /* cvt */ + { 0xF055FC48UL, 0x000001C2UL }, /* fpgm */ + { 0x3900DED3UL, 0x00001E18UL } /* prep */ } }; @@ -760,7 +760,9 @@ if ( !exec ) return FT_THROW( Could_Not_Find_Context ); - TT_Load_Context( exec, face, size ); + error = TT_Load_Context( exec, face, size ); + if ( error ) + return error; exec->callTop = 0; exec->top = 0; @@ -801,18 +803,16 @@ if ( face->font_program_size > 0 ) { - error = TT_Goto_CodeRange( exec, tt_coderange_font, 0 ); + TT_Goto_CodeRange( exec, tt_coderange_font, 0 ); - if ( !error ) - { - FT_TRACE4(( "Executing `fpgm' table.\n" )); - - error = face->interpreter( exec ); - } + FT_TRACE4(( "Executing `fpgm' table.\n" )); + error = face->interpreter( exec ); } else error = FT_Err_Ok; + size->bytecode_ready = error; + if ( !error ) TT_Save_Context( exec, size ); @@ -854,7 +854,9 @@ if ( !exec ) return FT_THROW( Could_Not_Find_Context ); - TT_Load_Context( exec, face, size ); + error = TT_Load_Context( exec, face, size ); + if ( error ) + return error; exec->callTop = 0; exec->top = 0; @@ -872,9 +874,9 @@ if ( face->cvt_program_size > 0 ) { - error = TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 ); + TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 ); - if ( !error && !size->debug ) + if ( !size->debug ) { FT_TRACE4(( "Executing `prep' table.\n" )); @@ -884,6 +886,8 @@ else error = FT_Err_Ok; + size->cvt_ready = error; + /* UNDOCUMENTED! The MS rasterizer doesn't allow the following */ /* graphics state variables to be modified by the CVT program. */ @@ -912,10 +916,6 @@ return error; } -#endif /* TT_USE_BYTECODE_INTERPRETER */ - - -#ifdef TT_USE_BYTECODE_INTERPRETER static void tt_size_done_bytecode( FT_Size ftsize ) @@ -953,8 +953,8 @@ size->max_func = 0; size->max_ins = 0; - size->bytecode_ready = 0; - size->cvt_ready = 0; + size->bytecode_ready = -1; + size->cvt_ready = -1; } @@ -968,14 +968,13 @@ TT_Size size = (TT_Size)ftsize; TT_Face face = (TT_Face)ftsize->face; FT_Memory memory = face->root.memory; - FT_Int i; FT_UShort n_twilight; TT_MaxProfile* maxp = &face->max_profile; - size->bytecode_ready = 1; - size->cvt_ready = 0; + size->bytecode_ready = -1; + size->cvt_ready = -1; size->max_function_defs = maxp->maxFunctionDefs; size->max_instruction_defs = maxp->maxInstructionDefs; @@ -997,9 +996,11 @@ metrics->rotated = FALSE; metrics->stretched = FALSE; - /* set default compensation (all 0) */ - for ( i = 0; i < 4; i++ ) - metrics->compensations[i] = 0; + /* set default engine compensation */ + metrics->compensations[0] = 0; /* gray */ + metrics->compensations[1] = 0; /* black */ + metrics->compensations[2] = 0; /* white */ + metrics->compensations[3] = 0; /* reserved */ } /* allocate function defs, instruction defs, cvt, and storage area */ @@ -1052,15 +1053,14 @@ FT_Error error = FT_Err_Ok; - if ( !size->bytecode_ready ) - { + if ( size->bytecode_ready < 0 ) error = tt_size_init_bytecode( (FT_Size)size, pedantic ); - if ( error ) - goto Exit; - } + + if ( error || size->bytecode_ready ) + goto Exit; /* rescale CVT when needed */ - if ( !size->cvt_ready ) + if ( size->cvt_ready < 0 ) { FT_UInt i; TT_Face face = (TT_Face)size->root.face; @@ -1087,8 +1087,6 @@ size->GS = tt_default_graphics_state; error = tt_size_run_prep( size, pedantic ); - if ( !error ) - size->cvt_ready = 1; } Exit: @@ -1118,9 +1116,10 @@ TT_Size size = (TT_Size)ttsize; FT_Error error = FT_Err_Ok; + #ifdef TT_USE_BYTECODE_INTERPRETER - size->bytecode_ready = 0; - size->cvt_ready = 0; + size->bytecode_ready = -1; + size->cvt_ready = -1; #endif size->ttmetrics.valid = FALSE; @@ -1148,8 +1147,7 @@ #ifdef TT_USE_BYTECODE_INTERPRETER - if ( size->bytecode_ready ) - tt_size_done_bytecode( ttsize ); + tt_size_done_bytecode( ttsize ); #endif size->ttmetrics.valid = FALSE; @@ -1229,7 +1227,7 @@ } #ifdef TT_USE_BYTECODE_INTERPRETER - size->cvt_ready = 0; + size->cvt_ready = -1; #endif /* TT_USE_BYTECODE_INTERPRETER */ if ( !error ) diff --git a/freetype/src/truetype/ttobjs.h b/freetype/src/truetype/ttobjs.h index a11dd3752..859164f86 100644 --- a/freetype/src/truetype/ttobjs.h +++ b/freetype/src/truetype/ttobjs.h @@ -4,7 +4,7 @@ /* */ /* Objects manager (specification). */ /* */ -/* Copyright 1996-2009, 2011-2013 by */ +/* Copyright 1996-2009, 2011-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -95,8 +95,8 @@ FT_BEGIN_HEADER FT_F26Dot6 control_value_cutin; FT_F26Dot6 single_width_cutin; FT_F26Dot6 single_width_value; - FT_Short delta_base; - FT_Short delta_shift; + FT_UShort delta_base; + FT_UShort delta_shift; FT_Byte instruct_control; /* According to Greg Hitchcock from Microsoft, the `scan_control' */ @@ -333,8 +333,10 @@ FT_BEGIN_HEADER FT_Bool debug; TT_ExecContext context; - FT_Bool bytecode_ready; - FT_Bool cvt_ready; + /* if negative, `fpgm' (resp. `prep'), wasn't executed yet; */ + /* otherwise it is the returned error code */ + FT_Error bytecode_ready; + FT_Error cvt_ready; #endif /* TT_USE_BYTECODE_INTERPRETER */ diff --git a/freetype/src/truetype/ttpload.c b/freetype/src/truetype/ttpload.c index 9723a515b..999192542 100644 --- a/freetype/src/truetype/ttpload.c +++ b/freetype/src/truetype/ttpload.c @@ -508,9 +508,9 @@ record_size = FT_NEXT_ULONG( p ); /* The maximum number of bytes in an hdmx device record is the */ - /* maximum number of glyphs + 2; this is 0xFFFF + 2; this is */ - /* the reason why `record_size' is a long (which we read as */ - /* unsigned long for convenience). In practice, two bytes */ + /* maximum number of glyphs + 2; this is 0xFFFF + 2, thus */ + /* explaining why `record_size' is a long (which we read as */ + /* unsigned long for convenience). In practice, two bytes are */ /* sufficient to hold the size value. */ /* */ /* There are at least two fonts, HANNOM-A and HANNOM-B version */ @@ -522,8 +522,10 @@ record_size &= 0xFFFFU; /* The limit for `num_records' is a heuristic value. */ - - if ( version != 0 || num_records > 255 || record_size > 0x10001L ) + if ( version != 0 || + num_records > 255 || + record_size > 0x10001L || + record_size < 4 ) { error = FT_THROW( Invalid_File_Format ); goto Fail; diff --git a/freetype/src/truetype/ttsubpix.c b/freetype/src/truetype/ttsubpix.c index 28470ad65..ca604518c 100644 --- a/freetype/src/truetype/ttsubpix.c +++ b/freetype/src/truetype/ttsubpix.c @@ -282,7 +282,7 @@ const SPH_TweakRule COMPATIBILITY_MODE_Rules [COMPATIBILITY_MODE_RULES_SIZE] = { - { "-", 0, "", 0 }, + { "Verdana Clones", 0, "", 0 }, }; @@ -956,7 +956,7 @@ if ( loader->exec->rasterizer_version != TT_INTERPRETER_VERSION_35 ) { loader->exec->rasterizer_version = TT_INTERPRETER_VERSION_35; - loader->exec->size->cvt_ready = FALSE; + loader->exec->size->cvt_ready = -1; tt_size_ready_bytecode( loader->exec->size, @@ -971,7 +971,7 @@ SPH_OPTION_SET_RASTERIZER_VERSION ) { loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION; - loader->exec->size->cvt_ready = FALSE; + loader->exec->size->cvt_ready = -1; tt_size_ready_bytecode( loader->exec->size, diff --git a/freetype/src/type1/t1driver.c b/freetype/src/type1/t1driver.c index 697288d66..2602bdb6f 100644 --- a/freetype/src/type1/t1driver.c +++ b/freetype/src/type1/t1driver.c @@ -4,7 +4,7 @@ /* */ /* Type 1 driver interface (body). */ /* */ -/* Copyright 1996-2004, 2006, 2007, 2009, 2011, 2013 by */ +/* Copyright 1996-2004, 2006, 2007, 2009, 2011, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -557,9 +557,6 @@ if ( value && value_len >= retval ) *((FT_Long *)value) = type1->font_info.italic_angle; break; - - default: - break; } return retval; diff --git a/freetype/src/type1/t1load.c b/freetype/src/type1/t1load.c index fd06432b5..22b3f6b31 100644 --- a/freetype/src/type1/t1load.c +++ b/freetype/src/type1/t1load.c @@ -1211,7 +1211,7 @@ char* notdef = (char *)".notdef"; - T1_Add_Table( char_table, n, notdef, 8 ); + (void)T1_Add_Table( char_table, n, notdef, 8 ); } /* Now we need to read records of the form */ @@ -1596,6 +1596,11 @@ } T1_Skip_PS_Token( parser ); + if ( parser->root.cursor >= limit ) + { + error = FT_THROW( Invalid_File_Format ); + goto Fail; + } if ( parser->root.error ) return; @@ -1604,7 +1609,7 @@ FT_PtrDist len; - if ( cur + 1 >= limit ) + if ( cur + 2 >= limit ) { error = FT_THROW( Invalid_File_Format ); goto Fail; diff --git a/freetype/src/type42/t42objs.c b/freetype/src/type42/t42objs.c index 798ebdbc5..915e81fe7 100644 --- a/freetype/src/type42/t42objs.c +++ b/freetype/src/type42/t42objs.c @@ -47,6 +47,12 @@ if ( FT_ALLOC( face->ttf_data, 12 ) ) goto Exit; + /* while parsing the font we always update `face->ttf_size' so that */ + /* even in case of buggy data (which might lead to premature end of */ + /* scanning without causing an error) the call to `FT_Open_Face' in */ + /* `T42_Face_Init' passes the correct size */ + face->ttf_size = 12; + error = t42_parser_init( parser, face->root.stream, memory, @@ -286,7 +292,9 @@ FT_Open_Args args; - args.flags = FT_OPEN_MEMORY; + args.flags = FT_OPEN_MEMORY | FT_OPEN_DRIVER; + args.driver = FT_Get_Module( FT_FACE_LIBRARY( face ), + "truetype" ); args.memory_base = face->ttf_data; args.memory_size = face->ttf_size; diff --git a/freetype/src/type42/t42parse.c b/freetype/src/type42/t42parse.c index 9b668889b..50708537d 100644 --- a/freetype/src/type42/t42parse.c +++ b/freetype/src/type42/t42parse.c @@ -366,7 +366,7 @@ char* notdef = (char *)".notdef"; - T1_Add_Table( char_table, n, notdef, 8 ); + (void)T1_Add_Table( char_table, n, notdef, 8 ); } /* Now we need to read records of the form */ @@ -524,7 +524,7 @@ FT_Byte* limit = parser->root.limit; FT_Error error; FT_Int num_tables = 0; - FT_ULong count, ttf_size = 0; + FT_ULong count; FT_Long n, string_size, old_string_size, real_size; FT_Byte* string_buf = NULL; @@ -580,6 +580,12 @@ /* don't include delimiters */ string_size = (FT_Long)( ( parser->root.cursor - cur - 2 + 1 ) / 2 ); + if ( !string_size ) + { + FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Fail; + } if ( FT_REALLOC( string_buf, old_string_size, string_size ) ) goto Fail; @@ -617,7 +623,7 @@ if ( limit - parser->root.cursor < string_size ) { - FT_ERROR(( "t42_parse_sfnts: too many binary data\n" )); + FT_ERROR(( "t42_parse_sfnts: too much binary data\n" )); error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -657,18 +663,25 @@ } else { - num_tables = 16 * face->ttf_data[4] + face->ttf_data[5]; - status = BEFORE_TABLE_DIR; - ttf_size = 12 + 16 * num_tables; + num_tables = 16 * face->ttf_data[4] + face->ttf_data[5]; + status = BEFORE_TABLE_DIR; + face->ttf_size = 12 + 16 * num_tables; - if ( FT_REALLOC( face->ttf_data, 12, ttf_size ) ) + if ( (FT_ULong)( limit - parser->root.cursor ) < face->ttf_size ) + { + FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Fail; + } + + if ( FT_REALLOC( face->ttf_data, 12, face->ttf_size ) ) goto Fail; } /* fall through */ case BEFORE_TABLE_DIR: /* the offset table is read; read the table directory */ - if ( count < ttf_size ) + if ( count < face->ttf_size ) { face->ttf_data[count++] = string_buf[n]; continue; @@ -687,24 +700,23 @@ len = FT_PEEK_ULONG( p ); /* Pad to a 4-byte boundary length */ - ttf_size += ( len + 3 ) & ~3; + face->ttf_size += ( len + 3 ) & ~3; } - status = OTHER_TABLES; - face->ttf_size = ttf_size; + status = OTHER_TABLES; /* there are no more than 256 tables, so no size check here */ if ( FT_REALLOC( face->ttf_data, 12 + 16 * num_tables, - ttf_size + 1 ) ) + face->ttf_size + 1 ) ) goto Fail; } /* fall through */ case OTHER_TABLES: /* all other tables are just copied */ - if ( count >= ttf_size ) + if ( count >= face->ttf_size ) { - FT_ERROR(( "t42_parse_sfnts: too many binary data\n" )); + FT_ERROR(( "t42_parse_sfnts: too much binary data\n" )); error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -850,6 +862,12 @@ break; T1_Skip_PS_Token( parser ); + if ( parser->root.cursor >= limit ) + { + FT_ERROR(( "t42_parse_charstrings: out of bounds\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Fail; + } if ( parser->root.error ) return; @@ -858,7 +876,7 @@ FT_PtrDist len; - if ( cur + 1 >= limit ) + if ( cur + 2 >= limit ) { FT_ERROR(( "t42_parse_charstrings: out of bounds\n" )); error = FT_THROW( Invalid_File_Format ); diff --git a/freetype/src/winfonts/winfnt.c b/freetype/src/winfonts/winfnt.c index e9c1a9b5f..4705c5396 100644 --- a/freetype/src/winfonts/winfnt.c +++ b/freetype/src/winfonts/winfnt.c @@ -72,12 +72,12 @@ FT_FRAME_START( 248 ), FT_FRAME_ULONG_LE ( magic ), /* PE00 */ - FT_FRAME_USHORT_LE ( machine ), /* 0x014c - i386 */ + FT_FRAME_USHORT_LE ( machine ), /* 0x014C - i386 */ FT_FRAME_USHORT_LE ( number_of_sections ), FT_FRAME_SKIP_BYTES( 12 ), FT_FRAME_USHORT_LE ( size_of_optional_header ), FT_FRAME_SKIP_BYTES( 2 ), - FT_FRAME_USHORT_LE ( magic32 ), /* 0x10b */ + FT_FRAME_USHORT_LE ( magic32 ), /* 0x10B */ FT_FRAME_SKIP_BYTES( 110 ), FT_FRAME_ULONG_LE ( rsrc_virtual_address ), FT_FRAME_ULONG_LE ( rsrc_size ), @@ -412,9 +412,9 @@ pe32_header.rsrc_size )); if ( pe32_header.magic != WINFNT_PE_MAGIC /* check full signature */ || - pe32_header.machine != 0x014c /* i386 */ || - pe32_header.size_of_optional_header != 0xe0 /* FIXME */ || - pe32_header.magic32 != 0x10b ) + pe32_header.machine != 0x014C /* i386 */ || + pe32_header.size_of_optional_header != 0xE0 /* FIXME */ || + pe32_header.magic32 != 0x10B ) { FT_TRACE2(( "this file has an invalid PE header\n" )); error = FT_THROW( Invalid_File_Format ); @@ -591,11 +591,14 @@ static FT_Error - fnt_cmap_init( FNT_CMap cmap ) + fnt_cmap_init( FNT_CMap cmap, + FT_Pointer pointer ) { FNT_Face face = (FNT_Face)FT_CMAP_FACE( cmap ); FNT_Font font = face->font; + FT_UNUSED( pointer ); + cmap->first = (FT_UInt32) font->header.first_char; cmap->count = (FT_UInt32)( font->header.last_char - cmap->first + 1 ); @@ -971,7 +974,7 @@ if ( !face ) { - error = FT_THROW( Invalid_Argument ); + error = FT_THROW( Invalid_Face_Handle ); goto Exit; } diff --git a/packages.txt b/packages.txt index 55eb27e96..89d45e772 100644 --- a/packages.txt +++ b/packages.txt @@ -45,7 +45,7 @@ font-winitzki-cyrillic-1.0.3 font-xfree86-type1-1.0.4 fontconfig git version fontsproto-2.1.3 -freetype-2.5.3 +freetype-2.5.5 glproto git version inputproto-2.3.1 kbproto-1.0.6 -- cgit v1.2.3