[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] anuj-distance-field 0d4c454: Revert "Merge remote-tracking b
From: |
Anuj Verma |
Subject: |
[freetype2] anuj-distance-field 0d4c454: Revert "Merge remote-tracking branch 'origin/master' into anuj-distance-field" |
Date: |
Sun, 2 Aug 2020 01:08:55 -0400 (EDT) |
branch: anuj-distance-field
commit 0d4c4547e840263a9618cd9c5c6b889ad80ff748
Author: Anuj Verma <anujv@iitbhilai.ac.in>
Commit: Anuj Verma <anujv@iitbhilai.ac.in>
Revert "Merge remote-tracking branch 'origin/master' into
anuj-distance-field"
This reverts commit 24480c6fca8be6703a9537e240415a3bbfd5f9ed.
---
.clang-format | 16 -
CMakeLists.txt | 4 +-
ChangeLog | 381 ------------------
README | 12 -
builds/unix/configure.raw | 24 +-
builds/unix/ftconfig.h.in | 62 ---
builds/unix/ftconfig.in | 602 ++++++++++++++++++++++++++++
builds/unix/ftsystem.c | 2 +-
builds/vms/ftconfig.h | 503 ++++++++++++++++++++++-
include/freetype/config/ftconfig.h | 530 +++++++++++++++++++++++-
include/freetype/config/ftheader.h | 20 +-
include/freetype/config/integer-types.h | 245 -----------
include/freetype/config/mac-support.h | 49 ---
include/freetype/config/public-macros.h | 120 ------
include/freetype/freetype.h | 9 -
include/freetype/ftdriver.h | 4 +
include/freetype/ftimage.h | 8 -
include/freetype/ftmodapi.h | 2 +-
include/freetype/internal/autohint.h | 3 -
include/freetype/internal/compiler-macros.h | 307 --------------
include/freetype/internal/ftcalc.h | 4 +-
include/freetype/internal/ftdebug.h | 2 -
include/freetype/internal/ftdrv.h | 1 -
include/freetype/internal/ftmemory.h | 1 -
include/freetype/internal/ftobjs.h | 8 +-
include/freetype/internal/ftserv.h | 1 -
include/freetype/internal/ftvalid.h | 3 +-
src/autofit/afcjk.c | 16 +-
src/autofit/afglobal.c | 2 +-
src/autofit/aflatin.c | 50 +--
src/autofit/afmodule.c | 6 +-
src/autofit/afmodule.h | 1 -
src/base/ftbase.h | 4 -
src/base/ftbitmap.c | 6 +-
src/base/ftglyph.c | 2 -
src/base/ftobjs.c | 48 ++-
src/base/ftoutln.c | 7 +-
src/base/ftrfork.c | 6 +-
src/base/ftsynth.c | 2 +-
src/bdf/bdfdrivr.c | 29 +-
src/cache/ftcbasic.c | 8 +-
src/cache/ftccache.h | 2 +-
src/cache/ftccback.h | 2 -
src/cache/ftcmru.h | 1 -
src/cff/cffcmap.h | 4 +-
src/cff/cffdrivr.c | 2 +-
src/cff/cffload.c | 41 +-
src/cff/cffobjs.c | 64 ++-
src/cff/cffparse.c | 18 +-
src/cid/cidload.c | 8 +-
src/cid/cidobjs.c | 3 +-
src/gxvalid/gxvmort.h | 5 -
src/gxvalid/gxvmorx.h | 5 -
src/lzw/ftzopen.h | 3 -
src/pcf/pcfdrivr.c | 7 +-
src/pcf/pcfread.c | 20 +-
src/pcf/pcfutil.h | 2 +-
src/pfr/pfrgload.c | 4 +-
src/pfr/pfrsbit.c | 2 +-
src/psaux/psauxmod.c | 8 +-
src/psaux/psauxmod.h | 14 -
src/psaux/pserror.h | 1 -
src/psaux/psft.h | 2 +-
src/psaux/pshints.c | 2 +-
src/psaux/psobjs.c | 4 +-
src/psaux/psstack.c | 12 +-
src/psaux/psstack.h | 1 -
src/psaux/t1decode.c | 123 +-----
src/pshinter/pshmod.c | 1 -
src/pshinter/pshrec.c | 2 +-
src/raster/ftraster.c | 14 +-
src/raster/ftraster.h | 1 -
src/sfnt/pngshim.c | 7 +-
src/sfnt/sfdriver.c | 2 +-
src/sfnt/sfobjs.c | 6 +-
src/sfnt/sfwoff2.c | 92 ++---
src/sfnt/ttcmap.c | 1 -
src/sfnt/ttcmap.h | 5 -
src/sfnt/ttload.c | 8 +-
src/sfnt/ttpost.c | 2 +-
src/sfnt/ttsbit.c | 2 +-
src/sfnt/woff2tags.c | 2 +-
src/sfnt/woff2tags.h | 3 +-
src/smooth/ftgrays.c | 2 +-
src/smooth/ftsmooth.c | 583 ++++++++++-----------------
src/truetype/ttgload.c | 4 +-
src/truetype/ttgxvar.c | 2 +-
src/truetype/ttinterp.c | 18 +-
src/truetype/ttpload.c | 16 +-
src/type1/t1gload.c | 2 +-
src/type1/t1load.c | 6 +-
src/type1/t1objs.c | 4 +-
src/type42/t42parse.c | 2 +-
93 files changed, 2148 insertions(+), 2109 deletions(-)
diff --git a/.clang-format b/.clang-format
deleted file mode 100644
index fbd04c1..0000000
--- a/.clang-format
+++ /dev/null
@@ -1,16 +0,0 @@
-BasedOnStyle: Chromium
-AlignAfterOpenBracket: Align
-AlignConsecutiveAssignments: true
-AlignConsecutiveDeclarations: true
-AlignConsecutiveMacros: true
-AlignEscapedNewlines: true
-# AlignOperands: Align
-AlignTrailingComments: true
-AlwaysBreakAfterReturnType: AllDefinitions
-BreakBeforeBraces: Allman
-ColumnLimit: 80
-DerivePointerAlignment: false
-IndentCaseLabels: false
-PointerAlignment: Left
-SpaceBeforeParens: ControlStatements
-SpacesInParentheses: true
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa63602..ef34e66 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -241,7 +241,7 @@ if (UNIX)
check_include_file("unistd.h" HAVE_UNISTD_H)
check_include_file("fcntl.h" HAVE_FCNTL_H)
- file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.h.in"
+ file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in"
FTCONFIG_H)
if (HAVE_UNISTD_H)
string(REGEX REPLACE
@@ -253,6 +253,8 @@ if (UNIX)
"#undef +(HAVE_FCNTL_H)" "#define \\1 1"
FTCONFIG_H "${FTCONFIG_H}")
endif ()
+ string(REPLACE "/undef " "#undef "
+ FTCONFIG_H "${FTCONFIG_H}")
else ()
file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftconfig.h"
FTCONFIG_H)
diff --git a/ChangeLog b/ChangeLog
index e96ec61..9c4ab5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,384 +1,3 @@
-2020-07-28 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Hide internal functions with SunPro.
-
- * include/freetype/internal/compiler-macros.h
- (FT_INTERNAL_FUNCTION_ATTRIBUTE) <__SUNPRO_C>: Define as __hidden.
-
-2020-07-28 Anuj Verma <anujv@iitbhilai.ac.in>
-
- Fix static compilation with Visual C.
-
- * include/freetype/internal/compiler-macros.h
- (FT_INTERNAL_FUNCTION_ATTRIBUTE) <_WIN32>: Define as empty.
-
-2020-07-28 Priyesh Kumar <priyeshkkumar@gmail.com>
-
- Fix `-Wformat' compiler warnings.
-
- * src/*: Fix format specifiers.
-
- * builds/unix/ftsystem.c (FT_Stream_Open): Ditto.
-
-2020-07-25 Werner Lemberg <wl@gnu.org>
-
- Fix `-Wformat' compiler warnings.
-
- Problem reported by Priyesh kumar <priyeshkkumar@gmail.com>
-
- * src/base/ftoutln.c (FT_Outline_Decompose): Fix number of arguments
- to tracing macro.
-
- * src/bdf/bdfdrivr.c (bdf_cmap_char_next, bdf_get_bdf_property):
- Ditto.
-
- * src/cache/ftcbasic.c (ftc_basic_family_get_count): Ditto.
- Reformulate message.
-
- * src/pcf/pcfdrivr.c (pcf_get_bdf_property): Ditto.
-
- * src/sfnt/sfwoff2.c (woff2_open_font): Ditto.
- Trace table offset, too.
-
- * src/truetype/ttgxvar.c (ft_var_apply_tuple): Ditto.
-
-2020-07-23 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfwoff2.c (woff2_decompress): Fix compiler warning.
-
- Reported by Hin-Tak.
-
-2020-07-12 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.raw: Fix inclusion of `ftoption.h'.
-
-2020-07-07 Werner Lemberg <wl@gnu.org>
-
- Fix clang warnings.
-
- * include/freetype/internal/autohint.h
- (FT_DECLARE_AUTOHINTER_INTERFACE): New macro.
- * src/autofit/afmodule.h: Use it to declare
- `af_autofitter_interface'.
-
- * include/freetype/internal/ftobjs.h (FT_DECLARE_GLYPH): New macro.
- * src/base/ftbase.h: Use it to declare `ft_bitmap_glyph_class' and
- `ft_outline_glyph_class'.
-
- * src/base/ftglyph.c: Include `ftbase.h'.
-
- * src/cff/cffparse.c (cff_parser_run): Fix type of `t2_size'.
-
- * src/pcf/pcfdrivr.c (pcf_cmap_char_next): Fix type of `result'.
-
- * src/psaux/psauxmod.c (psaux_module_class): Use `FT_DEFINE_MODULE'.
- * src/psaux/psauxmod.h: Declare `afm_parser_funcs',
- `t1_cmap_classes', `cff_decoder_funcs', and `psaux_module_class'.
-
- * src/pshinter/pshmod.c: Include `pshmod.h'.
-
- * src/sfnt/sfwoff2.c (ROUND4, WRITE_SHORT): Fix implicit sign
- conversion.
- (compute_ULong_sum): Fix return type.
- Fix implicit sign conversion.
- (store_points): Fix type of `last_flag', `repeat_count', and `flag'.
- Use casts to avoid warnings.
- (reconstruct_glyf): Fix implicit sign conversion.
- Use cast to avoid warning.
- (get_x_mins): Fix implicit sign conversion.
- * src/sfnt/ttcmap.c: Undef `TTCMAPCITEM'.
- * src/sfnt/ttcmap.h: Define `TTCMAPCITEM' and include `ttcmapc.h' to
- declare cmap classes.
-
- * src/smooth/ftsmooth.c (ft_smooth_overlap_spans): Use cast.
-
- * src/truetype/ttinterp.c (Ins_MIAP): Fix typo.
-
-2020-07-07 David Turner <david@freetype.org>
-
- [build] Really fix multi and C++ builds.
-
- The following builds were still failing due to previous changes:
-
- make multi
- make multi CC="c++"
- make CC="c++"
-
- This patch fixes the issues, which were missing includes to get the
- right macro definitions in multi-build mode.
-
- Also, `FT_UNUSED' is actually used by third-party code, so move it
- back to `public-macros.h' to avoid breaking it.
-
- * include/freetype/config/public-macros.h (FT_EXPORT): Remove
- special definition for C++.
- (FT_UNUSED): Define here instead of...
- * include/freetype/config/compiler-macros.h: ... here.
- (FT_FUNCTION_DECLARATION): Remove special definition for C++.
- (FT_LOCAL_ARRAY_DEF): Fix definition.
-
- * src/cache/ftccback.h, src/lzw/ftzopen.h, src/gxvalid/gxvmort.h,
- src/gxvalid/gxvmorx.h: Add `FT_BEGIN_HEADER' and `FT_END_HEADER'.
-
-2020-07-06 David Turner <david@freetype.org>
-
- [build] Fix multi and C++ builds.
-
- The following builds were failing due to previous changes:
-
- make multi
- make multi CC="c++"
-
- * include/freetype/config/ftconfig.h: Remove `FT_END_HEADER'.
-
- * include/freetype/config/ftheader.h (FT_BEGIN_HEADER,
- FT_END_HEADER): Protect against redefinition.
-
- * src/cache/ftccache.h, src/cache/ftcmru.h, src/pcf/pcfutil.h,
- src/psaux/pserror.h, src/psaux/psft.h, src/psaux/psstack.h,
- src/sfnt/woff2tags.h: Include `compiler-macros.h'.
-
- * src/sfnt/woff2tags.c: Include `woff2tags.h'.
-
-2020-07-06 Werner Lemberg <wl@gnu.org>
-
- [psaux] Improve `t1_decoder_parse_metrics' (#58646).
-
- * src/psaux/t1decode.c (t1_decoder_parse_metrics): Copy
- corresponding code from old engine's `t1_decoder_parse_charstrings'
- function to handle `op_callsubr' and `op_return'.
-
-2020-07-05 David Turner <david@freetype.org>
-
- [build] Improve visibility support of library function names.
-
- * include/freetype/config/public-macros.h
- (FT_PUBLIC_FUNCTION_ATTRIBUTE): New macro to tag functions as
- public (and thus exportable).
- (FT_EXPORT): Use it.
-
- * include/freetype/config/compiler-macros.h
- (FT_INTERNAL_FUNCTION_ATTRIBUTE): New macro to tag functions as
- internal to the library (and thus hidden). Note that on ELF
- systems, all internal functions have hidden visibility, which avoids
- the need to enforce this when invoking the compiler (e.g., with an
- option like `-fvisibility=hidden').
-
- (FT_FUNCTION_DECLARATION, FT_FUNCTION_DEFINITION): New base macros
- to deal with C and C++ linkage issues at the same time.
-
- (FT_LOCAL, FT_LOCAL_DEF, FT_LOCAL_ARRAY, FT_LOCAL_ARRAY_DEF,
- FT_BASE, FT_BASE_DEF, FT_EXPORT_VAR, FT_BASE_CALLBACK,
- FT_BASE_CALLBACK_DEF): Redefined using new macros.
-
-2020-07-05 David Turner <david@freetype.org>
-
- [build] Split off more stuff from `ftconfig.h'.
-
- * builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
- include/freetype/config/ftconfig.h: Split off macro definitions
- required by the FreeType API headers to...
- * include/freetype/config/public-macros.h: ...this new file.
-
- * builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
- include/freetype/config/ftconfig.h: Split off macro definitions used
- by the library but not to be exposed to clients to...
- * include/freetype/config/compiler-macros.h: ...this new file.
-
- * include/freetype/internal/*.h, src/raster/ftraster.h: Include
- `compiler-macros.h' where needed.
-
-2020-07-05 David Turner <david@freetype.org>
-
- [build] Move mac support code to `mac-support.h'.
-
- * builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
- include/freetype/config/ftconfig.h: Split off mac-specific stuff
- to...
- * include/freetype/config/mac-support.h: ...this new file.
-
- * CMakeLists.txt, builds/unix/configure.raw: Remove `/undef ->
- #undef' string replacement; the affected code is no longer part of
- the `ftconfig.h' template.
-
-2020-07-05 David Turner <david@freetype.org>
-
- [build] Put integer type definitions into `integer-types.h'.
-
- Refactor some of the `ftconfig.h' headers and template to move the
- definition of the FreeType integer types (e.g., `FT_Int16') to a
- common header file `freetype/config/integer-types.h'.
-
- * builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
- include/freetype/config/ftconfig.h: Split off integer type
- definition stuff to...
- * include/freetype/config/integer-types.h: ...this new file.
-
- * builds/unix/ftconfig.h.in: Control the definition of
- `FT_SIZEOF_INT' and `FT_SIZEOF_LONG' with macro
- `FT_USE_AUTOCONF_SIZEOF_TYPES'. If these are not defined, auto
- detection happens in `integer-types.h' as usual based on `INTXX_MAX'
- values. Otherwise the autoconf-detected values are used.
-
- * builds/unix/configure.raw (CPPFLAGS): Don't include path to
- `config' directory. Instead, ...
- (FT_CONFIG_STANDARD_LIBRARY_H): Use complete path.
-
-2020-07-05 David Turner <david@freetype.org>
-
- [build] Rename `build/unix/ftconfig.in' to `ftconfig.h.in'.
-
- Since we are no longer limited to 8.3 file names, it is simpler to
- follow the usual conventions for template files.
-
- * builds/unix/ftconfig.in: Renamed to...
- * builds/unix/ftconfig.h.in: ...this.
-
- * CMakeLists.txt, builds/unix/configure.raw: Updated.
-
-2020-07-03 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Introduce direct oversampling for overlaps.
-
- This implements oversampling to metigate artifacts in pixels partially
- covered by overlapping contours. It turns out that the 4x4
- oversampling is sufficient but, at least, quadruples the rendering
- time. The outline has to set FT_OUTLINE_OVERLAP to use this method.
-
- * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): New flag.
- * src/smooth/ftsmooth.c (ft_smooth_render): Check it to...
- (ft_smooth_raster_overlap): ... inflate outline and set up direct
- rendering for oversampling with...
- (ft_smooth_overlap_spans): ... new span function that integrates them.
-
-2020-07-03 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Use direct rendering mode in Harmony.
-
- Instead of rendering 3 bitmaps side by side and reshuffling, we use
- direct rendering to deliver the bitmaps on each third byte.
-
- * src/smooth/ftsmooth.c (ft_smooth_raster_lcd)
- [!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Set up direct mode with...
- (ft_smooth_lcd_spans): ... new span function.
-
-2020-07-03 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Separate LCD paths from gray rendering.
-
- This makes `ft_smooth_render' a lot smaller and easier to follow. It
- also cleanly separates Harmony and ClearType-style LCD rendering
- algorithms. Now I only wish to move LCD filtering and geometry from
- FT_Library to FT_Renderer.
-
- * src/smooth/ftsmooth.c (ft_smooth_render): Move LCD code from here...
- (ft_smooth_raster_lcd, ft_smooth_raster_lcdv): ... to here.
- [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Reorganize #ifdef's.
-
-2020-06-20 Sebastian Rasmussen <sebras@gmail.com>
-
- [cff] Fix handling of `style_name == NULL' (#58630).
-
- * src/cff/cffobjs.c (cff_face_init): If a call to `cff_strcpy' fails
- by returning NULL in `cff_face_init', `remove_style' is still
- called. This means that the NULL pointer is dereferenced, causing a
- crash.
-
-2020-06-19 Sebastian Rasmussen <sebras@gmail.com>
-
- [cff] Fix another two memory leaks (#58629).
-
- * src/cff/cffobjs.c (cff_size_init): If a call to `funcs->create'
- fails to allocate one of the `internal->subfont' variables, make
- sure to free `internal->topfont' and any successfully allocated
- subfonts.
-
-2020-06-19 Sebastian Rasmussen <sebras@gmail.com>
-
- [psaux] Fix memory leak (#58626).
-
- * src/psaux/psstack.c (cf2_stack_init): If `cf2_stack_init' fails to
- allocate the stack, return error early.
-
-2020-06-19 Sebastian Rasmussen <sebras@gmail.com>
-
- [base] Fix memory leak (#58624).
-
- * src/base/ftobjs.c (FT_New_Size): Avoid trying to free
- `size->internal' unless `size' has been allocated. This mistake
- appeared in the fix for issue #58611.
-
-2020-06-19 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Rework d1180b5f9598 until further notice.
-
- * src/base/ftoutln.c (FT_Outline_Get_Orientation): Reject large
- outlines.
-
-2020-06-19 Sebastian Rasmussen <sebras@gmail.com>
-
- [cff, cid] Fix segfaults in case of error (#58621).
-
- * src/cff/cffobjs.c (cff_slot_done), src/cid/cidobjs.c
- (cid_slot_done): If `ft_glyphslot_init' fails to allocate
- `internal', then the class' `done_slot' callback (called by
- `ft_glyphslot_done') must not dereference the pointer to `internal'.
-
-2020-06-19 Werner Lemberg <wl@gnu.org>
-
- [base] Fix UBSAN error.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23166
-
- * src/base/ftoutln.c (FT_Outline_Get_Orientation): Avoid values
- larger than 32 bits.
-
-2020-06-19 Werner Lemberg <wl@gnu.org>
-
- [woff2] Fix segfault.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23402
-
- * src/sfnt/sfwoff2.c (get_x_mins): Check whether `loca' table
- exists.
-
-2020-06-19 Stephen McDowell <svenevs.dev@gmail.com>
-
- [sfnt] Support Intel compilers.
-
- * src/sfnt/pngshim.c (premultiply_data): Intel compilers do not
- currently support `__builtin_shuffle'.
-
-2020-06-19 Sebastian Rasmussen <sebras@gmail.com>
-
- [base] Fix memory leak (#58611).
-
- * src/base/ftobjs.c (FT_New_Size): When the call to `clazz->init_size'
- fails, make sure to free `size->internal'.
-
-2020-06-19 Sebastian Rasmussen <sebras@gmail.com>
-
- [cff] Fix memory leak (#58610).
-
- * src/cff/cffobjs.c (cff_size_init): When the call to
- `funcs->create' fails, make sure to free `internal'.
-
-2020-06-19 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffload.c (cff_index_get_pointers): Rename `t' to `tbl'.
-
-2020-06-19 Sebastian Rasmussen <sebras@gmail.com>
-
- [cff] Free table upon error allocating other data (#58609).
-
- * src/cff/cffload.c (cff_index_get_pointers): When new_bytes fails
- to allocate, make sure to free the table. Do the same for both
- allocations if there is a later error.
-
2020-06-13 Werner Lemberg <wl@gnu.org>
Remove redundant inclusion of `ft2build.h'.
diff --git a/README b/README
index ab24a75..67455d7 100644
--- a/README
+++ b/README
@@ -67,18 +67,6 @@
a terse message that only says `it doesn't work'.
- Patches
- =======
-
- Please submit patches to the `freetype-devel@nongnu.org' mailing
- list -- and thank you in advance for your work on improving
- FreeType!
-
- Details on the process can be found here:
-
- https://www.freetype.org/developer.html#patches
-
-
Enjoy!
diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index c0b28e2..50f2701 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -12,7 +12,7 @@
# fully.
AC_INIT([FreeType], [@VERSION@], [freetype@nongnu.org], [freetype])
-AC_CONFIG_SRCDIR([ftconfig.h.in])
+AC_CONFIG_SRCDIR([ftconfig.in])
# Don't forget to update `docs/VERSIONS.TXT'!
@@ -109,11 +109,11 @@ AC_CHECK_SIZEOF([long])
AC_TYPE_LONG_LONG_INT
-# check whether cpp computation of size of int and long in ftconfig.h.in works
+# check whether cpp computation of size of int and long in ftconfig.in works
-AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.h.in works])
+AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.in works])
orig_CPPFLAGS="${CPPFLAGS}"
-CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include ${CPPFLAGS}"
+CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include/freetype/config
${CPPFLAGS}"
ac_clean_files=
if test ! -f ft2build.h; then
@@ -123,11 +123,11 @@ fi
cat > conftest.c <<\_ACEOF
#include <limits.h>
-#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
-#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h>
+#define FT_CONFIG_OPTIONS_H "ftoption.h"
+#define FT_CONFIG_STANDARD_LIBRARY_H "ftstdlib.h"
#define FT_UINT_MAX UINT_MAX
#define FT_ULONG_MAX ULONG_MAX
-#include "ftconfig.h.in"
+#include "ftconfig.in"
_ACEOF
echo >> conftest.c "#if FT_SIZEOF_INT == "${ac_cv_sizeof_int}
echo >> conftest.c "ac_cpp_ft_sizeof_int="${ac_cv_sizeof_int}
@@ -1158,7 +1158,15 @@
AC_CONFIG_FILES([ftoption.h:${srcdir}/../../include/freetype/config/ftoption.h],
rm ftoption.tmp],
[FTOPTION_H_SED="$FTOPTION_H_SED"])
-AC_CONFIG_HEADERS([ftconfig.h])
+# configuration file -- stay in 8.3 limit
+#
+# since #undef doesn't survive in configuration header files we replace
+# `/undef' with `#undef' after creating the output file
+
+AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in],
+ [mv ftconfig.h ftconfig.tmp
+ sed 's|/undef|#undef|' < ftconfig.tmp > ftconfig.h
+ rm ftconfig.tmp])
# create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk'
# and `builds/unix/unix-cc.mk' that will be used by the build system
diff --git a/builds/unix/ftconfig.h.in b/builds/unix/ftconfig.h.in
deleted file mode 100644
index 00b5a82..0000000
--- a/builds/unix/ftconfig.h.in
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
- *
- * ftconfig.h.in
- *
- * UNIX-specific configuration file (specification only).
- *
- * Copyright (C) 1996-2020 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.
- *
- */
-
-
- /**************************************************************************
- *
- * This header file contains a number of macro definitions that are used by
- * the rest of the engine. Most of the macros here are automatically
- * determined at compile time, and you should not need to change it to port
- * FreeType, except to compile the library with a non-ANSI compiler.
- *
- * Note however that if some specific modifications are needed, we advise
- * you to place a modified copy in your build directory.
- *
- * The build directory is usually `builds/<system>`, and contains
- * system-specific files that are always included first when building the
- * library.
- *
- */
-
-#ifndef FTCONFIG_H_
-#define FTCONFIG_H_
-
-#include <ft2build.h>
-#include FT_CONFIG_OPTIONS_H
-#include FT_CONFIG_STANDARD_LIBRARY_H
-
-#undef HAVE_UNISTD_H
-#undef HAVE_FCNTL_H
-
-#undef FT_USE_AUTOCONF_SIZEOF_TYPES
-#ifdef FT_USE_AUTOCONF_SIZEOF_TYPES
-
-#undef SIZEOF_INT
-#undef SIZEOF_LONG
-#define FT_SIZEOF_INT SIZEOF_INT
-#define FT_SIZEOF_LONG SIZEOF_LONG
-
-#endif /* FT_USE_AUTOCONF_SIZEOF_TYPES */
-
-#include <freetype/config/integer-types.h>
-#include <freetype/config/public-macros.h>
-#include <freetype/config/mac-support.h>
-
-#endif /* FTCONFIG_H_ */
-
-
-/* END */
diff --git a/builds/unix/ftconfig.in b/builds/unix/ftconfig.in
new file mode 100644
index 0000000..a8c7d8a
--- /dev/null
+++ b/builds/unix/ftconfig.in
@@ -0,0 +1,602 @@
+/****************************************************************************
+ *
+ * ftconfig.in
+ *
+ * UNIX-specific configuration file (specification only).
+ *
+ * Copyright (C) 1996-2020 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.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * This header file contains a number of macro definitions that are used by
+ * the rest of the engine. Most of the macros here are automatically
+ * determined at compile time, and you should not need to change it to port
+ * FreeType, except to compile the library with a non-ANSI compiler.
+ *
+ * Note however that if some specific modifications are needed, we advise
+ * you to place a modified copy in your build directory.
+ *
+ * The build directory is usually `builds/<system>`, and contains
+ * system-specific files that are always included first when building the
+ * library.
+ *
+ */
+
+#ifndef FTCONFIG_H_
+#define FTCONFIG_H_
+
+#include <ft2build.h>
+#include FT_CONFIG_OPTIONS_H
+#include FT_CONFIG_STANDARD_LIBRARY_H
+
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * PLATFORM-SPECIFIC CONFIGURATION MACROS
+ *
+ * These macros can be toggled to suit a specific system. The current ones
+ * are defaults used to compile FreeType in an ANSI C environment (16bit
+ * compilers are also supported). Copy this file to your own
+ * `builds/<system>` directory, and edit it to port the engine.
+ *
+ */
+
+#undef HAVE_UNISTD_H
+#undef HAVE_FCNTL_H
+
+ /* There are systems (like the Texas Instruments 'C54x) where a `char` */
+ /* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
+ /* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
+ /* is probably unexpected. */
+ /* */
+ /* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
+ /* `char` type. */
+
+#ifndef FT_CHAR_BIT
+#define FT_CHAR_BIT CHAR_BIT
+#endif
+
+
+#undef FT_USE_AUTOCONF_SIZEOF_TYPES
+#ifdef FT_USE_AUTOCONF_SIZEOF_TYPES
+
+#undef SIZEOF_INT
+#undef SIZEOF_LONG
+#define FT_SIZEOF_INT SIZEOF_INT
+#define FT_SIZEOF_LONG SIZEOF_LONG
+
+#else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
+
+ /* Following cpp computation of the bit length of `int` and `long` */
+ /* is copied from default `include/freetype/config/ftconfig.h`. */
+ /* If any improvement is required for this file, it should be */
+ /* applied to the original header file for the builders that do */
+ /* not use configure script. */
+
+ /* The size of an `int` type. */
+#if FT_UINT_MAX == 0xFFFFUL
+#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
+#elif FT_UINT_MAX == 0xFFFFFFFFUL
+#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 )
+#else
+#error "Unsupported size of `int' type!"
+#endif
+
+ /* 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 )
+#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
+#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 )
+#else
+#error "Unsupported size of `long' type!"
+#endif
+
+#endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */
+
+ /* `FT_UNUSED` indicates that a given parameter is not used -- */
+ /* this is only used to get rid of unpleasant compiler warnings. */
+#ifndef FT_UNUSED
+#define FT_UNUSED( arg ) ( (arg) = (arg) )
+#endif
+
+
+ /**************************************************************************
+ *
+ * AUTOMATIC CONFIGURATION MACROS
+ *
+ * These macros are computed from the ones defined above. Don't touch
+ * their definition, unless you know precisely what you are doing. No
+ * porter should need to mess with them.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * Mac support
+ *
+ * This is the only necessary change, so it is defined here instead
+ * providing a new configuration file.
+ */
+#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
+ /* No Carbon frameworks for 64bit 10.4.x. */
+ /* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
+ /* so guess the system version by maximum errno before inclusion. */
+#include <errno.h>
+#ifdef ECANCELED /* defined since 10.2 */
+#include "AvailabilityMacros.h"
+#endif
+#if defined( __LP64__ ) && \
+ ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
+/undef FT_MACINTOSH
+#endif
+
+#elif defined( __SC__ ) || defined( __MRC__ )
+ /* Classic MacOS compilers */
+#include "ConditionalMacros.h"
+#if TARGET_OS_MAC
+#define FT_MACINTOSH 1
+#endif
+
+#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:
+ * basic_types
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_Int16
+ *
+ * @description:
+ * A typedef for a 16bit signed integer type.
+ */
+ typedef signed short FT_Int16;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_UInt16
+ *
+ * @description:
+ * A typedef for a 16bit unsigned integer type.
+ */
+ typedef unsigned short FT_UInt16;
+
+ /* */
+
+
+ /* this #if 0 ... #endif clause is for documentation purposes */
+#if 0
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_Int32
+ *
+ * @description:
+ * A typedef for a 32bit signed integer type. The size depends on the
+ * configuration.
+ */
+ typedef signed XXX FT_Int32;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_UInt32
+ *
+ * A typedef for a 32bit unsigned integer type. The size depends on the
+ * configuration.
+ */
+ typedef unsigned XXX FT_UInt32;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_Int64
+ *
+ * A typedef for a 64bit signed integer type. The size depends on the
+ * configuration. Only defined if there is real 64bit support;
+ * otherwise, it gets emulated with a structure (if necessary).
+ */
+ typedef signed XXX FT_Int64;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_UInt64
+ *
+ * A typedef for a 64bit unsigned integer type. The size depends on the
+ * configuration. Only defined if there is real 64bit support;
+ * otherwise, it gets emulated with a structure (if necessary).
+ */
+ typedef unsigned XXX FT_UInt64;
+
+ /* */
+
+#endif
+
+#if FT_SIZEOF_INT == 4
+
+ typedef signed int FT_Int32;
+ typedef unsigned int FT_UInt32;
+
+#elif FT_SIZEOF_LONG == 4
+
+ typedef signed long FT_Int32;
+ typedef unsigned long FT_UInt32;
+
+#else
+#error "no 32bit type found -- please check your configuration files"
+#endif
+
+
+ /* look up an integer type that is at least 32~bits */
+#if FT_SIZEOF_INT >= 4
+
+ typedef int FT_Fast;
+ typedef unsigned int FT_UFast;
+
+#elif FT_SIZEOF_LONG >= 4
+
+ typedef long FT_Fast;
+ typedef unsigned long FT_UFast;
+
+#endif
+
+
+ /* determine whether we have a 64-bit `int` type for platforms without */
+ /* Autoconf */
+#if FT_SIZEOF_LONG == 8
+
+ /* `FT_LONG64` must be defined if a 64-bit type is available */
+#define FT_LONG64
+#define FT_INT64 long
+#define FT_UINT64 unsigned long
+
+ /* we handle the LLP64 scheme separately for GCC and clang, */
+ /* suppressing the `long long` warning */
+#elif ( FT_SIZEOF_LONG == 4 ) && \
+ defined( HAVE_LONG_LONG_INT ) && \
+ defined( __GNUC__ )
+#pragma GCC diagnostic ignored "-Wlong-long"
+#define FT_LONG64
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+ /**************************************************************************
+ *
+ * A 64-bit data type may create compilation problems if you compile in
+ * strict ANSI mode. To avoid them, we disable other 64-bit data types if
+ * `__STDC__` is defined. You can however ignore this rule by defining the
+ * `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
+ */
+#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
+
+#if defined( __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
+#define FT_INT64 __int64
+#define FT_UINT64 unsigned __int64
+
+#elif defined( __BORLANDC__ ) /* Borland C++ */
+
+ /* XXXX: We should probably check the value of `__BORLANDC__` in order */
+ /* to test the compiler version. */
+
+ /* this compiler provides the `__int64` type */
+#define FT_LONG64
+#define FT_INT64 __int64
+#define FT_UINT64 unsigned __int64
+
+#elif defined( __WATCOMC__ ) /* Watcom C++ */
+
+ /* Watcom doesn't provide 64-bit data types */
+
+#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
+
+#define FT_LONG64
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+#elif defined( __GNUC__ )
+
+ /* GCC provides the `long long` type */
+#define FT_LONG64
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+#endif /* __STDC_VERSION__ >= 199901L */
+
+#endif /* FT_SIZEOF_LONG == 8 */
+
+#ifdef FT_LONG64
+ typedef FT_INT64 FT_Int64;
+ typedef FT_UINT64 FT_UInt64;
+#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
+ *
+ */
+
+
+#define FT_BEGIN_STMNT do {
+#define FT_END_STMNT } while ( 0 )
+#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
+
+
+ /* `typeof` condition taken from gnulib's `intprops.h` header file */
+#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
+#define FT_LOCAL_DEF( x ) static x
+
+#else
+
+#ifdef __cplusplus
+#define FT_LOCAL( x ) extern "C" x
+#define FT_LOCAL_DEF( x ) extern "C" x
+#else
+#define FT_LOCAL( x ) extern x
+#define FT_LOCAL_DEF( x ) x
+#endif
+
+#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
+
+#define FT_LOCAL_ARRAY( x ) extern const x
+#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
+#define FT_BASE( x ) extern "C" x
+#else
+#define FT_BASE( x ) extern x
+#endif
+
+#endif /* !FT_BASE */
+
+
+#ifndef FT_BASE_DEF
+
+#ifdef __cplusplus
+#define FT_BASE_DEF( x ) x
+#else
+#define FT_BASE_DEF( x ) x
+#endif
+
+#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 FT2_BUILD_LIBRARY
+
+#if defined( _WIN32 ) && 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( __SUNPRO_C ) && __SUNPRO_C >= 0x550
+#define FT_EXPORT( x ) __global x
+#elif defined( __cplusplus )
+#define FT_EXPORT( x ) extern "C" x
+#else
+#define FT_EXPORT( x ) extern x
+#endif
+
+#else
+
+#if defined( _WIN32 ) && defined( DLL_IMPORT )
+#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 */
+
+
+#ifndef FT_EXPORT_DEF
+
+#ifdef __cplusplus
+#define FT_EXPORT_DEF( x ) extern "C" x
+#else
+#define FT_EXPORT_DEF( x ) extern x
+#endif
+
+#endif /* !FT_EXPORT_DEF */
+
+
+#ifndef FT_EXPORT_VAR
+
+#ifdef __cplusplus
+#define FT_EXPORT_VAR( x ) extern "C" x
+#else
+#define FT_EXPORT_VAR( x ) extern x
+#endif
+
+#endif /* !FT_EXPORT_VAR */
+
+
+ /* The following macros are needed to compile the library with a */
+ /* C++ compiler and with 16bit compilers. */
+ /* */
+
+ /* This is special. Within C++, you must specify `extern "C"` for */
+ /* functions which are used via function pointers, and you also */
+ /* must do that for structures which contain function pointers to */
+ /* assure C linkage -- it's not possible to have (local) anonymous */
+ /* functions which are accessed by (global) function pointers. */
+ /* */
+ /* */
+ /* 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. */
+ /* */
+ /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
+ /* that contains pointers to callback functions. */
+ /* */
+ /* */
+ /* Some 16bit compilers have to redefine these macros to insert */
+ /* the infamous `_cdecl` or `__fastcall` declarations. */
+ /* */
+#ifndef FT_CALLBACK_DEF
+#ifdef __cplusplus
+#define FT_CALLBACK_DEF( x ) extern "C" x
+#else
+#define FT_CALLBACK_DEF( x ) static x
+#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"
+#define FT_CALLBACK_TABLE_DEF extern "C"
+#else
+#define FT_CALLBACK_TABLE extern
+#define FT_CALLBACK_TABLE_DEF /* nothing */
+#endif
+#endif /* FT_CALLBACK_TABLE */
+
+
+FT_END_HEADER
+
+
+#endif /* FTCONFIG_H_ */
+
+
+/* END */
diff --git a/builds/unix/ftsystem.c b/builds/unix/ftsystem.c
index 8437a66..dc11dd1 100644
--- a/builds/unix/ftsystem.c
+++ b/builds/unix/ftsystem.c
@@ -351,7 +351,7 @@
stream->read = 0;
FT_TRACE1(( "FT_Stream_Open:" ));
- FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n",
+ FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
filepathname, stream->size ));
return FT_Err_Ok;
diff --git a/builds/vms/ftconfig.h b/builds/vms/ftconfig.h
index 07e5f83..d9165e5 100644
--- a/builds/vms/ftconfig.h
+++ b/builds/vms/ftconfig.h
@@ -39,6 +39,21 @@
#include FT_CONFIG_OPTIONS_H
#include FT_CONFIG_STANDARD_LIBRARY_H
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * PLATFORM-SPECIFIC CONFIGURATION MACROS
+ *
+ * These macros can be toggled to suit a specific system. The current ones
+ * are defaults used to compile FreeType in an ANSI C environment (16bit
+ * compilers are also supported). Copy this file to your own
+ * `builds/<system>` directory, and edit it to port the engine.
+ *
+ */
+
#define HAVE_UNISTD_H 1
#define HAVE_FCNTL_H 1
@@ -48,9 +63,491 @@
#define FT_SIZEOF_INT 4
#define FT_SIZEOF_LONG 4
-#include <freetype/config/integer-types.h>
-#include <freetype/config/public-macros.h>
-#include <freetype/config/mac-support.h>
+
+ /* `FT_UNUSED` indicates that a given parameter is not used -- */
+ /* this is only used to get rid of unpleasant compiler warnings. */
+#ifndef FT_UNUSED
+#define FT_UNUSED( arg ) ( (arg) = (arg) )
+#endif
+
+
+ /**************************************************************************
+ *
+ * AUTOMATIC CONFIGURATION MACROS
+ *
+ * These macros are computed from the ones defined above. Don't touch
+ * their definition, unless you know precisely what you are doing. No
+ * porter should need to mess with them.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * Mac support
+ *
+ * This is the only necessary change, so it is defined here instead
+ * providing a new configuration file.
+ */
+#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
+ /* No Carbon frameworks for 64bit 10.4.x. */
+ /* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
+ /* so guess the system version by maximum errno before inclusion. */
+#include <errno.h>
+#ifdef ECANCELED /* defined since 10.2 */
+#include "AvailabilityMacros.h"
+#endif
+#if defined( __LP64__ ) && \
+ ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
+#undef FT_MACINTOSH
+#endif
+
+#elif defined( __SC__ ) || defined( __MRC__ )
+ /* Classic MacOS compilers */
+#include "ConditionalMacros.h"
+#if TARGET_OS_MAC
+#define FT_MACINTOSH 1
+#endif
+
+#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:
+ * basic_types
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_Int16
+ *
+ * @description:
+ * A typedef for a 16bit signed integer type.
+ */
+ typedef signed short FT_Int16;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_UInt16
+ *
+ * @description:
+ * A typedef for a 16bit unsigned integer type.
+ */
+ typedef unsigned short FT_UInt16;
+
+ /* */
+
+
+ /* this #if 0 ... #endif clause is for documentation purposes */
+#if 0
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_Int32
+ *
+ * @description:
+ * A typedef for a 32bit signed integer type. The size depends on the
+ * configuration.
+ */
+ typedef signed XXX FT_Int32;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_UInt32
+ *
+ * A typedef for a 32bit unsigned integer type. The size depends on the
+ * configuration.
+ */
+ typedef unsigned XXX FT_UInt32;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_Int64
+ *
+ * A typedef for a 64bit signed integer type. The size depends on the
+ * configuration. Only defined if there is real 64bit support;
+ * otherwise, it gets emulated with a structure (if necessary).
+ */
+ typedef signed XXX FT_Int64;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_UInt64
+ *
+ * A typedef for a 64bit unsigned integer type. The size depends on the
+ * configuration. Only defined if there is real 64bit support;
+ * otherwise, it gets emulated with a structure (if necessary).
+ */
+ typedef unsigned XXX FT_UInt64;
+
+ /* */
+
+#endif
+
+#if FT_SIZEOF_INT == 4
+
+ typedef signed int FT_Int32;
+ typedef unsigned int FT_UInt32;
+
+#elif FT_SIZEOF_LONG == 4
+
+ typedef signed long FT_Int32;
+ typedef unsigned long FT_UInt32;
+
+#else
+#error "no 32bit type found -- please check your configuration files"
+#endif
+
+
+ /* look up an integer type that is at least 32~bits */
+#if FT_SIZEOF_INT >= 4
+
+ typedef int FT_Fast;
+ typedef unsigned int FT_UFast;
+
+#elif FT_SIZEOF_LONG >= 4
+
+ typedef long FT_Fast;
+ typedef unsigned long FT_UFast;
+
+#endif
+
+
+ /* determine whether we have a 64-bit `int` type for platforms without */
+ /* Autoconf */
+#if FT_SIZEOF_LONG == 8
+
+ /* `FT_LONG64` must be defined if a 64-bit type is available */
+#define FT_LONG64
+#define FT_INT64 long
+#define FT_UINT64 unsigned long
+
+ /* we handle the LLP64 scheme separately for GCC and clang, */
+ /* suppressing the `long long` warning */
+#elif ( FT_SIZEOF_LONG == 4 ) && \
+ defined( HAVE_LONG_LONG_INT ) && \
+ defined( __GNUC__ )
+#pragma GCC diagnostic ignored "-Wlong-long"
+#define FT_LONG64
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+ /**************************************************************************
+ *
+ * A 64-bit data type may create compilation problems if you compile in
+ * strict ANSI mode. To avoid them, we disable other 64-bit data types if
+ * `__STDC__` is defined. You can however ignore this rule by defining the
+ * `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
+ */
+#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
+
+#if defined( __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
+#define FT_INT64 __int64
+#define FT_UINT64 unsigned __int64
+
+#elif defined( __BORLANDC__ ) /* Borland C++ */
+
+ /* XXXX: We should probably check the value of `__BORLANDC__` in order */
+ /* to test the compiler version. */
+
+ /* this compiler provides the `__int64` type */
+#define FT_LONG64
+#define FT_INT64 __int64
+#define FT_UINT64 unsigned __int64
+
+#elif defined( __WATCOMC__ ) /* Watcom C++ */
+
+ /* Watcom doesn't provide 64-bit data types */
+
+#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
+
+#define FT_LONG64
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+#elif defined( __GNUC__ )
+
+ /* GCC provides the `long long` type */
+#define FT_LONG64
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+#endif /* __STDC_VERSION__ >= 199901L */
+
+#endif /* FT_SIZEOF_LONG == 8 */
+
+#ifdef FT_LONG64
+ typedef FT_INT64 FT_Int64;
+ typedef FT_UINT64 FT_UInt64;
+#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
+ *
+ */
+
+
+#define FT_BEGIN_STMNT do {
+#define FT_END_STMNT } while ( 0 )
+#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
+
+
+ /* `typeof` condition taken from gnulib's `intprops.h` header file */
+#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
+#define FT_LOCAL_DEF( x ) static x
+
+#else
+
+#ifdef __cplusplus
+#define FT_LOCAL( x ) extern "C" x
+#define FT_LOCAL_DEF( x ) extern "C" x
+#else
+#define FT_LOCAL( x ) extern x
+#define FT_LOCAL_DEF( x ) x
+#endif
+
+#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
+
+#define FT_LOCAL_ARRAY( x ) extern const x
+#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
+#define FT_BASE( x ) extern "C" x
+#else
+#define FT_BASE( x ) extern x
+#endif
+
+#endif /* !FT_BASE */
+
+
+#ifndef FT_BASE_DEF
+
+#ifdef __cplusplus
+#define FT_BASE_DEF( x ) x
+#else
+#define FT_BASE_DEF( x ) x
+#endif
+
+#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 FT2_BUILD_LIBRARY
+
+#if defined( _WIN32 ) && 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( __SUNPRO_C ) && __SUNPRO_C >= 0x550
+#define FT_EXPORT( x ) __global x
+#elif defined( __cplusplus )
+#define FT_EXPORT( x ) extern "C" x
+#else
+#define FT_EXPORT( x ) extern x
+#endif
+
+#else
+
+#if defined( _WIN32 ) && defined( DLL_IMPORT )
+#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 */
+
+
+#ifndef FT_EXPORT_DEF
+
+#ifdef __cplusplus
+#define FT_EXPORT_DEF( x ) extern "C" x
+#else
+#define FT_EXPORT_DEF( x ) extern x
+#endif
+
+#endif /* !FT_EXPORT_DEF */
+
+
+#ifndef FT_EXPORT_VAR
+
+#ifdef __cplusplus
+#define FT_EXPORT_VAR( x ) extern "C" x
+#else
+#define FT_EXPORT_VAR( x ) extern x
+#endif
+
+#endif /* !FT_EXPORT_VAR */
+
+
+ /* The following macros are needed to compile the library with a */
+ /* C++ compiler and with 16bit compilers. */
+ /* */
+
+ /* This is special. Within C++, you must specify `extern "C"` for */
+ /* functions which are used via function pointers, and you also */
+ /* must do that for structures which contain function pointers to */
+ /* assure C linkage -- it's not possible to have (local) anonymous */
+ /* functions which are accessed by (global) function pointers. */
+ /* */
+ /* */
+ /* 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. */
+ /* */
+ /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
+ /* that contains pointers to callback functions. */
+ /* */
+ /* */
+ /* Some 16bit compilers have to redefine these macros to insert */
+ /* the infamous `_cdecl` or `__fastcall` declarations. */
+ /* */
+#ifndef FT_CALLBACK_DEF
+#ifdef __cplusplus
+#define FT_CALLBACK_DEF( x ) extern "C" x
+#else
+#define FT_CALLBACK_DEF( x ) static x
+#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"
+#define FT_CALLBACK_TABLE_DEF extern "C"
+#else
+#define FT_CALLBACK_TABLE extern
+#define FT_CALLBACK_TABLE_DEF /* nothing */
+#endif
+#endif /* FT_CALLBACK_TABLE */
+
+
+FT_END_HEADER
+
#endif /* FTCONFIG_H_ */
diff --git a/include/freetype/config/ftconfig.h
b/include/freetype/config/ftconfig.h
index b464e0b..14eecef 100644
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -41,9 +41,533 @@
#include FT_CONFIG_OPTIONS_H
#include FT_CONFIG_STANDARD_LIBRARY_H
-#include <freetype/config/integer-types.h>
-#include <freetype/config/public-macros.h>
-#include <freetype/config/mac-support.h>
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * PLATFORM-SPECIFIC CONFIGURATION MACROS
+ *
+ * These macros can be toggled to suit a specific system. The current ones
+ * are defaults used to compile FreeType in an ANSI C environment (16bit
+ * compilers are also supported). Copy this file to your own
+ * `builds/<system>` directory, and edit it to port the engine.
+ *
+ */
+
+
+ /* There are systems (like the Texas Instruments 'C54x) where a `char` */
+ /* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
+ /* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
+ /* is probably unexpected. */
+ /* */
+ /* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
+ /* `char` type. */
+
+#ifndef FT_CHAR_BIT
+#define FT_CHAR_BIT CHAR_BIT
+#endif
+
+
+ /* The size of an `int` type. */
+#if FT_UINT_MAX == 0xFFFFUL
+#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
+#elif FT_UINT_MAX == 0xFFFFFFFFUL
+#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 )
+#else
+#error "Unsupported size of `int' type!"
+#endif
+
+ /* 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 )
+#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
+#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 )
+#else
+#error "Unsupported size of `long' type!"
+#endif
+
+
+ /* `FT_UNUSED` indicates that a given parameter is not used -- */
+ /* this is only used to get rid of unpleasant compiler warnings. */
+#ifndef FT_UNUSED
+#define FT_UNUSED( arg ) ( (arg) = (arg) )
+#endif
+
+
+ /**************************************************************************
+ *
+ * AUTOMATIC CONFIGURATION MACROS
+ *
+ * These macros are computed from the ones defined above. Don't touch
+ * their definition, unless you know precisely what you are doing. No
+ * porter should need to mess with them.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * Mac support
+ *
+ * This is the only necessary change, so it is defined here instead
+ * providing a new configuration file.
+ */
+#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
+ /* No Carbon frameworks for 64bit 10.4.x. */
+ /* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
+ /* so guess the system version by maximum errno before inclusion. */
+#include <errno.h>
+#ifdef ECANCELED /* defined since 10.2 */
+#include "AvailabilityMacros.h"
+#endif
+#if defined( __LP64__ ) && \
+ ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
+#undef FT_MACINTOSH
+#endif
+
+#elif defined( __SC__ ) || defined( __MRC__ )
+ /* Classic MacOS compilers */
+#include "ConditionalMacros.h"
+#if TARGET_OS_MAC
+#define FT_MACINTOSH 1
+#endif
+
+#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:
+ * basic_types
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_Int16
+ *
+ * @description:
+ * A typedef for a 16bit signed integer type.
+ */
+ typedef signed short FT_Int16;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_UInt16
+ *
+ * @description:
+ * A typedef for a 16bit unsigned integer type.
+ */
+ typedef unsigned short FT_UInt16;
+
+ /* */
+
+
+ /* this #if 0 ... #endif clause is for documentation purposes */
+#if 0
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_Int32
+ *
+ * @description:
+ * A typedef for a 32bit signed integer type. The size depends on the
+ * configuration.
+ */
+ typedef signed XXX FT_Int32;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_UInt32
+ *
+ * A typedef for a 32bit unsigned integer type. The size depends on the
+ * configuration.
+ */
+ typedef unsigned XXX FT_UInt32;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_Int64
+ *
+ * A typedef for a 64bit signed integer type. The size depends on the
+ * configuration. Only defined if there is real 64bit support;
+ * otherwise, it gets emulated with a structure (if necessary).
+ */
+ typedef signed XXX FT_Int64;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_UInt64
+ *
+ * A typedef for a 64bit unsigned integer type. The size depends on the
+ * configuration. Only defined if there is real 64bit support;
+ * otherwise, it gets emulated with a structure (if necessary).
+ */
+ typedef unsigned XXX FT_UInt64;
+
+ /* */
+
+#endif
+
+#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 )
+
+ typedef signed long FT_Int32;
+ typedef unsigned long FT_UInt32;
+
+#else
+#error "no 32bit type found -- please check your configuration files"
+#endif
+
+
+ /* look up an integer type that is at least 32~bits */
+#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 )
+
+ typedef long FT_Fast;
+ typedef unsigned long FT_UFast;
+
+#endif
+
+
+ /* determine whether we have a 64-bit `int` type for platforms without */
+ /* Autoconf */
+#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
+
+ /* `FT_LONG64` must be defined if a 64-bit type is available */
+#define FT_LONG64
+#define FT_INT64 long
+#define FT_UINT64 unsigned long
+
+ /**************************************************************************
+ *
+ * A 64-bit data type may create compilation problems if you compile in
+ * strict ANSI mode. To avoid them, we disable other 64-bit data types if
+ * `__STDC__` is defined. You can however ignore this rule by defining the
+ * `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
+ */
+#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
+
+#if defined( __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
+#define FT_INT64 __int64
+#define FT_UINT64 unsigned __int64
+
+#elif defined( __BORLANDC__ ) /* Borland C++ */
+
+ /* XXXX: We should probably check the value of `__BORLANDC__` in order */
+ /* to test the compiler version. */
+
+ /* this compiler provides the `__int64` type */
+#define FT_LONG64
+#define FT_INT64 __int64
+#define FT_UINT64 unsigned __int64
+
+#elif defined( __WATCOMC__ ) /* Watcom C++ */
+
+ /* Watcom doesn't provide 64-bit data types */
+
+#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
+
+#define FT_LONG64
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+#elif defined( __GNUC__ )
+
+ /* GCC provides the `long long` type */
+#define FT_LONG64
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
+#endif /* __STDC_VERSION__ >= 199901L */
+
+#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
+
+#ifdef FT_LONG64
+ typedef FT_INT64 FT_Int64;
+ typedef FT_UINT64 FT_UInt64;
+#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
+ *
+ */
+
+
+#define FT_BEGIN_STMNT do {
+#define FT_END_STMNT } while ( 0 )
+#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
+
+
+ /* `typeof` condition taken from gnulib's `intprops.h` header file */
+#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
+#define FT_LOCAL_DEF( x ) static x
+
+#else
+
+#ifdef __cplusplus
+#define FT_LOCAL( x ) extern "C" x
+#define FT_LOCAL_DEF( x ) extern "C" x
+#else
+#define FT_LOCAL( x ) extern x
+#define FT_LOCAL_DEF( x ) x
+#endif
+
+#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
+
+#define FT_LOCAL_ARRAY( x ) extern const x
+#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
+#define FT_BASE( x ) extern "C" x
+#else
+#define FT_BASE( x ) extern x
+#endif
+
+#endif /* !FT_BASE */
+
+
+#ifndef FT_BASE_DEF
+
+#ifdef __cplusplus
+#define FT_BASE_DEF( x ) x
+#else
+#define FT_BASE_DEF( x ) x
+#endif
+
+#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 FT2_BUILD_LIBRARY
+
+#if defined( _WIN32 ) && 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( __SUNPRO_C ) && __SUNPRO_C >= 0x550
+#define FT_EXPORT( x ) __global x
+#elif defined( __cplusplus )
+#define FT_EXPORT( x ) extern "C" x
+#else
+#define FT_EXPORT( x ) extern x
+#endif
+
+#else
+
+#if defined( _WIN32 ) && defined( DLL_IMPORT )
+#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 */
+
+
+#ifndef FT_EXPORT_DEF
+
+#ifdef __cplusplus
+#define FT_EXPORT_DEF( x ) extern "C" x
+#else
+#define FT_EXPORT_DEF( x ) extern x
+#endif
+
+#endif /* !FT_EXPORT_DEF */
+
+
+#ifndef FT_EXPORT_VAR
+
+#ifdef __cplusplus
+#define FT_EXPORT_VAR( x ) extern "C" x
+#else
+#define FT_EXPORT_VAR( x ) extern x
+#endif
+
+#endif /* !FT_EXPORT_VAR */
+
+
+ /* The following macros are needed to compile the library with a */
+ /* C++ compiler and with 16bit compilers. */
+ /* */
+
+ /* This is special. Within C++, you must specify `extern "C"` for */
+ /* functions which are used via function pointers, and you also */
+ /* must do that for structures which contain function pointers to */
+ /* assure C linkage -- it's not possible to have (local) anonymous */
+ /* functions which are accessed by (global) function pointers. */
+ /* */
+ /* */
+ /* 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. */
+ /* */
+ /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
+ /* that contains pointers to callback functions. */
+ /* */
+ /* */
+ /* Some 16bit compilers have to redefine these macros to insert */
+ /* the infamous `_cdecl` or `__fastcall` declarations. */
+ /* */
+#ifndef FT_CALLBACK_DEF
+#ifdef __cplusplus
+#define FT_CALLBACK_DEF( x ) extern "C" x
+#else
+#define FT_CALLBACK_DEF( x ) static x
+#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"
+#define FT_CALLBACK_TABLE_DEF extern "C"
+#else
+#define FT_CALLBACK_TABLE extern
+#define FT_CALLBACK_TABLE_DEF /* nothing */
+#endif
+#endif /* FT_CALLBACK_TABLE */
+
+
+FT_END_HEADER
+
#endif /* FTCONFIG_H_ */
diff --git a/include/freetype/config/ftheader.h
b/include/freetype/config/ftheader.h
index 28b5cc6..b028ece 100644
--- a/include/freetype/config/ftheader.h
+++ b/include/freetype/config/ftheader.h
@@ -30,12 +30,10 @@
/* encapsulated in an `extern "C" { .. }` block when included from a */
/* C++ compiler. */
/* */
-#ifndef FT_BEGIN_HEADER
-# ifdef __cplusplus
-# define FT_BEGIN_HEADER extern "C" {
-# else
-# define FT_BEGIN_HEADER /* nothing */
-# endif
+#ifdef __cplusplus
+#define FT_BEGIN_HEADER extern "C" {
+#else
+#define FT_BEGIN_HEADER /* nothing */
#endif
@@ -50,12 +48,10 @@
/* encapsulated in an `extern "C" { .. }` block when included from a */
/* C++ compiler. */
/* */
-#ifndef FT_END_HEADER
-# ifdef __cplusplus
-# define FT_END_HEADER }
-# else
-# define FT_END_HEADER /* nothing */
-# endif
+#ifdef __cplusplus
+#define FT_END_HEADER }
+#else
+#define FT_END_HEADER /* nothing */
#endif
diff --git a/include/freetype/config/integer-types.h
b/include/freetype/config/integer-types.h
deleted file mode 100644
index a0ca0c9..0000000
--- a/include/freetype/config/integer-types.h
+++ /dev/null
@@ -1,245 +0,0 @@
-/****************************************************************************
- *
- * config/integer-types.h
- *
- * FreeType integer types definitions.
- *
- * Copyright (C) 1996-2020 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 FREETYPE_CONFIG_INTEGER_TYPES_H_
-#define FREETYPE_CONFIG_INTEGER_TYPES_H_
-
- /* There are systems (like the Texas Instruments 'C54x) where a `char` */
- /* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
- /* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
- /* is probably unexpected. */
- /* */
- /* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
- /* `char` type. */
-
-#ifndef FT_CHAR_BIT
-#define FT_CHAR_BIT CHAR_BIT
-#endif
-
-#ifndef FT_SIZEOF_INT
-
- /* The size of an `int` type. */
-#if FT_UINT_MAX == 0xFFFFUL
-#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
-#elif FT_UINT_MAX == 0xFFFFFFFFUL
-#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 )
-#else
-#error "Unsupported size of `int' type!"
-#endif
-
-#endif /* !defined(FT_SIZEOF_INT) */
-
-#ifndef FT_SIZEOF_LONG
-
- /* 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 )
-#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
-#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 )
-#else
-#error "Unsupported size of `long' type!"
-#endif
-
-#endif /* !defined(FT_SIZEOF_LONG) */
-
- /**************************************************************************
- *
- * @section:
- * basic_types
- *
- */
-
-
- /**************************************************************************
- *
- * @type:
- * FT_Int16
- *
- * @description:
- * A typedef for a 16bit signed integer type.
- */
- typedef signed short FT_Int16;
-
-
- /**************************************************************************
- *
- * @type:
- * FT_UInt16
- *
- * @description:
- * A typedef for a 16bit unsigned integer type.
- */
- typedef unsigned short FT_UInt16;
-
- /* */
-
-
- /* this #if 0 ... #endif clause is for documentation purposes */
-#if 0
-
- /**************************************************************************
- *
- * @type:
- * FT_Int32
- *
- * @description:
- * A typedef for a 32bit signed integer type. The size depends on the
- * configuration.
- */
- typedef signed XXX FT_Int32;
-
-
- /**************************************************************************
- *
- * @type:
- * FT_UInt32
- *
- * A typedef for a 32bit unsigned integer type. The size depends on the
- * configuration.
- */
- typedef unsigned XXX FT_UInt32;
-
-
- /**************************************************************************
- *
- * @type:
- * FT_Int64
- *
- * A typedef for a 64bit signed integer type. The size depends on the
- * configuration. Only defined if there is real 64bit support;
- * otherwise, it gets emulated with a structure (if necessary).
- */
- typedef signed XXX FT_Int64;
-
-
- /**************************************************************************
- *
- * @type:
- * FT_UInt64
- *
- * A typedef for a 64bit unsigned integer type. The size depends on the
- * configuration. Only defined if there is real 64bit support;
- * otherwise, it gets emulated with a structure (if necessary).
- */
- typedef unsigned XXX FT_UInt64;
-
- /* */
-
-#endif
-
-#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 )
-
- typedef signed long FT_Int32;
- typedef unsigned long FT_UInt32;
-
-#else
-#error "no 32bit type found -- please check your configuration files"
-#endif
-
-
- /* look up an integer type that is at least 32~bits */
-#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 )
-
- typedef long FT_Fast;
- typedef unsigned long FT_UFast;
-
-#endif
-
-
- /* determine whether we have a 64-bit `int` type for platforms without */
- /* Autoconf */
-#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
-
- /* `FT_LONG64` must be defined if a 64-bit type is available */
-#define FT_LONG64
-#define FT_INT64 long
-#define FT_UINT64 unsigned long
-
- /**************************************************************************
- *
- * A 64-bit data type may create compilation problems if you compile in
- * strict ANSI mode. To avoid them, we disable other 64-bit data types if
- * `__STDC__` is defined. You can however ignore this rule by defining the
- * `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
- */
-#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
-
-#if defined( __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
-#define FT_INT64 __int64
-#define FT_UINT64 unsigned __int64
-
-#elif defined( __BORLANDC__ ) /* Borland C++ */
-
- /* XXXX: We should probably check the value of `__BORLANDC__` in order */
- /* to test the compiler version. */
-
- /* this compiler provides the `__int64` type */
-#define FT_LONG64
-#define FT_INT64 __int64
-#define FT_UINT64 unsigned __int64
-
-#elif defined( __WATCOMC__ ) /* Watcom C++ */
-
- /* Watcom doesn't provide 64-bit data types */
-
-#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
-
-#define FT_LONG64
-#define FT_INT64 long long int
-#define FT_UINT64 unsigned long long int
-
-#elif defined( __GNUC__ )
-
- /* GCC provides the `long long` type */
-#define FT_LONG64
-#define FT_INT64 long long int
-#define FT_UINT64 unsigned long long int
-
-#endif /* __STDC_VERSION__ >= 199901L */
-
-#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
-
-#ifdef FT_LONG64
- typedef FT_INT64 FT_Int64;
- typedef FT_UINT64 FT_UInt64;
-#endif
-
-
-#endif /* FREETYPE_CONFIG_INTEGER_TYPES_H_ */
diff --git a/include/freetype/config/mac-support.h
b/include/freetype/config/mac-support.h
deleted file mode 100644
index 9486708..0000000
--- a/include/freetype/config/mac-support.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
- *
- * config/mac-support.h
- *
- * Mac/OS X support configuration header.
- *
- * Copyright (C) 1996-2020 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 FREETYPE_CONFIG_MAC_SUPPORT_H_
-#define FREETYPE_CONFIG_MAC_SUPPORT_H_
-
- /**************************************************************************
- *
- * Mac support
- *
- * This is the only necessary change, so it is defined here instead
- * providing a new configuration file.
- */
-#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
- /* No Carbon frameworks for 64bit 10.4.x. */
- /* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
- /* so guess the system version by maximum errno before inclusion. */
-#include <errno.h>
-#ifdef ECANCELED /* defined since 10.2 */
-#include "AvailabilityMacros.h"
-#endif
-#if defined( __LP64__ ) && \
- ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
-#undef FT_MACINTOSH
-#endif
-
-#elif defined( __SC__ ) || defined( __MRC__ )
- /* Classic MacOS compilers */
-#include "ConditionalMacros.h"
-#if TARGET_OS_MAC
-#define FT_MACINTOSH 1
-#endif
-
-#endif /* Mac support */
-
-#endif /* FREETYPE_CONFIG_MAC_SUPPORT_H_ */
diff --git a/include/freetype/config/public-macros.h
b/include/freetype/config/public-macros.h
deleted file mode 100644
index 6aa673e..0000000
--- a/include/freetype/config/public-macros.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
- *
- * config/public-macros.h
- *
- * Define a set of compiler macros used in public FreeType headers.
- *
- * Copyright (C) 2020 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.
- *
- */
-
- /*
- * The definitions in this file are used by the public FreeType headers
- * and thus should be considered part of the public API.
- *
- * Other compiler-specific macro definitions that are not exposed by the
- * FreeType API should go into
- * `include/freetype/internal/compiler-macros.h` instead.
- */
-#ifndef FREETYPE_CONFIG_PUBLIC_MACROS_H_
-#define FREETYPE_CONFIG_PUBLIC_MACROS_H_
-
- /*
- * `FT_BEGIN_HEADER` and `FT_END_HEADER` might have already been defined
- * by `freetype/config/ftheader.h`, but we don't want to include this
- * header here, so redefine the macros here only when needed. Their
- * definition is very stable, so keeping them in sync with the ones in the
- * header should not be a maintenance issue.
- */
-#ifndef FT_BEGIN_HEADER
-#ifdef __cplusplus
-#define FT_BEGIN_HEADER extern "C" {
-#else
-#define FT_BEGIN_HEADER /* empty */
-#endif
-#endif /* FT_BEGIN_HEADER */
-
-#ifndef FT_END_HEADER
-#ifdef __cplusplus
-#define FT_END_HEADER }
-#else
-#define FT_END_HEADER /* empty */
-#endif
-#endif /* FT_END_HEADER */
-
-
-FT_BEGIN_HEADER
-
- /*
- * Mark a function declaration as public. This ensures it will be
- * properly exported to client code. Place this before a function
- * declaration.
- *
- * NOTE: This macro should be considered an internal implementation
- * detail, and not part of the FreeType API. It is only defined here
- * because it is needed by `FT_EXPORT`.
- */
-
- /* Visual C, mingw */
-#if defined( _WIN32 )
-
-#if defined( FT2_BUILD_LIBRARY ) && defined( DLL_EXPORT )
-#define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllexport )
-#elif defined( DLL_IMPORT )
-#define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllimport )
-#endif
-
- /* gcc, clang */
-#elif ( defined( __GNUC__ ) && __GNUC__ >= 4 ) || defined( __clang__ )
-#define FT_PUBLIC_FUNCTION_ATTRIBUTE \
- __attribute__(( visibility( "default" ) ))
-
- /* Sun */
-#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
-#define FT_PUBLIC_FUNCTION_ATTRIBUTE __global
-#endif
-
-
-#ifndef FT_PUBLIC_FUNCTION_ATTRIBUTE
-#define FT_PUBLIC_FUNCTION_ATTRIBUTE /* empty */
-#endif
-
-
- /*
- * Define a public FreeType API function. This ensures it is properly
- * exported or imported at build time. The macro parameter is the
- * function's return type as in:
- *
- * FT_EXPORT( FT_Bool )
- * FT_Object_Method( FT_Object obj,
- * ... );
- *
- * NOTE: This requires that all `FT_EXPORT` uses are inside
- * `FT_BEGIN_HEADER ... FT_END_HEADER` blocks. This guarantees that the
- * functions are exported with C linkage, even when the header is included
- * by a C++ source file.
- */
-#define FT_EXPORT( x ) FT_PUBLIC_FUNCTION_ATTRIBUTE extern x
-
- /*
- * `FT_UNUSED` indicates that a given parameter is not used -- this is
- * only used to get rid of unpleasant compiler warnings.
- *
- * Technically, this was not meant to be part of the public API, but some
- * third-party code depends on it.
- */
-#ifndef FT_UNUSED
-#define FT_UNUSED( arg ) ( (arg) = (arg) )
-#endif
-
-
-FT_END_HEADER
-
-#endif /* FREETYPE_CONFIG_PUBLIC_MACROS_H_ */
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index de06623..4f4748c 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -958,9 +958,6 @@ FT_BEGIN_HEADER
* Note that the bounding box might be off by (at least) one pixel for
* hinted fonts. See @FT_Size_Metrics for further discussion.
*
- * Note that the bounding box does not vary in OpenType variable fonts
- * and should only be used in relation to the default instance.
- *
* units_per_EM ::
* The number of font units per EM square for this face. This is
* typically 2048 for TrueType fonts, and 1000 for Type~1 fonts. Only
@@ -3175,12 +3172,6 @@ FT_BEGIN_HEADER
* A pointer to the translation vector. Use `NULL` for the null vector.
*
* @note:
- * This function is provided as a convenience, but keep in mind that
- * @FT_Matrix coefficients are only 16.16 fixed point values, which can
- * limit the accuracy of the results. Using floating-point computations
- * to perform the transform directly in client code instead will always
- * yield better numbers.
- *
* The transformation is only applied to scalable image formats after the
* glyph has been loaded. It means that hinting is unaltered by the
* transformation and is performed on the character size given in the
diff --git a/include/freetype/ftdriver.h b/include/freetype/ftdriver.h
index 804ec34..34fcaad 100644
--- a/include/freetype/ftdriver.h
+++ b/include/freetype/ftdriver.h
@@ -426,6 +426,10 @@ FT_BEGIN_HEADER
* counteracts the 'thinning out' of glyphs, making text remain readable
* at smaller sizes.
*
+ * By default, the Adobe engines for CFF, Type~1, and CID fonts darken
+ * stems at smaller sizes, regardless of hinting, to enhance contrast.
+ * Setting this property, stem darkening gets switched off.
+ *
* For the auto-hinter, stem-darkening is experimental currently and thus
* switched off by default (this is, `no-stem-darkening` is set to TRUE
* by default). Total consistency with the CFF driver is not achieved
diff --git a/include/freetype/ftimage.h b/include/freetype/ftimage.h
index 72bf8c4..d789298 100644
--- a/include/freetype/ftimage.h
+++ b/include/freetype/ftimage.h
@@ -407,13 +407,6 @@ FT_BEGIN_HEADER
* if @FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more
* information.
*
- * FT_OUTLINE_OVERLAP ::
- * This flag indicates that this outline contains overlapping contrours
- * and the anti-aliased renderer should perform oversampling to
- * metigate possible artifacts. This flag should _not_ be set for
- * well designed glyphs without overlaps because it quadruples the
- * rendering time.
- *
* FT_OUTLINE_HIGH_PRECISION ::
* This flag indicates that the scan-line converter should try to
* convert this outline to bitmaps with the highest possible quality.
@@ -446,7 +439,6 @@ FT_BEGIN_HEADER
#define FT_OUTLINE_SMART_DROPOUTS 0x10
#define FT_OUTLINE_INCLUDE_STUBS 0x20
-#define FT_OUTLINE_OVERLAP 0x80
#define FT_OUTLINE_HIGH_PRECISION 0x100
#define FT_OUTLINE_SINGLE_PASS 0x200
diff --git a/include/freetype/ftmodapi.h b/include/freetype/ftmodapi.h
index 3f7ae82..4b5cdfb 100644
--- a/include/freetype/ftmodapi.h
+++ b/include/freetype/ftmodapi.h
@@ -485,7 +485,7 @@ FT_BEGIN_HEADER
*
* ```
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
- * cff:no-stem-darkening=0 \
+ * cff:no-stem-darkening=1 \
* autofitter:warping=1
* ```
*
diff --git a/include/freetype/internal/autohint.h
b/include/freetype/internal/autohint.h
index 2a472e2..d4220a2 100644
--- a/include/freetype/internal/autohint.h
+++ b/include/freetype/internal/autohint.h
@@ -207,9 +207,6 @@ FT_BEGIN_HEADER
} FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;
-#define FT_DECLARE_AUTOHINTER_INTERFACE( class_ ) \
- FT_CALLBACK_TABLE const FT_AutoHinter_InterfaceRec class_;
-
#define FT_DEFINE_AUTOHINTER_INTERFACE( \
class_, \
reset_face_, \
diff --git a/include/freetype/internal/compiler-macros.h
b/include/freetype/internal/compiler-macros.h
deleted file mode 100644
index 97c18d3..0000000
--- a/include/freetype/internal/compiler-macros.h
+++ /dev/null
@@ -1,307 +0,0 @@
-/****************************************************************************
- *
- * internal/compiler-macros.h
- *
- * Compiler-specific macro definitions used internally by FreeType.
- *
- * Copyright (C) 2020 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 INTERNAL_COMPILER_MACROS_H_
-#define INTERNAL_COMPILER_MACROS_H_
-
-#include <freetype/config/public-macros.h>
-
-FT_BEGIN_HEADER
-
- /* Fix compiler warning with sgi compiler. */
-#if defined( __sgi ) && !defined( __GNUC__ )
-# if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
-# pragma set woff 3505
-# endif
-#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
-
- /*
- * When defining a macro that expands to a non-trivial C statement, use
- * FT_BEGIN_STMNT and FT_END_STMNT to enclose the macro's body. This
- * ensures there are no surprises when the macro is invoked in conditional
- * branches.
- *
- * Example:
- *
- * #define LOG( ... ) \
- * FT_BEGIN_STMNT \
- * if ( logging_enabled ) \
- * log( __VA_ARGS__ ); \
- * FT_END_STMNT
- */
-#define FT_BEGIN_STMNT do {
-#define FT_END_STMNT } while ( 0 )
-
- /*
- * FT_DUMMY_STMNT expands to an empty C statement. Useful for
- * conditionally defined statement macros.
- *
- * Example:
- *
- * #ifdef BUILD_CONFIG_LOGGING
- * #define LOG( ... ) \
- * FT_BEGIN_STMNT \
- * if ( logging_enabled ) \
- * log( __VA_ARGS__ ); \
- * FT_END_STMNT
- * #else
- * # define LOG( ... ) FT_DUMMY_STMNT
- * #endif
- */
-#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
-
-#ifdef _WIN64
- /* only 64bit Windows uses the LLP64 data model, i.e., */
- /* 32-bit integers, 64-bit pointers. */
-#define FT_UINT_TO_POINTER( x ) (void *)(unsigned __int64)(x)
-#else
-#define FT_UINT_TO_POINTER( x ) (void *)(unsigned long)(x)
-#endif
-
- /*
- * Use `FT_TYPEOF( type )` to cast a value to `type`. This is useful to
- * suppress signedness compilation warnings in macros.
- *
- * Example:
- *
- * #define PAD_( x, n ) ( (x) & ~FT_TYPEOF( x )( (n) - 1 ) )
- *
- * (The `typeof` condition is taken from gnulib's `intprops.h` header
- * file.)
- */
-#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
-
- /*
- * Mark a function declaration as internal to the library. This ensures
- * that it will not be exposed by default to client code, and helps
- * generate smaller and faster code on ELF-based platforms. Place this
- * before a function declaration.
- */
-
- /* Visual C, mingw */
-#if defined( _WIN32 )
-#define FT_INTERNAL_FUNCTION_ATTRIBUTE /* empty */
-
- /* gcc, clang */
-#elif ( defined( __GNUC__ ) && __GNUC__ >= 4 ) || defined( __clang__ )
-#define FT_INTERNAL_FUNCTION_ATTRIBUTE \
- __attribute__(( visibility( "hidden" ) ))
-
- /* Sun */
-#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
-#define FT_INTERNAL_FUNCTION_ATTRIBUTE __hidden
-
-#else
-#define FT_INTERNAL_FUNCTION_ATTRIBUTE /* empty */
-#endif
-
- /*
- * FreeType supports compilation of its C sources with a C++ compiler (in
- * C++ mode); this introduces a number of subtle issues.
- *
- * The main one is that a C++ function declaration and its definition must
- * have the same 'linkage'. Because all FreeType headers declare their
- * functions with C linkage (i.e., within an `extern "C" { ... }` block
- * due to the magic of FT_BEGIN_HEADER and FT_END_HEADER), their
- * definition in FreeType sources should also be prefixed with `extern
- * "C"` when compiled in C++ mode.
- *
- * The `FT_FUNCTION_DECLARATION` and `FT_FUNCTION_DEFINITION` macros are
- * provided to deal with this case, as well as `FT_CALLBACK_DEF` and its
- * siblings below.
- */
-
- /*
- * `FT_FUNCTION_DECLARATION( type )` can be used to write a C function
- * declaration to ensure it will have C linkage when the library is built
- * with a C++ compiler. The parameter is the function's return type, so a
- * declaration would look like
- *
- * FT_FUNCTION_DECLARATION( int )
- * foo( int x );
- *
- * NOTE: This requires that all uses are inside of `FT_BEGIN_HEADER ...
- * FT_END_HEADER` blocks, which guarantees that the declarations have C
- * linkage when the headers are included by C++ sources.
- *
- * NOTE: Do not use directly. Use `FT_LOCAL`, `FT_BASE`, and `FT_EXPORT`
- * instead.
- */
-#define FT_FUNCTION_DECLARATION( x ) extern x
-
- /*
- * Same as `FT_FUNCTION_DECLARATION`, but for function definitions instead.
- *
- * NOTE: Do not use directly. Use `FT_LOCAL_DEF`, `FT_BASE_DEF`, and
- * `FT_EXPORT_DEF` instead.
- */
-#ifdef __cplusplus
-#define FT_FUNCTION_DEFINITION( x ) extern "C" x
-#else
-#define FT_FUNCTION_DEFINITION( x ) x
-#endif
-
- /*
- * Use `FT_LOCAL` and `FT_LOCAL_DEF` to declare and define, respectively,
- * an internal FreeType function that is only used by the sources of a
- * single `src/module/` directory. This ensures that the functions are
- * turned into static ones at build time, resulting in smaller and faster
- * code.
- */
-#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
-
-#define FT_LOCAL( x ) static x
-#define FT_LOCAL_DEF( x ) static x
-
-#else
-
-#define FT_LOCAL( x ) FT_INTERNAL_FUNCTION_ATTRIBUTE \
- FT_FUNCTION_DECLARATION( x )
-#define FT_LOCAL_DEF( x ) FT_FUNCTION_DEFINITION( x )
-
-#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
-
- /*
- * Use `FT_LOCAL_ARRAY` and `FT_LOCAL_ARRAY_DEF` to declare and define,
- * respectively, a constant array that must be accessed from several
- * sources in the same `src/module/` sub-directory, and which are internal
- * to the library.
- */
-#define FT_LOCAL_ARRAY( x ) FT_INTERNAL_FUNCTION_ATTRIBUTE \
- extern const x
-#define FT_LOCAL_ARRAY_DEF( x ) FT_FUNCTION_DEFINITION( const x )
-
- /*
- * `Use FT_BASE` and `FT_BASE_DEF` to declare and define, respectively, an
- * internal library function that is used by more than a single module.
- */
-#define FT_BASE( x ) FT_INTERNAL_FUNCTION_ATTRIBUTE \
- FT_FUNCTION_DECLARATION( x )
-#define FT_BASE_DEF( x ) FT_FUNCTION_DEFINITION( x )
-
-
- /*
- * NOTE: Conditionally define `FT_EXPORT_VAR` due to its definition in
- * `src/smooth/ftgrays.h` to make the header more portable.
- */
-#ifndef FT_EXPORT_VAR
-#define FT_EXPORT_VAR( x ) FT_FUNCTION_DECLARATION( x )
-#endif
-
- /* 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`. */
- /* */
-
- /* See `freetype/config/compiler_macros.h` for the `FT_EXPORT` definition */
-#define FT_EXPORT_DEF( x ) FT_FUNCTION_DEFINITION( x )
-
- /* The following macros are needed to compile the library with a */
- /* C++ compiler and with 16bit compilers. */
- /* */
-
- /* This is special. Within C++, you must specify `extern "C"` for */
- /* functions which are used via function pointers, and you also */
- /* must do that for structures which contain function pointers to */
- /* assure C linkage -- it's not possible to have (local) anonymous */
- /* functions which are accessed by (global) function pointers. */
- /* */
- /* */
- /* 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. */
- /* */
- /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
- /* that contains pointers to callback functions. */
- /* */
- /* */
- /* Some 16bit compilers have to redefine these macros to insert */
- /* the infamous `_cdecl` or `__fastcall` declarations. */
- /* */
-#ifdef __cplusplus
-#define FT_CALLBACK_DEF( x ) extern "C" x
-#else
-#define FT_CALLBACK_DEF( x ) static x
-#endif
-
-#define FT_BASE_CALLBACK( x ) FT_FUNCTION_DECLARATION( x )
-#define FT_BASE_CALLBACK_DEF( x ) FT_FUNCTION_DEFINITION( x )
-
-#ifndef FT_CALLBACK_TABLE
-#ifdef __cplusplus
-#define FT_CALLBACK_TABLE extern "C"
-#define FT_CALLBACK_TABLE_DEF extern "C"
-#else
-#define FT_CALLBACK_TABLE extern
-#define FT_CALLBACK_TABLE_DEF /* nothing */
-#endif
-#endif /* FT_CALLBACK_TABLE */
-
-FT_END_HEADER
-
-#endif /* INTERNAL_COMPILER_MACROS_H_ */
diff --git a/include/freetype/internal/ftcalc.h
b/include/freetype/internal/ftcalc.h
index c653074..6bc2791 100644
--- a/include/freetype/internal/ftcalc.h
+++ b/include/freetype/internal/ftcalc.h
@@ -22,7 +22,6 @@
#include <freetype/freetype.h>
-#include "compiler-macros.h"
FT_BEGIN_HEADER
@@ -449,7 +448,8 @@ FT_BEGIN_HEADER
#define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) * 4 ) /* << 2 */
#define FIXED_TO_INT( x ) ( FT_RoundFix( x ) >> 16 )
-#define ROUND_F26DOT6( x ) ( ( (x) + 32 - ( x < 0 ) ) & -64 )
+#define ROUND_F26DOT6( x ) ( x >= 0 ? ( ( (x) + 32 ) & -64 ) \
+ : ( -( ( 32 - (x) ) & -64 ) ) )
/*
* The following macros have two purposes.
diff --git a/include/freetype/internal/ftdebug.h
b/include/freetype/internal/ftdebug.h
index df5357a..e7eb29a 100644
--- a/include/freetype/internal/ftdebug.h
+++ b/include/freetype/internal/ftdebug.h
@@ -29,8 +29,6 @@
#include FT_CONFIG_CONFIG_H
#include <freetype/freetype.h>
-#include "compiler-macros.h"
-
FT_BEGIN_HEADER
diff --git a/include/freetype/internal/ftdrv.h
b/include/freetype/internal/ftdrv.h
index 7f22710..a294516 100644
--- a/include/freetype/internal/ftdrv.h
+++ b/include/freetype/internal/ftdrv.h
@@ -22,7 +22,6 @@
#include <freetype/ftmodapi.h>
-#include "compiler-macros.h"
FT_BEGIN_HEADER
diff --git a/include/freetype/internal/ftmemory.h
b/include/freetype/internal/ftmemory.h
index ddb18b0..940510d 100644
--- a/include/freetype/internal/ftmemory.h
+++ b/include/freetype/internal/ftmemory.h
@@ -24,7 +24,6 @@
#include FT_CONFIG_CONFIG_H
#include <freetype/fttypes.h>
-#include "compiler-macros.h"
FT_BEGIN_HEADER
diff --git a/include/freetype/internal/ftobjs.h
b/include/freetype/internal/ftobjs.h
index 25db2c4..c7ac1a7 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -40,7 +40,6 @@
#include <freetype/ftincrem.h>
#endif
-#include "compiler-macros.h"
FT_BEGIN_HEADER
@@ -226,8 +225,8 @@ FT_BEGIN_HEADER
} FT_CMap_ClassRec;
-#define FT_DECLARE_CMAP_CLASS( class_ ) \
- FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
+#define FT_DECLARE_CMAP_CLASS( class_ ) \
+ FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
#define FT_DEFINE_CMAP_CLASS( \
class_, \
@@ -1057,9 +1056,6 @@ FT_BEGIN_HEADER
* The struct will be allocated in the global scope (or the scope where
* the macro is used).
*/
-#define FT_DECLARE_GLYPH( class_ ) \
- FT_CALLBACK_TABLE const FT_Glyph_Class class_;
-
#define FT_DEFINE_GLYPH( \
class_, \
size_, \
diff --git a/include/freetype/internal/ftserv.h
b/include/freetype/internal/ftserv.h
index 6e1a947..68336f4 100644
--- a/include/freetype/internal/ftserv.h
+++ b/include/freetype/internal/ftserv.h
@@ -31,7 +31,6 @@
#ifndef FTSERV_H_
#define FTSERV_H_
-#include "compiler-macros.h"
FT_BEGIN_HEADER
diff --git a/include/freetype/internal/ftvalid.h
b/include/freetype/internal/ftvalid.h
index a5bc6c9..62aea4d 100644
--- a/include/freetype/internal/ftvalid.h
+++ b/include/freetype/internal/ftvalid.h
@@ -20,9 +20,8 @@
#define FTVALID_H_
#include <ft2build.h>
-#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_jmpbuf */
+#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_setjmp and ft_longjmp */
-#include "compiler-macros.h"
FT_BEGIN_HEADER
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index 3b340cd..ed7a065 100644
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -157,7 +157,7 @@
if ( !glyph_index )
goto Exit;
- FT_TRACE5(( "standard character: U+%04lX (glyph index %ld)\n",
+ FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n",
ch, glyph_index ));
error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
@@ -260,9 +260,9 @@
dim == AF_DIMENSION_VERT ? "horizontal"
: "vertical" ));
- FT_TRACE5(( " %ld (standard)", axis->standard_width ));
+ FT_TRACE5(( " %d (standard)", axis->standard_width ));
for ( i = 1; i < axis->width_count; i++ )
- FT_TRACE5(( " %ld", axis->widths[i].org ));
+ FT_TRACE5(( " %d", axis->widths[i].org ));
FT_TRACE5(( "\n" ));
}
@@ -727,7 +727,7 @@
delta2 = FT_MulFix( delta2, scale );
- FT_TRACE5(( "delta: %ld", delta1 ));
+ FT_TRACE5(( "delta: %d", delta1 ));
if ( delta2 < 32 )
delta2 = 0;
#if 0
@@ -736,7 +736,7 @@
#endif
else
delta2 = FT_PIX_ROUND( delta2 );
- FT_TRACE5(( "/%ld\n", delta2 ));
+ FT_TRACE5(( "/%d\n", delta2 ));
if ( delta1 < 0 )
delta2 = -delta2;
@@ -1643,7 +1643,7 @@
stem_edge->pos = base_edge->pos + fitted_width;
- FT_TRACE5(( " CJKLINK: edge %ld @%d (opos=%.2f) linked to %.2f,"
+ FT_TRACE5(( " CJKLINK: edge %d @%d (opos=%.2f) linked to %.2f,"
" dist was %.2f, now %.2f\n",
stem_edge - hints->axis[dim].edges, stem_edge->fpos,
stem_edge->opos / 64.0, stem_edge->pos / 64.0,
@@ -1865,7 +1865,7 @@
continue;
#ifdef FT_DEBUG_LEVEL_TRACE
- FT_TRACE5(( " CJKBLUE: edge %ld @%d (opos=%.2f) snapped to %.2f,"
+ FT_TRACE5(( " CJKBLUE: edge %d @%d (opos=%.2f) snapped to %.2f,"
" was %.2f\n",
edge1 - edges, edge1->fpos, edge1->opos / 64.0,
blue->fit / 64.0, edge1->pos / 64.0 ));
@@ -1929,7 +1929,7 @@
/* this should not happen, but it's better to be safe */
if ( edge2->blue_edge )
{
- FT_TRACE5(( "ASSERTION FAILED for edge %ld\n", edge2-edges ));
+ FT_TRACE5(( "ASSERTION FAILED for edge %d\n", edge2-edges ));
af_cjk_align_linked_edge( hints, dim, edge2, edge );
edge->flags |= AF_EDGE_DONE;
diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c
index d512942..66aa2f1 100644
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -306,7 +306,7 @@
if ( !( count % 10 ) )
FT_TRACE4(( " " ));
- FT_TRACE4(( " %ld", idx ));
+ FT_TRACE4(( " %d", idx ));
count++;
if ( !( count % 10 ) )
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 21ec02e..6e9f28c 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -154,7 +154,7 @@
goto Exit;
}
- FT_TRACE5(( "standard character: U+%04lX (glyph index %ld)\n",
+ FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n",
ch, glyph_index ));
error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
@@ -257,9 +257,9 @@
dim == AF_DIMENSION_VERT ? "horizontal"
: "vertical" ));
- FT_TRACE5(( " %ld (standard)", axis->standard_width ));
+ FT_TRACE5(( " %d (standard)", axis->standard_width ));
for ( i = 1; i < axis->width_count; i++ )
- FT_TRACE5(( " %ld", axis->widths[i].org ));
+ FT_TRACE5(( " %d", axis->widths[i].org ));
FT_TRACE5(( "\n" ));
}
@@ -1031,7 +1031,7 @@
{
*a = *b;
FT_TRACE5(( "blue zone overlap:"
- " adjusting %s %ld to %ld\n",
+ " adjusting %s %d to %ld\n",
a_is_top ? "overshoot" : "reference",
blue_sorted[i] - axis->blues,
*a ));
@@ -1279,7 +1279,7 @@
"af_latin_metrics_scale_dim:"
" x height alignment (style `%s'):\n"
" "
- " vertical scaling changed from %.5f to %.5f (by %ld%%)\n"
+ " vertical scaling changed from %.5f to %.5f (by %d%%)\n"
"\n",
af_style_names[metrics->root.style_class->style],
scale / 65536.0,
@@ -1332,7 +1332,7 @@
width->cur = FT_MulFix( width->org, scale );
width->fit = width->cur;
- FT_TRACE5(( " %ld scaled to %.2f\n",
+ FT_TRACE5(( " %d scaled to %.2f\n",
width->org,
width->cur / 64.0 ));
}
@@ -1473,8 +1473,8 @@
AF_LatinBlue blue = &axis->blues[nn];
- FT_TRACE5(( " reference %d: %ld scaled to %.2f%s\n"
- " overshoot %d: %ld scaled to %.2f%s\n",
+ FT_TRACE5(( " reference %d: %d scaled to %.2f%s\n"
+ " overshoot %d: %d scaled to %.2f%s\n",
nn,
blue->ref.org,
blue->ref.fit / 64.0,
@@ -2944,7 +2944,7 @@
stem_edge->pos = base_edge->pos + fitted_width;
- FT_TRACE5(( " LINK: edge %ld (opos=%.2f) linked to %.2f,"
+ FT_TRACE5(( " LINK: edge %d (opos=%.2f) linked to %.2f,"
" dist was %.2f, now %.2f\n",
stem_edge - hints->axis[dim].edges, stem_edge->opos / 64.0,
stem_edge->pos / 64.0, dist / 64.0, fitted_width / 64.0 ));
@@ -3068,12 +3068,12 @@
#ifdef FT_DEBUG_LEVEL_TRACE
if ( !anchor )
- FT_TRACE5(( " BLUE_ANCHOR: edge %ld (opos=%.2f) snapped to %.2f,"
- " was %.2f (anchor=edge %ld)\n",
+ FT_TRACE5(( " BLUE_ANCHOR: edge %d (opos=%.2f) snapped to %.2f,"
+ " was %.2f (anchor=edge %d)\n",
edge1 - edges, edge1->opos / 64.0, blue->fit / 64.0,
edge1->pos / 64.0, edge - edges ));
else
- FT_TRACE5(( " BLUE: edge %ld (opos=%.2f) snapped to %.2f,"
+ FT_TRACE5(( " BLUE: edge %d (opos=%.2f) snapped to %.2f,"
" was %.2f\n",
edge1 - edges, edge1->opos / 64.0, blue->fit / 64.0,
edge1->pos / 64.0 ));
@@ -3122,7 +3122,7 @@
/* this should not happen, but it's better to be safe */
if ( edge2->blue_edge )
{
- FT_TRACE5(( " ASSERTION FAILED for edge %ld\n", edge2 - edges ));
+ FT_TRACE5(( " ASSERTION FAILED for edge %d\n", edge2 - edges ));
af_latin_align_linked_edge( hints, dim, edge2, edge );
edge->flags |= AF_EDGE_DONE;
@@ -3190,7 +3190,7 @@
anchor = edge;
edge->flags |= AF_EDGE_DONE;
- FT_TRACE5(( " ANCHOR: edge %ld (opos=%.2f) and %ld (opos=%.2f)"
+ FT_TRACE5(( " ANCHOR: edge %d (opos=%.2f) and %d (opos=%.2f)"
" snapped to %.2f and %.2f\n",
edge - edges, edge->opos / 64.0,
edge2 - edges, edge2->opos / 64.0,
@@ -3219,7 +3219,7 @@
if ( edge2->flags & AF_EDGE_DONE )
{
- FT_TRACE5(( " ADJUST: edge %ld (pos=%.2f) moved to %.2f\n",
+ FT_TRACE5(( " ADJUST: edge %d (pos=%.2f) moved to %.2f\n",
edge - edges, edge->pos / 64.0,
( edge2->pos - cur_len ) / 64.0 ));
@@ -3260,7 +3260,7 @@
edge->pos = cur_pos1 - cur_len / 2;
edge2->pos = cur_pos1 + cur_len / 2;
- FT_TRACE5(( " STEM: edge %ld (opos=%.2f) linked to %ld (opos=%.2f)"
+ FT_TRACE5(( " STEM: edge %d (opos=%.2f) linked to %d (opos=%.2f)"
" snapped to %.2f and %.2f\n",
edge - edges, edge->opos / 64.0,
edge2 - edges, edge2->opos / 64.0,
@@ -3291,7 +3291,7 @@
edge->pos = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2;
edge2->pos = edge->pos + cur_len;
- FT_TRACE5(( " STEM: edge %ld (opos=%.2f) linked to %ld (opos=%.2f)"
+ FT_TRACE5(( " STEM: edge %d (opos=%.2f) linked to %d (opos=%.2f)"
" snapped to %.2f and %.2f\n",
edge - edges, edge->opos / 64.0,
edge2 - edges, edge2->opos / 64.0,
@@ -3314,7 +3314,7 @@
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
{
#ifdef FT_DEBUG_LEVEL_TRACE
- FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n",
+ FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n",
edge - edges,
edge->pos / 64.0,
edge[-1].pos / 64.0 ));
@@ -3416,7 +3416,7 @@
if ( delta < 64 + 16 )
{
af_latin_align_serif_edge( hints, edge->serif, edge );
- FT_TRACE5(( " SERIF: edge %ld (opos=%.2f) serif to %ld (opos=%.2f)"
+ FT_TRACE5(( " SERIF: edge %d (opos=%.2f) serif to %d (opos=%.2f)"
" aligned to %.2f\n",
edge - edges, edge->opos / 64.0,
edge->serif - edges, edge->serif->opos / 64.0,
@@ -3426,7 +3426,7 @@
{
edge->pos = FT_PIX_ROUND( edge->opos );
anchor = edge;
- FT_TRACE5(( " SERIF_ANCHOR: edge %ld (opos=%.2f)"
+ FT_TRACE5(( " SERIF_ANCHOR: edge %d (opos=%.2f)"
" snapped to %.2f\n",
edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
}
@@ -3454,8 +3454,8 @@
after->pos - before->pos,
after->opos - before->opos );
- FT_TRACE5(( " SERIF_LINK1: edge %ld (opos=%.2f) snapped to %.2f"
- " from %ld (opos=%.2f)\n",
+ FT_TRACE5(( " SERIF_LINK1: edge %d (opos=%.2f) snapped to %.2f"
+ " from %d (opos=%.2f)\n",
edge - edges, edge->opos / 64.0,
edge->pos / 64.0,
before - edges, before->opos / 64.0 ));
@@ -3464,7 +3464,7 @@
{
edge->pos = anchor->pos +
( ( edge->opos - anchor->opos + 16 ) & ~31 );
- FT_TRACE5(( " SERIF_LINK2: edge %ld (opos=%.2f)"
+ FT_TRACE5(( " SERIF_LINK2: edge %d (opos=%.2f)"
" snapped to %.2f\n",
edge - edges, edge->opos / 64.0, edge->pos / 64.0 ));
}
@@ -3484,7 +3484,7 @@
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
{
#ifdef FT_DEBUG_LEVEL_TRACE
- FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n",
+ FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n",
edge - edges,
edge->pos / 64.0,
edge[-1].pos / 64.0 ));
@@ -3505,7 +3505,7 @@
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
{
#ifdef FT_DEBUG_LEVEL_TRACE
- FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n",
+ FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n",
edge - edges,
edge->pos / 64.0,
edge[1].pos / 64.0 ));
diff --git a/src/autofit/afmodule.c b/src/autofit/afmodule.c
index e164944..95d58b8 100644
--- a/src/autofit/afmodule.c
+++ b/src/autofit/afmodule.c
@@ -149,7 +149,7 @@
if ( !af_style_classes[ss] )
{
FT_TRACE0(( "af_property_set: Invalid value %d for property `%s'\n",
- *fallback_script, property_name ));
+ fallback_script, property_name ));
return FT_THROW( Invalid_Argument );
}
@@ -550,8 +550,8 @@
NULL, /* reset_face */
NULL, /* get_global_hints */
NULL, /* done_global_hints */
- (FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph /* load_glyph */
- )
+ (FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph ) /* load_glyph */
+
FT_DEFINE_MODULE(
autofit_module_class,
diff --git a/src/autofit/afmodule.h b/src/autofit/afmodule.h
index e8fe4a9..74c4ff6 100644
--- a/src/autofit/afmodule.h
+++ b/src/autofit/afmodule.h
@@ -46,7 +46,6 @@ FT_BEGIN_HEADER
} AF_ModuleRec, *AF_Module;
-FT_DECLARE_AUTOHINTER_INTERFACE( af_autofitter_interface )
FT_DECLARE_MODULE( autofit_module_class )
diff --git a/src/base/ftbase.h b/src/base/ftbase.h
index 25afa9b..b03922a 100644
--- a/src/base/ftbase.h
+++ b/src/base/ftbase.h
@@ -26,10 +26,6 @@
FT_BEGIN_HEADER
- FT_DECLARE_GLYPH( ft_bitmap_glyph_class )
- FT_DECLARE_GLYPH( ft_outline_glyph_class )
-
-
#ifdef FT_CONFIG_OPTION_MAC_FONTS
/* MacOS resource fork cannot exceed 16MB at least for Carbon code; */
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c
index 584213d..d109ee4 100644
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -908,13 +908,13 @@
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE5(( "FT_Bitmap_Blend:\n"
- " source bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n",
+ " source bitmap: (%d, %d) -- (%d, %d); %d x %d\n",
source_llx / 64, source_lly / 64,
source_urx / 64, source_ury / 64,
source_->width, source_->rows ));
if ( target->width && target->rows )
- FT_TRACE5(( " target bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n",
+ FT_TRACE5(( " target bitmap: (%d, %d) -- (%d, %d); %d x %d\n",
target_llx / 64, target_lly / 64,
target_urx / 64, target_ury / 64,
target->width, target->rows ));
@@ -922,7 +922,7 @@
FT_TRACE5(( " target bitmap: empty\n" ));
if ( final_width && final_rows )
- FT_TRACE5(( " final bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n",
+ FT_TRACE5(( " final bitmap: (%d, %d) -- (%d, %d); %d x %d\n",
final_llx / 64, final_lly / 64,
final_urx / 64, final_ury / 64,
final_width, final_rows ));
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index 825eba2..78dff7f 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -35,8 +35,6 @@
#include <freetype/ftbitmap.h>
#include <freetype/internal/ftobjs.h>
-#include "ftbase.h"
-
/**************************************************************************
*
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 94b6972..76607cb 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1841,15 +1841,15 @@
/* FT2 allocator takes signed long buffer length,
* too large value causing overflow should be checked
*/
- FT_TRACE4(( " POST fragment #%d: length=0x%08lx"
- " total pfb_len=0x%08lx\n",
+ FT_TRACE4(( " POST fragment #%d: length=0x%08x"
+ " total pfb_len=0x%08x\n",
i, temp, pfb_len + temp + 6 ));
if ( FT_MAC_RFORK_MAX_LEN < temp ||
FT_MAC_RFORK_MAX_LEN - temp < pfb_len + 6 )
{
FT_TRACE2(( " MacOS resource length cannot exceed"
- " 0x%08lx\n",
+ " 0x%08x\n",
FT_MAC_RFORK_MAX_LEN ));
error = FT_THROW( Invalid_Offset );
@@ -1860,13 +1860,13 @@
}
FT_TRACE2(( " total buffer size to concatenate"
- " %ld POST fragments: 0x%08lx\n",
+ " %d POST fragments: 0x%08x\n",
resource_cnt, pfb_len + 2 ));
if ( pfb_len + 2 < 6 )
{
FT_TRACE2(( " too long fragment length makes"
- " pfb_len confused: pfb_len=0x%08lx\n",
+ " pfb_len confused: pfb_len=0x%08x\n",
pfb_len ));
error = FT_THROW( Array_Too_Large );
@@ -1909,7 +1909,7 @@
goto Exit2;
FT_TRACE3(( "POST fragment[%d]:"
- " offsets=0x%08lx, rlen=0x%08lx, flags=0x%04x\n",
+ " offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n",
i, offsets[i], rlen, flags ));
error = FT_ERR( Array_Too_Large );
@@ -1936,7 +1936,7 @@
else
{
FT_TRACE3(( " Write POST fragment #%d header (4-byte) to buffer"
- " %p + 0x%08lx\n",
+ " %p + 0x%08x\n",
i, pfb_data, pfb_lenpos ));
if ( pfb_lenpos + 3 > pfb_len + 2 )
@@ -1951,7 +1951,7 @@
break;
FT_TRACE3(( " Write POST fragment #%d header (6-byte) to buffer"
- " %p + 0x%08lx\n",
+ " %p + 0x%08x\n",
i, pfb_data, pfb_pos ));
if ( pfb_pos + 6 > pfb_len + 2 )
@@ -1973,8 +1973,8 @@
if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len )
goto Exit2;
- FT_TRACE3(( " Load POST fragment #%d (%ld byte) to buffer"
- " %p + 0x%08lx\n",
+ FT_TRACE3(( " Load POST fragment #%d (%d byte) to buffer"
+ " %p + 0x%08x\n",
i, rlen, pfb_data, pfb_pos ));
error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen );
@@ -2259,7 +2259,7 @@
args2.flags = FT_OPEN_PATHNAME;
args2.pathname = file_names[i] ? file_names[i] : args->pathname;
- FT_TRACE3(( "Try rule %d: %s (offset=%ld) ...",
+ FT_TRACE3(( "Try rule %d: %s (offset=%d) ...",
i, args2.pathname, offsets[i] ));
error = FT_Stream_New( library, &args2, &stream2 );
@@ -2857,8 +2857,6 @@
if ( error )
{
FT_FREE( node );
- if ( size )
- FT_FREE( size->internal );
FT_FREE( size );
}
@@ -3214,9 +3212,9 @@
FT_Size_Metrics* metrics = &face->size->metrics;
- FT_TRACE5(( " x scale: %ld (%f)\n",
+ FT_TRACE5(( " x scale: %d (%f)\n",
metrics->x_scale, metrics->x_scale / 65536.0 ));
- FT_TRACE5(( " y scale: %ld (%f)\n",
+ FT_TRACE5(( " y scale: %d (%f)\n",
metrics->y_scale, metrics->y_scale / 65536.0 ));
FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 ));
FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 ));
@@ -3289,9 +3287,9 @@
FT_Size_Metrics* metrics = &face->size->metrics;
- FT_TRACE5(( " x scale: %ld (%f)\n",
+ FT_TRACE5(( " x scale: %d (%f)\n",
metrics->x_scale, metrics->x_scale / 65536.0 ));
- FT_TRACE5(( " y scale: %ld (%f)\n",
+ FT_TRACE5(( " y scale: %d (%f)\n",
metrics->y_scale, metrics->y_scale / 65536.0 ));
FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 ));
FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 ));
@@ -3451,7 +3449,7 @@
if ( akerning->x != orig_x_rounded ||
akerning->y != orig_y_rounded )
FT_TRACE5(( "FT_Get_Kerning: horizontal kerning"
- " (%ld, %ld) scaled down to (%ld, %ld) pixels\n",
+ " (%d, %d) scaled down to (%d, %d) pixels\n",
orig_x_rounded / 64, orig_y_rounded / 64,
akerning->x / 64, akerning->y / 64 ));
}
@@ -3723,7 +3721,7 @@
if ( charcode > 0xFFFFFFFFUL )
{
FT_TRACE1(( "FT_Get_Char_Index: too large charcode" ));
- FT_TRACE1(( " 0x%lx is truncated\n", charcode ));
+ FT_TRACE1(( " 0x%x is truncated\n", charcode ));
}
result = cmap->clazz->char_index( cmap, (FT_UInt32)charcode );
@@ -3899,13 +3897,13 @@
{
FT_TRACE1(( "FT_Face_GetCharVariantIndex:"
" too large charcode" ));
- FT_TRACE1(( " 0x%lx is truncated\n", charcode ));
+ FT_TRACE1(( " 0x%x is truncated\n", charcode ));
}
if ( variantSelector > 0xFFFFFFFFUL )
{
FT_TRACE1(( "FT_Face_GetCharVariantIndex:"
" too large variantSelector" ));
- FT_TRACE1(( " 0x%lx is truncated\n", variantSelector ));
+ FT_TRACE1(( " 0x%x is truncated\n", variantSelector ));
}
result = vcmap->clazz->char_var_index( vcmap, ucmap,
@@ -3942,13 +3940,13 @@
{
FT_TRACE1(( "FT_Face_GetCharVariantIsDefault:"
" too large charcode" ));
- FT_TRACE1(( " 0x%lx is truncated\n", charcode ));
+ FT_TRACE1(( " 0x%x is truncated\n", charcode ));
}
if ( variantSelector > 0xFFFFFFFFUL )
{
FT_TRACE1(( "FT_Face_GetCharVariantIsDefault:"
" too large variantSelector" ));
- FT_TRACE1(( " 0x%lx is truncated\n", variantSelector ));
+ FT_TRACE1(( " 0x%x is truncated\n", variantSelector ));
}
result = vcmap->clazz->char_var_default( vcmap,
@@ -4011,7 +4009,7 @@
if ( charcode > 0xFFFFFFFFUL )
{
FT_TRACE1(( "FT_Face_GetVariantsOfChar: too large charcode" ));
- FT_TRACE1(( " 0x%lx is truncated\n", charcode ));
+ FT_TRACE1(( " 0x%x is truncated\n", charcode ));
}
result = vcmap->clazz->charvariant_list( vcmap, memory,
@@ -4045,7 +4043,7 @@
if ( variantSelector > 0xFFFFFFFFUL )
{
FT_TRACE1(( "FT_Get_Char_Index: too large variantSelector" ));
- FT_TRACE1(( " 0x%lx is truncated\n", variantSelector ));
+ FT_TRACE1(( " 0x%x is truncated\n", variantSelector ));
}
result = vcmap->clazz->variantchar_list( vcmap, memory,
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 311f098..9935e05 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -274,7 +274,7 @@
first = (FT_UInt)last + 1;
}
- FT_TRACE5(( "FT_Outline_Decompose: Done\n" ));
+ FT_TRACE5(( "FT_Outline_Decompose: Done\n", n ));
return FT_Err_Ok;
Invalid_Outline:
@@ -1060,11 +1060,6 @@
if ( cbox.xMin == cbox.xMax || cbox.yMin == cbox.yMax )
return FT_ORIENTATION_NONE;
- /* Reject values large outlines. */
- if ( cbox.xMin < -0x1000000L || cbox.yMin < -0x1000000L ||
- cbox.xMax > 0x1000000L || cbox.yMax > 0x1000000L )
- return FT_ORIENTATION_NONE;
-
xshift = FT_MSB( (FT_UInt32)( FT_ABS( cbox.xMax ) |
FT_ABS( cbox.xMin ) ) ) - 14;
xshift = FT_MAX( xshift, 0 );
diff --git a/src/base/ftrfork.c b/src/base/ftrfork.c
index f989be4..ea7e310 100644
--- a/src/base/ftrfork.c
+++ b/src/base/ftrfork.c
@@ -239,7 +239,7 @@
(char)( 0xFF & ( tag_internal >> 16 ) ),
(char)( 0xFF & ( tag_internal >> 8 ) ),
(char)( 0xFF & ( tag_internal >> 0 ) ) ));
- FT_TRACE3(( " : subcount=%d, suboffset=0x%04lx\n",
+ FT_TRACE3(( " : subcount=%d, suboffset=0x%04x\n",
subcnt, rpos ));
if ( tag_internal == tag )
@@ -285,7 +285,7 @@
ref[j].offset = temp & 0xFFFFFFL;
FT_TRACE3(( " [%d]:"
- " resource_id=0x%04x, offset=0x%08lx\n",
+ " resource_id=0x%04x, offset=0x%08x\n",
j, (FT_UShort)ref[j].res_id, ref[j].offset ));
}
@@ -301,7 +301,7 @@
for ( j = 0; j < *count; j++ )
FT_TRACE3(( " [%d]:"
- " resource_id=0x%04x, offset=0x%08lx\n",
+ " resource_id=0x%04x, offset=0x%08x\n",
j, ref[j].res_id, ref[j].offset ));
}
diff --git a/src/base/ftsynth.c b/src/base/ftsynth.c
index a9119e2..3c96272 100644
--- a/src/base/ftsynth.c
+++ b/src/base/ftsynth.c
@@ -129,7 +129,7 @@
if ( ( ystr >> 6 ) > FT_INT_MAX || ( ystr >> 6 ) < FT_INT_MIN )
{
FT_TRACE1(( "FT_GlyphSlot_Embolden:" ));
- FT_TRACE1(( "too strong emboldening parameter ystr=%ld\n", ystr ));
+ FT_TRACE1(( "too strong emboldening parameter ystr=%d\n", ystr ));
return;
}
error = FT_GlyphSlot_Own_Bitmap( slot );
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index d29188b..e338808 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -183,8 +183,7 @@ THE SOFTWARE.
Exit:
if ( charcode > 0xFFFFFFFFUL )
{
- FT_TRACE1(( "bdf_cmap_char_next: charcode 0x%lx > 32bit API",
- charcode ));
+ FT_TRACE1(( "bdf_cmap_char_next: charcode 0x%x > 32bit API" ));
*acharcode = 0;
/* XXX: result should be changed to indicate an overflow error */
}
@@ -402,10 +401,10 @@ THE SOFTWARE.
bdf_property_t* prop = NULL;
- FT_TRACE4(( " number of glyphs: allocated %ld (used %ld)\n",
+ FT_TRACE4(( " number of glyphs: allocated %d (used %d)\n",
font->glyphs_size,
font->glyphs_used ));
- FT_TRACE4(( " number of unencoded glyphs: allocated %ld (used %ld)\n",
+ FT_TRACE4(( " number of unencoded glyphs: allocated %d (used %d)\n",
font->unencoded_size,
font->unencoded_used ));
@@ -457,13 +456,13 @@ THE SOFTWARE.
if ( font->font_ascent > 0x7FFF || font->font_ascent < -0x7FFF )
{
font->font_ascent = font->font_ascent < 0 ? -0x7FFF : 0x7FFF;
- FT_TRACE0(( "BDF_Face_Init: clamping font ascent to value %ld\n",
+ FT_TRACE0(( "BDF_Face_Init: clamping font ascent to value %d\n",
font->font_ascent ));
}
if ( font->font_descent > 0x7FFF || font->font_descent < -0x7FFF )
{
font->font_descent = font->font_descent < 0 ? -0x7FFF : 0x7FFF;
- FT_TRACE0(( "BDF_Face_Init: clamping font descent to value %ld\n",
+ FT_TRACE0(( "BDF_Face_Init: clamping font descent to value %d\n",
font->font_descent ));
}
@@ -504,7 +503,7 @@ THE SOFTWARE.
prop->value.l < -0x504C2L )
{
bsize->size = 0x7FFF;
- FT_TRACE0(( "BDF_Face_Init: clamping point size to value %ld\n",
+ FT_TRACE0(( "BDF_Face_Init: clamping point size to value %d\n",
bsize->size ));
}
else
@@ -517,7 +516,7 @@ THE SOFTWARE.
if ( font->point_size > 0x7FFF )
{
bsize->size = 0x7FFF;
- FT_TRACE0(( "BDF_Face_Init: clamping point size to value %ld\n",
+ FT_TRACE0(( "BDF_Face_Init: clamping point size to value %d\n",
bsize->size ));
}
else
@@ -539,7 +538,7 @@ THE SOFTWARE.
if ( prop->value.l > 0x7FFF || prop->value.l < -0x7FFF )
{
bsize->y_ppem = 0x7FFF << 6;
- FT_TRACE0(( "BDF_Face_Init: clamping pixel size to value %ld\n",
+ FT_TRACE0(( "BDF_Face_Init: clamping pixel size to value %d\n",
bsize->y_ppem ));
}
else
@@ -615,7 +614,7 @@ THE SOFTWARE.
for ( n = 0; n < font->glyphs_size; n++ )
{
(face->en_table[n]).enc = cur[n].encoding;
- FT_TRACE4(( " idx %ld, val 0x%lX\n", n, cur[n].encoding ));
+ FT_TRACE4(( " idx %d, val 0x%lX\n", n, cur[n].encoding ));
(face->en_table[n]).glyph = (FT_UShort)n;
if ( cur[n].encoding == font->default_char )
@@ -624,7 +623,7 @@ THE SOFTWARE.
face->default_glyph = (FT_UInt)n;
else
FT_TRACE1(( "BDF_Face_Init:"
- " idx %ld is too large for this system\n", n ));
+ " idx %d is too large for this system\n", n ));
}
}
}
@@ -825,7 +824,7 @@ THE SOFTWARE.
bitmap->rows = glyph.bbx.height;
bitmap->width = glyph.bbx.width;
if ( glyph.bpr > FT_INT_MAX )
- FT_TRACE1(( "BDF_Glyph_Load: too large pitch %ld is truncated\n",
+ FT_TRACE1(( "BDF_Glyph_Load: too large pitch %d is truncated\n",
glyph.bpr ));
bitmap->pitch = (int)glyph.bpr; /* same as FT_Bitmap.pitch */
@@ -902,8 +901,7 @@ THE SOFTWARE.
if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL
) )
{
FT_TRACE1(( "bdf_get_bdf_property:"
- " too large integer 0x%lx is truncated\n",
- prop->value.l ));
+ " too large integer 0x%x is truncated\n" ));
}
aproperty->type = BDF_PROPERTY_TYPE_INTEGER;
aproperty->u.integer = (FT_Int32)prop->value.l;
@@ -913,8 +911,7 @@ THE SOFTWARE.
if ( prop->value.ul > 0xFFFFFFFFUL )
{
FT_TRACE1(( "bdf_get_bdf_property:"
- " too large cardinal 0x%lx is truncated\n",
- prop->value.ul ));
+ " too large cardinal 0x%x is truncated\n" ));
}
aproperty->type = BDF_PROPERTY_TYPE_CARDINAL;
aproperty->u.cardinal = (FT_UInt32)prop->value.ul;
diff --git a/src/cache/ftcbasic.c b/src/cache/ftcbasic.c
index 43ea314..493fc0a 100644
--- a/src/cache/ftcbasic.c
+++ b/src/cache/ftcbasic.c
@@ -110,9 +110,7 @@
if ( (FT_ULong)face->num_glyphs > FT_UINT_MAX || 0 > face->num_glyphs )
FT_TRACE1(( "ftc_basic_family_get_count:"
- " the number of glyphs in this face is %ld,\n"
- " "
- " which is too much and thus truncated\n",
+ " too large number of glyphs in this face, truncated\n",
face->num_glyphs ));
if ( !error )
@@ -395,7 +393,7 @@
#if FT_ULONG_MAX > FT_UINT_MAX
if ( load_flags > FT_UINT_MAX )
FT_TRACE1(( "FTC_ImageCache_LookupScaler:"
- " higher bits in load_flags 0x%lx are dropped\n",
+ " higher bits in load_flags 0x%x are dropped\n",
load_flags & ~((FT_ULong)FT_UINT_MAX) ));
#endif
@@ -595,7 +593,7 @@
#if FT_ULONG_MAX > FT_UINT_MAX
if ( load_flags > FT_UINT_MAX )
FT_TRACE1(( "FTC_ImageCache_LookupScaler:"
- " higher bits in load_flags 0x%lx are dropped\n",
+ " higher bits in load_flags 0x%x are dropped\n",
load_flags & ~((FT_ULong)FT_UINT_MAX) ));
#endif
diff --git a/src/cache/ftccache.h b/src/cache/ftccache.h
index 11698bb..2996ee8 100644
--- a/src/cache/ftccache.h
+++ b/src/cache/ftccache.h
@@ -19,7 +19,7 @@
#ifndef FTCCACHE_H_
#define FTCCACHE_H_
-#include <freetype/internal/compiler-macros.h>
+
#include "ftcmru.h"
FT_BEGIN_HEADER
diff --git a/src/cache/ftccback.h b/src/cache/ftccback.h
index 542acb1..802fd44 100644
--- a/src/cache/ftccback.h
+++ b/src/cache/ftccback.h
@@ -25,7 +25,6 @@
#include "ftcglyph.h"
#include "ftcsbits.h"
-FT_BEGIN_HEADER
FT_LOCAL( void )
ftc_inode_free( FTC_Node inode,
@@ -85,7 +84,6 @@ FT_BEGIN_HEADER
ftc_node_destroy( FTC_Node node,
FTC_Manager manager );
-FT_END_HEADER
#endif /* FTCCBACK_H_ */
diff --git a/src/cache/ftcmru.h b/src/cache/ftcmru.h
index ac4f9b1..e7c2a8f 100644
--- a/src/cache/ftcmru.h
+++ b/src/cache/ftcmru.h
@@ -45,7 +45,6 @@
#include <freetype/freetype.h>
-#include <freetype/internal/compiler-macros.h>
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
diff --git a/src/cff/cffcmap.h b/src/cff/cffcmap.h
index 69fab8d..fc6bd90 100644
--- a/src/cff/cffcmap.h
+++ b/src/cff/cffcmap.h
@@ -43,7 +43,7 @@ FT_BEGIN_HEADER
} CFF_CMapStdRec;
- FT_DECLARE_CMAP_CLASS( cff_cmap_encoding_class_rec )
+ FT_DECLARE_CMAP_CLASS(cff_cmap_encoding_class_rec)
/*************************************************************************/
@@ -56,7 +56,7 @@ FT_BEGIN_HEADER
/* unicode (synthetic) cmaps */
- FT_DECLARE_CMAP_CLASS( cff_cmap_unicode_class_rec )
+ FT_DECLARE_CMAP_CLASS(cff_cmap_unicode_class_rec)
FT_END_HEADER
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 486ab24..af0ec71 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -737,7 +737,7 @@
{
if ( dict->cid_supplement < FT_INT_MIN ||
dict->cid_supplement > FT_INT_MAX )
- FT_TRACE1(( "cff_get_ros: too large supplement %ld is truncated\n",
+ FT_TRACE1(( "cff_get_ros: too large supplement %d is truncated\n",
dict->cid_supplement ));
*supplement = (FT_Int)dict->cid_supplement;
}
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 73d3eec..3a3df6b 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -410,7 +410,7 @@
FT_Error error = FT_Err_Ok;
FT_Memory memory = idx->stream->memory;
- FT_Byte** tbl = NULL;
+ FT_Byte** t = NULL;
FT_Byte* new_bytes = NULL;
FT_ULong new_size;
@@ -427,11 +427,11 @@
new_size = idx->data_size + idx->count;
if ( idx->count > 0 &&
- !FT_NEW_ARRAY( tbl, idx->count + 1 ) &&
+ !FT_NEW_ARRAY( t, idx->count + 1 ) &&
( !pool || !FT_ALLOC( new_bytes, new_size ) ) )
{
FT_ULong n, cur_offset;
- FT_ULong extra = 0;
+ FT_ULong extra = 0;
FT_Byte* org_bytes = idx->bytes;
@@ -442,15 +442,15 @@
if ( cur_offset != 0 )
{
FT_TRACE0(( "cff_index_get_pointers:"
- " invalid first offset value %ld set to zero\n",
+ " invalid first offset value %d set to zero\n",
cur_offset ));
cur_offset = 0;
}
if ( !pool )
- tbl[0] = org_bytes + cur_offset;
+ t[0] = org_bytes + cur_offset;
else
- tbl[0] = new_bytes + cur_offset;
+ t[0] = new_bytes + cur_offset;
for ( n = 1; n <= idx->count; n++ )
{
@@ -464,25 +464,23 @@
next_offset = idx->data_size;
if ( !pool )
- tbl[n] = org_bytes + next_offset;
+ t[n] = org_bytes + next_offset;
else
{
- tbl[n] = new_bytes + next_offset + extra;
+ t[n] = new_bytes + next_offset + extra;
if ( next_offset != cur_offset )
{
- FT_MEM_COPY( tbl[n - 1],
- org_bytes + cur_offset,
- tbl[n] - tbl[n - 1] );
- tbl[n][0] = '\0';
- tbl[n] += 1;
+ FT_MEM_COPY( t[n - 1], org_bytes + cur_offset, t[n] - t[n - 1] );
+ t[n][0] = '\0';
+ t[n] += 1;
extra++;
}
}
cur_offset = next_offset;
}
- *table = tbl;
+ *table = t;
if ( pool )
*pool = new_bytes;
@@ -491,11 +489,6 @@
}
Exit:
- if ( error && new_bytes )
- FT_FREE( new_bytes );
- if ( error && tbl )
- FT_FREE( tbl );
-
return error;
}
@@ -559,8 +552,8 @@
idx->data_offset > stream->size - off2 + 1 )
{
FT_ERROR(( "cff_index_access_element:"
- " offset to next entry (%ld)"
- " exceeds the end of stream (%ld)\n",
+ " offset to next entry (%d)"
+ " exceeds the end of stream (%d)\n",
off2, stream->size - idx->data_offset + 1 ));
off2 = stream->size - idx->data_offset + 1;
}
@@ -984,7 +977,7 @@
if ( glyph_sid > 0xFFFFL - nleft )
{
FT_ERROR(( "cff_charset_load: invalid SID range trimmed"
- " nleft=%d -> %ld\n", nleft, 0xFFFFL - glyph_sid ));
+ " nleft=%d -> %d\n", nleft, 0xFFFFL - glyph_sid ));
nleft = ( FT_UInt )( 0xFFFFL - glyph_sid );
}
@@ -1951,7 +1944,7 @@
if ( priv->blue_shift > 1000 || priv->blue_shift < 0 )
{
FT_TRACE2(( "cff_load_private_dict:"
- " setting unlikely BlueShift value %ld to default (7)\n",
+ " setting unlikely BlueShift value %d to default (7)\n",
priv->blue_shift ));
priv->blue_shift = 7;
}
@@ -1959,7 +1952,7 @@
if ( priv->blue_fuzz > 1000 || priv->blue_fuzz < 0 )
{
FT_TRACE2(( "cff_load_private_dict:"
- " setting unlikely BlueFuzz value %ld to default (1)\n",
+ " setting unlikely BlueFuzz value %d to default (1)\n",
priv->blue_fuzz ));
priv->blue_fuzz = 1;
}
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index d555d52..981bc70 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -166,56 +166,46 @@
FT_Error error = FT_Err_Ok;
PSH_Globals_Funcs funcs = cff_size_get_globals_funcs( size );
- FT_Memory memory = cffsize->face->memory;
- CFF_Internal internal = NULL;
- CFF_Face face = (CFF_Face)cffsize->face;
- CFF_Font font = (CFF_Font)face->extra.data;
-
- PS_PrivateRec priv;
-
- FT_UInt i;
- if ( !funcs )
- goto Exit;
+ if ( funcs )
+ {
+ CFF_Face face = (CFF_Face)cffsize->face;
+ CFF_Font font = (CFF_Font)face->extra.data;
+ CFF_Internal internal = NULL;
- if ( FT_NEW( internal ) )
- goto Exit;
+ PS_PrivateRec priv;
+ FT_Memory memory = cffsize->face->memory;
- cff_make_private_dict( &font->top_font, &priv );
- error = funcs->create( cffsize->face->memory, &priv,
- &internal->topfont );
- if ( error )
- goto Exit;
+ FT_UInt i;
- for ( i = font->num_subfonts; i > 0; i-- )
- {
- CFF_SubFont sub = font->subfonts[i - 1];
+ if ( FT_NEW( internal ) )
+ goto Exit;
- cff_make_private_dict( sub, &priv );
+ cff_make_private_dict( &font->top_font, &priv );
error = funcs->create( cffsize->face->memory, &priv,
- &internal->subfonts[i - 1] );
+ &internal->topfont );
if ( error )
goto Exit;
- }
- cffsize->internal->module_data = internal;
+ for ( i = font->num_subfonts; i > 0; i-- )
+ {
+ CFF_SubFont sub = font->subfonts[i - 1];
- size->strike_index = 0xFFFFFFFFUL;
- Exit:
- if ( error )
- {
- if ( internal )
- {
- for ( i = font->num_subfonts; i > 0; i-- )
- FT_FREE( internal->subfonts[i - 1] );
- FT_FREE( internal->topfont );
+ cff_make_private_dict( sub, &priv );
+ error = funcs->create( cffsize->face->memory, &priv,
+ &internal->subfonts[i - 1] );
+ if ( error )
+ goto Exit;
}
- FT_FREE( internal );
+ cffsize->internal->module_data = internal;
}
+ size->strike_index = 0xFFFFFFFFUL;
+
+ Exit:
return error;
}
@@ -358,8 +348,7 @@
FT_LOCAL_DEF( void )
cff_slot_done( FT_GlyphSlot slot )
{
- if ( slot->internal )
- slot->internal->glyph_hints = NULL;
+ slot->internal->glyph_hints = NULL;
}
@@ -950,8 +939,7 @@
style_name = cff_strcpy( memory, fullp );
/* remove the style part from the family name (if present) */
- if ( style_name )
- remove_style( cffface->family_name, style_name );
+ remove_style( cffface->family_name, style_name );
}
break;
}
diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c
index 69bcd5d..25c90d2 100644
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -713,7 +713,7 @@
( max_scaling - min_scaling ) > 9 )
{
FT_TRACE1(( "cff_parse_font_matrix:"
- " strange scaling values (minimum %ld, maximum %ld),\n"
+ " strange scaling values (minimum %d, maximum %d),\n"
" "
" using default matrix\n", min_scaling, max_scaling ));
goto Unlikely;
@@ -810,7 +810,7 @@
bbox->yMax = FT_RoundFix( cff_parse_fixed( parser, data ) );
error = FT_Err_Ok;
- FT_TRACE4(( " [%ld %ld %ld %ld]\n",
+ FT_TRACE4(( " [%d %d %d %d]\n",
bbox->xMin / 65536,
bbox->yMin / 65536,
bbox->xMax / 65536,
@@ -933,11 +933,11 @@
FT_TRACE1(( "cff_parse_cid_ros: real supplement is rounded\n" ));
dict->cid_supplement = cff_parse_num( parser, data );
if ( dict->cid_supplement < 0 )
- FT_TRACE1(( "cff_parse_cid_ros: negative supplement %ld is found\n",
+ FT_TRACE1(( "cff_parse_cid_ros: negative supplement %d is found\n",
dict->cid_supplement ));
error = FT_Err_Ok;
- FT_TRACE4(( " %d %d %ld\n",
+ FT_TRACE4(( " %d %d %d\n",
dict->cid_registry,
dict->cid_ordering,
dict->cid_supplement ));
@@ -1263,11 +1263,11 @@
FT_Byte* charstring_base;
FT_ULong charstring_len;
- FT_Fixed* stack;
- FT_ListNode node;
- CFF_T2_String t2;
- FT_Fixed t2_size;
- FT_Byte* q;
+ FT_Fixed* stack;
+ FT_ListNode node;
+ CFF_T2_String t2;
+ size_t t2_size;
+ FT_Byte* q;
charstring_base = ++p;
diff --git a/src/cid/cidload.c b/src/cid/cidload.c
index bb9136a..0f41605 100644
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -254,7 +254,7 @@
goto Exit;
}
- FT_TRACE4(( " %ld\n", num_dicts ));
+ FT_TRACE4(( " %d\n", num_dicts ));
/*
* A single entry in the FDArray must (at least) contain the following
@@ -275,7 +275,7 @@
if ( (FT_ULong)num_dicts > stream->size / 100 )
{
FT_TRACE0(( "parse_fd_array: adjusting FDArray size"
- " (from %ld to %ld)\n",
+ " (from %d to %d)\n",
num_dicts,
stream->size / 100 ));
num_dicts = (FT_Long)( stream->size / 100 );
@@ -329,7 +329,7 @@
dict->expansion_factor = cid_parser_to_fixed( parser, 0 );
dict->private_dict.expansion_factor = dict->expansion_factor;
- FT_TRACE4(( "%ld\n", dict->expansion_factor ));
+ FT_TRACE4(( "%d\n", dict->expansion_factor ));
}
return;
@@ -804,7 +804,7 @@
face->root.stream->size - parser->data_offset )
{
FT_TRACE0(( "cid_face_open: adjusting length of binary data\n"
- " (from %ld to %ld bytes)\n",
+ " (from %d to %d bytes)\n",
parser->binary_length,
face->root.stream->size - parser->data_offset ));
parser->binary_length = face->root.stream->size -
diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c
index 04b295e..2d284ca 100644
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -49,8 +49,7 @@
FT_LOCAL_DEF( void )
cid_slot_done( FT_GlyphSlot slot )
{
- if ( slot->internal )
- slot->internal->glyph_hints = NULL;
+ slot->internal->glyph_hints = NULL;
}
diff --git a/src/gxvalid/gxvmort.h b/src/gxvalid/gxvmort.h
index 7237c58..24c7e45 100644
--- a/src/gxvalid/gxvmort.h
+++ b/src/gxvalid/gxvmort.h
@@ -34,9 +34,6 @@
#include <freetype/ftsnames.h>
-FT_BEGIN_HEADER
-
-
typedef struct GXV_mort_featureRec_
{
FT_UShort featureType;
@@ -91,8 +88,6 @@ FT_BEGIN_HEADER
GXV_Validator gxvalid );
-FT_END_HEADER
-
#endif /* GXVMORT_H_ */
diff --git a/src/gxvalid/gxvmorx.h b/src/gxvalid/gxvmorx.h
index f747b1d..ceb14a9 100644
--- a/src/gxvalid/gxvmorx.h
+++ b/src/gxvalid/gxvmorx.h
@@ -36,9 +36,6 @@
#include <freetype/ftsnames.h>
-FT_BEGIN_HEADER
-
-
FT_LOCAL( void )
gxv_morx_subtable_type0_validate( FT_Bytes table,
FT_Bytes limit,
@@ -65,8 +62,6 @@ FT_BEGIN_HEADER
GXV_Validator gxvalid );
-FT_END_HEADER
-
#endif /* GXVMORX_H_ */
diff --git a/src/lzw/ftzopen.h b/src/lzw/ftzopen.h
index d8768f7..cb9206b 100644
--- a/src/lzw/ftzopen.h
+++ b/src/lzw/ftzopen.h
@@ -24,7 +24,6 @@
#include <freetype/freetype.h>
-FT_BEGIN_HEADER
/*
* This is a complete re-implementation of the LZW file reader,
@@ -166,8 +165,6 @@ FT_BEGIN_HEADER
/* */
-FT_END_HEADER
-
#endif /* FTZOPEN_H_ */
diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c
index e9dd517..b0b5ee4 100644
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -136,7 +136,7 @@ THE SOFTWARE.
FT_UInt32 charcode = *acharcode;
FT_UShort charcodeRow;
FT_UShort charcodeCol;
- FT_UInt result = 0;
+ FT_Int result = 0;
while ( charcode < (FT_UInt32)( enc->lastRow * 256 + enc->lastCol ) )
@@ -606,9 +606,8 @@ THE SOFTWARE.
if ( prop->value.l > 0x7FFFFFFFL ||
prop->value.l < ( -1 - 0x7FFFFFFFL ) )
{
- FT_TRACE1(( "pcf_get_bdf_property:"
- " too large integer 0x%lx is truncated\n",
- prop->value.l ));
+ FT_TRACE1(( "pcf_get_bdf_property:" ));
+ FT_TRACE1(( " too large integer 0x%x is truncated\n" ));
}
/*
diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
index 8817682..08878a2 100644
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -121,7 +121,7 @@ THE SOFTWARE.
toc->count > 9 )
{
FT_TRACE0(( "pcf_read_TOC: adjusting number of tables"
- " (from %ld to %ld)\n",
+ " (from %d to %d)\n",
toc->count,
FT_MIN( stream->size >> 4, 9 ) ));
toc->count = FT_MIN( stream->size >> 4, 9 );
@@ -241,7 +241,7 @@ THE SOFTWARE.
if ( tables[i].type == (FT_UInt)( 1 << j ) )
name = tableNames[j];
- FT_TRACE4(( " %d: type=%s, format=0x%lX,"
+ FT_TRACE4(( " %d: type=%s, format=0x%X,"
" size=%ld (0x%lX), offset=%ld (0x%lX)\n",
i, name,
tables[i].format,
@@ -660,7 +660,7 @@ THE SOFTWARE.
{
properties[i].value.l = props[i].value;
- FT_TRACE4(( " %ld\n", properties[i].value.l ));
+ FT_TRACE4(( " %d\n", properties[i].value.l ));
}
}
@@ -797,7 +797,7 @@ THE SOFTWARE.
metrics->descent = 0;
FT_TRACE0(( "pcf_get_metrics:"
- " invalid metrics for glyph %ld\n", i ));
+ " invalid metrics for glyph %d\n", i ));
}
}
@@ -917,11 +917,11 @@ THE SOFTWARE.
sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX( format )];
- FT_TRACE4(( " %d-bit padding implies a size of %lu\n",
+ FT_TRACE4(( " %ld-bit padding implies a size of %lu\n",
8 << i, bitmapSizes[i] ));
}
- FT_TRACE4(( " %lu bitmaps, using %d-bit padding\n",
+ FT_TRACE4(( " %lu bitmaps, using %ld-bit padding\n",
nbitmaps,
8 << PCF_GLYPH_PAD_INDEX( format ) ));
FT_TRACE4(( " bitmap size: %lu\n", sizebitmaps ));
@@ -1251,13 +1251,13 @@ THE SOFTWARE.
if ( FT_ABS( accel->fontAscent ) > 0x7FFF )
{
accel->fontAscent = accel->fontAscent < 0 ? -0x7FFF : 0x7FFF;
- FT_TRACE0(( "pfc_get_accel: clamping font ascent to value %ld\n",
+ FT_TRACE0(( "pfc_get_accel: clamping font ascent to value %d\n",
accel->fontAscent ));
}
if ( FT_ABS( accel->fontDescent ) > 0x7FFF )
{
accel->fontDescent = accel->fontDescent < 0 ? -0x7FFF : 0x7FFF;
- FT_TRACE0(( "pfc_get_accel: clamping font descent to value %ld\n",
+ FT_TRACE0(( "pfc_get_accel: clamping font descent to value %d\n",
accel->fontDescent ));
}
@@ -1630,7 +1630,7 @@ THE SOFTWARE.
if ( FT_ABS( prop->value.l ) > 0x504C2L ) /* 0x7FFF * 72270/7200 */
{
bsize->size = 0x7FFF;
- FT_TRACE0(( "pcf_load_font: clamping point size to value %ld\n",
+ FT_TRACE0(( "pcf_load_font: clamping point size to value %d\n",
bsize->size ));
}
else
@@ -1649,7 +1649,7 @@ THE SOFTWARE.
if ( FT_ABS( prop->value.l ) > 0x7FFF )
{
bsize->y_ppem = 0x7FFF << 6;
- FT_TRACE0(( "pcf_load_font: clamping pixel size to value %ld\n",
+ FT_TRACE0(( "pcf_load_font: clamping pixel size to value %d\n",
bsize->y_ppem ));
}
else
diff --git a/src/pcf/pcfutil.h b/src/pcf/pcfutil.h
index a197c15..be986e7 100644
--- a/src/pcf/pcfutil.h
+++ b/src/pcf/pcfutil.h
@@ -31,7 +31,7 @@ THE SOFTWARE.
#include <ft2build.h>
#include FT_CONFIG_CONFIG_H
-#include <freetype/internal/compiler-macros.h>
+
FT_BEGIN_HEADER
diff --git a/src/pfr/pfrgload.c b/src/pfr/pfrgload.c
index aa640c3..a651342 100644
--- a/src/pfr/pfrgload.c
+++ b/src/pfr/pfrgload.c
@@ -451,7 +451,7 @@
case 1: /* 16-bit absolute value */
PFR_CHECK( 2 );
cur->x = PFR_NEXT_SHORT( p );
- FT_TRACE7(( " x.%ld", cur->x ));
+ FT_TRACE7(( " x.%d", cur->x ));
break;
case 2: /* 8-bit delta */
@@ -481,7 +481,7 @@
case 1: /* 16-bit absolute value */
PFR_CHECK( 2 );
cur->y = PFR_NEXT_SHORT( p );
- FT_TRACE7(( " y.%ld", cur->y ));
+ FT_TRACE7(( " y.%d", cur->y ));
break;
case 2: /* 8-bit delta */
diff --git a/src/pfr/pfrsbit.c b/src/pfr/pfrsbit.c
index a6691e6..9c1d31d 100644
--- a/src/pfr/pfrsbit.c
+++ b/src/pfr/pfrsbit.c
@@ -745,7 +745,7 @@
ypos + (FT_Long)ysize < FT_INT_MIN )
{
FT_TRACE1(( "pfr_slot_load_bitmap:" ));
- FT_TRACE1(( "huge bitmap glyph %ldx%ld over FT_GlyphSlot\n",
+ FT_TRACE1(( "huge bitmap glyph %dx%d over FT_GlyphSlot\n",
xpos, ypos ));
error = FT_THROW( Invalid_Pixel_Size );
}
diff --git a/src/psaux/psauxmod.c b/src/psaux/psauxmod.c
index e73ba22..bfc507c 100644
--- a/src/psaux/psauxmod.c
+++ b/src/psaux/psauxmod.c
@@ -170,9 +170,9 @@
};
- FT_DEFINE_MODULE(
- psaux_module_class,
-
+ FT_CALLBACK_TABLE_DEF
+ const FT_Module_Class psaux_module_class =
+ {
0,
sizeof ( FT_ModuleRec ),
"psaux",
@@ -184,7 +184,7 @@
(FT_Module_Constructor)NULL, /* module_init */
(FT_Module_Destructor) NULL, /* module_done */
(FT_Module_Requester) NULL /* get_interface */
- )
+ };
/* END */
diff --git a/src/psaux/psauxmod.h b/src/psaux/psauxmod.h
index a6bebe4..400d0ea 100644
--- a/src/psaux/psauxmod.h
+++ b/src/psaux/psauxmod.h
@@ -34,24 +34,10 @@ FT_BEGIN_HEADER
FT_CALLBACK_TABLE
const PS_Builder_FuncsRec ps_builder_funcs;
-#ifndef T1_CONFIG_OPTION_NO_AFM
- FT_CALLBACK_TABLE
- const AFM_Parser_FuncsRec afm_parser_funcs;
-#endif
-
- FT_CALLBACK_TABLE
- const T1_CMap_ClassesRec t1_cmap_classes;
-
- FT_CALLBACK_TABLE
- const CFF_Decoder_FuncsRec cff_decoder_funcs;
-
FT_EXPORT_VAR( const FT_Module_Class ) psaux_driver_class;
- FT_DECLARE_MODULE( psaux_module_class )
-
-
FT_END_HEADER
#endif /* PSAUXMOD_H_ */
diff --git a/src/psaux/pserror.h b/src/psaux/pserror.h
index 5738853..eb0a865 100644
--- a/src/psaux/pserror.h
+++ b/src/psaux/pserror.h
@@ -50,7 +50,6 @@
#include <freetype/fterrors.h>
-#include <freetype/internal/compiler-macros.h>
#include "psft.h"
diff --git a/src/psaux/psft.h b/src/psaux/psft.h
index 3da454e..902983e 100644
--- a/src/psaux/psft.h
+++ b/src/psaux/psft.h
@@ -40,9 +40,9 @@
#define PSFT_H_
-#include <freetype/internal/compiler-macros.h>
#include "pstypes.h"
+
/* TODO: disable asserts for now */
#define CF2_NDEBUG
diff --git a/src/psaux/pshints.c b/src/psaux/pshints.c
index ce8cfca..6d63903 100644
--- a/src/psaux/pshints.c
+++ b/src/psaux/pshints.c
@@ -310,7 +310,7 @@
CF2_Hint hint = &hintmap->edge[i];
- FT_TRACE6(( " %3ld %7.2f %7.2f %5d %s%s%s%s\n",
+ FT_TRACE6(( " %3d %7.2f %7.2f %5d %s%s%s%s\n",
hint->index,
hint->csCoord / 65536.0,
hint->dsCoord / ( hint->scale * 1.0 ),
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index defc4d4..4b8f58c 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -1232,7 +1232,7 @@
bbox->xMax = FT_RoundFix( temp[2] );
bbox->yMax = FT_RoundFix( temp[3] );
- FT_TRACE4(( " [%ld %ld %ld %ld]",
+ FT_TRACE4(( " [%d %d %d %d]",
bbox->xMin / 65536,
bbox->yMin / 65536,
bbox->xMax / 65536,
@@ -1286,7 +1286,7 @@
bbox->xMax = FT_RoundFix( temp[i + 2 * max_objects] );
bbox->yMax = FT_RoundFix( temp[i + 3 * max_objects] );
- FT_TRACE4(( " [%ld %ld %ld %ld]",
+ FT_TRACE4(( " [%d %d %d %d]",
bbox->xMin / 65536,
bbox->yMin / 65536,
bbox->xMax / 65536,
diff --git a/src/psaux/psstack.c b/src/psaux/psstack.c
index 7ae5256..bebbba2 100644
--- a/src/psaux/psstack.c
+++ b/src/psaux/psstack.c
@@ -59,12 +59,12 @@
CF2_Stack stack = NULL;
- if ( FT_NEW( stack ) )
- return NULL;
-
- /* initialize the structure; FT_NEW zeroes it */
- stack->memory = memory;
- stack->error = e;
+ if ( !FT_NEW( stack ) )
+ {
+ /* initialize the structure; FT_NEW zeroes it */
+ stack->memory = memory;
+ stack->error = e;
+ }
/* allocate the stack buffer */
if ( FT_NEW_ARRAY( stack->buffer, stackSize ) )
diff --git a/src/psaux/psstack.h b/src/psaux/psstack.h
index b9ef9ed..18cd39b 100644
--- a/src/psaux/psstack.h
+++ b/src/psaux/psstack.h
@@ -39,7 +39,6 @@
#ifndef PSSTACK_H_
#define PSSTACK_H_
-#include <freetype/internal/compiler-macros.h>
FT_BEGIN_HEADER
diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c
index 2ed27ca..5761c53 100644
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -1237,8 +1237,8 @@
FT_UNUSED( orig_y );
- /* `metrics_only' indicates that we only want to compute the */
- /* glyph's metrics (lsb + advance width) without loading the */
+ /* the `metrics_only' indicates that we only want to compute */
+ /* the glyph's metrics (lsb + advance width), not load the */
/* rest of it; so exit immediately */
if ( builder->metrics_only )
{
@@ -1272,8 +1272,8 @@
x = ADD_LONG( builder->pos_x, top[0] );
y = ADD_LONG( builder->pos_y, top[1] );
- /* `metrics_only' indicates that we only want to compute the */
- /* glyph's metrics (lsb + advance width) without loading the */
+ /* the `metrics_only' indicates that we only want to compute */
+ /* the glyph's metrics (lsb + advance width), not load the */
/* rest of it; so exit immediately */
if ( builder->metrics_only )
{
@@ -1727,7 +1727,7 @@
#ifdef FT_DEBUG_LEVEL_TRACE
if ( bol )
{
- FT_TRACE5(( " (%ld)", decoder->top - decoder->stack ));
+ FT_TRACE5(( " (%d)", decoder->top - decoder->stack ));
bol = FALSE;
}
#endif
@@ -1749,6 +1749,8 @@
case 7:
case 8:
case 9:
+ case 10:
+ case 11:
case 14:
case 15:
case 21:
@@ -1757,13 +1759,6 @@
case 31:
goto No_Width;
- case 10:
- op = op_callsubr;
- break;
- case 11:
- op = op_return;
- break;
-
case 13:
op = op_hsbw;
break;
@@ -1903,20 +1898,13 @@
#ifdef FT_DEBUG_LEVEL_TRACE
- switch ( op )
+ if ( op != op_div )
{
- case op_callsubr:
- case op_div:
- case op_return:
- break;
-
- default:
if ( top - decoder->stack != num_args )
FT_TRACE0(( "t1_decoder_parse_metrics:"
" too much operands on the stack"
- " (seen %ld, expected %d)\n",
+ " (seen %d, expected %d)\n",
top - decoder->stack, num_args ));
- break;
}
#endif /* FT_DEBUG_LEVEL_TRACE */
@@ -1937,8 +1925,8 @@
builder->advance.y = 0;
/* we only want to compute the glyph's metrics */
- /* (lsb + advance width) without loading the */
- /* rest of it; so exit immediately */
+ /* (lsb + advance width), not load the rest of */
+ /* it; so exit immediately */
FT_TRACE4(( "\n" ));
return FT_Err_Ok;
@@ -1956,8 +1944,8 @@
builder->advance.y = top[3];
/* we only want to compute the glyph's metrics */
- /* (lsb + advance width), without loading the */
- /* rest of it; so exit immediately */
+ /* (lsb + advance width), not load the rest of */
+ /* it; so exit immediately */
FT_TRACE4(( "\n" ));
return FT_Err_Ok;
@@ -1973,91 +1961,6 @@
large_int = FALSE;
break;
- case op_callsubr:
- {
- FT_Int idx;
-
-
- FT_TRACE4(( " callsubr" ));
-
- idx = Fix2Int( top[0] );
-
- if ( decoder->subrs_hash )
- {
- size_t* val = ft_hash_num_lookup( idx,
- decoder->subrs_hash );
-
-
- if ( val )
- idx = *val;
- else
- idx = -1;
- }
-
- if ( idx < 0 || idx >= decoder->num_subrs )
- {
- FT_ERROR(( "t1_decoder_parse_metrics:"
- " invalid subrs index\n" ));
- goto Syntax_Error;
- }
-
- if ( zone - decoder->zones >= T1_MAX_SUBRS_CALLS )
- {
- FT_ERROR(( "t1_decoder_parse_metrics:"
- " too many nested subrs\n" ));
- goto Syntax_Error;
- }
-
- zone->cursor = ip; /* save current instruction pointer */
-
- zone++;
-
- /* The Type 1 driver stores subroutines without the seed bytes. */
- /* The CID driver stores subroutines with seed bytes. This */
- /* case is taken care of when decoder->subrs_len == 0. */
- zone->base = decoder->subrs[idx];
-
- if ( decoder->subrs_len )
- zone->limit = zone->base + decoder->subrs_len[idx];
- else
- {
- /* We are using subroutines from a CID font. We must adjust */
- /* for the seed bytes. */
- zone->base += ( decoder->lenIV >= 0 ? decoder->lenIV : 0 );
- zone->limit = decoder->subrs[idx + 1];
- }
-
- zone->cursor = zone->base;
-
- if ( !zone->base )
- {
- FT_ERROR(( "t1_decoder_parse_metrics:"
- " invoking empty subrs\n" ));
- goto Syntax_Error;
- }
-
- decoder->zone = zone;
- ip = zone->base;
- limit = zone->limit;
- break;
- }
-
- case op_return:
- FT_TRACE4(( " return" ));
-
- if ( zone <= decoder->zones )
- {
- FT_ERROR(( "t1_decoder_parse_metrics:"
- " unexpected return\n" ));
- goto Syntax_Error;
- }
-
- zone--;
- ip = zone->cursor;
- limit = zone->limit;
- decoder->zone = zone;
- break;
-
default:
FT_ERROR(( "t1_decoder_parse_metrics:"
" unhandled opcode %d\n", op ));
diff --git a/src/pshinter/pshmod.c b/src/pshinter/pshmod.c
index e0abd38..801bf92 100644
--- a/src/pshinter/pshmod.c
+++ b/src/pshinter/pshmod.c
@@ -19,7 +19,6 @@
#include <freetype/internal/ftobjs.h>
#include "pshrec.h"
#include "pshalgo.h"
-#include "pshmod.h"
/* the Postscript Hinter module structure */
diff --git a/src/pshinter/pshrec.c b/src/pshinter/pshrec.c
index bddccf2..36debf1 100644
--- a/src/pshinter/pshrec.c
+++ b/src/pshinter/pshrec.c
@@ -874,7 +874,7 @@
if ( error )
{
FT_ERROR(( "ps_hints_stem: could not add stem"
- " (%ld,%ld) to hints table\n", stems[0], stems[1] ));
+ " (%d,%d) to hints table\n", stems[0], stems[1] ));
hints->error = error;
return;
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 9dd55cb..6a85f25 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -673,13 +673,13 @@
if ( overshoot )
ras.cProfile->flags |= Overshoot_Bottom;
- FT_TRACE6(( " new ascending profile = %p\n", (void *)ras.cProfile ));
+ FT_TRACE6(( " new ascending profile = %p\n", ras.cProfile ));
break;
case Descending_State:
if ( overshoot )
ras.cProfile->flags |= Overshoot_Top;
- FT_TRACE6(( " new descending profile = %p\n", (void *)ras.cProfile ));
+ FT_TRACE6(( " new descending profile = %p\n", ras.cProfile ));
break;
default:
@@ -736,7 +736,7 @@
FT_TRACE6(( " ending profile %p, start = %ld, height = %ld\n",
- (void *)ras.cProfile, ras.cProfile->start, h ));
+ ras.cProfile, ras.cProfile->start, h ));
ras.cProfile->height = h;
if ( overshoot )
@@ -2273,7 +2273,7 @@
if ( e2 >= ras.bWidth )
e2 = ras.bWidth - 1;
- FT_TRACE7(( " -> x=[%ld;%ld]", e1, e2 ));
+ FT_TRACE7(( " -> x=[%d;%d]", e1, e2 ));
c1 = (Short)( e1 >> 3 );
c2 = (Short)( e2 >> 3 );
@@ -2447,7 +2447,7 @@
if ( e1 >= 0 && e1 < ras.bWidth )
{
- FT_TRACE7(( " -> x=%ld (drop-out)", e1 ));
+ FT_TRACE7(( " -> x=%d (drop-out)", e1 ));
c1 = (Short)( e1 >> 3 );
f1 = (Short)( e1 & 7 );
@@ -2521,7 +2521,7 @@
PByte bits;
- FT_TRACE7(( " -> y=%ld (drop-out)", e1 ));
+ FT_TRACE7(( " -> y=%d (drop-out)", e1 ));
bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.target.pitch;
f1 = (Byte)( 0x80 >> ( y & 7 ) );
@@ -2644,7 +2644,7 @@
if ( e1 >= 0 && (ULong)e1 < ras.target.rows )
{
- FT_TRACE7(( " -> y=%ld (drop-out)", e1 ));
+ FT_TRACE7(( " -> y=%d (drop-out)", e1 ));
bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.target.pitch;
f1 = (Byte)( 0x80 >> ( y & 7 ) );
diff --git a/src/raster/ftraster.h b/src/raster/ftraster.h
index 1b2ee3c..1e5a725 100644
--- a/src/raster/ftraster.h
+++ b/src/raster/ftraster.h
@@ -24,7 +24,6 @@
#include FT_CONFIG_CONFIG_H
#include <freetype/ftimage.h>
-#include <freetype/internal/compiler-macros.h>
FT_BEGIN_HEADER
diff --git a/src/sfnt/pngshim.c b/src/sfnt/pngshim.c
index 2e64e58..7388837 100644
--- a/src/sfnt/pngshim.c
+++ b/src/sfnt/pngshim.c
@@ -60,12 +60,7 @@
/* predates clang; the `__BYTE_ORDER__' preprocessor symbol was */
/* introduced in gcc 4.6 and clang 3.2, respectively. */
/* `__builtin_shuffle' for gcc was introduced in gcc 4.7.0. */
- /* */
- /* Intel compilers do not currently support __builtin_shuffle; */
-
- /* The Intel check must be first. */
-#if !defined( __INTEL_COMPILER ) && \
- ( ( defined( __GNUC__ ) && \
+#if ( ( defined( __GNUC__ ) && \
( ( __GNUC__ >= 5 ) || \
( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 7 ) ) ) ) || \
( defined( __clang__ ) && \
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index 0460339..0f463a3 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -194,7 +194,7 @@
else if ( (FT_ULong)face->num_glyphs < FT_UINT_MAX )
max_gid = (FT_UInt)face->num_glyphs;
else
- FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08lx\n",
+ FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08x\n",
FT_UINT_MAX, face->num_glyphs ));
for ( i = 0; i < max_gid; i++ )
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 39460be..22da061 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -546,8 +546,8 @@
/* Stream may have changed in sfnt_open_font. */
stream = face->root.stream;
- FT_TRACE2(( "sfnt_init_face: %p (index %d)\n",
- (void *)face,
+ FT_TRACE2(( "sfnt_init_face: %08p (index %d)\n",
+ face,
face_instance_index ));
face_index = FT_ABS( face_instance_index ) & 0xFFFF;
@@ -820,7 +820,7 @@
/* it doesn't contain outlines. */
/* */
- FT_TRACE2(( "sfnt_load_face: %p\n\n", (void *)face ));
+ FT_TRACE2(( "sfnt_load_face: %08p\n\n", face ));
/* do we have outlines in there? */
#ifdef FT_CONFIG_OPTION_INCREMENTAL
diff --git a/src/sfnt/sfwoff2.c b/src/sfnt/sfwoff2.c
index 73d19f5..3f59044 100644
--- a/src/sfnt/sfwoff2.c
+++ b/src/sfnt/sfwoff2.c
@@ -43,8 +43,7 @@
#define READ_BASE128( var ) FT_SET_ERROR( ReadBase128( stream, &var ) )
- /* `var' should be FT_ULong */
-#define ROUND4( var ) ( ( var + 3 ) & ~3UL )
+#define ROUND4( var ) ( ( var + 3 ) & ~3 )
#define WRITE_USHORT( p, v ) \
do \
@@ -64,12 +63,12 @@
\
} while ( 0 )
-#define WRITE_SHORT( p, v ) \
- do \
- { \
- *(p)++ = (FT_Byte)( (v) >> 8 ); \
- *(p)++ = (FT_Byte)( (v) >> 0 ); \
- \
+#define WRITE_SHORT( p, v ) \
+ do \
+ { \
+ *(p)++ = ( (v) >> 8 ); \
+ *(p)++ = ( (v) >> 0 ); \
+ \
} while ( 0 )
#define WRITE_SFNT_BUF( buf, s ) \
@@ -281,12 +280,12 @@
/* Calculate table checksum of `buf'. */
- static FT_ULong
+ static FT_Long
compute_ULong_sum( FT_Byte* buf,
FT_ULong size )
{
FT_ULong checksum = 0;
- FT_ULong aligned_size = size & ~3UL;
+ FT_ULong aligned_size = size & ~3;
FT_ULong i;
FT_ULong v;
@@ -318,9 +317,7 @@
{
#ifdef FT_CONFIG_OPTION_USE_BROTLI
- /* this cast is only of importance on 32bit systems; */
- /* we don't validate it */
- FT_Offset uncompressed_size = (FT_Offset)dst_size;
+ FT_ULong uncompressed_size = dst_size;
BrotliDecoderResult result;
@@ -539,12 +536,12 @@
FT_ULong* glyph_size )
{
FT_UInt flag_offset = 10 + ( 2 * n_contours ) + 2 + instruction_len;
- FT_Byte last_flag = 0xFFU;
- FT_Byte repeat_count = 0;
- FT_Int last_x = 0;
- FT_Int last_y = 0;
- FT_UInt x_bytes = 0;
- FT_UInt y_bytes = 0;
+ FT_Int last_flag = -1;
+ FT_Int repeat_count = 0;
+ FT_Int last_x = 0;
+ FT_Int last_y = 0;
+ FT_UInt x_bytes = 0;
+ FT_UInt y_bytes = 0;
FT_UInt xy_bytes;
FT_UInt i;
FT_UInt x_offset;
@@ -556,9 +553,9 @@
{
const WOFF2_PointRec point = points[i];
- FT_Byte flag = point.on_curve ? GLYF_ON_CURVE : 0;
- FT_Int dx = point.x - last_x;
- FT_Int dy = point.y - last_y;
+ FT_Int flag = point.on_curve ? GLYF_ON_CURVE : 0;
+ FT_Int dx = point.x - last_x;
+ FT_Int dy = point.y - last_y;
if ( dx == 0 )
@@ -635,7 +632,7 @@
if ( dx == 0 )
;
else if ( dx > -256 && dx < 256 )
- dst[x_offset++] = (FT_Byte)FT_ABS( dx );
+ dst[x_offset++] = FT_ABS( dx );
else
{
pointer = dst + x_offset;
@@ -648,7 +645,7 @@
if ( dy == 0 )
;
else if ( dy > -256 && dy < 256 )
- dst[y_offset++] = (FT_Byte)FT_ABS( dy );
+ dst[y_offset++] = FT_ABS( dy );
else
{
pointer = dst + y_offset;
@@ -920,7 +917,7 @@
bbox_bitmap_offset = substreams[BBOX_STREAM].offset;
/* Size of bboxBitmap = 4 * floor((numGlyphs + 31) / 32) */
- bitmap_length = ( ( num_glyphs + 31U ) >> 5 ) << 2;
+ bitmap_length = ( ( num_glyphs + 31 ) >> 5 ) << 2;
substreams[BBOX_STREAM].offset += bitmap_length;
glyph_buf_size = WOFF2_DEFAULT_GLYPH_BUF;
@@ -1198,7 +1195,7 @@
/* Store x_mins, may be required to reconstruct `hmtx'. */
if ( n_contours > 0 )
- info->x_mins[i] = (FT_Short)x_min;
+ info->x_mins[i] = x_min;
}
info->glyf_table->dst_length = dest_offset - info->glyf_table->dst_offset;
@@ -1222,7 +1219,7 @@
FT_TRACE4(( " loca table info:\n" ));
FT_TRACE4(( " dst_offset = %lu\n", info->loca_table->dst_offset ));
FT_TRACE4(( " dst_length = %lu\n", info->loca_table->dst_length ));
- FT_TRACE4(( " checksum = %09lx\n", *loca_checksum ));
+ FT_TRACE4(( " checksum = %09x\n", *loca_checksum ));
/* Set pointer `sfnt_bytes' to its correct value. */
*sfnt_bytes = sfnt;
@@ -1289,12 +1286,6 @@
return FT_THROW( Invalid_Table );
}
- if ( !info->loca_table )
- {
- FT_ERROR(( "`loca' table is missing.\n" ));
- return FT_THROW( Invalid_Table );
- }
-
/* Read `numGlyphs' field from `maxp' table. */
if ( FT_STREAM_SEEK( maxp_table->src_offset ) || FT_STREAM_SKIP( 8 ) )
return error;
@@ -1346,7 +1337,7 @@
if ( FT_STREAM_SEEK( glyf_offset ) || FT_STREAM_SKIP( 2 ) )
return error;
- if ( FT_READ_SHORT( info->x_mins[i] ) )
+ if ( FT_READ_USHORT( info->x_mins[i] ) )
return error;
}
@@ -1573,7 +1564,7 @@
WOFF2_TableRec table = *( indices[nn] );
- FT_TRACE3(( "Seeking to %ld with table size %ld.\n",
+ FT_TRACE3(( "Seeking to %d with table size %d.\n",
table.src_offset, table.src_length ));
FT_TRACE3(( "Table tag: %c%c%c%c.\n",
(FT_Char)( table.Tag >> 24 ),
@@ -1614,7 +1605,7 @@
checksum = compute_ULong_sum( transformed_buf + table.src_offset,
table.src_length );
- FT_TRACE4(( "Checksum = %09lx.\n", checksum ));
+ FT_TRACE4(( "Checksum = %09x.\n", checksum ));
if ( WRITE_SFNT_BUF( transformed_buf + table.src_offset,
table.src_length ) )
@@ -1639,7 +1630,7 @@
memory ) )
goto Fail;
- FT_TRACE4(( "Checksum = %09lx.\n", checksum ));
+ FT_TRACE4(( "Checksum = %09x.\n", checksum ));
}
else if ( table.Tag == TTAG_loca )
@@ -1715,7 +1706,7 @@
WRITE_ULONG( buf_cursor, font_checksum );
- FT_TRACE2(( "Final checksum = %09lx.\n", font_checksum ));
+ FT_TRACE2(( "Final checksum = %09x.\n", font_checksum ));
woff2->actual_sfnt_size = dest_offset;
@@ -1812,15 +1803,15 @@
if ( FT_STREAM_READ_FIELDS( woff2_header_fields, &woff2 ) )
return error;
- FT_TRACE4(( "signature -> 0x%lX\n", woff2.signature ));
+ FT_TRACE4(( "signature -> 0x%X\n", woff2.signature ));
FT_TRACE2(( "flavor -> 0x%08lx\n", woff2.flavor ));
FT_TRACE4(( "length -> %lu\n", woff2.length ));
FT_TRACE2(( "num_tables -> %hu\n", woff2.num_tables ));
FT_TRACE4(( "totalSfntSize -> %lu\n", woff2.totalSfntSize ));
- FT_TRACE4(( "metaOffset -> %lu\n", woff2.metaOffset ));
- FT_TRACE4(( "metaLength -> %lu\n", woff2.metaLength ));
- FT_TRACE4(( "privOffset -> %lu\n", woff2.privOffset ));
- FT_TRACE4(( "privLength -> %lu\n", woff2.privLength ));
+ FT_TRACE4(( "metaOffset -> %hu\n", woff2.metaOffset ));
+ FT_TRACE4(( "metaLength -> %hu\n", woff2.metaLength ));
+ FT_TRACE4(( "privOffset -> %hu\n", woff2.privOffset ));
+ FT_TRACE4(( "privLength -> %hu\n", woff2.privLength ));
/* Make sure we don't recurse back here. */
if ( woff2.flavor == TTAG_wOF2 )
@@ -1852,11 +1843,9 @@
FT_NEW_ARRAY( indices, woff2.num_tables ) )
goto Exit;
- FT_TRACE2((
- "\n"
- " tag flags transform origLen transformLen offset\n"
- " -----------------------------------------------------------\n" ));
- /* " XXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX" */
+ FT_TRACE2(( "\n"
+ " tag flags transform origLen transformLen\n"
+ " --------------------------------------------------\n" ));
for ( nn = 0; nn < woff2.num_tables; nn++ )
{
@@ -1926,7 +1915,7 @@
src_offset += table->TransformLength;
table->flags = flags;
- FT_TRACE2(( " %c%c%c%c %08d %08d %08ld %08ld %08ld\n",
+ FT_TRACE2(( " %c%c%c%c %08d %08d %08ld %08ld\n",
(FT_Char)( table->Tag >> 24 ),
(FT_Char)( table->Tag >> 16 ),
(FT_Char)( table->Tag >> 8 ),
@@ -1935,6 +1924,7 @@
( table->FlagByte >> 6 ) & 0x03,
table->dst_length,
table->TransformLength,
+ table->src_length,
table->src_offset ));
indices[nn] = table;
@@ -1980,7 +1970,7 @@
goto Exit;
}
- FT_TRACE4(( "Number of fonts in TTC: %d\n", woff2.num_fonts ));
+ FT_TRACE4(( "Number of fonts in TTC: %ld\n", woff2.num_fonts ));
if ( FT_NEW_ARRAY( woff2.ttc_fonts, woff2.num_fonts ) )
goto Exit;
@@ -1998,7 +1988,7 @@
if ( FT_NEW_ARRAY( ttc_font->table_indices, ttc_font->num_tables ) )
goto Exit;
- FT_TRACE5(( "Number of tables in font %d: %d\n",
+ FT_TRACE5(( "Number of tables in font %d: %ld\n",
nn, ttc_font->num_tables ));
#ifdef FT_DEBUG_LEVEL_TRACE
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index 556a712..e54baf9 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -3751,7 +3751,6 @@
static const TT_CMap_Class tt_cmap_classes[] =
{
-#undef TTCMAPCITEM
#define TTCMAPCITEM( a ) &a,
#include "ttcmapc.h"
NULL,
diff --git a/src/sfnt/ttcmap.h b/src/sfnt/ttcmap.h
index c7d7c21..428ad21 100644
--- a/src/sfnt/ttcmap.h
+++ b/src/sfnt/ttcmap.h
@@ -90,11 +90,6 @@ FT_BEGIN_HEADER
};
-#undef TTCMAPCITEM
-#define TTCMAPCITEM( a ) FT_CALLBACK_TABLE const TT_CMap_ClassRec a;
-#include "ttcmapc.h"
-
-
typedef struct TT_ValidatorRec_
{
FT_ValidatorRec validator;
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index 4b46f41..8e9591b 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -64,8 +64,8 @@
#endif
- FT_TRACE4(( "tt_face_lookup_table: %p, `%c%c%c%c' -- ",
- (void *)face,
+ FT_TRACE4(( "tt_face_lookup_table: %08p, `%c%c%c%c' -- ",
+ face,
(FT_Char)( tag >> 24 ),
(FT_Char)( tag >> 16 ),
(FT_Char)( tag >> 8 ),
@@ -362,7 +362,7 @@
};
- FT_TRACE2(( "tt_face_load_font_dir: %p\n", (void *)face ));
+ FT_TRACE2(( "tt_face_load_font_dir: %08p\n", face ));
/* read the offset table */
@@ -1314,7 +1314,7 @@
/* we don't load the glyph names, we do that in another */
/* module (ttpost). */
- FT_TRACE3(( "FormatType: 0x%lx\n", post->FormatType ));
+ FT_TRACE3(( "FormatType: 0x%x\n", post->FormatType ));
FT_TRACE3(( "isFixedPitch: %s\n", post->isFixedPitch
? " yes" : " no" ));
diff --git a/src/sfnt/ttpost.c b/src/sfnt/ttpost.c
index e93a4bf..ffc90b6 100644
--- a/src/sfnt/ttpost.c
+++ b/src/sfnt/ttpost.c
@@ -239,7 +239,7 @@
break;
else
{
- FT_TRACE6(( "load_format_20: %ld byte left in post table\n",
+ FT_TRACE6(( "load_format_20: %d byte left in post table\n",
post_limit - FT_STREAM_POS() ));
if ( FT_READ_BYTE( len ) )
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index 9dd4419..293c6fd 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -347,7 +347,7 @@
FT_TRACE2(( "tt_face_load_strike_metrics:"
" sanitizing invalid ascender and descender\n"
" "
- " values for strike %ld (%dppem, %dppem)\n",
+ " values for strike %d (%dppem, %dppem)\n",
strike_index,
metrics->x_ppem, metrics->y_ppem ));
diff --git a/src/sfnt/woff2tags.c b/src/sfnt/woff2tags.c
index fd9f2e6..9775385 100644
--- a/src/sfnt/woff2tags.c
+++ b/src/sfnt/woff2tags.c
@@ -17,7 +17,7 @@
#include <freetype/tttags.h>
-#include "woff2tags.h"
+
/*
* Return tag from index in the order given in WOFF2 specification.
diff --git a/src/sfnt/woff2tags.h b/src/sfnt/woff2tags.h
index c437c77..a312483 100644
--- a/src/sfnt/woff2tags.h
+++ b/src/sfnt/woff2tags.h
@@ -4,7 +4,7 @@
*
* WOFFF2 Font table tags (specification).
*
- * Copyright (C) 2019-2020 by
+ * Copyright (C) 1996-2020 by
* Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -21,7 +21,6 @@
#include <freetype/internal/ftobjs.h>
-#include <freetype/internal/compiler-macros.h>
FT_BEGIN_HEADER
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 681900f..fd64548 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -1648,7 +1648,7 @@ typedef ptrdiff_t FT_PtrDist;
if ( !ras.invalid )
gray_record_cell( RAS_VAR );
- FT_TRACE7(( "band [%d..%d]: %ld cell%s\n",
+ FT_TRACE7(( "band [%d..%d]: %d cell%s\n",
ras.min_ey,
ras.max_ey,
ras.num_cells,
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index 3ce1cea..95e14d3 100644
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -25,6 +25,36 @@
#include "ftsmerrs.h"
+ /* initialize renderer -- init its raster */
+ static FT_Error
+ ft_smooth_init( FT_Renderer render )
+ {
+
+#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+
+ FT_Vector* sub = render->root.library->lcd_geometry;
+
+
+ /* set up default subpixel geometry for striped RGB panels. */
+ sub[0].x = -21;
+ sub[0].y = 0;
+ sub[1].x = 0;
+ sub[1].y = 0;
+ sub[2].x = 21;
+ sub[2].y = 0;
+
+#else /* set up default LCD filtering */
+
+ FT_Library_SetLcdFilter( render->root.library, FT_LCD_FILTER_DEFAULT );
+
+#endif
+
+ render->clazz->raster_class->raster_reset( render->raster, NULL, 0 );
+
+ return 0;
+ }
+
+
/* sets render-specific mode */
static FT_Error
ft_smooth_set_mode( FT_Renderer render,
@@ -76,351 +106,8 @@
FT_Outline_Get_CBox( &slot->outline, cbox );
}
- typedef struct TOrigin_
- {
- unsigned char* origin; /* pixmap origin at the bottom-left */
- int pitch; /* pitch to go down one row */
-
- } TOrigin;
-
-#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
- /* initialize renderer -- init its raster */
- static FT_Error
- ft_smooth_init( FT_Renderer render )
- {
- FT_Vector* sub = render->root.library->lcd_geometry;
-
-
- /* set up default subpixel geometry for striped RGB panels. */
- sub[0].x = -21;
- sub[0].y = 0;
- sub[1].x = 0;
- sub[1].y = 0;
- sub[2].x = 21;
- sub[2].y = 0;
-
- render->clazz->raster_class->raster_reset( render->raster, NULL, 0 );
-
- return 0;
- }
-
-
- /* This function writes every third byte in direct rendering mode */
- static void
- ft_smooth_lcd_spans( int y,
- int count,
- const FT_Span* spans,
- TOrigin* target )
- {
- unsigned char* dst_line = target->origin - y * target->pitch;
- unsigned char* dst;
- unsigned short w;
-
-
- for ( ; count--; spans++ )
- for ( dst = dst_line + spans->x * 3, w = spans->len; w--; dst += 3 )
- *dst = spans->coverage;
- }
-
-
- static FT_Error
- ft_smooth_raster_lcd( FT_Renderer render,
- FT_Outline* outline,
- FT_Bitmap* bitmap )
- {
- FT_Error error = FT_Err_Ok;
- FT_Vector* sub = render->root.library->lcd_geometry;
- FT_Pos x, y;
-
- FT_Raster_Params params;
- TOrigin target;
-
-
- /* Render 3 separate coverage bitmaps, shifting the outline. */
- /* Set up direct rendering to record them on each third byte. */
- params.target = bitmap;
- params.source = outline;
- params.flags = FT_RASTER_FLAG_AA | FT_RASTER_FLAG_DIRECT;
- params.gray_spans = (FT_SpanFunc)ft_smooth_lcd_spans;
- params.user = ⌖
-
- params.clip_box.xMin = 0;
- params.clip_box.yMin = 0;
- params.clip_box.xMax = bitmap->width;
- params.clip_box.yMax = bitmap->rows;
-
- if ( bitmap->pitch < 0 )
- target.origin = bitmap->buffer;
- else
- target.origin = bitmap->buffer
- + ( bitmap->rows - 1 ) * (unsigned int)bitmap->pitch;
-
- target.pitch = bitmap->pitch;
-
- FT_Outline_Translate( outline,
- -sub[0].x,
- -sub[0].y );
- error = render->raster_render( render->raster, ¶ms );
- x = sub[0].x;
- y = sub[0].y;
- if ( error )
- goto Exit;
-
- target.origin++;
- FT_Outline_Translate( outline,
- sub[0].x - sub[1].x,
- sub[0].y - sub[1].y );
- error = render->raster_render( render->raster, ¶ms );
- x = sub[1].x;
- y = sub[1].y;
- if ( error )
- goto Exit;
-
- target.origin++;
- FT_Outline_Translate( outline,
- sub[1].x - sub[2].x,
- sub[1].y - sub[2].y );
- error = render->raster_render( render->raster, ¶ms );
- x = sub[2].x;
- y = sub[2].y;
-
- Exit:
- FT_Outline_Translate( outline, x, y );
-
- return error;
- }
-
-
- static FT_Error
- ft_smooth_raster_lcdv( FT_Renderer render,
- FT_Outline* outline,
- FT_Bitmap* bitmap )
- {
- FT_Error error = FT_Err_Ok;
- int pitch = bitmap->pitch;
- FT_Vector* sub = render->root.library->lcd_geometry;
- FT_Pos x, y;
-
- FT_Raster_Params params;
-
-
- params.target = bitmap;
- params.source = outline;
- params.flags = FT_RASTER_FLAG_AA;
-
- /* Render 3 separate coverage bitmaps, shifting the outline. */
- /* Notice that the subpixel geometry vectors are rotated. */
- /* Triple the pitch to render on each third row. */
- bitmap->pitch *= 3;
- bitmap->rows /= 3;
-
- FT_Outline_Translate( outline,
- -sub[0].y,
- sub[0].x );
- error = render->raster_render( render->raster, ¶ms );
- x = sub[0].y;
- y = -sub[0].x;
- if ( error )
- goto Exit;
-
- bitmap->buffer += pitch;
- FT_Outline_Translate( outline,
- sub[0].y - sub[1].y,
- sub[1].x - sub[0].x );
- error = render->raster_render( render->raster, ¶ms );
- x = sub[1].y;
- y = -sub[1].x;
- bitmap->buffer -= pitch;
- if ( error )
- goto Exit;
-
- bitmap->buffer += 2 * pitch;
- FT_Outline_Translate( outline,
- sub[1].y - sub[2].y,
- sub[2].x - sub[1].x );
- error = render->raster_render( render->raster, ¶ms );
- x = sub[2].y;
- y = -sub[2].x;
- bitmap->buffer -= 2 * pitch;
-
- Exit:
- FT_Outline_Translate( outline, x, y );
-
- bitmap->pitch /= 3;
- bitmap->rows *= 3;
-
- return error;
- }
-
-#else /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
-
- /* initialize renderer -- init its raster */
- static FT_Error
- ft_smooth_init( FT_Renderer render )
- {
- /* set up default LCD filtering */
- FT_Library_SetLcdFilter( render->root.library, FT_LCD_FILTER_DEFAULT );
-
- render->clazz->raster_class->raster_reset( render->raster, NULL, 0 );
-
- return 0;
- }
-
-
- static FT_Error
- ft_smooth_raster_lcd( FT_Renderer render,
- FT_Outline* outline,
- FT_Bitmap* bitmap )
- {
- FT_Error error = FT_Err_Ok;
- FT_Vector* points = outline->points;
- FT_Vector* points_end = FT_OFFSET( points, outline->n_points );
- FT_Vector* vec;
-
- FT_Raster_Params params;
-
-
- params.target = bitmap;
- params.source = outline;
- params.flags = FT_RASTER_FLAG_AA;
-
- /* implode outline */
- for ( vec = points; vec < points_end; vec++ )
- vec->x *= 3;
-
- /* render outline into the bitmap */
- error = render->raster_render( render->raster, ¶ms );
-
- /* deflate outline */
- for ( vec = points; vec < points_end; vec++ )
- vec->x /= 3;
-
- return error;
- }
-
-
- static FT_Error
- ft_smooth_raster_lcdv( FT_Renderer render,
- FT_Outline* outline,
- FT_Bitmap* bitmap )
- {
- FT_Error error = FT_Err_Ok;
- FT_Vector* points = outline->points;
- FT_Vector* points_end = FT_OFFSET( points, outline->n_points );
- FT_Vector* vec;
-
- FT_Raster_Params params;
-
-
- params.target = bitmap;
- params.source = outline;
- params.flags = FT_RASTER_FLAG_AA;
-
- /* implode outline */
- for ( vec = points; vec < points_end; vec++ )
- vec->y *= 3;
-
- /* render outline into the bitmap */
- error = render->raster_render( render->raster, ¶ms );
-
- /* deflate outline */
- for ( vec = points; vec < points_end; vec++ )
- vec->y /= 3;
-
- return error;
- }
-
-#endif /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
-
-/* Oversampling scale to be used in rendering overlaps */
-#define SCALE ( 1 << 2 )
-
- /* This function averages inflated spans in direct rendering mode */
- static void
- ft_smooth_overlap_spans( int y,
- int count,
- const FT_Span* spans,
- TOrigin* target )
- {
- unsigned char* dst = target->origin - ( y / SCALE ) * target->pitch;
- unsigned short x;
- unsigned int cover, sum;
-
-
- /* When accumulating the oversampled spans we need to assure that */
- /* fully covered pixels are equal to 255 and do not overflow. */
- /* It is important that the SCALE is a power of 2, each subpixel */
- /* cover can also reach a power of 2 after rounding, and the total */
- /* is clamped to 255 when it adds up to 256. */
- for ( ; count--; spans++ )
- {
- cover = ( spans->coverage + SCALE * SCALE / 2 ) / ( SCALE * SCALE );
- for ( x = 0; x < spans->len; x++ )
- {
- sum = dst[( spans->x + x ) / SCALE] + cover;
- dst[( spans->x + x ) / SCALE] = (unsigned char)( sum - ( sum >> 8 ) );
- }
- }
- }
-
-
- static FT_Error
- ft_smooth_raster_overlap( FT_Renderer render,
- FT_Outline* outline,
- FT_Bitmap* bitmap )
- {
- FT_Error error = FT_Err_Ok;
- FT_Vector* points = outline->points;
- FT_Vector* points_end = FT_OFFSET( points, outline->n_points );
- FT_Vector* vec;
-
- FT_Raster_Params params;
- TOrigin target;
-
-
- /* Set up direct rendering to average oversampled spans. */
- params.target = bitmap;
- params.source = outline;
- params.flags = FT_RASTER_FLAG_AA | FT_RASTER_FLAG_DIRECT;
- params.gray_spans = (FT_SpanFunc)ft_smooth_overlap_spans;
- params.user = ⌖
-
- params.clip_box.xMin = 0;
- params.clip_box.yMin = 0;
- params.clip_box.xMax = bitmap->width * SCALE;
- params.clip_box.yMax = bitmap->rows * SCALE;
-
- if ( bitmap->pitch < 0 )
- target.origin = bitmap->buffer;
- else
- target.origin = bitmap->buffer
- + ( bitmap->rows - 1 ) * (unsigned int)bitmap->pitch;
-
- target.pitch = bitmap->pitch;
-
- /* inflate outline */
- for ( vec = points; vec < points_end; vec++ )
- {
- vec->x *= SCALE;
- vec->y *= SCALE;
- }
-
- /* render outline into the bitmap */
- error = render->raster_render( render->raster, ¶ms );
-
- /* deflate outline */
- for ( vec = points; vec < points_end; vec++ )
- {
- vec->x /= SCALE;
- vec->y /= SCALE;
- }
-
- return error;
- }
-
-#undef SCALE
+ /* convert a slot's glyph image into a bitmap */
static FT_Error
ft_smooth_render( FT_Renderer render,
FT_GlyphSlot slot,
@@ -433,6 +120,10 @@
FT_Memory memory = render->root.memory;
FT_Pos x_shift = 0;
FT_Pos y_shift = 0;
+ FT_Int hmul = ( mode == FT_RENDER_MODE_LCD );
+ FT_Int vmul = ( mode == FT_RENDER_MODE_LCD_V );
+
+ FT_Raster_Params params;
/* check glyph image format */
@@ -445,8 +136,7 @@
/* check mode */
if ( mode != FT_RENDER_MODE_NORMAL &&
mode != FT_RENDER_MODE_LIGHT &&
- mode != FT_RENDER_MODE_LCD &&
- mode != FT_RENDER_MODE_LCD_V )
+ !hmul && !vmul )
{
error = FT_THROW( Cannot_Render_Glyph );
goto Exit;
@@ -491,57 +181,188 @@
if ( x_shift || y_shift )
FT_Outline_Translate( outline, x_shift, y_shift );
- if ( mode == FT_RENDER_MODE_NORMAL ||
- mode == FT_RENDER_MODE_LIGHT )
+ /* set up parameters */
+ params.target = bitmap;
+ params.source = outline;
+ params.flags = FT_RASTER_FLAG_AA;
+
+#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+
+ /* implode outline if needed */
{
- if ( outline->flags & FT_OUTLINE_OVERLAP )
- error = ft_smooth_raster_overlap( render, outline, bitmap );
- else
- {
- FT_Raster_Params params;
+ FT_Vector* points = outline->points;
+ FT_Vector* points_end = FT_OFFSET( points, outline->n_points );
+ FT_Vector* vec;
- params.target = bitmap;
- params.source = outline;
- params.flags = FT_RASTER_FLAG_AA;
+ if ( hmul )
+ for ( vec = points; vec < points_end; vec++ )
+ vec->x *= 3;
- error = render->raster_render( render->raster, ¶ms );
- }
+ if ( vmul )
+ for ( vec = points; vec < points_end; vec++ )
+ vec->y *= 3;
}
- else
+
+ /* render outline into the bitmap */
+ error = render->raster_render( render->raster, ¶ms );
+
+ /* deflate outline if needed */
{
- if ( mode == FT_RENDER_MODE_LCD )
- error = ft_smooth_raster_lcd ( render, outline, bitmap );
- else if ( mode == FT_RENDER_MODE_LCD_V )
- error = ft_smooth_raster_lcdv( render, outline, bitmap );
+ FT_Vector* points = outline->points;
+ FT_Vector* points_end = FT_OFFSET( points, outline->n_points );
+ FT_Vector* vec;
+
+
+ if ( hmul )
+ for ( vec = points; vec < points_end; vec++ )
+ vec->x /= 3;
+
+ if ( vmul )
+ for ( vec = points; vec < points_end; vec++ )
+ vec->y /= 3;
+ }
+
+ if ( error )
+ goto Exit;
+
+ /* finally apply filtering */
+ if ( hmul || vmul )
+ {
+ FT_Byte* lcd_weights;
+ FT_Bitmap_LcdFilterFunc lcd_filter_func;
-#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
- /* finally apply filtering */
+ /* Per-face LCD filtering takes priority if set up. */
+ if ( slot->face && slot->face->internal->lcd_filter_func )
{
- FT_Byte* lcd_weights;
- FT_Bitmap_LcdFilterFunc lcd_filter_func;
+ lcd_weights = slot->face->internal->lcd_weights;
+ lcd_filter_func = slot->face->internal->lcd_filter_func;
+ }
+ else
+ {
+ lcd_weights = slot->library->lcd_weights;
+ lcd_filter_func = slot->library->lcd_filter_func;
+ }
+ if ( lcd_filter_func )
+ lcd_filter_func( bitmap, lcd_weights );
+ }
- /* Per-face LCD filtering takes priority if set up. */
- if ( slot->face && slot->face->internal->lcd_filter_func )
- {
- lcd_weights = slot->face->internal->lcd_weights;
- lcd_filter_func = slot->face->internal->lcd_filter_func;
- }
- else
+#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+
+ if ( hmul ) /* lcd */
+ {
+ FT_Byte* line;
+ FT_Byte* temp = NULL;
+ FT_UInt i, j;
+
+ unsigned int height = bitmap->rows;
+ unsigned int width = bitmap->width;
+ int pitch = bitmap->pitch;
+
+ FT_Vector* sub = slot->library->lcd_geometry;
+
+
+ /* Render 3 separate monochrome bitmaps, shifting the outline. */
+ width /= 3;
+
+ FT_Outline_Translate( outline,
+ -sub[0].x,
+ -sub[0].y );
+ error = render->raster_render( render->raster, ¶ms );
+ if ( error )
+ goto Exit;
+
+ bitmap->buffer += width;
+ FT_Outline_Translate( outline,
+ sub[0].x - sub[1].x,
+ sub[0].y - sub[1].y );
+ error = render->raster_render( render->raster, ¶ms );
+ bitmap->buffer -= width;
+ if ( error )
+ goto Exit;
+
+ bitmap->buffer += 2 * width;
+ FT_Outline_Translate( outline,
+ sub[1].x - sub[2].x,
+ sub[1].y - sub[2].y );
+ error = render->raster_render( render->raster, ¶ms );
+ bitmap->buffer -= 2 * width;
+ if ( error )
+ goto Exit;
+
+ x_shift -= sub[2].x;
+ y_shift -= sub[2].y;
+
+ /* XXX: Rearrange the bytes according to FT_PIXEL_MODE_LCD. */
+ /* XXX: It is more efficient to render every third byte above. */
+
+ if ( FT_ALLOC( temp, (FT_ULong)pitch ) )
+ goto Exit;
+
+ for ( i = 0; i < height; i++ )
+ {
+ line = bitmap->buffer + i * (FT_ULong)pitch;
+ for ( j = 0; j < width; j++ )
{
- lcd_weights = slot->library->lcd_weights;
- lcd_filter_func = slot->library->lcd_filter_func;
+ temp[3 * j ] = line[j];
+ temp[3 * j + 1] = line[j + width];
+ temp[3 * j + 2] = line[j + width + width];
}
-
- if ( lcd_filter_func )
- lcd_filter_func( bitmap, lcd_weights );
+ FT_MEM_COPY( line, temp, pitch );
}
-#endif /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
-
+ FT_FREE( temp );
}
+ else if ( vmul ) /* lcd_v */
+ {
+ int pitch = bitmap->pitch;
+
+ FT_Vector* sub = slot->library->lcd_geometry;
+
+
+ /* Render 3 separate monochrome bitmaps, shifting the outline. */
+ /* Notice that the subpixel geometry vectors are rotated. */
+ /* Triple the pitch to render on each third row. */
+ bitmap->pitch *= 3;
+ bitmap->rows /= 3;
+
+ FT_Outline_Translate( outline,
+ -sub[0].y,
+ sub[0].x );
+ error = render->raster_render( render->raster, ¶ms );
+ if ( error )
+ goto Exit;
+
+ bitmap->buffer += pitch;
+ FT_Outline_Translate( outline,
+ sub[0].y - sub[1].y,
+ sub[1].x - sub[0].x );
+ error = render->raster_render( render->raster, ¶ms );
+ bitmap->buffer -= pitch;
+ if ( error )
+ goto Exit;
+
+ bitmap->buffer += 2 * pitch;
+ FT_Outline_Translate( outline,
+ sub[1].y - sub[2].y,
+ sub[2].x - sub[1].x );
+ error = render->raster_render( render->raster, ¶ms );
+ bitmap->buffer -= 2 * pitch;
+ if ( error )
+ goto Exit;
+
+ x_shift -= sub[2].y;
+ y_shift += sub[2].x;
+
+ bitmap->pitch /= 3;
+ bitmap->rows *= 3;
+ }
+ else /* grayscale */
+ error = render->raster_render( render->raster, ¶ms );
+
+#endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
Exit:
if ( !error )
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 6710613..d76ce43 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -333,9 +333,9 @@
loader->bbox.yMax = FT_NEXT_SHORT( p );
FT_TRACE5(( " # of contours: %d\n", loader->n_contours ));
- FT_TRACE5(( " xMin: %4ld xMax: %4ld\n", loader->bbox.xMin,
+ FT_TRACE5(( " xMin: %4d xMax: %4d\n", loader->bbox.xMin,
loader->bbox.xMax ));
- FT_TRACE5(( " yMin: %4ld yMax: %4ld\n", loader->bbox.yMin,
+ FT_TRACE5(( " yMin: %4d yMax: %4d\n", loader->bbox.yMin,
loader->bbox.yMax ));
loader->cursor = p;
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index b462263..22c7025 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -1729,7 +1729,7 @@
if ( tuple_coords[i] == 0 )
{
- FT_TRACE6(( " tuple coordinate is zero, ignore\n" ));
+ FT_TRACE6(( " tuple coordinate is zero, ignore\n", i ));
continue;
}
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 2c6fc05..6aecfb4 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -293,7 +293,7 @@
FT_Error error;
- FT_TRACE1(( "Init_Context: new object at %p\n", (void *)exec ));
+ FT_TRACE1(( "Init_Context: new object at 0x%08p\n", exec ));
exec->memory = memory;
exec->callSize = 32;
@@ -318,7 +318,7 @@
return FT_Err_Ok;
Fail_Memory:
- FT_ERROR(( "Init_Context: not enough memory for %p\n", (void *)exec ));
+ FT_ERROR(( "Init_Context: not enough memory for %p\n", exec ));
TT_Done_Context( exec );
return error;
@@ -6081,7 +6081,7 @@
exc->zp0.org[point].x = TT_MulFix14( distance,
exc->GS.freeVector.x );
exc->zp0.org[point].y = TT_MulFix14( distance,
- exc->GS.freeVector.y );
+ exc->GS.freeVector.y ),
exc->zp0.cur[point] = exc->zp0.org[point];
}
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
@@ -7845,7 +7845,7 @@
num_twilight_points = 0xFFFFU;
FT_TRACE5(( "TT_RunIns: Resetting number of twilight points\n"
- " from %d to the more reasonable value %ld\n",
+ " from %d to the more reasonable value %d\n",
exc->twilight.n_points,
num_twilight_points ));
exc->twilight.n_points = (FT_UShort)num_twilight_points;
@@ -7880,11 +7880,11 @@
exc->loopcall_counter_max = 100 * (FT_ULong)exc->face->root.num_glyphs;
FT_TRACE5(( "TT_RunIns: Limiting total number of loops in LOOPCALL"
- " to %ld\n", exc->loopcall_counter_max ));
+ " to %d\n", exc->loopcall_counter_max ));
exc->neg_jump_counter_max = exc->loopcall_counter_max;
FT_TRACE5(( "TT_RunIns: Limiting total number of backward jumps"
- " to %ld\n", exc->neg_jump_counter_max ));
+ " to %d\n", exc->neg_jump_counter_max ));
/* set PPEM and CVT functions */
exc->tt_metrics.ratio = 0;
@@ -7921,14 +7921,14 @@
/* if tracing level is 7, show current code position */
/* and the first few stack elements also */
FT_TRACE6(( " " ));
- FT_TRACE7(( "%06ld ", exc->IP ));
+ FT_TRACE7(( "%06d ", exc->IP ));
FT_TRACE6(( "%s", opcode_name[exc->opcode] + 2 ));
FT_TRACE7(( "%*s", *opcode_name[exc->opcode] == 'A'
? 2
: 12 - ( *opcode_name[exc->opcode] - '0' ),
"#" ));
for ( n = 1; n <= cnt; n++ )
- FT_TRACE7(( " %ld", exc->stack[exc->top - n] ));
+ FT_TRACE7(( " %d", exc->stack[exc->top - n] ));
FT_TRACE6(( "\n" ));
}
#endif /* FT_DEBUG_LEVEL_TRACE */
@@ -8646,7 +8646,7 @@
} while ( !exc->instruction_trap );
LNo_Error_:
- FT_TRACE4(( " %ld instruction%s executed\n",
+ FT_TRACE4(( " %d instruction%s executed\n",
ins_counter,
ins_counter == 1 ? "" : "s" ));
return FT_Err_Ok;
diff --git a/src/truetype/ttpload.c b/src/truetype/ttpload.c
index b1255b8..bf0f99f 100644
--- a/src/truetype/ttpload.c
+++ b/src/truetype/ttpload.c
@@ -123,7 +123,7 @@
if ( face->num_locations != (FT_ULong)face->root.num_glyphs + 1 )
{
- FT_TRACE2(( "glyph count mismatch! loca: %ld, maxp: %ld\n",
+ FT_TRACE2(( "glyph count mismatch! loca: %d, maxp: %d\n",
face->num_locations - 1, face->root.num_glyphs ));
/* we only handle the case where `maxp' gives a larger value */
@@ -164,7 +164,7 @@
face->num_locations = (FT_ULong)face->root.num_glyphs + 1;
table_len = new_loca_len;
- FT_TRACE2(( "adjusting num_locations to %ld\n",
+ FT_TRACE2(( "adjusting num_locations to %d\n",
face->num_locations ));
}
else
@@ -172,7 +172,7 @@
face->root.num_glyphs = face->num_locations
? (FT_Long)face->num_locations - 1 : 0;
- FT_TRACE2(( "adjusting num_glyphs to %ld\n",
+ FT_TRACE2(( "adjusting num_glyphs to %d\n",
face->root.num_glyphs ));
}
}
@@ -237,7 +237,7 @@
if ( pos1 > face->glyf_len )
{
FT_TRACE1(( "tt_face_get_location:"
- " too large offset (0x%08lx) found for glyph index %d,\n"
+ " too large offset (0x%08lx) found for glyph index %ld,\n"
" "
" exceeding the end of `glyf' table (0x%08lx)\n",
pos1, gindex, face->glyf_len ));
@@ -251,7 +251,7 @@
if ( gindex == face->num_locations - 2 )
{
FT_TRACE1(( "tt_face_get_location:"
- " too large size (%ld bytes) found for glyph index %d,\n"
+ " too large size (%ld bytes) found for glyph index %ld,\n"
" "
" truncating at the end of `glyf' table to %ld bytes\n",
pos2 - pos1, gindex, face->glyf_len - pos1 ));
@@ -260,7 +260,7 @@
else
{
FT_TRACE1(( "tt_face_get_location:"
- " too large offset (0x%08lx) found for glyph index %d,\n"
+ " too large offset (0x%08lx) found for glyph index %ld,\n"
" "
" exceeding the end of `glyf' table (0x%08lx)\n",
pos2, gindex + 1, face->glyf_len ));
@@ -428,7 +428,7 @@
if ( FT_FRAME_EXTRACT( table_len, face->font_program ) )
goto Exit;
- FT_TRACE2(( "loaded, %12ld bytes\n", face->font_program_size ));
+ FT_TRACE2(( "loaded, %12d bytes\n", face->font_program_size ));
}
Exit:
@@ -491,7 +491,7 @@
if ( FT_FRAME_EXTRACT( table_len, face->cvt_program ) )
goto Exit;
- FT_TRACE2(( "loaded, %12ld bytes\n", face->cvt_program_size ));
+ FT_TRACE2(( "loaded, %12d bytes\n", face->cvt_program_size ));
}
Exit:
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index d16b81f..9d04bd2 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -333,7 +333,7 @@
else
advances[nn] = 0;
- FT_TRACE5(( " idx %d: advance width %ld font unit%s\n",
+ FT_TRACE5(( " idx %d: advance width %d font unit%s\n",
first + nn,
advances[nn],
advances[nn] == 1 ? "" : "s" ));
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 8498600..08a36d1 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1063,7 +1063,7 @@
map->design_points[p] = T1_ToInt( parser );
map->blend_points [p] = T1_ToFixed( parser, 0 );
- FT_TRACE4(( " [%ld %f]",
+ FT_TRACE4(( " [%d %f]",
map->design_points[p],
(double)map->blend_points[p] / 65536 ));
}
@@ -1755,7 +1755,7 @@
*/
FT_TRACE0(( "parse_subrs: adjusting number of subroutines"
- " (from %d to %ld)\n",
+ " (from %d to %d)\n",
num_subrs,
( parser->root.limit - parser->root.cursor ) >> 3 ));
num_subrs = ( parser->root.limit - parser->root.cursor ) >> 3;
@@ -1926,7 +1926,7 @@
if ( num_glyphs > ( limit - cur ) >> 3 )
{
FT_TRACE0(( "parse_charstrings: adjusting number of glyphs"
- " (from %d to %ld)\n",
+ " (from %d to %d)\n",
num_glyphs, ( limit - cur ) >> 3 ));
num_glyphs = ( limit - cur ) >> 3;
}
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 3b918b7..9defdfc 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -346,8 +346,8 @@
if ( error )
goto Exit;
- FT_TRACE2(( "T1_Face_Init: %p (index %d)\n",
- (void *)face,
+ FT_TRACE2(( "T1_Face_Init: %08p (index %d)\n",
+ face,
face_index ));
/* if we just wanted to check the format, leave successfully now */
diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c
index 9850769..75c07dc 100644
--- a/src/type42/t42parse.c
+++ b/src/type42/t42parse.c
@@ -826,7 +826,7 @@
if ( loader->num_glyphs > ( limit - parser->root.cursor ) >> 2 )
{
FT_TRACE0(( "t42_parse_charstrings: adjusting number of glyphs"
- " (from %d to %ld)\n",
+ " (from %d to %d)\n",
loader->num_glyphs,
( limit - parser->root.cursor ) >> 2 ));
loader->num_glyphs = ( limit - parser->root.cursor ) >> 2;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] anuj-distance-field 0d4c454: Revert "Merge remote-tracking branch 'origin/master' into anuj-distance-field",
Anuj Verma <=