Merge remote-tracking branch 'origin/5.12' into 5.13

Conflicts:
	src/android/templates/AndroidManifest.xml
	src/network/ssl/qsslsocket_mac.cpp
	src/widgets/styles/qstylesheetstyle.cpp
	tests/auto/corelib/kernel/qtimer/BLACKLIST
	tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
	tests/auto/testlib/selftests/expected_blacklisted.lightxml
	tests/auto/testlib/selftests/expected_blacklisted.tap
	tests/auto/testlib/selftests/expected_blacklisted.teamcity
	tests/auto/testlib/selftests/expected_blacklisted.txt
	tests/auto/testlib/selftests/expected_blacklisted.xml
	tests/auto/testlib/selftests/expected_blacklisted.xunitxml
	tests/auto/testlib/selftests/expected_float.tap
	tests/auto/testlib/selftests/expected_float.teamcity
	tests/auto/testlib/selftests/expected_float.txt
	tests/auto/testlib/selftests/expected_float.xunitxml

Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: If93cc432a56ae3ac1b6533d0028e4dc497415a52
This commit is contained in:
Liang Qi 2019-02-08 09:28:00 +01:00 committed by Edward Welbourne
commit fbfacd33be
743 changed files with 49736 additions and 14904 deletions

View File

@ -144,6 +144,9 @@ attribute_target("sha") void test_shani()
#endif
#if T(AVX)
# if defined(__WIN64__) && defined(__GNUC__) && !defined(__clang__)
# error "AVX support is broken in 64-bit MinGW - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49001"
# endif
attribute_target("avx") void test_avx()
{
__m256d a = _mm256_setzero_pd();

View File

@ -29,8 +29,11 @@ else: equals(ANDROID_TARGET_ARCH, mips): \
else: equals(ANDROID_TARGET_ARCH, mips64): \
QMAKE_CFLAGS += -target mips64el-none-linux-android
QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH
QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a
QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH -fno-limit-debug-info
QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a
equals(ANDROID_TARGET_ARCH, armeabi-v7a): QMAKE_LINK += -Wl,--exclude-libs,libunwind.a
QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$NDK_ROOT/sysroot \
-isystem $$NDK_ROOT/sysroot/usr/include/$$NDK_TOOLS_PREFIX \
-isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++/include \

View File

@ -17,8 +17,8 @@ os_directory = $$(INTEGRITY_DIR)
isEmpty(os_directory): \
error("This qmakespec requires $INTEGRITY_DIR to be set")
QMAKE_CC = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared
QMAKE_CXX = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared
QMAKE_CC = cxintarm64 -U__ARM_NEON__ -U__ARM_NEON -bsp $$bsp_name -os_dir $$os_directory -non_shared
QMAKE_CXX = cxintarm64 -U__ARM_NEON__ -U__ARM_NEON -bsp $$bsp_name -os_dir $$os_directory -non_shared
QMAKE_LINK = $$QMAKE_CXX
QMAKE_AR = $$QMAKE_CXX -archive -o

View File

@ -33,9 +33,6 @@ gl_lib_directory = $$(GL_LIB_DIR)
isEmpty(gl_lib_directory): \
error("This qmakespec requires $GL_LIB_DIR to be set")
QMAKE_LIBDIR += $$(QCLIBS_DIR)/base
QMAKE_LIBDIR += $$(QCLIBS_DIR)/multimedia/display
QMAKE_INCDIR += $$(QC_MULTIMEDIA_INC_DIR)
QMAKE_LIBS_EGL += -lESXEGL_Adreno -lESXGLESv2_Adreno -ladreno_utils -lGSLUser -lOSUser -lpanel -livfs -lposix -lpmem -ltzbsp -lpaged_alloc -lglnext-llvm -lopenwfd -lplanedef -lmmosallibrary
@ -51,7 +48,12 @@ QMAKE_LFLAGS += -bigswitch
# OpenGL libraries have a dependency on libEGL
QMAKE_INCDIR_EGL = $$(GL_INC_DIR)
QMAKE_LIBDIR_EGL = $$(GL_LIB_DIR)
QMAKE_LIBDIR_EGL += $$(QCLIBS_DIR)/base
QMAKE_LIBDIR_EGL += $$(QCLIBS_DIR)/multimedia/display
QMAKE_INCDIR_OPENGL_ES2 = $$(GL_INC_DIR)
QMAKE_LIBDIR_OPENGL_ES2 = $$(GL_LIB_DIR)
QMAKE_LIBDIR_OPENGL_ES2 += $$(QCLIBS_DIR)/base
QMAKE_LIBDIR_OPENGL_ES2 += $$(QCLIBS_DIR)/multimedia/display
load(qt_config)

View File

@ -58,6 +58,14 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-embedded {
!isEmpty(ANDROID_PACKAGE_SOURCE_DIR): \
FILE_CONTENT += " \"android-package-source-directory\": $$emitString($$ANDROID_PACKAGE_SOURCE_DIR),"
# Android-specific version string
!isEmpty(ANDROID_VERSION_NAME): \
FILE_CONTENT += " \"android-version-name\": $$emitString($$ANDROID_VERSION_NAME),"
# Android-specific version number
!isEmpty(ANDROID_VERSION_CODE): \
FILE_CONTENT += " \"android-version-code\": $$emitString($$ANDROID_VERSION_CODE),"
!isEmpty(ANDROID_EXTRA_LIBS): \
FILE_CONTENT += " \"android-extra-libs\": $$emitString($$join(ANDROID_EXTRA_LIBS, ",")),"

View File

@ -1,12 +1,25 @@
CURRENT_MAC_SDK_VERSION := $(shell DEVELOPER_DIR=$(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version)
ifneq ($(CURRENT_MAC_SDK_VERSION),$(EXPORT_QMAKE_MAC_SDK_VERSION))
$(info The platform SDK has been changed from version $(EXPORT_QMAKE_MAC_SDK_VERSION) to version $(CURRENT_MAC_SDK_VERSION).)
$(info This requires a fresh build. Please wipe the build directory completely,)
$(info including any .qmake.stash and .qmake.cache files generated by qmake.)
# FIXME: Ideally this should be advertised as just running make distclean, or we
# should even do it automatically by having proper makefile dependencies between
# .qmake.stash and the SDK version, but as qmake doesn't seem to be consistent in
# how it deals with .qmake.stash as a dependency we need to defer that until later.
$(error ^)
ifeq ($(QT_MAC_SDK_NO_VERSION_CHECK),)
CHECK_SDK_COMMAND = /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version 2>&1
CURRENT_MAC_SDK_VERSION := $(shell DEVELOPER_DIR=$(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) $(CHECK_SDK_COMMAND))
ifneq ($(CURRENT_MAC_SDK_VERSION),$(EXPORT_QMAKE_MAC_SDK_VERSION))
# We don't want to complain about out of date SDK unless the target needs to be remade.
# This covers use-cases such as running 'make check' after moving the build to a
# computer without Xcode or with a different Xcode version.
TARGET_UP_TO_DATE := $(shell QT_MAC_SDK_NO_VERSION_CHECK=1 $(MAKE) --question $(QMAKE_TARGET) && echo 1 || echo 0)
ifeq ($(TARGET_UP_TO_DATE),0)
ifneq ($(findstring missing DEVELOPER_DIR path,$(CURRENT_MAC_SDK_VERSION)),)
$(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) is no longer valid.)
else ifneq ($(findstring SDK "$(EXPORT_QMAKE_MAC_SDK)" cannot be located,$(CURRENT_MAC_SDK_VERSION)),)
$(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) no longer contains the $(EXPORT_QMAKE_MAC_SDK_VERSION) platform SDK.)
else ifneq ($(CURRENT_MAC_SDK_VERSION),)
$(info The platform SDK has been changed from version $(EXPORT_QMAKE_MAC_SDK_VERSION) to version $(CURRENT_MAC_SDK_VERSION).)
else
$(info Unknown error resolving current platform SDK version.)
endif
$(info This requires a fresh build. Please wipe the build directory completely,)
$(info including any .qmake.stash and .qmake.cache files generated by qmake.)
$(error ^)
endif
endif
endif

View File

@ -333,9 +333,21 @@ defineTest(qtConfParseCommandLine) {
type = boolean
}
isEmpty(type):contains(opt, "skip") {
isEmpty(skipOptionWarningAdded) {
qtConfAddWarning("Command line option -skip is only effective in top-level builds.")
skipOptionWarningAdded = 1
}
$$qtConfGetNextCommandlineArg()
next()
}
isEmpty(type) {
qtConfAddError("Unknown command line option '$$c'.")
return()
equals(config.input.continue, yes): \
next()
else: \
return()
}
call = "qtConfCommandline_$${type}"

View File

@ -38,6 +38,8 @@ qt_install_headers {
private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES $$SYNCQT.INJECTED_PRIVATE_HEADER_FILES
private_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/private
generated_privates: \
private_headers.CONFIG += no_check_exist
INSTALLS += private_headers
qpa_headers.files = $$SYNCQT.QPA_HEADER_FILES

View File

@ -108,7 +108,7 @@ rcc.name = RCC ${QMAKE_FILE_IN}
rcc.depend_command = $$QMAKE_RCC_DEP -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN}
rcc.CONFIG += add_inputs_as_makefile_deps dep_lines
!resources_big|ltcg|macx-xcode|contains(TEMPLATE, "vc.*") {
!resources_big|ltcg|macx-xcode|wasm|contains(TEMPLATE, "vc.*") {
rcc.output = $$RCC_DIR/$${first(QMAKE_MOD_RCC)}_${QMAKE_FILE_BASE}$${first(QMAKE_EXT_CPP)}
rcc.commands = $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}

View File

@ -2585,6 +2585,9 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
{ //actually compile
t << subtarget->target << ":";
auto extraDeps = extraSubTargetDependencies();
if (!extraDeps.isEmpty())
t << " " << valList(extraDeps);
if(!subtarget->depends.isEmpty())
t << " " << valList(subtarget->depends);
t << " FORCE";

View File

@ -119,6 +119,7 @@ protected:
virtual void writeSubMakeCall(QTextStream &t, const QString &outDirectory_cdin,
const QString &makeFileIn);
virtual void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags);
virtual ProStringList extraSubTargetDependencies() { return {}; }
//extra compiler interface
bool verifyExtraCompiler(const ProString &c, const QString &f);

View File

@ -76,6 +76,11 @@ void NmakeMakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &cal
Win32MakefileGenerator::writeSubMakeCall(t, callPrefix, makeArguments);
}
ProStringList NmakeMakefileGenerator::extraSubTargetDependencies()
{
return { "$(MAKEFILE)" };
}
QString NmakeMakefileGenerator::defaultInstall(const QString &t)
{
QString ret = Win32MakefileGenerator::defaultInstall(t);

View File

@ -48,6 +48,7 @@ class NmakeMakefileGenerator : public Win32MakefileGenerator
protected:
void writeSubMakeCall(QTextStream &t, const QString &callPrefix,
const QString &makeArguments) override;
ProStringList extraSubTargetDependencies() override;
QString defaultInstall(const QString &t) override;
QStringList &findDependencies(const QString &file) override;
QString var(const ProKey &value) const override;

View File

@ -1,7 +1,7 @@
FreeType 2.6.1
FreeType 2.9.1
==============
Homepage: http://www.freetype.org
Homepage: https://www.freetype.org
FreeType is a freely available software library to render fonts.
@ -20,17 +20,17 @@
documentation is available as a separate package from our sites. Go
to
http://download.savannah.gnu.org/releases/freetype/
https://download.savannah.gnu.org/releases/freetype/
and download one of the following files.
freetype-doc-2.6.1.tar.bz2
freetype-doc-2.6.1.tar.gz
ftdoc261.zip
freetype-doc-2.9.1.tar.bz2
freetype-doc-2.9.1.tar.gz
ftdoc291.zip
To view the documentation online, go to
http://www.freetype.org/freetype2/documentation.html
https://www.freetype.org/freetype2/documentation.html
Mailing Lists
@ -46,7 +46,7 @@
The lists are moderated; see
http://www.freetype.org/contact.html
https://www.freetype.org/contact.html
how to subscribe.
@ -71,7 +71,7 @@
----------------------------------------------------------------------
Copyright 2006-2015 by
Copyright 2006-2018 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
/* */
/* Unix-specific FreeType low-level system interface (body). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */

View File

@ -1,3 +1,681 @@
CHANGES BETWEEN 2.9 and 2.9.1
I. IMPORTANT BUG FIXES
- Type 1 fonts containing flex features were not rendered
correctly (bug introduced in version 2.9).
- CVE-2018-6942: Older FreeType versions can crash with certain
malformed variation fonts.
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-6942
II. MISCELLANEOUS
- Bug fix: Multiple calls to `FT_Get_MM_Var' returned garbage.
- The base extensions `ftlcdfil' and `ftfntfmt' are now part of
the base module (and thus no longer configurable in file
`modules.cfg').
- Emboldening of bitmaps didn't work correctly sometimes, showing
various artifacts (bug introduced in version 2.8.1).
- Use of the `freetype-config' script to get compilation and
linking options is deprecated since it doesn't support
cross-compiling, among other deficiencies. Instead, you should
use the `pkg-config' interface.
The `configure' script no longer installs `freetype-config' by
default. For backwards compatibility, a new configure option
`--enable-freetype-config' is provided that reverts this
decision.
- The auto-hinter script ranges have been updated for Unicode 11.
No support for new scripts have been added, however, with the
exception of Georgian Mtavruli.
- Support for cmake has been improved.
- The next release will remove support for Position Independent
Code as needed by systems that prohibit automatic address
fixups, such as BREW. [Compilation with modern compilers that
use flags like `-fPIC' or `-fPIE' is not affected.]
======================================================================
CHANGES BETWEEN 2.8.1 and 2.9
I. IMPORTANT BUG FIXES
- Advance width values of variation fonts were often wrong.
- More fixes for variation font support; you should update to this
version if you want to support them.
II. IMPORTANT CHANGES
- As a GSoC project, Ewald Hew extended the new (Adobe) CFF engine
to handle Type 1 fonts also, thus greatly improving the
rendering of this format. This is the new default. The old
engine is still available if the configuration macro
`T1_CONFIG_OPTION_OLD_ENGINE' gets defined; using the
`hinting-engine' property of the `type1' driver module you can
then switch between the two engines.
- A new function, `FT_Set_Named_Instance', can be used to set or
change the current named instance.
- Starting with this FreeType version, resetting variation
coordinates will return to the currently selected named
instance. Previously, FreeType returned to the base font (i.e.,
no instance set).
III. MISCELLANEOUS
- The `face_flags' field of the `FT_Face' structure has a new bit,
`FT_FACE_FLAG_VARIATION', which is set if a variation font has
been altered with `FT_Set_MM_Design_Coordinates',
`FT_Set_Var_Design_Coordinates', or
`FT_Set_Var_Blend_Coordinates'.
- If the current face is a named instance, the new macro
`FT_IS_NAMED_INSTANCE' returns true.
- `FT_IS_VARIATION' is a new macro that returns true whenever a
face object has been altered by `FT_Set_MM_Design_Coordinates',
`FT_Set_Var_Design_Coordinates', or
`FT_Set_Var_Blend_Coordinates'.
- Changing the design coordinates of a variation font with
`FT_Set_Var_Design_Coordinates' or
`FT_Set_Var_Blend_Coordinates' does not influence the named
instance index value (only `FT_Set_Named_Instance' does that).
- Special PostScript names for named instances are only returned
if the named instance is set with `FT_Set_Named_Instance' (and
the font has corresponding entries in its `fvar' table). If
`FT_IS_VARIATION' returns true, the algorithmically derived
PostScript name is provided, not looking up special entries for
named instances.
- A new function `FT_Done_MM_Var' is provided to free the memory
returned in a call to `FT_Get_MM_Var'.
- On platforms using the `configure' script, the installed
`ftoption.h' file now correctly reflects configuration options
like `--with-harfbuzz'.
- Better support to build FreeType as a DLL on Windows using
Visual C.
- All data specific to driver modules is now collected in a single
file, `FT_DRIVER_H'. Consequently, the macros
`FT_AUTOHINTER_H', `FT_CFF_DRIVER_H', `FT_TRUETYPE_DRIVER_H',
and `FT_PCF_DRIVER_H' still work but are deprecated.
- Some fuzzer fixes to better reject malformed fonts.
- The `ftbench' demo program has a new test for opening a new face
and loading some glyphs.
- The `ftbench' demo program has a new option `-j' to specify the
last glyph index to be used in the tests.
- The `ftgrid' demo program has a new option `-n' to suppress
display of named instances of variation fonts.
- The `ttdebug' demo program can now show a stack trace (key `K')
and switch between hexadecimal and decimal display of integers
(key `I').
======================================================================
CHANGES BETWEEN 2.8 and 2.8.1
I. IMPORTANT BUG FIXES
- B/W hinting of TrueType fonts didn't work properly if
interpreter version 38 or 40 was selected.
- Some severe problems within the handling of TrueType Variation
Fonts were found and fixed.
- Function `FT_Set_Var_Design_Coordinates' didn't correctly handle
the case with less input coordinates than axes.
II. IMPORTANT CHANGES
- By default, FreeType now offers high quality LCD-optimized
output without resorting to ClearType techniques of resolution
tripling and filtering. In this method, called Harmony, each
color channel is generated separately after shifting the glyph
outline, capitalizing on the fact that the color grids on LCD
panels are shifted by a third of a pixel. This output is
indistinguishable from ClearType with a light 3-tap filter.
III. MISCELLANEOUS
- Using the new function `FT_Get_Var_Axis_Flags', an application
can access the `flags' field of a variation axis (introduced in
OpenType version 1.8.2)
- More sanity checks.
- The internal representation of buffers for LCD rendering has
changed (to be more precise, the amount of padding gets computed
differently). Applications that use the FreeType API are not
affected.
- To reset all design axis values of a variation font to its
default values you can now say
error = FT_Set_Var_Design_Coordinates( face, 0, NULL );
This also works with functions `FT_Set_MM_Design_Coordinates'
and `FT_Set_MM_Blend_Coordinates'.
- FreeType now synthesizes a missing Unicode cmap for (older)
TrueType fonts also if glyph names are available.
- FreeType has improved handling of BDF fonts without the
`POINT_SIZE', `RESOLUTION_X', or `RESOLUTION_Y' properties; the
library now uses the values of the `SIZE' keyword if they are
missing. Previously, `SIZE' was completely ignored, and
FreeType used heuristic values instead.
- Multiple calls to `FT_Bitmap_Convert' do work now as advertised.
Previously, they failed with an assertion error if there was an
empty bitmap between non-empty ones.
- The warping option has moved from `light' to `normal' hinting
where it replaces the original hinting algorithm. The `light'
mode is now always void of any hinting in x-direction.
- 16bit compiler support is now officially ended. We didn't
provide any maintenance since many years, and given that there
were no error or problem reports either it seems that it is no
longer needed.
- The `ftgrid' demo program can now toggle the display of grid
lines with the `G' key.
- The `ftgrid' demo program can toggle a different set of colors
(suitable to color-blind people) with the `C' key.
- The `ftgrid' demo program now supports the `-e' command line
option to select a cmap.
- The `ftdump' demo program has a new command line option `-t' to
output the SFNT table list.
======================================================================
CHANGES BETWEEN 2.7.1 and 2.8
I. IMPORTANT CHANGES
- Support for OpenType Variation Fonts is now complete. The last
missing part was handling the `VVAR' and `MVAR' tables, which is
available with this release.
- A new function `FT_Face_Properties' allows the control of some
module and library properties per font. Currently, the
following properties can be handled: stem darkening, LCD filter
weights, and the random seed for the `random' CFF operator.
- The PCF change to show more `colourful' family names (introduced
in version 2.7.1) was too radical; it can now be configured with
PCF_CONFIG_OPTION_LONG_FAMILY_NAMES at compile time. If
activated, it can be switched off at run time with the new pcf
property `no-long-family-names'. If the `FREETYPE_PROPERTIES'
environment variable is available, you can say
FREETYPE_PROPERTIES=pcf:no-long-family-names=1
- Support for the following scripts has been added to the
auto-hinter.
Adlam, Avestan, Bamum, Buhid, Carian, Chakma, Coptic, Cypriot,
Deseret, Glagolitic, Gothic, Kayah, Lisu, N'Ko, Ol Chiki, Old
Turkic, Osage, Osmanya, Saurashtra, Shavian, Sundanese, Tai
Viet, Tifinagh, Unified Canadian Syllabics, Vai
II. IMPORTANT BUG FIXES
- `Light' auto-hinting mode no longer uses TrueType metrics for
TrueType fonts. This bug was introduced in version 2.4.6,
causing horizontal scaling also. Almost all GNU/Linux
distributions (with Fedora as a notable exception) disabled the
corresponding patch for good reasons; chances are thus high that
you won't notice a difference.
If optical backward compatibility for legacy applications is
necessary, you might enable the AF_CONFIG_OPTION_TT_SIZE_METRICS
configuration option. However, it is strongly recommended to
avoid that, adjusting font sizes instead.
- Global size metrics values in the `FT_Size_Metrics' structure
can be different for TrueType fonts. Reason is that in older
FreeType versions the metrics were rounded differently to
integer pixels compared to all other font formats, yielding an
inconsistent behaviour if you used non-native hinting. Starting
with this version, global size metrics for TrueType fonts are
handled the same as other font formats: `ascender' gets rounded
up, `descender' gets rounded down, `height' gets normally
rounded, and `max_advance' gets normally rounded, too.
If you need more precise values of (global) ascender, descender,
height, or `max_advance', please take the corresponding values
from the `FT_Face' structure and scale them manually.
- If a TrueType font gets loaded with FT_LOAD_NO_HINTING, FreeType
now scales the font linearly again (bug introduced in version
2.4.6).
- CVE-2017-8105, CVE-2017-8287: Older FreeType versions have
out-of-bounds writes caused by heap-based buffer overflows
related to Type 1 fonts.
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8105
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8287
III. MISCELLANEOUS
- A new function `FT_Set_Default_Properties' has been added to
parse the `FREETYPE_PROPERTIES' environment variable
(previously, it was internal only). `FT_Init_FreeType' always
call this function, but `FT_New_Library' does not (similar to
`FT_Add_Default_Modules').
- To be in sync with OpenType version 1.7 and newer, macros
FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY,
FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY,
TT_NAME_ID_PREFERRED_FAMILY
TT_NAME_ID_PREFERRED_SUBFAMILY
are renamed to
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY,
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY,
TT_NAME_ID_TYPOGRAPHIC_FAMILY
TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY
The old macro names are deprecated (but still available).
- Support for SFNT `name' tables has been improved.
. Format 1 `name' tables are now supported. Use new function
`FT_Get_Sfnt_LangTag' to access associated language tags.
. Language, encoding, and name IDs have been updated to OpenType
version 1.8.1.
- The new CFF engine now handles the `random' operator. All CFF
opcodes are now supported.
- The CFF module has a new property `random-seed' to control the
pseudo-random number generation for the `random' operator.
- The `freetype-config' script is now a wrapper of `pkg-config' if
this program is available in the path.
- FT_LOAD_TARGET_LCD is now a variant of FT_LOAD_TARGET_LIGHT;
this should provide better rendering results.
- A mode to display light auto-hinting with subpixel positioning
has been added to `ftdiff'.
======================================================================
CHANGES BETWEEN 2.7 and 2.7.1
I. IMPORTANT CHANGES
- Support for the new CFF2 font format as introduced with OpenType
1.8 has been contributed by Dave Arnolds from Adobe.
- Preliminary support for variation fonts as specified in OpenType
1.8 (in addition to the already existing support for Adobe's MM
and Apple's GX formats). Dave Arnolds contributed handling of
advance width change variation; more will come in the next
version.
II. IMPORTANT BUG FIXES
- Handling of raw CID fonts was partially broken (bug introduced
in 2.6.4).
- CVE-2016-10328: Older FreeType versions had an out-of-bounds
write caused by a heap-based buffer overflow related to the CFF
fonts.
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10328
III. MISCELLANEOUS
- Some limits for TrueType bytecode execution have been tightened
to speed up FreeType's handling of malformed fonts, in
particular to quickly abort endless loops.
- The number of twilight points can no longer be set to an
arbitrarily large value.
- The total number of jump opcode instructions (like JMPR) with
negative arguments is dynamically restricted; the same holds
for the total number of iterations in LOOPCALL opcodes.
The dynamic limits are based on the number of points in a glyph
and the number of CVT entries. Please report if you encounter a
font where the selected values are not adequate.
- PCF family names are made more `colourful'; they now include the
foundry and information whether they contain wide characters.
For example, you no longer get `Fixed' but rather `Sony Fixed'
or `Misc Fixed Wide'.
- A new function `FT_Get_Var_Blend_Coordinates' (with its alias
name `FT_Get_MM_Blend_Coordinates') to retrieve the normalized
blend coordinates of the currently selected variation instance
has been added to the Multiple Masters interface.
- A new function `FT_Get_Var_Design_Coordinates' to retrieve the
design coordinates of the currently selected variation instance
has been added to the Multiple Masters interface.
- A new load flag `FT_LOAD_BITMAP_METRICS_ONLY' to retrieve bitmap
information without loading the (embedded) bitmap itself.
- Retrieving advance widths from bitmap strikes (using
`FT_Get_Advance' and `FT_Get_Advances') have been sped up.
- The usual round of fuzzer fixes to better reject malformed
fonts.
- The `ftmulti' demo program can now switch engines with key `H'.
- The `ftstring' demo program can now show some built-in,
non-latin sample strings (to be selected with the TAB key).
- The `ftview' demo program can now switch between a font's
charmaps using the TAB key.
======================================================================
CHANGES BETWEEN 2.6.5 and 2.7
I. IMPORTANT CHANGES
- As announced earlier, the 2.7.x series now uses the new subpixel
hinting mode as the default, emulating a modern version of
ClearType.
This change inevitably leads to different rendering results, and
you might change the `TT_CONFIG_OPTION_SUBPIXEL_HINTING'
configuration option to adapt it to your taste (or use the new
`FREETYPE_PROPERTIES' environment variable). See the
corresponding entry below for version 2.6.4, which gives more
information.
- A new option `FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES' has been
introduced. If set (which is the default), an environment
variable `FREETYPE_PROPERTIES' can be used to control driver
properties. Example:
FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
cff:no-stem-darkening=1 \
autofitter:warping=1
This allows to select, say, the subpixel hinting mode at runtime
for a given application. See file `ftoption.h' for more.
II. IMPORTANT BUG FIXES
- After loading a named instance of a GX variation font, the
`face_index' value in the returned `FT_Face' structure now
correctly holds the named instance index in the upper 16bits as
documented.
III. MISCELLANEOUS
- A new macro `FT_IS_NAMED_INSTANCE' to test whether a given face
is a named instance.
- More fixes to GX font handling.
- Apple's `GETVARIATION' bytecode operator (needed for GX
variation font support) has been implemented.
- Another round of fuzzer fixes, mainly to reject invalid fonts
faster.
- Handling of raw CID fonts was broken (bug introduced in version
2.6.4).
- The smooth rasterizer has been streamlined to make it faster by
approx. 20%.
- The `ftgrid' demo program now understands command line option
`-d' to give start-up design coordinates.
- The `ftdump' demo program has a new command line option `-p' to
dump TrueType bytecode instructions.
======================================================================
CHANGES BETWEEN 2.6.4 and 2.6.5
I. IMPORTANT BUG FIXES
- Compilation works again on Mac OS X (bug introduced in version
2.6.4).
II. IMPORTANT CHANGES
- The new subpixel hinting mode is now disabled by default; it
will be enabled by default in the forthcoming 2.7.x series.
Main reason for reverting this feature is the principle of least
surprise: a sudden change in appearance of all fonts (even if
the rendering improves for almost all recent fonts) should not
be expected in a new micro version of a series.
======================================================================
CHANGES BETWEEN 2.6.3 and 2.6.4
I. IMPORTANT CHANGES
- A new subpixel hinting mode has been contributed by Nikolaus
Waxweiler, which is now the default rendering mode for TrueType
fonts. It implements (almost everything of) version 40 of the
bytecode engine.
The existing code base in FreeType (the `Infinality code') was
stripped to the bare minimum and all configurability removed in
the name of speed and simplicity. The configurability was
mainly aimed at legacy fonts like Arial, Times New Roman, or
Courier. [Legacy fonts are fonts that modify vertical stems to
achieve clean black-and-white bitmaps.] The new mode focuses on
applying a minimal set of rules to all fonts indiscriminately so
that modern and web fonts render well while legacy fonts render
okay.
Activation of the subpixel hinting support can be controlled
with the `TT_CONFIG_OPTION_SUBPIXEL_HINTING' configuration
option at compile time: If set to value 1, you get the old
Infinality mode (which was never the default due to its
slowness). Value 2 activates the new subpixel hinting mode, and
value 3 activates both. The default is value 2.
At run time, you can select the subpixel hinting mode with the
`interpreter-version' property (provided you have compiled in
the corresponding hinting mode); see `ftttdrv.h' for more.
- Support for the following scripts has been added to the
auto-hinter.
Armenian, Cherokee, Ethiopic, Georgian, Gujarati, Gurmukhi,
Malayalam, Sinhala, Tamil
II. MISCELLANEOUS
- Type 42 fonts as created by LilyPond are now supported.
- Minor rendering improvements in the auto-hinter.
- For experimental reasons, the old CFF engine now supports all
CFF operators except `random', including the deprecated Multiple
Masters instructions. This allows the display of fonts like
`ITCGaramondMM-It.otf' (without font variations, though).
- Another round of fixes to improve handling of invalid fonts.
- The `ftgrid' demo program now displays the rendered pixels also;
this can be switched off with the `b' key. Selection of various
LCD filtering modes can be done with the `L' key.
- The demo programs have been extended to allow selection of all
available TrueType bytecode engines.
- A very early beta version of a new, Qt based demo program called
`ftinspect' is part of the source code bundle; it will
eventually supersede the other demo programs. Currently, you
have to compile it manually with `qmake; make'; note that many
features are still missing.
======================================================================
CHANGES BETWEEN 2.6.2 and 2.6.3
I. IMPORTANT CHANGES
- Khmer, Myanmar, Bengali, and Kannada script support has been
added to the auto-hinter.
II. MISCELLANEOUS
- Better support of Indic scripts like Devanagari by using a
top-to-bottom hinting flow.
- All FreeType macros starting with two underscores have been
renamed to avoid a violation of both the C and C++ standards.
Example: Header macros of the form `__FOO_H__' are now called
`FOO_H_'. In most cases, this should be completely transparent
to the user. The exception to this is `__FTERRORS_H__', which
must be sometimes undefined by the user to get FreeType error
strings: Both this form and the new `FTERRORS_H_' macro are
accepted for backward compatibility.
- Minor improvements mainly to the Type 1 driver.
- The new CFF engine now supports all Type 2 operators except
`random'.
- The macro `_STANDALONE_', used for compiling the B/W and smooth
rasterizers as stand-alone modules, has been renamed to
`STANDALONE_', since macro names starting with an underscore and
followed by an uppercase letter are reserved in both C and C++.
- Function `FT_Library_SetLcdFilterWeights' now also activates
custom LCD filter weights (instead of just adjusting them).
- Support for `unpatented hinting' has been completely removed:
Consequently, the two functions `FT_Face_CheckTrueTypePatents'
and `FT_Face_SetUnpatentedHinting' now return always false,
doing nothing.
- The `ftgamma' demo program has been modernized; the gamma grid
display has been moved from `ftview' to this program.
- In `ftview', it is now possible to cycle through the available
LCD filtering modes.
======================================================================
CHANGES BETWEEN 2.6.1 and 2.6.2
I. IMPORTANT CHANGES
- The auto-hinter now supports stem darkening, to be controlled by
the new `no-stem-darkening' and `darkening-parameters'
properties. This is an experimental feature contributed by
Nikolaus Waxweiler, and the interface might change in a future
release.
- By default, stem darkening is now switched off (for both the CFF
engine and the auto-hinter). The main reason is that you need
linear alpha blending and gamma correction to get correct
rendering results, and the latter is not yet available in most
freely available rendering stacks like X11. Applying stem
darkening without proper gamma correction leads to far too dark
rendering results.
- The meaning of `FT_RENDER_MODE_LIGHT' has been slightly
modified. It now essentially means `no hinting along the
horizontal axis'; in particular, no change of glyph advance
widths. Consequently, the auto-hinter is used for all scalable
font formats except for CFF. It is planned that other
font-specific rendering engines (TrueType, Type 1) will follow.
II. MISCELLANEOUS
- The default LCD filter has been changed to be normalized and
color-balanced.
- For better compatibility with FontConfig, function
`FT_Library_SetLcdFilter' accepts a new enumeration value
`FT_LCD_FILTER_LEGACY1' (which has the same meaning as
`FT_LCD_FILTER_LEGACY').
- A large number of bugs have been detected by using the libFuzzer
framework, which should further improve handling of invalid
fonts. Thanks again to Kostya Serebryany and Bungeman!
- `TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES', a new configuration
option, controls the maximum number of executed opcodes within a
bytecode program. You don't want to change this except for very
special situations (e.g., making a library fuzzer spend less
time to handle broken fonts).
- The smooth renderer has been made faster.
- The `ftstring' demo program now supports subpixel rendering; use
key `l' to cycle through the LCD modes.
- The `ftstring' demo program now supports colour rendering; use
the `space' key to cycle through various colour combinations.
- The graphical demo programs now use a default gamma value of 1.8
(instead of 1.2).
======================================================================
CHANGES BETWEEN 2.6 and 2.6.1
I. IMPORTANT BUG FIXES
@ -150,17 +828,17 @@ CHANGES BETWEEN 2.5.5 and 2.6
compiler warnings.
- Function `FT_Bitmap_New' has been renamed to `FT_Bitmap_Init',
since this name better reflects its function. For backwards
since this name better reflects its function. For backward
compatibility, the old function name is still available.
- Function `FT_Get_X11_Font_Format' has been renamed to
`FT_Get_Font_Format', since this name better reflects its
function. For backwards compatibility, the old function name is
function. For backward compatibility, the old function name is
still available.
Additionally, the header file macro for this function has been
renamed to `FT_FONT_FORMATS_H' (the old name `FT_XFREE86_H' is
retained for backwards compatibility).
retained for backward compatibility).
- Various improvements to the `ftgrid' demo program.
@ -200,7 +878,7 @@ 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
(cf. https://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
@ -271,7 +949,7 @@ CHANGES BETWEEN 2.5.2 and 2.5.3
I. IMPORTANT BUG FIXES
- A vulnerability (CVE-2014-2240) was identified and fixed in the
new CFF driver (cf. http://savannah.nongnu.org/bugs/?41697).
new CFF driver (cf. https://savannah.nongnu.org/bugs/?41697).
All users should upgrade.
- More bug fixes related to correct positioning of composite
@ -304,7 +982,7 @@ CHANGES BETWEEN 2.5.2 and 2.5.3
and install FreeType again.
With FreeType's `configure' script the procedure boils down to
configure, build, and install Freetype, then configure, compile,
configure, build, and install FreeType, then configure, compile,
and install HarfBuzz, then configure, compile, and install
FreeType again (after executing `make distclean').
@ -594,7 +1272,7 @@ index ebcf189..3f2ce6b 100644
II. MISCELLANEOUS
- The (top-level) `configure' script now respects the MAKE
environment variable to specify a `make' binary. For backwards
environment variable to specify a `make' binary. For backward
compatibility, GNUMAKE still overrides MAKE, though.
- The `ftview' and `ftdiff' demo programs have been redesigned,
@ -643,7 +1321,7 @@ CHANGES BETWEEN 2.4.10 and 2.4.11
- Subpixel hinting support has been contributed by Infinality,
based on Greg Hitchcock's whitepaper at
http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
Originally, it was a separate patch available from
@ -1513,7 +2191,7 @@ CHANGES BETWEEN 2.3.0 and 2.2.1
of the library, mainly due to patent issues. For more
information see:
http://lists.gnu.org/archive/html/freetype/2006-09/msg00064.html
https://lists.gnu.org/archive/html/freetype/2006-09/msg00064.html
A new configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING
has been introduced in `ftoption.h'; manually define it in this
@ -1616,7 +2294,7 @@ CHANGES BETWEEN 2.2 and 2.1.10
We provide patches for most of those rogue clients. See the
following page for more information:
http://www.freetype.org/freetype2/patches/rogue-patches.html
https://www.freetype.org/freetype2/patches/rogue-patches.html
Note that, as a convenience to our Unix desktop users, version
2.2 is *binary* compatible with FreeType 2.1.7, which means that
@ -1728,7 +2406,7 @@ CHANGES BETWEEN 2.2 and 2.1.10
- Rudimentary support for Adobe's new `SING Glyphlet' format. See
http://www.adobe.com/products/indesign/sing_gaiji.html
https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5148.SING_Tutorial.pdf
for more information.
@ -1813,7 +2491,7 @@ CHANGES BETWEEN 2.1.10 and 2.1.9
probably using a different pitch, and to further manipulate it.
- A new API `FT_Outline_Embolden' (in FT_OUTLINE_H) gives finer
control how outlines are embolded.
control how outlines are emboldened.
- `FT_GlyphSlot_Embolden' (in FT_SYNTHESIS_H) now handles bitmaps
also (code contributed by Chia I Wu). Note that this function
@ -1932,7 +2610,7 @@ CHANGES BETWEEN 2.1.8 and 2.1.7
correctly treated as a CID, similar to FreeType's CID driver
module. Note that CID CMap support is still missing.
- The FT_FACE_FLAGS_GLYPH_NAMES flag is now set correctly for all
- The FT_FACE_FLAG_GLYPH_NAMES flag is now set correctly for all
font formats.
- Some subsetted Type 1 fonts weren't parsed correctly. This bug
@ -2223,7 +2901,7 @@ CHANGES BETWEEN 2.1.5 and 2.1.4
- FT_ENCODING_MS_{SJIS,GB2312,BIG5,WANSUNG,JOHAB} are now
deprecated in favour of
FT_ENCODING_{SJIS,GB2312,GIB5,WANSONG,JOHAB} -- those encodings
FT_ENCODING_{SJIS,GB2312,BIG5,WANSUNG,JOHAB} -- those encodings
are not specific to Microsoft.
@ -2405,7 +3083,7 @@ CHANGES BETWEEN 2.1.3 and 2.1.2
quality since many nasty defaults have been suppressed. Please
visit the web page:
http://www.freetype.org/hinting/smooth-hinting.html
https://www.freetype.org/hinting/smooth-hinting.html
for additional details on this topic.
@ -2425,12 +3103,12 @@ CHANGES BETWEEN 2.1.3 and 2.1.2
FT_LOAD_TARGET_MONO :: Hint and render for 1-bit displays.
FT_LOAD_TARGET_LCD :: Hint and render for horizontal RGB or
BGR sub-pixel displays (like LCD
BGR subpixel displays (like LCD
screens). THIS IS STILL
EXPERIMENTAL!
FT_LOAD_TARGET_LCD_V :: Same as FT_LOAD_TARGET_LCD, for
vertical sub-pixel displays (like
vertical subpixel displays (like
rotated LCD screens). THIS IS STILL
EXPERIMENTAL!
@ -2664,7 +3342,7 @@ CHANGES BETWEEN 2.1.0 and 2.0.9
- The FreeType 2 redesign has begun. More information can be
found at this URL:
http://www.freetype.org/freetype2/redesign.html
https://www.freetype.org/freetype2/redesign.html
The following internal changes have been performed within the
sources of this release:
@ -3255,13 +3933,7 @@ CHANGES BETWEEN 2.0.2 and 2.0.1
For more information, see section I of the following document:
http://www.freetype.org/
freetype2/docs/tutorial/step1.html
or
http://freetype.sourceforge.net/
freetype2/docs/tutorial/step1.html
https://www.freetype.org/freetype2/docs/tutorial/step1.html
- Many, many comments have been added to the public source file in
order to automatically generate the API Reference through the
@ -3270,7 +3942,7 @@ CHANGES BETWEEN 2.0.2 and 2.0.1
The latter has been updated to support the grouping of sections
in chapters and better index sort. See:
http://www.freetype.org/freetype2/docs/reference/ft2-toc.html
https://www.freetype.org/freetype2/docs/reference/ft2-toc.html
III. CHANGES TO THE BUILD PROCESS
@ -3644,7 +4316,7 @@ BETA-8 (RELEASE CANDIDATE) CHANGES
automatically when needed.
- Reformatted all modules source code in order to get rid of the
basic data types redifinitions (i.e. `TT_Int' instead of `FT_Int',
basic data types redefinitions (i.e. `TT_Int' instead of `FT_Int',
`T1_Fixed' instead of `FT_Fixed'). Hence the format-specific
prefixes like `TT_', `T1_', `T2_' and `CID_' are only used for
relevant structures.
@ -4345,7 +5017,7 @@ Extensions support:
------------------------------------------------------------------------
Copyright 2000-2015 by
Copyright 2000-2018 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -117,15 +117,15 @@ IV. Overriding default configuration and module headers
name the configuration headers. To do so, you need a custom
`ft2build.h' whose content can be as simple as:
#ifndef __FT2_BUILD_MY_PLATFORM_H__
#define __FT2_BUILD_MY_PLATFORM_H__
#ifndef FT2_BUILD_MY_PLATFORM_H_
#define FT2_BUILD_MY_PLATFORM_H_
#define FT_CONFIG_OPTIONS_H <custom/my-ftoption.h>
#define FT_CONFIG_MODULES_H <custom/my-ftmodule.h>
#include <freetype/config/ftheader.h>
#endif /* __FT2_BUILD_MY_PLATFORM_H__ */
#endif /* FT2_BUILD_MY_PLATFORM_H_ */
Place those files in a separate directory, e.g.,
@ -139,7 +139,7 @@ IV. Overriding default configuration and module headers
----------------------------------------------------------------------
Copyright 2003-2015 by
Copyright 2003-2018 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -6,7 +6,7 @@ I. Configuration macros
There are several ways to enable debugging features in a FreeType 2
builds. This is controlled through the definition of special macros
located in the file `ftoptions.h'. The macros are:
located in the file `ftoption.h'. The macros are:
FT_DEBUG_LEVEL_ERROR
@ -191,7 +191,7 @@ behaviour of FreeType at runtime.
------------------------------------------------------------------------
Copyright 2002-2015 by
Copyright 2002-2018 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -48,7 +48,7 @@ Introduction
encourage you to use the following text:
"""
Portions of this software are copyright © <year> The FreeType
Portions of this software are copyright © <year> The FreeType
Project (www.freetype.org). All rights reserved.
"""
@ -163,7 +163,7 @@ Legal Terms
Our home page can be found at
http://www.freetype.org
https://www.freetype.org
--- end of FTL.TXT ---

View File

@ -23,9 +23,11 @@ any of your projects or products.
GPL. Note that the FTL is incompatible with GPLv2 due to its
advertisement clause.
The contributed BDF and PCF drivers come with a license similar to that
The contributed BDF and PCF drivers come with a license similar to that
of the X Window System. It is compatible to the above two licenses (see
file src/bdf/README and src/pcf/README).
file src/bdf/README and src/pcf/README). The same holds for the files
`fthash.c' and `fthash.h'; their code was part of the BDF driver in
earlier FreeType versions.
The gzip module uses the zlib license (see src/gzip/zlib.h) which too is
compatible to the above two licenses.

View File

@ -27,7 +27,7 @@ Other bugs have been registered at the savannah bugzilla of FreeType.
------------------------------------------------------------------------
Copyright 2001-2015 by
Copyright 2001-2018 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
/* */
/* ANSI-specific configuration file (specification only). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -35,8 +35,8 @@
/* */
/*************************************************************************/
#ifndef __FTCONFIG_H__
#define __FTCONFIG_H__
#ifndef FTCONFIG_H_
#define FTCONFIG_H_
#include <ft2build.h>
#include FT_CONFIG_OPTIONS_H
@ -73,11 +73,11 @@ FT_BEGIN_HEADER
/* The size of an `int' type. */
#if FT_UINT_MAX == 0xFFFFUL
#define FT_SIZEOF_INT (16 / FT_CHAR_BIT)
#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
#elif FT_UINT_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_INT (32 / FT_CHAR_BIT)
#define FT_SIZEOF_INT ( 32 / FT_CHAR_BIT )
#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
#define FT_SIZEOF_INT (64 / FT_CHAR_BIT)
#define FT_SIZEOF_INT ( 64 / FT_CHAR_BIT )
#else
#error "Unsupported size of `int' type!"
#endif
@ -85,11 +85,11 @@ FT_BEGIN_HEADER
/* The size of a `long' type. A five-byte `long' (as used e.g. on the */
/* DM642) is recognized but avoided. */
#if FT_ULONG_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
#define FT_SIZEOF_LONG (64 / FT_CHAR_BIT)
#define FT_SIZEOF_LONG ( 64 / FT_CHAR_BIT )
#else
#error "Unsupported size of `long' type!"
#endif
@ -143,6 +143,14 @@ FT_BEGIN_HEADER
#endif
/* Fix compiler warning with sgi compiler */
#if defined( __sgi ) && !defined( __GNUC__ )
#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
#pragma set woff 3505
#endif
#endif
/*************************************************************************/
/* */
/* <Section> */
@ -228,12 +236,12 @@ FT_BEGIN_HEADER
#endif
#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)
#if FT_SIZEOF_INT == ( 32 / FT_CHAR_BIT )
typedef signed int FT_Int32;
typedef unsigned int FT_UInt32;
#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)
#elif FT_SIZEOF_LONG == ( 32 / FT_CHAR_BIT )
typedef signed long FT_Int32;
typedef unsigned long FT_UInt32;
@ -244,12 +252,12 @@ FT_BEGIN_HEADER
/* look up an integer type that is at least 32 bits */
#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)
#if FT_SIZEOF_INT >= ( 32 / FT_CHAR_BIT )
typedef int FT_Fast;
typedef unsigned int FT_UFast;
#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)
#elif FT_SIZEOF_LONG >= ( 32 / FT_CHAR_BIT )
typedef long FT_Fast;
typedef unsigned long FT_UFast;
@ -259,7 +267,7 @@ FT_BEGIN_HEADER
/* determine whether we have a 64-bit int type for platforms without */
/* Autoconf */
#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)
#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
/* FT_LONG64 must be defined if a 64-bit type is available */
#define FT_LONG64
@ -275,7 +283,13 @@ FT_BEGIN_HEADER
/* */
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
#define FT_LONG64
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
/* this compiler provides the __int64 type */
#define FT_LONG64
@ -309,7 +323,7 @@ FT_BEGIN_HEADER
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#endif /* _MSC_VER */
#endif /* __STDC_VERSION__ >= 199901L */
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
@ -319,6 +333,15 @@ FT_BEGIN_HEADER
#endif
#ifdef _WIN64
/* only 64bit Windows uses the LLP64 data model, i.e., */
/* 32bit integers, 64bit pointers */
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned __int64)(x)
#else
#define FT_UINT_TO_POINTER( x ) (void*)(unsigned long)(x)
#endif
/*************************************************************************/
/* */
/* miscellaneous */
@ -332,15 +355,24 @@ FT_BEGIN_HEADER
/* typeof condition taken from gnulib's `intprops.h' header file */
#if ( __GNUC__ >= 2 || \
defined( __IBM__TYPEOF__ ) || \
( __SUNPRO_C >= 0x5110 && !__STDC__ ) )
#define FT_TYPEOF( type ) (__typeof__ (type))
#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
defined( __IBM__TYPEOF__ ) ) || \
( defined( __SUNPRO_C ) && __SUNPRO_C >= 0x5110 && !__STDC__ ) )
#define FT_TYPEOF( type ) ( __typeof__ ( type ) )
#else
#define FT_TYPEOF( type ) /* empty */
#endif
/* Use FT_LOCAL and FT_LOCAL_DEF to declare and define, respectively, */
/* a function that gets used only within the scope of a module. */
/* Normally, both the header and source code files for such a */
/* function are within a single module directory. */
/* */
/* Intra-module arrays should be tagged with FT_LOCAL_ARRAY and */
/* FT_LOCAL_ARRAY_DEF. */
/* */
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
#define FT_LOCAL( x ) static x
@ -362,6 +394,12 @@ FT_BEGIN_HEADER
#define FT_LOCAL_ARRAY_DEF( x ) const x
/* Use FT_BASE and FT_BASE_DEF to declare and define, respectively, */
/* functions that are used in more than a single module. In the */
/* current setup this implies that the declaration is in a header */
/* file in the `include/freetype/internal' directory, and the */
/* function body is in a file in `src/base'. */
/* */
#ifndef FT_BASE
#ifdef __cplusplus
@ -384,14 +422,63 @@ FT_BEGIN_HEADER
#endif /* !FT_BASE_DEF */
/* When compiling FreeType as a DLL or DSO with hidden visibility */
/* some systems/compilers need a special attribute in front OR after */
/* the return type of function declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
/* */
/* FT_EXPORT( return_type ) */
/* */
/* is used in a function declaration, as in */
/* */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* */
/* */
/* FT_EXPORT_DEF( return_type ) */
/* */
/* is used in a function definition, as in */
/* */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* */
/* You can provide your own implementation of FT_EXPORT and */
/* FT_EXPORT_DEF here if you want. */
/* */
/* To export a variable, use FT_EXPORT_VAR. */
/* */
#ifndef FT_EXPORT
#ifdef __cplusplus
#ifdef FT2_BUILD_LIBRARY
#if defined( _WIN32 ) && ( defined( _DLL ) || defined( DLL_EXPORT ) )
#define FT_EXPORT( x ) __declspec( dllexport ) x
#elif defined( __GNUC__ ) && __GNUC__ >= 4
#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x
#else
#define FT_EXPORT( x ) extern x
#endif
#else
#if defined( FT2_DLLIMPORT )
#define FT_EXPORT( x ) __declspec( dllimport ) x
#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x
#else
#define FT_EXPORT( x ) extern x
#endif
#endif
#endif /* !FT_EXPORT */
@ -416,6 +503,7 @@ FT_BEGIN_HEADER
#endif /* !FT_EXPORT_VAR */
/* The following macros are needed to compile the library with a */
/* C++ compiler and with 16bit compilers. */
/* */
@ -427,7 +515,13 @@ FT_BEGIN_HEADER
/* functions which are accessed by (global) function pointers. */
/* */
/* */
/* FT_CALLBACK_DEF is used to _define_ a callback function. */
/* FT_CALLBACK_DEF is used to _define_ a callback function, */
/* located in the same source code file as the structure that uses */
/* it. */
/* */
/* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
/* and define a callback function, respectively, in a similar way */
/* as FT_BASE and FT_BASE_DEF work. */
/* */
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
/* contains pointers to callback functions. */
@ -447,6 +541,16 @@ FT_BEGIN_HEADER
#endif
#endif /* FT_CALLBACK_DEF */
#ifndef FT_BASE_CALLBACK
#ifdef __cplusplus
#define FT_BASE_CALLBACK( x ) extern "C" x
#define FT_BASE_CALLBACK_DEF( x ) extern "C" x
#else
#define FT_BASE_CALLBACK( x ) extern x
#define FT_BASE_CALLBACK_DEF( x ) x
#endif
#endif /* FT_BASE_CALLBACK */
#ifndef FT_CALLBACK_TABLE
#ifdef __cplusplus
#define FT_CALLBACK_TABLE extern "C"
@ -461,7 +565,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTCONFIG_H__ */
#endif /* FTCONFIG_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Build macros of the FreeType 2 library. */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -15,8 +15,8 @@
/* */
/***************************************************************************/
#ifndef __FT_HEADER_H__
#define __FT_HEADER_H__
#ifndef FTHEADER_H_
#define FTHEADER_H_
/*@***********************************************************************/
@ -315,6 +315,19 @@
#define FT_RENDER_H <freetype/ftrender.h>
/*************************************************************************
*
* @macro:
* FT_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* structures and macros related to the driver modules.
*
*/
#define FT_DRIVER_H <freetype/ftdriver.h>
/*************************************************************************
*
* @macro:
@ -324,8 +337,10 @@
* A macro used in #include statements to name the file containing
* structures and macros related to the auto-hinting module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_AUTOHINTER_H <freetype/ftautoh.h>
#define FT_AUTOHINTER_H FT_DRIVER_H
/*************************************************************************
@ -337,8 +352,10 @@
* A macro used in #include statements to name the file containing
* structures and macros related to the CFF driver module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_CFF_DRIVER_H <freetype/ftcffdrv.h>
#define FT_CFF_DRIVER_H FT_DRIVER_H
/*************************************************************************
@ -350,8 +367,25 @@
* A macro used in #include statements to name the file containing
* structures and macros related to the TrueType driver module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_TRUETYPE_DRIVER_H <freetype/ftttdrv.h>
#define FT_TRUETYPE_DRIVER_H FT_DRIVER_H
/*************************************************************************
*
* @macro:
* FT_PCF_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* structures and macros related to the PCF driver module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_PCF_DRIVER_H FT_DRIVER_H
/*************************************************************************
@ -541,63 +575,6 @@
#define FT_CACHE_H <freetype/ftcache.h>
/*************************************************************************
*
* @macro:
* FT_CACHE_IMAGE_H
*
* @description:
* 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.
*
*/
#define FT_CACHE_IMAGE_H FT_CACHE_H
/*************************************************************************
*
* @macro:
* FT_CACHE_SMALL_BITMAPS_H
*
* @description:
* 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.
*
*/
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
/*************************************************************************
*
* @macro:
* FT_CACHE_CHARMAP_H
*
* @description:
* 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.
*
*/
#define FT_CACHE_CHARMAP_H FT_CACHE_H
/*************************************************************************
*
* @macro:
@ -747,18 +724,6 @@
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
/*************************************************************************
*
* @macro:
* FT_UNPATENTED_HINTING_H
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
*/
#define FT_UNPATENTED_HINTING_H <freetype/ttunpat.h>
/*************************************************************************
*
* @macro:
@ -766,7 +731,7 @@
*
* @description:
* A macro used in #include statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
* FreeType~2 API which performs incremental glyph loading.
*/
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
@ -797,25 +762,30 @@
/* */
/* These header files don't need to be included by the user. */
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
#define FT_PARAMETER_TAGS_H <freetype/ftparams.h>
/* Deprecated macros. */
#define FT_UNPATENTED_HINTING_H <freetype/ftparams.h>
#define FT_TRUETYPE_UNPATENTED_H <freetype/ftparams.h>
/* FT_CACHE_H is the only header file needed for the cache subsystem. */
#define FT_CACHE_IMAGE_H FT_CACHE_H
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
#define FT_CACHE_CHARMAP_H FT_CACHE_H
/* The internals of the cache sub-system are no longer exposed. We */
/* default to FT_CACHE_H at the moment just in case, but we know of */
/* no rogue client that uses them. */
/* */
#define FT_CACHE_MANAGER_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_CACHE_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_GLYPH_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_IMAGE_H <freetype/ftcache.h>
#define FT_CACHE_INTERNAL_SBITS_H <freetype/ftcache.h>
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h>
#define FT_CACHE_MANAGER_H FT_CACHE_H
#define FT_CACHE_INTERNAL_MRU_H FT_CACHE_H
#define FT_CACHE_INTERNAL_MANAGER_H FT_CACHE_H
#define FT_CACHE_INTERNAL_CACHE_H FT_CACHE_H
#define FT_CACHE_INTERNAL_GLYPH_H FT_CACHE_H
#define FT_CACHE_INTERNAL_IMAGE_H FT_CACHE_H
#define FT_CACHE_INTERNAL_SBITS_H FT_CACHE_H
/*
@ -828,7 +798,7 @@
#endif /* FT2_BUILD_LIBRARY */
#endif /* __FT2_BUILD_H__ */
#endif /* FTHEADER_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* User-selectable configuration macros (specification only). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTOPTION_H__
#define __FTOPTION_H__
#ifndef FTOPTION_H_
#define FTOPTION_H_
#include <ft2build.h>
@ -75,22 +75,52 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*#***********************************************************************/
/* */
/* If you enable this configuration option, FreeType recognizes an */
/* environment variable called `FREETYPE_PROPERTIES', which can be used */
/* to control the various font drivers and modules. The controllable */
/* properties are listed in the section @properties. */
/* */
/* You have to undefine this configuration option on platforms that lack */
/* the concept of environment variables (and thus don't have the */
/* `getenv' function), for example Windows CE. */
/* */
/* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */
/* multiple lines for better readability). */
/* */
/* { */
/* <optional whitespace> */
/* <module-name1> ':' */
/* <property-name1> '=' <property-value1> */
/* <whitespace> */
/* <module-name2> ':' */
/* <property-name2> '=' <property-value2> */
/* ... */
/* } */
/* */
/* Example: */
/* */
/* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */
/* cff:no-stem-darkening=1 \ */
/* autofitter:warping=1 */
/* */
#define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
/*************************************************************************/
/* */
/* Uncomment the line below if you want to activate sub-pixel rendering */
/* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
/* Uncomment the line below if you want to activate LCD rendering */
/* technology similar to ClearType in this build of the library. This */
/* technology triples the resolution in the direction color subpixels. */
/* To mitigate color fringes inherent to this technology, you also need */
/* to explicitly set up LCD filtering. */
/* */
/* Note that this feature is covered by several Microsoft patents */
/* and should not be activated in any default build of the library. */
/* */
/* This macro has no impact on the FreeType API, only on its */
/* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
/* FT_Render_Glyph still generates a bitmap that is 3 times wider than */
/* the original size in case this macro isn't defined; however, each */
/* triplet of subpixels has R=G=B. */
/* */
/* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */
/* When this macro is not defined, FreeType offers alternative LCD */
/* rendering technology that produces excellent output without LCD */
/* filtering. */
/* */
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
@ -184,6 +214,10 @@ FT_BEGIN_HEADER
/* Do not #undef this macro here since the build system might define */
/* it for certain configurations only. */
/* */
/* If you use a build system like cmake or the `configure' script, */
/* options set by those programs have precendence, overwriting the */
/* value here with the configured one. */
/* */
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
@ -200,6 +234,10 @@ FT_BEGIN_HEADER
/* */
/* Define this macro if you want to enable this `feature'. */
/* */
/* If you use a build system like cmake or the `configure' script, */
/* options set by those programs have precendence, overwriting the */
/* value here with the configured one. */
/* */
/* #define FT_CONFIG_OPTION_USE_BZIP2 */
@ -225,6 +263,10 @@ FT_BEGIN_HEADER
/* */
/* Define this macro if you want to enable this `feature'. */
/* */
/* If you use a build system like cmake or the `configure' script, */
/* options set by those programs have precendence, overwriting the */
/* value here with the configured one. */
/* */
/* #define FT_CONFIG_OPTION_USE_PNG */
@ -238,51 +280,13 @@ FT_BEGIN_HEADER
/* */
/* Define this macro if you want to enable this `feature'. */
/* */
/* If you use a build system like cmake or the `configure' script, */
/* options set by those programs have precendence, overwriting the */
/* value here with the configured one. */
/* */
/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */
/*************************************************************************/
/* */
/* DLL export compilation */
/* */
/* When compiling FreeType as a DLL, some systems/compilers need a */
/* special keyword in front OR after the return type of function */
/* declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
/* */
/* FT_EXPORT( return_type ) */
/* */
/* is used in a function declaration, as in */
/* */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* */
/* */
/* FT_EXPORT_DEF( return_type ) */
/* */
/* is used in a function definition, as in */
/* */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* */
/* You can provide your own implementation of FT_EXPORT and */
/* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
/* will be later automatically defined as `extern return_type' to */
/* allow normal compilation. */
/* */
/* Do not #undef these macros here since the build system might define */
/* them for certain configurations only. */
/* */
/* #define FT_EXPORT(x) extern x */
/* #define FT_EXPORT_DEF(x) x */
/*************************************************************************/
/* */
/* Glyph Postscript Names handling */
@ -297,7 +301,7 @@ FT_BEGIN_HEADER
/* */
/* - The TrueType driver will provide its own set of glyph names, */
/* if you build it to support postscript names in the TrueType */
/* `post' table. */
/* `post' table, but will not synthesize a missing Unicode charmap. */
/* */
/* - The Type 1 driver will not be able to synthesize a Unicode */
/* charmap out of the glyphs found in the fonts. */
@ -492,7 +496,21 @@ FT_BEGIN_HEADER
/* code will be used. */
/* */
/* Setting this macro is needed for systems that prohibit address */
/* fixups, such as BREW. */
/* fixups, such as BREW. [Note that standard compilers like gcc or */
/* clang handle PIC generation automatically; you don't have to set */
/* FT_CONFIG_OPTION_PIC, which is only necessary for very special */
/* compilers.] */
/* */
/* Note that FT_CONFIG_OPTION_PIC support is not available for all */
/* modules (see `modules.cfg' for a complete list). For building with */
/* FT_CONFIG_OPTION_PIC support, do the following. */
/* */
/* 0. Clone the repository. */
/* 1. Define FT_CONFIG_OPTION_PIC. */
/* 2. Remove all subdirectories in `src' that don't have */
/* FT_CONFIG_OPTION_PIC support. */
/* 3. Comment out the corresponding modules in `modules.cfg'. */
/* 4. Compile. */
/* */
/* #define FT_CONFIG_OPTION_PIC */
@ -586,73 +604,62 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
/* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
/* replaces the native TrueType hinting mechanism when anything but */
/* FT_RENDER_MODE_MONO is requested. */
/* subpixel hinting support into the TrueType driver. This modifies the */
/* TrueType hinting mechanism when anything but FT_RENDER_MODE_MONO is */
/* requested. */
/* */
/* Enabling this causes the TrueType driver to ignore instructions under */
/* certain conditions. This is done in accordance with the guide here, */
/* with some minor differences: */
/* In particular, it modifies the bytecode interpreter to interpret (or */
/* not) instructions in a certain way so that all TrueType fonts look */
/* like they do in a Windows ClearType (DirectWrite) environment. See */
/* [1] for a technical overview on what this means. See `ttinterp.h' */
/* for more details on the LEAN option. */
/* */
/* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
/* There are three possible values. */
/* */
/* By undefining this, you only compile the code necessary to hint */
/* TrueType glyphs with native TT hinting. */
/* Value 1: */
/* This value is associated with the `Infinality' moniker, */
/* contributed by an individual nicknamed Infinality with the goal of */
/* making TrueType fonts render better than on Windows. A high */
/* amount of configurability and flexibility, down to rules for */
/* single glyphs in fonts, but also very slow. Its experimental and */
/* slow nature and the original developer losing interest meant that */
/* this option was never enabled in default builds. */
/* */
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
/* defined. */
/* The corresponding interpreter version is v38. */
/* */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */
/*************************************************************************/
/* Value 2: */
/* The new default mode for the TrueType driver. The Infinality code */
/* base was stripped to the bare minimum and all configurability */
/* removed in the name of speed and simplicity. The configurability */
/* was mainly aimed at legacy fonts like Arial, Times New Roman, or */
/* Courier. Legacy fonts are fonts that modify vertical stems to */
/* achieve clean black-and-white bitmaps. The new mode focuses on */
/* applying a minimal set of rules to all fonts indiscriminately so */
/* that modern and web fonts render well while legacy fonts render */
/* okay. */
/* */
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
/* of the TrueType bytecode interpreter is used that doesn't implement */
/* any of the patented opcodes and algorithms. The patents related to */
/* TrueType hinting have expired worldwide since May 2010; this option */
/* is now deprecated. */
/* The corresponding interpreter version is v40. */
/* */
/* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
/* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
/* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
/* Value 3: */
/* Compile both, making both v38 and v40 available (the latter is the */
/* default). */
/* */
/* This macro is only useful for a small number of font files (mostly */
/* for Asian scripts) that require bytecode interpretation to properly */
/* load glyphs. For all other fonts, this produces unpleasant results, */
/* thus the unpatented interpreter is never used to load glyphs from */
/* TrueType fonts unless one of the following two options is used. */
/* By undefining these, you get rendering behavior like on Windows */
/* without ClearType, i.e., Windows XP without ClearType enabled and */
/* Win9x (interpreter version v35). Or not, depending on how much */
/* hinting blood and testing tears the font designer put into a given */
/* font. If you define one or both subpixel hinting options, you can */
/* switch between between v35 and the ones you define (using */
/* `FT_Property_Set'). */
/* */
/* - The unpatented interpreter is explicitly activated by the user */
/* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
/* when opening the FT_Face. */
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
/* defined. */
/* */
/* - FreeType detects that the FT_Face corresponds to one of the */
/* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
/* contains a hard-coded list of font names and other matching */
/* parameters (see function `tt_face_init' in file */
/* `src/truetype/ttobjs.c'). */
/* [1] https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
/* */
/* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
/* */
/* { */
/* FT_Parameter parameter; */
/* FT_Open_Args open_args; */
/* */
/* */
/* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
/* */
/* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
/* open_args.pathname = my_font_pathname; */
/* open_args.num_params = 1; */
/* open_args.params = &parameter; */
/* */
/* error = FT_Open_Face( library, &open_args, index, &face ); */
/* ... */
/* } */
/* */
/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
/*************************************************************************/
@ -668,7 +675,7 @@ FT_BEGIN_HEADER
/* composite flags array which can be used to disambiguate, but old */
/* fonts will not have them. */
/* */
/* http://www.microsoft.com/typography/otspec/glyf.htm */
/* https://www.microsoft.com/typography/otspec/glyf.htm */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html */
/* */
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
@ -692,6 +699,24 @@ FT_BEGIN_HEADER
#define TT_CONFIG_OPTION_BDF
/*************************************************************************/
/* */
/* Option TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES controls the maximum */
/* number of bytecode instructions executed for a single run of the */
/* bytecode interpreter, needed to prevent infinite loops. You don't */
/* want to change this except for very special situations (e.g., making */
/* a library fuzzer spend less time to handle broken fonts). */
/* */
/* It is not expected that this value is ever modified by a configuring */
/* script; instead, it gets surrounded with #ifndef ... #endif so that */
/* the value can be set as a preprocessor option on the compiler's */
/* command line. */
/* */
#ifndef TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES
#define TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES 1000000L
#endif
/*************************************************************************/
/*************************************************************************/
/**** ****/
@ -747,6 +772,16 @@ FT_BEGIN_HEADER
#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
/*************************************************************************/
/* */
/* T1_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe Type 1 */
/* engine gets compiled into FreeType. If defined, it is possible to */
/* switch between the two engines using the `hinting-engine' property of */
/* the type1 driver module. */
/* */
/* #define T1_CONFIG_OPTION_OLD_ENGINE */
/*************************************************************************/
/*************************************************************************/
/**** ****/
@ -762,8 +797,8 @@ FT_BEGIN_HEADER
/* 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. */
/* `darkening-parameters' property (file `ftdriver.h'), which allows the */
/* control at run-time. */
/* */
/* Do *not* undefine these macros! */
/* */
@ -790,6 +825,33 @@ FT_BEGIN_HEADER
/* #define CFF_CONFIG_OPTION_OLD_ENGINE */
/*************************************************************************/
/*************************************************************************/
/**** ****/
/**** P C F D R I V E R C O N F I G U R A T I O N ****/
/**** ****/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* There are many PCF fonts just called `Fixed' which look completely */
/* different, and which have nothing to do with each other. When */
/* selecting `Fixed' in KDE or Gnome one gets results that appear rather */
/* random, the style changes often if one changes the size and one */
/* cannot select some fonts at all. This option makes the PCF module */
/* prepend the foundry name (plus a space) to the family name. */
/* */
/* We also check whether we have `wide' characters; all put together, we */
/* get family names like `Sony Fixed' or `Misc Fixed Wide'. */
/* */
/* If this option is activated, it can be controlled with the */
/* `no-long-family-names' property of the pcf driver module. */
/* */
/* #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
/*************************************************************************/
/*************************************************************************/
/**** ****/
@ -808,7 +870,9 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* Compile autofit module with Indic script support. */
/* Compile autofit module with fallback Indic script support, covering */
/* some scripts that the `latin' submodule of the autofit module doesn't */
/* (yet) handle. */
/* */
#define AF_CONFIG_OPTION_INDIC
@ -822,11 +886,31 @@ FT_BEGIN_HEADER
/* */
/* This experimental option is active only if the rendering mode is */
/* FT_RENDER_MODE_LIGHT; you can switch warping on and off with the */
/* `warping' property of the auto-hinter (see file `ftautoh.h' for more */
/* `warping' property of the auto-hinter (see file `ftdriver.h' for more */
/* information; by default it is switched off). */
/* */
#define AF_CONFIG_OPTION_USE_WARPER
/*************************************************************************/
/* */
/* Use TrueType-like size metrics for `light' auto-hinting. */
/* */
/* It is strongly recommended to avoid this option, which exists only to */
/* help some legacy applications retain its appearance and behaviour */
/* with respect to auto-hinted TrueType fonts. */
/* */
/* The very reason this option exists at all are GNU/Linux distributions */
/* like Fedora that did not un-patch the following change (which was */
/* present in FreeType between versions 2.4.6 and 2.7.1, inclusive). */
/* */
/* 2011-07-16 Steven Chu <steven.f.chu@gmail.com> */
/* */
/* [truetype] Fix metrics on size request for scalable fonts. */
/* */
/* This problematic commit is now reverted (more or less). */
/* */
/* #define AF_CONFIG_OPTION_TT_SIZE_METRICS */
/* */
@ -838,14 +922,21 @@ FT_BEGIN_HEADER
/*
* This macro is defined if either unpatented or native TrueType
* hinting is requested by the definitions above.
* This macro is defined if native TrueType hinting is requested by the
* definitions above.
*/
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
#undef TT_CONFIG_OPTION_UNPATENTED_HINTING
#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
#define TT_USE_BYTECODE_INTERPRETER
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
#endif
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
#endif
#endif
#endif
@ -880,7 +971,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTOPTION_H__ */
#endif /* FTOPTION_H_ */
/* END */

View File

@ -5,7 +5,7 @@
/* ANSI-specific library and header configuration file (specification */
/* only). */
/* */
/* Copyright 2002-2015 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -23,14 +23,13 @@
/* FreeType normally requires. It also defines macros to rename the */
/* standard functions within the FreeType source code. */
/* */
/* Load a file which defines __FTSTDLIB_H__ before this one to override */
/* it. */
/* Load a file which defines FTSTDLIB_H_ before this one to override it. */
/* */
/*************************************************************************/
#ifndef __FTSTDLIB_H__
#define __FTSTDLIB_H__
#ifndef FTSTDLIB_H_
#define FTSTDLIB_H_
#include <stddef.h>
@ -64,6 +63,7 @@
#define FT_INT_MAX INT_MAX
#define FT_INT_MIN INT_MIN
#define FT_UINT_MAX UINT_MAX
#define FT_LONG_MIN LONG_MIN
#define FT_LONG_MAX LONG_MAX
#define FT_ULONG_MAX ULONG_MAX
@ -142,7 +142,8 @@
/**********************************************************************/
#define ft_atol atol
#define ft_strtol strtol
#define ft_getenv getenv
/**********************************************************************/
@ -168,7 +169,7 @@
#include <stdarg.h>
#endif /* __FTSTDLIB_H__ */
#endif /* FTSTDLIB_H_ */
/* END */

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
/* */
/* Quick computation of advance widths (specification only). */
/* */
/* Copyright 2008-2015 by */
/* Copyright 2008-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTADVANC_H__
#define __FTADVANC_H__
#ifndef FTADVANC_H_
#define FTADVANC_H_
#include <ft2build.h>
@ -181,7 +181,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTADVANC_H__ */
#endif /* FTADVANC_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType exact bbox computation (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -27,8 +27,8 @@
/*************************************************************************/
#ifndef __FTBBOX_H__
#define __FTBBOX_H__
#ifndef FTBBOX_H_
#define FTBBOX_H_
#include <ft2build.h>
@ -61,7 +61,7 @@ FT_BEGIN_HEADER
/* 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 */
/* coincide. Otherwise, the outline Bezier arcs are traversed to */
/* extract their extrema. */
/* */
/* <Input> */
@ -90,7 +90,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTBBOX_H__ */
#endif /* FTBBOX_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing BDF-specific strings (specification). */
/* */
/* Copyright 2002-2015 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTBDF_H__
#define __FTBDF_H__
#ifndef FTBDF_H_
#define FTBDF_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -204,7 +204,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTBDF_H__ */
#endif /* FTBDF_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType utility functions for bitmaps (specification). */
/* */
/* Copyright 2004-2015 by */
/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTBITMAP_H__
#define __FTBITMAP_H__
#ifndef FTBITMAP_H_
#define FTBITMAP_H_
#include <ft2build.h>
@ -97,7 +97,7 @@ FT_BEGIN_HEADER
FT_EXPORT( FT_Error )
FT_Bitmap_Copy( FT_Library library,
const FT_Bitmap *source,
FT_Bitmap *target);
FT_Bitmap *target );
/*************************************************************************/
@ -234,7 +234,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTBITMAP_H__ */
#endif /* FTBITMAP_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Bzip2-compressed stream support. */
/* */
/* Copyright 2010-2015 by */
/* Copyright 2010-2018 by */
/* Joel Klinghed. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTBZIP2_H__
#define __FTBZIP2_H__
#ifndef FTBZIP2_H_
#define FTBZIP2_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -96,7 +96,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTBZIP2_H__ */
#endif /* FTBZIP2_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType Cache subsystem (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTCACHE_H__
#define __FTCACHE_H__
#ifndef FTCACHE_H_
#define FTCACHE_H_
#include <ft2build.h>
@ -540,13 +540,6 @@ FT_BEGIN_HEADER
FTC_FaceID face_id );
/*************************************************************************/
/* */
/* <Section> */
/* cache_subsystem */
/* */
/*************************************************************************/
/*************************************************************************
*
* @type:
@ -623,14 +616,6 @@ FT_BEGIN_HEADER
FT_UInt32 char_code );
/*************************************************************************/
/* */
/* <Section> */
/* cache_subsystem */
/* */
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@ -749,7 +734,7 @@ FT_BEGIN_HEADER
/* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
/* failure. */
/* */
/* anode :: Used to return the address of of the corresponding cache */
/* anode :: Used to return the address of the corresponding cache */
/* node after incrementing its reference count (see note */
/* below). */
/* */
@ -802,7 +787,7 @@ FT_BEGIN_HEADER
/* aglyph :: The corresponding @FT_Glyph object. 0~in case of */
/* failure. */
/* */
/* anode :: Used to return the address of of the corresponding */
/* anode :: Used to return the address of the corresponding */
/* cache node after incrementing its reference count */
/* (see note below). */
/* */
@ -957,7 +942,7 @@ FT_BEGIN_HEADER
/* <Output> */
/* sbit :: A handle to a small bitmap descriptor. */
/* */
/* anode :: Used to return the address of of the corresponding cache */
/* anode :: Used to return the address of the corresponding cache */
/* node after incrementing its reference count (see note */
/* below). */
/* */
@ -1012,7 +997,7 @@ FT_BEGIN_HEADER
/* <Output> */
/* sbit :: A handle to a small bitmap descriptor. */
/* */
/* anode :: Used to return the address of of the corresponding */
/* anode :: Used to return the address of the corresponding */
/* cache node after incrementing its reference count */
/* (see note below). */
/* */
@ -1051,7 +1036,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTCACHE_H__ */
#endif /* FTCACHE_H_ */
/* END */

View File

@ -76,7 +76,11 @@
/* <Sections> */
/* auto_hinter */
/* cff_driver */
/* t1_cid_driver */
/* tt_driver */
/* pcf_driver */
/* properties */
/* parameter_tags */
/* */
/***************************************************************************/

View File

@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing CID font information (specification). */
/* */
/* Copyright 2007-2015 by */
/* Copyright 2007-2018 by */
/* Dereg Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTCID_H__
#define __FTCID_H__
#ifndef FTCID_H_
#define FTCID_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -87,7 +87,7 @@ FT_BEGIN_HEADER
FT_Get_CID_Registry_Ordering_Supplement( FT_Face face,
const char* *registry,
const char* *ordering,
FT_Int *supplement);
FT_Int *supplement );
/**********************************************************************
@ -97,8 +97,8 @@ FT_BEGIN_HEADER
*
* @description:
* 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.
* contrast to the @FT_IS_CID_KEYED macro this function returns
* successfully also for CID-keyed fonts in an SFNT wrapper.
*
* @input:
* face ::
@ -162,7 +162,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTCID_H__ */
#endif /* FTCID_H_ */
/* END */

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
/* */
/* FreeType error codes (specification). */
/* */
/* Copyright 2002-2015 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -231,6 +231,10 @@
"invalid PostScript (post) table format" )
FT_ERRORDEF_( Invalid_Post_Table, 0x9B,
"invalid PostScript (post) table" )
FT_ERRORDEF_( DEF_In_Glyf_Bytecode, 0x9C,
"found FDEF or IDEF opcode in glyf bytecode" )
FT_ERRORDEF_( Missing_Bitmap, 0x9D,
"missing bitmap in strike" )
/* CFF, CID, and Type 1 errors */
@ -243,7 +247,7 @@
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3,
"no Unicode glyph name found" )
FT_ERRORDEF_( Glyph_Too_Big, 0xA4,
"glyph to big for hinting" )
"glyph too big for hinting" )
/* BDF errors */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType error code handling (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -38,15 +38,15 @@
/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
/* defined in `ftoption.h' in order to make the higher byte indicate */
/* the module where the error has happened (this is not compatible */
/* with standard builds of FreeType&nbsp;2, however). See the file */
/* with standard builds of FreeType~2, however). See the file */
/* `ftmoderr.h' for more details. */
/* */
/* *Error* *Message* *Strings* */
/* */
/* Error definitions are set up with special macros that allow client */
/* applications to build a table of error message strings. The */
/* strings are not included in a normal build of FreeType&nbsp;2 to */
/* save space (most client applications do not use them). */
/* strings are not included in a normal build of FreeType~2 to save */
/* space (most client applications do not use them). */
/* */
/* To do so, you have to define the following macros before including */
/* this file. */
@ -72,13 +72,13 @@
/* */
/* This macro ends the list. */
/* */
/* Additionally, you have to undefine `__FTERRORS_H__' before */
/* #including this file. */
/* Additionally, you have to undefine `FTERRORS_H_' before #including */
/* this file. */
/* */
/* Here is a simple example. */
/* */
/* { */
/* #undef __FTERRORS_H__ */
/* #undef FTERRORS_H_ */
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
/* #define FT_ERROR_START_LIST { */
/* #define FT_ERROR_END_LIST { 0, NULL } }; */
@ -99,7 +99,17 @@
/* */
#ifndef __FTERRORS_H__
/* In previous FreeType versions we used `__FTERRORS_H__'. However, */
/* using two successive underscores in a non-system symbol name */
/* violates the C (and C++) standard, so it was changed to the */
/* current form. In spite of this, we have to make */
/* */
/* #undefine __FTERRORS_H__ */
/* */
/* work for backward compatibility. */
/* */
#if !( defined( FTERRORS_H_ ) && defined ( __FTERRORS_H__ ) )
#define FTERRORS_H_
#define __FTERRORS_H__
@ -210,7 +220,7 @@
#undef FT_ERR_PREFIX
#endif
#endif /* __FTERRORS_H__ */
#endif /* !(FTERRORS_H_ && __FTERRORS_H__) */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Support functions for font formats. */
/* */
/* Copyright 2002-2015 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTFNTFMT_H__
#define __FTFNTFMT_H__
#ifndef FTFNTFMT_H_
#define FTFNTFMT_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -89,4 +89,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTFNTFMT_H__ */
#endif /* FTFNTFMT_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Access of TrueType's `gasp' table (specification). */
/* */
/* Copyright 2007-2015 by */
/* Copyright 2007-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef _FT_GASP_H_
#define _FT_GASP_H_
#ifndef FTGASP_H_
#define FTGASP_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -29,6 +29,9 @@
#endif
FT_BEGIN_HEADER
/***************************************************************************
*
* @section:
@ -92,8 +95,8 @@
#define FT_GASP_NO_TABLE -1
#define FT_GASP_DO_GRIDFIT 0x01
#define FT_GASP_DO_GRAY 0x02
#define FT_GASP_SYMMETRIC_GRIDFIT 0x04
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08
#define FT_GASP_SYMMETRIC_GRIDFIT 0x10
/*************************************************************************
@ -102,17 +105,25 @@
* FT_Get_Gasp
*
* @description:
* Read the `gasp' table from a TrueType or OpenType font file and
* return the entry corresponding to a given character pixel size.
* For a TrueType or OpenType font file, return the rasterizer behaviour
* flags from the font's `gasp' table corresponding to a given
* character pixel size.
*
* @input:
* face :: The source face handle.
*
* ppem :: The vertical character pixel size.
*
* @return:
* Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
* `gasp' table in the face.
*
* @note:
* If you want to use the MM functionality of OpenType variation fonts
* (i.e., using @FT_Set_Var_Design_Coordinates and friends), call this
* function *after* setting an instance since the return values can
* change.
*
* @since:
* 2.3.0
*/
@ -123,7 +134,9 @@
/* */
#endif /* _FT_GASP_H_ */
FT_END_HEADER
#endif /* FTGASP_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType convenience functions to handle glyphs (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -29,8 +29,8 @@
/*************************************************************************/
#ifndef __FTGLYPH_H__
#define __FTGLYPH_H__
#ifndef FTGLYPH_H_
#define FTGLYPH_H_
#include <ft2build.h>
@ -231,6 +231,12 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* Because `*aglyph->advance.x' and '*aglyph->advance.y' are 16.16 */
/* fixed-point numbers, `slot->advance.x' and `slot->advance.y' */
/* (which are in 26.6 fixed-point format) must be in the range */
/* ]-32768;32768[. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Glyph( FT_GlyphSlot slot,
FT_Glyph *aglyph );
@ -341,10 +347,10 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Return a glyph's `control box'. The control box encloses all the */
/* outline's points, including Bézier control points. Though it */
/* outline's points, including Bezier 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). */
/* that contains Bezier 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 */
@ -453,7 +459,7 @@ FT_BEGIN_HEADER
/* */
/* */
/* // load glyph */
/* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */
/* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAULT ); */
/* */
/* // extract glyph image */
/* error = FT_Get_Glyph( face->glyph, &glyph ); */
@ -566,6 +572,9 @@ FT_BEGIN_HEADER
/* <Note> */
/* The result is undefined if either `a' or `b' is zero. */
/* */
/* Since the function uses wrap-around arithmetic, results become */
/* meaningless if the arguments are very large. */
/* */
FT_EXPORT( void )
FT_Matrix_Multiply( const FT_Matrix* a,
FT_Matrix* b );
@ -594,7 +603,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTGLYPH_H__ */
#endif /* FTGLYPH_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
/* Copyright 2004-2015 by */
/* Copyright 2004-2018 by */
/* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@ -25,8 +25,8 @@
/***************************************************************************/
#ifndef __FTGXVAL_H__
#define __FTGXVAL_H__
#ifndef FTGXVAL_H_
#define FTGXVAL_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -101,15 +101,15 @@ FT_BEGIN_HEADER
* The number of tables checked in this module. Use it as a parameter
* for the `table-length' argument of function @FT_TrueTypeGX_Validate.
*/
#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
#define FT_VALIDATE_GX_LENGTH ( FT_VALIDATE_GX_LAST_INDEX + 1 )
/* */
/* Up to 0x1000 is used by otvalid.
Ox2xxx is reserved for feature OT extension. */
#define FT_VALIDATE_GX_START 0x4000
#define FT_VALIDATE_GX_BITFIELD( tag ) \
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
#define FT_VALIDATE_GX_START 0x4000
#define FT_VALIDATE_GX_BITFIELD( tag ) \
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
/**********************************************************************
@ -351,7 +351,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTGXVAL_H__ */
#endif /* FTGXVAL_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Gzip-compressed stream support. */
/* */
/* Copyright 2002-2015 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTGZIP_H__
#define __FTGZIP_H__
#ifndef FTGZIP_H_
#define FTGZIP_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -117,11 +117,11 @@ FT_BEGIN_HEADER
*
* @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'.
* Before calling the function, this is 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:
* FreeType error code. 0~means success.
@ -129,6 +129,9 @@ FT_BEGIN_HEADER
* @note:
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with zlib support.
*
* @since:
* 2.5.1
*/
FT_EXPORT( FT_Error )
FT_Gzip_Uncompress( FT_Memory memory,
@ -142,7 +145,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTGZIP_H__ */
#endif /* FTGZIP_H_ */
/* END */

View File

@ -5,7 +5,7 @@
/* FreeType glyph image formats and default raster interface */
/* (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -24,12 +24,12 @@
/*************************************************************************/
#ifndef __FTIMAGE_H__
#define __FTIMAGE_H__
#ifndef FTIMAGE_H_
#define FTIMAGE_H_
/* _STANDALONE_ is from ftgrays.c */
#ifndef _STANDALONE_
/* STANDALONE_ is from ftgrays.c */
#ifndef STANDALONE_
#include <ft2build.h>
#endif
@ -169,13 +169,13 @@ FT_BEGIN_HEADER
/* @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. */
/* [Since 2.5] 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. */
/* */
typedef enum FT_Pixel_Mode_
{
@ -301,11 +301,11 @@ FT_BEGIN_HEADER
/* 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 */
/* i.e., a Bezier 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; */
/* it indicates a third-order Bezier arc control point; */
/* and a second-order control point if unset. */
/* */
/* If bit~2 is set, bits 5-7 contain the drop-out mode */
@ -532,7 +532,7 @@ FT_BEGIN_HEADER
/* 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 */
/* A `conic to' is emitted to indicate a second-order Bezier arc in */
/* the outline. */
/* */
/* <Input> */
@ -564,12 +564,12 @@ FT_BEGIN_HEADER
/* 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. */
/* A `cubic to' is emitted to indicate a third-order Bezier arc. */
/* */
/* <Input> */
/* control1 :: A pointer to the first Bézier control point. */
/* control1 :: A pointer to the first Bezier control point. */
/* */
/* control2 :: A pointer to the second Bézier control point. */
/* control2 :: A pointer to the second Bezier control point. */
/* */
/* to :: A pointer to the target end point. */
/* */
@ -595,16 +595,16 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* A structure to hold various function pointers used during outline */
/* decomposition in order to emit segments, conic, and cubic Béziers. */
/* decomposition in order to emit segments, conic, and cubic Beziers. */
/* */
/* <Fields> */
/* move_to :: The `move to' emitter. */
/* */
/* line_to :: The segment emitter. */
/* */
/* conic_to :: The second-order Bézier arc emitter. */
/* conic_to :: The second-order Bezier arc emitter. */
/* */
/* cubic_to :: The third-order Bézier arc emitter. */
/* cubic_to :: The third-order Bezier arc emitter. */
/* */
/* shift :: The shift that is applied to coordinates before they */
/* are sent to the emitter. */
@ -619,7 +619,7 @@ FT_BEGIN_HEADER
/* */
/* { */
/* x' = (x << shift) - delta */
/* y' = (x << shift) - delta */
/* y' = (y << shift) - delta */
/* } */
/* */
/* Set the values of `shift' and `delta' to~0 to get the original */
@ -701,7 +701,7 @@ FT_BEGIN_HEADER
/* */
/* 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 */
/* and Bezier 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. */
/* */
@ -747,7 +747,7 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* A raster is a scan converter, in charge of rendering an outline into */
/* a a bitmap. This section contains the public API for rasters. */
/* a bitmap. This section contains the public API for rasters. */
/* */
/* Note that in FreeType 2, all rasters are now encapsulated within */
/* specific modules called `renderers'. See `ftrender.h' for more */
@ -860,16 +860,6 @@ FT_BEGIN_HEADER
/* 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. */
/* */
typedef void
(*FT_SpanFunc)( int y,
int count,
@ -1074,24 +1064,24 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* FreeType used to provide an area of memory called the `render */
/* pool' available to all registered rasters. This was not thread */
/* safe however and now FreeType never allocates this pool. NULL */
/* is always passed in as pool_base. */
/* pool' available to all registered rasterizers. This was not */
/* thread safe, however, and now FreeType never allocates this pool. */
/* */
/* This function is called each time the render pool changes, or just */
/* after a new raster object is created. */
/* This function is called after a new raster object is created. */
/* */
/* <Input> */
/* raster :: A handle to the new raster object. */
/* */
/* pool_base :: The address in memory of the render pool. */
/* pool_base :: Previously, the address in memory of the render pool. */
/* Set this to NULL. */
/* */
/* pool_size :: The size in bytes of the render pool. */
/* pool_size :: Previously, the size in bytes of the render pool. */
/* Set this to 0. */
/* */
/* <Note> */
/* Rasters should ignore the render pool and rely on dynamic or stack */
/* allocation if they want to (a handle to the memory allocator is */
/* passed to the raster constructor). */
/* Rasterizers should rely on dynamic or stack allocation if they */
/* want to (a handle to the memory allocator is passed to the */
/* rasterizer constructor). */
/* */
typedef void
(*FT_Raster_ResetFunc)( FT_Raster raster,
@ -1190,6 +1180,7 @@ FT_BEGIN_HEADER
typedef struct FT_Raster_Funcs_
{
FT_Glyph_Format glyph_format;
FT_Raster_NewFunc raster_new;
FT_Raster_ResetFunc raster_reset;
FT_Raster_SetModeFunc raster_set_mode;
@ -1203,7 +1194,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTIMAGE_H__ */
#endif /* FTIMAGE_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType incremental loading (specification). */
/* */
/* Copyright 2002-2015 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,11 +16,12 @@
/***************************************************************************/
#ifndef __FTINCREM_H__
#define __FTINCREM_H__
#ifndef FTINCREM_H_
#define FTINCREM_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_PARAMETER_TAGS_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
@ -331,24 +332,12 @@ FT_BEGIN_HEADER
typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_INCREMENTAL
*
* @description:
* A constant used as the tag of @FT_Parameter structures to indicate
* an incremental loading object to be used by FreeType.
*
*/
#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
/* */
FT_END_HEADER
#endif /* __FTINCREM_H__ */
#endif /* FTINCREM_H_ */
/* END */

View File

@ -5,7 +5,7 @@
/* FreeType API for color filtering of subpixel bitmap glyphs */
/* (specification). */
/* */
/* Copyright 2006-2015 by */
/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -17,11 +17,12 @@
/***************************************************************************/
#ifndef __FT_LCD_FILTER_H__
#define __FT_LCD_FILTER_H__
#ifndef FTLCDFIL_H_
#define FTLCDFIL_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_PARAMETER_TAGS_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
@ -41,56 +42,92 @@ FT_BEGIN_HEADER
* LCD Filtering
*
* @abstract:
* Reduce color fringes of LCD-optimized bitmaps.
* Reduce color fringes of subpixel-rendered bitmaps.
*
* @description:
* 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.
* Should you #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your
* `ftoption.h', which enables patented ClearType-style rendering,
* the LCD-optimized glyph bitmaps should be filtered to reduce color
* fringes inherent to this technology. The default FreeType LCD
* rendering uses different technology, and API described below,
* although available, does nothing.
*
* 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.
* ClearType-style LCD rendering exploits the color-striped structure of
* LCD pixels, increasing the available resolution in the direction of
* the stripe (usually horizontal RGB) by a factor of~3. Since these
* subpixels are color pixels, using them unfiltered creates severe
* color fringes. Use the @FT_Library_SetLcdFilter API to specify a
* low-pass filter, which is then applied to subpixel-rendered bitmaps
* generated through @FT_Render_Glyph. The filter sacrifices some of
* the higher resolution to reduce color fringes, making the glyph image
* slightly blurrier. Positional improvements will remain.
*
* 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
* A filter should have two properties:
*
* {
* dst = alpha * src + (1 - alpha) * dst ,
* }
* 1) It should be normalized, meaning the sum of the 5~components
* should be 256 (0x100). It is possible to go above or under this
* target sum, however: going under means tossing out contrast, going
* over means invoking clamping and thereby non-linearities that
* increase contrast somewhat at the expense of greater distortion
* and color-fringing. Contrast is better enhanced through stem
* darkening.
*
* which is known as OVER. However, when calculating the output of the
* OVER operator, the source colors should first be transformed to a
* linear color space, then alpha blended in that space, and transformed
* back to the output color space.
* 2) It should be color-balanced, meaning a filter `{~a, b, c, b, a~}'
* where a~+ b~=~c. It distributes the computed coverage for one
* subpixel to all subpixels equally, sacrificing some won resolution
* but drastically reducing color-fringing. Positioning improvements
* remain! Note that color-fringing can only really be minimized
* when using a color-balanced filter and alpha-blending the glyph
* onto a surface in linear space; see @FT_Render_Glyph.
*
* When linear light blending is used, the default FIR5 filtering
* weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as
* they have been designed for black on white rendering while lacking
* gamma correction. To preserve color neutrality, weights for a FIR5
* filter should be chosen according to two free parameters `a' and `c',
* and the FIR weights should be
* Regarding the form, a filter can be a `boxy' filter or a `beveled'
* filter. Boxy filters are sharper but are less forgiving of non-ideal
* gamma curves of a screen (viewing angles!), beveled filters are
* fuzzier but more tolerant.
*
* {
* [a - c, a + c, 2 * a, a + c, a - c] .
* }
* Examples:
*
* This formula generates equal weights for all the color primaries
* across the filter kernel, which makes it colorless. One suggested
* set of weights is
* - [0x10 0x40 0x70 0x40 0x10] is beveled and neither balanced nor
* normalized.
*
* {
* [0x10, 0x50, 0x60, 0x50, 0x10] ,
* }
* - [0x1A 0x33 0x4D 0x33 0x1A] is beveled and balanced but not
* normalized.
*
* 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.
* - [0x19 0x33 0x66 0x4c 0x19] is beveled and normalized but not
* balanced.
*
* - [0x00 0x4c 0x66 0x4c 0x00] is boxily beveled and normalized but not
* balanced.
*
* - [0x00 0x55 0x56 0x55 0x00] is boxy, normalized, and almost
* balanced.
*
* - [0x08 0x4D 0x56 0x4D 0x08] is beveled, normalized and, almost
* balanced.
*
* The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
* @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 wider or taller than the dimensions of the corresponding
* outline with regard to the pixel grid. For example, for
* @FT_RENDER_MODE_LCD, the filter adds 3~subpixels to the left, and
* 3~subpixels to the right. The bitmap offset values are adjusted
* accordingly, so clients shouldn't need to modify their layout and
* glyph positioning code when enabling the filter.
*
* It is important to understand that linear alpha blending and gamma
* correction is critical for correctly rendering glyphs onto surfaces
* without artifacts and even more critical when subpixel rendering is
* involved.
*
* Each of the 3~alpha values (subpixels) is independently used to blend
* one color channel. That is, red alpha blends the red channel of the
* text color with the red channel of the background pixel. The
* distribution of density values by the color-balanced filter assumes
* alpha blending is done in linear space; only then color artifacts
* cancel out.
*/
@ -111,10 +148,23 @@ FT_BEGIN_HEADER
* The default filter reduces color fringes considerably, at the cost
* of a slight blurriness in the output.
*
* It is a beveled, normalized, and color-balanced five-tap filter
* that is more forgiving to screens with non-ideal gamma curves and
* viewing angles. Note that while color-fringing is reduced, it can
* only be minimized by using linear alpha blending and gamma
* correction to render glyphs onto surfaces. The default filter
* weights are [0x08 0x4D 0x56 0x4D 0x08].
*
* 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.
* The light filter is a variant that is sharper at the cost of
* slightly more color fringes than the default one.
*
* It is a boxy, normalized, and color-balanced three-tap filter that
* is less forgiving to screens with non-ideal gamma curves and
* viewing angles. This filter works best when the rendering system
* uses linear alpha blending and gamma correction to render glyphs
* onto surfaces. The light filter weights are
* [0x00 0x55 0x56 0x55 0x00].
*
* FT_LCD_FILTER_LEGACY ::
* This filter corresponds to the original libXft color filter. It
@ -126,14 +176,23 @@ FT_BEGIN_HEADER
* This filter is only provided for comparison purposes, and might be
* disabled or stay unsupported in the future.
*
* FT_LCD_FILTER_LEGACY1 ::
* For historical reasons, the FontConfig library returns a different
* enumeration value for legacy LCD filtering. To make code work that
* (incorrectly) forwards FontConfig's enumeration value to
* @FT_Library_SetLcdFilter without proper mapping, it is thus easiest
* to have another enumeration value, which is completely equal to
* `FT_LCD_FILTER_LEGACY'.
*
* @since:
* 2.3.0
* 2.3.0 (`FT_LCD_FILTER_LEGACY1' since 2.6.2)
*/
typedef enum FT_LcdFilter_
{
FT_LCD_FILTER_NONE = 0,
FT_LCD_FILTER_DEFAULT = 1,
FT_LCD_FILTER_LIGHT = 2,
FT_LCD_FILTER_LEGACY1 = 3,
FT_LCD_FILTER_LEGACY = 16,
FT_LCD_FILTER_MAX /* do not remove */
@ -176,22 +235,6 @@ FT_BEGIN_HEADER
* 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:
* 2.3.0
*/
@ -206,11 +249,8 @@ FT_BEGIN_HEADER
* FT_Library_SetLcdFilterWeights
*
* @description:
* 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.
* This function can be used to enable LCD filter with custom weights,
* instead of using presets in @FT_Library_SetLcdFilter.
*
* @input:
* library ::
@ -230,8 +270,8 @@ FT_BEGIN_HEADER
* 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.
* LCD filter weights can also be set per face using @FT_Face_Properties
* with @FT_PARAM_TAG_LCD_FILTER_WEIGHTS.
*
* @since:
* 2.4.0
@ -240,12 +280,30 @@ FT_BEGIN_HEADER
FT_Library_SetLcdFilterWeights( FT_Library library,
unsigned char *weights );
/*
* @type:
* FT_LcdFiveTapFilter
*
* @description:
* A typedef for passing the five LCD filter weights to
* @FT_Face_Properties within an @FT_Parameter structure.
*
* @since:
* 2.8
*
*/
#define FT_LCD_FILTER_FIVE_TAPS 5
typedef FT_Byte FT_LcdFiveTapFilter[FT_LCD_FILTER_FIVE_TAPS];
/* */
FT_END_HEADER
#endif /* __FT_LCD_FILTER_H__ */
#endif /* FTLCDFIL_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Generic list support for FreeType (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -24,8 +24,8 @@
/*************************************************************************/
#ifndef __FTLIST_H__
#define __FTLIST_H__
#ifndef FTLIST_H_
#define FTLIST_H_
#include <ft2build.h>
@ -270,7 +270,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTLIST_H__ */
#endif /* FTLIST_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* LZW-compressed stream support. */
/* */
/* Copyright 2004-2015 by */
/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTLZW_H__
#define __FTLZW_H__
#ifndef FTLZW_H_
#define FTLZW_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -93,7 +93,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTLZW_H__ */
#endif /* FTLZW_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Additional Mac-specific API. */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -25,8 +25,8 @@
/***************************************************************************/
#ifndef __FTMAC_H__
#define __FTMAC_H__
#ifndef FTMAC_H_
#define FTMAC_H_
#include <ft2build.h>
@ -35,11 +35,12 @@
FT_BEGIN_HEADER
/* gcc-3.4.1 and later can warn about functions tagged as deprecated */
/* gcc-3.1 and later can warn about functions tagged as deprecated */
#ifndef FT_DEPRECATED_ATTRIBUTE
#if defined(__GNUC__) && \
((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
#if defined( __GNUC__ ) && \
( ( __GNUC__ >= 4 ) || \
( ( __GNUC__ == 3 ) && ( __GNUC_MINOR__ >= 1 ) ) )
#define FT_DEPRECATED_ATTRIBUTE __attribute__(( deprecated ))
#else
#define FT_DEPRECATED_ATTRIBUTE
#endif
@ -268,7 +269,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTMAC_H__ */
#endif /* FTMAC_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType Multiple Master font interface (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTMM_H__
#define __FTMM_H__
#ifndef FTMM_H_
#define FTMM_H_
#include <ft2build.h>
@ -43,11 +43,10 @@ FT_BEGIN_HEADER
/* 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. */
/* Besides Adobe MM fonts, the interface supports Apple's TrueType GX */
/* and OpenType variation fonts. Some of the routines only work with */
/* Adobe MM fonts, others will work with all three types. They are */
/* similar enough that a consistent interface makes sense. */
/* */
/*************************************************************************/
@ -58,10 +57,11 @@ FT_BEGIN_HEADER
/* FT_MM_Axis */
/* */
/* <Description> */
/* A simple structure used to model a given axis in design space for */
/* Multiple Masters fonts. */
/* A structure to model a given axis in design space for Multiple */
/* Masters fonts. */
/* */
/* This structure can't be used for GX var fonts. */
/* This structure can't be used for TrueType GX or OpenType variation */
/* fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
@ -85,10 +85,11 @@ FT_BEGIN_HEADER
/* FT_Multi_Master */
/* */
/* <Description> */
/* A structure used to model the axes and space of a Multiple Masters */
/* A structure to model the axes and space of a Multiple Masters */
/* font. */
/* */
/* This structure can't be used for GX var fonts. */
/* This structure can't be used for TrueType GX or OpenType variation */
/* fonts. */
/* */
/* <Fields> */
/* num_axis :: Number of axes. Cannot exceed~4. */
@ -115,27 +116,35 @@ FT_BEGIN_HEADER
/* FT_Var_Axis */
/* */
/* <Description> */
/* A simple structure used to model a given axis in design space for */
/* Multiple Masters and GX var fonts. */
/* A structure to model a given axis in design space for Multiple */
/* Masters, TrueType GX, and OpenType variation fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
/* Not always meaningful for GX. */
/* Not always meaningful for TrueType GX or OpenType */
/* variation fonts. */
/* */
/* minimum :: The axis's minimum design coordinate. */
/* */
/* 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. */
/* FreeType computes meaningful default values for Adobe */
/* MM fonts. */
/* */
/* maximum :: The axis's maximum design coordinate. */
/* */
/* tag :: The axis's tag (the GX equivalent to `name'). */
/* FreeType provides default values for MM if possible. */
/* tag :: The axis's tag (the equivalent to `name' for TrueType */
/* GX and OpenType variation fonts). FreeType provides */
/* default values for Adobe MM fonts if possible. */
/* */
/* strid :: The entry in `name' table (another GX version of */
/* `name'). */
/* Not meaningful for MM. */
/* strid :: The axis name entry in the font's `name' table. This */
/* is another (and often better) version of the `name' */
/* field for TrueType GX or OpenType variation fonts. Not */
/* meaningful for Adobe MM fonts. */
/* */
/* <Note> */
/* The fields `minimum', `def', and `maximum' are 16.16 fractional */
/* values for TrueType GX and OpenType variation fonts. For Adobe MM */
/* fonts, the values are integers. */
/* */
typedef struct FT_Var_Axis_
{
@ -157,20 +166,26 @@ FT_BEGIN_HEADER
/* FT_Var_Named_Style */
/* */
/* <Description> */
/* A simple structure used to model a named style in a GX var font. */
/* A structure to model a named instance in a TrueType GX or OpenType */
/* variation font. */
/* */
/* This structure can't be used for MM fonts. */
/* This structure can't be used for Adobe MM fonts. */
/* */
/* <Fields> */
/* coords :: The design coordinates for this style. */
/* coords :: The design coordinates for this instance. */
/* This is an array with one entry for each axis. */
/* */
/* strid :: The entry in `name' table identifying this style. */
/* strid :: The entry in `name' table identifying this instance. */
/* */
/* psid :: The entry in `name' table identifying a PostScript name */
/* for this instance. Value 0xFFFF indicates a missing */
/* entry. */
/* */
typedef struct FT_Var_Named_Style_
{
FT_Fixed* coords;
FT_UInt strid;
FT_UInt psid; /* since 2.7.1 */
} FT_Var_Named_Style;
@ -181,31 +196,43 @@ FT_BEGIN_HEADER
/* FT_MM_Var */
/* */
/* <Description> */
/* A structure used to model the axes and space of a Multiple Masters */
/* or GX var distortable font. */
/* A structure to model the axes and space of an Adobe MM, TrueType */
/* GX, or OpenType variation font. */
/* */
/* Some fields are specific to one format and not to the other. */
/* Some fields are specific to one format and not to the others. */
/* */
/* <Fields> */
/* num_axis :: The number of axes. The maximum value is~4 for */
/* MM; no limit in GX. */
/* Adobe MM fonts; no limit in TrueType GX or */
/* OpenType variation fonts. */
/* */
/* num_designs :: The number of designs; should be normally */
/* 2^num_axis for MM fonts. Not meaningful for GX */
/* 2^num_axis for Adobe MM fonts. Not meaningful */
/* for TrueType GX or OpenType variation fonts */
/* (where every glyph could have a different */
/* number of designs). */
/* */
/* 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'. */
/* num_namedstyles :: The number of named styles; a `named style' is */
/* a tuple of design coordinates that has a string */
/* ID (in the `name' table) associated with it. */
/* The font can tell the user that, for example, */
/* [Weight=1.5,Width=1.1] is `Bold'. Another name */
/* for `named style' is `named instance'. */
/* */
/* For Adobe Multiple Masters fonts, this value is */
/* always zero because the format does not support */
/* named styles. */
/* */
/* axis :: An axis descriptor table. */
/* GX fonts contain slightly more data than MM. */
/* TrueType GX and OpenType variation fonts */
/* contain slightly more data than Adobe MM fonts. */
/* Memory management of this pointer is done */
/* internally by FreeType. */
/* */
/* namedstyle :: A named style table. */
/* Only meaningful with GX. */
/* namedstyle :: A named style (instance) table. */
/* Only meaningful for TrueType GX and OpenType */
/* variation fonts. Memory management of this */
/* pointer is done internally by FreeType. */
/* */
typedef struct FT_MM_Var_
{
@ -224,9 +251,10 @@ FT_BEGIN_HEADER
/* FT_Get_Multi_Master */
/* */
/* <Description> */
/* Retrieve the Multiple Master descriptor of a given font. */
/* Retrieve a variation descriptor of a given Adobe MM font. */
/* */
/* This function can't be used with GX fonts. */
/* This function can't be used with TrueType GX or OpenType variation */
/* fonts. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
@ -248,14 +276,17 @@ FT_BEGIN_HEADER
/* FT_Get_MM_Var */
/* */
/* <Description> */
/* Retrieve the Multiple Master/GX var descriptor of a given font. */
/* Retrieve a variation descriptor for a given font. */
/* */
/* This function works with all supported variation formats. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Output> */
/* amaster :: The Multiple Masters/GX var descriptor. */
/* Allocates a data structure, which the user must free. */
/* amaster :: The variation descriptor. */
/* Allocates a data structure, which the user must */
/* deallocate with a call to @FT_Done_MM_Var after use. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
@ -265,16 +296,37 @@ FT_BEGIN_HEADER
FT_MM_Var* *amaster );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_MM_Var */
/* */
/* <Description> */
/* Free the memory allocated by @FT_Get_MM_Var. */
/* */
/* <Input> */
/* library :: A handle of the face's parent library object that was */
/* used in the call to @FT_Get_MM_Var to create `amaster'. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Done_MM_Var( FT_Library library,
FT_MM_Var *amaster );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_MM_Design_Coordinates */
/* */
/* <Description> */
/* For Multiple Masters fonts, choose an interpolated font design */
/* through design coordinates. */
/* For Adobe MM fonts, choose an interpolated font design through */
/* design coordinates. */
/* */
/* This function can't be used with GX fonts. */
/* This function can't be used with TrueType GX or OpenType variation */
/* fonts. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
@ -290,6 +342,15 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* [Since 2.8.1] To reset all axes to the default values, call the */
/* function with `num_coords' set to zero and `coords' set to NULL. */
/* */
/* [Since 2.9] If `num_coords' is larger than zero, this function */
/* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */
/* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */
/* is zero, this bit flag gets unset. */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
@ -302,8 +363,9 @@ FT_BEGIN_HEADER
/* FT_Set_Var_Design_Coordinates */
/* */
/* <Description> */
/* For Multiple Master or GX Var fonts, choose an interpolated font */
/* design through design coordinates. */
/* Choose an interpolated font design through design coordinates. */
/* */
/* This function works with all supported variation formats. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
@ -319,20 +381,66 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* [Since 2.8.1] To reset all axes to the default values, call the */
/* function with `num_coords' set to zero and `coords' set to NULL. */
/* [Since 2.9] `Default values' means the currently selected named */
/* instance (or the base font if no named instance is selected). */
/* */
/* [Since 2.9] If `num_coords' is larger than zero, this function */
/* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */
/* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */
/* is zero, this bit flag gets unset. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Var_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Var_Design_Coordinates */
/* */
/* <Description> */
/* Get the design coordinates of the currently selected interpolated */
/* font. */
/* */
/* This function works with all supported variation formats. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* num_coords :: The number of design coordinates to retrieve. If it */
/* is larger than the number of axes, set the excess */
/* values to~0. */
/* */
/* <Output> */
/* coords :: The design coordinates array. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Since> */
/* 2.7.1 */
/* */
FT_EXPORT( FT_Error )
FT_Get_Var_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_MM_Blend_Coordinates */
/* */
/* <Description> */
/* For Multiple Masters and GX var fonts, choose an interpolated font */
/* design through normalized blend coordinates. */
/* Choose an interpolated font design through normalized blend */
/* coordinates. */
/* */
/* This function works with all supported variation formats. */
/* */
/* <InOut> */
/* face :: A handle to the source face. */
@ -344,17 +452,64 @@ FT_BEGIN_HEADER
/* use default values for the remaining axes. */
/* */
/* coords :: The design coordinates array (each element must be */
/* between 0 and 1.0). */
/* between 0 and 1.0 for Adobe MM fonts, and between */
/* -1.0 and 1.0 for TrueType GX and OpenType variation */
/* fonts). */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* [Since 2.8.1] To reset all axes to the default values, call the */
/* function with `num_coords' set to zero and `coords' set to NULL. */
/* [Since 2.9] `Default values' means the currently selected named */
/* instance (or the base font if no named instance is selected). */
/* */
/* [Since 2.9] If `num_coords' is larger than zero, this function */
/* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */
/* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */
/* is zero, this bit flag gets unset. */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_MM_Blend_Coordinates */
/* */
/* <Description> */
/* Get the normalized blend coordinates of the currently selected */
/* interpolated font. */
/* */
/* This function works with all supported variation formats. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* num_coords :: The number of normalized blend coordinates to */
/* retrieve. If it is larger than the number of axes, */
/* set the excess values to~0.5 for Adobe MM fonts, and */
/* to~0 for TrueType GX and OpenType variation fonts. */
/* */
/* <Output> */
/* coords :: The normalized blend coordinates array. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Since> */
/* 2.7.1 */
/* */
FT_EXPORT( FT_Error )
FT_Get_MM_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
@ -368,12 +523,116 @@ FT_BEGIN_HEADER
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Var_Blend_Coordinates */
/* */
/* <Description> */
/* This is another name of @FT_Get_MM_Blend_Coordinates. */
/* */
/* <Since> */
/* 2.7.1 */
/* */
FT_EXPORT( FT_Error )
FT_Get_Var_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************/
/* */
/* <Enum> */
/* FT_VAR_AXIS_FLAG_XXX */
/* */
/* <Description> */
/* A list of bit flags used in the return value of */
/* @FT_Get_Var_Axis_Flags. */
/* */
/* <Values> */
/* FT_VAR_AXIS_FLAG_HIDDEN :: */
/* The variation axis should not be exposed to user interfaces. */
/* */
/* <Since> */
/* 2.8.1 */
/* */
#define FT_VAR_AXIS_FLAG_HIDDEN 1
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Var_Axis_Flags */
/* */
/* <Description> */
/* Get the `flags' field of an OpenType Variation Axis Record. */
/* */
/* Not meaningful for Adobe MM fonts (`*flags' is always zero). */
/* */
/* <Input> */
/* master :: The variation descriptor. */
/* */
/* axis_index :: The index of the requested variation axis. */
/* */
/* <Output> */
/* flags :: The `flags' field. See @FT_VAR_AXIS_FLAG_XXX for */
/* possible values. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Since> */
/* 2.8.1 */
/* */
FT_EXPORT( FT_Error )
FT_Get_Var_Axis_Flags( FT_MM_Var* master,
FT_UInt axis_index,
FT_UInt* flags );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Named_Instance */
/* */
/* <Description> */
/* Set or change the current named instance. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* instance_index :: The index of the requested instance, starting */
/* with value 1. If set to value 0, FreeType */
/* switches to font access without a named */
/* instance. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The function uses the value of `instance_index' to set bits 16-30 */
/* of the face's `face_index' field. It also resets any variation */
/* applied to the font, and the @FT_FACE_FLAG_VARIATION bit of the */
/* face's `face_flags' field gets reset to zero (i.e., */
/* @FT_IS_VARIATION will return false). */
/* */
/* For Adobe MM fonts (which don't have named instances) this */
/* function simply resets the current face to the default instance. */
/* */
/* <Since> */
/* 2.9 */
/* */
FT_EXPORT( FT_Error )
FT_Set_Named_Instance( FT_Face face,
FT_UInt instance_index );
/* */
FT_END_HEADER
#endif /* __FTMM_H__ */
#endif /* FTMM_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType modules public interface (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTMODAPI_H__
#define __FTMODAPI_H__
#ifndef FTMODAPI_H_
#define FTMODAPI_H_
#include <ft2build.h>
@ -89,6 +89,7 @@ FT_BEGIN_HEADER
/* */
/* FT_Property_Set */
/* FT_Property_Get */
/* FT_Set_Default_Properties */
/* */
/* FT_New_Library */
/* FT_Done_Library */
@ -111,12 +112,14 @@ FT_BEGIN_HEADER
#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */
#define FT_MODULE_STYLER 8 /* this module is a styler */
#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
/* scalable fonts */
#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
/* support vector outlines */
#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
/* own hinter */
#define FT_MODULE_DRIVER_HINTS_LIGHTLY 0x800 /* the driver's hinter */
/* produces LIGHT hints */
/* deprecated values */
@ -125,9 +128,10 @@ FT_BEGIN_HEADER
#define ft_module_hinter FT_MODULE_HINTER
#define ft_module_styler FT_MODULE_STYLER
#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
#define ft_module_driver_hints_lightly FT_MODULE_DRIVER_HINTS_LIGHTLY
typedef FT_Pointer FT_Module_Interface;
@ -319,16 +323,15 @@ FT_BEGIN_HEADER
* The module name.
*
* property_name ::
* The property name. Properties are described in the `Synopsis'
* subsection of the module's documentation.
* The property name. Properties are described in section
* @properties.
*
* Note that only a few modules have properties.
*
* 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.
* dependent on the property; see section @properties.
*
* @return:
* FreeType error code. 0~means success.
@ -386,15 +389,14 @@ FT_BEGIN_HEADER
* The module name.
*
* property_name ::
* The property name. Properties are described in the `Synopsis'
* subsection of the module's documentation.
* The property name. Properties are described in section
* @properties.
*
* @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.
* dependent on the property; see section @properties.
*
* @return:
* FreeType error code. 0~means success.
@ -434,6 +436,50 @@ FT_BEGIN_HEADER
void* value );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Default_Properties */
/* */
/* <Description> */
/* If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is */
/* set, this function reads the `FREETYPE_PROPERTIES' environment */
/* variable to control driver properties. See section @properties */
/* for more. */
/* */
/* If the compilation option is not set, this function does nothing. */
/* */
/* `FREETYPE_PROPERTIES' has the following syntax form (broken here */
/* into multiple lines for better readability). */
/* */
/* { */
/* <optional whitespace> */
/* <module-name1> ':' */
/* <property-name1> '=' <property-value1> */
/* <whitespace> */
/* <module-name2> ':' */
/* <property-name2> '=' <property-value2> */
/* ... */
/* } */
/* */
/* Example: */
/* */
/* { */
/* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */
/* cff:no-stem-darkening=1 \ */
/* autofitter:warping=1 */
/* } */
/* */
/* <InOut> */
/* library :: A handle to a new library object. */
/* */
/* <Since> */
/* 2.8 */
/* */
FT_EXPORT( void )
FT_Set_Default_Properties( FT_Library library );
/*************************************************************************/
/* */
/* <Function> */
@ -474,8 +520,9 @@ FT_BEGIN_HEADER
/* valid for the life of the @FT_Library object. */
/* */
/* 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. */
/* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module, */
/* and a call to @FT_Set_Default_Properties) 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. */
@ -610,12 +657,7 @@ FT_BEGIN_HEADER
* The library doesn't implement any kind of bytecode interpreter.
*
* 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.
* Deprecated and removed.
*
* FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
* The library implements a bytecode interpreter that covers
@ -663,7 +705,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTMODAPI_H__ */
#endif /* FTMODAPI_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType module error offsets (specification). */
/* */
/* Copyright 2001-2015 by */
/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -74,7 +74,7 @@
/* with something like */
/* */
/* { */
/* #undef __FTMODERR_H__ */
/* #undef FTMODERR_H_ */
/* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
/* #define FT_MODERR_START_LIST { */
/* #define FT_MODERR_END_LIST { 0, 0 } }; */
@ -91,8 +91,8 @@
/*************************************************************************/
#ifndef __FTMODERR_H__
#define __FTMODERR_H__
#ifndef FTMODERR_H_
#define FTMODERR_H_
/*******************************************************************/
@ -188,7 +188,7 @@
#undef FT_NEED_EXTERN_C
#endif /* __FTMODERR_H__ */
#endif /* FTMODERR_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType API for validating OpenType tables (specification). */
/* */
/* Copyright 2004-2015 by */
/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -27,8 +27,8 @@
/***************************************************************************/
#ifndef __FTOTVAL_H__
#define __FTOTVAL_H__
#ifndef FTOTVAL_H_
#define FTOTVAL_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -106,12 +106,12 @@ FT_BEGIN_HEADER
#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
#define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \
FT_VALIDATE_GDEF | \
FT_VALIDATE_GPOS | \
FT_VALIDATE_GSUB | \
FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH )
/**********************************************************************
*
@ -198,7 +198,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTOTVAL_H__ */
#endif /* FTOTVAL_H_ */
/* END */

View File

@ -5,7 +5,7 @@
/* Support for the FT_Outline type used to store glyph shapes of */
/* most scalable font formats (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -17,8 +17,8 @@
/***************************************************************************/
#ifndef __FTOUTLN_H__
#define __FTOUTLN_H__
#ifndef FTOUTLN_H_
#define FTOUTLN_H_
#include <ft2build.h>
@ -89,7 +89,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Walk over an outline's structure to decompose it into individual */
/* segments and Bézier arcs. This function also emits `move to' */
/* segments and Bezier arcs. This function also emits `move to' */
/* operations to indicate the start of new contours in the outline. */
/* */
/* <Input> */
@ -115,6 +115,10 @@ FT_BEGIN_HEADER
/* outline for stroking purposes (otherwise it would result in a */
/* visible dot when round caps are used). */
/* */
/* Similarly, the function returns success for an empty outline also */
/* (doing nothing, this is, not calling any emitter); if necessary, */
/* you should filter this out, too. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Decompose( FT_Outline* outline,
const FT_Outline_Funcs* func_interface,
@ -186,9 +190,6 @@ FT_BEGIN_HEADER
/* 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(). */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Done( FT_Library library,
FT_Outline* outline );
@ -213,6 +214,10 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* An empty outline, or an outline with a single point only is also */
/* valid. */
/* */
FT_EXPORT( FT_Error )
FT_Outline_Check( FT_Outline* outline );
@ -224,10 +229,10 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Return an outline's `control box'. The control box encloses all */
/* the outline's points, including Bézier control points. Though it */
/* the outline's points, including Bezier 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). */
/* that contains Bezier 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 */
@ -377,6 +382,9 @@ FT_BEGIN_HEADER
/* @FT_Outline_Embolden, which uses the same strength in both */
/* directions. */
/* */
/* <Since> */
/* 2.4.10 */
/* */
FT_EXPORT( FT_Error )
FT_Outline_EmboldenXY( FT_Outline* outline,
FT_Pos xstrength,
@ -563,7 +571,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTOUTLN_H__ */
#endif /* FTOUTLN_H_ */
/* END */

View File

@ -0,0 +1,205 @@
/***************************************************************************/
/* */
/* ftparams.h */
/* */
/* FreeType API for possible FT_Parameter tags (specification only). */
/* */
/* Copyright 2017-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* 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. */
/* */
/***************************************************************************/
#ifndef FTPARAMS_H_
#define FTPARAMS_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* parameter_tags
*
* @title:
* Parameter Tags
*
* @abstract:
* Macros for driver property and font loading parameter tags.
*
* @description:
* This section contains macros for the @FT_Parameter structure that are
* used with various functions to activate some special functionality or
* different behaviour of various components of FreeType.
*
*/
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
*
* @description:
* A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
* family names in the `name' table (introduced in OpenType version
* 1.4). Use this for backward compatibility with legacy systems that
* have a four-faces-per-family restriction.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \
FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
/* this constant is deprecated */
#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY \
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
*
* @description:
* A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
* subfamily names in the `name' table (introduced in OpenType version
* 1.4). Use this for backward compatibility with legacy systems that
* have a four-faces-per-family restriction.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \
FT_MAKE_TAG( 'i', 'g', 'p', 's' )
/* this constant is deprecated */
#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY \
FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_INCREMENTAL
*
* @description:
* An @FT_Parameter tag to be used with @FT_Open_Face to indicate
* incremental glyph loading.
*
*/
#define FT_PARAM_TAG_INCREMENTAL \
FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
/**************************************************************************
*
* @constant:
* FT_PARAM_TAG_LCD_FILTER_WEIGHTS
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding argument specifies the five LCD filter weights for a
* given face (if using @FT_LOAD_TARGET_LCD, for example), overriding
* the global default values or the values set up with
* @FT_Library_SetLcdFilterWeights.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_LCD_FILTER_WEIGHTS \
FT_MAKE_TAG( 'l', 'c', 'd', 'f' )
/**************************************************************************
*
* @constant:
* FT_PARAM_TAG_RANDOM_SEED
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding 32bit signed integer argument overrides the font
* driver's random seed value with a face-specific one; see
* @random-seed.
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_RANDOM_SEED \
FT_MAKE_TAG( 's', 'e', 'e', 'd' )
/**************************************************************************
*
* @constant:
* FT_PARAM_TAG_STEM_DARKENING
*
* @description:
* An @FT_Parameter tag to be used with @FT_Face_Properties. The
* corresponding Boolean argument specifies whether to apply stem
* darkening, overriding the global default values or the values set up
* with @FT_Property_Set (see @no-stem-darkening).
*
* This is a passive setting that only takes effect if the font driver
* or autohinter honors it, which the CFF, Type~1, and CID drivers
* always do, but the autohinter only in `light' hinting mode (as of
* version 2.9).
*
* @since:
* 2.8
*
*/
#define FT_PARAM_TAG_STEM_DARKENING \
FT_MAKE_TAG( 'd', 'a', 'r', 'k' )
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_UNPATENTED_HINTING
*
* @description:
* Deprecated, no effect.
*
* Previously: 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.
*
*/
#define FT_PARAM_TAG_UNPATENTED_HINTING \
FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
/* */
FT_END_HEADER
#endif /* FTPARAMS_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing PFR-specific data (specification only). */
/* */
/* Copyright 2002-2015 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTPFR_H__
#define __FTPFR_H__
#ifndef FTPFR_H_
#define FTPFR_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -71,7 +71,7 @@ FT_BEGIN_HEADER
*
* 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
* in metrics units to device subpixels. This is equivalent to
* `face->size->x_scale', but for metrics only. Optional (parameter
* can be NULL).
*
@ -123,7 +123,7 @@ FT_BEGIN_HEADER
* 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.
* returned by @FT_Get_PFR_Metrics to scale these to device subpixels.
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Kerning( FT_Face face,
@ -154,7 +154,7 @@ FT_BEGIN_HEADER
*
* @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).
* to convert the advance to device subpixels (i.e., 1/64th of pixels).
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Advance( FT_Face face,
@ -166,7 +166,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTPFR_H__ */
#endif /* FTPFR_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType renderer modules public interface (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTRENDER_H__
#define __FTRENDER_H__
#ifndef FTRENDER_H_
#define FTRENDER_H_
#include <ft2build.h>
@ -75,6 +75,7 @@ FT_BEGIN_HEADER
{
FT_Long glyph_size;
FT_Glyph_Format glyph_format;
FT_Glyph_InitFunc glyph_init;
FT_Glyph_DoneFunc glyph_done;
FT_Glyph_CopyFunc glyph_copy;
@ -87,7 +88,7 @@ FT_BEGIN_HEADER
typedef FT_Error
(*FT_Renderer_RenderFunc)( FT_Renderer renderer,
FT_GlyphSlot slot,
FT_UInt mode,
FT_Render_Mode mode,
const FT_Vector* origin );
typedef FT_Error
@ -226,7 +227,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTRENDER_H__ */
#endif /* FTRENDER_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType size objects management (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -25,8 +25,8 @@
/*************************************************************************/
#ifndef __FTSIZES_H__
#define __FTSIZES_H__
#ifndef FTSIZES_H_
#define FTSIZES_H_
#include <ft2build.h>
@ -153,7 +153,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTSIZES_H__ */
#endif /* FTSIZES_H_ */
/* END */

View File

@ -2,12 +2,12 @@
/* */
/* ftsnames.h */
/* */
/* Simple interface to access SFNT name tables (which are used */
/* Simple interface to access SFNT `name' tables (which are used */
/* to hold font names, copyright info, notices, etc.) (specification). */
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -19,12 +19,13 @@
/***************************************************************************/
#ifndef __FT_SFNT_NAMES_H__
#define __FT_SFNT_NAMES_H__
#ifndef FTSNAMES_H_
#define FTSNAMES_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_PARAMETER_TAGS_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
@ -49,7 +50,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* The TrueType and OpenType specifications allow the inclusion of */
/* a special `names table' in font files. This table contains */
/* a special names table (`name') in font files. This table contains */
/* textual (and internationalized) information regarding the font, */
/* like family name, copyright, version, etc. */
/* */
@ -70,30 +71,37 @@ FT_BEGIN_HEADER
/* */
/* <Fields> */
/* platform_id :: The platform ID for `string'. */
/* See @TT_PLATFORM_XXX for possible values. */
/* */
/* encoding_id :: The encoding ID for `string'. */
/* See @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
/* @TT_ISO_ID_XXX, @TT_MS_ID_XXX, and @TT_ADOBE_ID_XXX */
/* for possible values. */
/* */
/* language_id :: The language ID for `string'. */
/* See @TT_MAC_LANGID_XXX and @TT_MS_LANGID_XXX for */
/* possible values. */
/* */
/* Registered OpenType values for `language_id' are */
/* always smaller than 0x8000; values equal or larger */
/* than 0x8000 usually indicate a language tag string */
/* (introduced in OpenType version 1.6). Use function */
/* @FT_Get_Sfnt_LangTag with `language_id' as its */
/* argument to retrieve the associated language tag. */
/* */
/* name_id :: An identifier for `string'. */
/* See @TT_NAME_ID_XXX for possible values. */
/* */
/* 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. */
/* depending on the (platform,encoding) pair, being */
/* either a string of bytes (without a terminating */
/* NULL byte) or containing UTF-16BE entities. */
/* */
/* string_len :: The length of `string' in bytes. */
/* */
/* <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. */
/* Please refer to the TrueType or OpenType specification for more */
/* details. */
/* */
typedef struct FT_SfntName_
{
@ -103,7 +111,7 @@ FT_BEGIN_HEADER
FT_UShort name_id;
FT_Byte* string; /* this string is *not* null-terminated! */
FT_UInt string_len; /* in bytes */
FT_UInt string_len; /* in bytes */
} FT_SfntName;
@ -147,54 +155,99 @@ FT_BEGIN_HEADER
/* */
/* <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. */
/* null-terminated. Note that you don't have to deallocate `string' */
/* by yourself; FreeType takes care of it if you call @FT_Done_Face. */
/* */
/* 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. */
/* */
/* `name' table format~1 entries can use language tags also, see */
/* @FT_Get_Sfnt_LangTag. */
/* */
FT_EXPORT( FT_Error )
FT_Get_Sfnt_Name( FT_Face face,
FT_UInt idx,
FT_SfntName *aname );
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
*
* @description:
* 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.
*
*/
#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
/*************************************************************************/
/* */
/* <Struct> */
/* FT_SfntLangTag */
/* */
/* <Description> */
/* A structure to model a language tag entry from an SFNT `name' */
/* table. */
/* */
/* <Fields> */
/* string :: The language tag string, encoded in UTF-16BE */
/* (without trailing NULL bytes). */
/* */
/* string_len :: The length of `string' in *bytes*. */
/* */
/* <Note> */
/* Please refer to the TrueType or OpenType specification for more */
/* details. */
/* */
/* <Since> */
/* 2.8 */
/* */
typedef struct FT_SfntLangTag_
{
FT_Byte* string; /* this string is *not* null-terminated! */
FT_UInt string_len; /* in bytes */
} FT_SfntLangTag;
/***************************************************************************
*
* @constant:
* FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
*
* @description:
* 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.
*
*/
#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' )
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Sfnt_LangTag */
/* */
/* <Description> */
/* Retrieve the language tag associated with a language ID of an SFNT */
/* `name' table entry. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* langID :: The language ID, as returned by @FT_Get_Sfnt_Name. */
/* This is always a value larger than 0x8000. */
/* */
/* <Output> */
/* alangTag :: The language tag associated with the `name' table */
/* entry's language ID. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* The `string' array returned in the `alangTag' structure is not */
/* null-terminated. Note that you don't have to deallocate `string' */
/* by yourself; FreeType takes care of it if you call @FT_Done_Face. */
/* */
/* Only `name' table format~1 supports language tags. For format~0 */
/* tables, this function always returns FT_Err_Invalid_Table. For */
/* invalid format~1 language ID values, FT_Err_Invalid_Argument is */
/* returned. */
/* */
/* <Since> */
/* 2.8 */
/* */
FT_EXPORT( FT_Error )
FT_Get_Sfnt_LangTag( FT_Face face,
FT_UInt langID,
FT_SfntLangTag *alangTag );
/* */
FT_END_HEADER
#endif /* __FT_SFNT_NAMES_H__ */
#endif /* FTSNAMES_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType path stroker (specification). */
/* */
/* Copyright 2002-2015 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FT_STROKE_H__
#define __FT_STROKE_H__
#ifndef FTSTROKE_H_
#define FTSTROKE_H_
#include <ft2build.h>
#include FT_OUTLINE_H
@ -136,7 +136,7 @@ FT_BEGIN_HEADER
* 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.
* backward compatibility.
*/
typedef enum FT_Stroker_LineJoin_
{
@ -466,7 +466,7 @@ FT_BEGIN_HEADER
* FT_Stroker_ConicTo
*
* @description:
* `Draw' a single quadratic Bézier in the stroker's current sub-path,
* `Draw' a single quadratic Bezier in the stroker's current sub-path,
* from the last position.
*
* @input:
@ -474,7 +474,7 @@ FT_BEGIN_HEADER
* The target stroker handle.
*
* control ::
* A pointer to a Bézier control point.
* A pointer to a Bezier control point.
*
* to ::
* A pointer to the destination point.
@ -498,7 +498,7 @@ FT_BEGIN_HEADER
* FT_Stroker_CubicTo
*
* @description:
* `Draw' a single cubic Bézier in the stroker's current sub-path,
* `Draw' a single cubic Bezier in the stroker's current sub-path,
* from the last position.
*
* @input:
@ -506,10 +506,10 @@ FT_BEGIN_HEADER
* The target stroker handle.
*
* control1 ::
* A pointer to the first Bézier control point.
* A pointer to the first Bezier control point.
*
* control2 ::
* A pointer to second Bézier control point.
* A pointer to second Bezier control point.
*
* to ::
* A pointer to the destination point.
@ -774,7 +774,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FT_STROKE_H__ */
#endif /* FTSTROKE_H_ */
/* END */

View File

@ -5,7 +5,7 @@
/* FreeType synthesizing code for emboldening and slanting */
/* (specification). */
/* */
/* Copyright 2000-2015 by */
/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -41,8 +41,8 @@
/* adapted to the particular needs. */
#ifndef __FTSYNTH_H__
#define __FTSYNTH_H__
#ifndef FTSYNTH_H_
#define FTSYNTH_H_
#include <ft2build.h>
@ -78,7 +78,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTSYNTH_H__ */
#endif /* FTSYNTH_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType low-level system interface definition (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTSYSTEM_H__
#define __FTSYSTEM_H__
#ifndef FTSYSTEM_H_
#define FTSYSTEM_H_
#include <ft2build.h>
@ -290,7 +290,7 @@ FT_BEGIN_HEADER
* 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.
* 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.)
*
@ -349,7 +349,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTSYSTEM_H__ */
#endif /* FTSYSTEM_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType trigonometric functions (specification). */
/* */
/* Copyright 2001-2015 by */
/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTTRIGON_H__
#define __FTTRIGON_H__
#ifndef FTTRIGON_H_
#define FTTRIGON_H_
#include FT_FREETYPE_H
@ -344,7 +344,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTTRIGON_H__ */
#endif /* FTTRIGON_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType simple types definitions (specification only). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTTYPES_H__
#define __FTTYPES_H__
#ifndef FTTYPES_H_
#define FTTYPES_H_
#include <ft2build.h>
@ -425,7 +425,7 @@ FT_BEGIN_HEADER
/* The address of the FreeType object that is under finalization. */
/* Its client data is accessed through its `generic' field. */
/* */
typedef void (*FT_Generic_Finalizer)(void* object);
typedef void (*FT_Generic_Finalizer)( void* object );
/*************************************************************************/
@ -596,7 +596,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTTYPES_H__ */
#endif /* FTTYPES_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing Windows fnt-specific data. */
/* */
/* Copyright 2003-2015 by */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTWINFNT_H__
#define __FTWINFNT_H__
#ifndef FTWINFNT_H_
#define FTWINFNT_H_
#include <ft2build.h>
#include FT_FREETYPE_H
@ -78,7 +78,7 @@ FT_BEGIN_HEADER
* Mac Roman encoding.
*
* FT_WinFNT_ID_OEM ::
* From Michael Pöttgen <michael@poettgen.de>:
* From Michael Poettgen <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',
@ -264,7 +264,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTWINFNT_H__ */
#endif /* FTWINFNT_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* High-level `autohint' module-specific interface (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -24,8 +24,8 @@
/*************************************************************************/
#ifndef __AUTOHINT_H__
#define __AUTOHINT_H__
#ifndef AUTOHINT_H_
#define AUTOHINT_H_
/*************************************************************************/
@ -238,7 +238,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __AUTOHINT_H__ */
#endif /* AUTOHINT_H_ */
/* END */

View File

@ -0,0 +1,108 @@
/***************************************************************************/
/* */
/* cffotypes.h */
/* */
/* Basic OpenType/CFF object type definitions (specification). */
/* */
/* Copyright 2017-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* 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. */
/* */
/***************************************************************************/
#ifndef CFFOTYPES_H_
#define CFFOTYPES_H_
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_CFF_TYPES_H
#include FT_INTERNAL_TRUETYPE_TYPES_H
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
FT_BEGIN_HEADER
typedef TT_Face CFF_Face;
/*************************************************************************/
/* */
/* <Type> */
/* CFF_Size */
/* */
/* <Description> */
/* A handle to an OpenType size object. */
/* */
typedef struct CFF_SizeRec_
{
FT_SizeRec root;
FT_ULong strike_index; /* 0xFFFFFFFF to indicate invalid */
} CFF_SizeRec, *CFF_Size;
/*************************************************************************/
/* */
/* <Type> */
/* CFF_GlyphSlot */
/* */
/* <Description> */
/* A handle to an OpenType glyph slot object. */
/* */
typedef struct CFF_GlyphSlotRec_
{
FT_GlyphSlotRec root;
FT_Bool hint;
FT_Bool scaled;
FT_Fixed x_scale;
FT_Fixed y_scale;
} CFF_GlyphSlotRec, *CFF_GlyphSlot;
/*************************************************************************/
/* */
/* <Type> */
/* CFF_Internal */
/* */
/* <Description> */
/* The interface to the `internal' field of `FT_Size'. */
/* */
typedef struct CFF_InternalRec_
{
PSH_Globals topfont;
PSH_Globals subfonts[CFF_MAX_CID_FONTS];
} CFF_InternalRec, *CFF_Internal;
/*************************************************************************/
/* */
/* Subglyph transformation record. */
/* */
typedef struct CFF_Transform_
{
FT_Fixed xx, xy; /* transformation matrix coefficients */
FT_Fixed yx, yy;
FT_F26Dot6 ox, oy; /* offsets */
} CFF_Transform;
FT_END_HEADER
#endif /* CFFOTYPES_H_ */
/* END */

View File

@ -0,0 +1,412 @@
/***************************************************************************/
/* */
/* cfftypes.h */
/* */
/* Basic OpenType/CFF type definitions and interface (specification */
/* only). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* 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. */
/* */
/***************************************************************************/
#ifndef CFFTYPES_H_
#define CFFTYPES_H_
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_TYPE1_TABLES_H
#include FT_INTERNAL_SERVICE_H
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
#include FT_INTERNAL_TYPE1_TYPES_H
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Struct> */
/* CFF_IndexRec */
/* */
/* <Description> */
/* A structure used to model a CFF Index table. */
/* */
/* <Fields> */
/* stream :: The source input stream. */
/* */
/* start :: The position of the first index byte in the */
/* input stream. */
/* */
/* count :: The number of elements in the index. */
/* */
/* off_size :: The size in bytes of object offsets in index. */
/* */
/* data_offset :: The position of first data byte in the index's */
/* bytes. */
/* */
/* data_size :: The size of the data table in this index. */
/* */
/* offsets :: A table of element offsets in the index. Must be */
/* loaded explicitly. */
/* */
/* bytes :: If the index is loaded in memory, its bytes. */
/* */
typedef struct CFF_IndexRec_
{
FT_Stream stream;
FT_ULong start;
FT_UInt hdr_size;
FT_UInt count;
FT_Byte off_size;
FT_ULong data_offset;
FT_ULong data_size;
FT_ULong* offsets;
FT_Byte* bytes;
} CFF_IndexRec, *CFF_Index;
typedef struct CFF_EncodingRec_
{
FT_UInt format;
FT_ULong offset;
FT_UInt count;
FT_UShort sids [256]; /* avoid dynamic allocations */
FT_UShort codes[256];
} CFF_EncodingRec, *CFF_Encoding;
typedef struct CFF_CharsetRec_
{
FT_UInt format;
FT_ULong offset;
FT_UShort* sids;
FT_UShort* cids; /* the inverse mapping of `sids'; only needed */
/* for CID-keyed fonts */
FT_UInt max_cid;
FT_UInt num_glyphs;
} CFF_CharsetRec, *CFF_Charset;
/* cf. similar fields in file `ttgxvar.h' from the `truetype' module */
typedef struct CFF_VarData_
{
#if 0
FT_UInt itemCount; /* not used; always zero */
FT_UInt shortDeltaCount; /* not used; always zero */
#endif
FT_UInt regionIdxCount; /* number of region indexes */
FT_UInt* regionIndices; /* array of `regionIdxCount' indices; */
/* these index `varRegionList' */
} CFF_VarData;
/* contribution of one axis to a region */
typedef struct CFF_AxisCoords_
{
FT_Fixed startCoord;
FT_Fixed peakCoord; /* zero peak means no effect (factor = 1) */
FT_Fixed endCoord;
} CFF_AxisCoords;
typedef struct CFF_VarRegion_
{
CFF_AxisCoords* axisList; /* array of axisCount records */
} CFF_VarRegion;
typedef struct CFF_VStoreRec_
{
FT_UInt dataCount;
CFF_VarData* varData; /* array of dataCount records */
/* vsindex indexes this array */
FT_UShort axisCount;
FT_UInt regionCount; /* total number of regions defined */
CFF_VarRegion* varRegionList;
} CFF_VStoreRec, *CFF_VStore;
/* forward reference */
typedef struct CFF_FontRec_* CFF_Font;
/* This object manages one cached blend vector. */
/* */
/* There is a BlendRec for Private DICT parsing in each subfont */
/* and a BlendRec for charstrings in CF2_Font instance data. */
/* A cached BV may be used across DICTs or Charstrings if inputs */
/* have not changed. */
/* */
/* `usedBV' is reset at the start of each parse or charstring. */
/* vsindex cannot be changed after a BV is used. */
/* */
/* Note: NDV is long (32/64 bit), while BV is 16.16 (FT_Int32). */
typedef struct CFF_BlendRec_
{
FT_Bool builtBV; /* blendV has been built */
FT_Bool usedBV; /* blendV has been used */
CFF_Font font; /* top level font struct */
FT_UInt lastVsindex; /* last vsindex used */
FT_UInt lenNDV; /* normDV length (aka numAxes) */
FT_Fixed* lastNDV; /* last NDV used */
FT_UInt lenBV; /* BlendV length (aka numMasters) */
FT_Int32* BV; /* current blendV (per DICT/glyph) */
} CFF_BlendRec, *CFF_Blend;
typedef struct CFF_FontRecDictRec_
{
FT_UInt version;
FT_UInt notice;
FT_UInt copyright;
FT_UInt full_name;
FT_UInt family_name;
FT_UInt weight;
FT_Bool is_fixed_pitch;
FT_Fixed italic_angle;
FT_Fixed underline_position;
FT_Fixed underline_thickness;
FT_Int paint_type;
FT_Int charstring_type;
FT_Matrix font_matrix;
FT_Bool has_font_matrix;
FT_ULong units_per_em; /* temporarily used as scaling value also */
FT_Vector font_offset;
FT_ULong unique_id;
FT_BBox font_bbox;
FT_Pos stroke_width;
FT_ULong charset_offset;
FT_ULong encoding_offset;
FT_ULong charstrings_offset;
FT_ULong private_offset;
FT_ULong private_size;
FT_Long synthetic_base;
FT_UInt embedded_postscript;
/* these should only be used for the top-level font dictionary */
FT_UInt cid_registry;
FT_UInt cid_ordering;
FT_Long cid_supplement;
FT_Long cid_font_version;
FT_Long cid_font_revision;
FT_Long cid_font_type;
FT_ULong cid_count;
FT_ULong cid_uid_base;
FT_ULong cid_fd_array_offset;
FT_ULong cid_fd_select_offset;
FT_UInt cid_font_name;
/* the next fields come from the data of the deprecated */
/* `MultipleMaster' operator; they are needed to parse the (also */
/* deprecated) `blend' operator in Type 2 charstrings */
FT_UShort num_designs;
FT_UShort num_axes;
/* fields for CFF2 */
FT_ULong vstore_offset;
FT_UInt maxstack;
} CFF_FontRecDictRec, *CFF_FontRecDict;
/* forward reference */
typedef struct CFF_SubFontRec_* CFF_SubFont;
typedef struct CFF_PrivateRec_
{
FT_Byte num_blue_values;
FT_Byte num_other_blues;
FT_Byte num_family_blues;
FT_Byte num_family_other_blues;
FT_Pos blue_values[14];
FT_Pos other_blues[10];
FT_Pos family_blues[14];
FT_Pos family_other_blues[10];
FT_Fixed blue_scale;
FT_Pos blue_shift;
FT_Pos blue_fuzz;
FT_Pos standard_width;
FT_Pos standard_height;
FT_Byte num_snap_widths;
FT_Byte num_snap_heights;
FT_Pos snap_widths[13];
FT_Pos snap_heights[13];
FT_Bool force_bold;
FT_Fixed force_bold_threshold;
FT_Int lenIV;
FT_Int language_group;
FT_Fixed expansion_factor;
FT_Long initial_random_seed;
FT_ULong local_subrs_offset;
FT_Pos default_width;
FT_Pos nominal_width;
/* fields for CFF2 */
FT_UInt vsindex;
CFF_SubFont subfont;
} CFF_PrivateRec, *CFF_Private;
typedef struct CFF_FDSelectRec_
{
FT_Byte format;
FT_UInt range_count;
/* that's the table, taken from the file `as is' */
FT_Byte* data;
FT_UInt data_size;
/* small cache for format 3 only */
FT_UInt cache_first;
FT_UInt cache_count;
FT_Byte cache_fd;
} CFF_FDSelectRec, *CFF_FDSelect;
/* A SubFont packs a font dict and a private dict together. They are */
/* needed to support CID-keyed CFF fonts. */
typedef struct CFF_SubFontRec_
{
CFF_FontRecDictRec font_dict;
CFF_PrivateRec private_dict;
/* fields for CFF2 */
CFF_BlendRec blend; /* current blend vector */
FT_UInt lenNDV; /* current length NDV or zero */
FT_Fixed* NDV; /* ptr to current NDV or NULL */
/* `blend_stack' is a writable buffer to hold blend results. */
/* This buffer is to the side of the normal cff parser stack; */
/* `cff_parse_blend' and `cff_blend_doBlend' push blend results here. */
/* The normal stack then points to these values instead of the DICT */
/* because all other operators in Private DICT clear the stack. */
/* `blend_stack' could be cleared at each operator other than blend. */
/* Blended values are stored as 5-byte fixed point values. */
FT_Byte* blend_stack; /* base of stack allocation */
FT_Byte* blend_top; /* first empty slot */
FT_UInt blend_used; /* number of bytes in use */
FT_UInt blend_alloc; /* number of bytes allocated */
CFF_IndexRec local_subrs_index;
FT_Byte** local_subrs; /* array of pointers */
/* into Local Subrs INDEX data */
FT_UInt32 random;
} CFF_SubFontRec;
#define CFF_MAX_CID_FONTS 256
typedef struct CFF_FontRec_
{
FT_Library library;
FT_Stream stream;
FT_Memory memory; /* TODO: take this from stream->memory? */
FT_ULong base_offset; /* offset to start of CFF */
FT_UInt num_faces;
FT_UInt num_glyphs;
FT_Byte version_major;
FT_Byte version_minor;
FT_Byte header_size;
FT_UInt top_dict_length; /* cff2 only */
FT_Bool cff2;
CFF_IndexRec name_index;
CFF_IndexRec top_dict_index;
CFF_IndexRec global_subrs_index;
CFF_EncodingRec encoding;
CFF_CharsetRec charset;
CFF_IndexRec charstrings_index;
CFF_IndexRec font_dict_index;
CFF_IndexRec private_index;
CFF_IndexRec local_subrs_index;
FT_String* font_name;
/* array of pointers into Global Subrs INDEX data */
FT_Byte** global_subrs;
/* array of pointers into String INDEX data stored at string_pool */
FT_UInt num_strings;
FT_Byte** strings;
FT_Byte* string_pool;
FT_ULong string_pool_size;
CFF_SubFontRec top_font;
FT_UInt num_subfonts;
CFF_SubFont subfonts[CFF_MAX_CID_FONTS];
CFF_FDSelectRec fd_select;
/* interface to PostScript hinter */
PSHinter_Service pshinter;
/* interface to Postscript Names service */
FT_Service_PsCMaps psnames;
/* interface to CFFLoad service */
const void* cffload;
/* since version 2.3.0 */
PS_FontInfoRec* font_info; /* font info dictionary */
/* since version 2.3.6 */
FT_String* registry;
FT_String* ordering;
/* since version 2.4.12 */
FT_Generic cf2_instance;
/* since version 2.7.1 */
CFF_VStoreRec vstore; /* parsed vstore structure */
/* since version 2.9 */
PS_FontExtraRec* font_extra;
} CFF_FontRec;
FT_END_HEADER
#endif /* CFFTYPES_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Arithmetic computations (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTCALC_H__
#define __FTCALC_H__
#ifndef FTCALC_H_
#define FTCALC_H_
#include <ft2build.h>
@ -47,7 +47,7 @@ FT_BEGIN_HEADER
FT_MulFix_arm( FT_Int32 a,
FT_Int32 b )
{
register FT_Int32 t, t2;
FT_Int32 t, t2;
__asm
@ -80,7 +80,7 @@ FT_BEGIN_HEADER
FT_MulFix_arm( FT_Int32 a,
FT_Int32 b )
{
register FT_Int32 t, t2;
FT_Int32 t, t2;
__asm__ __volatile__ (
@ -116,7 +116,7 @@ FT_BEGIN_HEADER
FT_MulFix_i386( FT_Int32 a,
FT_Int32 b )
{
register FT_Int32 result;
FT_Int32 result;
__asm__ __volatile__ (
@ -152,7 +152,7 @@ FT_BEGIN_HEADER
FT_MulFix_i386( FT_Int32 a,
FT_Int32 b )
{
register FT_Int32 result;
FT_Int32 result;
__asm
{
@ -399,20 +399,46 @@ FT_BEGIN_HEADER
#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 )
#define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) << 2 )
#define FLOAT_TO_FIXED( x ) ( (FT_Long)( x * 65536.0 ) )
#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) * 64 ) /* << 6 */
#define INT_TO_F2DOT14( x ) ( (FT_Long)(x) * 16384 ) /* << 14 */
#define INT_TO_FIXED( x ) ( (FT_Long)(x) * 65536 ) /* << 16 */
#define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) * 4 ) /* << 2 */
#define FIXED_TO_INT( x ) ( FT_RoundFix( x ) >> 16 )
#define ROUND_F26DOT6( x ) ( x >= 0 ? ( ( (x) + 32 ) & -64 ) \
: ( -( ( 32 - (x) ) & -64 ) ) )
/*
* The following macros have two purposes.
*
* . Tag places where overflow is expected and harmless.
*
* . Avoid run-time sanitizer errors.
*
* Use with care!
*/
#define ADD_LONG( a, b ) \
(FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) )
#define SUB_LONG( a, b ) \
(FT_Long)( (FT_ULong)(a) - (FT_ULong)(b) )
#define MUL_LONG( a, b ) \
(FT_Long)( (FT_ULong)(a) * (FT_ULong)(b) )
#define NEG_LONG( a ) \
(FT_Long)( (FT_ULong)0 - (FT_ULong)(a) )
#define ADD_INT32( a, b ) \
(FT_Int32)( (FT_UInt32)(a) + (FT_UInt32)(b) )
#define SUB_INT32( a, b ) \
(FT_Int32)( (FT_UInt32)(a) - (FT_UInt32)(b) )
#define MUL_INT32( a, b ) \
(FT_Int32)( (FT_UInt32)(a) * (FT_UInt32)(b) )
#define NEG_INT32( a ) \
(FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
FT_END_HEADER
#endif /* __FTCALC_H__ */
#endif /* FTCALC_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Debugging and logging component (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -21,8 +21,8 @@
/***************************************************************************/
#ifndef __FTDEBUG_H__
#define __FTDEBUG_H__
#ifndef FTDEBUG_H_
#define FTDEBUG_H_
#include <ft2build.h>
@ -249,7 +249,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTDEBUG_H__ */
#endif /* FTDEBUG_H_ */
/* END */

View File

@ -0,0 +1,400 @@
/***************************************************************************/
/* */
/* ftdrv.h */
/* */
/* FreeType internal font driver interface (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* 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. */
/* */
/***************************************************************************/
#ifndef FTDRV_H_
#define FTDRV_H_
#include <ft2build.h>
#include FT_MODULE_H
FT_BEGIN_HEADER
typedef FT_Error
(*FT_Face_InitFunc)( FT_Stream stream,
FT_Face face,
FT_Int typeface_index,
FT_Int num_params,
FT_Parameter* parameters );
typedef void
(*FT_Face_DoneFunc)( FT_Face face );
typedef FT_Error
(*FT_Size_InitFunc)( FT_Size size );
typedef void
(*FT_Size_DoneFunc)( FT_Size size );
typedef FT_Error
(*FT_Slot_InitFunc)( FT_GlyphSlot slot );
typedef void
(*FT_Slot_DoneFunc)( FT_GlyphSlot slot );
typedef FT_Error
(*FT_Size_RequestFunc)( FT_Size size,
FT_Size_Request req );
typedef FT_Error
(*FT_Size_SelectFunc)( FT_Size size,
FT_ULong size_index );
typedef FT_Error
(*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
FT_Size size,
FT_UInt glyph_index,
FT_Int32 load_flags );
typedef FT_Error
(*FT_Face_GetKerningFunc)( FT_Face face,
FT_UInt left_glyph,
FT_UInt right_glyph,
FT_Vector* kerning );
typedef FT_Error
(*FT_Face_AttachFunc)( FT_Face face,
FT_Stream stream );
typedef FT_Error
(*FT_Face_GetAdvancesFunc)( FT_Face face,
FT_UInt first,
FT_UInt count,
FT_Int32 flags,
FT_Fixed* advances );
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Driver_ClassRec */
/* */
/* <Description> */
/* The font driver class. This structure mostly contains pointers to */
/* driver methods. */
/* */
/* <Fields> */
/* root :: The parent module. */
/* */
/* face_object_size :: The size of a face object in bytes. */
/* */
/* size_object_size :: The size of a size object in bytes. */
/* */
/* slot_object_size :: The size of a glyph object in bytes. */
/* */
/* init_face :: The format-specific face constructor. */
/* */
/* done_face :: The format-specific face destructor. */
/* */
/* init_size :: The format-specific size constructor. */
/* */
/* done_size :: The format-specific size destructor. */
/* */
/* init_slot :: The format-specific slot constructor. */
/* */
/* done_slot :: The format-specific slot destructor. */
/* */
/* */
/* load_glyph :: A function handle to load a glyph to a slot. */
/* This field is mandatory! */
/* */
/* get_kerning :: A function handle to return the unscaled */
/* kerning for a given pair of glyphs. Can be */
/* set to 0 if the format doesn't support */
/* kerning. */
/* */
/* attach_file :: This function handle is used to read */
/* additional data for a face from another */
/* file/stream. For example, this can be used to */
/* add data from AFM or PFM files on a Type 1 */
/* face, or a CIDMap on a CID-keyed face. */
/* */
/* get_advances :: A function handle used to return advance */
/* widths of `count' glyphs (in font units), */
/* starting at `first'. The `vertical' flag must */
/* be set to get vertical advance heights. The */
/* `advances' buffer is caller-allocated. */
/* The idea of this function is to be able to */
/* perform device-independent text layout without */
/* loading a single glyph image. */
/* */
/* request_size :: A handle to a function used to request the new */
/* character size. Can be set to 0 if the */
/* scaling done in the base layer suffices. */
/* */
/* select_size :: A handle to a function used to select a new */
/* fixed size. It is used only if */
/* @FT_FACE_FLAG_FIXED_SIZES is set. Can be set */
/* to 0 if the scaling done in the base layer */
/* suffices. */
/* <Note> */
/* Most function pointers, with the exception of `load_glyph', can be */
/* set to 0 to indicate a default behaviour. */
/* */
typedef struct FT_Driver_ClassRec_
{
FT_Module_Class root;
FT_Long face_object_size;
FT_Long size_object_size;
FT_Long slot_object_size;
FT_Face_InitFunc init_face;
FT_Face_DoneFunc done_face;
FT_Size_InitFunc init_size;
FT_Size_DoneFunc done_size;
FT_Slot_InitFunc init_slot;
FT_Slot_DoneFunc done_slot;
FT_Slot_LoadFunc load_glyph;
FT_Face_GetKerningFunc get_kerning;
FT_Face_AttachFunc attach_file;
FT_Face_GetAdvancesFunc get_advances;
/* since version 2.2 */
FT_Size_RequestFunc request_size;
FT_Size_SelectFunc select_size;
} FT_Driver_ClassRec, *FT_Driver_Class;
/*************************************************************************/
/* */
/* <Macro> */
/* FT_DECLARE_DRIVER */
/* */
/* <Description> */
/* Used to create a forward declaration of an FT_Driver_ClassRec */
/* struct instance. */
/* */
/* <Macro> */
/* FT_DEFINE_DRIVER */
/* */
/* <Description> */
/* Used to initialize an instance of FT_Driver_ClassRec struct. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */
/* called with a pointer where the allocated structure is returned. */
/* And when it is no longer needed a `destroy' function needs to be */
/* called to release that allocation. */
/* */
/* `ftinit.c' (ft_create_default_module_classes) already contains a */
/* mechanism to call these functions for the default modules */
/* described in `ftmodule.h'. */
/* */
/* Notice that the created `create' and `destroy' functions call */
/* `pic_init' and `pic_free' to allow you to manually allocate and */
/* initialize any additional global data, like a module specific */
/* interface, and put them in the global pic container defined in */
/* `ftpic.h'. If you don't need them just implement the functions as */
/* empty to resolve the link error. Also the `pic_init' and */
/* `pic_free' functions should be declared in `pic.h', to be referred */
/* by driver definition calling `FT_DEFINE_DRIVER' in following. */
/* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro is */
/* used). */
/* */
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DECLARE_DRIVER( class_ ) \
FT_CALLBACK_TABLE \
const FT_Driver_ClassRec class_;
#define FT_DEFINE_DRIVER( \
class_, \
flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
init_, \
done_, \
get_interface_, \
face_object_size_, \
size_object_size_, \
slot_object_size_, \
init_face_, \
done_face_, \
init_size_, \
done_size_, \
init_slot_, \
done_slot_, \
load_glyph_, \
get_kerning_, \
attach_file_, \
get_advances_, \
request_size_, \
select_size_ ) \
FT_CALLBACK_TABLE_DEF \
const FT_Driver_ClassRec class_ = \
{ \
FT_DEFINE_ROOT_MODULE( flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
init_, \
done_, \
get_interface_ ) \
\
face_object_size_, \
size_object_size_, \
slot_object_size_, \
\
init_face_, \
done_face_, \
\
init_size_, \
done_size_, \
\
init_slot_, \
done_slot_, \
\
load_glyph_, \
\
get_kerning_, \
attach_file_, \
get_advances_, \
\
request_size_, \
select_size_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DECLARE_DRIVER( class_ ) FT_DECLARE_MODULE( class_ )
#define FT_DEFINE_DRIVER( \
class_, \
flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
init_, \
done_, \
get_interface_, \
face_object_size_, \
size_object_size_, \
slot_object_size_, \
init_face_, \
done_face_, \
init_size_, \
done_size_, \
init_slot_, \
done_slot_, \
load_glyph_, \
get_kerning_, \
attach_file_, \
get_advances_, \
request_size_, \
select_size_ ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_Module_Class* clazz ) \
{ \
FT_Memory memory = library->memory; \
FT_Driver_Class dclazz = (FT_Driver_Class)clazz; \
\
\
class_ ## _pic_free( library ); \
if ( dclazz ) \
FT_FREE( dclazz ); \
} \
\
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_Module_Class** output_class ) \
{ \
FT_Driver_Class clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
return error; \
\
error = class_ ## _pic_init( library ); \
if ( error ) \
{ \
FT_FREE( clazz ); \
return error; \
} \
\
FT_DEFINE_ROOT_MODULE( flags_, \
size_, \
name_, \
version_, \
requires_, \
interface_, \
init_, \
done_, \
get_interface_ ) \
\
clazz->face_object_size = face_object_size_; \
clazz->size_object_size = size_object_size_; \
clazz->slot_object_size = slot_object_size_; \
\
clazz->init_face = init_face_; \
clazz->done_face = done_face_; \
\
clazz->init_size = init_size_; \
clazz->done_size = done_size_; \
\
clazz->init_slot = init_slot_; \
clazz->done_slot = done_slot_; \
\
clazz->load_glyph = load_glyph_; \
\
clazz->get_kerning = get_kerning_; \
clazz->attach_file = attach_file_; \
clazz->get_advances = get_advances_; \
\
clazz->request_size = request_size_; \
clazz->select_size = select_size_; \
\
*output_class = (FT_Module_Class*)clazz; \
\
return FT_Err_Ok; \
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER
#endif /* FTDRV_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType glyph loader (specification). */
/* */
/* Copyright 2002-2015 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTGLOADR_H__
#define __FTGLOADR_H__
#ifndef FTGLOADR_H_
#define FTGLOADR_H_
#include <ft2build.h>
@ -36,24 +36,6 @@ FT_BEGIN_HEADER
/* The glyph loader is an internal object used to load several glyphs */
/* together (for example, in the case of composites). */
/* */
/* <Note> */
/* The glyph loader implementation is not part of the high-level API, */
/* hence the forward structure declaration. */
/* */
typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ;
#if 0 /* moved to freetype.h in version 2.2 */
#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
#endif
typedef struct FT_SubGlyphRec_
{
FT_Int index;
@ -89,7 +71,7 @@ FT_BEGIN_HEADER
void* other; /* for possible future extension? */
} FT_GlyphLoaderRec;
} FT_GlyphLoaderRec, *FT_GlyphLoader;
/* create new empty glyph loader */
@ -166,7 +148,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTGLOADR_H__ */
#endif /* FTGLOADR_H_ */
/* END */

View File

@ -0,0 +1,136 @@
/***************************************************************************/
/* */
/* fthash.h */
/* */
/* Hashing functions (specification). */
/* */
/***************************************************************************/
/*
* Copyright 2000 Computing Research Labs, New Mexico State University
* Copyright 2001-2015
* Francesco Zappa Nardelli
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*************************************************************************/
/* */
/* This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50 */
/* */
/* taken from Mark Leisher's xmbdfed package */
/* */
/*************************************************************************/
#ifndef FTHASH_H_
#define FTHASH_H_
#include <ft2build.h>
#include FT_FREETYPE_H
FT_BEGIN_HEADER
typedef union FT_Hashkey_
{
FT_Int num;
const char* str;
} FT_Hashkey;
typedef struct FT_HashnodeRec_
{
FT_Hashkey key;
size_t data;
} FT_HashnodeRec;
typedef struct FT_HashnodeRec_ *FT_Hashnode;
typedef FT_ULong
(*FT_Hash_LookupFunc)( FT_Hashkey* key );
typedef FT_Bool
(*FT_Hash_CompareFunc)( FT_Hashkey* a,
FT_Hashkey* b );
typedef struct FT_HashRec_
{
FT_UInt limit;
FT_UInt size;
FT_UInt used;
FT_Hash_LookupFunc lookup;
FT_Hash_CompareFunc compare;
FT_Hashnode* table;
} FT_HashRec;
typedef struct FT_HashRec_ *FT_Hash;
FT_Error
ft_hash_str_init( FT_Hash hash,
FT_Memory memory );
FT_Error
ft_hash_num_init( FT_Hash hash,
FT_Memory memory );
void
ft_hash_str_free( FT_Hash hash,
FT_Memory memory );
#define ft_hash_num_free ft_hash_str_free
FT_Error
ft_hash_str_insert( const char* key,
size_t data,
FT_Hash hash,
FT_Memory memory );
FT_Error
ft_hash_num_insert( FT_Int num,
size_t data,
FT_Hash hash,
FT_Memory memory );
size_t*
ft_hash_str_lookup( const char* key,
FT_Hash hash );
size_t*
ft_hash_num_lookup( FT_Int num,
FT_Hash hash );
FT_END_HEADER
#endif /* FTHASH_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType memory management macros (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTMEMORY_H__
#define __FTMEMORY_H__
#ifndef FTMEMORY_H_
#define FTMEMORY_H_
#include <ft2build.h>
@ -65,13 +65,15 @@ FT_BEGIN_HEADER
#ifdef __cplusplus
extern "C++"
extern "C++"
{
template <typename T> inline T*
cplusplus_typeof( T*,
void *v )
{
return static_cast <T*> ( v );
}
}
#define FT_ASSIGNP( p, val ) (p) = cplusplus_typeof( (p), (val) )
@ -106,10 +108,12 @@ FT_BEGIN_HEADER
/*
* The allocation functions return a pointer, and the error code
* is written to through the `p_error' parameter. See below for
* for documentation.
* is written to through the `p_error' parameter.
*/
/* The `q' variants of the functions below (`q' for `quick') don't fill */
/* the allocated or reallocated memory with zero bytes. */
FT_BASE( FT_Pointer )
ft_mem_alloc( FT_Memory memory,
FT_Long size,
@ -141,6 +145,9 @@ FT_BEGIN_HEADER
const void* P );
/* The `Q' variants of the macros below (`Q' for `quick') don't fill */
/* the allocated or reallocated memory with zero bytes. */
#define FT_MEM_ALLOC( ptr, size ) \
FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, \
(FT_Long)(size), \
@ -203,7 +210,7 @@ FT_BEGIN_HEADER
NULL, \
&error ) )
#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \
#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
(FT_Long)(itmsz), \
(FT_Long)(oldcnt), \
@ -380,7 +387,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTMEMORY_H__ */
#endif /* FTMEMORY_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType private base classes (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -23,8 +23,8 @@
/*************************************************************************/
#ifndef __FTOBJS_H__
#define __FTOBJS_H__
#ifndef FTOBJS_H_
#define FTOBJS_H_
#include <ft2build.h>
#include FT_RENDER_H
@ -36,6 +36,7 @@
#include FT_INTERNAL_AUTOHINT_H
#include FT_INTERNAL_SERVICE_H
#include FT_INTERNAL_PIC_H
#include FT_INTERNAL_CALC_H
#ifdef FT_CONFIG_OPTION_INCREMENTAL
#include FT_INCREMENTAL_H
@ -84,14 +85,30 @@ FT_BEGIN_HEADER
: y + ( 3 * x >> 3 ) )
/* we use FT_TYPEOF to suppress signedness compilation warnings */
#define FT_PAD_FLOOR( x, n ) ( (x) & ~FT_TYPEOF( x )( (n)-1 ) )
#define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + ((n)/2), n )
#define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + ((n)-1), n )
#define FT_PAD_FLOOR( x, n ) ( (x) & ~FT_TYPEOF( x )( (n) - 1 ) )
#define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + (n) / 2, n )
#define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + (n) - 1, n )
#define FT_PIX_FLOOR( x ) ( (x) & ~FT_TYPEOF( x )63 )
#define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x) + 32 )
#define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 )
/* specialized versions (for signed values) */
/* that don't produce run-time errors due to integer overflow */
#define FT_PAD_ROUND_LONG( x, n ) FT_PAD_FLOOR( ADD_LONG( (x), (n) / 2 ), \
n )
#define FT_PAD_CEIL_LONG( x, n ) FT_PAD_FLOOR( ADD_LONG( (x), (n) - 1 ), \
n )
#define FT_PIX_ROUND_LONG( x ) FT_PIX_FLOOR( ADD_LONG( (x), 32 ) )
#define FT_PIX_CEIL_LONG( x ) FT_PIX_FLOOR( ADD_LONG( (x), 63 ) )
#define FT_PAD_ROUND_INT32( x, n ) FT_PAD_FLOOR( ADD_INT32( (x), (n) / 2 ), \
n )
#define FT_PAD_CEIL_INT32( x, n ) FT_PAD_FLOOR( ADD_INT32( (x), (n) - 1 ), \
n )
#define FT_PIX_ROUND_INT32( x ) FT_PIX_FLOOR( ADD_INT32( (x), 32 ) )
#define FT_PIX_CEIL_INT32( x ) FT_PIX_FLOOR( ADD_INT32( (x), 63 ) )
/*
* character classification functions -- since these are used to parse
@ -138,8 +155,8 @@ FT_BEGIN_HEADER
} FT_CMapRec;
/* typecase any pointer to a charmap handle */
#define FT_CMAP( x ) ((FT_CMap)( x ))
/* typecast any pointer to a charmap handle */
#define FT_CMAP( x ) ( (FT_CMap)( x ) )
/* obvious macros */
#define FT_CMAP_PLATFORM_ID( x ) FT_CMAP( x )->charmap.platform_id
@ -193,6 +210,7 @@ FT_BEGIN_HEADER
typedef struct FT_CMap_ClassRec_
{
FT_ULong size;
FT_CMap_InitFunc init;
FT_CMap_DoneFunc done;
FT_CMap_CharIndexFunc char_index;
@ -294,6 +312,27 @@ FT_BEGIN_HEADER
FT_CMap_Done( FT_CMap cmap );
/* adds LCD padding to Min and Max boundaries */
FT_BASE( void )
ft_lcd_padding( FT_Pos* Min,
FT_Pos* Max,
FT_GlyphSlot slot );
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
FT_Render_Mode render_mode,
FT_Byte* weights );
/* This is the default LCD filter, an in-place, 5-tap FIR filter. */
FT_BASE( void )
ft_lcd_filter_fir( FT_Bitmap* bitmap,
FT_Render_Mode mode,
FT_LcdFiveTapFilter weights );
#endif /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
/*************************************************************************/
/* */
/* <Struct> */
@ -341,11 +380,20 @@ FT_BEGIN_HEADER
/* this data when first opened. This field exists only if */
/* @FT_CONFIG_OPTION_INCREMENTAL is defined. */
/* */
/* ignore_unpatented_hinter :: */
/* This boolean flag instructs the glyph loader to ignore the */
/* native font hinter, if one is found. This is exclusively used */
/* in the case when the unpatented hinter is compiled within the */
/* library. */
/* no_stem_darkening :: */
/* Overrides the module-level default, see @stem-darkening[cff], */
/* for example. FALSE and TRUE toggle stem darkening on and off, */
/* respectively, value~-1 means to use the module/driver default. */
/* */
/* random_seed :: */
/* If positive, override the seed value for the CFF `random' */
/* operator. Value~0 means to use the font's value. Value~-1 */
/* means to use the CFF driver's default. */
/* */
/* lcd_weights :: */
/* lcd_filter_func :: */
/* If subpixel rendering is activated, the LCD filtering weights */
/* and callback function. */
/* */
/* refcount :: */
/* A counter initialized to~1 at the time an @FT_Face structure is */
@ -355,9 +403,9 @@ FT_BEGIN_HEADER
/* */
typedef struct FT_Face_InternalRec_
{
FT_Matrix transform_matrix;
FT_Vector transform_delta;
FT_Int transform_flags;
FT_Matrix transform_matrix;
FT_Vector transform_delta;
FT_Int transform_flags;
FT_ServiceCacheRec services;
@ -365,8 +413,15 @@ FT_BEGIN_HEADER
FT_Incremental_InterfaceRec* incremental_interface;
#endif
FT_Bool ignore_unpatented_hinter;
FT_Int refcount;
FT_Char no_stem_darkening;
FT_Int32 random_seed;
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
FT_LcdFiveTapFilter lcd_weights; /* filter weights, if any */
FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
#endif
FT_Int refcount;
} FT_Face_InternalRec;
@ -419,8 +474,6 @@ FT_BEGIN_HEADER
} FT_GlyphSlot_InternalRec;
#if 0
/*************************************************************************/
/* */
/* <Struct> */
@ -428,18 +481,26 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* This structure contains the internal fields of each FT_Size */
/* object. Currently, it's empty. */
/* object. */
/* */
/* <Fields> */
/* module_data :: Data specific to a driver module. */
/* */
/* autohint_mode :: The used auto-hinting mode. */
/* */
/* autohint_metrics :: Metrics used by the auto-hinter. */
/* */
/*************************************************************************/
typedef struct FT_Size_InternalRec_
{
/* empty */
void* module_data;
FT_Render_Mode autohint_mode;
FT_Size_Metrics autohint_metrics;
} FT_Size_InternalRec;
#endif
/*************************************************************************/
/*************************************************************************/
@ -479,7 +540,8 @@ FT_BEGIN_HEADER
/* typecast an object to an FT_Module */
#define FT_MODULE( x ) ((FT_Module)( x ))
#define FT_MODULE( x ) ( (FT_Module)(x) )
#define FT_MODULE_CLASS( x ) FT_MODULE( x )->clazz
#define FT_MODULE_LIBRARY( x ) FT_MODULE( x )->library
#define FT_MODULE_MEMORY( x ) FT_MODULE( x )->memory
@ -506,6 +568,9 @@ FT_BEGIN_HEADER
#define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
FT_MODULE_DRIVER_HAS_HINTER )
#define FT_DRIVER_HINTS_LIGHTLY( x ) ( FT_MODULE_CLASS( x )->module_flags & \
FT_MODULE_DRIVER_HINTS_LIGHTLY )
/*************************************************************************/
/* */
@ -534,7 +599,16 @@ FT_BEGIN_HEADER
FT_BASE( FT_Pointer )
ft_module_get_service( FT_Module module,
const char* service_id );
const char* service_id,
FT_Bool global );
#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
FT_BASE( FT_Error )
ft_property_string_set( FT_Library library,
const FT_String* module_name,
const FT_String* property_name,
FT_String* value );
#endif
/* */
@ -553,9 +627,9 @@ FT_BEGIN_HEADER
/* a few macros used to perform easy typecasts with minimal brain damage */
#define FT_FACE( x ) ((FT_Face)(x))
#define FT_SIZE( x ) ((FT_Size)(x))
#define FT_SLOT( x ) ((FT_GlyphSlot)(x))
#define FT_FACE( x ) ( (FT_Face)(x) )
#define FT_SIZE( x ) ( (FT_Size)(x) )
#define FT_SLOT( x ) ( (FT_GlyphSlot)(x) )
#define FT_FACE_DRIVER( x ) FT_FACE( x )->driver
#define FT_FACE_LIBRARY( x ) FT_FACE_DRIVER( x )->root.library
@ -656,6 +730,12 @@ FT_BEGIN_HEADER
ft_glyphslot_free_bitmap( FT_GlyphSlot slot );
/* Preset bitmap metrics of an outline glyphslot prior to rendering. */
FT_BASE( void )
ft_glyphslot_preset_bitmap( FT_GlyphSlot slot,
FT_Render_Mode mode,
const FT_Vector* origin );
/* Allocate a new bitmap buffer in a glyph slot. */
FT_BASE( FT_Error )
ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot,
@ -682,10 +762,10 @@ FT_BEGIN_HEADER
/*************************************************************************/
#define FT_RENDERER( x ) ((FT_Renderer)( x ))
#define FT_GLYPH( x ) ((FT_Glyph)( x ))
#define FT_BITMAP_GLYPH( x ) ((FT_BitmapGlyph)( x ))
#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))
#define FT_RENDERER( x ) ( (FT_Renderer)(x) )
#define FT_GLYPH( x ) ( (FT_Glyph)(x) )
#define FT_BITMAP_GLYPH( x ) ( (FT_BitmapGlyph)(x) )
#define FT_OUTLINE_GLYPH( x ) ( (FT_OutlineGlyph)(x) )
typedef struct FT_RendererRec_
@ -716,7 +796,7 @@ FT_BEGIN_HEADER
/* typecast a module into a driver easily */
#define FT_DRIVER( x ) ((FT_Driver)(x))
#define FT_DRIVER( x ) ( (FT_Driver)(x) )
/* typecast a module as a driver, and get its driver class */
#define FT_DRIVER_CLASS( x ) FT_DRIVER( x )->clazz
@ -769,19 +849,7 @@ FT_BEGIN_HEADER
/* This hook is used by the TrueType debugger. It must be set to an */
/* alternate truetype bytecode interpreter function. */
#define FT_DEBUG_HOOK_TRUETYPE 0
/* Set this debug hook to a non-null pointer to force unpatented hinting */
/* for all faces when both TT_USE_BYTECODE_INTERPRETER and */
/* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. This is only used */
/* during debugging. */
#define FT_DEBUG_HOOK_UNPATENTED_HINTING 1
typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
FT_Render_Mode render_mode,
FT_Library library );
#define FT_DEBUG_HOOK_TRUETYPE 0
/*************************************************************************/
@ -822,20 +890,12 @@ FT_BEGIN_HEADER
/* handle to the current renderer for the */
/* FT_GLYPH_FORMAT_OUTLINE format. */
/* */
/* auto_hinter :: XXX */
/* auto_hinter :: The auto-hinter module interface. */
/* */
/* raster_pool :: The raster object's render pool. This can */
/* ideally be changed dynamically at run-time. */
/* */
/* raster_pool_size :: The size of the render pool in bytes. */
/* */
/* debug_hooks :: XXX */
/* */
/* lcd_filter :: If subpixel rendering is activated, the */
/* selected LCD filter mode. */
/* */
/* lcd_extra :: If subpixel rendering is activated, the number */
/* of extra pixels needed for the LCD filter. */
/* debug_hooks :: An array of four function pointers that allow */
/* debuggers to hook into a font format's */
/* interpreter. Currently, only the TrueType */
/* bytecode debugger uses this. */
/* */
/* lcd_weights :: If subpixel rendering is activated, the LCD */
/* filter weights, if any. */
@ -844,7 +904,7 @@ FT_BEGIN_HEADER
/* filtering callback function. */
/* */
/* pic_container :: Contains global structs and tables, instead */
/* of defining them globallly. */
/* of defining them globally. */
/* */
/* refcount :: A counter initialized to~1 at the time an */
/* @FT_Library structure is created. */
@ -868,16 +928,10 @@ FT_BEGIN_HEADER
FT_Renderer cur_renderer; /* current outline renderer */
FT_Module auto_hinter;
FT_Byte* raster_pool; /* scan-line conversion */
/* render pool */
FT_ULong raster_pool_size; /* size of render pool in bytes */
FT_DebugHook_Func debug_hooks[4];
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
FT_LcdFilter lcd_filter;
FT_Int lcd_extra; /* number of extra pixels */
FT_Byte lcd_weights[7]; /* filter weights, if any */
FT_LcdFiveTapFilter lcd_weights; /* filter weights, if any */
FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
#endif
@ -982,8 +1036,8 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Used to initialize an instance of FT_Outline_Funcs struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
/* be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is defined an init function will need */
/* to be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
@ -1041,8 +1095,8 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Used to initialize an instance of FT_Raster_Funcs struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
/* be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is defined an init function will need */
/* to be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
@ -1101,8 +1155,8 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Used to initialize an instance of FT_Glyph_Class struct. */
/* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
/* be called with a pre-allocated stcture to be filled. */
/* When FT_CONFIG_OPTION_PIC is defined an init function will need */
/* to be called with a pre-allocated structure to be filled. */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */
/* is used). */
@ -1175,11 +1229,11 @@ FT_BEGIN_HEADER
/* <Description> */
/* Used to initialize an instance of FT_Renderer_Class struct. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a `create' funtion will need */
/* to be called with a pointer where the allocated structure is */
/* When FT_CONFIG_OPTION_PIC is defined a `create' function will */
/* need to be called with a pointer where the allocated structure is */
/* returned. And when it is no longer needed a `destroy' function */
/* needs to be called to release that allocation. */
/* `fcinit.c' (ft_create_default_module_classes) already contains */
/* `ftinit.c' (ft_create_default_module_classes) already contains */
/* a mechanism to call these functions for the default modules */
/* described in `ftmodule.h'. */
/* */
@ -1379,11 +1433,11 @@ FT_BEGIN_HEADER
/* <Description> */
/* Used to initialize an instance of an FT_Module_Class struct. */
/* */
/* When FT_CONFIG_OPTION_PIC is defined a `create' funtion needs to */
/* be called with a pointer where the allocated structure is */
/* When FT_CONFIG_OPTION_PIC is defined a `create' function needs */
/* to be called with a pointer where the allocated structure is */
/* returned. And when it is no longer needed a `destroy' function */
/* needs to be called to release that allocation. */
/* `fcinit.c' (ft_create_default_module_classes) already contains */
/* `ftinit.c' (ft_create_default_module_classes) already contains */
/* a mechanism to call these functions for the default modules */
/* described in `ftmodule.h'. */
/* */
@ -1565,7 +1619,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTOBJS_H__ */
#endif /* FTOBJS_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services (declaration). */
/* */
/* Copyright 2009-2015 by */
/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -23,8 +23,8 @@
/*************************************************************************/
#ifndef __FTPIC_H__
#define __FTPIC_H__
#ifndef FTPIC_H_
#define FTPIC_H_
FT_BEGIN_HEADER
@ -65,7 +65,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTPIC_H__ */
#endif /* FTPIC_H_ */
/* END */

View File

@ -0,0 +1,48 @@
/***************************************************************************/
/* */
/* ftpsprop.h */
/* */
/* Get and set properties of PostScript drivers (specification). */
/* */
/* Copyright 2017-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* 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. */
/* */
/***************************************************************************/
#ifndef FTPSPROP_H_
#define FTPSPROP_H_
#include <ft2build.h>
#include FT_FREETYPE_H
FT_BEGIN_HEADER
FT_BASE_CALLBACK( FT_Error )
ps_property_set( FT_Module module, /* PS_Driver */
const char* property_name,
const void* value,
FT_Bool value_is_string );
FT_BASE_CALLBACK( FT_Error )
ps_property_get( FT_Module module, /* PS_Driver */
const char* property_name,
void* value );
FT_END_HEADER
#endif /* FTPSPROP_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Embedded resource forks accessor (specification). */
/* */
/* Copyright 2004-2015 by */
/* Copyright 2004-2018 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -21,8 +21,8 @@
/***************************************************************************/
#ifndef __FTRFORK_H__
#define __FTRFORK_H__
#ifndef FTRFORK_H_
#define FTRFORK_H_
#include <ft2build.h>
@ -43,11 +43,12 @@ FT_BEGIN_HEADER
typedef struct FT_RFork_Ref_
{
FT_UShort res_id;
FT_Long offset;
FT_Short res_id;
FT_Long offset;
} FT_RFork_Ref;
#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
typedef FT_Error
(*ft_raccess_guess_func)( FT_Library library,
@ -227,7 +228,7 @@ FT_BEGIN_HEADER
/* sort_by_res_id :: */
/* A Boolean to sort the fragmented resource by their ids. */
/* The fragmented resources for `POST' resource should be sorted */
/* to restore Type1 font properly. For `snft' resources, sorting */
/* to restore Type1 font properly. For `sfnt' resources, sorting */
/* may induce a different order of the faces in comparison to that */
/* by QuickDraw API. */
/* */
@ -260,7 +261,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTRFORK_H__ */
#endif /* FTRFORK_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType services (specification only). */
/* */
/* Copyright 2003-2015 by */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -28,8 +28,8 @@
/*************************************************************************/
#ifndef __FTSERV_H__
#define __FTSERV_H__
#ifndef FTSERV_H_
#define FTSERV_H_
FT_BEGIN_HEADER
@ -109,27 +109,27 @@ FT_BEGIN_HEADER
*/
#ifdef __cplusplus
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
FT_BEGIN_STMNT \
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
FT_Pointer _tmp_; \
FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
\
\
_tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
*_pptr_ = _tmp_; \
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
FT_BEGIN_STMNT \
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
FT_Pointer _tmp_; \
FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
\
\
_tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id, 1 ); \
*_pptr_ = _tmp_; \
FT_END_STMNT
#else /* !C++ */
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
FT_BEGIN_STMNT \
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
FT_Pointer _tmp_; \
\
\
_tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
ptr = _tmp_; \
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
FT_BEGIN_STMNT \
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
FT_Pointer _tmp_; \
\
\
_tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id, 1 ); \
ptr = _tmp_; \
FT_END_STMNT
#endif /* !C++ */
@ -167,6 +167,7 @@ FT_BEGIN_HEADER
/* FT_DEFINE_SERVICEDESCREC5 */
/* FT_DEFINE_SERVICEDESCREC6 */
/* FT_DEFINE_SERVICEDESCREC7 */
/* FT_DEFINE_SERVICEDESCREC8 */
/* */
/* <Description> */
/* Used to initialize an array of FT_ServiceDescRec structures. */
@ -283,6 +284,78 @@ FT_BEGIN_HEADER
{ NULL, NULL } \
};
#define FT_DEFINE_SERVICEDESCREC8( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8 ) \
static const FT_ServiceDescRec class_[] = \
{ \
{ serv_id_1, serv_data_1 }, \
{ serv_id_2, serv_data_2 }, \
{ serv_id_3, serv_data_3 }, \
{ serv_id_4, serv_data_4 }, \
{ serv_id_5, serv_data_5 }, \
{ serv_id_6, serv_data_6 }, \
{ serv_id_7, serv_data_7 }, \
{ serv_id_8, serv_data_8 }, \
{ NULL, NULL } \
};
#define FT_DEFINE_SERVICEDESCREC9( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8, \
serv_id_9, serv_data_9 ) \
static const FT_ServiceDescRec class_[] = \
{ \
{ serv_id_1, serv_data_1 }, \
{ serv_id_2, serv_data_2 }, \
{ serv_id_3, serv_data_3 }, \
{ serv_id_4, serv_data_4 }, \
{ serv_id_5, serv_data_5 }, \
{ serv_id_6, serv_data_6 }, \
{ serv_id_7, serv_data_7 }, \
{ serv_id_8, serv_data_8 }, \
{ serv_id_9, serv_data_9 }, \
{ NULL, NULL } \
};
#define FT_DEFINE_SERVICEDESCREC10( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8, \
serv_id_9, serv_data_9, \
serv_id_10, serv_data_10 ) \
static const FT_ServiceDescRec class_[] = \
{ \
{ serv_id_1, serv_data_1 }, \
{ serv_id_2, serv_data_2 }, \
{ serv_id_3, serv_data_3 }, \
{ serv_id_4, serv_data_4 }, \
{ serv_id_5, serv_data_5 }, \
{ serv_id_6, serv_data_6 }, \
{ serv_id_7, serv_data_7 }, \
{ serv_id_8, serv_data_8 }, \
{ serv_id_9, serv_data_9 }, \
{ serv_id_10, serv_data_10 }, \
{ NULL, NULL } \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICEDESCREC1( class_, \
@ -510,7 +583,7 @@ FT_BEGIN_HEADER
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class) \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
@ -561,7 +634,7 @@ FT_BEGIN_HEADER
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class) \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
@ -593,6 +666,183 @@ FT_BEGIN_HEADER
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC8( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 9 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = serv_id_6; \
clazz[5].serv_data = serv_data_6; \
clazz[6].serv_id = serv_id_7; \
clazz[6].serv_data = serv_data_7; \
clazz[7].serv_id = serv_id_8; \
clazz[7].serv_data = serv_data_8; \
clazz[8].serv_id = NULL; \
clazz[8].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC9( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8, \
serv_id_9, serv_data_9 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 10 ) ) \
return error; \
\
clazz[0].serv_id = serv_id_1; \
clazz[0].serv_data = serv_data_1; \
clazz[1].serv_id = serv_id_2; \
clazz[1].serv_data = serv_data_2; \
clazz[2].serv_id = serv_id_3; \
clazz[2].serv_data = serv_data_3; \
clazz[3].serv_id = serv_id_4; \
clazz[3].serv_data = serv_data_4; \
clazz[4].serv_id = serv_id_5; \
clazz[4].serv_data = serv_data_5; \
clazz[5].serv_id = serv_id_6; \
clazz[5].serv_data = serv_data_6; \
clazz[6].serv_id = serv_id_7; \
clazz[6].serv_data = serv_data_7; \
clazz[7].serv_id = serv_id_8; \
clazz[7].serv_data = serv_data_8; \
clazz[8].serv_id = serv_id_9; \
clazz[8].serv_data = serv_data_9; \
clazz[9].serv_id = NULL; \
clazz[9].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#define FT_DEFINE_SERVICEDESCREC10( class_, \
serv_id_1, serv_data_1, \
serv_id_2, serv_data_2, \
serv_id_3, serv_data_3, \
serv_id_4, serv_data_4, \
serv_id_5, serv_data_5, \
serv_id_6, serv_data_6, \
serv_id_7, serv_data_7, \
serv_id_8, serv_data_8, \
serv_id_9, serv_data_9, \
serv_id_10, serv_data_10 ) \
void \
FT_Destroy_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec* clazz ) \
{ \
FT_Memory memory = library->memory; \
\
\
if ( clazz ) \
FT_FREE( clazz ); \
} \
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
FT_Memory memory = library->memory; \
\
\
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 11 ) ) \
return error; \
\
clazz[ 0].serv_id = serv_id_1; \
clazz[ 0].serv_data = serv_data_1; \
clazz[ 1].serv_id = serv_id_2; \
clazz[ 1].serv_data = serv_data_2; \
clazz[ 2].serv_id = serv_id_3; \
clazz[ 2].serv_data = serv_data_3; \
clazz[ 3].serv_id = serv_id_4; \
clazz[ 3].serv_data = serv_data_4; \
clazz[ 4].serv_id = serv_id_5; \
clazz[ 4].serv_data = serv_data_5; \
clazz[ 5].serv_id = serv_id_6; \
clazz[ 5].serv_data = serv_data_6; \
clazz[ 6].serv_id = serv_id_7; \
clazz[ 6].serv_data = serv_data_7; \
clazz[ 7].serv_id = serv_id_8; \
clazz[ 7].serv_data = serv_data_8; \
clazz[ 8].serv_id = serv_id_9; \
clazz[ 8].serv_data = serv_data_9; \
clazz[ 9].serv_id = serv_id_10; \
clazz[ 9].serv_data = serv_data_10; \
clazz[10].serv_id = NULL; \
clazz[10].serv_data = NULL; \
\
*output_class = clazz; \
\
return FT_Err_Ok; \
}
#endif /* FT_CONFIG_OPTION_PIC */
@ -635,6 +885,7 @@ FT_BEGIN_HEADER
{
FT_Pointer service_POSTSCRIPT_FONT_NAME;
FT_Pointer service_MULTI_MASTERS;
FT_Pointer service_METRICS_VARIATIONS;
FT_Pointer service_GLYPH_DICT;
FT_Pointer service_PFR_METRICS;
FT_Pointer service_WINFNT;
@ -655,7 +906,7 @@ FT_BEGIN_HEADER
* FT_FACE_LOOKUP_SERVICE
*
* @description:
* This macro is used to lookup a service from a face's driver module
* This macro is used to look up a service from a face's driver module
* using its cache.
*
* @input:
@ -735,10 +986,13 @@ FT_BEGIN_HEADER
*/
#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h>
#define FT_SERVICE_CFF_TABLE_LOAD_H <freetype/internal/services/svcfftl.h>
#define FT_SERVICE_CID_H <freetype/internal/services/svcid.h>
#define FT_SERVICE_FONT_FORMAT_H <freetype/internal/services/svfntfmt.h>
#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h>
#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h>
#define FT_SERVICE_METRICS_VARIATIONS_H <freetype/internal/services/svmetric.h>
#define FT_SERVICE_MULTIPLE_MASTERS_H <freetype/internal/services/svmm.h>
#define FT_SERVICE_OPENTYPE_VALIDATE_H <freetype/internal/services/svotval.h>
#define FT_SERVICE_PFR_H <freetype/internal/services/svpfr.h>
@ -748,16 +1002,15 @@ FT_BEGIN_HEADER
#define FT_SERVICE_PROPERTIES_H <freetype/internal/services/svprop.h>
#define FT_SERVICE_SFNT_H <freetype/internal/services/svsfnt.h>
#define FT_SERVICE_TRUETYPE_ENGINE_H <freetype/internal/services/svtteng.h>
#define FT_SERVICE_TRUETYPE_GLYF_H <freetype/internal/services/svttglyf.h>
#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h>
#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h>
#define FT_SERVICE_FONT_FORMAT_H <freetype/internal/services/svfntfmt.h>
#define FT_SERVICE_TRUETYPE_GLYF_H <freetype/internal/services/svttglyf.h>
/* */
FT_END_HEADER
#endif /* __FTSERV_H__ */
#endif /* FTSERV_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Stream handling (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTSTREAM_H__
#define __FTSTREAM_H__
#ifndef FTSTREAM_H_
#define FTSTREAM_H_
#include <ft2build.h>
@ -165,8 +165,8 @@ FT_BEGIN_HEADER
#define FT_BYTE_U32( p, i, s ) ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
#define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8) | \
FT_BYTE_U16( p, 1, 0) )
#define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8 ) | \
FT_BYTE_U16( p, 1, 0 ) )
#define FT_PEEK_USHORT( p ) FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \
FT_BYTE_U16( p, 1, 0 ) )
@ -502,7 +502,7 @@ FT_BEGIN_HEADER
#define FT_STREAM_READ_AT( position, buffer, count ) \
FT_SET_ERROR( FT_Stream_ReadAt( stream, \
(FT_ULong)(position), \
(FT_Byte*)buffer, \
(FT_Byte*)(buffer), \
(FT_ULong)(count) ) )
#define FT_STREAM_READ_FIELDS( fields, object ) \
@ -530,7 +530,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTSTREAM_H__ */
#endif /* FTSTREAM_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Tracing handling (specification only). */
/* */
/* Copyright 2002-2015 by */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -39,6 +39,7 @@ FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
FT_TRACE_DEF( bitmap ) /* bitmap checksum (ftobjs.c) */
FT_TRACE_DEF( psprops ) /* PS driver properties (ftpsprop.c) */
/* Cache sub-system */
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
@ -66,20 +67,19 @@ FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */
FT_TRACE_DEF( t1afm )
FT_TRACE_DEF( t1driver )
FT_TRACE_DEF( t1gload )
FT_TRACE_DEF( t1hint )
FT_TRACE_DEF( t1load )
FT_TRACE_DEF( t1objs )
FT_TRACE_DEF( t1parse )
/* PostScript helper module `psaux' */
FT_TRACE_DEF( t1decode )
FT_TRACE_DEF( cffdecode )
FT_TRACE_DEF( psobjs )
FT_TRACE_DEF( psconv )
/* PostScript hinting module `pshinter' */
FT_TRACE_DEF( pshrec )
FT_TRACE_DEF( pshalgo1 )
FT_TRACE_DEF( pshalgo2 )
FT_TRACE_DEF( pshalgo )
/* Type 2 driver components */
FT_TRACE_DEF( cffdriver )
@ -96,7 +96,6 @@ FT_TRACE_DEF( cf2interp )
FT_TRACE_DEF( t42 )
/* CID driver components */
FT_TRACE_DEF( cidafm )
FT_TRACE_DEF( ciddriver )
FT_TRACE_DEF( cidgload )
FT_TRACE_DEF( cidload )
@ -148,7 +147,7 @@ FT_TRACE_DEF( afcjk )
FT_TRACE_DEF( aflatin )
FT_TRACE_DEF( aflatin2 )
FT_TRACE_DEF( afwarp )
FT_TRACE_DEF( afharfbuzz )
FT_TRACE_DEF( afshaper )
FT_TRACE_DEF( afglobal )
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType validation support (specification). */
/* */
/* Copyright 2004-2015 by */
/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __FTVALID_H__
#define __FTVALID_H__
#ifndef FTVALID_H_
#define FTVALID_H_
#include <ft2build.h>
#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_setjmp and ft_longjmp */
@ -153,7 +153,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __FTVALID_H__ */
#endif /* FTVALID_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Internal header files (specification only). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -30,7 +30,8 @@
#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h>
#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>
#define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h>
#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h>
#define FT_INTERNAL_HASH_H <freetype/internal/fthash.h>
#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdrv.h>
#define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h>
#define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h>
#define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h>
@ -43,10 +44,13 @@
#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h>
#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h>
#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H <freetype/internal/psglobal.h>
#define FT_INTERNAL_POSTSCRIPT_PROPS_H <freetype/internal/ftpsprop.h>
#define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h>
#define FT_INTERNAL_CFF_TYPES_H <freetype/internal/cfftypes.h>
#define FT_INTERNAL_CFF_OBJECTS_TYPES_H <freetype/internal/cffotypes.h>
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */

View File

@ -5,7 +5,7 @@
/* Auxiliary functions and data structures related to PostScript fonts */
/* (specification). */
/* */
/* Copyright 1996-2015 by */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -17,19 +17,40 @@
/***************************************************************************/
#ifndef __PSAUX_H__
#define __PSAUX_H__
#ifndef PSAUX_H_
#define PSAUX_H_
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_TYPE1_TYPES_H
#include FT_INTERNAL_HASH_H
#include FT_INTERNAL_TRUETYPE_TYPES_H
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_INTERNAL_CFF_TYPES_H
#include FT_INTERNAL_CFF_OBJECTS_TYPES_H
FT_BEGIN_HEADER
/***********************************************************************/
/* */
/* PostScript modules driver class. */
/* */
typedef struct PS_DriverRec_
{
FT_DriverRec root;
FT_UInt hinting_engine;
FT_Bool no_stem_darkening;
FT_Int darken_params[8];
FT_Int32 random_seed;
} PS_DriverRec, *PS_Driver;
/*************************************************************************/
/*************************************************************************/
/***** *****/
@ -438,6 +459,202 @@ FT_BEGIN_HEADER
} PS_ParserRec;
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** PS BUILDER *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
typedef struct PS_Builder_ PS_Builder;
typedef const struct PS_Builder_FuncsRec_* PS_Builder_Funcs;
typedef struct PS_Builder_FuncsRec_
{
void
(*init)( PS_Builder* ps_builder,
void* builder,
FT_Bool is_t1 );
void
(*done)( PS_Builder* builder );
} PS_Builder_FuncsRec;
/*************************************************************************/
/* */
/* <Structure> */
/* PS_Builder */
/* */
/* <Description> */
/* A structure used during glyph loading to store its outline. */
/* */
/* <Fields> */
/* memory :: The current memory object. */
/* */
/* face :: The current face object. */
/* */
/* glyph :: The current glyph slot. */
/* */
/* loader :: XXX */
/* */
/* base :: The base glyph outline. */
/* */
/* current :: The current glyph outline. */
/* */
/* pos_x :: The horizontal translation (if composite glyph). */
/* */
/* pos_y :: The vertical translation (if composite glyph). */
/* */
/* left_bearing :: The left side bearing point. */
/* */
/* advance :: The horizontal advance vector. */
/* */
/* bbox :: Unused. */
/* */
/* path_begun :: A flag which indicates that a new path has begun. */
/* */
/* load_points :: If this flag is not set, no points are loaded. */
/* */
/* no_recurse :: Set but not used. */
/* */
/* metrics_only :: A boolean indicating that we only want to compute */
/* the metrics of a given glyph, not load all of its */
/* points. */
/* */
/* is_t1 :: Set if current font type is Type 1. */
/* */
/* funcs :: An array of function pointers for the builder. */
/* */
struct PS_Builder_
{
FT_Memory memory;
FT_Face face;
CFF_GlyphSlot glyph;
FT_GlyphLoader loader;
FT_Outline* base;
FT_Outline* current;
FT_Pos* pos_x;
FT_Pos* pos_y;
FT_Vector* left_bearing;
FT_Vector* advance;
FT_BBox* bbox; /* bounding box */
FT_Bool path_begun;
FT_Bool load_points;
FT_Bool no_recurse;
FT_Bool metrics_only;
FT_Bool is_t1;
PS_Builder_FuncsRec funcs;
};
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** PS DECODER *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
#define PS_MAX_OPERANDS 48
#define PS_MAX_SUBRS_CALLS 16 /* maximum subroutine nesting; */
/* only 10 are allowed but there exist */
/* fonts like `HiraKakuProN-W3.ttf' */
/* (Hiragino Kaku Gothic ProN W3; */
/* 8.2d6e1; 2014-12-19) that exceed */
/* this limit */
/* execution context charstring zone */
typedef struct PS_Decoder_Zone_
{
FT_Byte* base;
FT_Byte* limit;
FT_Byte* cursor;
} PS_Decoder_Zone;
typedef FT_Error
(*CFF_Decoder_Get_Glyph_Callback)( TT_Face face,
FT_UInt glyph_index,
FT_Byte** pointer,
FT_ULong* length );
typedef void
(*CFF_Decoder_Free_Glyph_Callback)( TT_Face face,
FT_Byte** pointer,
FT_ULong length );
typedef struct PS_Decoder_
{
PS_Builder builder;
FT_Fixed stack[PS_MAX_OPERANDS + 1];
FT_Fixed* top;
PS_Decoder_Zone zones[PS_MAX_SUBRS_CALLS + 1];
PS_Decoder_Zone* zone;
FT_Int flex_state;
FT_Int num_flex_vectors;
FT_Vector flex_vectors[7];
CFF_Font cff;
CFF_SubFont current_subfont; /* for current glyph_index */
FT_Generic* cf2_instance;
FT_Pos* glyph_width;
FT_Bool width_only;
FT_Int num_hints;
FT_UInt num_locals;
FT_UInt num_globals;
FT_Int locals_bias;
FT_Int globals_bias;
FT_Byte** locals;
FT_Byte** globals;
FT_Byte** glyph_names; /* for pure CFF fonts only */
FT_UInt num_glyphs; /* number of glyphs in font */
FT_Render_Mode hint_mode;
FT_Bool seac;
CFF_Decoder_Get_Glyph_Callback get_glyph_callback;
CFF_Decoder_Free_Glyph_Callback free_glyph_callback;
/* Type 1 stuff */
FT_Service_PsCMaps psnames; /* for seac */
FT_Int lenIV; /* internal for sub routine calls */
FT_UInt* locals_len; /* array of subrs length (optional) */
FT_Hash locals_hash; /* used if `num_subrs' was massaged */
FT_Matrix font_matrix;
FT_Vector font_offset;
PS_Blend blend; /* for multiple master support */
FT_Long* buildchar;
FT_UInt len_buildchar;
} PS_Decoder;
/*************************************************************************/
/*************************************************************************/
/***** *****/
@ -652,10 +869,23 @@ FT_BEGIN_HEADER
void
(*done)( T1_Decoder decoder );
#ifdef T1_CONFIG_OPTION_OLD_ENGINE
FT_Error
(*parse_charstrings)( T1_Decoder decoder,
FT_Byte* base,
FT_UInt len );
(*parse_charstrings_old)( T1_Decoder decoder,
FT_Byte* base,
FT_UInt len );
#else
FT_Error
(*parse_metrics)( T1_Decoder decoder,
FT_Byte* base,
FT_UInt len );
#endif
FT_Error
(*parse_charstrings)( PS_Decoder* decoder,
FT_Byte* charstring_base,
FT_ULong charstring_len );
} T1_Decoder_FuncsRec;
@ -678,6 +908,7 @@ FT_BEGIN_HEADER
FT_Int num_subrs;
FT_Byte** subrs;
FT_UInt* subrs_len; /* array of subrs length (optional) */
FT_Hash subrs_hash; /* used if `num_subrs' was massaged */
FT_Matrix font_matrix;
FT_Vector font_offset;
@ -698,9 +929,258 @@ FT_BEGIN_HEADER
FT_Bool seac;
FT_Generic cf2_instance;
} T1_DecoderRec;
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** CFF BUILDER *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
typedef struct CFF_Builder_ CFF_Builder;
typedef FT_Error
(*CFF_Builder_Check_Points_Func)( CFF_Builder* builder,
FT_Int count );
typedef void
(*CFF_Builder_Add_Point_Func)( CFF_Builder* builder,
FT_Pos x,
FT_Pos y,
FT_Byte flag );
typedef FT_Error
(*CFF_Builder_Add_Point1_Func)( CFF_Builder* builder,
FT_Pos x,
FT_Pos y );
typedef FT_Error
(*CFF_Builder_Start_Point_Func)( CFF_Builder* builder,
FT_Pos x,
FT_Pos y );
typedef void
(*CFF_Builder_Close_Contour_Func)( CFF_Builder* builder );
typedef FT_Error
(*CFF_Builder_Add_Contour_Func)( CFF_Builder* builder );
typedef const struct CFF_Builder_FuncsRec_* CFF_Builder_Funcs;
typedef struct CFF_Builder_FuncsRec_
{
void
(*init)( CFF_Builder* builder,
TT_Face face,
CFF_Size size,
CFF_GlyphSlot glyph,
FT_Bool hinting );
void
(*done)( CFF_Builder* builder );
CFF_Builder_Check_Points_Func check_points;
CFF_Builder_Add_Point_Func add_point;
CFF_Builder_Add_Point1_Func add_point1;
CFF_Builder_Add_Contour_Func add_contour;
CFF_Builder_Start_Point_Func start_point;
CFF_Builder_Close_Contour_Func close_contour;
} CFF_Builder_FuncsRec;
/*************************************************************************/
/* */
/* <Structure> */
/* CFF_Builder */
/* */
/* <Description> */
/* A structure used during glyph loading to store its outline. */
/* */
/* <Fields> */
/* memory :: The current memory object. */
/* */
/* face :: The current face object. */
/* */
/* glyph :: The current glyph slot. */
/* */
/* loader :: The current glyph loader. */
/* */
/* base :: The base glyph outline. */
/* */
/* current :: The current glyph outline. */
/* */
/* pos_x :: The horizontal translation (if composite glyph). */
/* */
/* pos_y :: The vertical translation (if composite glyph). */
/* */
/* left_bearing :: The left side bearing point. */
/* */
/* advance :: The horizontal advance vector. */
/* */
/* bbox :: Unused. */
/* */
/* path_begun :: A flag which indicates that a new path has begun. */
/* */
/* load_points :: If this flag is not set, no points are loaded. */
/* */
/* no_recurse :: Set but not used. */
/* */
/* metrics_only :: A boolean indicating that we only want to compute */
/* the metrics of a given glyph, not load all of its */
/* points. */
/* */
/* hints_funcs :: Auxiliary pointer for hinting. */
/* */
/* hints_globals :: Auxiliary pointer for hinting. */
/* */
/* funcs :: A table of method pointers for this object. */
/* */
struct CFF_Builder_
{
FT_Memory memory;
TT_Face face;
CFF_GlyphSlot glyph;
FT_GlyphLoader loader;
FT_Outline* base;
FT_Outline* current;
FT_Pos pos_x;
FT_Pos pos_y;
FT_Vector left_bearing;
FT_Vector advance;
FT_BBox bbox; /* bounding box */
FT_Bool path_begun;
FT_Bool load_points;
FT_Bool no_recurse;
FT_Bool metrics_only;
void* hints_funcs; /* hinter-specific */
void* hints_globals; /* hinter-specific */
CFF_Builder_FuncsRec funcs;
};
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** CFF DECODER *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
#define CFF_MAX_OPERANDS 48
#define CFF_MAX_SUBRS_CALLS 16 /* maximum subroutine nesting; */
/* only 10 are allowed but there exist */
/* fonts like `HiraKakuProN-W3.ttf' */
/* (Hiragino Kaku Gothic ProN W3; */
/* 8.2d6e1; 2014-12-19) that exceed */
/* this limit */
#define CFF_MAX_TRANS_ELEMENTS 32
/* execution context charstring zone */
typedef struct CFF_Decoder_Zone_
{
FT_Byte* base;
FT_Byte* limit;
FT_Byte* cursor;
} CFF_Decoder_Zone;
typedef struct CFF_Decoder_
{
CFF_Builder builder;
CFF_Font cff;
FT_Fixed stack[CFF_MAX_OPERANDS + 1];
FT_Fixed* top;
CFF_Decoder_Zone zones[CFF_MAX_SUBRS_CALLS + 1];
CFF_Decoder_Zone* zone;
FT_Int flex_state;
FT_Int num_flex_vectors;
FT_Vector flex_vectors[7];
FT_Pos glyph_width;
FT_Pos nominal_width;
FT_Bool read_width;
FT_Bool width_only;
FT_Int num_hints;
FT_Fixed buildchar[CFF_MAX_TRANS_ELEMENTS];
FT_UInt num_locals;
FT_UInt num_globals;
FT_Int locals_bias;
FT_Int globals_bias;
FT_Byte** locals;
FT_Byte** globals;
FT_Byte** glyph_names; /* for pure CFF fonts only */
FT_UInt num_glyphs; /* number of glyphs in font */
FT_Render_Mode hint_mode;
FT_Bool seac;
CFF_SubFont current_subfont; /* for current glyph_index */
CFF_Decoder_Get_Glyph_Callback get_glyph_callback;
CFF_Decoder_Free_Glyph_Callback free_glyph_callback;
} CFF_Decoder;
typedef const struct CFF_Decoder_FuncsRec_* CFF_Decoder_Funcs;
typedef struct CFF_Decoder_FuncsRec_
{
void
(*init)( CFF_Decoder* decoder,
TT_Face face,
CFF_Size size,
CFF_GlyphSlot slot,
FT_Bool hinting,
FT_Render_Mode hint_mode,
CFF_Decoder_Get_Glyph_Callback get_callback,
CFF_Decoder_Free_Glyph_Callback free_callback );
FT_Error
(*prepare)( CFF_Decoder* decoder,
CFF_Size size,
FT_UInt glyph_index );
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
FT_Error
(*parse_charstrings_old)( CFF_Decoder* decoder,
FT_Byte* charstring_base,
FT_ULong charstring_len,
FT_Bool in_dict );
#endif
FT_Error
(*parse_charstrings)( PS_Decoder* decoder,
FT_Byte* charstring_base,
FT_ULong charstring_len );
} CFF_Decoder_FuncsRec;
/*************************************************************************/
/*************************************************************************/
/***** *****/
@ -808,14 +1288,29 @@ FT_BEGIN_HEADER
FT_Offset length,
FT_UShort seed );
FT_UInt32
(*cff_random)( FT_UInt32 r );
void
(*ps_decoder_init)( PS_Decoder* ps_decoder,
void* decoder,
FT_Bool is_t1 );
void
(*t1_make_subfont)( FT_Face face,
PS_Private priv,
CFF_SubFont subfont );
T1_CMap_Classes t1_cmap_classes;
/* fields after this comment line were added after version 2.1.10 */
const AFM_Parser_FuncsRec* afm_parser_funcs;
const CFF_Decoder_FuncsRec* cff_decoder_funcs;
} PSAux_ServiceRec, *PSAux_Service;
/* backwards-compatible type definition */
/* backward compatible type definition */
typedef PSAux_ServiceRec PSAux_Interface;
@ -871,7 +1366,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __PSAUX_H__ */
#endif /* PSAUX_H_ */
/* END */

View File

@ -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-2015 by */
/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -18,8 +18,8 @@
/***************************************************************************/
#ifndef __PSHINTS_H__
#define __PSHINTS_H__
#ifndef PSHINTS_H_
#define PSHINTS_H_
#include <ft2build.h>
@ -716,7 +716,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __PSHINTS_H__ */
#endif /* PSHINTS_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType BDF services (specification). */
/* */
/* Copyright 2003-2015 by */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __SVBDF_H__
#define __SVBDF_H__
#ifndef SVBDF_H_
#define SVBDF_H_
#include FT_BDF_H
#include FT_INTERNAL_SERVICE_H
@ -76,7 +76,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVBDF_H__ */
#endif /* SVBDF_H_ */
/* END */

View File

@ -0,0 +1,112 @@
/***************************************************************************/
/* */
/* svcfftl.h */
/* */
/* The FreeType CFF tables loader service (specification). */
/* */
/* Copyright 2017-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* 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. */
/* */
/***************************************************************************/
#ifndef SVCFFTL_H_
#define SVCFFTL_H_
#include FT_INTERNAL_SERVICE_H
#include FT_INTERNAL_CFF_TYPES_H
FT_BEGIN_HEADER
#define FT_SERVICE_ID_CFF_LOAD "cff-load"
typedef FT_UShort
(*FT_Get_Standard_Encoding_Func)( FT_UInt charcode );
typedef FT_Error
(*FT_Load_Private_Dict_Func)( CFF_Font font,
CFF_SubFont subfont,
FT_UInt lenNDV,
FT_Fixed* NDV );
typedef FT_Byte
(*FT_FD_Select_Get_Func)( CFF_FDSelect fdselect,
FT_UInt glyph_index );
typedef FT_Bool
(*FT_Blend_Check_Vector_Func)( CFF_Blend blend,
FT_UInt vsindex,
FT_UInt lenNDV,
FT_Fixed* NDV );
typedef FT_Error
(*FT_Blend_Build_Vector_Func)( CFF_Blend blend,
FT_UInt vsindex,
FT_UInt lenNDV,
FT_Fixed* NDV );
FT_DEFINE_SERVICE( CFFLoad )
{
FT_Get_Standard_Encoding_Func get_standard_encoding;
FT_Load_Private_Dict_Func load_private_dict;
FT_FD_Select_Get_Func fd_select_get;
FT_Blend_Check_Vector_Func blend_check_vector;
FT_Blend_Build_Vector_Func blend_build_vector;
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_CFFLOADREC( class_, \
get_standard_encoding_, \
load_private_dict_, \
fd_select_get_, \
blend_check_vector_, \
blend_build_vector_ ) \
static const FT_Service_CFFLoadRec class_ = \
{ \
get_standard_encoding_, \
load_private_dict_, \
fd_select_get_, \
blend_check_vector_, \
blend_build_vector_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_CFFLOADREC( class_, \
get_standard_encoding_, \
load_private_dict_, \
fd_select_get_, \
blend_check_vector_, \
blend_build_vector_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_CFFLoadRec* clazz ) \
{ \
clazz->get_standard_encoding = get_standard_encoding_; \
clazz->load_private_dict = load_private_dict_; \
clazz->fd_select_get = fd_select_get_; \
clazz->blend_check_vector = blend_check_vector_; \
clazz->blend_build_vector = blend_build_vector_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER
#endif
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType CID font services (specification). */
/* */
/* Copyright 2007-2015 by */
/* Copyright 2007-2018 by */
/* Derek Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __SVCID_H__
#define __SVCID_H__
#ifndef SVCID_H_
#define SVCID_H_
#include FT_INTERNAL_SERVICE_H
@ -84,7 +84,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVCID_H__ */
#endif /* SVCID_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType font format service (specification only). */
/* */
/* Copyright 2003-2015 by */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __SVFNTFMT_H__
#define __SVFNTFMT_H__
#ifndef SVFNTFMT_H_
#define SVFNTFMT_H_
#include FT_INTERNAL_SERVICE_H
@ -49,7 +49,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVFNTFMT_H__ */
#endif /* SVFNTFMT_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType glyph dictionary services (specification). */
/* */
/* Copyright 2003-2015 by */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __SVGLDICT_H__
#define __SVGLDICT_H__
#ifndef SVGLDICT_H_
#define SVGLDICT_H_
#include FT_INTERNAL_SERVICE_H
@ -56,7 +56,7 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
get_name_, \
name_index_) \
name_index_ ) \
static const FT_Service_GlyphDictRec class_ = \
{ \
get_name_, name_index_ \
@ -66,7 +66,7 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
get_name_, \
name_index_) \
name_index_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_GlyphDictRec* clazz ) \
@ -85,4 +85,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVGLDICT_H__ */
#endif /* SVGLDICT_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
/* Copyright 2004-2015 by */
/* Copyright 2004-2018 by */
/* Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@ -25,8 +25,8 @@
/***************************************************************************/
#ifndef __SVGXVAL_H__
#define __SVGXVAL_H__
#ifndef SVGXVAL_H_
#define SVGXVAL_H_
#include FT_GX_VALIDATE_H
#include FT_INTERNAL_VALIDATE_H
@ -66,7 +66,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVGXVAL_H__ */
#endif /* SVGXVAL_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType Kerning service (specification). */
/* */
/* Copyright 2006-2015 by */
/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __SVKERN_H__
#define __SVKERN_H__
#ifndef SVKERN_H_
#define SVKERN_H_
#include FT_INTERNAL_SERVICE_H
#include FT_TRUETYPE_TABLES_H
@ -45,7 +45,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVKERN_H__ */
#endif /* SVKERN_H_ */
/* END */

View File

@ -0,0 +1,153 @@
/***************************************************************************/
/* */
/* svmetric.h */
/* */
/* The FreeType services for metrics variations (specification). */
/* */
/* Copyright 2016-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* 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. */
/* */
/***************************************************************************/
#ifndef SVMETRIC_H_
#define SVMETRIC_H_
#include FT_INTERNAL_SERVICE_H
FT_BEGIN_HEADER
/*
* A service to manage the `HVAR, `MVAR', and `VVAR' OpenType tables.
*
*/
#define FT_SERVICE_ID_METRICS_VARIATIONS "metrics-variations"
/* HVAR */
typedef FT_Error
(*FT_HAdvance_Adjust_Func)( FT_Face face,
FT_UInt gindex,
FT_Int *avalue );
typedef FT_Error
(*FT_LSB_Adjust_Func)( FT_Face face,
FT_UInt gindex,
FT_Int *avalue );
typedef FT_Error
(*FT_RSB_Adjust_Func)( FT_Face face,
FT_UInt gindex,
FT_Int *avalue );
/* VVAR */
typedef FT_Error
(*FT_VAdvance_Adjust_Func)( FT_Face face,
FT_UInt gindex,
FT_Int *avalue );
typedef FT_Error
(*FT_TSB_Adjust_Func)( FT_Face face,
FT_UInt gindex,
FT_Int *avalue );
typedef FT_Error
(*FT_BSB_Adjust_Func)( FT_Face face,
FT_UInt gindex,
FT_Int *avalue );
typedef FT_Error
(*FT_VOrg_Adjust_Func)( FT_Face face,
FT_UInt gindex,
FT_Int *avalue );
/* MVAR */
typedef void
(*FT_Metrics_Adjust_Func)( FT_Face face );
FT_DEFINE_SERVICE( MetricsVariations )
{
FT_HAdvance_Adjust_Func hadvance_adjust;
FT_LSB_Adjust_Func lsb_adjust;
FT_RSB_Adjust_Func rsb_adjust;
FT_VAdvance_Adjust_Func vadvance_adjust;
FT_TSB_Adjust_Func tsb_adjust;
FT_BSB_Adjust_Func bsb_adjust;
FT_VOrg_Adjust_Func vorg_adjust;
FT_Metrics_Adjust_Func metrics_adjust;
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
hadvance_adjust_, \
lsb_adjust_, \
rsb_adjust_, \
vadvance_adjust_, \
tsb_adjust_, \
bsb_adjust_, \
vorg_adjust_, \
metrics_adjust_ ) \
static const FT_Service_MetricsVariationsRec class_ = \
{ \
hadvance_adjust_, \
lsb_adjust_, \
rsb_adjust_, \
vadvance_adjust_, \
tsb_adjust_, \
bsb_adjust_, \
vorg_adjust_, \
metrics_adjust_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_METRICSVARIATIONSREC( class_, \
hadvance_adjust_, \
lsb_adjust_, \
rsb_adjust_, \
vadvance_adjust_, \
tsb_adjust_, \
bsb_adjust_, \
vorg_adjust_, \
metrics_adjust_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_MetricsVariationsRec* clazz ) \
{ \
clazz->hadvance_adjust = hadvance_adjust_; \
clazz->lsb_adjust = lsb_adjust_; \
clazz->rsb_adjust = rsb_adjust_; \
clazz->vadvance_adjust = vadvance_adjust_; \
clazz->tsb_adjust = tsb_adjust_; \
clazz->bsb_adjust = bsb_adjust_; \
clazz->vorg_adjust = vorg_adjust_; \
clazz->metrics_adjust = metrics_adjust_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
/* */
FT_END_HEADER
#endif /* SVMETRIC_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType Multiple Masters and GX var services (specification). */
/* */
/* Copyright 2003-2015 by */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __SVMM_H__
#define __SVMM_H__
#ifndef SVMM_H_
#define SVMM_H_
#include FT_INTERNAL_SERVICE_H
@ -48,56 +48,115 @@ FT_BEGIN_HEADER
FT_UInt num_coords,
FT_Long* coords );
/* use return value -1 to indicate that the new coordinates */
/* are equal to the current ones; no changes are thus needed */
typedef FT_Error
(*FT_Set_Var_Design_Func)( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/* use return value -1 to indicate that the new coordinates */
/* are equal to the current ones; no changes are thus needed */
typedef FT_Error
(*FT_Set_MM_Blend_Func)( FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
typedef FT_Error
(*FT_Get_Var_Design_Func)( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
typedef FT_Error
(*FT_Set_Instance_Func)( FT_Face face,
FT_UInt instance_index );
typedef FT_Error
(*FT_Get_MM_Blend_Func)( FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
typedef FT_Error
(*FT_Get_Var_Blend_Func)( FT_Face face,
FT_UInt *num_coords,
FT_Fixed* *coords,
FT_Fixed* *normalizedcoords,
FT_MM_Var* *mm_var );
typedef void
(*FT_Done_Blend_Func)( FT_Face );
FT_DEFINE_SERVICE( MultiMasters )
{
FT_Get_MM_Func get_mm;
FT_Set_MM_Design_Func set_mm_design;
FT_Set_MM_Blend_Func set_mm_blend;
FT_Get_MM_Blend_Func get_mm_blend;
FT_Get_MM_Var_Func get_mm_var;
FT_Set_Var_Design_Func set_var_design;
FT_Get_Var_Design_Func get_var_design;
FT_Set_Instance_Func set_instance;
/* for internal use; only needed for code sharing between modules */
FT_Get_Var_Blend_Func get_var_blend;
FT_Done_Blend_Func done_blend;
};
#ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
get_mm_, \
set_mm_design_, \
set_mm_blend_, \
get_mm_var_, \
set_var_design_ ) \
static const FT_Service_MultiMastersRec class_ = \
{ \
get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_ \
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
get_mm_, \
set_mm_design_, \
set_mm_blend_, \
get_mm_blend_, \
get_mm_var_, \
set_var_design_, \
get_var_design_, \
set_instance_, \
get_var_blend_, \
done_blend_ ) \
static const FT_Service_MultiMastersRec class_ = \
{ \
get_mm_, \
set_mm_design_, \
set_mm_blend_, \
get_mm_blend_, \
get_mm_var_, \
set_var_design_, \
get_var_design_, \
set_instance_, \
get_var_blend_, \
done_blend_ \
};
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
get_mm_, \
set_mm_design_, \
set_mm_blend_, \
get_mm_var_, \
set_var_design_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_MultiMastersRec* clazz ) \
{ \
clazz->get_mm = get_mm_; \
clazz->set_mm_design = set_mm_design_; \
clazz->set_mm_blend = set_mm_blend_; \
clazz->get_mm_var = get_mm_var_; \
clazz->set_var_design = set_var_design_; \
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
get_mm_, \
set_mm_design_, \
set_mm_blend_, \
get_mm_blend_, \
get_mm_var_, \
set_var_design_, \
get_var_design_, \
set_instance_, \
get_var_blend_, \
done_blend_ ) \
void \
FT_Init_Class_ ## class_( FT_Service_MultiMastersRec* clazz ) \
{ \
clazz->get_mm = get_mm_; \
clazz->set_mm_design = set_mm_design_; \
clazz->set_mm_blend = set_mm_blend_; \
clazz->get_mm_blend = get_mm_blend_; \
clazz->get_mm_var = get_mm_var_; \
clazz->set_var_design = set_var_design_; \
clazz->get_var_design = get_var_design_; \
clazz->set_instance = set_instance_; \
clazz->get_var_blend = get_var_blend_; \
clazz->done_blend = done_blend_; \
}
#endif /* FT_CONFIG_OPTION_PIC */
@ -107,7 +166,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVMM_H__ */
#endif /* SVMM_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType OpenType validation service (specification). */
/* */
/* Copyright 2004-2015 by */
/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __SVOTVAL_H__
#define __SVOTVAL_H__
#ifndef SVOTVAL_H_
#define SVOTVAL_H_
#include FT_OPENTYPE_VALIDATE_H
#include FT_INTERNAL_VALIDATE_H
@ -49,7 +49,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVOTVAL_H__ */
#endif /* SVOTVAL_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* Internal PFR service functions (specification). */
/* */
/* Copyright 2003-2015 by */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __SVPFR_H__
#define __SVPFR_H__
#ifndef SVPFR_H_
#define SVPFR_H_
#include FT_PFR_H
#include FT_INTERNAL_SERVICE_H
@ -60,7 +60,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVPFR_H__ */
#endif /* SVPFR_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType PostScript name services (specification). */
/* */
/* Copyright 2003-2015 by */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __SVPOSTNM_H__
#define __SVPOSTNM_H__
#ifndef SVPOSTNM_H_
#define SVPOSTNM_H_
#include FT_INTERNAL_SERVICE_H
@ -75,7 +75,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVPOSTNM_H__ */
#endif /* SVPOSTNM_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType property service (specification). */
/* */
/* Copyright 2012-2015 by */
/* Copyright 2012-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __SVPROP_H__
#define __SVPROP_H__
#ifndef SVPROP_H_
#define SVPROP_H_
FT_BEGIN_HEADER
@ -29,7 +29,8 @@ FT_BEGIN_HEADER
typedef FT_Error
(*FT_Properties_SetFunc)( FT_Module module,
const char* property_name,
const void* value );
const void* value,
FT_Bool value_is_string );
typedef FT_Error
(*FT_Properties_GetFunc)( FT_Module module,
@ -75,7 +76,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVPROP_H__ */
#endif /* SVPROP_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType PostScript charmap service (specification). */
/* */
/* Copyright 2003-2015 by */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __SVPSCMAP_H__
#define __SVPSCMAP_H__
#ifndef SVPSCMAP_H_
#define SVPSCMAP_H_
#include FT_INTERNAL_OBJECTS_H
@ -171,7 +171,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVPSCMAP_H__ */
#endif /* SVPSCMAP_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType PostScript info service (specification). */
/* */
/* Copyright 2003-2015 by */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __SVPSINFO_H__
#define __SVPSINFO_H__
#ifndef SVPSINFO_H_
#define SVPSINFO_H_
#include FT_INTERNAL_SERVICE_H
#include FT_INTERNAL_TYPE1_TYPES_H
@ -105,7 +105,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVPSINFO_H__ */
#endif /* SVPSINFO_H_ */
/* END */

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType SFNT table loading service (specification). */
/* */
/* Copyright 2003-2015 by */
/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -16,8 +16,8 @@
/***************************************************************************/
#ifndef __SVSFNT_H__
#define __SVSFNT_H__
#ifndef SVSFNT_H_
#define SVSFNT_H_
#include FT_INTERNAL_SERVICE_H
#include FT_TRUETYPE_TABLES_H
@ -97,7 +97,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
#endif /* __SVSFNT_H__ */
#endif /* SVSFNT_H_ */
/* END */

Some files were not shown because too many files have changed in this diff Show More