diff options
Diffstat (limited to 'lib/freetype')
434 files changed, 4425 insertions, 5896 deletions
diff --git a/lib/freetype/CMakeLists.txt b/lib/freetype/CMakeLists.txt index a7aec4d05..3ed55aad7 100644 --- a/lib/freetype/CMakeLists.txt +++ b/lib/freetype/CMakeLists.txt @@ -147,7 +147,7 @@ project(freetype C) set(VERSION_MAJOR "2") set(VERSION_MINOR "10") -set(VERSION_PATCH "2") +set(VERSION_PATCH "4") # Generate LIBRARY_VERSION and LIBRARY_SOVERSION. set(LIBTOOL_REGEX "version_info='([0-9]+):([0-9]+):([0-9]+)'") @@ -240,9 +240,8 @@ endif () if (UNIX) check_include_file("unistd.h" HAVE_UNISTD_H) check_include_file("fcntl.h" HAVE_FCNTL_H) - check_include_file("stdint.h" HAVE_STDINT_H) - file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in" + file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.h.in" FTCONFIG_H) if (HAVE_UNISTD_H) string(REGEX REPLACE @@ -254,13 +253,6 @@ if (UNIX) "#undef +(HAVE_FCNTL_H)" "#define \\1 1" FTCONFIG_H "${FTCONFIG_H}") endif () - if (HAVE_STDINT_H) - string(REGEX REPLACE - "#undef +(HAVE_STDINT_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) @@ -535,6 +527,12 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) COMPONENT pkgconfig) endif () + include(CMakePackageConfigHelpers) + write_basic_package_version_file( + ${PROJECT_BINARY_DIR}/freetype-config-version.cmake + VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} + COMPATIBILITY SameMajorVersion) + install( TARGETS freetype EXPORT freetype-targets @@ -548,6 +546,10 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype FILE freetype-config.cmake COMPONENT headers) + install( + FILES ${PROJECT_BINARY_DIR}/freetype-config-version.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype + COMPONENT headers) endif () diff --git a/lib/freetype/ChangeLog b/lib/freetype/ChangeLog index e4ea3c531..42f7c34ba 100644 --- a/lib/freetype/ChangeLog +++ b/lib/freetype/ChangeLog @@ -1,3 +1,782 @@ +2020-10-20 Werner Lemberg <wl@gnu.org> + + * Version 2.10.4 released. + ========================== + + + Tag sources with `VER-2-10-4'. + + * docs/VERSION.TXT: Add entry for version 2.10.4. + * docs/CHANGES: Updated. + + * README, src/base/ftver.rc, builds/windows/vc2010/index.html, + builds/windows/visualc/index.html, + builds/windows/visualce/index.html, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/index.html, docs/freetype-config.1: + s/2.10.3/2.10.4/, s/2103/2104/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4. + + * builds/unix/configure.raw (version_info): Set to 23:4:17. + * CMakeLists.txt (VERSION_PATCH): Set to 4. + +2020-10-19 Werner Lemberg <wl@gnu.org> + + [sfnt] Fix heap buffer overflow (#59308). + + This is CVE-2020-15999. + + * src/sfnt/pngshim.c (Load_SBit_Png): Test bitmap size earlier. + +2020-10-17 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/sfnt/tt{colr,cpal}.c: Fix signedness warnings from VC++. + +2020-10-17 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/sfnt/sfwoff2.c (Read255UShort): Tweak types to please VC++. + +2020-10-10 Werner Lemberg <wl@gnu.org> + + * Version 2.10.3 released. + ========================== + + + Tag sources with `VER-2-10-3'. + + * docs/VERSION.TXT: Add entry for version 2.10.3. + + * README, src/base/ftver.rc, builds/windows/vc2010/index.html, + builds/windows/visualc/index.html, + builds/windows/visualce/index.html, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/index.html, docs/freetype-config.1: + s/2.10.2/2.10.3/, s/2102/2103/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3. + + * builds/unix/configure.raw (version_info): Set to 23:3:17. + * CMakeLists.txt (VERSION_PATCH): Set to 3. + +2020-09-25 Werner Lemberg <wl@gnu.org> + + [autofit] Synchronize with ttfautohint. + + This corresponds to the following commits in the ttfautohint git + repository: + + bb6842bd3bd437b7b4a7921b0376c860f5e73d18 Typo, formatting. + d5c91ddb1cb310257a3dfe9a8e20e1fc51335faa Add Medefaidrin script. + + * src/autofit/afblue.dat: Add blue zone data for Medefaidrin. + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + + * src/autofit/afscript.h: Add Medefaidrin standard characters. + + * src/autofit/afranges.c, src/autofit/afstyles.h: Add Medefaidrin + data. + +2020-09-25 Werner Lemberg <wl@gnu.org> + + Move `scripts/make_distribution_archives.py` to `src/tools`. + + * scr/tools/scripts/make_distribution_archives.py: (_TOP_DIR, + _SCRIPT_DIR): Updated to new location. + (main): s/shutils.copyfile/shutils.copy/ to preserve file + permissions. + (main): Prefix source file paths with `git_dir` while copying files + to allow calls of the script from other places than the top-level + directory. + +2020-09-24 Werner Lemberg <wl@gnu.org> + + * src/cff/cffgload.c (cff_slot_load): Scale `vertBearingY`. + + Towards the end of the the function there is a call to + `FT_Outline_Get_CBox` that retrieves the glyph bbox in scaled units. + That sets `horiBearing{X,Y}` and `vertBearingX` but `vertBearingY` + is left alone, and is not scaled. + + Patch from Eric Muller <emuller@amazon.com>. + +2020-09-24 Werner Lemberg <wl@gnu.org> + + * src/base/ftobjs.c (FT_Load_Glyph): Trace glyph metrics. + +2020-09-22 Werner Lemberg <wl@gnu.org> + + [meson] Move auxiliary scripts to `builds/meson`. + + Suggested by Alexei. + + * scripts/*.py: Move meson scripts to... + * builds/meson/*.py: ... this new location. + + * meson.build: Updated. + +2020-09-21 David Turner <david@freetype.org> + + Add python script for building tarballs. + + * scripts/make_distribution_archives.py: New file. + + This standalone Python script should be equivalent to running `make + dist` with the Make-based build system, with the following minor + differences: + + - Since `make distclean` doesn't always clean up `objs/` properly, + `make dist` archives may contain some stale binaries like + `objs/.libs/libfreetype.so.6` or others. + + - `config.guess` and `config.sub` are not updated unless option + `--gnu-config-dir=DIR` is used to specify the location of these + files. + + - Some bits of the auto-generated reference documentation may + appear in slightly different order, probably due to issues related + to mkdocs and docwriter. + + As an example, the call + + scripts/make_distribution_archives.py /tmp/freetype2-dist + + creates the following files under `/tmp/freetype2-dist`: + + freetype-<version>.tar.gz + freetype-<version>.tar.xz + ft<winversion>.zip + +2020-09-21 Werner Lemberg <wl@gnu.org> + + * scripts/extract_freetype_version.py: Fix regex typos. + +2020-09-21 David Turner <david@freetype.org> + + Add Meson build project file. + + Example usage: + + # Configure Meson build in directory `build-meson` to generate + # release binaries comparable to to the ones from the + # autotools/make build system. + meson setup build-meson \ + --prefix=/usr/local \ + --buildtype=debugoptimized \ + --strip \ + -Db_ndebug=true + + # After configuring the Meson build with the above command, + # compile and install to `/usr/local/`; this includes a pkg-config + # file. + ninja -C build-meson install + + # Alternatively, compile and install to `/tmp/aa/usr/local/...` + # for packaging. + DESTDIR=/tmp/aa ninja -C build-meson install + + # Generate documentation under `build-meson/docs`. + ninja -C build-meson docs + + Library size comparison for stripped `libfreetype.so` generated by + all three build systems: + + - Default build (autotools + libtool): 712 KiB + - CMake build (RelWithDebInfo): 712 KiB + - Meson build: 712 KiB + + + * meson.build: New top-level Meson build file for the library. + + * meson_options.txt: New file. It holds user-selectable options for + the build, which can be printed with `meson configure`, and selected + at `meson setup` or `meson --reconfigure` time with + `-D<option>=<value>`. + + * scripts/parse_modules_cfg.py: A script invoked by `meson.build` to + parse `modules.cfg` and extract important information out of it + (i.e., the list of modules). + + * scripts/process_ftoption_h.py: New script invoked by `meson.build` + to process the original `ftoption.h` file. It enables or disables + configuration macro variables based on the available dependencies. + This is similar to what other build systems are using (i.e., Meson's + `configure_file()` command is not used here). + + * scripts/extract_freetype_version.py: New script invoked by + `meson.build` to extract the FreeType version number from + `<freetype/freetype.h>`. + + * scripts/extract_libtool_version.py: New script invoked by + `meson.build` to extract the libtool `revision_info` data from + `builds/unix/configure.raw`, and to generate the corresponding + shared library suffix. + + * scripts/generate_reference_docs.py: New script invoked by + `meson.build` to generate the FreeType 2 reference documentation + (using the `docwriter` and `mkdocs` packages, which must be already + installed). + +2020-09-11 Alexei Podtelezhnikov <apodtele@gmail.com> + + [raster] Improve the second pass (#58373). + + Besides dropout control the second horizontal sweep is supposed to + clean up straight horizontal edges that are mishandled by the first + vertical sweep when a line passes through pixel centers. This line + would present as perfectly aligned span edges in the second sweep. + + * src/raster/ftraster.c (Horizontal_Sweep_Span): Replace the old + implementation with a better one focusing on aligned span edges only. + +2020-09-08 Alexei Podtelezhnikov <apodtele@gmail.com> + + [raster] Tune SMART macro (#58352). + + Windows seems to perform smart dropout control at 26.6 precision. + To mimick Windows independent of increased precision, we need to tweak + the macro so that some close calls break down rather than up. + + * src/raster/ftraster.c (SMART): Tweak the macro. + +2020-09-08 Alexei Podtelezhnikov <apodtele@gmail.com> + + [raster] Introduce SMART macro. + + * src/raster/ftraster.c (SMART): New macro for smart dropout rounding. + (Verstical_Sweep_Drop, Horizontal_Sweep_Drop): Use it. + +2020-09-03 Boris Dalstein <dalboris@gmail.com> + + [build] Make CMake install basic version information. + + * CMakeLists.txt: Do it. + +2020-09-02 Alexei Podtelezhnikov <apodtele@gmail.com> + + [truetype] Reduce Infinality footprint (cont'd). + + * src/truetype/ttinterp.c (Ins_DELTAP): Shrink variable scope. + (Ins_SHPIX, Ins_MIRP): Revise if-logic. + +2020-09-02 Alexei Podtelezhnikov <apodtele@gmail.com> + + [truetype] Reduce Infinality footprint. + + * src/truetype/ttinterp.c (Ins_SHPIX, Ins_MSIRP, Ins_MIAP, Ins_MDRP, + Ins_MIRP): Shrink variable scopes and consolidate ifdefs. + +2020-09-01 Alexei Podtelezhnikov <apodtele@gmail.com> + + [truetype] Refactor compensation color. + + * src/truetype/ttinterp.h (TT_Round_Func): Change the last argument. + * src/truetype/ttinterp.c (Ins_ROUND, Ins_NROUND, Ins_MDAP, Ins_MIAP, + Ins_MDRP, Ins_MIRP): Move compensation retrieval from here... + (Round_*): ... to here. + * src/truetype/ttobjs.c (tt_size_init_bytecode): Reserve zero + compensation at color index 3. + +2020-08-28 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Don't set target in direct mode. + + * src/smooth/ftsmooth.c (ft_smooth_raster_overlap): Remove assignment. + (ft_smooth_raster_lcd) [!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Ditto. + +2020-08-25 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/smooth/ftsmooth.c (ft_smooth_raster_overlap): Limit width. + + Segmentation fault reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24729 + +2020-08-22 Werner Lemberg <wl@gnu.org> + + * src/truetype/ttgload.c (TT_Get_VMetrics): Add tracing message. + +2020-08-05 Alexei Podtelezhnikov <apodtele@gmail.com> + + [truetype] Retain OVERLAP_SIMPLE and OVERLAP_COMPOUND. + + For glyphs with OVERLAP_SIMPLE or OVERLAP_COMPOUND, set + FT_OUTLINE_OVERLAP to render them with direct oversampling, which + mitigates artifacts (see 3bb512bc9f62). + + * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Redefine to rhyme + with OVERLAP_SIMPLE. + * src/base/ftgloadr.c (FT_GlyphLoader_Rewind): Reset outline flags. + * src/truetype/ttgload.c + (TT_Load_Simple_Glyph): Retain OVERLAP_SIMPLE. + (load_truetype_glyph): Retain OVERLAP_COMPOUND. + +2020-08-04 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/truetype/ttgload.c (TT_Load_Glyph): More tracing. + +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 mitigate 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'. + + * */*: Remove `#include <ft2build.h>' where possible. + + * include/freetype/freetype.h: Remove cpp error about missing + inclusion of `ft2build.h'. + +2020-06-08 David Turner <david@freetype.org> + + Make macros for header file names optional. + + We no longer have to take care of the 8.3 file name limit; this + allows us (a) to introduce longer, meaningful file names, and (b) to + avoid macro names in `#include' lines altogether since some + compilers (most notably Visual C++) doesn't support this properly. + + */*: Replace + + #include FOO_H + + with + + #include <freetype/foo.h> + + or something similar. Also update the documentation. + +2020-06-02 Werner Lemberg <wl@gnu.org> + + * src/sfnt/ttcmap.c (tt_face_build_cmaps): Trace number of cmaps. + +2020-05-18 David Turner <david@freetype.org> + + Remove obsolete HAVE_STDINT_H probing macro. + + This macro was updated by the unix configure script and the + `CMakeLists.txt' one, but is never used in the source tree (nor is + <stdint.h> included anywhere). + + * CMakeLists.txt, builds/unix/ftconfig.in: Don't handle + `HAVE_STDINT_H'. + +2020-05-18 David Turner <david@freetype.org> + + Remove Jamfile files from the tree. + + These have not been used in a very, very long time, so better remove + them. A corresponding patch will be submitted to the + `freetype2-demos' repository. + + * src/Jamfile, src/*/Jamfile, Jamrules: Delete. + +2020-05-12 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Turn on LCD filtering during FreeType initialization. + + * src/smooth/ftsmooth.c (ft_smooth_init): Enable LCD filtering. + + * include/freetype/ftlcdfil.h: Document it, remove patent warnings. + * include/freetype/freetype.h (FT_Render_Mode): Updated. + * include/freetype/config/ftoption.h, devel/ftoption.h + [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Do not mention patents. + +2020-05-11 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Stop using dedicated LCD modules and classes. + + The LCD modules were never truly independent. They mostly served as + a way to disable patented LCD rendering, which is no longer necessary. + The `smooth' module now handles LCD modes as well. + + * src/smooth/ftsmooth.c (ft_smooth_lcd_renderer_class. + ft_smooth_lcdv_renderer_class): Deleted. + (ft_render_smooth): Reworked from `ft_render_smooth_generic'. + * src/smooth/ftsmooth.h: Remove dedicated LCD classes. + * src/smooth/module.mk: Remove dedicated LCD modules. + * include/freetype/config/ftmodule.h: Ditto. + * builds/amiga/include/config/ftmodule.h: Ditto. + * include/freetype/ftmodapi.h: Do not mention LCD modules. + 2020-05-09 Werner Lemberg <wl@gnu.org> * Version 2.10.2 released. @@ -4079,7 +4858,7 @@ 2018-05-13 Shao Yu Zhang <shaozhang@fb.com> Werner Lemberg <wl@gnu.org> - [sfnt] Preliminary support of coloured layer outlines (#44689). + [sfnt] Preliminary support of colored layer outlines (#44689). This commit enables OpenType's COLR/CPAL table handling; a typical application are color emojis that can be scaled to any size. diff --git a/lib/freetype/ChangeLog.21 b/lib/freetype/ChangeLog.21 index 3ed33baf2..f36f5b7fb 100644 --- a/lib/freetype/ChangeLog.21 +++ b/lib/freetype/ChangeLog.21 @@ -4799,11 +4799,11 @@ (chapter_inter, chapter_footer): Add <li> and use special <ul> class. Use double quotes around table widths given in percent. - (keyword_prefix, keyword_suffix): Don't change font colour directly + (keyword_prefix, keyword_suffix): Don't change font color directly but use a new <span> class. (section_synopsis_header, section_synopsis_footer): Don't change - colour. - (code_header, code_footer): Don't change font colour directly but + color. + (code_header, code_footer): Don't change font color directly but use a special <pre> class. (print_html_field): <tr> gets the `valign' attribute, not <table>. (print_html_field_list): Ditto. diff --git a/lib/freetype/Jamfile b/lib/freetype/Jamfile deleted file mode 100644 index 76ccdeed0..000000000 --- a/lib/freetype/Jamfile +++ /dev/null @@ -1,224 +0,0 @@ -# FreeType 2 top Jamfile. -# -# Copyright (C) 2001-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 HDRMACRO is already defined in FTJam and is used to add -# the content of certain macros to the list of included header -# files. -# -# We can compile FreeType 2 with classic Jam however thanks to -# the following code -# -if ! $(JAM_TOOLSET) -{ - rule HDRMACRO - { - # nothing - } -} - - -# We need to invoke a SubDir rule if the FT2 source directory top is not the -# current directory. This allows us to build FreeType 2 as part of a larger -# project easily. -# -if $(FT2_TOP) != $(DOT) -{ - SubDir FT2_TOP ; -} - - -# The following macros define the include directory, the source directory, -# and the final library name (without library extensions). They can be -# replaced by other definitions when the library is compiled as part of -# a larger project. -# - -# Name of FreeType include directory during compilation. -# This is relative to FT2_TOP. -# -FT2_INCLUDE_DIR ?= include ; - -# Name of FreeType source directory during compilation. -# This is relative to FT2_TOP. -# -FT2_SRC_DIR ?= src ; - -# Name of final library, without extension. -# -FT2_LIB ?= $(LIBPREFIX)freetype ; - - -# Define FT2_BUILD_INCLUDE to point to your build-specific directory. -# This is prepended to FT2_INCLUDE_DIR. It can be used to specify -# the location of a custom <ft2build.h> which will point to custom -# versions of `ftmodule.h' and `ftoption.h', for example. -# -FT2_BUILD_INCLUDE ?= ; - -# The list of modules to compile on any given build of the library. -# By default, this will contain _all_ modules defined in FT2_SRC_DIR. -# -# IMPORTANT: You'll need to change the content of `ftmodule.h' as well -# if you modify this list or provide your own. -# -FT2_COMPONENTS ?= autofit # auto-fitter - base # base component (public APIs) - bdf # BDF font driver - bzip2 # support for bzip2-compressed PCF font - cache # cache sub-system - cff # CFF/CEF font driver - cid # PostScript CID-keyed font driver - gzip # support for gzip-compressed PCF font - lzw # support for LZW-compressed PCF font - pcf # PCF font driver - pfr # PFR/TrueDoc font driver - psaux # common PostScript routines module - pshinter # PostScript hinter module - psnames # PostScript names handling - raster # monochrome rasterizer - sfnt # SFNT-based format support routines - smooth # anti-aliased rasterizer - truetype # TrueType font driver - type1 # PostScript Type 1 font driver - type42 # PostScript Type 42 (embedded TrueType) driver - winfonts # Windows FON/FNT font driver - ; - - -# Don't touch. -# -FT2_INCLUDE = $(FT2_BUILD_INCLUDE) - [ FT2_SubDir $(FT2_INCLUDE_DIR) ] ; - -FT2_SRC = [ FT2_SubDir $(FT2_SRC_DIR) ] ; - -# Location of API Reference Documentation -# -if $(DOC_DIR) -{ - DOC_DIR = $(DOCDIR:T) ; -} -else -{ - DOC_DIR = docs/reference ; -} - - -# Only used by FreeType developers. -# -if $(DEBUG_HINTER) -{ - CCFLAGS += -DDEBUG_HINTER ; -} - - -# We need `include' in the current include path in order to -# compile any part of FreeType 2. -# -HDRS += $(FT2_INCLUDE) ; - - -# We need to #define FT2_BUILD_LIBRARY so that our sources find the -# internal headers -# -CCFLAGS += -DFT2_BUILD_LIBRARY ; - -# Uncomment the following line if you want to build individual source files -# for each FreeType 2 module. This is only useful during development, and -# is better defined as an environment variable anyway! -# -# FT2_MULTI = true ; - - -# The files `ftheader.h', `internal.h', and `ftserv.h' are used to define -# macros that are later used in #include statements. They need to be parsed -# in order to record these definitions. -# -HDRMACRO [ FT2_SubDir $(FT2_INCLUDE_DIR) freetype config ftheader.h ] ; -HDRMACRO [ FT2_SubDir $(FT2_INCLUDE_DIR) freetype internal internal.h ] ; -HDRMACRO [ FT2_SubDir $(FT2_INCLUDE_DIR) freetype internal ftserv.h ] ; - - -# Now include the Jamfile in `freetype2/src', used to drive the compilation -# of each FreeType 2 component and/or module. -# -SubInclude FT2_TOP $(FT2_SRC_DIR) ; - -# Handle the generation of the `ftexport.sym' file, which contains the list -# of exported symbols. This can be used on Unix by libtool. -# -SubInclude FT2_TOP $(FT2_SRC_DIR) tools ; - -rule GenExportSymbols -{ - local apinames = apinames$(SUFEXE) ; - local aheader ; - local headers ; - - for aheader in [ Glob $(2) : *.h ] - { - switch $(aheader) - { - case */ftmac.h : - if ( $(MAC) || $(OS) = MACOSX ) { - headers += $(aheader) ; - } - case *.h : headers += $(aheader) ; - } - } - - LOCATE on $(1) = $(ALL_LOCATE_TARGET) ; - - APINAMES on $(1) = apinames$(SUFEXE) ; - - Depends $(1) : $(apinames) $(headers) ; - GenExportSymbols1 $(1) : $(headers) ; - Clean clean : $(1) ; -} - -actions GenExportSymbols1 bind APINAMES -{ - $(APINAMES) $(2) > $(1) -} - -GenExportSymbols ftexport.sym : include/freetype ; - -# Test files (hinter debugging). Only used by FreeType developers. -# -if $(DEBUG_HINTER) -{ - SubInclude FT2_TOP tests ; -} - -rule RefDoc -{ - Depends $1 : all ; - NotFile $1 ; - Always $1 ; -} - -actions RefDoc -{ - python3 -m docwriter - --prefix=ft2 - --title=FreeType-2.10.2 - --site=reference - --output=$(DOC_DIR) - $(FT2_INCLUDE)/freetype/*.h - $(FT2_INCLUDE)/freetype/config/*.h - $(FT2_INCLUDE)/freetype/cache/*.h -} - -RefDoc refdoc ; - - -# end of top Jamfile diff --git a/lib/freetype/Jamrules b/lib/freetype/Jamrules deleted file mode 100644 index 816febaca..000000000 --- a/lib/freetype/Jamrules +++ /dev/null @@ -1,71 +0,0 @@ -# FreeType 2 JamRules. -# -# Copyright (C) 2001-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 file contains the Jam rules needed to build the FreeType 2 library. -# It is shared by all Jamfiles and is included only once in the build -# process. -# - - -# Call SubDirHdrs on a list of directories. -# -rule AddSubDirHdrs -{ - local x ; - - for x in $(<) - { - SubDirHdrs $(x) ; - } -} - - -# Determine prefix of library file. We must use "libxxxxx" on Unix systems, -# while all other simply use the real name. -# -if $(UNIX) -{ - LIBPREFIX ?= lib ; -} -else -{ - LIBPREFIX ?= "" ; -} - -# FT2_TOP contains the location of the FreeType source directory. You can -# set it to a specific value if you want to compile the library as part of a -# larger project. -# -FT2_TOP ?= $(DOT) ; - -# Define a new rule used to declare a sub directory of the Nirvana source -# tree. -# -rule FT2_SubDir -{ - if $(FT2_TOP) = $(DOT) - { - return [ FDirName $(<) ] ; - } - else - { - return [ FDirName $(FT2_TOP) $(<) ] ; - } -} - -# We also set ALL_LOCATE_TARGET in order to place all object and library -# files in "objs". -# -ALL_LOCATE_TARGET ?= [ FT2_SubDir objs ] ; - - -# end of Jamrules diff --git a/lib/freetype/Makefile b/lib/freetype/Makefile index aabdcdcfc..7f890bfc2 100644 --- a/lib/freetype/Makefile +++ b/lib/freetype/Makefile @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile,v 1.54 2020/06/27 09:06:07 matthieu Exp $ +# $OpenBSD: Makefile,v 1.55 2020/11/11 09:27:24 matthieu Exp $ .include <bsd.own.mk> FREETYPESRC= ${.CURDIR}/src # Get it from builds/unix/configure.ac -FT_VERSION_INFO= 23.2.17 +FT_VERSION_INFO= 23.4.17 INSTALL_PROGRAM = ${INSTALL} ${INSTALL_COPY} -m 755 -o $(BINOWN) -g $(BINGRP) @@ -26,7 +26,7 @@ SRCS= ftbase.c ftbbox.c ftbdf.c ftbitmap.c ftdebug.c ftcache.c \ raster.c sfnt.c smooth.c truetype.c type1.c type1cid.c \ type42.c winfnt.c -CPPFLAGS+= -I${.CURDIR}/include -I${.CURDIR}/builds/unix -I${.CURDIR}/src/lzw -DFT2_BUILD_LIBRARY +CPPFLAGS+= -I${.CURDIR}/include -I${.CURDIR}/builds/unix -I${.CURDIR}/src/lzw -DFT2_BUILD_LIBRARY -DFT_CONFIG_CONFIG_H='<ftconfig.h>' .if ${COMPILER_VERSION} != "gcc3" CFLAGS+= -fvisibility=hidden diff --git a/lib/freetype/README b/lib/freetype/README index 67455d788..e4c8cf1c5 100644 --- a/lib/freetype/README +++ b/lib/freetype/README @@ -1,4 +1,4 @@ - FreeType 2.10.2 + FreeType 2.10.4 =============== Homepage: https://www.freetype.org @@ -27,9 +27,9 @@ and download one of the following files. - freetype-doc-2.10.2.tar.xz - freetype-doc-2.10.2.tar.gz - ftdoc2102.zip + freetype-doc-2.10.4.tar.xz + freetype-doc-2.10.4.tar.gz + ftdoc2104.zip To view the documentation online, go to @@ -67,6 +67,18 @@ 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/lib/freetype/builds/amiga/include/config/ftmodule.h b/lib/freetype/builds/amiga/include/config/ftmodule.h index 8bc115049..6035bf016 100644 --- a/lib/freetype/builds/amiga/include/config/ftmodule.h +++ b/lib/freetype/builds/amiga/include/config/ftmodule.h @@ -137,8 +137,6 @@ FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) #ifdef FT_USE_SMOOTH FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) #endif #ifdef FT_USE_OTV diff --git a/lib/freetype/builds/amiga/src/base/ftdebug.c b/lib/freetype/builds/amiga/src/base/ftdebug.c index 816e62622..6510d206a 100644 --- a/lib/freetype/builds/amiga/src/base/ftdebug.c +++ b/lib/freetype/builds/amiga/src/base/ftdebug.c @@ -68,8 +68,8 @@ #include <ft2build.h> -#include FT_FREETYPE_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/freetype.h> +#include <freetype/internal/ftdebug.h> #ifdef FT_DEBUG_LEVEL_ERROR @@ -152,7 +152,7 @@ static const char* ft_trace_toggles[trace_count + 1] = { -#include FT_INTERNAL_TRACE_H +#include <freetype/internal/fttrace.h> NULL }; diff --git a/lib/freetype/builds/amiga/src/base/ftsystem.c b/lib/freetype/builds/amiga/src/base/ftsystem.c index 04eb99955..1dfbd6615 100644 --- a/lib/freetype/builds/amiga/src/base/ftsystem.c +++ b/lib/freetype/builds/amiga/src/base/ftsystem.c @@ -96,10 +96,10 @@ Free_VecPooled( APTR poolHeader, #include <ft2build.h> #include FT_CONFIG_CONFIG_H -#include FT_INTERNAL_DEBUG_H -#include FT_SYSTEM_H -#include FT_ERRORS_H -#include FT_TYPES_H +#include <freetype/internal/ftdebug.h> +#include <freetype/ftsystem.h> +#include <freetype/fterrors.h> +#include <freetype/fttypes.h> #include <stdio.h> #include <stdlib.h> diff --git a/lib/freetype/builds/cmake/testbuild.sh b/lib/freetype/builds/cmake/testbuild.sh index 8f8b60055..cc67abd46 100755 --- a/lib/freetype/builds/cmake/testbuild.sh +++ b/lib/freetype/builds/cmake/testbuild.sh @@ -93,7 +93,7 @@ cat >$tmpdir/main.c << END #include <stdlib.h> #include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> FT_Library library; diff --git a/lib/freetype/builds/mac/ftmac.c b/lib/freetype/builds/mac/ftmac.c index b211780ba..2cb30468c 100644 --- a/lib/freetype/builds/mac/ftmac.c +++ b/lib/freetype/builds/mac/ftmac.c @@ -62,10 +62,9 @@ */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_TRUETYPE_TAGS_H -#include FT_INTERNAL_STREAM_H +#include <freetype/freetype.h> +#include <freetype/tttags.h> +#include <freetype/internal/ftstream.h> #include "ftbase.h" #if defined( __GNUC__ ) || defined( __IBMC__ ) diff --git a/lib/freetype/builds/unix/configure.ac b/lib/freetype/builds/unix/configure.ac index adb51018e..f54b94631 100644 --- a/lib/freetype/builds/unix/configure.ac +++ b/lib/freetype/builds/unix/configure.ac @@ -11,13 +11,13 @@ # indicate that you have read the license and understand and accept it # fully. -AC_INIT([FreeType], [2.10.2], [freetype@nongnu.org], [freetype]) -AC_CONFIG_SRCDIR([ftconfig.in]) +AC_INIT([FreeType], [2.10.4], [freetype@nongnu.org], [freetype]) +AC_CONFIG_SRCDIR([ftconfig.h.in]) # Don't forget to update `docs/VERSIONS.TXT'! -version_info='23:2:17' +version_info='23:4:17' AC_SUBST([version_info]) ft_version=`echo $version_info | tr : .` AC_SUBST([ft_version]) @@ -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.in works +# check whether cpp computation of size of int and long in ftconfig.h.in works -AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.in works]) +AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.h.in works]) orig_CPPFLAGS="${CPPFLAGS}" -CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include/freetype/config ${CPPFLAGS}" +CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include ${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 "ftoption.h" -#define FT_CONFIG_STANDARD_LIBRARY_H "ftstdlib.h" +#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h> +#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h> #define FT_UINT_MAX UINT_MAX #define FT_ULONG_MAX ULONG_MAX -#include "ftconfig.in" +#include "ftconfig.h.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,15 +1158,7 @@ AC_CONFIG_FILES([ftoption.h:${srcdir}/../../include/freetype/config/ftoption.h], rm ftoption.tmp], [FTOPTION_H_SED="$FTOPTION_H_SED"]) -# 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]) +AC_CONFIG_HEADERS([ftconfig.h]) # 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 @@ -1174,10 +1166,6 @@ AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in], AC_CONFIG_FILES([unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in]) -# re-generate the Jamfile to use libtool now -# -# AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in]) - AC_OUTPUT AC_MSG_NOTICE([ @@ -1193,9 +1181,9 @@ Library configuration: # Warn if docwriter is not installed if test $have_docwriter = no; then - AC_MSG_NOTICE([ - Warning: \`make refdoc' will fail since pip package \`docwriter' is not - installed. To install, run \`$PIP install docwriter', or to use a Python + AC_MSG_WARN([ + \`make refdoc' will fail since pip package \`docwriter' is not installed. + To install, run \`$PIP install docwriter', or to use a Python virtual environment, run \`make refdoc-venv' (requires pip package \`virtualenv'). These operations require Python >= 3.5. ]) diff --git a/lib/freetype/builds/unix/configure.raw b/lib/freetype/builds/unix/configure.raw index 2d89c7446..bc65e452a 100644 --- a/lib/freetype/builds/unix/configure.raw +++ b/lib/freetype/builds/unix/configure.raw @@ -12,12 +12,12 @@ # fully. AC_INIT([FreeType], [@VERSION@], [freetype@nongnu.org], [freetype]) -AC_CONFIG_SRCDIR([ftconfig.in]) +AC_CONFIG_SRCDIR([ftconfig.h.in]) # Don't forget to update `docs/VERSIONS.TXT'! -version_info='23:2:17' +version_info='23:4:17' AC_SUBST([version_info]) ft_version=`echo $version_info | tr : .` AC_SUBST([ft_version]) @@ -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.in works +# check whether cpp computation of size of int and long in ftconfig.h.in works -AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.in works]) +AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.h.in works]) orig_CPPFLAGS="${CPPFLAGS}" -CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include/freetype/config ${CPPFLAGS}" +CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include ${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 "ftoption.h" -#define FT_CONFIG_STANDARD_LIBRARY_H "ftstdlib.h" +#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h> +#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h> #define FT_UINT_MAX UINT_MAX #define FT_ULONG_MAX ULONG_MAX -#include "ftconfig.in" +#include "ftconfig.h.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,15 +1158,7 @@ AC_CONFIG_FILES([ftoption.h:${srcdir}/../../include/freetype/config/ftoption.h], rm ftoption.tmp], [FTOPTION_H_SED="$FTOPTION_H_SED"]) -# 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]) +AC_CONFIG_HEADERS([ftconfig.h]) # 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 @@ -1174,10 +1166,6 @@ AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in], AC_CONFIG_FILES([unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in]) -# re-generate the Jamfile to use libtool now -# -# AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in]) - AC_OUTPUT AC_MSG_NOTICE([ @@ -1193,9 +1181,9 @@ Library configuration: # Warn if docwriter is not installed if test $have_docwriter = no; then - AC_MSG_NOTICE([ - Warning: \`make refdoc' will fail since pip package \`docwriter' is not - installed. To install, run \`$PIP install docwriter', or to use a Python + AC_MSG_WARN([ + \`make refdoc' will fail since pip package \`docwriter' is not installed. + To install, run \`$PIP install docwriter', or to use a Python virtual environment, run \`make refdoc-venv' (requires pip package \`virtualenv'). These operations require Python >= 3.5. ]) diff --git a/lib/freetype/builds/unix/freetype2.m4 b/lib/freetype/builds/unix/freetype2.m4 index c8766caac..207c263fb 100644 --- a/lib/freetype/builds/unix/freetype2.m4 +++ b/lib/freetype/builds/unix/freetype2.m4 @@ -15,7 +15,7 @@ # generated by Autoconf, under the same distribution terms as the rest of # that program. # -# serial 4 +# serial 5 # AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) # Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS. @@ -116,7 +116,7 @@ AC_DEFUN([AC_CHECK_FT2], AC_LANG_SOURCE([[ #include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #include <stdio.h> #include <stdlib.h> diff --git a/lib/freetype/builds/unix/ftconfig.h b/lib/freetype/builds/unix/ftconfig.h index e8c37704d..51cb79639 100644 --- a/lib/freetype/builds/unix/ftconfig.h +++ b/lib/freetype/builds/unix/ftconfig.h @@ -1,11 +1,11 @@ -/* ftconfig.h. Generated from ftconfig.in by configure. */ +/* ftconfig.h. Generated from ftconfig.h.in by configure. */ /**************************************************************************** * - * ftconfig.in + * ftconfig.h.in * * UNIX-specific configuration file (specification only). * - * Copyright (C) 1996-2019 by + * 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, @@ -40,37 +40,8 @@ #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 -#define HAVE_STDINT_H 1 - - /* 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 @@ -80,523 +51,11 @@ FT_BEGIN_HEADER #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 /* 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_ */ diff --git a/lib/freetype/builds/unix/ftconfig.h.in b/lib/freetype/builds/unix/ftconfig.h.in new file mode 100644 index 000000000..00b5a8226 --- /dev/null +++ b/lib/freetype/builds/unix/ftconfig.h.in @@ -0,0 +1,62 @@ +/**************************************************************************** + * + * 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/lib/freetype/builds/unix/ftconfig.in b/lib/freetype/builds/unix/ftconfig.in deleted file mode 100644 index 7f3737776..000000000 --- a/lib/freetype/builds/unix/ftconfig.in +++ /dev/null @@ -1,603 +0,0 @@ -/**************************************************************************** - * - * 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 -#undef HAVE_STDINT_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/lib/freetype/builds/unix/ftsystem.c b/lib/freetype/builds/unix/ftsystem.c index ba2595162..b4d71d40e 100644 --- a/lib/freetype/builds/unix/ftsystem.c +++ b/lib/freetype/builds/unix/ftsystem.c @@ -18,12 +18,12 @@ #include <ft2build.h> /* we use our special ftconfig.h file, not the standard one */ -#include <ftconfig.h> -#include FT_INTERNAL_DEBUG_H -#include FT_SYSTEM_H -#include FT_ERRORS_H -#include FT_TYPES_H -#include FT_INTERNAL_STREAM_H +#include FT_CONFIG_CONFIG_H +#include <freetype/internal/ftdebug.h> +#include <freetype/ftsystem.h> +#include <freetype/fterrors.h> +#include <freetype/fttypes.h> +#include <freetype/internal/ftstream.h> /* memory-mapping includes and definitions */ #ifdef HAVE_UNISTD_H @@ -351,7 +351,7 @@ stream->read = 0; FT_TRACE1(( "FT_Stream_Open:" )); - FT_TRACE1(( " opened `%s' (%d bytes) successfully\n", + FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n", filepathname, stream->size )); return FT_Err_Ok; diff --git a/lib/freetype/builds/vms/ftconfig.h b/lib/freetype/builds/vms/ftconfig.h index d9165e5f6..07e5f83d7 100644 --- a/lib/freetype/builds/vms/ftconfig.h +++ b/lib/freetype/builds/vms/ftconfig.h @@ -39,21 +39,6 @@ #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 @@ -63,491 +48,9 @@ FT_BEGIN_HEADER #define FT_SIZEOF_INT 4 #define FT_SIZEOF_LONG 4 - - /* `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 - +#include <freetype/config/integer-types.h> +#include <freetype/config/public-macros.h> +#include <freetype/config/mac-support.h> #endif /* FTCONFIG_H_ */ diff --git a/lib/freetype/builds/vms/ftsystem.c b/lib/freetype/builds/vms/ftsystem.c index f372f0cd2..177481ab2 100644 --- a/lib/freetype/builds/vms/ftsystem.c +++ b/lib/freetype/builds/vms/ftsystem.c @@ -19,11 +19,11 @@ #include <ft2build.h> /* we use our special ftconfig.h file, not the standard one */ #include <ftconfig.h> -#include FT_INTERNAL_DEBUG_H -#include FT_SYSTEM_H -#include FT_ERRORS_H -#include FT_TYPES_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/ftsystem.h> +#include <freetype/fterrors.h> +#include <freetype/fttypes.h> +#include <freetype/internal/ftobjs.h> /* memory-mapping includes and definitions */ #ifdef HAVE_UNISTD_H diff --git a/lib/freetype/builds/wince/ftdebug.c b/lib/freetype/builds/wince/ftdebug.c index cd3c6cfd4..734c4f0a5 100644 --- a/lib/freetype/builds/wince/ftdebug.c +++ b/lib/freetype/builds/wince/ftdebug.c @@ -41,9 +41,8 @@ */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/freetype.h> +#include <freetype/internal/ftdebug.h> #ifdef FT_DEBUG_LEVEL_ERROR @@ -154,7 +153,7 @@ static const char* ft_trace_toggles[trace_count + 1] = { -#include FT_INTERNAL_TRACE_H +#include <freetype/internal/fttrace.h> NULL }; diff --git a/lib/freetype/builds/wince/vc2005-ce/index.html b/lib/freetype/builds/wince/vc2005-ce/index.html index ff57231ec..6936a8909 100644 --- a/lib/freetype/builds/wince/vc2005-ce/index.html +++ b/lib/freetype/builds/wince/vc2005-ce/index.html @@ -21,7 +21,7 @@ the following targets: <li>PPC/SP WM6 (Windows Mobile 6)</li> </ul> -It compiles the following libraries from the FreeType 2.10.2 sources:</p> +It compiles the following libraries from the FreeType 2.10.4 sources:</p> <ul> <pre> diff --git a/lib/freetype/builds/wince/vc2008-ce/index.html b/lib/freetype/builds/wince/vc2008-ce/index.html index 43798217c..ee385af86 100644 --- a/lib/freetype/builds/wince/vc2008-ce/index.html +++ b/lib/freetype/builds/wince/vc2008-ce/index.html @@ -21,7 +21,7 @@ the following targets: <li>PPC/SP WM6 (Windows Mobile 6)</li> </ul> -It compiles the following libraries from the FreeType 2.10.2 sources:</p> +It compiles the following libraries from the FreeType 2.10.4 sources:</p> <ul> <pre> diff --git a/lib/freetype/builds/windows/ftdebug.c b/lib/freetype/builds/windows/ftdebug.c index ce464a171..d58949003 100644 --- a/lib/freetype/builds/windows/ftdebug.c +++ b/lib/freetype/builds/windows/ftdebug.c @@ -41,9 +41,8 @@ */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/freetype.h> +#include <freetype/internal/ftdebug.h> #ifdef FT_DEBUG_LEVEL_ERROR @@ -138,7 +137,7 @@ static const char* ft_trace_toggles[trace_count + 1] = { -#include FT_INTERNAL_TRACE_H +#include <freetype/internal/fttrace.h> NULL }; diff --git a/lib/freetype/builds/windows/vc2010/index.html b/lib/freetype/builds/windows/vc2010/index.html index 1999a7fda..3b60c5fe1 100644 --- a/lib/freetype/builds/windows/vc2010/index.html +++ b/lib/freetype/builds/windows/vc2010/index.html @@ -12,7 +12,7 @@ <p>This directory contains solution and project files for Visual C++ 2010 or newer, named <tt>freetype.sln</tt>, and <tt>freetype.vcxproj</tt>. It compiles the following libraries -from the FreeType 2.10.2 sources:</p> +from the FreeType 2.10.4 sources:</p> <ul> <li>freetype.dll using 'Release' or 'Debug' configurations</li> diff --git a/lib/freetype/builds/windows/visualc/index.html b/lib/freetype/builds/windows/visualc/index.html index 56a52f45e..cec26d27a 100644 --- a/lib/freetype/builds/windows/visualc/index.html +++ b/lib/freetype/builds/windows/visualc/index.html @@ -12,7 +12,7 @@ <p>This directory contains project files <tt>freetype.dsp</tt> for Visual C++ 6.0, and <tt>freetype.vcproj</tt> for Visual C++ 2002 through 2008, which you might need to upgrade automatically. -It compiles the following libraries from the FreeType 2.10.2 sources:</p> +It compiles the following libraries from the FreeType 2.10.4 sources:</p> <ul> <li>freetype.dll using 'Release' or 'Debug' configurations</li> diff --git a/lib/freetype/builds/windows/visualce/index.html b/lib/freetype/builds/windows/visualce/index.html index 1501123a2..474e85c37 100644 --- a/lib/freetype/builds/windows/visualce/index.html +++ b/lib/freetype/builds/windows/visualce/index.html @@ -21,7 +21,7 @@ the following targets: <li>PPC/SP WM6 (Windows Mobile 6)</li> </ul> -It compiles the following libraries from the FreeType 2.10.2 sources:</p> +It compiles the following libraries from the FreeType 2.10.4 sources:</p> <ul> <pre> diff --git a/lib/freetype/devel/ftoption.h b/lib/freetype/devel/ftoption.h index c234de391..307d1a382 100644 --- a/lib/freetype/devel/ftoption.h +++ b/lib/freetype/devel/ftoption.h @@ -42,7 +42,7 @@ FT_BEGIN_HEADER * the name of a directory that is included _before_ the FreeType include * path during compilation. * - * The default FreeType Makefiles and Jamfiles use the build directory + * The default FreeType Makefiles use the build directory * `builds/<system>` by default, but you can easily change that for your * own projects. * @@ -121,10 +121,8 @@ FT_BEGIN_HEADER * mitigate color fringes inherent to this technology, you also need to * explicitly set up LCD filtering. * - * Note that this feature is covered by several Microsoft patents and - * should not be activated in any default build of the library. When this - * macro is not defined, FreeType offers alternative LCD rendering - * technology that produces excellent output without LCD filtering. + * When this macro is not defined, FreeType offers alternative LCD + * rendering technology that produces excellent output. */ /* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ @@ -542,7 +540,7 @@ FT_BEGIN_HEADER /************************************************************************** * - * Define `TT_CONFIG_OPTION_COLOR_LAYERS` if you want to support coloured + * Define `TT_CONFIG_OPTION_COLOR_LAYERS` if you want to support colored * outlines (from the 'COLR'/'CPAL' tables) in all formats using the 'sfnt' * module (namely TrueType~& OpenType). */ diff --git a/lib/freetype/docs/CHANGES b/lib/freetype/docs/CHANGES index b0f4304fa..3bd5291ae 100644 --- a/lib/freetype/docs/CHANGES +++ b/lib/freetype/docs/CHANGES @@ -1,3 +1,67 @@ +CHANGES BETWEEN 2.10.3 and 2.10.4 + + I. IMPORTANT BUG FIXES + + - A heap buffer overflow has been found in the handling of embedded + PNG bitmaps, introduced in FreeType version 2.6. + + https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15999 + + If you use option FT_CONFIG_OPTION_USE_PNG you should upgrade + immediately. + + +====================================================================== + +CHANGES BETWEEN 2.10.2 and 2.10.3 + + I. IMPORTANT CHANGES + + - New flag `FT_OUTLINE_OVERLAP'. If set, make the smooth rasterizer + do 4x4 oversampling to mitigate artifacts in pixels partially + covered by overlapping contours. Note that this at least + quadruples the rendering time. + + If a glyph in a TrueType font has the `OVERLAP_SIMPLE' or + `OVERLAP_COMPOUND' bit set, FreeType automatically selects this + rendering mode. + + + II. MISCELLANEOUS + + - Using the arcane method of including FreeType header files with + macros like `FT_FREETYPE_H' is no longer mandatory (but retained + as an optional feature for backward compatibility). + + - Support for building the library with Meson. Building the demo + programs with Meson will follow in a forthcoming release. + + - Minor improvements to the B/W rasterizer. + + - Auto-hinter support for Medefaidrin script. + + - Fix various memory leaks (mainly for CFF) and other issues that + might cause crashes in rare circumstances. + + - Jam support has been removed. + + - In `ftview', custom LCD filter values are now normalized and + balanced. Unorthodox filters are still available through the `-L' + command line option. + + - The GUI demo programs can now be resized. + + - Demo programs that accept command line option `-k' can now handle + function keys, too. The corresponding character codes start with + 0xF1. As an example, the POSIX shell syntax (accepted by bash, + ksh, and zsh) + + -k $'\xF3q' + + emulates the pressing of function key `F3' followed by key `q'. + + +====================================================================== CHANGES BETWEEN 2.10.1 and 2.10.2 @@ -246,7 +310,7 @@ CHANGES BETWEEN 2.9 and 2.9.1 use the `pkg-config' interface. The `configure' script no longer installs `freetype-config' by - default. For backwards compatibility, a new configure option + default. For backward compatibility, a new configure option `--enable-freetype-config' is provided that reverts this decision. diff --git a/lib/freetype/docs/INSTALL.ANY b/lib/freetype/docs/INSTALL.ANY index 58cc22b82..879dddb89 100644 --- a/lib/freetype/docs/INSTALL.ANY +++ b/lib/freetype/docs/INSTALL.ANY @@ -8,13 +8,15 @@ specific environments. I. Standard procedure --------------------- - * DISABLE PRE-COMPILED HEADERS! This is very important for Visual - C++, because FreeType uses lines like: + * If you use macro names for FreeType header files (while mandatory + in earlier versions, this is now optional since FreeType version + 2.10.3) it is necessary to disable pre-compiled headers. This is + very important for Visual C++, because lines like #include FT_FREETYPE_H - which are not correctly supported by this compiler while being ISO - C compliant! + are not correctly supported by this compiler while being ISO C + compliant! * You need to add the directory `include' to your include path when compiling the library. diff --git a/lib/freetype/docs/VERSIONS.TXT b/lib/freetype/docs/VERSIONS.TXT index 1cb5982c4..4e281a725 100644 --- a/lib/freetype/docs/VERSIONS.TXT +++ b/lib/freetype/docs/VERSIONS.TXT @@ -38,7 +38,7 @@ The libtool-specific number does not equal the release number but is tied to it. The release number is available at *compile* time through the -following macros defined in FT_FREETYPE_H: +following macros defined in `freetype.h': - FREETYPE_MAJOR: major release number - FREETYPE_MINOR: minor release number @@ -60,6 +60,8 @@ found on _most_ systems, but not all of them: release libtool so ------------------------------- + 2.10.4 23.4.17 6.17.4 + 2.10.3 23.3.17 6.17.3 2.10.2 23.2.17 6.17.2 2.10.1 23.1.17 6.17.1 2.10.0 23.0.17 6.17.0 @@ -99,7 +101,7 @@ other release numbers. AC_TRY_CPP([ #include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #if FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH < 21002 # error FreeType version too low. diff --git a/lib/freetype/docs/freetype-config.1 b/lib/freetype/docs/freetype-config.1 index ae65e8366..7dea66afa 100644 --- a/lib/freetype/docs/freetype-config.1 +++ b/lib/freetype/docs/freetype-config.1 @@ -1,4 +1,4 @@ -.TH FREETYPE-CONFIG 1 "May 2020" "FreeType 2.10.2" +.TH FREETYPE-CONFIG 1 "October 2020" "FreeType 2.10.4" . . .SH NAME diff --git a/lib/freetype/include/freetype/config/Makefile b/lib/freetype/include/freetype/config/Makefile index 2bc451deb..54f9f29ff 100644 --- a/lib/freetype/include/freetype/config/Makefile +++ b/lib/freetype/include/freetype/config/Makefile @@ -1,7 +1,8 @@ -# $OpenBSD: Makefile,v 1.6 2015/12/25 11:54:40 matthieu Exp $ +# $OpenBSD: Makefile,v 1.7 2020/11/11 09:27:29 matthieu Exp $ .include <bsd.xorg.mk> INCSDIR=${X11BASE}/include/freetype2/freetype/config -INCS= ftheader.h ftmodule.h ftoption.h ftstdlib.h +INCS= ftheader.h ftmodule.h ftoption.h ftstdlib.h \ + integer-types.h mac-support.h public-macros.h diff --git a/lib/freetype/include/freetype/config/ftconfig.h b/lib/freetype/include/freetype/config/ftconfig.h index 14eecefc2..b464e0b78 100644 --- a/lib/freetype/include/freetype/config/ftconfig.h +++ b/lib/freetype/include/freetype/config/ftconfig.h @@ -41,533 +41,9 @@ #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. - * - */ - - - /* 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 - +#include <freetype/config/integer-types.h> +#include <freetype/config/public-macros.h> +#include <freetype/config/mac-support.h> #endif /* FTCONFIG_H_ */ diff --git a/lib/freetype/include/freetype/config/ftheader.h b/lib/freetype/include/freetype/config/ftheader.h index e91598e20..28b5cc60c 100644 --- a/lib/freetype/include/freetype/config/ftheader.h +++ b/lib/freetype/include/freetype/config/ftheader.h @@ -30,10 +30,12 @@ /* encapsulated in an `extern "C" { .. }` block when included from a */ /* C++ compiler. */ /* */ -#ifdef __cplusplus -#define FT_BEGIN_HEADER extern "C" { -#else -#define FT_BEGIN_HEADER /* nothing */ +#ifndef FT_BEGIN_HEADER +# ifdef __cplusplus +# define FT_BEGIN_HEADER extern "C" { +# else +# define FT_BEGIN_HEADER /* nothing */ +# endif #endif @@ -48,10 +50,12 @@ /* encapsulated in an `extern "C" { .. }` block when included from a */ /* C++ compiler. */ /* */ -#ifdef __cplusplus -#define FT_END_HEADER } -#else -#define FT_END_HEADER /* nothing */ +#ifndef FT_END_HEADER +# ifdef __cplusplus +# define FT_END_HEADER } +# else +# define FT_END_HEADER /* nothing */ +# endif #endif @@ -73,9 +77,16 @@ * Macro definitions used to `#include` specific header files. * * @description: - * The following macros are defined to the name of specific FreeType~2 - * header files. They can be used directly in `#include` statements as - * in: + * In addition to the normal scheme of including header files like + * + * ``` + * #include <freetype/freetype.h> + * #include <freetype/ftmm.h> + * #include <freetype/ftglyph.h> + * ``` + * + * it is possible to used named macros instead. They can be used + * directly in `#include` statements as in * * ``` * #include FT_FREETYPE_H @@ -83,13 +94,9 @@ * #include FT_GLYPH_H * ``` * - * There are several reasons why we are now using macros to name public - * header files. The first one is that such macros are not limited to - * the infamous 8.3~naming rule required by DOS (and - * `FT_MULTIPLE_MASTERS_H` is a lot more meaningful than `ftmm.h`). - * - * The second reason is that it allows for more flexibility in the way - * FreeType~2 is installed on a given system. + * These macros were introduced to overcome the infamous 8.3~naming rule + * required by DOS (and `FT_MULTIPLE_MASTERS_H` is a lot more meaningful + * than `ftmm.h`). * */ @@ -797,16 +804,19 @@ #define FT_CACHE_INTERNAL_IMAGE_H FT_CACHE_H #define FT_CACHE_INTERNAL_SBITS_H FT_CACHE_H - - /* - * Include internal headers definitions from `<internal/...>` only when - * building the library. - */ +/* TODO(david): Move this section below to a different header */ #ifdef FT2_BUILD_LIBRARY -#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h> -#include FT_INTERNAL_INTERNAL_H -#endif /* FT2_BUILD_LIBRARY */ +#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */ + /* We disable the warning `conditional expression is constant' here */ + /* in order to compile cleanly with the maximum level of warnings. */ + /* In particular, the warning complains about stuff like `while(0)' */ + /* which is very useful in macro definitions. There is no benefit */ + /* in having it enabled. */ +#pragma warning( disable : 4127 ) + +#endif /* _MSC_VER */ +#endif /* FT2_BUILD_LIBRARY */ #endif /* FTHEADER_H_ */ diff --git a/lib/freetype/include/freetype/config/ftmodule.h b/lib/freetype/include/freetype/config/ftmodule.h index 7c603e532..b5c4b1ee5 100644 --- a/lib/freetype/include/freetype/config/ftmodule.h +++ b/lib/freetype/include/freetype/config/ftmodule.h @@ -25,8 +25,6 @@ FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) -FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) /* EOF */ diff --git a/lib/freetype/include/freetype/config/ftoption.h b/lib/freetype/include/freetype/config/ftoption.h index 426806d2e..43b2d3743 100644 --- a/lib/freetype/include/freetype/config/ftoption.h +++ b/lib/freetype/include/freetype/config/ftoption.h @@ -42,7 +42,7 @@ FT_BEGIN_HEADER * the name of a directory that is included _before_ the FreeType include * path during compilation. * - * The default FreeType Makefiles and Jamfiles use the build directory + * The default FreeType Makefiles use the build directory * `builds/<system>` by default, but you can easily change that for your * own projects. * @@ -121,10 +121,8 @@ FT_BEGIN_HEADER * mitigate color fringes inherent to this technology, you also need to * explicitly set up LCD filtering. * - * Note that this feature is covered by several Microsoft patents and - * should not be activated in any default build of the library. When this - * macro is not defined, FreeType offers alternative LCD rendering - * technology that produces excellent output without LCD filtering. + * When this macro is not defined, FreeType offers alternative LCD + * rendering technology that produces excellent output. */ /* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ @@ -223,7 +221,7 @@ FT_BEGIN_HEADER * options set by those programs have precedence, overwriting the value * here with the configured one. */ -/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ +#define FT_CONFIG_OPTION_SYSTEM_ZLIB /************************************************************************** @@ -542,7 +540,7 @@ FT_BEGIN_HEADER /************************************************************************** * - * Define `TT_CONFIG_OPTION_COLOR_LAYERS` if you want to support coloured + * Define `TT_CONFIG_OPTION_COLOR_LAYERS` if you want to support colored * outlines (from the 'COLR'/'CPAL' tables) in all formats using the 'sfnt' * module (namely TrueType~& OpenType). */ diff --git a/lib/freetype/include/freetype/config/integer-types.h b/lib/freetype/include/freetype/config/integer-types.h new file mode 100644 index 000000000..a0ca0c95e --- /dev/null +++ b/lib/freetype/include/freetype/config/integer-types.h @@ -0,0 +1,245 @@ +/**************************************************************************** + * + * 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/lib/freetype/include/freetype/config/mac-support.h b/lib/freetype/include/freetype/config/mac-support.h new file mode 100644 index 000000000..94867088e --- /dev/null +++ b/lib/freetype/include/freetype/config/mac-support.h @@ -0,0 +1,49 @@ +/**************************************************************************** + * + * 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/lib/freetype/include/freetype/config/public-macros.h b/lib/freetype/include/freetype/config/public-macros.h new file mode 100644 index 000000000..6aa673e80 --- /dev/null +++ b/lib/freetype/include/freetype/config/public-macros.h @@ -0,0 +1,120 @@ +/**************************************************************************** + * + * 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/lib/freetype/include/freetype/freetype.h b/lib/freetype/include/freetype/freetype.h index 973264b12..be191f5aa 100644 --- a/lib/freetype/include/freetype/freetype.h +++ b/lib/freetype/include/freetype/freetype.h @@ -20,19 +20,10 @@ #define FREETYPE_H_ -#ifndef FT_FREETYPE_H -#error "`ft2build.h' hasn't been included yet!" -#error "Please always use macros to include FreeType header files." -#error "Example:" -#error " #include <ft2build.h>" -#error " #include FT_FREETYPE_H" -#endif - - #include <ft2build.h> #include FT_CONFIG_CONFIG_H -#include FT_TYPES_H -#include FT_ERRORS_H +#include <freetype/fttypes.h> +#include <freetype/fterrors.h> FT_BEGIN_HEADER @@ -51,22 +42,15 @@ FT_BEGIN_HEADER * How client applications should include FreeType header files. * * @description: - * To be as flexible as possible (and for historical reasons), FreeType - * uses a very special inclusion scheme to load header files, for example + * To be as flexible as possible (and for historical reasons), you must + * load file `ft2build.h` first before other header files, for example * * ``` * #include <ft2build.h> * - * #include FT_FREETYPE_H - * #include FT_OUTLINE_H + * #include <freetype/freetype.h> + * #include <freetype/ftoutln.h> * ``` - * - * A compiler and its preprocessor only needs an include path to find the - * file `ft2build.h`; the exact locations and names of the other FreeType - * header files are hidden by @header_file_macros, loaded by - * `ft2build.h`. The API documentation always gives the header macro - * name needed for a particular function. - * */ @@ -974,6 +958,9 @@ 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 @@ -3188,6 +3175,12 @@ 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 @@ -3246,14 +3239,6 @@ FT_BEGIN_HEADER * pixels and use the @FT_PIXEL_MODE_LCD_V mode. * * @note: - * Should you define `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` in your - * `ftoption.h`, which enables patented ClearType-style rendering, the - * LCD-optimized glyph bitmaps should be filtered to reduce color fringes - * inherent to this technology. You can either set up LCD filtering with - * @FT_Library_SetLcdFilter or @FT_Face_Properties, or do the filtering - * yourself. The default FreeType LCD rendering technology does not - * require filtering. - * * The selected render mode only affects vector glyphs of a font. * Embedded bitmaps often have a different pixel mode like * @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform them @@ -4089,7 +4074,7 @@ FT_BEGIN_HEADER * https://docs.microsoft.com/en-us/typography/opentype/spec/colr * * The glyph layer data for a given glyph index, if present, provides an - * alternative, multi-colour glyph representation: Instead of rendering + * alternative, multi-color glyph representation: Instead of rendering * the outline or bitmap with the given glyph index, glyphs with the * indices and colors returned by this function are rendered layer by * layer. @@ -4782,7 +4767,7 @@ FT_BEGIN_HEADER */ #define FREETYPE_MAJOR 2 #define FREETYPE_MINOR 10 -#define FREETYPE_PATCH 2 +#define FREETYPE_PATCH 4 /************************************************************************** diff --git a/lib/freetype/include/freetype/ftadvanc.h b/lib/freetype/include/freetype/ftadvanc.h index c30472bfd..f166bc6f9 100644 --- a/lib/freetype/include/freetype/ftadvanc.h +++ b/lib/freetype/include/freetype/ftadvanc.h @@ -20,8 +20,7 @@ #define FTADVANC_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" @@ -96,6 +95,7 @@ FT_BEGIN_HEADER * load_flags :: * A set of bit flags similar to those used when calling * @FT_Load_Glyph, used to determine what kind of advances you need. + * * @output: * padvance :: * The advance value. If scaling is performed (based on the value of diff --git a/lib/freetype/include/freetype/ftbbox.h b/lib/freetype/include/freetype/ftbbox.h index 294f99697..fda1ad94a 100644 --- a/lib/freetype/include/freetype/ftbbox.h +++ b/lib/freetype/include/freetype/ftbbox.h @@ -31,8 +31,7 @@ #define FTBBOX_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftbdf.h b/lib/freetype/include/freetype/ftbdf.h index 61db27c8f..2e1daeeaa 100644 --- a/lib/freetype/include/freetype/ftbdf.h +++ b/lib/freetype/include/freetype/ftbdf.h @@ -19,8 +19,7 @@ #ifndef FTBDF_H_ #define FTBDF_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftbitmap.h b/lib/freetype/include/freetype/ftbitmap.h index 6c5545576..282c22e1c 100644 --- a/lib/freetype/include/freetype/ftbitmap.h +++ b/lib/freetype/include/freetype/ftbitmap.h @@ -20,9 +20,8 @@ #define FTBITMAP_H_ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_COLOR_H +#include <freetype/freetype.h> +#include <freetype/ftcolor.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftbzip2.h b/lib/freetype/include/freetype/ftbzip2.h index cb8e8458e..eb6a5a55d 100644 --- a/lib/freetype/include/freetype/ftbzip2.h +++ b/lib/freetype/include/freetype/ftbzip2.h @@ -19,8 +19,7 @@ #ifndef FTBZIP2_H_ #define FTBZIP2_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" @@ -43,6 +42,16 @@ FT_BEGIN_HEADER * Using bzip2-compressed font files. * * @description: + * In certain builds of the library, bzip2 compression recognition is + * automatically handled when calling @FT_New_Face or @FT_Open_Face. + * This means that if no font driver is capable of handling the raw + * compressed file, the library will try to open a bzip2 compressed + * stream from it and re-open the face with it. + * + * The stream implementation is very basic and resets the decompression + * process each time seeking backwards is needed within the stream, + * which significantly undermines the performance. + * * This section contains the declaration of Bzip2-specific functions. * */ @@ -75,15 +84,6 @@ FT_BEGIN_HEADER * **not** call `FT_Stream_Close` on the source stream. None of the * stream objects will be released to the heap. * - * The stream implementation is very basic and resets the decompression - * process each time seeking backwards is needed within the stream. - * - * In certain builds of the library, bzip2 compression recognition is - * automatically handled when calling @FT_New_Face or @FT_Open_Face. - * This means that if no font driver is capable of handling the raw - * compressed file, the library will try to open a bzip2 compressed - * stream from it and re-open the face with it. - * * This function may return `FT_Err_Unimplemented_Feature` if your build * of FreeType was not compiled with bzip2 support. */ diff --git a/lib/freetype/include/freetype/ftcache.h b/lib/freetype/include/freetype/ftcache.h index d82c4815c..604727520 100644 --- a/lib/freetype/include/freetype/ftcache.h +++ b/lib/freetype/include/freetype/ftcache.h @@ -20,8 +20,7 @@ #define FTCACHE_H_ -#include <ft2build.h> -#include FT_GLYPH_H +#include <freetype/ftglyph.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/ftcid.h b/lib/freetype/include/freetype/ftcid.h index 85b74e004..a29fb3330 100644 --- a/lib/freetype/include/freetype/ftcid.h +++ b/lib/freetype/include/freetype/ftcid.h @@ -19,8 +19,7 @@ #ifndef FTCID_H_ #define FTCID_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftcolor.h b/lib/freetype/include/freetype/ftcolor.h index b744939dd..ecc6485e5 100644 --- a/lib/freetype/include/freetype/ftcolor.h +++ b/lib/freetype/include/freetype/ftcolor.h @@ -19,8 +19,7 @@ #ifndef FTCOLOR_H_ #define FTCOLOR_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftdriver.h b/lib/freetype/include/freetype/ftdriver.h index 19b666ecb..804ec34a3 100644 --- a/lib/freetype/include/freetype/ftdriver.h +++ b/lib/freetype/include/freetype/ftdriver.h @@ -19,9 +19,8 @@ #ifndef FTDRIVER_H_ #define FTDRIVER_H_ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_PARAMETER_TAGS_H +#include <freetype/freetype.h> +#include <freetype/ftparams.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" @@ -427,10 +426,6 @@ 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/lib/freetype/include/freetype/fterrors.h b/lib/freetype/include/freetype/fterrors.h index 771bc5db5..60a637c77 100644 --- a/lib/freetype/include/freetype/fterrors.h +++ b/lib/freetype/include/freetype/fterrors.h @@ -89,7 +89,7 @@ * const char* err_msg; * } ft_errors[] = * - * #include FT_ERRORS_H + * #include <freetype/fterrors.h> * ``` * * An alternative to using an array is a switch statement. @@ -124,7 +124,7 @@ /* include module base error codes */ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> /*******************************************************************/ @@ -197,7 +197,7 @@ /* now include the error codes */ -#include FT_ERROR_DEFINITIONS_H +#include <freetype/fterrdef.h> #ifdef FT_ERROR_END_LIST @@ -232,11 +232,16 @@ #undef FT_ERR_PREFIX #endif - /* FT_INCLUDE_ERR_PROTOS: Control if function prototypes should be */ - /* included with `#include FT_ERRORS_H'. This is */ - /* only true where `FT_ERRORDEF` is undefined. */ - /* FT_ERR_PROTOS_DEFINED: Actual multiple-inclusion protection of */ - /* `fterrors.h`. */ + /* FT_INCLUDE_ERR_PROTOS: Control whether function prototypes should be */ + /* included with */ + /* */ + /* #include <freetype/fterrors.h> */ + /* */ + /* This is only true where `FT_ERRORDEF` is */ + /* undefined. */ + /* */ + /* FT_ERR_PROTOS_DEFINED: Actual multiple-inclusion protection of */ + /* `fterrors.h`. */ #ifdef FT_INCLUDE_ERR_PROTOS #undef FT_INCLUDE_ERR_PROTOS diff --git a/lib/freetype/include/freetype/ftfntfmt.h b/lib/freetype/include/freetype/ftfntfmt.h index ad5a1d416..f803349cd 100644 --- a/lib/freetype/include/freetype/ftfntfmt.h +++ b/lib/freetype/include/freetype/ftfntfmt.h @@ -19,8 +19,7 @@ #ifndef FTFNTFMT_H_ #define FTFNTFMT_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftgasp.h b/lib/freetype/include/freetype/ftgasp.h index aca1a1329..6b76882c7 100644 --- a/lib/freetype/include/freetype/ftgasp.h +++ b/lib/freetype/include/freetype/ftgasp.h @@ -19,8 +19,7 @@ #ifndef FTGASP_H_ #define FTGASP_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftglyph.h b/lib/freetype/include/freetype/ftglyph.h index ec515a369..704619e3d 100644 --- a/lib/freetype/include/freetype/ftglyph.h +++ b/lib/freetype/include/freetype/ftglyph.h @@ -33,8 +33,7 @@ #define FTGLYPH_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftgxval.h b/lib/freetype/include/freetype/ftgxval.h index 691a73b94..354460a9a 100644 --- a/lib/freetype/include/freetype/ftgxval.h +++ b/lib/freetype/include/freetype/ftgxval.h @@ -28,8 +28,7 @@ #ifndef FTGXVAL_H_ #define FTGXVAL_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftgzip.h b/lib/freetype/include/freetype/ftgzip.h index f588c8503..ec5939a19 100644 --- a/lib/freetype/include/freetype/ftgzip.h +++ b/lib/freetype/include/freetype/ftgzip.h @@ -19,8 +19,7 @@ #ifndef FTGZIP_H_ #define FTGZIP_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" @@ -43,6 +42,16 @@ FT_BEGIN_HEADER * Using gzip-compressed font files. * * @description: + * In certain builds of the library, gzip compression recognition is + * automatically handled when calling @FT_New_Face or @FT_Open_Face. + * This means that if no font driver is capable of handling the raw + * compressed file, the library will try to open a gzipped stream from it + * and re-open the face with it. + * + * The stream implementation is very basic and resets the decompression + * process each time seeking backwards is needed within the stream, + * which significantly undermines the performance. + * * This section contains the declaration of Gzip-specific functions. * */ @@ -75,15 +84,6 @@ FT_BEGIN_HEADER * **not** call `FT_Stream_Close` on the source stream. None of the * stream objects will be released to the heap. * - * The stream implementation is very basic and resets the decompression - * process each time seeking backwards is needed within the stream. - * - * In certain builds of the library, gzip compression recognition is - * automatically handled when calling @FT_New_Face or @FT_Open_Face. - * This means that if no font driver is capable of handling the raw - * compressed file, the library will try to open a gzipped stream from it - * and re-open the face with it. - * * This function may return `FT_Err_Unimplemented_Feature` if your build * of FreeType was not compiled with zlib support. */ diff --git a/lib/freetype/include/freetype/ftimage.h b/lib/freetype/include/freetype/ftimage.h index 185967c1b..74911620d 100644 --- a/lib/freetype/include/freetype/ftimage.h +++ b/lib/freetype/include/freetype/ftimage.h @@ -30,7 +30,6 @@ /* STANDALONE_ is from ftgrays.c */ #ifndef STANDALONE_ -#include <ft2build.h> #endif @@ -401,6 +400,13 @@ 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 + * mitigate 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. @@ -432,6 +438,7 @@ FT_BEGIN_HEADER #define FT_OUTLINE_IGNORE_DROPOUTS 0x8 #define FT_OUTLINE_SMART_DROPOUTS 0x10 #define FT_OUTLINE_INCLUDE_STUBS 0x20 +#define FT_OUTLINE_OVERLAP 0x40 #define FT_OUTLINE_HIGH_PRECISION 0x100 #define FT_OUTLINE_SINGLE_PASS 0x200 @@ -1004,20 +1011,26 @@ FT_BEGIN_HEADER * User-supplied data that is passed to each drawing callback. * * clip_box :: - * An optional clipping box. It is only used in direct rendering mode. - * Note that coordinates here should be expressed in _integer_ pixels - * (and not in 26.6 fixed-point units). + * An optional span clipping box expressed in _integer_ pixels + * (not in 26.6 fixed-point units). * * @note: - * An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA bit - * flag is set in the `flags` field, otherwise a monochrome bitmap is - * generated. - * - * If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags`, the raster - * will call the `gray_spans` callback to draw gray pixel spans. This - * allows direct composition over a pre-existing bitmap through - * user-provided callbacks to perform the span drawing and composition. - * Not supported by the monochrome rasterizer. + * The @FT_RASTER_FLAG_AA bit flag must be set in the `flags` to + * generate an anti-aliased glyph bitmap, otherwise a monochrome bitmap + * is generated. The `target` should have appropriate pixel mode and its + * dimensions define the clipping region. + * + * If both @FT_RASTER_FLAG_AA and @FT_RASTER_FLAG_DIRECT bit flags + * are set in `flags`, the raster calls an @FT_SpanFunc callback + * `gray_spans` with `user` data as an argument ignoring `target`. This + * allows direct composition over a pre-existing user surface to perform + * the span drawing and composition. To optionally clip the spans, set + * the @FT_RASTER_FLAG_CLIP flag and `clip_box`. The monochrome raster + * does not support the direct mode. + * + * The gray-level rasterizer always uses 256 gray levels. If you want + * fewer gray levels, you have to use @FT_RASTER_FLAG_DIRECT and reduce + * the levels in the callback function. */ typedef struct FT_Raster_Params_ { diff --git a/lib/freetype/include/freetype/ftincrem.h b/lib/freetype/include/freetype/ftincrem.h index 8c00cfe41..f67655eda 100644 --- a/lib/freetype/include/freetype/ftincrem.h +++ b/lib/freetype/include/freetype/ftincrem.h @@ -19,9 +19,8 @@ #ifndef FTINCREM_H_ #define FTINCREM_H_ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_PARAMETER_TAGS_H +#include <freetype/freetype.h> +#include <freetype/ftparams.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftlcdfil.h b/lib/freetype/include/freetype/ftlcdfil.h index c5516d0e0..c6995f2ff 100644 --- a/lib/freetype/include/freetype/ftlcdfil.h +++ b/lib/freetype/include/freetype/ftlcdfil.h @@ -20,9 +20,8 @@ #ifndef FTLCDFIL_H_ #define FTLCDFIL_H_ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_PARAMETER_TAGS_H +#include <freetype/freetype.h> +#include <freetype/ftparams.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" @@ -47,7 +46,7 @@ FT_BEGIN_HEADER * @description: * FreeType provides two alternative subpixel rendering technologies. * Should you define `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` in your - * `ftoption.h` file, this enables patented ClearType-style rendering. + * `ftoption.h` file, this enables ClearType-style rendering. * Otherwise, Harmony LCD rendering is enabled. These technologies are * controlled differently and API described below, although always * available, performs its function when appropriate method is enabled @@ -177,7 +176,7 @@ FT_BEGIN_HEADER * FT_Library_SetLcdFilter * * @description: - * This function is used to apply color filtering to LCD decimated + * This function is used to change filter applied to LCD decimated * bitmaps, like the ones used when calling @FT_Render_Glyph with * @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V. * @@ -196,15 +195,14 @@ FT_BEGIN_HEADER * FreeType error code. 0~means success. * * @note: - * This feature is always disabled by default. Clients must make an - * explicit call to this function with a `filter` value other than - * @FT_LCD_FILTER_NONE in order to enable it. + * Since 2.10.3 the LCD filtering is enabled with @FT_LCD_FILTER_DEFAULT. + * It is no longer necessary to call this function explicitly except + * to choose a different filter or disable filtering altogether with + * @FT_LCD_FILTER_NONE. * - * Due to **PATENTS** covering subpixel rendering, this function doesn't - * do anything except returning `FT_Err_Unimplemented_Feature` if the - * configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is not - * defined in your build of the library, which should correspond to all - * default builds of FreeType. + * This function does nothing but returns `FT_Err_Unimplemented_Feature` + * if the configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is + * not defined in your build of the library. * * @since: * 2.3.0 @@ -235,11 +233,9 @@ FT_BEGIN_HEADER * FreeType error code. 0~means success. * * @note: - * Due to **PATENTS** covering subpixel rendering, this function doesn't - * do anything except returning `FT_Err_Unimplemented_Feature` if the - * configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is not - * defined in your build of the library, which should correspond to all - * default builds of FreeType. + * This function does nothing but returns `FT_Err_Unimplemented_Feature` + * if the configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is + * not defined in your build of the library. * * LCD filter weights can also be set per face using @FT_Face_Properties * with @FT_PARAM_TAG_LCD_FILTER_WEIGHTS. diff --git a/lib/freetype/include/freetype/ftlist.h b/lib/freetype/include/freetype/ftlist.h index 3f6079f24..458892270 100644 --- a/lib/freetype/include/freetype/ftlist.h +++ b/lib/freetype/include/freetype/ftlist.h @@ -28,8 +28,7 @@ #define FTLIST_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftlzw.h b/lib/freetype/include/freetype/ftlzw.h index 37a53c1b3..ae46ad602 100644 --- a/lib/freetype/include/freetype/ftlzw.h +++ b/lib/freetype/include/freetype/ftlzw.h @@ -19,8 +19,7 @@ #ifndef FTLZW_H_ #define FTLZW_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" @@ -43,6 +42,16 @@ FT_BEGIN_HEADER * Using LZW-compressed font files. * * @description: + * In certain builds of the library, LZW compression recognition is + * automatically handled when calling @FT_New_Face or @FT_Open_Face. + * This means that if no font driver is capable of handling the raw + * compressed file, the library will try to open a LZW stream from it and + * re-open the face with it. + * + * The stream implementation is very basic and resets the decompression + * process each time seeking backwards is needed within the stream, + * which significantly undermines the performance. + * * This section contains the declaration of LZW-specific functions. * */ @@ -73,15 +82,6 @@ FT_BEGIN_HEADER * **not** call `FT_Stream_Close` on the source stream. None of the * stream objects will be released to the heap. * - * The stream implementation is very basic and resets the decompression - * process each time seeking backwards is needed within the stream - * - * In certain builds of the library, LZW compression recognition is - * automatically handled when calling @FT_New_Face or @FT_Open_Face. - * This means that if no font driver is capable of handling the raw - * compressed file, the library will try to open a LZW stream from it and - * re-open the face with it. - * * This function may return `FT_Err_Unimplemented_Feature` if your build * of FreeType was not compiled with LZW support. */ diff --git a/lib/freetype/include/freetype/ftmac.h b/lib/freetype/include/freetype/ftmac.h index c1a0aa373..c9de98184 100644 --- a/lib/freetype/include/freetype/ftmac.h +++ b/lib/freetype/include/freetype/ftmac.h @@ -29,7 +29,6 @@ #define FTMAC_H_ -#include <ft2build.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/ftmm.h b/lib/freetype/include/freetype/ftmm.h index 0d839942b..d8781a829 100644 --- a/lib/freetype/include/freetype/ftmm.h +++ b/lib/freetype/include/freetype/ftmm.h @@ -20,8 +20,7 @@ #define FTMM_H_ -#include <ft2build.h> -#include FT_TYPE1_TABLES_H +#include <freetype/t1tables.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/ftmodapi.h b/lib/freetype/include/freetype/ftmodapi.h index 01cb5fba8..3f7ae82ba 100644 --- a/lib/freetype/include/freetype/ftmodapi.h +++ b/lib/freetype/include/freetype/ftmodapi.h @@ -20,8 +20,7 @@ #define FTMODAPI_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" @@ -65,7 +64,7 @@ FT_BEGIN_HEADER * psnames * raster1 * sfnt - * smooth, smooth-lcd, smooth-lcdv + * smooth * truetype * type1 * type42 @@ -486,7 +485,7 @@ FT_BEGIN_HEADER * * ``` * FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ - * cff:no-stem-darkening=1 \ + * cff:no-stem-darkening=0 \ * autofitter:warping=1 * ``` * diff --git a/lib/freetype/include/freetype/ftmoderr.h b/lib/freetype/include/freetype/ftmoderr.h index 5e6aeeb43..f05fc53aa 100644 --- a/lib/freetype/include/freetype/ftmoderr.h +++ b/lib/freetype/include/freetype/ftmoderr.h @@ -94,7 +94,7 @@ * const char* mod_err_msg * } ft_mod_errors[] = * - * #include FT_MODULE_ERRORS_H + * #include <freetype/ftmoderr.h> * ``` * */ diff --git a/lib/freetype/include/freetype/ftotval.h b/lib/freetype/include/freetype/ftotval.h index 6f46c414b..9c00ad30b 100644 --- a/lib/freetype/include/freetype/ftotval.h +++ b/lib/freetype/include/freetype/ftotval.h @@ -30,8 +30,7 @@ #ifndef FTOTVAL_H_ #define FTOTVAL_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftoutln.h b/lib/freetype/include/freetype/ftoutln.h index fa295b0ab..84e9b144c 100644 --- a/lib/freetype/include/freetype/ftoutln.h +++ b/lib/freetype/include/freetype/ftoutln.h @@ -21,8 +21,7 @@ #define FTOUTLN_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" @@ -483,19 +482,13 @@ FT_BEGIN_HEADER * FreeType error code. 0~means success. * * @note: - * This advanced function uses @FT_Raster_Params as an argument, - * allowing FreeType rasterizer to be used for direct composition, - * translucency, etc. You should know how to set up @FT_Raster_Params - * for this function to work. - * + * This advanced function uses @FT_Raster_Params as an argument. * The field `params.source` will be set to `outline` before the scan * converter is called, which means that the value you give to it is - * actually ignored. - * - * The gray-level rasterizer always uses 256 gray levels. If you want - * less gray levels, you have to provide your own span callback. See the - * @FT_RASTER_FLAG_DIRECT value of the `flags` field in the - * @FT_Raster_Params structure for more details. + * actually ignored. Either `params.target` must point to preallocated + * bitmap, or @FT_RASTER_FLAG_DIRECT must be set in `params.flags` + * allowing FreeType rasterizer to be used for direct composition, + * translucency, etc. See @FT_Raster_Params for more details. */ FT_EXPORT( FT_Error ) FT_Outline_Render( FT_Library library, diff --git a/lib/freetype/include/freetype/ftparams.h b/lib/freetype/include/freetype/ftparams.h index 255c6bb16..55ea2a387 100644 --- a/lib/freetype/include/freetype/ftparams.h +++ b/lib/freetype/include/freetype/ftparams.h @@ -19,8 +19,7 @@ #ifndef FTPARAMS_H_ #define FTPARAMS_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftpfr.h b/lib/freetype/include/freetype/ftpfr.h index 58fbbb78d..9a5383f91 100644 --- a/lib/freetype/include/freetype/ftpfr.h +++ b/lib/freetype/include/freetype/ftpfr.h @@ -19,8 +19,7 @@ #ifndef FTPFR_H_ #define FTPFR_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftrender.h b/lib/freetype/include/freetype/ftrender.h index 684511190..8007951b3 100644 --- a/lib/freetype/include/freetype/ftrender.h +++ b/lib/freetype/include/freetype/ftrender.h @@ -20,9 +20,8 @@ #define FTRENDER_H_ -#include <ft2build.h> -#include FT_MODULE_H -#include FT_GLYPH_H +#include <freetype/ftmodapi.h> +#include <freetype/ftglyph.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/ftsizes.h b/lib/freetype/include/freetype/ftsizes.h index 7dc929521..a8682a30f 100644 --- a/lib/freetype/include/freetype/ftsizes.h +++ b/lib/freetype/include/freetype/ftsizes.h @@ -29,8 +29,7 @@ #define FTSIZES_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftsnames.h b/lib/freetype/include/freetype/ftsnames.h index 298276063..729e6ab06 100644 --- a/lib/freetype/include/freetype/ftsnames.h +++ b/lib/freetype/include/freetype/ftsnames.h @@ -23,9 +23,8 @@ #define FTSNAMES_H_ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_PARAMETER_TAGS_H +#include <freetype/freetype.h> +#include <freetype/ftparams.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftstroke.h b/lib/freetype/include/freetype/ftstroke.h index 141af7d0b..a759c94dd 100644 --- a/lib/freetype/include/freetype/ftstroke.h +++ b/lib/freetype/include/freetype/ftstroke.h @@ -19,9 +19,8 @@ #ifndef FTSTROKE_H_ #define FTSTROKE_H_ -#include <ft2build.h> -#include FT_OUTLINE_H -#include FT_GLYPH_H +#include <freetype/ftoutln.h> +#include <freetype/ftglyph.h> FT_BEGIN_HEADER @@ -44,7 +43,7 @@ FT_BEGIN_HEADER * borders of the stroke. * * This can be useful to generate 'bordered' glyph, i.e., glyphs - * displayed with a coloured (and anti-aliased) border around their + * displayed with a colored (and anti-aliased) border around their * shape. * * @order: diff --git a/lib/freetype/include/freetype/ftsynth.h b/lib/freetype/include/freetype/ftsynth.h index 3882e69e6..bdb4c5753 100644 --- a/lib/freetype/include/freetype/ftsynth.h +++ b/lib/freetype/include/freetype/ftsynth.h @@ -45,8 +45,7 @@ #define FTSYNTH_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ftsystem.h b/lib/freetype/include/freetype/ftsystem.h index f7fecb53f..22aead714 100644 --- a/lib/freetype/include/freetype/ftsystem.h +++ b/lib/freetype/include/freetype/ftsystem.h @@ -20,7 +20,6 @@ #define FTSYSTEM_H_ -#include <ft2build.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/fttrigon.h b/lib/freetype/include/freetype/fttrigon.h index 968df1fbf..2ce6b324c 100644 --- a/lib/freetype/include/freetype/fttrigon.h +++ b/lib/freetype/include/freetype/fttrigon.h @@ -19,7 +19,7 @@ #ifndef FTTRIGON_H_ #define FTTRIGON_H_ -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/fttypes.h b/lib/freetype/include/freetype/fttypes.h index cb785d98b..aaeb9e878 100644 --- a/lib/freetype/include/freetype/fttypes.h +++ b/lib/freetype/include/freetype/fttypes.h @@ -22,8 +22,8 @@ #include <ft2build.h> #include FT_CONFIG_CONFIG_H -#include FT_SYSTEM_H -#include FT_IMAGE_H +#include <freetype/ftsystem.h> +#include <freetype/ftimage.h> #include <stddef.h> diff --git a/lib/freetype/include/freetype/ftwinfnt.h b/lib/freetype/include/freetype/ftwinfnt.h index bacb8aa37..786528c6e 100644 --- a/lib/freetype/include/freetype/ftwinfnt.h +++ b/lib/freetype/include/freetype/ftwinfnt.h @@ -19,8 +19,7 @@ #ifndef FTWINFNT_H_ #define FTWINFNT_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/internal/autohint.h b/lib/freetype/include/freetype/internal/autohint.h index 438f9c175..2a472e20b 100644 --- a/lib/freetype/include/freetype/internal/autohint.h +++ b/lib/freetype/include/freetype/internal/autohint.h @@ -70,8 +70,7 @@ */ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> FT_BEGIN_HEADER @@ -208,6 +207,9 @@ 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/lib/freetype/include/freetype/internal/cffotypes.h b/lib/freetype/include/freetype/internal/cffotypes.h index 207eeda5f..a316fd1f3 100644 --- a/lib/freetype/include/freetype/internal/cffotypes.h +++ b/lib/freetype/include/freetype/internal/cffotypes.h @@ -19,12 +19,11 @@ #ifndef CFFOTYPES_H_ #define CFFOTYPES_H_ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_CFF_TYPES_H -#include FT_INTERNAL_TRUETYPE_TYPES_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/cfftypes.h> +#include <freetype/internal/tttypes.h> +#include <freetype/internal/services/svpscmap.h> +#include <freetype/internal/pshints.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/cfftypes.h b/lib/freetype/include/freetype/internal/cfftypes.h index 40b0fc73c..f21167b1e 100644 --- a/lib/freetype/include/freetype/internal/cfftypes.h +++ b/lib/freetype/include/freetype/internal/cfftypes.h @@ -21,13 +21,12 @@ #define CFFTYPES_H_ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_TYPE1_TABLES_H -#include FT_INTERNAL_SERVICE_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H -#include FT_INTERNAL_TYPE1_TYPES_H +#include <freetype/freetype.h> +#include <freetype/t1tables.h> +#include <freetype/internal/ftserv.h> +#include <freetype/internal/services/svpscmap.h> +#include <freetype/internal/pshints.h> +#include <freetype/internal/t1types.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/compiler-macros.h b/lib/freetype/include/freetype/internal/compiler-macros.h new file mode 100644 index 000000000..97c18d3a2 --- /dev/null +++ b/lib/freetype/include/freetype/internal/compiler-macros.h @@ -0,0 +1,307 @@ +/**************************************************************************** + * + * 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/lib/freetype/include/freetype/internal/ftcalc.h b/lib/freetype/include/freetype/internal/ftcalc.h index 3054a4c49..c65307472 100644 --- a/lib/freetype/include/freetype/internal/ftcalc.h +++ b/lib/freetype/include/freetype/internal/ftcalc.h @@ -20,9 +20,9 @@ #define FTCALC_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> +#include "compiler-macros.h" FT_BEGIN_HEADER @@ -449,8 +449,7 @@ 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 >= 0 ? ( ( (x) + 32 ) & -64 ) \ - : ( -( ( 32 - (x) ) & -64 ) ) ) +#define ROUND_F26DOT6( x ) ( ( (x) + 32 - ( x < 0 ) ) & -64 ) /* * The following macros have two purposes. diff --git a/lib/freetype/include/freetype/internal/ftdebug.h b/lib/freetype/include/freetype/internal/ftdebug.h index 00d258e64..df5357ad5 100644 --- a/lib/freetype/include/freetype/internal/ftdebug.h +++ b/lib/freetype/include/freetype/internal/ftdebug.h @@ -27,7 +27,9 @@ #include <ft2build.h> #include FT_CONFIG_CONFIG_H -#include FT_FREETYPE_H +#include <freetype/freetype.h> + +#include "compiler-macros.h" FT_BEGIN_HEADER @@ -56,7 +58,7 @@ FT_BEGIN_HEADER /* defining the enumeration */ typedef enum FT_Trace_ { -#include FT_INTERNAL_TRACE_H +#include <freetype/internal/fttrace.h> trace_count } FT_Trace; diff --git a/lib/freetype/include/freetype/internal/ftdrv.h b/lib/freetype/include/freetype/internal/ftdrv.h index 1dd9206c8..7f22710ea 100644 --- a/lib/freetype/include/freetype/internal/ftdrv.h +++ b/lib/freetype/include/freetype/internal/ftdrv.h @@ -20,9 +20,9 @@ #define FTDRV_H_ -#include <ft2build.h> -#include FT_MODULE_H +#include <freetype/ftmodapi.h> +#include "compiler-macros.h" FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/ftgloadr.h b/lib/freetype/include/freetype/internal/ftgloadr.h index 6f3793b1c..27b8659f7 100644 --- a/lib/freetype/include/freetype/internal/ftgloadr.h +++ b/lib/freetype/include/freetype/internal/ftgloadr.h @@ -20,8 +20,7 @@ #define FTGLOADR_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> FT_BEGIN_HEADER @@ -138,8 +137,6 @@ FT_BEGIN_HEADER FT_BASE( void ) FT_GlyphLoader_Add( FT_GlyphLoader loader ); - /* */ - FT_END_HEADER diff --git a/lib/freetype/include/freetype/internal/fthash.h b/lib/freetype/include/freetype/internal/fthash.h index 249188040..622ec76bb 100644 --- a/lib/freetype/include/freetype/internal/fthash.h +++ b/lib/freetype/include/freetype/internal/fthash.h @@ -43,8 +43,7 @@ #define FTHASH_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/ftmemory.h b/lib/freetype/include/freetype/internal/ftmemory.h index e0758c127..ddb18b051 100644 --- a/lib/freetype/include/freetype/internal/ftmemory.h +++ b/lib/freetype/include/freetype/internal/ftmemory.h @@ -22,8 +22,9 @@ #include <ft2build.h> #include FT_CONFIG_CONFIG_H -#include FT_TYPES_H +#include <freetype/fttypes.h> +#include "compiler-macros.h" FT_BEGIN_HEADER @@ -389,8 +390,6 @@ extern "C++" #define FT_STRCPYN( dst, src, size ) \ ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) ) - /* */ - FT_END_HEADER diff --git a/lib/freetype/include/freetype/internal/ftobjs.h b/lib/freetype/include/freetype/internal/ftobjs.h index 140eebc7c..25db2c494 100644 --- a/lib/freetype/include/freetype/internal/ftobjs.h +++ b/lib/freetype/include/freetype/internal/ftobjs.h @@ -26,21 +26,21 @@ #ifndef FTOBJS_H_ #define FTOBJS_H_ -#include <ft2build.h> -#include FT_RENDER_H -#include FT_SIZES_H -#include FT_LCD_FILTER_H -#include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_GLYPH_LOADER_H -#include FT_INTERNAL_DRIVER_H -#include FT_INTERNAL_AUTOHINT_H -#include FT_INTERNAL_SERVICE_H -#include FT_INTERNAL_CALC_H +#include <freetype/ftrender.h> +#include <freetype/ftsizes.h> +#include <freetype/ftlcdfil.h> +#include <freetype/internal/ftmemory.h> +#include <freetype/internal/ftgloadr.h> +#include <freetype/internal/ftdrv.h> +#include <freetype/internal/autohint.h> +#include <freetype/internal/ftserv.h> +#include <freetype/internal/ftcalc.h> #ifdef FT_CONFIG_OPTION_INCREMENTAL -#include FT_INCREMENTAL_H +#include <freetype/ftincrem.h> #endif +#include "compiler-macros.h" FT_BEGIN_HEADER @@ -226,8 +226,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_, \ @@ -653,7 +653,7 @@ FT_BEGIN_HEADER FT_BASE( void ) FT_Done_GlyphSlot( FT_GlyphSlot slot ); - /* */ + /* */ #define FT_REQUEST_WIDTH( req ) \ ( (req)->horiResolution \ @@ -1057,6 +1057,9 @@ 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/lib/freetype/include/freetype/internal/ftpsprop.h b/lib/freetype/include/freetype/internal/ftpsprop.h index 72907c4c3..81ec29151 100644 --- a/lib/freetype/include/freetype/internal/ftpsprop.h +++ b/lib/freetype/include/freetype/internal/ftpsprop.h @@ -20,8 +20,7 @@ #define FTPSPROP_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/ftrfork.h b/lib/freetype/include/freetype/internal/ftrfork.h index 9a275a515..1b7b25acb 100644 --- a/lib/freetype/include/freetype/internal/ftrfork.h +++ b/lib/freetype/include/freetype/internal/ftrfork.h @@ -25,8 +25,7 @@ #define FTRFORK_H_ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftobjs.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/ftserv.h b/lib/freetype/include/freetype/internal/ftserv.h index bcaf4720d..6e1a9472d 100644 --- a/lib/freetype/include/freetype/internal/ftserv.h +++ b/lib/freetype/include/freetype/internal/ftserv.h @@ -31,6 +31,7 @@ #ifndef FTSERV_H_ #define FTSERV_H_ +#include "compiler-macros.h" FT_BEGIN_HEADER @@ -486,33 +487,6 @@ FT_BEGIN_HEADER /* */ - /* - * The header files containing the services. - */ - -#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h> -#define FT_SERVICE_CFF_TABLE_LOAD_H <freetype/internal/services/svcfftl.h> -#define FT_SERVICE_CID_H <freetype/internal/services/svcid.h> -#define FT_SERVICE_FONT_FORMAT_H <freetype/internal/services/svfntfmt.h> -#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h> -#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h> -#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h> -#define FT_SERVICE_METRICS_VARIATIONS_H <freetype/internal/services/svmetric.h> -#define FT_SERVICE_MULTIPLE_MASTERS_H <freetype/internal/services/svmm.h> -#define FT_SERVICE_OPENTYPE_VALIDATE_H <freetype/internal/services/svotval.h> -#define FT_SERVICE_PFR_H <freetype/internal/services/svpfr.h> -#define FT_SERVICE_POSTSCRIPT_CMAPS_H <freetype/internal/services/svpscmap.h> -#define FT_SERVICE_POSTSCRIPT_INFO_H <freetype/internal/services/svpsinfo.h> -#define FT_SERVICE_POSTSCRIPT_NAME_H <freetype/internal/services/svpostnm.h> -#define FT_SERVICE_PROPERTIES_H <freetype/internal/services/svprop.h> -#define FT_SERVICE_SFNT_H <freetype/internal/services/svsfnt.h> -#define FT_SERVICE_TRUETYPE_ENGINE_H <freetype/internal/services/svtteng.h> -#define FT_SERVICE_TRUETYPE_GLYF_H <freetype/internal/services/svttglyf.h> -#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h> -#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h> - - /* */ - FT_END_HEADER #endif /* FTSERV_H_ */ diff --git a/lib/freetype/include/freetype/internal/ftstream.h b/lib/freetype/include/freetype/internal/ftstream.h index f3b3ef0d0..e7d922260 100644 --- a/lib/freetype/include/freetype/internal/ftstream.h +++ b/lib/freetype/include/freetype/internal/ftstream.h @@ -21,8 +21,8 @@ #include <ft2build.h> -#include FT_SYSTEM_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/ftsystem.h> +#include <freetype/internal/ftobjs.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/ftvalid.h b/lib/freetype/include/freetype/internal/ftvalid.h index 62aea4dc6..a5bc6c9b5 100644 --- a/lib/freetype/include/freetype/internal/ftvalid.h +++ b/lib/freetype/include/freetype/internal/ftvalid.h @@ -20,8 +20,9 @@ #define FTVALID_H_ #include <ft2build.h> -#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_setjmp and ft_longjmp */ +#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_jmpbuf */ +#include "compiler-macros.h" FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/internal.h b/lib/freetype/include/freetype/internal/internal.h deleted file mode 100644 index 766bf64c2..000000000 --- a/lib/freetype/include/freetype/internal/internal.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** - * - * internal.h - * - * Internal header files (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 file is automatically included by `ft2build.h`. Do not include it - * manually! - * - */ - - -#define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h> -#define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h> -#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h> -#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h> -#define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h> -#define FT_INTERNAL_HASH_H <freetype/internal/fthash.h> -#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdrv.h> -#define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h> -#define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h> -#define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h> -#define FT_INTERNAL_SERVICE_H <freetype/internal/ftserv.h> -#define FT_INTERNAL_RFORK_H <freetype/internal/ftrfork.h> -#define FT_INTERNAL_VALIDATE_H <freetype/internal/ftvalid.h> - -#define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h> -#define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h> -#define FT_INTERNAL_WOFF_TYPES_H <freetype/internal/wofftypes.h> - -#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h> -#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h> -#define FT_INTERNAL_POSTSCRIPT_PROPS_H <freetype/internal/ftpsprop.h> - -#define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h> - -#define FT_INTERNAL_CFF_TYPES_H <freetype/internal/cfftypes.h> -#define FT_INTERNAL_CFF_OBJECTS_TYPES_H <freetype/internal/cffotypes.h> - - -#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */ - - /* We disable the warning `conditional expression is constant' here */ - /* in order to compile cleanly with the maximum level of warnings. */ - /* In particular, the warning complains about stuff like `while(0)' */ - /* which is very useful in macro definitions. There is no benefit */ - /* in having it enabled. */ -#pragma warning( disable : 4127 ) - -#endif /* _MSC_VER */ - - -/* END */ diff --git a/lib/freetype/include/freetype/internal/psaux.h b/lib/freetype/include/freetype/internal/psaux.h index 8248a0ecd..8e0a262fd 100644 --- a/lib/freetype/include/freetype/internal/psaux.h +++ b/lib/freetype/include/freetype/internal/psaux.h @@ -21,14 +21,13 @@ #define PSAUX_H_ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_TYPE1_TYPES_H -#include FT_INTERNAL_HASH_H -#include FT_INTERNAL_TRUETYPE_TYPES_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_INTERNAL_CFF_TYPES_H -#include FT_INTERNAL_CFF_OBJECTS_TYPES_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/t1types.h> +#include <freetype/internal/fthash.h> +#include <freetype/internal/tttypes.h> +#include <freetype/internal/services/svpscmap.h> +#include <freetype/internal/cfftypes.h> +#include <freetype/internal/cffotypes.h> diff --git a/lib/freetype/include/freetype/internal/pshints.h b/lib/freetype/include/freetype/internal/pshints.h index cf0c65298..663e9d348 100644 --- a/lib/freetype/include/freetype/internal/pshints.h +++ b/lib/freetype/include/freetype/internal/pshints.h @@ -22,9 +22,8 @@ #define PSHINTS_H_ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_TYPE1_TABLES_H +#include <freetype/freetype.h> +#include <freetype/t1tables.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svbdf.h b/lib/freetype/include/freetype/internal/services/svbdf.h index 0ec9c7ccb..81f5a06b6 100644 --- a/lib/freetype/include/freetype/internal/services/svbdf.h +++ b/lib/freetype/include/freetype/internal/services/svbdf.h @@ -19,8 +19,8 @@ #ifndef SVBDF_H_ #define SVBDF_H_ -#include FT_BDF_H -#include FT_INTERNAL_SERVICE_H +#include <freetype/ftbdf.h> +#include <freetype/internal/ftserv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svcfftl.h b/lib/freetype/include/freetype/internal/services/svcfftl.h index c2f42c1d1..1d2dbb6a8 100644 --- a/lib/freetype/include/freetype/internal/services/svcfftl.h +++ b/lib/freetype/include/freetype/internal/services/svcfftl.h @@ -19,8 +19,8 @@ #ifndef SVCFFTL_H_ #define SVCFFTL_H_ -#include FT_INTERNAL_SERVICE_H -#include FT_INTERNAL_CFF_TYPES_H +#include <freetype/internal/ftserv.h> +#include <freetype/internal/cfftypes.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svcid.h b/lib/freetype/include/freetype/internal/services/svcid.h index b8efd8147..bd49f3270 100644 --- a/lib/freetype/include/freetype/internal/services/svcid.h +++ b/lib/freetype/include/freetype/internal/services/svcid.h @@ -19,7 +19,7 @@ #ifndef SVCID_H_ #define SVCID_H_ -#include FT_INTERNAL_SERVICE_H +#include <freetype/internal/ftserv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svfntfmt.h b/lib/freetype/include/freetype/internal/services/svfntfmt.h index 5ec84c933..6114d638a 100644 --- a/lib/freetype/include/freetype/internal/services/svfntfmt.h +++ b/lib/freetype/include/freetype/internal/services/svfntfmt.h @@ -19,7 +19,7 @@ #ifndef SVFNTFMT_H_ #define SVFNTFMT_H_ -#include FT_INTERNAL_SERVICE_H +#include <freetype/internal/ftserv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svgldict.h b/lib/freetype/include/freetype/internal/services/svgldict.h index 5a63883c9..f9443e40d 100644 --- a/lib/freetype/include/freetype/internal/services/svgldict.h +++ b/lib/freetype/include/freetype/internal/services/svgldict.h @@ -19,7 +19,7 @@ #ifndef SVGLDICT_H_ #define SVGLDICT_H_ -#include FT_INTERNAL_SERVICE_H +#include <freetype/internal/ftserv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svgxval.h b/lib/freetype/include/freetype/internal/services/svgxval.h index d0cb10a42..83c2f26ce 100644 --- a/lib/freetype/include/freetype/internal/services/svgxval.h +++ b/lib/freetype/include/freetype/internal/services/svgxval.h @@ -28,8 +28,8 @@ #ifndef SVGXVAL_H_ #define SVGXVAL_H_ -#include FT_GX_VALIDATE_H -#include FT_INTERNAL_VALIDATE_H +#include <freetype/ftgxval.h> +#include <freetype/internal/ftvalid.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svkern.h b/lib/freetype/include/freetype/internal/services/svkern.h index 891c61a75..13cfb3272 100644 --- a/lib/freetype/include/freetype/internal/services/svkern.h +++ b/lib/freetype/include/freetype/internal/services/svkern.h @@ -19,8 +19,8 @@ #ifndef SVKERN_H_ #define SVKERN_H_ -#include FT_INTERNAL_SERVICE_H -#include FT_TRUETYPE_TABLES_H +#include <freetype/internal/ftserv.h> +#include <freetype/tttables.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svmetric.h b/lib/freetype/include/freetype/internal/services/svmetric.h index 06faa4b4f..2b30edaab 100644 --- a/lib/freetype/include/freetype/internal/services/svmetric.h +++ b/lib/freetype/include/freetype/internal/services/svmetric.h @@ -19,7 +19,7 @@ #ifndef SVMETRIC_H_ #define SVMETRIC_H_ -#include FT_INTERNAL_SERVICE_H +#include <freetype/internal/ftserv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svmm.h b/lib/freetype/include/freetype/internal/services/svmm.h index fa044c92d..5a807636a 100644 --- a/lib/freetype/include/freetype/internal/services/svmm.h +++ b/lib/freetype/include/freetype/internal/services/svmm.h @@ -19,7 +19,7 @@ #ifndef SVMM_H_ #define SVMM_H_ -#include FT_INTERNAL_SERVICE_H +#include <freetype/internal/ftserv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svotval.h b/lib/freetype/include/freetype/internal/services/svotval.h index 34ad7ca9f..763fb2efb 100644 --- a/lib/freetype/include/freetype/internal/services/svotval.h +++ b/lib/freetype/include/freetype/internal/services/svotval.h @@ -19,8 +19,8 @@ #ifndef SVOTVAL_H_ #define SVOTVAL_H_ -#include FT_OPENTYPE_VALIDATE_H -#include FT_INTERNAL_VALIDATE_H +#include <freetype/ftotval.h> +#include <freetype/internal/ftvalid.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svpfr.h b/lib/freetype/include/freetype/internal/services/svpfr.h index 2dd075c5d..bdeba0785 100644 --- a/lib/freetype/include/freetype/internal/services/svpfr.h +++ b/lib/freetype/include/freetype/internal/services/svpfr.h @@ -19,8 +19,8 @@ #ifndef SVPFR_H_ #define SVPFR_H_ -#include FT_PFR_H -#include FT_INTERNAL_SERVICE_H +#include <freetype/ftpfr.h> +#include <freetype/internal/ftserv.h> FT_BEGIN_HEADER @@ -56,7 +56,6 @@ FT_BEGIN_HEADER }; - /* */ FT_END_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svpostnm.h b/lib/freetype/include/freetype/internal/services/svpostnm.h index 86ab61138..8ef62c5f9 100644 --- a/lib/freetype/include/freetype/internal/services/svpostnm.h +++ b/lib/freetype/include/freetype/internal/services/svpostnm.h @@ -19,7 +19,7 @@ #ifndef SVPOSTNM_H_ #define SVPOSTNM_H_ -#include FT_INTERNAL_SERVICE_H +#include <freetype/internal/ftserv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svpscmap.h b/lib/freetype/include/freetype/internal/services/svpscmap.h index 6c2ffe2e2..b4dcd8075 100644 --- a/lib/freetype/include/freetype/internal/services/svpscmap.h +++ b/lib/freetype/include/freetype/internal/services/svpscmap.h @@ -19,7 +19,7 @@ #ifndef SVPSCMAP_H_ #define SVPSCMAP_H_ -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftobjs.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svpsinfo.h b/lib/freetype/include/freetype/internal/services/svpsinfo.h index ade24dc2b..1e7276ff4 100644 --- a/lib/freetype/include/freetype/internal/services/svpsinfo.h +++ b/lib/freetype/include/freetype/internal/services/svpsinfo.h @@ -19,8 +19,8 @@ #ifndef SVPSINFO_H_ #define SVPSINFO_H_ -#include FT_INTERNAL_SERVICE_H -#include FT_INTERNAL_TYPE1_TYPES_H +#include <freetype/internal/ftserv.h> +#include <freetype/internal/t1types.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svsfnt.h b/lib/freetype/include/freetype/internal/services/svsfnt.h index f3e81ca84..39c8b5e19 100644 --- a/lib/freetype/include/freetype/internal/services/svsfnt.h +++ b/lib/freetype/include/freetype/internal/services/svsfnt.h @@ -19,8 +19,8 @@ #ifndef SVSFNT_H_ #define SVSFNT_H_ -#include FT_INTERNAL_SERVICE_H -#include FT_TRUETYPE_TABLES_H +#include <freetype/internal/ftserv.h> +#include <freetype/tttables.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svttcmap.h b/lib/freetype/include/freetype/internal/services/svttcmap.h index fbb3115ed..c18bb2336 100644 --- a/lib/freetype/include/freetype/internal/services/svttcmap.h +++ b/lib/freetype/include/freetype/internal/services/svttcmap.h @@ -22,8 +22,8 @@ #ifndef SVTTCMAP_H_ #define SVTTCMAP_H_ -#include FT_INTERNAL_SERVICE_H -#include FT_TRUETYPE_TABLES_H +#include <freetype/internal/ftserv.h> +#include <freetype/tttables.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svtteng.h b/lib/freetype/include/freetype/internal/services/svtteng.h index 6218d9efe..7a17e4a75 100644 --- a/lib/freetype/include/freetype/internal/services/svtteng.h +++ b/lib/freetype/include/freetype/internal/services/svtteng.h @@ -19,8 +19,8 @@ #ifndef SVTTENG_H_ #define SVTTENG_H_ -#include FT_INTERNAL_SERVICE_H -#include FT_MODULE_H +#include <freetype/internal/ftserv.h> +#include <freetype/ftmodapi.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svttglyf.h b/lib/freetype/include/freetype/internal/services/svttglyf.h index d9894e362..90a81dd40 100644 --- a/lib/freetype/include/freetype/internal/services/svttglyf.h +++ b/lib/freetype/include/freetype/internal/services/svttglyf.h @@ -18,8 +18,8 @@ #ifndef SVTTGLYF_H_ #define SVTTGLYF_H_ -#include FT_INTERNAL_SERVICE_H -#include FT_TRUETYPE_TABLES_H +#include <freetype/internal/ftserv.h> +#include <freetype/tttables.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/services/svwinfnt.h b/lib/freetype/include/freetype/internal/services/svwinfnt.h index 377f73d45..8c915f525 100644 --- a/lib/freetype/include/freetype/internal/services/svwinfnt.h +++ b/lib/freetype/include/freetype/internal/services/svwinfnt.h @@ -19,8 +19,8 @@ #ifndef SVWINFNT_H_ #define SVWINFNT_H_ -#include FT_INTERNAL_SERVICE_H -#include FT_WINFONTS_H +#include <freetype/internal/ftserv.h> +#include <freetype/ftwinfnt.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/sfnt.h b/lib/freetype/include/freetype/internal/sfnt.h index b9c81a8f3..b4c12dbb2 100644 --- a/lib/freetype/include/freetype/internal/sfnt.h +++ b/lib/freetype/include/freetype/internal/sfnt.h @@ -20,10 +20,9 @@ #define SFNT_H_ -#include <ft2build.h> -#include FT_INTERNAL_DRIVER_H -#include FT_INTERNAL_TRUETYPE_TYPES_H -#include FT_INTERNAL_WOFF_TYPES_H +#include <freetype/internal/ftdrv.h> +#include <freetype/internal/tttypes.h> +#include <freetype/internal/wofftypes.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/t1types.h b/lib/freetype/include/freetype/internal/t1types.h index 799c2939f..6a0fe5e97 100644 --- a/lib/freetype/include/freetype/internal/t1types.h +++ b/lib/freetype/include/freetype/internal/t1types.h @@ -21,12 +21,11 @@ #define T1TYPES_H_ -#include <ft2build.h> -#include FT_TYPE1_TABLES_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H -#include FT_INTERNAL_SERVICE_H -#include FT_INTERNAL_HASH_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include <freetype/t1tables.h> +#include <freetype/internal/pshints.h> +#include <freetype/internal/ftserv.h> +#include <freetype/internal/fthash.h> +#include <freetype/internal/services/svpscmap.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/internal/tttypes.h b/lib/freetype/include/freetype/internal/tttypes.h index 1bddf102b..c36342c93 100644 --- a/lib/freetype/include/freetype/internal/tttypes.h +++ b/lib/freetype/include/freetype/internal/tttypes.h @@ -21,13 +21,12 @@ #define TTTYPES_H_ -#include <ft2build.h> -#include FT_TRUETYPE_TABLES_H -#include FT_INTERNAL_OBJECTS_H -#include FT_COLOR_H +#include <freetype/tttables.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/ftcolor.h> #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include FT_MULTIPLE_MASTERS_H +#include <freetype/ftmm.h> #endif diff --git a/lib/freetype/include/freetype/internal/wofftypes.h b/lib/freetype/include/freetype/internal/wofftypes.h index 26159b9d3..1874a138a 100644 --- a/lib/freetype/include/freetype/internal/wofftypes.h +++ b/lib/freetype/include/freetype/internal/wofftypes.h @@ -21,9 +21,8 @@ #define WOFFTYPES_H_ -#include <ft2build.h> -#include FT_TRUETYPE_TABLES_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/tttables.h> +#include <freetype/internal/ftobjs.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/t1tables.h b/lib/freetype/include/freetype/t1tables.h index 522d6ae6a..426e14024 100644 --- a/lib/freetype/include/freetype/t1tables.h +++ b/lib/freetype/include/freetype/t1tables.h @@ -21,8 +21,7 @@ #define T1TABLES_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/ttnameid.h b/lib/freetype/include/freetype/ttnameid.h index 9a00913ee..2b2ed4c61 100644 --- a/lib/freetype/include/freetype/ttnameid.h +++ b/lib/freetype/include/freetype/ttnameid.h @@ -20,7 +20,6 @@ #define TTNAMEID_H_ -#include <ft2build.h> FT_BEGIN_HEADER diff --git a/lib/freetype/include/freetype/tttables.h b/lib/freetype/include/freetype/tttables.h index 8108db717..c8fa35ef8 100644 --- a/lib/freetype/include/freetype/tttables.h +++ b/lib/freetype/include/freetype/tttables.h @@ -21,8 +21,7 @@ #define TTTABLES_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/freetype/tttags.h b/lib/freetype/include/freetype/tttags.h index f2b2a4526..3c9fbd59d 100644 --- a/lib/freetype/include/freetype/tttags.h +++ b/lib/freetype/include/freetype/tttags.h @@ -20,8 +20,7 @@ #define TTAGS_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FREETYPE_H #error "freetype.h of FreeType 1 has been loaded!" diff --git a/lib/freetype/include/ft2build.h b/lib/freetype/include/ft2build.h index 195e91833..b4fd1f8c3 100644 --- a/lib/freetype/include/ft2build.h +++ b/lib/freetype/include/ft2build.h @@ -18,16 +18,14 @@ /************************************************************************** * - * This is the 'entry point' for FreeType header file inclusions. It is - * the only header file which should be included directly; all other - * FreeType header files should be accessed with macro names (after - * including `ft2build.h`). + * This is the 'entry point' for FreeType header file inclusions, to be + * loaded before all other header files. * * A typical example is * * ``` * #include <ft2build.h> - * #include FT_FREETYPE_H + * #include <freetype/freetype.h> * ``` * */ diff --git a/lib/freetype/src/Jamfile b/lib/freetype/src/Jamfile deleted file mode 100644 index c50f5d209..000000000 --- a/lib/freetype/src/Jamfile +++ /dev/null @@ -1,19 +0,0 @@ -# FreeType 2 src Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) ; - -for xx in $(FT2_COMPONENTS) -{ - SubInclude FT2_TOP $(FT2_SRC_DIR) $(xx) ; -} - -# end of src Jamfile diff --git a/lib/freetype/src/autofit/Jamfile b/lib/freetype/src/autofit/Jamfile deleted file mode 100644 index 0b200825b..000000000 --- a/lib/freetype/src/autofit/Jamfile +++ /dev/null @@ -1,53 +0,0 @@ -# FreeType 2 src/autofit Jamfile -# -# Copyright (C) 2003-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. - -SubDir FT2_TOP src autofit ; - -{ - local _sources ; - - # define FT2_AUTOFIT2 to enable experimental latin hinter replacement - if $(FT2_AUTOFIT2) - { - CCFLAGS += FT_OPTION_AUTOFIT2 ; - } - if $(FT2_MULTI) - { - _sources = afangles - afblue - afcjk - afdummy - afglobal - afhints - afindic - aflatin - afloader - afmodule - afpic - afranges - afshaper - afwarp - ; - - if $(FT2_AUTOFIT2) - { - _sources += aflatin2 ; - } - } - else - { - _sources = autofit ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/autofit Jamfile diff --git a/lib/freetype/src/autofit/afblue.c b/lib/freetype/src/autofit/afblue.c index 63f9ed458..9ebffdd09 100644 --- a/lib/freetype/src/autofit/afblue.c +++ b/lib/freetype/src/autofit/afblue.c @@ -134,7 +134,7 @@ '\0', '\xF0', '\x90', '\x90', '\xA8', ' ', '\xF0', '\x90', '\x90', '\xAA', ' ', '\xF0', '\x90', '\x90', '\xAC', ' ', '\xF0', '\x90', '\x90', '\xBF', ' ', '\xF0', '\x90', '\x91', '\x83', /* 𐐨 𐐪 𐐬 𐐿 𐑃 */ '\0', - '\xE0', '\xA4', '\x95', ' ', '\xE0', '\xA4', '\xAE', ' ', '\xE0', '\xA4', '\x85', ' ', '\xE0', '\xA4', '\x86', ' ', '\xE0', '\xA4', '\xA5', ' ', '\xE0', '\xA4', '\xA7', ' ', '\xE0', '\xA4', '\xAD', ' ', '\xE0', '\xA4', '\xB6', /* क म अ आ थ ध भ श */ + '\xE0', '\xA4', '\x95', ' ', '\xE0', '\xA4', '\xA8', ' ', '\xE0', '\xA4', '\xAE', ' ', '\xE0', '\xA4', '\x89', ' ', '\xE0', '\xA4', '\x9B', ' ', '\xE0', '\xA4', '\x9F', ' ', '\xE0', '\xA4', '\xA0', ' ', '\xE0', '\xA4', '\xA1', /* क न म उ छ ट ठ ड */ '\0', '\xE0', '\xA4', '\x88', ' ', '\xE0', '\xA4', '\x90', ' ', '\xE0', '\xA4', '\x93', ' ', '\xE0', '\xA4', '\x94', ' ', '\xE0', '\xA4', '\xBF', ' ', '\xE0', '\xA5', '\x80', ' ', '\xE0', '\xA5', '\x8B', ' ', '\xE0', '\xA5', '\x8C', /* ई ऐ ओ औ ि ी ो ौ */ '\0', @@ -296,6 +296,20 @@ '\0', '\xE0', '\xB4', '\x9F', ' ', '\xE0', '\xB4', '\xA0', ' ', '\xE0', '\xB4', '\xA7', ' ', '\xE0', '\xB4', '\xB6', ' ', '\xE0', '\xB4', '\x98', ' ', '\xE0', '\xB4', '\x9A', ' ', '\xE0', '\xB4', '\xA5', ' ', '\xE0', '\xB4', '\xB2', /* ട ഠ ധ ശ ഘ ച ഥ ല */ '\0', + '\xF0', '\x96', '\xB9', '\x80', ' ', '\xF0', '\x96', '\xB9', '\x81', ' ', '\xF0', '\x96', '\xB9', '\x82', ' ', '\xF0', '\x96', '\xB9', '\x83', ' ', '\xF0', '\x96', '\xB9', '\x8F', ' ', '\xF0', '\x96', '\xB9', '\x9A', ' ', '\xF0', '\x96', '\xB9', '\x9F', /* 𖹀 𖹁 𖹂 𖹃 𖹏 𖹚 𖹟 */ + '\0', + '\xF0', '\x96', '\xB9', '\x80', ' ', '\xF0', '\x96', '\xB9', '\x81', ' ', '\xF0', '\x96', '\xB9', '\x82', ' ', '\xF0', '\x96', '\xB9', '\x83', ' ', '\xF0', '\x96', '\xB9', '\x8F', ' ', '\xF0', '\x96', '\xB9', '\x9A', ' ', '\xF0', '\x96', '\xB9', '\x92', ' ', '\xF0', '\x96', '\xB9', '\x93', /* 𖹀 𖹁 𖹂 𖹃 𖹏 𖹚 𖹒 𖹓 */ + '\0', + '\xF0', '\x96', '\xB9', '\xA4', ' ', '\xF0', '\x96', '\xB9', '\xAC', ' ', '\xF0', '\x96', '\xB9', '\xA7', ' ', '\xF0', '\x96', '\xB9', '\xB4', ' ', '\xF0', '\x96', '\xB9', '\xB6', ' ', '\xF0', '\x96', '\xB9', '\xBE', /* 𖹤 𖹬 𖹧 𖹴 𖹶 𖹾 */ + '\0', + '\xF0', '\x96', '\xB9', '\xA0', ' ', '\xF0', '\x96', '\xB9', '\xA1', ' ', '\xF0', '\x96', '\xB9', '\xA2', ' ', '\xF0', '\x96', '\xB9', '\xB9', ' ', '\xF0', '\x96', '\xB9', '\xB3', ' ', '\xF0', '\x96', '\xB9', '\xAE', /* 𖹠 𖹡 𖹢 𖹹 𖹳 𖹮 */ + '\0', + '\xF0', '\x96', '\xB9', '\xA0', ' ', '\xF0', '\x96', '\xB9', '\xA1', ' ', '\xF0', '\x96', '\xB9', '\xA2', ' ', '\xF0', '\x96', '\xB9', '\xB3', ' ', '\xF0', '\x96', '\xB9', '\xAD', ' ', '\xF0', '\x96', '\xB9', '\xBD', /* 𖹠 𖹡 𖹢 𖹳 𖹭 𖹽 */ + '\0', + '\xF0', '\x96', '\xB9', '\xA5', ' ', '\xF0', '\x96', '\xB9', '\xA8', ' ', '\xF0', '\x96', '\xB9', '\xA9', /* 𖹥 𖹨 𖹩 */ + '\0', + '\xF0', '\x96', '\xBA', '\x80', ' ', '\xF0', '\x96', '\xBA', '\x85', ' ', '\xF0', '\x96', '\xBA', '\x88', ' ', '\xF0', '\x96', '\xBA', '\x84', ' ', '\xF0', '\x96', '\xBA', '\x8D', /* 𖺀 𖺅 𖺈 𖺄 𖺍 */ + '\0', '\xE1', '\xA0', '\xB3', ' ', '\xE1', '\xA0', '\xB4', ' ', '\xE1', '\xA0', '\xB6', ' ', '\xE1', '\xA0', '\xBD', ' ', '\xE1', '\xA1', '\x82', ' ', '\xE1', '\xA1', '\x8A', ' ', '\xE2', '\x80', '\x8D', '\xE1', '\xA1', '\xA1', '\xE2', '\x80', '\x8D', ' ', '\xE2', '\x80', '\x8D', '\xE1', '\xA1', '\xB3', '\xE2', '\x80', '\x8D', /* ᠳ ᠴ ᠶ ᠽ ᡂ ᡊ ᡡ ᡳ */ '\0', '\xE1', '\xA1', '\x83', /* ᡃ */ @@ -494,14 +508,14 @@ { AF_BLUE_STRING_CHAKMA_BOTTOM, 0 }, { AF_BLUE_STRING_CHAKMA_DESCENDER, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 }, - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, 0 }, - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 }, - { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 }, + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, 0 }, + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_CARIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_CARIAN_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, @@ -601,6 +615,9 @@ { AF_BLUE_STRING_HEBREW_BOTTOM, 0 }, { AF_BLUE_STRING_HEBREW_DESCENDER, 0 }, { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_KANNADA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_KANNADA_BOTTOM, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_KAYAH_LI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, { AF_BLUE_STRING_KAYAH_LI_BOTTOM, 0 }, @@ -619,9 +636,6 @@ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, { AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_KANNADA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_KANNADA_BOTTOM, 0 }, - { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, { AF_BLUE_STRING_LAO_BOTTOM, 0 }, @@ -659,6 +673,15 @@ { AF_BLUE_STRING_MALAYALAM_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM, 0 }, + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM, 0 }, + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_MONGOLIAN_TOP_BASE, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE, 0 }, { AF_BLUE_STRING_MAX, 0 }, @@ -724,9 +747,6 @@ { AF_BLUE_STRING_TELUGU_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_TELUGU_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, - { AF_BLUE_STRING_TIFINAGH, AF_BLUE_PROPERTY_LATIN_TOP }, - { AF_BLUE_STRING_TIFINAGH, 0 }, - { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_THAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, { AF_BLUE_STRING_THAI_BOTTOM, 0 }, @@ -736,6 +756,9 @@ { AF_BLUE_STRING_THAI_LARGE_DESCENDER, 0 }, { AF_BLUE_STRING_THAI_DIGIT_TOP, 0 }, { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_TIFINAGH, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_TIFINAGH, 0 }, + { AF_BLUE_STRING_MAX, 0 }, { AF_BLUE_STRING_VAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, { AF_BLUE_STRING_VAI_BOTTOM, 0 }, { AF_BLUE_STRING_MAX, 0 }, diff --git a/lib/freetype/src/autofit/afblue.dat b/lib/freetype/src/autofit/afblue.dat index f8356ba3a..b19b8df0f 100644 --- a/lib/freetype/src/autofit/afblue.dat +++ b/lib/freetype/src/autofit/afblue.dat @@ -203,7 +203,7 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: "𐐨 𐐪 𐐬 𐐿 𐑃" AF_BLUE_STRING_DEVANAGARI_BASE - "क म अ आ थ ध भ श" + "क न म उ छ ट ठ ड" AF_BLUE_STRING_DEVANAGARI_TOP "ई ऐ ओ औ ि ी ो ौ" // note that some fonts have extreme variation in the height of the @@ -392,6 +392,21 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: AF_BLUE_STRING_MALAYALAM_BOTTOM "ട ഠ ധ ശ ഘ ച ഥ ല" + AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP + "𖹀 𖹁 𖹂 𖹃 𖹏 𖹚 𖹟" + AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM + "𖹀 𖹁 𖹂 𖹃 𖹏 𖹚 𖹒 𖹓" + AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP + "𖹤 𖹬 𖹧 𖹴 𖹶 𖹾" + AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP + "𖹠 𖹡 𖹢 𖹹 𖹳 𖹮" + AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM + "𖹠 𖹡 𖹢 𖹳 𖹭 𖹽" + AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER + "𖹥 𖹨 𖹩" + AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP + "𖺀 𖺅 𖺈 𖺄 𖺍" + AF_BLUE_STRING_MONGOLIAN_TOP_BASE "ᠳ ᠴ ᠶ ᠽ ᡂ ᡊ ᡡ ᡳ" AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE @@ -741,14 +756,14 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_CANS - { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | - AF_BLUE_PROPERTY_LATIN_X_HEIGHT } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, 0 } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } AF_BLUE_STRINGSET_CARI { AF_BLUE_STRING_CARIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP } @@ -881,6 +896,11 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_HEBREW_DESCENDER, 0 } { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_KNDA + { AF_BLUE_STRING_KANNADA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_KANNADA_BOTTOM, 0 } + { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_KALI { AF_BLUE_STRING_KAYAH_LI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_X_HEIGHT } @@ -905,11 +925,6 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM, 0 } { AF_BLUE_STRING_MAX, 0 } - AF_BLUE_STRINGSET_KNDA - { AF_BLUE_STRING_KANNADA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_KANNADA_BOTTOM, 0 } - { AF_BLUE_STRING_MAX, 0 } - AF_BLUE_STRINGSET_LAO { AF_BLUE_STRING_LAO_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_X_HEIGHT } @@ -959,6 +974,17 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 } { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_MEDF + { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM, 0 } + { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_MONG { AF_BLUE_STRING_MONGOLIAN_TOP_BASE, AF_BLUE_PROPERTY_LATIN_TOP } { AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE, 0 } @@ -1056,11 +1082,6 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_TELUGU_BOTTOM, 0 } { AF_BLUE_STRING_MAX, 0 } - AF_BLUE_STRINGSET_TFNG - { AF_BLUE_STRING_TIFINAGH, AF_BLUE_PROPERTY_LATIN_TOP } - { AF_BLUE_STRING_TIFINAGH, 0 } - { AF_BLUE_STRING_MAX, 0 } - AF_BLUE_STRINGSET_THAI { AF_BLUE_STRING_THAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP | AF_BLUE_PROPERTY_LATIN_X_HEIGHT } @@ -1072,6 +1093,11 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: { AF_BLUE_STRING_THAI_DIGIT_TOP, 0 } { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_TFNG + { AF_BLUE_STRING_TIFINAGH, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_TIFINAGH, 0 } + { AF_BLUE_STRING_MAX, 0 } + AF_BLUE_STRINGSET_VAII { AF_BLUE_STRING_VAI_TOP, AF_BLUE_PROPERTY_LATIN_TOP } { AF_BLUE_STRING_VAI_BOTTOM, 0 } diff --git a/lib/freetype/src/autofit/afblue.h b/lib/freetype/src/autofit/afblue.h index 2b6a5cdda..486d663b6 100644 --- a/lib/freetype/src/autofit/afblue.h +++ b/lib/freetype/src/autofit/afblue.h @@ -212,61 +212,68 @@ FT_BEGIN_HEADER AF_BLUE_STRING_LISU_BOTTOM = 3506, AF_BLUE_STRING_MALAYALAM_TOP = 3538, AF_BLUE_STRING_MALAYALAM_BOTTOM = 3582, - AF_BLUE_STRING_MONGOLIAN_TOP_BASE = 3614, - AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE = 3658, - AF_BLUE_STRING_MYANMAR_TOP = 3662, - AF_BLUE_STRING_MYANMAR_BOTTOM = 3694, - AF_BLUE_STRING_MYANMAR_ASCENDER = 3726, - AF_BLUE_STRING_MYANMAR_DESCENDER = 3754, - AF_BLUE_STRING_NKO_TOP = 3786, - AF_BLUE_STRING_NKO_BOTTOM = 3810, - AF_BLUE_STRING_NKO_SMALL_TOP = 3825, - AF_BLUE_STRING_NKO_SMALL_BOTTOM = 3834, - AF_BLUE_STRING_OL_CHIKI = 3846, - AF_BLUE_STRING_OLD_TURKIC_TOP = 3870, - AF_BLUE_STRING_OLD_TURKIC_BOTTOM = 3885, - AF_BLUE_STRING_OSAGE_CAPITAL_TOP = 3905, - AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM = 3945, - AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER = 3975, - AF_BLUE_STRING_OSAGE_SMALL_TOP = 3990, - AF_BLUE_STRING_OSAGE_SMALL_BOTTOM = 4030, - AF_BLUE_STRING_OSAGE_SMALL_ASCENDER = 4070, - AF_BLUE_STRING_OSAGE_SMALL_DESCENDER = 4095, - AF_BLUE_STRING_OSMANYA_TOP = 4110, - AF_BLUE_STRING_OSMANYA_BOTTOM = 4150, - AF_BLUE_STRING_ROHINGYA_TOP = 4190, - AF_BLUE_STRING_ROHINGYA_BOTTOM = 4215, - AF_BLUE_STRING_ROHINGYA_JOIN = 4240, - AF_BLUE_STRING_SAURASHTRA_TOP = 4243, - AF_BLUE_STRING_SAURASHTRA_BOTTOM = 4275, - AF_BLUE_STRING_SHAVIAN_TOP = 4295, - AF_BLUE_STRING_SHAVIAN_BOTTOM = 4305, - AF_BLUE_STRING_SHAVIAN_DESCENDER = 4330, - AF_BLUE_STRING_SHAVIAN_SMALL_TOP = 4340, - AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM = 4375, - AF_BLUE_STRING_SINHALA_TOP = 4390, - AF_BLUE_STRING_SINHALA_BOTTOM = 4422, - AF_BLUE_STRING_SINHALA_DESCENDER = 4454, - AF_BLUE_STRING_SUNDANESE_TOP = 4498, - AF_BLUE_STRING_SUNDANESE_BOTTOM = 4522, - AF_BLUE_STRING_SUNDANESE_DESCENDER = 4554, - AF_BLUE_STRING_TAI_VIET_TOP = 4562, - AF_BLUE_STRING_TAI_VIET_BOTTOM = 4582, - AF_BLUE_STRING_TAMIL_TOP = 4594, - AF_BLUE_STRING_TAMIL_BOTTOM = 4626, - AF_BLUE_STRING_TELUGU_TOP = 4658, - AF_BLUE_STRING_TELUGU_BOTTOM = 4686, - AF_BLUE_STRING_THAI_TOP = 4714, - AF_BLUE_STRING_THAI_BOTTOM = 4738, - AF_BLUE_STRING_THAI_ASCENDER = 4766, - AF_BLUE_STRING_THAI_LARGE_ASCENDER = 4778, - AF_BLUE_STRING_THAI_DESCENDER = 4790, - AF_BLUE_STRING_THAI_LARGE_DESCENDER = 4806, - AF_BLUE_STRING_THAI_DIGIT_TOP = 4814, - AF_BLUE_STRING_TIFINAGH = 4826, - AF_BLUE_STRING_VAI_TOP = 4858, - AF_BLUE_STRING_VAI_BOTTOM = 4890, - af_blue_1_1 = 4921, + AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP = 3614, + AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM = 3649, + AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP = 3689, + AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP = 3719, + AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM = 3749, + AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER = 3779, + AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP = 3794, + AF_BLUE_STRING_MONGOLIAN_TOP_BASE = 3819, + AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE = 3863, + AF_BLUE_STRING_MYANMAR_TOP = 3867, + AF_BLUE_STRING_MYANMAR_BOTTOM = 3899, + AF_BLUE_STRING_MYANMAR_ASCENDER = 3931, + AF_BLUE_STRING_MYANMAR_DESCENDER = 3959, + AF_BLUE_STRING_NKO_TOP = 3991, + AF_BLUE_STRING_NKO_BOTTOM = 4015, + AF_BLUE_STRING_NKO_SMALL_TOP = 4030, + AF_BLUE_STRING_NKO_SMALL_BOTTOM = 4039, + AF_BLUE_STRING_OL_CHIKI = 4051, + AF_BLUE_STRING_OLD_TURKIC_TOP = 4075, + AF_BLUE_STRING_OLD_TURKIC_BOTTOM = 4090, + AF_BLUE_STRING_OSAGE_CAPITAL_TOP = 4110, + AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM = 4150, + AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER = 4180, + AF_BLUE_STRING_OSAGE_SMALL_TOP = 4195, + AF_BLUE_STRING_OSAGE_SMALL_BOTTOM = 4235, + AF_BLUE_STRING_OSAGE_SMALL_ASCENDER = 4275, + AF_BLUE_STRING_OSAGE_SMALL_DESCENDER = 4300, + AF_BLUE_STRING_OSMANYA_TOP = 4315, + AF_BLUE_STRING_OSMANYA_BOTTOM = 4355, + AF_BLUE_STRING_ROHINGYA_TOP = 4395, + AF_BLUE_STRING_ROHINGYA_BOTTOM = 4420, + AF_BLUE_STRING_ROHINGYA_JOIN = 4445, + AF_BLUE_STRING_SAURASHTRA_TOP = 4448, + AF_BLUE_STRING_SAURASHTRA_BOTTOM = 4480, + AF_BLUE_STRING_SHAVIAN_TOP = 4500, + AF_BLUE_STRING_SHAVIAN_BOTTOM = 4510, + AF_BLUE_STRING_SHAVIAN_DESCENDER = 4535, + AF_BLUE_STRING_SHAVIAN_SMALL_TOP = 4545, + AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM = 4580, + AF_BLUE_STRING_SINHALA_TOP = 4595, + AF_BLUE_STRING_SINHALA_BOTTOM = 4627, + AF_BLUE_STRING_SINHALA_DESCENDER = 4659, + AF_BLUE_STRING_SUNDANESE_TOP = 4703, + AF_BLUE_STRING_SUNDANESE_BOTTOM = 4727, + AF_BLUE_STRING_SUNDANESE_DESCENDER = 4759, + AF_BLUE_STRING_TAI_VIET_TOP = 4767, + AF_BLUE_STRING_TAI_VIET_BOTTOM = 4787, + AF_BLUE_STRING_TAMIL_TOP = 4799, + AF_BLUE_STRING_TAMIL_BOTTOM = 4831, + AF_BLUE_STRING_TELUGU_TOP = 4863, + AF_BLUE_STRING_TELUGU_BOTTOM = 4891, + AF_BLUE_STRING_THAI_TOP = 4919, + AF_BLUE_STRING_THAI_BOTTOM = 4943, + AF_BLUE_STRING_THAI_ASCENDER = 4971, + AF_BLUE_STRING_THAI_LARGE_ASCENDER = 4983, + AF_BLUE_STRING_THAI_DESCENDER = 4995, + AF_BLUE_STRING_THAI_LARGE_DESCENDER = 5011, + AF_BLUE_STRING_THAI_DIGIT_TOP = 5019, + AF_BLUE_STRING_TIFINAGH = 5031, + AF_BLUE_STRING_VAI_TOP = 5063, + AF_BLUE_STRING_VAI_BOTTOM = 5095, + af_blue_1_1 = 5126, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1, AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203, @@ -350,36 +357,37 @@ FT_BEGIN_HEADER AF_BLUE_STRINGSET_GUJR = 112, AF_BLUE_STRINGSET_GURU = 118, AF_BLUE_STRINGSET_HEBR = 124, - AF_BLUE_STRINGSET_KALI = 128, - AF_BLUE_STRINGSET_KHMR = 134, - AF_BLUE_STRINGSET_KHMS = 140, - AF_BLUE_STRINGSET_KNDA = 143, + AF_BLUE_STRINGSET_KNDA = 128, + AF_BLUE_STRINGSET_KALI = 131, + AF_BLUE_STRINGSET_KHMR = 137, + AF_BLUE_STRINGSET_KHMS = 143, AF_BLUE_STRINGSET_LAO = 146, AF_BLUE_STRINGSET_LATN = 152, AF_BLUE_STRINGSET_LATB = 159, AF_BLUE_STRINGSET_LATP = 166, AF_BLUE_STRINGSET_LISU = 173, AF_BLUE_STRINGSET_MLYM = 176, - AF_BLUE_STRINGSET_MONG = 179, - AF_BLUE_STRINGSET_MYMR = 182, - AF_BLUE_STRINGSET_NKOO = 187, - AF_BLUE_STRINGSET_NONE = 192, - AF_BLUE_STRINGSET_OLCK = 193, - AF_BLUE_STRINGSET_ORKH = 196, - AF_BLUE_STRINGSET_OSGE = 199, - AF_BLUE_STRINGSET_OSMA = 207, - AF_BLUE_STRINGSET_ROHG = 210, - AF_BLUE_STRINGSET_SAUR = 214, - AF_BLUE_STRINGSET_SHAW = 217, - AF_BLUE_STRINGSET_SINH = 223, - AF_BLUE_STRINGSET_SUND = 227, - AF_BLUE_STRINGSET_TAML = 231, - AF_BLUE_STRINGSET_TAVT = 234, - AF_BLUE_STRINGSET_TELU = 237, - AF_BLUE_STRINGSET_TFNG = 240, - AF_BLUE_STRINGSET_THAI = 243, - AF_BLUE_STRINGSET_VAII = 251, - af_blue_2_1 = 254, + AF_BLUE_STRINGSET_MEDF = 179, + AF_BLUE_STRINGSET_MONG = 187, + AF_BLUE_STRINGSET_MYMR = 190, + AF_BLUE_STRINGSET_NKOO = 195, + AF_BLUE_STRINGSET_NONE = 200, + AF_BLUE_STRINGSET_OLCK = 201, + AF_BLUE_STRINGSET_ORKH = 204, + AF_BLUE_STRINGSET_OSGE = 207, + AF_BLUE_STRINGSET_OSMA = 215, + AF_BLUE_STRINGSET_ROHG = 218, + AF_BLUE_STRINGSET_SAUR = 222, + AF_BLUE_STRINGSET_SHAW = 225, + AF_BLUE_STRINGSET_SINH = 231, + AF_BLUE_STRINGSET_SUND = 235, + AF_BLUE_STRINGSET_TAML = 239, + AF_BLUE_STRINGSET_TAVT = 242, + AF_BLUE_STRINGSET_TELU = 245, + AF_BLUE_STRINGSET_THAI = 248, + AF_BLUE_STRINGSET_TFNG = 256, + AF_BLUE_STRINGSET_VAII = 259, + af_blue_2_1 = 262, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0, af_blue_2_1_1 = af_blue_2_1 + 2, diff --git a/lib/freetype/src/autofit/afcjk.c b/lib/freetype/src/autofit/afcjk.c index ca6ce0c60..3b340cd5e 100644 --- a/lib/freetype/src/autofit/afcjk.c +++ b/lib/freetype/src/autofit/afcjk.c @@ -22,9 +22,8 @@ * */ -#include <ft2build.h> -#include FT_ADVANCES_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/ftadvanc.h> +#include <freetype/internal/ftdebug.h> #include "afglobal.h" #include "aflatin.h" @@ -158,7 +157,7 @@ if ( !glyph_index ) goto Exit; - FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n", + FT_TRACE5(( "standard character: U+%04lX (glyph index %ld)\n", ch, glyph_index )); error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); @@ -261,9 +260,9 @@ dim == AF_DIMENSION_VERT ? "horizontal" : "vertical" )); - FT_TRACE5(( " %d (standard)", axis->standard_width )); + FT_TRACE5(( " %ld (standard)", axis->standard_width )); for ( i = 1; i < axis->width_count; i++ ) - FT_TRACE5(( " %d", axis->widths[i].org )); + FT_TRACE5(( " %ld", axis->widths[i].org )); FT_TRACE5(( "\n" )); } @@ -728,7 +727,7 @@ delta2 = FT_MulFix( delta2, scale ); - FT_TRACE5(( "delta: %d", delta1 )); + FT_TRACE5(( "delta: %ld", delta1 )); if ( delta2 < 32 ) delta2 = 0; #if 0 @@ -737,7 +736,7 @@ #endif else delta2 = FT_PIX_ROUND( delta2 ); - FT_TRACE5(( "/%d\n", delta2 )); + FT_TRACE5(( "/%ld\n", delta2 )); if ( delta1 < 0 ) delta2 = -delta2; @@ -1644,7 +1643,7 @@ stem_edge->pos = base_edge->pos + fitted_width; - FT_TRACE5(( " CJKLINK: edge %d @%d (opos=%.2f) linked to %.2f," + FT_TRACE5(( " CJKLINK: edge %ld @%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, @@ -1866,7 +1865,7 @@ continue; #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE5(( " CJKBLUE: edge %d @%d (opos=%.2f) snapped to %.2f," + FT_TRACE5(( " CJKBLUE: edge %ld @%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 )); @@ -1930,7 +1929,7 @@ /* this should not happen, but it's better to be safe */ if ( edge2->blue_edge ) { - FT_TRACE5(( "ASSERTION FAILED for edge %d\n", edge2-edges )); + FT_TRACE5(( "ASSERTION FAILED for edge %ld\n", edge2-edges )); af_cjk_align_linked_edge( hints, dim, edge2, edge ); edge->flags |= AF_EDGE_DONE; diff --git a/lib/freetype/src/autofit/aferrors.h b/lib/freetype/src/autofit/aferrors.h index 6c7d0e1d7..f90899944 100644 --- a/lib/freetype/src/autofit/aferrors.h +++ b/lib/freetype/src/autofit/aferrors.h @@ -26,7 +26,7 @@ #ifndef AFERRORS_H_ #define AFERRORS_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -34,7 +34,7 @@ #define FT_ERR_PREFIX AF_Err_ #define FT_ERR_BASE FT_Mod_Err_Autofit -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* AFERRORS_H_ */ diff --git a/lib/freetype/src/autofit/afglobal.c b/lib/freetype/src/autofit/afglobal.c index 5ad4ea921..d5129423d 100644 --- a/lib/freetype/src/autofit/afglobal.c +++ b/lib/freetype/src/autofit/afglobal.c @@ -19,7 +19,7 @@ #include "afglobal.h" #include "afranges.h" #include "afshaper.h" -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> /************************************************************************** @@ -306,7 +306,7 @@ if ( !( count % 10 ) ) FT_TRACE4(( " " )); - FT_TRACE4(( " %d", idx )); + FT_TRACE4(( " %ld", idx )); count++; if ( !( count % 10 ) ) diff --git a/lib/freetype/src/autofit/afhints.c b/lib/freetype/src/autofit/afhints.c index 5a123b2ba..a8e00890e 100644 --- a/lib/freetype/src/autofit/afhints.c +++ b/lib/freetype/src/autofit/afhints.c @@ -18,8 +18,8 @@ #include "afhints.h" #include "aferrors.h" -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftcalc.h> +#include <freetype/internal/ftdebug.h> /************************************************************************** diff --git a/lib/freetype/src/autofit/aflatin.c b/lib/freetype/src/autofit/aflatin.c index b453fcdf6..21ec02ebd 100644 --- a/lib/freetype/src/autofit/aflatin.c +++ b/lib/freetype/src/autofit/aflatin.c @@ -16,9 +16,8 @@ */ -#include <ft2build.h> -#include FT_ADVANCES_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/ftadvanc.h> +#include <freetype/internal/ftdebug.h> #include "afglobal.h" #include "aflatin.h" @@ -155,7 +154,7 @@ goto Exit; } - FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n", + FT_TRACE5(( "standard character: U+%04lX (glyph index %ld)\n", ch, glyph_index )); error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); @@ -258,9 +257,9 @@ dim == AF_DIMENSION_VERT ? "horizontal" : "vertical" )); - FT_TRACE5(( " %d (standard)", axis->standard_width )); + FT_TRACE5(( " %ld (standard)", axis->standard_width )); for ( i = 1; i < axis->width_count; i++ ) - FT_TRACE5(( " %d", axis->widths[i].org )); + FT_TRACE5(( " %ld", axis->widths[i].org )); FT_TRACE5(( "\n" )); } @@ -1032,7 +1031,7 @@ { *a = *b; FT_TRACE5(( "blue zone overlap:" - " adjusting %s %d to %ld\n", + " adjusting %s %ld to %ld\n", a_is_top ? "overshoot" : "reference", blue_sorted[i] - axis->blues, *a )); @@ -1280,7 +1279,7 @@ "af_latin_metrics_scale_dim:" " x height alignment (style `%s'):\n" " " - " vertical scaling changed from %.5f to %.5f (by %d%%)\n" + " vertical scaling changed from %.5f to %.5f (by %ld%%)\n" "\n", af_style_names[metrics->root.style_class->style], scale / 65536.0, @@ -1333,7 +1332,7 @@ width->cur = FT_MulFix( width->org, scale ); width->fit = width->cur; - FT_TRACE5(( " %d scaled to %.2f\n", + FT_TRACE5(( " %ld scaled to %.2f\n", width->org, width->cur / 64.0 )); } @@ -1474,8 +1473,8 @@ AF_LatinBlue blue = &axis->blues[nn]; - FT_TRACE5(( " reference %d: %d scaled to %.2f%s\n" - " overshoot %d: %d scaled to %.2f%s\n", + FT_TRACE5(( " reference %d: %ld scaled to %.2f%s\n" + " overshoot %d: %ld scaled to %.2f%s\n", nn, blue->ref.org, blue->ref.fit / 64.0, @@ -2945,7 +2944,7 @@ stem_edge->pos = base_edge->pos + fitted_width; - FT_TRACE5(( " LINK: edge %d (opos=%.2f) linked to %.2f," + FT_TRACE5(( " LINK: edge %ld (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 )); @@ -3069,12 +3068,12 @@ #ifdef FT_DEBUG_LEVEL_TRACE if ( !anchor ) - FT_TRACE5(( " BLUE_ANCHOR: edge %d (opos=%.2f) snapped to %.2f," - " was %.2f (anchor=edge %d)\n", + FT_TRACE5(( " BLUE_ANCHOR: edge %ld (opos=%.2f) snapped to %.2f," + " was %.2f (anchor=edge %ld)\n", edge1 - edges, edge1->opos / 64.0, blue->fit / 64.0, edge1->pos / 64.0, edge - edges )); else - FT_TRACE5(( " BLUE: edge %d (opos=%.2f) snapped to %.2f," + FT_TRACE5(( " BLUE: edge %ld (opos=%.2f) snapped to %.2f," " was %.2f\n", edge1 - edges, edge1->opos / 64.0, blue->fit / 64.0, edge1->pos / 64.0 )); @@ -3123,7 +3122,7 @@ /* this should not happen, but it's better to be safe */ if ( edge2->blue_edge ) { - FT_TRACE5(( " ASSERTION FAILED for edge %d\n", edge2 - edges )); + FT_TRACE5(( " ASSERTION FAILED for edge %ld\n", edge2 - edges )); af_latin_align_linked_edge( hints, dim, edge2, edge ); edge->flags |= AF_EDGE_DONE; @@ -3191,7 +3190,7 @@ anchor = edge; edge->flags |= AF_EDGE_DONE; - FT_TRACE5(( " ANCHOR: edge %d (opos=%.2f) and %d (opos=%.2f)" + FT_TRACE5(( " ANCHOR: edge %ld (opos=%.2f) and %ld (opos=%.2f)" " snapped to %.2f and %.2f\n", edge - edges, edge->opos / 64.0, edge2 - edges, edge2->opos / 64.0, @@ -3220,7 +3219,7 @@ if ( edge2->flags & AF_EDGE_DONE ) { - FT_TRACE5(( " ADJUST: edge %d (pos=%.2f) moved to %.2f\n", + FT_TRACE5(( " ADJUST: edge %ld (pos=%.2f) moved to %.2f\n", edge - edges, edge->pos / 64.0, ( edge2->pos - cur_len ) / 64.0 )); @@ -3261,7 +3260,7 @@ edge->pos = cur_pos1 - cur_len / 2; edge2->pos = cur_pos1 + cur_len / 2; - FT_TRACE5(( " STEM: edge %d (opos=%.2f) linked to %d (opos=%.2f)" + FT_TRACE5(( " STEM: edge %ld (opos=%.2f) linked to %ld (opos=%.2f)" " snapped to %.2f and %.2f\n", edge - edges, edge->opos / 64.0, edge2 - edges, edge2->opos / 64.0, @@ -3292,7 +3291,7 @@ edge->pos = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2; edge2->pos = edge->pos + cur_len; - FT_TRACE5(( " STEM: edge %d (opos=%.2f) linked to %d (opos=%.2f)" + FT_TRACE5(( " STEM: edge %ld (opos=%.2f) linked to %ld (opos=%.2f)" " snapped to %.2f and %.2f\n", edge - edges, edge->opos / 64.0, edge2 - edges, edge2->opos / 64.0, @@ -3315,7 +3314,7 @@ if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 ) { #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n", + FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n", edge - edges, edge->pos / 64.0, edge[-1].pos / 64.0 )); @@ -3417,7 +3416,7 @@ if ( delta < 64 + 16 ) { af_latin_align_serif_edge( hints, edge->serif, edge ); - FT_TRACE5(( " SERIF: edge %d (opos=%.2f) serif to %d (opos=%.2f)" + FT_TRACE5(( " SERIF: edge %ld (opos=%.2f) serif to %ld (opos=%.2f)" " aligned to %.2f\n", edge - edges, edge->opos / 64.0, edge->serif - edges, edge->serif->opos / 64.0, @@ -3427,7 +3426,7 @@ { edge->pos = FT_PIX_ROUND( edge->opos ); anchor = edge; - FT_TRACE5(( " SERIF_ANCHOR: edge %d (opos=%.2f)" + FT_TRACE5(( " SERIF_ANCHOR: edge %ld (opos=%.2f)" " snapped to %.2f\n", edge-edges, edge->opos / 64.0, edge->pos / 64.0 )); } @@ -3455,8 +3454,8 @@ after->pos - before->pos, after->opos - before->opos ); - FT_TRACE5(( " SERIF_LINK1: edge %d (opos=%.2f) snapped to %.2f" - " from %d (opos=%.2f)\n", + FT_TRACE5(( " SERIF_LINK1: edge %ld (opos=%.2f) snapped to %.2f" + " from %ld (opos=%.2f)\n", edge - edges, edge->opos / 64.0, edge->pos / 64.0, before - edges, before->opos / 64.0 )); @@ -3465,7 +3464,7 @@ { edge->pos = anchor->pos + ( ( edge->opos - anchor->opos + 16 ) & ~31 ); - FT_TRACE5(( " SERIF_LINK2: edge %d (opos=%.2f)" + FT_TRACE5(( " SERIF_LINK2: edge %ld (opos=%.2f)" " snapped to %.2f\n", edge - edges, edge->opos / 64.0, edge->pos / 64.0 )); } @@ -3485,7 +3484,7 @@ if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 ) { #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n", + FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n", edge - edges, edge->pos / 64.0, edge[-1].pos / 64.0 )); @@ -3506,7 +3505,7 @@ if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 ) { #ifdef FT_DEBUG_LEVEL_TRACE - FT_TRACE5(( " BOUND: edge %d (pos=%.2f) moved to %.2f\n", + FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n", edge - edges, edge->pos / 64.0, edge[1].pos / 64.0 )); diff --git a/lib/freetype/src/autofit/aflatin2.c b/lib/freetype/src/autofit/aflatin2.c index 7bd4156a0..902f3982e 100644 --- a/lib/freetype/src/autofit/aflatin2.c +++ b/lib/freetype/src/autofit/aflatin2.c @@ -21,8 +21,7 @@ */ -#include <ft2build.h> -#include FT_ADVANCES_H +#include <freetype/ftadvanc.h> #ifdef FT_OPTION_AUTOFIT2 diff --git a/lib/freetype/src/autofit/afloader.c b/lib/freetype/src/autofit/afloader.c index a53fbf2d2..c35d85c4c 100644 --- a/lib/freetype/src/autofit/afloader.c +++ b/lib/freetype/src/autofit/afloader.c @@ -22,7 +22,7 @@ #include "aferrors.h" #include "afmodule.h" -#include FT_INTERNAL_CALC_H +#include <freetype/internal/ftcalc.h> /* Initialize glyph loader. */ diff --git a/lib/freetype/src/autofit/afmodule.c b/lib/freetype/src/autofit/afmodule.c index 0bcae4cc2..e16494460 100644 --- a/lib/freetype/src/autofit/afmodule.c +++ b/lib/freetype/src/autofit/afmodule.c @@ -53,10 +53,10 @@ void* _af_debug_hints = _af_debug_hints_rec; #endif -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H -#include FT_DRIVER_H -#include FT_SERVICE_PROPERTIES_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/ftdriver.h> +#include <freetype/internal/services/svprop.h> /************************************************************************** @@ -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/lib/freetype/src/autofit/afmodule.h b/lib/freetype/src/autofit/afmodule.h index efa0240b4..e8fe4a93a 100644 --- a/lib/freetype/src/autofit/afmodule.h +++ b/lib/freetype/src/autofit/afmodule.h @@ -19,9 +19,8 @@ #ifndef AFMODULE_H_ #define AFMODULE_H_ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_MODULE_H +#include <freetype/internal/ftobjs.h> +#include <freetype/ftmodapi.h> FT_BEGIN_HEADER @@ -47,6 +46,7 @@ FT_BEGIN_HEADER } AF_ModuleRec, *AF_Module; +FT_DECLARE_AUTOHINTER_INTERFACE( af_autofitter_interface ) FT_DECLARE_MODULE( autofit_module_class ) diff --git a/lib/freetype/src/autofit/afranges.c b/lib/freetype/src/autofit/afranges.c index d6ecf8891..c8ebf5e78 100644 --- a/lib/freetype/src/autofit/afranges.c +++ b/lib/freetype/src/autofit/afranges.c @@ -664,6 +664,18 @@ }; + const AF_Script_UniRangeRec af_medf_uniranges[] = + { + AF_UNIRANGE_REC( 0x16E40, 0x16E9F ), /* Medefaidrin */ + AF_UNIRANGE_REC( 0, 0 ) + }; + + const AF_Script_UniRangeRec af_medf_nonbase_uniranges[] = + { + AF_UNIRANGE_REC( 0, 0 ) + }; + + const AF_Script_UniRangeRec af_mong_uniranges[] = { AF_UNIRANGE_REC( 0x1800, 0x18AF ), /* Mongolian */ diff --git a/lib/freetype/src/autofit/afscript.h b/lib/freetype/src/autofit/afscript.h index 36caaddc5..4cf9cc19f 100644 --- a/lib/freetype/src/autofit/afscript.h +++ b/lib/freetype/src/autofit/afscript.h @@ -243,6 +243,12 @@ HINTING_BOTTOM_TO_TOP, "\xE0\xB4\xA0 \xE0\xB4\xB1" ) /* ഠ റ */ + SCRIPT( medf, MEDF, + "Medefaidrin", + HB_SCRIPT_MEDEFAIDRIN, + HINTING_BOTTOM_TO_TOP, + "\xF0\x96\xB9\xA1 \xF0\x96\xB9\x9B \xF0\x96\xB9\xAF" ) /* 𖹡 𖹛 𖹯 */ + SCRIPT( mong, MONG, "Mongolian", HB_SCRIPT_MONGOLIAN, diff --git a/lib/freetype/src/autofit/afshaper.c b/lib/freetype/src/autofit/afshaper.c index d3902db2e..bbf7b6b1f 100644 --- a/lib/freetype/src/autofit/afshaper.c +++ b/lib/freetype/src/autofit/afshaper.c @@ -16,9 +16,8 @@ */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_ADVANCES_H +#include <freetype/freetype.h> +#include <freetype/ftadvanc.h> #include "afglobal.h" #include "aftypes.h" #include "afshaper.h" diff --git a/lib/freetype/src/autofit/afshaper.h b/lib/freetype/src/autofit/afshaper.h index a7dbf34f1..138c27b32 100644 --- a/lib/freetype/src/autofit/afshaper.h +++ b/lib/freetype/src/autofit/afshaper.h @@ -20,8 +20,7 @@ #define AFSHAPER_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> #ifdef FT_CONFIG_OPTION_USE_HARFBUZZ diff --git a/lib/freetype/src/autofit/afstyles.h b/lib/freetype/src/autofit/afstyles.h index 8d411ab0d..9113ec451 100644 --- a/lib/freetype/src/autofit/afstyles.h +++ b/lib/freetype/src/autofit/afstyles.h @@ -322,6 +322,13 @@ AF_BLUE_STRINGSET_MLYM, AF_COVERAGE_DEFAULT ) + STYLE( medf_dflt, MEDF_DFLT, + "Medefaidrin default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_MEDF, + AF_BLUE_STRINGSET_MEDF, + AF_COVERAGE_DEFAULT ) + STYLE( mong_dflt, MONG_DFLT, "Mongolian default style", AF_WRITING_SYSTEM_LATIN, diff --git a/lib/freetype/src/autofit/aftypes.h b/lib/freetype/src/autofit/aftypes.h index 7ca0b59e3..5f040c6b4 100644 --- a/lib/freetype/src/autofit/aftypes.h +++ b/lib/freetype/src/autofit/aftypes.h @@ -32,12 +32,11 @@ #ifndef AFTYPES_H_ #define AFTYPES_H_ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_OUTLINE_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/freetype.h> +#include <freetype/ftoutln.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> #include "afblue.h" diff --git a/lib/freetype/src/autofit/autofit.c b/lib/freetype/src/autofit/autofit.c index 88be8bf2b..ef5e7f145 100644 --- a/lib/freetype/src/autofit/autofit.c +++ b/lib/freetype/src/autofit/autofit.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "afangles.c" #include "afblue.c" diff --git a/lib/freetype/src/base/Jamfile b/lib/freetype/src/base/Jamfile deleted file mode 100644 index 8e10eac36..000000000 --- a/lib/freetype/src/base/Jamfile +++ /dev/null @@ -1,90 +0,0 @@ -# FreeType 2 src/base Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) base ; - - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = basepic - ftadvanc - ftcalc - ftcolor - ftdbgmem - fterrors - ftfntfmt - ftgloadr - fthash - ftlcdfil - ftobjs - ftoutln - ftpic - ftpsprop - ftrfork - ftsnames - ftstream - fttrigon - ftutil - ; - } - else - { - _sources = ftbase ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# Add the optional/replaceable files. -# -{ - local _sources = ftbbox - ftbdf - ftbitmap - ftcid - ftdebug - ftfstype - ftgasp - ftglyph - ftgxval - ftinit - ftmm - ftotval - ftpatent - ftpfr - ftstroke - ftsynth - ftsystem - fttype1 - ftwinfnt - ; - - Library $(FT2_LIB) : $(_sources).c ; -} - -# Add Macintosh-specific file to the library when necessary. -# -if $(MAC) -{ - Library $(FT2_LIB) : ftmac.c ; -} -else if $(OS) = MACOSX -{ - if $(FT2_MULTI) - { - Library $(FT2_LIB) : ftmac.c ; - } -} - -# end of src/base Jamfile diff --git a/lib/freetype/src/base/ftadvanc.c b/lib/freetype/src/base/ftadvanc.c index 310bbba41..c689e6a15 100644 --- a/lib/freetype/src/base/ftadvanc.c +++ b/lib/freetype/src/base/ftadvanc.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> -#include FT_ADVANCES_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/ftadvanc.h> +#include <freetype/internal/ftobjs.h> static FT_Error diff --git a/lib/freetype/src/base/ftbase.c b/lib/freetype/src/base/ftbase.c index b8242bb96..bfbaffd64 100644 --- a/lib/freetype/src/base/ftbase.c +++ b/lib/freetype/src/base/ftbase.c @@ -16,7 +16,6 @@ */ -#include <ft2build.h> #define FT_MAKE_OPTION_SINGLE_OBJECT #include "ftadvanc.c" diff --git a/lib/freetype/src/base/ftbase.h b/lib/freetype/src/base/ftbase.h index 472713add..25afa9bc3 100644 --- a/lib/freetype/src/base/ftbase.h +++ b/lib/freetype/src/base/ftbase.h @@ -20,13 +20,16 @@ #define FTBASE_H_ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftobjs.h> 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/lib/freetype/src/base/ftbbox.c b/lib/freetype/src/base/ftbbox.c index 9d9f9c401..30a4eba0b 100644 --- a/lib/freetype/src/base/ftbbox.c +++ b/lib/freetype/src/base/ftbbox.c @@ -24,14 +24,13 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H - -#include FT_BBOX_H -#include FT_IMAGE_H -#include FT_OUTLINE_H -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftdebug.h> + +#include <freetype/ftbbox.h> +#include <freetype/ftimage.h> +#include <freetype/ftoutln.h> +#include <freetype/internal/ftcalc.h> +#include <freetype/internal/ftobjs.h> typedef struct TBBox_Rec_ diff --git a/lib/freetype/src/base/ftbdf.c b/lib/freetype/src/base/ftbdf.c index a239e5f87..fc374c667 100644 --- a/lib/freetype/src/base/ftbdf.c +++ b/lib/freetype/src/base/ftbdf.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_BDF_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/services/svbdf.h> /* documentation is in ftbdf.h */ diff --git a/lib/freetype/src/base/ftbitmap.c b/lib/freetype/src/base/ftbitmap.c index 18ac4c5f3..584213ddc 100644 --- a/lib/freetype/src/base/ftbitmap.c +++ b/lib/freetype/src/base/ftbitmap.c @@ -16,12 +16,11 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> -#include FT_BITMAP_H -#include FT_IMAGE_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/ftbitmap.h> +#include <freetype/ftimage.h> +#include <freetype/internal/ftobjs.h> /************************************************************************** @@ -909,13 +908,13 @@ #ifdef FT_DEBUG_LEVEL_TRACE FT_TRACE5(( "FT_Bitmap_Blend:\n" - " source bitmap: (%d, %d) -- (%d, %d); %d x %d\n", + " source bitmap: (%ld, %ld) -- (%ld, %ld); %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: (%d, %d) -- (%d, %d); %d x %d\n", + FT_TRACE5(( " target bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n", target_llx / 64, target_lly / 64, target_urx / 64, target_ury / 64, target->width, target->rows )); @@ -923,7 +922,7 @@ FT_TRACE5(( " target bitmap: empty\n" )); if ( final_width && final_rows ) - FT_TRACE5(( " final bitmap: (%d, %d) -- (%d, %d); %d x %d\n", + FT_TRACE5(( " final bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n", final_llx / 64, final_lly / 64, final_urx / 64, final_ury / 64, final_width, final_rows )); diff --git a/lib/freetype/src/base/ftcalc.c b/lib/freetype/src/base/ftcalc.c index 53550057b..b5258c85a 100644 --- a/lib/freetype/src/base/ftcalc.c +++ b/lib/freetype/src/base/ftcalc.c @@ -32,12 +32,11 @@ */ -#include <ft2build.h> -#include FT_GLYPH_H -#include FT_TRIGONOMETRY_H -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/ftglyph.h> +#include <freetype/fttrigon.h> +#include <freetype/internal/ftcalc.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftobjs.h> #ifdef FT_MULFIX_ASSEMBLER diff --git a/lib/freetype/src/base/ftcid.c b/lib/freetype/src/base/ftcid.c index 17c25730e..ce8a876ad 100644 --- a/lib/freetype/src/base/ftcid.c +++ b/lib/freetype/src/base/ftcid.c @@ -16,10 +16,9 @@ */ -#include <ft2build.h> -#include FT_CID_H -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_CID_H +#include <freetype/ftcid.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/services/svcid.h> /* documentation is in ftcid.h */ diff --git a/lib/freetype/src/base/ftcolor.c b/lib/freetype/src/base/ftcolor.c index 986e9924a..a50d68009 100644 --- a/lib/freetype/src/base/ftcolor.c +++ b/lib/freetype/src/base/ftcolor.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_SFNT_H -#include FT_INTERNAL_TRUETYPE_TYPES_H -#include FT_COLOR_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/sfnt.h> +#include <freetype/internal/tttypes.h> +#include <freetype/ftcolor.h> #ifdef TT_CONFIG_OPTION_COLOR_LAYERS diff --git a/lib/freetype/src/base/ftdbgmem.c b/lib/freetype/src/base/ftdbgmem.c index 7f06c8600..eb0d65160 100644 --- a/lib/freetype/src/base/ftdbgmem.c +++ b/lib/freetype/src/base/ftdbgmem.c @@ -18,11 +18,11 @@ #include <ft2build.h> #include FT_CONFIG_CONFIG_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_MEMORY_H -#include FT_SYSTEM_H -#include FT_ERRORS_H -#include FT_TYPES_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftmemory.h> +#include <freetype/ftsystem.h> +#include <freetype/fterrors.h> +#include <freetype/fttypes.h> #ifdef FT_DEBUG_MEMORY diff --git a/lib/freetype/src/base/ftdebug.c b/lib/freetype/src/base/ftdebug.c index da1c1265e..62cf680b0 100644 --- a/lib/freetype/src/base/ftdebug.c +++ b/lib/freetype/src/base/ftdebug.c @@ -41,9 +41,8 @@ */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/freetype.h> +#include <freetype/internal/ftdebug.h> #ifdef FT_DEBUG_LEVEL_ERROR @@ -126,7 +125,7 @@ static const char* ft_trace_toggles[trace_count + 1] = { -#include FT_INTERNAL_TRACE_H +#include <freetype/internal/fttrace.h> NULL }; diff --git a/lib/freetype/src/base/fterrors.c b/lib/freetype/src/base/fterrors.c index 8aa688fbe..eba9e7656 100644 --- a/lib/freetype/src/base/fterrors.c +++ b/lib/freetype/src/base/fterrors.c @@ -16,9 +16,8 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_ERRORS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/fterrors.h> /* documentation is in fterrors.h */ @@ -38,7 +37,7 @@ #define FT_ERRORDEF( e, v, s ) case v: return s; #define FT_ERROR_END_LIST } -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* defined( FT_CONFIG_OPTION_ERROR_STRINGS ) || ... */ diff --git a/lib/freetype/src/base/ftfntfmt.c b/lib/freetype/src/base/ftfntfmt.c index 95e9b6e4c..a45317e79 100644 --- a/lib/freetype/src/base/ftfntfmt.c +++ b/lib/freetype/src/base/ftfntfmt.c @@ -16,10 +16,9 @@ */ -#include <ft2build.h> -#include FT_FONT_FORMATS_H -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_FONT_FORMAT_H +#include <freetype/ftfntfmt.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/services/svfntfmt.h> /* documentation is in ftfntfmt.h */ diff --git a/lib/freetype/src/base/ftfstype.c b/lib/freetype/src/base/ftfstype.c index 461d85707..bca548fc5 100644 --- a/lib/freetype/src/base/ftfstype.c +++ b/lib/freetype/src/base/ftfstype.c @@ -15,11 +15,10 @@ * */ -#include <ft2build.h> -#include FT_TYPE1_TABLES_H -#include FT_TRUETYPE_TABLES_H -#include FT_INTERNAL_SERVICE_H -#include FT_SERVICE_POSTSCRIPT_INFO_H +#include <freetype/t1tables.h> +#include <freetype/tttables.h> +#include <freetype/internal/ftserv.h> +#include <freetype/internal/services/svpsinfo.h> /* documentation is in freetype.h */ diff --git a/lib/freetype/src/base/ftgasp.c b/lib/freetype/src/base/ftgasp.c index 0fd80b9cd..eed05a326 100644 --- a/lib/freetype/src/base/ftgasp.c +++ b/lib/freetype/src/base/ftgasp.c @@ -16,9 +16,8 @@ */ -#include <ft2build.h> -#include FT_GASP_H -#include FT_INTERNAL_TRUETYPE_TYPES_H +#include <freetype/ftgasp.h> +#include <freetype/internal/tttypes.h> FT_EXPORT_DEF( FT_Int ) diff --git a/lib/freetype/src/base/ftgloadr.c b/lib/freetype/src/base/ftgloadr.c index 6032885c6..05fc7692b 100644 --- a/lib/freetype/src/base/ftgloadr.c +++ b/lib/freetype/src/base/ftgloadr.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_GLYPH_LOADER_H -#include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftgloadr.h> +#include <freetype/internal/ftmemory.h> +#include <freetype/internal/ftobjs.h> #undef FT_COMPONENT #define FT_COMPONENT gloader @@ -93,6 +92,7 @@ base->outline.n_points = 0; base->outline.n_contours = 0; + base->outline.flags = 0; base->num_subglyphs = 0; *current = *base; diff --git a/lib/freetype/src/base/ftglyph.c b/lib/freetype/src/base/ftglyph.c index 44654be78..825eba2c4 100644 --- a/lib/freetype/src/base/ftglyph.c +++ b/lib/freetype/src/base/ftglyph.c @@ -28,13 +28,14 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> -#include FT_GLYPH_H -#include FT_OUTLINE_H -#include FT_BITMAP_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/ftglyph.h> +#include <freetype/ftoutln.h> +#include <freetype/ftbitmap.h> +#include <freetype/internal/ftobjs.h> + +#include "ftbase.h" /************************************************************************** diff --git a/lib/freetype/src/base/ftgxval.c b/lib/freetype/src/base/ftgxval.c index fa32c5f6c..f04df1452 100644 --- a/lib/freetype/src/base/ftgxval.c +++ b/lib/freetype/src/base/ftgxval.c @@ -25,11 +25,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_GX_VALIDATE_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/services/svgxval.h> /* documentation is in ftgxval.h */ diff --git a/lib/freetype/src/base/fthash.c b/lib/freetype/src/base/fthash.c index 387e6d26d..449b03a5c 100644 --- a/lib/freetype/src/base/fthash.c +++ b/lib/freetype/src/base/fthash.c @@ -39,9 +39,8 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_HASH_H -#include FT_INTERNAL_MEMORY_H +#include <freetype/internal/fthash.h> +#include <freetype/internal/ftmemory.h> #define INITIAL_HT_SIZE 241 diff --git a/lib/freetype/src/base/ftinit.c b/lib/freetype/src/base/ftinit.c index 1aab09a77..0acc75e46 100644 --- a/lib/freetype/src/base/ftinit.c +++ b/lib/freetype/src/base/ftinit.c @@ -39,9 +39,9 @@ #include <ft2build.h> #include FT_CONFIG_CONFIG_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H -#include FT_MODULE_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/ftmodapi.h> /************************************************************************** diff --git a/lib/freetype/src/base/ftlcdfil.c b/lib/freetype/src/base/ftlcdfil.c index d4ef93a51..1e84dbc89 100644 --- a/lib/freetype/src/base/ftlcdfil.c +++ b/lib/freetype/src/base/ftlcdfil.c @@ -16,12 +16,11 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> -#include FT_LCD_FILTER_H -#include FT_IMAGE_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/ftlcdfil.h> +#include <freetype/ftimage.h> +#include <freetype/internal/ftobjs.h> #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING diff --git a/lib/freetype/src/base/ftmac.c b/lib/freetype/src/base/ftmac.c index 2de43a014..55a631fd7 100644 --- a/lib/freetype/src/base/ftmac.c +++ b/lib/freetype/src/base/ftmac.c @@ -65,10 +65,9 @@ */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_TRUETYPE_TAGS_H -#include FT_INTERNAL_STREAM_H +#include <freetype/freetype.h> +#include <freetype/tttags.h> +#include <freetype/internal/ftstream.h> #include "ftbase.h" diff --git a/lib/freetype/src/base/ftmm.c b/lib/freetype/src/base/ftmm.c index ef2e3d958..9a702b993 100644 --- a/lib/freetype/src/base/ftmm.c +++ b/lib/freetype/src/base/ftmm.c @@ -16,13 +16,12 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> -#include FT_MULTIPLE_MASTERS_H -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_MULTIPLE_MASTERS_H -#include FT_SERVICE_METRICS_VARIATIONS_H +#include <freetype/ftmm.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/services/svmm.h> +#include <freetype/internal/services/svmetric.h> /************************************************************************** diff --git a/lib/freetype/src/base/ftobjs.c b/lib/freetype/src/base/ftobjs.c index 1b042614d..c060bbbc8 100644 --- a/lib/freetype/src/base/ftobjs.c +++ b/lib/freetype/src/base/ftobjs.c @@ -16,32 +16,31 @@ */ -#include <ft2build.h> -#include FT_LIST_H -#include FT_OUTLINE_H -#include FT_FONT_FORMATS_H - -#include FT_INTERNAL_VALIDATE_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_RFORK_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_SFNT_H /* for SFNT_Load_Table_Func */ -#include FT_INTERNAL_POSTSCRIPT_AUX_H /* for PS_Driver */ - -#include FT_TRUETYPE_TABLES_H -#include FT_TRUETYPE_TAGS_H -#include FT_TRUETYPE_IDS_H - -#include FT_SERVICE_PROPERTIES_H -#include FT_SERVICE_SFNT_H -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_GLYPH_DICT_H -#include FT_SERVICE_TT_CMAP_H -#include FT_SERVICE_KERNING_H -#include FT_SERVICE_TRUETYPE_ENGINE_H - -#include FT_DRIVER_H +#include <freetype/ftlist.h> +#include <freetype/ftoutln.h> +#include <freetype/ftfntfmt.h> + +#include <freetype/internal/ftvalid.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftrfork.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/sfnt.h> /* for SFNT_Load_Table_Func */ +#include <freetype/internal/psaux.h> /* for PS_Driver */ + +#include <freetype/tttables.h> +#include <freetype/tttags.h> +#include <freetype/ttnameid.h> + +#include <freetype/internal/services/svprop.h> +#include <freetype/internal/services/svsfnt.h> +#include <freetype/internal/services/svpostnm.h> +#include <freetype/internal/services/svgldict.h> +#include <freetype/internal/services/svttcmap.h> +#include <freetype/internal/services/svkern.h> +#include <freetype/internal/services/svtteng.h> + +#include <freetype/ftdriver.h> #ifdef FT_CONFIG_OPTION_MAC_FONTS #include "ftbase.h" @@ -50,7 +49,7 @@ #ifdef FT_DEBUG_LEVEL_TRACE -#include FT_BITMAP_H +#include <freetype/ftbitmap.h> #if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */ /* We disable the warning `conversion from XXX to YYY, */ @@ -1063,11 +1062,30 @@ slot->linearHoriAdvance / 65536.0 )); FT_TRACE5(( " linear y advance: %f\n", slot->linearVertAdvance / 65536.0 )); + FT_TRACE5(( "\n" )); FT_TRACE5(( " bitmap %dx%d, %s (mode %d)\n", slot->bitmap.width, slot->bitmap.rows, pixel_modes[slot->bitmap.pixel_mode], slot->bitmap.pixel_mode )); + FT_TRACE5(( "\n" )); + + { + FT_Glyph_Metrics* metrics = &slot->metrics; + + + FT_TRACE5(( " metrics:\n" )); + FT_TRACE5(( " width: %f\n", metrics->width / 64.0 )); + FT_TRACE5(( " height: %f\n", metrics->height / 64.0 )); + FT_TRACE5(( "\n" )); + FT_TRACE5(( " horiBearingX: %f\n", metrics->horiBearingX / 64.0 )); + FT_TRACE5(( " horiBearingY: %f\n", metrics->horiBearingY / 64.0 )); + FT_TRACE5(( " horiAdvance: %f\n", metrics->horiAdvance / 64.0 )); + FT_TRACE5(( "\n" )); + FT_TRACE5(( " vertBearingX: %f\n", metrics->vertBearingX / 64.0 )); + FT_TRACE5(( " vertBearingY: %f\n", metrics->vertBearingY / 64.0 )); + FT_TRACE5(( " vertAdvance: %f\n", metrics->vertAdvance / 64.0 )); + } #endif Exit: @@ -1842,15 +1860,15 @@ /* FT2 allocator takes signed long buffer length, * too large value causing overflow should be checked */ - FT_TRACE4(( " POST fragment #%d: length=0x%08x" - " total pfb_len=0x%08x\n", + FT_TRACE4(( " POST fragment #%d: length=0x%08lx" + " total pfb_len=0x%08lx\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%08x\n", + " 0x%08lx\n", FT_MAC_RFORK_MAX_LEN )); error = FT_THROW( Invalid_Offset ); @@ -1861,13 +1879,13 @@ } FT_TRACE2(( " total buffer size to concatenate" - " %d POST fragments: 0x%08x\n", + " %ld POST fragments: 0x%08lx\n", resource_cnt, pfb_len + 2 )); if ( pfb_len + 2 < 6 ) { FT_TRACE2(( " too long fragment length makes" - " pfb_len confused: pfb_len=0x%08x\n", + " pfb_len confused: pfb_len=0x%08lx\n", pfb_len )); error = FT_THROW( Array_Too_Large ); @@ -1910,7 +1928,7 @@ goto Exit2; FT_TRACE3(( "POST fragment[%d]:" - " offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n", + " offsets=0x%08lx, rlen=0x%08lx, flags=0x%04x\n", i, offsets[i], rlen, flags )); error = FT_ERR( Array_Too_Large ); @@ -1937,7 +1955,7 @@ else { FT_TRACE3(( " Write POST fragment #%d header (4-byte) to buffer" - " %p + 0x%08x\n", + " %p + 0x%08lx\n", i, pfb_data, pfb_lenpos )); if ( pfb_lenpos + 3 > pfb_len + 2 ) @@ -1952,7 +1970,7 @@ break; FT_TRACE3(( " Write POST fragment #%d header (6-byte) to buffer" - " %p + 0x%08x\n", + " %p + 0x%08lx\n", i, pfb_data, pfb_pos )); if ( pfb_pos + 6 > pfb_len + 2 ) @@ -1974,8 +1992,8 @@ if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len ) goto Exit2; - FT_TRACE3(( " Load POST fragment #%d (%d byte) to buffer" - " %p + 0x%08x\n", + FT_TRACE3(( " Load POST fragment #%d (%ld byte) to buffer" + " %p + 0x%08lx\n", i, rlen, pfb_data, pfb_pos )); error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen ); @@ -2260,7 +2278,7 @@ args2.flags = FT_OPEN_PATHNAME; args2.pathname = file_names[i] ? file_names[i] : args->pathname; - FT_TRACE3(( "Try rule %d: %s (offset=%d) ...", + FT_TRACE3(( "Try rule %d: %s (offset=%ld) ...", i, args2.pathname, offsets[i] )); error = FT_Stream_New( library, &args2, &stream2 ); @@ -2858,6 +2876,8 @@ if ( error ) { FT_FREE( node ); + if ( size ) + FT_FREE( size->internal ); FT_FREE( size ); } @@ -3213,9 +3233,9 @@ FT_Size_Metrics* metrics = &face->size->metrics; - FT_TRACE5(( " x scale: %d (%f)\n", + FT_TRACE5(( " x scale: %ld (%f)\n", metrics->x_scale, metrics->x_scale / 65536.0 )); - FT_TRACE5(( " y scale: %d (%f)\n", + FT_TRACE5(( " y scale: %ld (%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 )); @@ -3288,9 +3308,9 @@ FT_Size_Metrics* metrics = &face->size->metrics; - FT_TRACE5(( " x scale: %d (%f)\n", + FT_TRACE5(( " x scale: %ld (%f)\n", metrics->x_scale, metrics->x_scale / 65536.0 )); - FT_TRACE5(( " y scale: %d (%f)\n", + FT_TRACE5(( " y scale: %ld (%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 )); @@ -3450,7 +3470,7 @@ if ( akerning->x != orig_x_rounded || akerning->y != orig_y_rounded ) FT_TRACE5(( "FT_Get_Kerning: horizontal kerning" - " (%d, %d) scaled down to (%d, %d) pixels\n", + " (%ld, %ld) scaled down to (%ld, %ld) pixels\n", orig_x_rounded / 64, orig_y_rounded / 64, akerning->x / 64, akerning->y / 64 )); } @@ -3722,7 +3742,7 @@ if ( charcode > 0xFFFFFFFFUL ) { FT_TRACE1(( "FT_Get_Char_Index: too large charcode" )); - FT_TRACE1(( " 0x%x is truncated\n", charcode )); + FT_TRACE1(( " 0x%lx is truncated\n", charcode )); } result = cmap->clazz->char_index( cmap, (FT_UInt32)charcode ); @@ -3898,13 +3918,13 @@ { FT_TRACE1(( "FT_Face_GetCharVariantIndex:" " too large charcode" )); - FT_TRACE1(( " 0x%x is truncated\n", charcode )); + FT_TRACE1(( " 0x%lx is truncated\n", charcode )); } if ( variantSelector > 0xFFFFFFFFUL ) { FT_TRACE1(( "FT_Face_GetCharVariantIndex:" " too large variantSelector" )); - FT_TRACE1(( " 0x%x is truncated\n", variantSelector )); + FT_TRACE1(( " 0x%lx is truncated\n", variantSelector )); } result = vcmap->clazz->char_var_index( vcmap, ucmap, @@ -3941,13 +3961,13 @@ { FT_TRACE1(( "FT_Face_GetCharVariantIsDefault:" " too large charcode" )); - FT_TRACE1(( " 0x%x is truncated\n", charcode )); + FT_TRACE1(( " 0x%lx is truncated\n", charcode )); } if ( variantSelector > 0xFFFFFFFFUL ) { FT_TRACE1(( "FT_Face_GetCharVariantIsDefault:" " too large variantSelector" )); - FT_TRACE1(( " 0x%x is truncated\n", variantSelector )); + FT_TRACE1(( " 0x%lx is truncated\n", variantSelector )); } result = vcmap->clazz->char_var_default( vcmap, @@ -4010,7 +4030,7 @@ if ( charcode > 0xFFFFFFFFUL ) { FT_TRACE1(( "FT_Face_GetVariantsOfChar: too large charcode" )); - FT_TRACE1(( " 0x%x is truncated\n", charcode )); + FT_TRACE1(( " 0x%lx is truncated\n", charcode )); } result = vcmap->clazz->charvariant_list( vcmap, memory, @@ -4044,7 +4064,7 @@ if ( variantSelector > 0xFFFFFFFFUL ) { FT_TRACE1(( "FT_Get_Char_Index: too large variantSelector" )); - FT_TRACE1(( " 0x%x is truncated\n", variantSelector )); + FT_TRACE1(( " 0x%lx is truncated\n", variantSelector )); } result = vcmap->clazz->variantchar_list( vcmap, memory, diff --git a/lib/freetype/src/base/ftotval.c b/lib/freetype/src/base/ftotval.c index 9f69e0c1f..90a5dd617 100644 --- a/lib/freetype/src/base/ftotval.c +++ b/lib/freetype/src/base/ftotval.c @@ -15,12 +15,11 @@ * */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_OPENTYPE_VALIDATE_H -#include FT_OPENTYPE_VALIDATE_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/services/svotval.h> +#include <freetype/ftotval.h> /* documentation is in ftotval.h */ diff --git a/lib/freetype/src/base/ftoutln.c b/lib/freetype/src/base/ftoutln.c index faaae8329..311f098e3 100644 --- a/lib/freetype/src/base/ftoutln.c +++ b/lib/freetype/src/base/ftoutln.c @@ -16,12 +16,11 @@ */ -#include <ft2build.h> -#include FT_OUTLINE_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_DEBUG_H -#include FT_TRIGONOMETRY_H +#include <freetype/ftoutln.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftcalc.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/fttrigon.h> /************************************************************************** @@ -275,7 +274,7 @@ first = (FT_UInt)last + 1; } - FT_TRACE5(( "FT_Outline_Decompose: Done\n", n )); + FT_TRACE5(( "FT_Outline_Decompose: Done\n" )); return FT_Err_Ok; Invalid_Outline: @@ -1061,6 +1060,11 @@ 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/lib/freetype/src/base/ftpatent.c b/lib/freetype/src/base/ftpatent.c index 077a9b03f..a02c636a6 100644 --- a/lib/freetype/src/base/ftpatent.c +++ b/lib/freetype/src/base/ftpatent.c @@ -16,13 +16,12 @@ * */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_TRUETYPE_TAGS_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_STREAM_H -#include FT_SERVICE_SFNT_H -#include FT_SERVICE_TRUETYPE_GLYF_H +#include <freetype/freetype.h> +#include <freetype/tttags.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/services/svsfnt.h> +#include <freetype/internal/services/svttglyf.h> /* documentation is in freetype.h */ diff --git a/lib/freetype/src/base/ftpfr.c b/lib/freetype/src/base/ftpfr.c index 57e65665f..c656fcd9b 100644 --- a/lib/freetype/src/base/ftpfr.c +++ b/lib/freetype/src/base/ftpfr.c @@ -15,11 +15,10 @@ * */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_PFR_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/services/svpfr.h> /* check the format */ diff --git a/lib/freetype/src/base/ftpsprop.c b/lib/freetype/src/base/ftpsprop.c index c63f864c1..8c29f50f6 100644 --- a/lib/freetype/src/base/ftpsprop.c +++ b/lib/freetype/src/base/ftpsprop.c @@ -17,12 +17,11 @@ */ -#include <ft2build.h> -#include FT_DRIVER_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_POSTSCRIPT_PROPS_H +#include <freetype/ftdriver.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/psaux.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftpsprop.h> /************************************************************************** diff --git a/lib/freetype/src/base/ftrfork.c b/lib/freetype/src/base/ftrfork.c index 1bf7800f1..f989be47f 100644 --- a/lib/freetype/src/base/ftrfork.c +++ b/lib/freetype/src/base/ftrfork.c @@ -24,10 +24,9 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_RFORK_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/ftrfork.h> #include "ftbase.h" @@ -240,7 +239,7 @@ (char)( 0xFF & ( tag_internal >> 16 ) ), (char)( 0xFF & ( tag_internal >> 8 ) ), (char)( 0xFF & ( tag_internal >> 0 ) ) )); - FT_TRACE3(( " : subcount=%d, suboffset=0x%04x\n", + FT_TRACE3(( " : subcount=%d, suboffset=0x%04lx\n", subcnt, rpos )); if ( tag_internal == tag ) @@ -286,7 +285,7 @@ ref[j].offset = temp & 0xFFFFFFL; FT_TRACE3(( " [%d]:" - " resource_id=0x%04x, offset=0x%08x\n", + " resource_id=0x%04x, offset=0x%08lx\n", j, (FT_UShort)ref[j].res_id, ref[j].offset )); } @@ -302,7 +301,7 @@ for ( j = 0; j < *count; j++ ) FT_TRACE3(( " [%d]:" - " resource_id=0x%04x, offset=0x%08x\n", + " resource_id=0x%04x, offset=0x%08lx\n", j, ref[j].res_id, ref[j].offset )); } diff --git a/lib/freetype/src/base/ftsnames.c b/lib/freetype/src/base/ftsnames.c index 25f5d45be..8507f28d3 100644 --- a/lib/freetype/src/base/ftsnames.c +++ b/lib/freetype/src/base/ftsnames.c @@ -19,12 +19,11 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> -#include FT_SFNT_NAMES_H -#include FT_INTERNAL_TRUETYPE_TYPES_H -#include FT_INTERNAL_STREAM_H +#include <freetype/ftsnames.h> +#include <freetype/internal/tttypes.h> +#include <freetype/internal/ftstream.h> #ifdef TT_CONFIG_OPTION_SFNT_NAMES diff --git a/lib/freetype/src/base/ftstream.c b/lib/freetype/src/base/ftstream.c index 7dbf9b55f..d940254d8 100644 --- a/lib/freetype/src/base/ftstream.c +++ b/lib/freetype/src/base/ftstream.c @@ -16,9 +16,8 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftstream.h> +#include <freetype/internal/ftdebug.h> /************************************************************************** diff --git a/lib/freetype/src/base/ftstroke.c b/lib/freetype/src/base/ftstroke.c index 3369dc24b..56f98e1d9 100644 --- a/lib/freetype/src/base/ftstroke.c +++ b/lib/freetype/src/base/ftstroke.c @@ -16,13 +16,12 @@ */ -#include <ft2build.h> -#include FT_STROKER_H -#include FT_TRIGONOMETRY_H -#include FT_OUTLINE_H -#include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/ftstroke.h> +#include <freetype/fttrigon.h> +#include <freetype/ftoutln.h> +#include <freetype/internal/ftmemory.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftobjs.h> /* declare an extern to access `ft_outline_glyph_class' globally */ diff --git a/lib/freetype/src/base/ftsynth.c b/lib/freetype/src/base/ftsynth.c index eee6b952b..a9119e2b2 100644 --- a/lib/freetype/src/base/ftsynth.c +++ b/lib/freetype/src/base/ftsynth.c @@ -16,12 +16,11 @@ */ -#include <ft2build.h> -#include FT_SYNTHESIS_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_OBJECTS_H -#include FT_OUTLINE_H -#include FT_BITMAP_H +#include <freetype/ftsynth.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/ftoutln.h> +#include <freetype/ftbitmap.h> /************************************************************************** @@ -130,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=%d\n", ystr )); + FT_TRACE1(( "too strong emboldening parameter ystr=%ld\n", ystr )); return; } error = FT_GlyphSlot_Own_Bitmap( slot ); diff --git a/lib/freetype/src/base/ftsystem.c b/lib/freetype/src/base/ftsystem.c index 290100613..3013cbda9 100644 --- a/lib/freetype/src/base/ftsystem.c +++ b/lib/freetype/src/base/ftsystem.c @@ -27,11 +27,11 @@ #include <ft2build.h> #include FT_CONFIG_CONFIG_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_SYSTEM_H -#include FT_ERRORS_H -#include FT_TYPES_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/ftsystem.h> +#include <freetype/fterrors.h> +#include <freetype/fttypes.h> /************************************************************************** diff --git a/lib/freetype/src/base/fttrigon.c b/lib/freetype/src/base/fttrigon.c index dbe11107b..c6f027cf6 100644 --- a/lib/freetype/src/base/fttrigon.c +++ b/lib/freetype/src/base/fttrigon.c @@ -29,10 +29,9 @@ * */ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_CALC_H -#include FT_TRIGONOMETRY_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftcalc.h> +#include <freetype/fttrigon.h> /* the Cordic shrink factor 0.858785336480436 * 2^32 */ diff --git a/lib/freetype/src/base/fttype1.c b/lib/freetype/src/base/fttype1.c index 61778faa7..be60ed6ec 100644 --- a/lib/freetype/src/base/fttype1.c +++ b/lib/freetype/src/base/fttype1.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_SERVICE_H -#include FT_SERVICE_POSTSCRIPT_INFO_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftserv.h> +#include <freetype/internal/services/svpsinfo.h> /* documentation is in t1tables.h */ diff --git a/lib/freetype/src/base/ftutil.c b/lib/freetype/src/base/ftutil.c index 629af174b..d90cfbcd2 100644 --- a/lib/freetype/src/base/ftutil.c +++ b/lib/freetype/src/base/ftutil.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_OBJECTS_H -#include FT_LIST_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftmemory.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/ftlist.h> /************************************************************************** diff --git a/lib/freetype/src/base/ftwinfnt.c b/lib/freetype/src/base/ftwinfnt.c index 77527277c..699dc3d70 100644 --- a/lib/freetype/src/base/ftwinfnt.c +++ b/lib/freetype/src/base/ftwinfnt.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_WINFONTS_H -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_WINFNT_H +#include <freetype/internal/ftdebug.h> +#include <freetype/ftwinfnt.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/services/svwinfnt.h> /* documentation is in ftwinfnt.h */ diff --git a/lib/freetype/src/bdf/Jamfile b/lib/freetype/src/bdf/Jamfile deleted file mode 100644 index 777090c9d..000000000 --- a/lib/freetype/src/bdf/Jamfile +++ /dev/null @@ -1,31 +0,0 @@ -# FreeType 2 src/bdf Jamfile -# -# Copyright (C) 2002-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) bdf ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = bdfdrivr - bdflib - ; - } - else - { - _sources = bdf ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/bdf Jamfile diff --git a/lib/freetype/src/bdf/bdf.c b/lib/freetype/src/bdf/bdf.c index e54df6649..249012e59 100644 --- a/lib/freetype/src/bdf/bdf.c +++ b/lib/freetype/src/bdf/bdf.c @@ -26,7 +26,6 @@ THE SOFTWARE. #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "bdflib.c" #include "bdfdrivr.c" diff --git a/lib/freetype/src/bdf/bdf.h b/lib/freetype/src/bdf/bdf.h index d9abd2378..5acbd5f2f 100644 --- a/lib/freetype/src/bdf/bdf.h +++ b/lib/freetype/src/bdf/bdf.h @@ -30,10 +30,9 @@ * Based on bdf.h,v 1.16 2000/03/16 20:08:51 mleisher */ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_HASH_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/fthash.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/bdf/bdfdrivr.c b/lib/freetype/src/bdf/bdfdrivr.c index 60eb93305..d29188b97 100644 --- a/lib/freetype/src/bdf/bdfdrivr.c +++ b/lib/freetype/src/bdf/bdfdrivr.c @@ -24,16 +24,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_OBJECTS_H -#include FT_BDF_H -#include FT_TRUETYPE_IDS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/ftbdf.h> +#include <freetype/ttnameid.h> -#include FT_SERVICE_BDF_H -#include FT_SERVICE_FONT_FORMAT_H +#include <freetype/internal/services/svbdf.h> +#include <freetype/internal/services/svfntfmt.h> #include "bdf.h" #include "bdfdrivr.h" @@ -184,7 +183,8 @@ THE SOFTWARE. Exit: if ( charcode > 0xFFFFFFFFUL ) { - FT_TRACE1(( "bdf_cmap_char_next: charcode 0x%x > 32bit API" )); + FT_TRACE1(( "bdf_cmap_char_next: charcode 0x%lx > 32bit API", + charcode )); *acharcode = 0; /* XXX: result should be changed to indicate an overflow error */ } @@ -402,10 +402,10 @@ THE SOFTWARE. bdf_property_t* prop = NULL; - FT_TRACE4(( " number of glyphs: allocated %d (used %d)\n", + FT_TRACE4(( " number of glyphs: allocated %ld (used %ld)\n", font->glyphs_size, font->glyphs_used )); - FT_TRACE4(( " number of unencoded glyphs: allocated %d (used %d)\n", + FT_TRACE4(( " number of unencoded glyphs: allocated %ld (used %ld)\n", font->unencoded_size, font->unencoded_used )); @@ -457,13 +457,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 %d\n", + FT_TRACE0(( "BDF_Face_Init: clamping font ascent to value %ld\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 %d\n", + FT_TRACE0(( "BDF_Face_Init: clamping font descent to value %ld\n", font->font_descent )); } @@ -504,7 +504,7 @@ THE SOFTWARE. prop->value.l < -0x504C2L ) { bsize->size = 0x7FFF; - FT_TRACE0(( "BDF_Face_Init: clamping point size to value %d\n", + FT_TRACE0(( "BDF_Face_Init: clamping point size to value %ld\n", bsize->size )); } else @@ -517,7 +517,7 @@ THE SOFTWARE. if ( font->point_size > 0x7FFF ) { bsize->size = 0x7FFF; - FT_TRACE0(( "BDF_Face_Init: clamping point size to value %d\n", + FT_TRACE0(( "BDF_Face_Init: clamping point size to value %ld\n", bsize->size )); } else @@ -539,7 +539,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 %d\n", + FT_TRACE0(( "BDF_Face_Init: clamping pixel size to value %ld\n", bsize->y_ppem )); } else @@ -615,7 +615,7 @@ THE SOFTWARE. for ( n = 0; n < font->glyphs_size; n++ ) { (face->en_table[n]).enc = cur[n].encoding; - FT_TRACE4(( " idx %d, val 0x%lX\n", n, cur[n].encoding )); + FT_TRACE4(( " idx %ld, 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 +624,7 @@ THE SOFTWARE. face->default_glyph = (FT_UInt)n; else FT_TRACE1(( "BDF_Face_Init:" - " idx %d is too large for this system\n", n )); + " idx %ld is too large for this system\n", n )); } } } @@ -825,7 +825,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 %d is truncated\n", + FT_TRACE1(( "BDF_Glyph_Load: too large pitch %ld is truncated\n", glyph.bpr )); bitmap->pitch = (int)glyph.bpr; /* same as FT_Bitmap.pitch */ @@ -902,7 +902,8 @@ THE SOFTWARE. if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) ) { FT_TRACE1(( "bdf_get_bdf_property:" - " too large integer 0x%x is truncated\n" )); + " too large integer 0x%lx is truncated\n", + prop->value.l )); } aproperty->type = BDF_PROPERTY_TYPE_INTEGER; aproperty->u.integer = (FT_Int32)prop->value.l; @@ -912,7 +913,8 @@ THE SOFTWARE. if ( prop->value.ul > 0xFFFFFFFFUL ) { FT_TRACE1(( "bdf_get_bdf_property:" - " too large cardinal 0x%x is truncated\n" )); + " too large cardinal 0x%lx is truncated\n", + prop->value.ul )); } aproperty->type = BDF_PROPERTY_TYPE_CARDINAL; aproperty->u.cardinal = (FT_UInt32)prop->value.ul; diff --git a/lib/freetype/src/bdf/bdfdrivr.h b/lib/freetype/src/bdf/bdfdrivr.h index b37b84ea3..54aaa3353 100644 --- a/lib/freetype/src/bdf/bdfdrivr.h +++ b/lib/freetype/src/bdf/bdfdrivr.h @@ -28,8 +28,7 @@ THE SOFTWARE. #ifndef BDFDRIVR_H_ #define BDFDRIVR_H_ -#include <ft2build.h> -#include FT_INTERNAL_DRIVER_H +#include <freetype/internal/ftdrv.h> #include "bdf.h" diff --git a/lib/freetype/src/bdf/bdferror.h b/lib/freetype/src/bdf/bdferror.h index dbe41c02a..c1b544487 100644 --- a/lib/freetype/src/bdf/bdferror.h +++ b/lib/freetype/src/bdf/bdferror.h @@ -29,7 +29,7 @@ #ifndef BDFERROR_H_ #define BDFERROR_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -37,7 +37,7 @@ #define FT_ERR_PREFIX BDF_Err_ #define FT_ERR_BASE FT_Mod_Err_BDF -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* BDFERROR_H_ */ diff --git a/lib/freetype/src/bdf/bdflib.c b/lib/freetype/src/bdf/bdflib.c index 63813f7ed..a4ddb9a1d 100644 --- a/lib/freetype/src/bdf/bdflib.c +++ b/lib/freetype/src/bdf/bdflib.c @@ -31,12 +31,11 @@ */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/freetype.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/ftobjs.h> #include "bdf.h" #include "bdferror.h" diff --git a/lib/freetype/src/bzip2/Jamfile b/lib/freetype/src/bzip2/Jamfile deleted file mode 100644 index 085180d6f..000000000 --- a/lib/freetype/src/bzip2/Jamfile +++ /dev/null @@ -1,18 +0,0 @@ -# FreeType 2 src/bzip2 Jamfile -# -# Copyright (C) 2010-2020 by -# Joel Klinghed -# -# based on `src/lzw/Jamfile' -# -# 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. - -SubDir FT2_TOP $(FT2_SRC_DIR) bzip2 ; - -Library $(FT2_LIB) : ftbzip2.c ; - -# end of src/bzip2 Jamfile diff --git a/lib/freetype/src/bzip2/ftbzip2.c b/lib/freetype/src/bzip2/ftbzip2.c index e4d7a4901..411c5d263 100644 --- a/lib/freetype/src/bzip2/ftbzip2.c +++ b/lib/freetype/src/bzip2/ftbzip2.c @@ -22,15 +22,14 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_DEBUG_H -#include FT_BZIP2_H +#include <freetype/internal/ftmemory.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/ftbzip2.h> #include FT_CONFIG_STANDARD_LIBRARY_H -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -38,7 +37,7 @@ #define FT_ERR_PREFIX Bzip2_Err_ #define FT_ERR_BASE FT_Mod_Err_Bzip2 -#include FT_ERRORS_H +#include <freetype/fterrors.h> #ifdef FT_CONFIG_OPTION_USE_BZIP2 diff --git a/lib/freetype/src/cache/Jamfile b/lib/freetype/src/cache/Jamfile deleted file mode 100644 index 4db9e0a77..000000000 --- a/lib/freetype/src/cache/Jamfile +++ /dev/null @@ -1,37 +0,0 @@ -# FreeType 2 src/cache Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) cache ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = ftcbasic - ftccache - ftcglyph - ftcimage - ftcmanag - ftccmap - ftcmru - ftcsbits - ; - } - else - { - _sources = ftcache ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/cache Jamfile diff --git a/lib/freetype/src/cache/ftcache.c b/lib/freetype/src/cache/ftcache.c index 4137f6869..e90f4639c 100644 --- a/lib/freetype/src/cache/ftcache.c +++ b/lib/freetype/src/cache/ftcache.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "ftcbasic.c" #include "ftccache.c" diff --git a/lib/freetype/src/cache/ftcbasic.c b/lib/freetype/src/cache/ftcbasic.c index a65a90e86..43ea314d4 100644 --- a/lib/freetype/src/cache/ftcbasic.c +++ b/lib/freetype/src/cache/ftcbasic.c @@ -16,10 +16,9 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H -#include FT_CACHE_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/ftcache.h> #include "ftcglyph.h" #include "ftcimage.h" #include "ftcsbits.h" @@ -111,7 +110,9 @@ if ( (FT_ULong)face->num_glyphs > FT_UINT_MAX || 0 > face->num_glyphs ) FT_TRACE1(( "ftc_basic_family_get_count:" - " too large number of glyphs in this face, truncated\n", + " the number of glyphs in this face is %ld,\n" + " " + " which is too much and thus truncated\n", face->num_glyphs )); if ( !error ) @@ -394,7 +395,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%x are dropped\n", + " higher bits in load_flags 0x%lx are dropped\n", load_flags & ~((FT_ULong)FT_UINT_MAX) )); #endif @@ -594,7 +595,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%x are dropped\n", + " higher bits in load_flags 0x%lx are dropped\n", load_flags & ~((FT_ULong)FT_UINT_MAX) )); #endif diff --git a/lib/freetype/src/cache/ftccache.c b/lib/freetype/src/cache/ftccache.c index 1d406c420..1c8e0f322 100644 --- a/lib/freetype/src/cache/ftccache.c +++ b/lib/freetype/src/cache/ftccache.c @@ -16,10 +16,9 @@ */ -#include <ft2build.h> #include "ftcmanag.h" -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> #include "ftccback.h" #include "ftcerror.h" diff --git a/lib/freetype/src/cache/ftccache.h b/lib/freetype/src/cache/ftccache.h index 2996ee808..11698bb0e 100644 --- a/lib/freetype/src/cache/ftccache.h +++ b/lib/freetype/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/lib/freetype/src/cache/ftccback.h b/lib/freetype/src/cache/ftccback.h index 252be7c2b..542acb156 100644 --- a/lib/freetype/src/cache/ftccback.h +++ b/lib/freetype/src/cache/ftccback.h @@ -18,14 +18,14 @@ #ifndef FTCCBACK_H_ #define FTCCBACK_H_ -#include <ft2build.h> -#include FT_CACHE_H +#include <freetype/ftcache.h> #include "ftcmru.h" #include "ftcimage.h" #include "ftcmanag.h" #include "ftcglyph.h" #include "ftcsbits.h" +FT_BEGIN_HEADER FT_LOCAL( void ) ftc_inode_free( FTC_Node inode, @@ -85,6 +85,7 @@ ftc_node_destroy( FTC_Node node, FTC_Manager manager ); +FT_END_HEADER #endif /* FTCCBACK_H_ */ diff --git a/lib/freetype/src/cache/ftccmap.c b/lib/freetype/src/cache/ftccmap.c index a5da694d5..468c008cf 100644 --- a/lib/freetype/src/cache/ftccmap.c +++ b/lib/freetype/src/cache/ftccmap.c @@ -16,13 +16,12 @@ */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_CACHE_H +#include <freetype/freetype.h> +#include <freetype/ftcache.h> #include "ftcmanag.h" -#include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftmemory.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> #include "ftccback.h" #include "ftcerror.h" diff --git a/lib/freetype/src/cache/ftcerror.h b/lib/freetype/src/cache/ftcerror.h index 15e416ed2..bedfd2837 100644 --- a/lib/freetype/src/cache/ftcerror.h +++ b/lib/freetype/src/cache/ftcerror.h @@ -26,7 +26,7 @@ #ifndef FTCERROR_H_ #define FTCERROR_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -34,7 +34,7 @@ #define FT_ERR_PREFIX FTC_Err_ #define FT_ERR_BASE FT_Mod_Err_Cache -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* FTCERROR_H_ */ diff --git a/lib/freetype/src/cache/ftcglyph.c b/lib/freetype/src/cache/ftcglyph.c index 559a2fb4c..7f5438aad 100644 --- a/lib/freetype/src/cache/ftcglyph.c +++ b/lib/freetype/src/cache/ftcglyph.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_CACHE_H +#include <freetype/internal/ftobjs.h> +#include <freetype/ftcache.h> #include "ftcglyph.h" -#include FT_ERRORS_H +#include <freetype/fterrors.h> #include "ftccback.h" #include "ftcerror.h" diff --git a/lib/freetype/src/cache/ftcglyph.h b/lib/freetype/src/cache/ftcglyph.h index ef689f994..5629545f3 100644 --- a/lib/freetype/src/cache/ftcglyph.h +++ b/lib/freetype/src/cache/ftcglyph.h @@ -117,7 +117,6 @@ #define FTCGLYPH_H_ -#include <ft2build.h> #include "ftcmanag.h" diff --git a/lib/freetype/src/cache/ftcimage.c b/lib/freetype/src/cache/ftcimage.c index 7696b2e52..58ebad8c9 100644 --- a/lib/freetype/src/cache/ftcimage.c +++ b/lib/freetype/src/cache/ftcimage.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_CACHE_H +#include <freetype/ftcache.h> #include "ftcimage.h" -#include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftmemory.h> +#include <freetype/internal/ftobjs.h> #include "ftccback.h" #include "ftcerror.h" diff --git a/lib/freetype/src/cache/ftcimage.h b/lib/freetype/src/cache/ftcimage.h index f99c5074c..a400788b3 100644 --- a/lib/freetype/src/cache/ftcimage.h +++ b/lib/freetype/src/cache/ftcimage.h @@ -36,8 +36,7 @@ #define FTCIMAGE_H_ -#include <ft2build.h> -#include FT_CACHE_H +#include <freetype/ftcache.h> #include "ftcglyph.h" FT_BEGIN_HEADER diff --git a/lib/freetype/src/cache/ftcmanag.c b/lib/freetype/src/cache/ftcmanag.c index a6f1733f6..436d41f37 100644 --- a/lib/freetype/src/cache/ftcmanag.c +++ b/lib/freetype/src/cache/ftcmanag.c @@ -16,12 +16,11 @@ */ -#include <ft2build.h> -#include FT_CACHE_H +#include <freetype/ftcache.h> #include "ftcmanag.h" -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H -#include FT_SIZES_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/ftsizes.h> #include "ftccback.h" #include "ftcerror.h" diff --git a/lib/freetype/src/cache/ftcmanag.h b/lib/freetype/src/cache/ftcmanag.h index 17ade7175..6c6ec6854 100644 --- a/lib/freetype/src/cache/ftcmanag.h +++ b/lib/freetype/src/cache/ftcmanag.h @@ -63,8 +63,7 @@ #define FTCMANAG_H_ -#include <ft2build.h> -#include FT_CACHE_H +#include <freetype/ftcache.h> #include "ftcmru.h" #include "ftccache.h" diff --git a/lib/freetype/src/cache/ftcmru.c b/lib/freetype/src/cache/ftcmru.c index 370ae3be0..8feed45f6 100644 --- a/lib/freetype/src/cache/ftcmru.c +++ b/lib/freetype/src/cache/ftcmru.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_CACHE_H +#include <freetype/ftcache.h> #include "ftcmru.h" -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> #include "ftcerror.h" diff --git a/lib/freetype/src/cache/ftcmru.h b/lib/freetype/src/cache/ftcmru.h index 1591c2080..ac4f9b126 100644 --- a/lib/freetype/src/cache/ftcmru.h +++ b/lib/freetype/src/cache/ftcmru.h @@ -44,8 +44,8 @@ #define FTCMRU_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#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/lib/freetype/src/cache/ftcsbits.c b/lib/freetype/src/cache/ftcsbits.c index 24e4aa131..e0db930af 100644 --- a/lib/freetype/src/cache/ftcsbits.c +++ b/lib/freetype/src/cache/ftcsbits.c @@ -16,12 +16,11 @@ */ -#include <ft2build.h> -#include FT_CACHE_H +#include <freetype/ftcache.h> #include "ftcsbits.h" -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H -#include FT_ERRORS_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/fterrors.h> #include "ftccback.h" #include "ftcerror.h" diff --git a/lib/freetype/src/cache/ftcsbits.h b/lib/freetype/src/cache/ftcsbits.h index 2517d1555..46f797e72 100644 --- a/lib/freetype/src/cache/ftcsbits.h +++ b/lib/freetype/src/cache/ftcsbits.h @@ -20,8 +20,7 @@ #define FTCSBITS_H_ -#include <ft2build.h> -#include FT_CACHE_H +#include <freetype/ftcache.h> #include "ftcglyph.h" diff --git a/lib/freetype/src/cff/Jamfile b/lib/freetype/src/cff/Jamfile deleted file mode 100644 index 6c818c1e2..000000000 --- a/lib/freetype/src/cff/Jamfile +++ /dev/null @@ -1,36 +0,0 @@ -# FreeType 2 src/cff Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) cff ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = cffcmap - cffdrivr - cffgload - cffload - cffobjs - cffparse - cffpic - ; - } - else - { - _sources = cff ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/cff Jamfile diff --git a/lib/freetype/src/cff/cff.c b/lib/freetype/src/cff/cff.c index 755228bb6..0fa6c8787 100644 --- a/lib/freetype/src/cff/cff.c +++ b/lib/freetype/src/cff/cff.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "cffcmap.c" #include "cffdrivr.c" diff --git a/lib/freetype/src/cff/cffcmap.c b/lib/freetype/src/cff/cffcmap.c index 1a045765d..6d16ed422 100644 --- a/lib/freetype/src/cff/cffcmap.c +++ b/lib/freetype/src/cff/cffcmap.c @@ -16,8 +16,7 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include "cffcmap.h" #include "cffload.h" diff --git a/lib/freetype/src/cff/cffcmap.h b/lib/freetype/src/cff/cffcmap.h index 319be8824..69fab8dc6 100644 --- a/lib/freetype/src/cff/cffcmap.h +++ b/lib/freetype/src/cff/cffcmap.h @@ -19,7 +19,7 @@ #ifndef CFFCMAP_H_ #define CFFCMAP_H_ -#include FT_INTERNAL_CFF_OBJECTS_TYPES_H +#include <freetype/internal/cffotypes.h> FT_BEGIN_HEADER @@ -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/lib/freetype/src/cff/cffdrivr.c b/lib/freetype/src/cff/cffdrivr.c index 6d0dcd09d..486ab2423 100644 --- a/lib/freetype/src/cff/cffdrivr.c +++ b/lib/freetype/src/cff/cffdrivr.c @@ -16,18 +16,17 @@ */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_SFNT_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_INTERNAL_POSTSCRIPT_PROPS_H -#include FT_SERVICE_CID_H -#include FT_SERVICE_POSTSCRIPT_INFO_H -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_TT_CMAP_H -#include FT_SERVICE_CFF_TABLE_LOAD_H +#include <freetype/freetype.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/sfnt.h> +#include <freetype/internal/psaux.h> +#include <freetype/internal/ftpsprop.h> +#include <freetype/internal/services/svcid.h> +#include <freetype/internal/services/svpsinfo.h> +#include <freetype/internal/services/svpostnm.h> +#include <freetype/internal/services/svttcmap.h> +#include <freetype/internal/services/svcfftl.h> #include "cffdrivr.h" #include "cffgload.h" @@ -37,16 +36,16 @@ #include "cffobjs.h" #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include FT_SERVICE_MULTIPLE_MASTERS_H -#include FT_SERVICE_METRICS_VARIATIONS_H +#include <freetype/internal/services/svmm.h> +#include <freetype/internal/services/svmetric.h> #endif #include "cfferrs.h" -#include FT_SERVICE_FONT_FORMAT_H -#include FT_SERVICE_GLYPH_DICT_H -#include FT_SERVICE_PROPERTIES_H -#include FT_DRIVER_H +#include <freetype/internal/services/svfntfmt.h> +#include <freetype/internal/services/svgldict.h> +#include <freetype/internal/services/svprop.h> +#include <freetype/ftdriver.h> /************************************************************************** @@ -738,7 +737,7 @@ { if ( dict->cid_supplement < FT_INT_MIN || dict->cid_supplement > FT_INT_MAX ) - FT_TRACE1(( "cff_get_ros: too large supplement %d is truncated\n", + FT_TRACE1(( "cff_get_ros: too large supplement %ld is truncated\n", dict->cid_supplement )); *supplement = (FT_Int)dict->cid_supplement; } diff --git a/lib/freetype/src/cff/cffdrivr.h b/lib/freetype/src/cff/cffdrivr.h index 25471d511..d198dd35c 100644 --- a/lib/freetype/src/cff/cffdrivr.h +++ b/lib/freetype/src/cff/cffdrivr.h @@ -20,8 +20,7 @@ #define CFFDRIVER_H_ -#include <ft2build.h> -#include FT_INTERNAL_DRIVER_H +#include <freetype/internal/ftdrv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/cff/cfferrs.h b/lib/freetype/src/cff/cfferrs.h index 32be8a763..5b00a3f0a 100644 --- a/lib/freetype/src/cff/cfferrs.h +++ b/lib/freetype/src/cff/cfferrs.h @@ -25,7 +25,7 @@ #ifndef CFFERRS_H_ #define CFFERRS_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -34,7 +34,7 @@ #define FT_ERR_BASE FT_Mod_Err_CFF -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* CFFERRS_H_ */ diff --git a/lib/freetype/src/cff/cffgload.c b/lib/freetype/src/cff/cffgload.c index 1c4e1979c..feee38a41 100644 --- a/lib/freetype/src/cff/cffgload.c +++ b/lib/freetype/src/cff/cffgload.c @@ -16,14 +16,13 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_SFNT_H -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_OUTLINE_H -#include FT_DRIVER_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/sfnt.h> +#include <freetype/internal/ftcalc.h> +#include <freetype/internal/psaux.h> +#include <freetype/ftoutln.h> +#include <freetype/ftdriver.h> #include "cffload.h" #include "cffgload.h" @@ -207,8 +206,8 @@ PSAux_Service psaux = (PSAux_Service)face->psaux; const CFF_Decoder_Funcs decoder_funcs = psaux->cff_decoder_funcs; - FT_Matrix font_matrix; - FT_Vector font_offset; + FT_Matrix font_matrix; + FT_Vector font_offset; force_scaling = FALSE; @@ -364,7 +363,6 @@ top_upm = (FT_Long)cff->top_font.font_dict.units_per_em; sub_upm = (FT_Long)cff->subfonts[fd_index]->font_dict.units_per_em; - font_matrix = cff->subfonts[fd_index]->font_dict.font_matrix; font_offset = cff->subfonts[fd_index]->font_dict.font_offset; @@ -399,7 +397,6 @@ PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( face ); #endif - FT_Byte* charstring; FT_ULong charstring_len; @@ -665,8 +662,12 @@ metrics->horiBearingY = cbox.yMax; if ( has_vertical_info ) + { metrics->vertBearingX = metrics->horiBearingX - metrics->horiAdvance / 2; + metrics->vertBearingY = FT_MulFix( metrics->vertBearingY, + glyph->y_scale ); + } else { if ( load_flags & FT_LOAD_VERTICAL_LAYOUT ) diff --git a/lib/freetype/src/cff/cffgload.h b/lib/freetype/src/cff/cffgload.h index b4ad61a56..3b312f452 100644 --- a/lib/freetype/src/cff/cffgload.h +++ b/lib/freetype/src/cff/cffgload.h @@ -20,9 +20,8 @@ #define CFFGLOAD_H_ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_INTERNAL_CFF_OBJECTS_TYPES_H +#include <freetype/freetype.h> +#include <freetype/internal/cffotypes.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/cff/cffload.c b/lib/freetype/src/cff/cffload.c index 9f1d0e2e6..73d3eecd3 100644 --- a/lib/freetype/src/cff/cffload.c +++ b/lib/freetype/src/cff/cffload.c @@ -16,17 +16,16 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H -#include FT_TYPE1_TABLES_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftstream.h> +#include <freetype/tttags.h> +#include <freetype/t1tables.h> +#include <freetype/internal/psaux.h> #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include FT_MULTIPLE_MASTERS_H -#include FT_SERVICE_MULTIPLE_MASTERS_H +#include <freetype/ftmm.h> +#include <freetype/internal/services/svmm.h> #endif #include "cffload.h" @@ -411,7 +410,7 @@ FT_Error error = FT_Err_Ok; FT_Memory memory = idx->stream->memory; - FT_Byte** t = NULL; + FT_Byte** tbl = NULL; FT_Byte* new_bytes = NULL; FT_ULong new_size; @@ -428,11 +427,11 @@ new_size = idx->data_size + idx->count; if ( idx->count > 0 && - !FT_NEW_ARRAY( t, idx->count + 1 ) && + !FT_NEW_ARRAY( tbl, 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; @@ -443,15 +442,15 @@ if ( cur_offset != 0 ) { FT_TRACE0(( "cff_index_get_pointers:" - " invalid first offset value %d set to zero\n", + " invalid first offset value %ld set to zero\n", cur_offset )); cur_offset = 0; } if ( !pool ) - t[0] = org_bytes + cur_offset; + tbl[0] = org_bytes + cur_offset; else - t[0] = new_bytes + cur_offset; + tbl[0] = new_bytes + cur_offset; for ( n = 1; n <= idx->count; n++ ) { @@ -465,23 +464,25 @@ next_offset = idx->data_size; if ( !pool ) - t[n] = org_bytes + next_offset; + tbl[n] = org_bytes + next_offset; else { - t[n] = new_bytes + next_offset + extra; + tbl[n] = new_bytes + next_offset + extra; if ( next_offset != cur_offset ) { - FT_MEM_COPY( t[n - 1], org_bytes + cur_offset, t[n] - t[n - 1] ); - t[n][0] = '\0'; - t[n] += 1; + FT_MEM_COPY( tbl[n - 1], + org_bytes + cur_offset, + tbl[n] - tbl[n - 1] ); + tbl[n][0] = '\0'; + tbl[n] += 1; extra++; } } cur_offset = next_offset; } - *table = t; + *table = tbl; if ( pool ) *pool = new_bytes; @@ -490,6 +491,11 @@ } Exit: + if ( error && new_bytes ) + FT_FREE( new_bytes ); + if ( error && tbl ) + FT_FREE( tbl ); + return error; } @@ -553,8 +559,8 @@ idx->data_offset > stream->size - off2 + 1 ) { FT_ERROR(( "cff_index_access_element:" - " offset to next entry (%d)" - " exceeds the end of stream (%d)\n", + " offset to next entry (%ld)" + " exceeds the end of stream (%ld)\n", off2, stream->size - idx->data_offset + 1 )); off2 = stream->size - idx->data_offset + 1; } @@ -978,7 +984,7 @@ if ( glyph_sid > 0xFFFFL - nleft ) { FT_ERROR(( "cff_charset_load: invalid SID range trimmed" - " nleft=%d -> %d\n", nleft, 0xFFFFL - glyph_sid )); + " nleft=%d -> %ld\n", nleft, 0xFFFFL - glyph_sid )); nleft = ( FT_UInt )( 0xFFFFL - glyph_sid ); } @@ -1945,7 +1951,7 @@ if ( priv->blue_shift > 1000 || priv->blue_shift < 0 ) { FT_TRACE2(( "cff_load_private_dict:" - " setting unlikely BlueShift value %d to default (7)\n", + " setting unlikely BlueShift value %ld to default (7)\n", priv->blue_shift )); priv->blue_shift = 7; } @@ -1953,7 +1959,7 @@ if ( priv->blue_fuzz > 1000 || priv->blue_fuzz < 0 ) { FT_TRACE2(( "cff_load_private_dict:" - " setting unlikely BlueFuzz value %d to default (1)\n", + " setting unlikely BlueFuzz value %ld to default (1)\n", priv->blue_fuzz )); priv->blue_fuzz = 1; } diff --git a/lib/freetype/src/cff/cffload.h b/lib/freetype/src/cff/cffload.h index 1b7971293..fc998db2d 100644 --- a/lib/freetype/src/cff/cffload.h +++ b/lib/freetype/src/cff/cffload.h @@ -20,10 +20,9 @@ #define CFFLOAD_H_ -#include <ft2build.h> -#include FT_INTERNAL_CFF_TYPES_H +#include <freetype/internal/cfftypes.h> #include "cffparse.h" -#include FT_INTERNAL_CFF_OBJECTS_TYPES_H /* for CFF_Face */ +#include <freetype/internal/cffotypes.h> /* for CFF_Face */ FT_BEGIN_HEADER diff --git a/lib/freetype/src/cff/cffobjs.c b/lib/freetype/src/cff/cffobjs.c index 78c3cb3c2..d555d5235 100644 --- a/lib/freetype/src/cff/cffobjs.c +++ b/lib/freetype/src/cff/cffobjs.c @@ -16,32 +16,31 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_STREAM_H -#include FT_ERRORS_H -#include FT_TRUETYPE_IDS_H -#include FT_TRUETYPE_TAGS_H -#include FT_INTERNAL_SFNT_H -#include FT_DRIVER_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftcalc.h> +#include <freetype/internal/ftstream.h> +#include <freetype/fterrors.h> +#include <freetype/ttnameid.h> +#include <freetype/tttags.h> +#include <freetype/internal/sfnt.h> +#include <freetype/ftdriver.h> #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include FT_MULTIPLE_MASTERS_H -#include FT_SERVICE_MULTIPLE_MASTERS_H -#include FT_SERVICE_METRICS_VARIATIONS_H +#include <freetype/ftmm.h> +#include <freetype/internal/services/svmm.h> +#include <freetype/internal/services/svmetric.h> #endif -#include FT_INTERNAL_CFF_OBJECTS_TYPES_H +#include <freetype/internal/cffotypes.h> #include "cffobjs.h" #include "cffload.h" #include "cffcmap.h" #include "cfferrs.h" -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_SERVICE_CFF_TABLE_LOAD_H +#include <freetype/internal/psaux.h> +#include <freetype/internal/services/svcfftl.h> /************************************************************************** @@ -167,46 +166,56 @@ 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; - if ( funcs ) - { - CFF_Face face = (CFF_Face)cffsize->face; - CFF_Font font = (CFF_Font)face->extra.data; - CFF_Internal internal = NULL; + PS_PrivateRec priv; - PS_PrivateRec priv; - FT_Memory memory = cffsize->face->memory; + FT_UInt i; - FT_UInt i; + if ( !funcs ) + goto Exit; + + if ( FT_NEW( internal ) ) + goto Exit; + cff_make_private_dict( &font->top_font, &priv ); + error = funcs->create( cffsize->face->memory, &priv, + &internal->topfont ); + if ( error ) + goto Exit; + + 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( &font->top_font, &priv ); + cff_make_private_dict( sub, &priv ); error = funcs->create( cffsize->face->memory, &priv, - &internal->topfont ); + &internal->subfonts[i - 1] ); if ( error ) goto Exit; + } - for ( i = font->num_subfonts; i > 0; i-- ) - { - CFF_SubFont sub = font->subfonts[i - 1]; + cffsize->internal->module_data = internal; + size->strike_index = 0xFFFFFFFFUL; - cff_make_private_dict( sub, &priv ); - error = funcs->create( cffsize->face->memory, &priv, - &internal->subfonts[i - 1] ); - if ( error ) - goto Exit; + Exit: + if ( error ) + { + if ( internal ) + { + for ( i = font->num_subfonts; i > 0; i-- ) + FT_FREE( internal->subfonts[i - 1] ); + FT_FREE( internal->topfont ); } - cffsize->internal->module_data = internal; + FT_FREE( internal ); } - size->strike_index = 0xFFFFFFFFUL; - - Exit: return error; } @@ -349,7 +358,8 @@ FT_LOCAL_DEF( void ) cff_slot_done( FT_GlyphSlot slot ) { - slot->internal->glyph_hints = NULL; + if ( slot->internal ) + slot->internal->glyph_hints = NULL; } @@ -940,7 +950,8 @@ style_name = cff_strcpy( memory, fullp ); /* remove the style part from the family name (if present) */ - remove_style( cffface->family_name, style_name ); + if ( style_name ) + remove_style( cffface->family_name, style_name ); } break; } diff --git a/lib/freetype/src/cff/cffobjs.h b/lib/freetype/src/cff/cffobjs.h index 6f12b95db..845bd9094 100644 --- a/lib/freetype/src/cff/cffobjs.h +++ b/lib/freetype/src/cff/cffobjs.h @@ -20,7 +20,6 @@ #define CFFOBJS_H_ -#include <ft2build.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/cff/cffparse.c b/lib/freetype/src/cff/cffparse.c index 0d3bf3459..69bcd5d95 100644 --- a/lib/freetype/src/cff/cffparse.c +++ b/lib/freetype/src/cff/cffparse.c @@ -16,13 +16,12 @@ */ -#include <ft2build.h> #include "cffparse.h" -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_LIST_H +#include <freetype/internal/ftstream.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftcalc.h> +#include <freetype/internal/psaux.h> +#include <freetype/ftlist.h> #include "cfferrs.h" #include "cffload.h" @@ -714,7 +713,7 @@ ( max_scaling - min_scaling ) > 9 ) { FT_TRACE1(( "cff_parse_font_matrix:" - " strange scaling values (minimum %d, maximum %d),\n" + " strange scaling values (minimum %ld, maximum %ld),\n" " " " using default matrix\n", min_scaling, max_scaling )); goto Unlikely; @@ -811,7 +810,7 @@ bbox->yMax = FT_RoundFix( cff_parse_fixed( parser, data ) ); error = FT_Err_Ok; - FT_TRACE4(( " [%d %d %d %d]\n", + FT_TRACE4(( " [%ld %ld %ld %ld]\n", bbox->xMin / 65536, bbox->yMin / 65536, bbox->xMax / 65536, @@ -934,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 %d is found\n", + FT_TRACE1(( "cff_parse_cid_ros: negative supplement %ld is found\n", dict->cid_supplement )); error = FT_Err_Ok; - FT_TRACE4(( " %d %d %d\n", + FT_TRACE4(( " %d %d %ld\n", dict->cid_registry, dict->cid_ordering, dict->cid_supplement )); @@ -1264,11 +1263,11 @@ FT_Byte* charstring_base; FT_ULong charstring_len; - FT_Fixed* stack; - FT_ListNode node; - CFF_T2_String t2; - size_t t2_size; - FT_Byte* q; + FT_Fixed* stack; + FT_ListNode node; + CFF_T2_String t2; + FT_Fixed t2_size; + FT_Byte* q; charstring_base = ++p; diff --git a/lib/freetype/src/cff/cffparse.h b/lib/freetype/src/cff/cffparse.h index 887110a74..6f3fbb37d 100644 --- a/lib/freetype/src/cff/cffparse.h +++ b/lib/freetype/src/cff/cffparse.h @@ -20,9 +20,8 @@ #define CFFPARSE_H_ -#include <ft2build.h> -#include FT_INTERNAL_CFF_TYPES_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/cfftypes.h> +#include <freetype/internal/ftobjs.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/cid/Jamfile b/lib/freetype/src/cid/Jamfile deleted file mode 100644 index 5833272af..000000000 --- a/lib/freetype/src/cid/Jamfile +++ /dev/null @@ -1,34 +0,0 @@ -# FreeType 2 src/cid Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) cid ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = cidgload - cidload - cidobjs - cidparse - cidriver - ; - } - else - { - _sources = type1cid ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/cid Jamfile diff --git a/lib/freetype/src/cid/ciderrs.h b/lib/freetype/src/cid/ciderrs.h index 52ab55d68..f698bb229 100644 --- a/lib/freetype/src/cid/ciderrs.h +++ b/lib/freetype/src/cid/ciderrs.h @@ -25,7 +25,7 @@ #ifndef CIDERRS_H_ #define CIDERRS_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -33,7 +33,7 @@ #define FT_ERR_PREFIX CID_Err_ #define FT_ERR_BASE FT_Mod_Err_CID -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* CIDERRS_H_ */ diff --git a/lib/freetype/src/cid/cidgload.c b/lib/freetype/src/cid/cidgload.c index daa0bddc2..54aa62f81 100644 --- a/lib/freetype/src/cid/cidgload.c +++ b/lib/freetype/src/cid/cidgload.c @@ -16,17 +16,16 @@ */ -#include <ft2build.h> #include "cidload.h" #include "cidgload.h" -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_OUTLINE_H -#include FT_INTERNAL_CALC_H - -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_INTERNAL_CFF_TYPES_H -#include FT_DRIVER_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/ftoutln.h> +#include <freetype/internal/ftcalc.h> + +#include <freetype/internal/psaux.h> +#include <freetype/internal/cfftypes.h> +#include <freetype/ftdriver.h> #include "ciderrs.h" diff --git a/lib/freetype/src/cid/cidgload.h b/lib/freetype/src/cid/cidgload.h index 251c93c9f..da36e37e0 100644 --- a/lib/freetype/src/cid/cidgload.h +++ b/lib/freetype/src/cid/cidgload.h @@ -20,7 +20,6 @@ #define CIDGLOAD_H_ -#include <ft2build.h> #include "cidobjs.h" diff --git a/lib/freetype/src/cid/cidload.c b/lib/freetype/src/cid/cidload.c index 472396602..bb9136a3d 100644 --- a/lib/freetype/src/cid/cidload.c +++ b/lib/freetype/src/cid/cidload.c @@ -17,11 +17,11 @@ #include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include FT_CONFIG_CONFIG_H -#include FT_MULTIPLE_MASTERS_H -#include FT_INTERNAL_TYPE1_TYPES_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/ftmm.h> +#include <freetype/internal/t1types.h> +#include <freetype/internal/psaux.h> #include "cidload.h" @@ -254,7 +254,7 @@ goto Exit; } - FT_TRACE4(( " %d\n", num_dicts )); + FT_TRACE4(( " %ld\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 %d to %d)\n", + " (from %ld to %ld)\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(( "%d\n", dict->expansion_factor )); + FT_TRACE4(( "%ld\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 %d to %d bytes)\n", + " (from %ld to %ld bytes)\n", parser->binary_length, face->root.stream->size - parser->data_offset )); parser->binary_length = face->root.stream->size - diff --git a/lib/freetype/src/cid/cidload.h b/lib/freetype/src/cid/cidload.h index e639f6ffe..06fb9ef47 100644 --- a/lib/freetype/src/cid/cidload.h +++ b/lib/freetype/src/cid/cidload.h @@ -20,8 +20,7 @@ #define CIDLOAD_H_ -#include <ft2build.h> -#include FT_INTERNAL_STREAM_H +#include <freetype/internal/ftstream.h> #include "cidparse.h" diff --git a/lib/freetype/src/cid/cidobjs.c b/lib/freetype/src/cid/cidobjs.c index 34f72b588..04b295eb8 100644 --- a/lib/freetype/src/cid/cidobjs.c +++ b/lib/freetype/src/cid/cidobjs.c @@ -16,17 +16,16 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> #include "cidgload.h" #include "cidload.h" -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H -#include FT_DRIVER_H +#include <freetype/internal/services/svpscmap.h> +#include <freetype/internal/psaux.h> +#include <freetype/internal/pshints.h> +#include <freetype/ftdriver.h> #include "ciderrs.h" @@ -50,7 +49,8 @@ FT_LOCAL_DEF( void ) cid_slot_done( FT_GlyphSlot slot ) { - slot->internal->glyph_hints = NULL; + if ( slot->internal ) + slot->internal->glyph_hints = NULL; } diff --git a/lib/freetype/src/cid/cidobjs.h b/lib/freetype/src/cid/cidobjs.h index efe812fd1..6ae306137 100644 --- a/lib/freetype/src/cid/cidobjs.h +++ b/lib/freetype/src/cid/cidobjs.h @@ -21,9 +21,9 @@ #include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftobjs.h> #include FT_CONFIG_CONFIG_H -#include FT_INTERNAL_TYPE1_TYPES_H +#include <freetype/internal/t1types.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/cid/cidparse.c b/lib/freetype/src/cid/cidparse.c index 94a36e22f..1fc098b44 100644 --- a/lib/freetype/src/cid/cidparse.c +++ b/lib/freetype/src/cid/cidparse.c @@ -16,10 +16,9 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_STREAM_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftstream.h> #include "cidparse.h" diff --git a/lib/freetype/src/cid/cidparse.h b/lib/freetype/src/cid/cidparse.h index 6b2944ff5..0b49bebf4 100644 --- a/lib/freetype/src/cid/cidparse.h +++ b/lib/freetype/src/cid/cidparse.h @@ -20,10 +20,9 @@ #define CIDPARSE_H_ -#include <ft2build.h> -#include FT_INTERNAL_TYPE1_TYPES_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/internal/t1types.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/psaux.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/cid/cidriver.c b/lib/freetype/src/cid/cidriver.c index ad2f7b5cf..d08cea1d7 100644 --- a/lib/freetype/src/cid/cidriver.c +++ b/lib/freetype/src/cid/cidriver.c @@ -16,22 +16,21 @@ */ -#include <ft2build.h> #include "cidriver.h" #include "cidgload.h" -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_POSTSCRIPT_PROPS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftpsprop.h> #include "ciderrs.h" -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_FONT_FORMAT_H -#include FT_SERVICE_POSTSCRIPT_INFO_H -#include FT_SERVICE_CID_H -#include FT_SERVICE_PROPERTIES_H -#include FT_DRIVER_H +#include <freetype/internal/services/svpostnm.h> +#include <freetype/internal/services/svfntfmt.h> +#include <freetype/internal/services/svpsinfo.h> +#include <freetype/internal/services/svcid.h> +#include <freetype/internal/services/svprop.h> +#include <freetype/ftdriver.h> -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/internal/psaux.h> /************************************************************************** diff --git a/lib/freetype/src/cid/cidriver.h b/lib/freetype/src/cid/cidriver.h index 400c2ae29..0fc8ed37b 100644 --- a/lib/freetype/src/cid/cidriver.h +++ b/lib/freetype/src/cid/cidriver.h @@ -20,8 +20,7 @@ #define CIDRIVER_H_ -#include <ft2build.h> -#include FT_INTERNAL_DRIVER_H +#include <freetype/internal/ftdrv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/cid/type1cid.c b/lib/freetype/src/cid/type1cid.c index ba9141075..082e8bfe5 100644 --- a/lib/freetype/src/cid/type1cid.c +++ b/lib/freetype/src/cid/type1cid.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "cidgload.c" #include "cidload.c" diff --git a/lib/freetype/src/gxvalid/Jamfile b/lib/freetype/src/gxvalid/Jamfile deleted file mode 100644 index 49a9004a7..000000000 --- a/lib/freetype/src/gxvalid/Jamfile +++ /dev/null @@ -1,52 +0,0 @@ -# FreeType 2 src/gxvalid Jamfile -# -# Copyright (C) 2005-2020 by -# suzuki toshiya, Masatake YAMATO and Red Hat K.K. -# -# 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. - -SubDir FT2_TOP $(FT2_SRC_DIR) gxvalid ; - - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = gxvbsln - gxvcommn - gxvfeat - gxvjust - gxvkern - gxvlcar - gxvmod - gxvmort - gxvmort0 - gxvmort1 - gxvmort2 - gxvmort4 - gxvmort5 - gxvmorx - gxvmorx0 - gxvmorx1 - gxvmorx2 - gxvmorx4 - gxvmorx5 - gxvopbd - gxvprop - gxvtrak - ; - } - else - { - _sources = gxvalid ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/gxvalid Jamfile diff --git a/lib/freetype/src/gxvalid/gxvalid.c b/lib/freetype/src/gxvalid/gxvalid.c index cb655aeb9..683b8a697 100644 --- a/lib/freetype/src/gxvalid/gxvalid.c +++ b/lib/freetype/src/gxvalid/gxvalid.c @@ -18,7 +18,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "gxvbsln.c" #include "gxvcommn.c" diff --git a/lib/freetype/src/gxvalid/gxvalid.h b/lib/freetype/src/gxvalid/gxvalid.h index cdf198632..ff2812da2 100644 --- a/lib/freetype/src/gxvalid/gxvalid.h +++ b/lib/freetype/src/gxvalid/gxvalid.h @@ -28,13 +28,12 @@ #ifndef GXVALID_H_ #define GXVALID_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> -#include "gxverror.h" /* must come before FT_INTERNAL_VALIDATE_H */ +#include "gxverror.h" /* must come before `ftvalid.h' */ -#include FT_INTERNAL_VALIDATE_H -#include FT_INTERNAL_STREAM_H +#include <freetype/internal/ftvalid.h> +#include <freetype/internal/ftstream.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/gxvalid/gxvcommn.h b/lib/freetype/src/gxvalid/gxvcommn.h index 2372fc86f..59d149215 100644 --- a/lib/freetype/src/gxvalid/gxvcommn.h +++ b/lib/freetype/src/gxvalid/gxvcommn.h @@ -43,10 +43,9 @@ #define GXVCOMMN_H_ -#include <ft2build.h> #include "gxvalid.h" -#include FT_INTERNAL_DEBUG_H -#include FT_SFNT_NAMES_H +#include <freetype/internal/ftdebug.h> +#include <freetype/ftsnames.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/gxvalid/gxverror.h b/lib/freetype/src/gxvalid/gxverror.h index 475b9f777..5d8f0b680 100644 --- a/lib/freetype/src/gxvalid/gxverror.h +++ b/lib/freetype/src/gxvalid/gxverror.h @@ -35,7 +35,7 @@ #ifndef GXVERROR_H_ #define GXVERROR_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -43,7 +43,7 @@ #define FT_ERR_PREFIX GXV_Err_ #define FT_ERR_BASE FT_Mod_Err_GXvalid -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* GXVERROR_H_ */ diff --git a/lib/freetype/src/gxvalid/gxvjust.c b/lib/freetype/src/gxvalid/gxvjust.c index d8875b411..3c7f1f953 100644 --- a/lib/freetype/src/gxvalid/gxvjust.c +++ b/lib/freetype/src/gxvalid/gxvjust.c @@ -28,7 +28,7 @@ #include "gxvalid.h" #include "gxvcommn.h" -#include FT_SFNT_NAMES_H +#include <freetype/ftsnames.h> /************************************************************************** diff --git a/lib/freetype/src/gxvalid/gxvkern.c b/lib/freetype/src/gxvalid/gxvkern.c index ab5643eb8..cc0b3dfcb 100644 --- a/lib/freetype/src/gxvalid/gxvkern.c +++ b/lib/freetype/src/gxvalid/gxvkern.c @@ -28,8 +28,8 @@ #include "gxvalid.h" #include "gxvcommn.h" -#include FT_SFNT_NAMES_H -#include FT_SERVICE_GX_VALIDATE_H +#include <freetype/ftsnames.h> +#include <freetype/internal/services/svgxval.h> /************************************************************************** diff --git a/lib/freetype/src/gxvalid/gxvmod.c b/lib/freetype/src/gxvalid/gxvmod.c index 2b8f45d1c..a467e8713 100644 --- a/lib/freetype/src/gxvalid/gxvmod.c +++ b/lib/freetype/src/gxvalid/gxvmod.c @@ -25,12 +25,11 @@ */ -#include <ft2build.h> -#include FT_TRUETYPE_TABLES_H -#include FT_TRUETYPE_TAGS_H -#include FT_GX_VALIDATE_H -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_GX_VALIDATE_H +#include <freetype/tttables.h> +#include <freetype/tttags.h> +#include <freetype/ftgxval.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/services/svgxval.h> #include "gxvmod.h" #include "gxvalid.h" diff --git a/lib/freetype/src/gxvalid/gxvmod.h b/lib/freetype/src/gxvalid/gxvmod.h index bdf465f4f..f2982c96c 100644 --- a/lib/freetype/src/gxvalid/gxvmod.h +++ b/lib/freetype/src/gxvalid/gxvmod.h @@ -29,8 +29,7 @@ #ifndef GXVMOD_H_ #define GXVMOD_H_ -#include <ft2build.h> -#include FT_MODULE_H +#include <freetype/ftmodapi.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/gxvalid/gxvmort.h b/lib/freetype/src/gxvalid/gxvmort.h index 35a18e76a..7237c5825 100644 --- a/lib/freetype/src/gxvalid/gxvmort.h +++ b/lib/freetype/src/gxvalid/gxvmort.h @@ -31,7 +31,10 @@ #include "gxvalid.h" #include "gxvcommn.h" -#include FT_SFNT_NAMES_H +#include <freetype/ftsnames.h> + + +FT_BEGIN_HEADER typedef struct GXV_mort_featureRec_ @@ -88,6 +91,8 @@ GXV_Validator gxvalid ); +FT_END_HEADER + #endif /* GXVMORT_H_ */ diff --git a/lib/freetype/src/gxvalid/gxvmorx.h b/lib/freetype/src/gxvalid/gxvmorx.h index 99be18106..f747b1d63 100644 --- a/lib/freetype/src/gxvalid/gxvmorx.h +++ b/lib/freetype/src/gxvalid/gxvmorx.h @@ -33,7 +33,10 @@ #include "gxvcommn.h" #include "gxvmort.h" -#include FT_SFNT_NAMES_H +#include <freetype/ftsnames.h> + + +FT_BEGIN_HEADER FT_LOCAL( void ) @@ -62,6 +65,8 @@ GXV_Validator gxvalid ); +FT_END_HEADER + #endif /* GXVMORX_H_ */ diff --git a/lib/freetype/src/gzip/Jamfile b/lib/freetype/src/gzip/Jamfile deleted file mode 100644 index 289ec1c57..000000000 --- a/lib/freetype/src/gzip/Jamfile +++ /dev/null @@ -1,16 +0,0 @@ -# FreeType 2 src/gzip Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) gzip ; - -Library $(FT2_LIB) : ftgzip.c ; - -# end of src/pcf Jamfile diff --git a/lib/freetype/src/gzip/ftgzip.c b/lib/freetype/src/gzip/ftgzip.c index 6b1df3a4a..de7d0fdd5 100644 --- a/lib/freetype/src/gzip/ftgzip.c +++ b/lib/freetype/src/gzip/ftgzip.c @@ -20,15 +20,14 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_DEBUG_H -#include FT_GZIP_H +#include <freetype/internal/ftmemory.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/ftgzip.h> #include FT_CONFIG_STANDARD_LIBRARY_H -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -36,7 +35,7 @@ #define FT_ERR_PREFIX Gzip_Err_ #define FT_ERR_BASE FT_Mod_Err_Gzip -#include FT_ERRORS_H +#include <freetype/fterrors.h> #ifdef FT_CONFIG_OPTION_USE_ZLIB diff --git a/lib/freetype/src/lzw/Jamfile b/lib/freetype/src/lzw/Jamfile deleted file mode 100644 index 35e9128c4..000000000 --- a/lib/freetype/src/lzw/Jamfile +++ /dev/null @@ -1,16 +0,0 @@ -# FreeType 2 src/lzw Jamfile -# -# Copyright (C) 2004-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) lzw ; - -Library $(FT2_LIB) : ftlzw.c ; - -# end of src/lzw Jamfile diff --git a/lib/freetype/src/lzw/ftlzw.c b/lib/freetype/src/lzw/ftlzw.c index 7d3f3e3f5..ddb81e6e9 100644 --- a/lib/freetype/src/lzw/ftlzw.c +++ b/lib/freetype/src/lzw/ftlzw.c @@ -21,15 +21,14 @@ * */ -#include <ft2build.h> -#include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_DEBUG_H -#include FT_LZW_H +#include <freetype/internal/ftmemory.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/ftlzw.h> #include FT_CONFIG_STANDARD_LIBRARY_H -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -37,7 +36,7 @@ #define FT_ERR_PREFIX LZW_Err_ #define FT_ERR_BASE FT_Mod_Err_LZW -#include FT_ERRORS_H +#include <freetype/fterrors.h> #ifdef FT_CONFIG_OPTION_USE_LZW diff --git a/lib/freetype/src/lzw/ftzopen.c b/lib/freetype/src/lzw/ftzopen.c index cdc7f4e68..884d2ec74 100644 --- a/lib/freetype/src/lzw/ftzopen.c +++ b/lib/freetype/src/lzw/ftzopen.c @@ -20,9 +20,9 @@ */ #include "ftzopen.h" -#include FT_INTERNAL_MEMORY_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftmemory.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/ftdebug.h> static int diff --git a/lib/freetype/src/lzw/ftzopen.h b/lib/freetype/src/lzw/ftzopen.h index 2866529bd..d8768f7b4 100644 --- a/lib/freetype/src/lzw/ftzopen.h +++ b/lib/freetype/src/lzw/ftzopen.h @@ -22,9 +22,9 @@ #ifndef FTZOPEN_H_ #define FTZOPEN_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> +FT_BEGIN_HEADER /* * This is a complete re-implementation of the LZW file reader, @@ -166,6 +166,8 @@ /* */ +FT_END_HEADER + #endif /* FTZOPEN_H_ */ diff --git a/lib/freetype/src/otvalid/Jamfile b/lib/freetype/src/otvalid/Jamfile deleted file mode 100644 index 58ea3c098..000000000 --- a/lib/freetype/src/otvalid/Jamfile +++ /dev/null @@ -1,37 +0,0 @@ -# FreeType 2 src/otvalid Jamfile -# -# Copyright (C) 2004-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) otvalid ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = otvbase - otvcommn - otvgdef - otvgpos - otvgsub - otvjstf - otvmath - otvmod - ; - } - else - { - _sources = otvalid ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/otvalid Jamfile diff --git a/lib/freetype/src/otvalid/otvalid.c b/lib/freetype/src/otvalid/otvalid.c index 487d336a3..d640209f6 100644 --- a/lib/freetype/src/otvalid/otvalid.c +++ b/lib/freetype/src/otvalid/otvalid.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "otvbase.c" #include "otvcommn.c" diff --git a/lib/freetype/src/otvalid/otvalid.h b/lib/freetype/src/otvalid/otvalid.h index 3c7026896..8208ff011 100644 --- a/lib/freetype/src/otvalid/otvalid.h +++ b/lib/freetype/src/otvalid/otvalid.h @@ -20,13 +20,12 @@ #define OTVALID_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> -#include "otverror.h" /* must come before FT_INTERNAL_VALIDATE_H */ +#include "otverror.h" /* must come before `ftvalid.h' */ -#include FT_INTERNAL_VALIDATE_H -#include FT_INTERNAL_STREAM_H +#include <freetype/internal/ftvalid.h> +#include <freetype/internal/ftstream.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/otvalid/otvcommn.h b/lib/freetype/src/otvalid/otvcommn.h index 1daf7dca7..f9926034a 100644 --- a/lib/freetype/src/otvalid/otvcommn.h +++ b/lib/freetype/src/otvalid/otvcommn.h @@ -20,9 +20,8 @@ #define OTVCOMMN_H_ -#include <ft2build.h> #include "otvalid.h" -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/otvalid/otverror.h b/lib/freetype/src/otvalid/otverror.h index 49c34d6cd..979e9cbd9 100644 --- a/lib/freetype/src/otvalid/otverror.h +++ b/lib/freetype/src/otvalid/otverror.h @@ -26,7 +26,7 @@ #ifndef OTVERROR_H_ #define OTVERROR_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -34,7 +34,7 @@ #define FT_ERR_PREFIX OTV_Err_ #define FT_ERR_BASE FT_Mod_Err_OTvalid -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* OTVERROR_H_ */ diff --git a/lib/freetype/src/otvalid/otvmod.c b/lib/freetype/src/otvalid/otvmod.c index 5f3e7e8d4..0188b2701 100644 --- a/lib/freetype/src/otvalid/otvmod.c +++ b/lib/freetype/src/otvalid/otvmod.c @@ -16,12 +16,11 @@ */ -#include <ft2build.h> -#include FT_TRUETYPE_TABLES_H -#include FT_TRUETYPE_TAGS_H -#include FT_OPENTYPE_VALIDATE_H -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_OPENTYPE_VALIDATE_H +#include <freetype/tttables.h> +#include <freetype/tttags.h> +#include <freetype/ftotval.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/services/svotval.h> #include "otvmod.h" #include "otvalid.h" diff --git a/lib/freetype/src/otvalid/otvmod.h b/lib/freetype/src/otvalid/otvmod.h index f172c2c8f..efd6da035 100644 --- a/lib/freetype/src/otvalid/otvmod.h +++ b/lib/freetype/src/otvalid/otvmod.h @@ -21,8 +21,7 @@ #define OTVMOD_H_ -#include <ft2build.h> -#include FT_MODULE_H +#include <freetype/ftmodapi.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/pcf/Jamfile b/lib/freetype/src/pcf/Jamfile deleted file mode 100644 index 9cc37e455..000000000 --- a/lib/freetype/src/pcf/Jamfile +++ /dev/null @@ -1,32 +0,0 @@ -# FreeType 2 src/pcf Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) pcf ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = pcfdrivr - pcfread - pcfutil - ; - } - else - { - _sources = pcf ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/pcf Jamfile diff --git a/lib/freetype/src/pcf/pcf.c b/lib/freetype/src/pcf/pcf.c index 8ffd6e280..6b30fb249 100644 --- a/lib/freetype/src/pcf/pcf.c +++ b/lib/freetype/src/pcf/pcf.c @@ -26,7 +26,6 @@ THE SOFTWARE. #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "pcfdrivr.c" #include "pcfread.c" diff --git a/lib/freetype/src/pcf/pcf.h b/lib/freetype/src/pcf/pcf.h index 33be4bcd8..3134cc355 100644 --- a/lib/freetype/src/pcf/pcf.h +++ b/lib/freetype/src/pcf/pcf.h @@ -29,9 +29,8 @@ THE SOFTWARE. #define PCF_H_ -#include <ft2build.h> -#include FT_INTERNAL_DRIVER_H -#include FT_INTERNAL_STREAM_H +#include <freetype/internal/ftdrv.h> +#include <freetype/internal/ftstream.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/pcf/pcfdrivr.c b/lib/freetype/src/pcf/pcfdrivr.c index b39592c79..e9dd51752 100644 --- a/lib/freetype/src/pcf/pcfdrivr.c +++ b/lib/freetype/src/pcf/pcfdrivr.c @@ -25,17 +25,16 @@ THE SOFTWARE. */ -#include <ft2build.h> - -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_OBJECTS_H -#include FT_GZIP_H -#include FT_LZW_H -#include FT_BZIP2_H -#include FT_ERRORS_H -#include FT_BDF_H -#include FT_TRUETYPE_IDS_H + +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/ftgzip.h> +#include <freetype/ftlzw.h> +#include <freetype/ftbzip2.h> +#include <freetype/fterrors.h> +#include <freetype/ftbdf.h> +#include <freetype/ttnameid.h> #include "pcf.h" #include "pcfdrivr.h" @@ -47,10 +46,10 @@ THE SOFTWARE. #undef FT_COMPONENT #define FT_COMPONENT pcfread -#include FT_SERVICE_BDF_H -#include FT_SERVICE_FONT_FORMAT_H -#include FT_SERVICE_PROPERTIES_H -#include FT_DRIVER_H +#include <freetype/internal/services/svbdf.h> +#include <freetype/internal/services/svfntfmt.h> +#include <freetype/internal/services/svprop.h> +#include <freetype/ftdriver.h> /************************************************************************** @@ -137,7 +136,7 @@ THE SOFTWARE. FT_UInt32 charcode = *acharcode; FT_UShort charcodeRow; FT_UShort charcodeCol; - FT_Int result = 0; + FT_UInt result = 0; while ( charcode < (FT_UInt32)( enc->lastRow * 256 + enc->lastCol ) ) @@ -607,8 +606,9 @@ THE SOFTWARE. if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) ) { - FT_TRACE1(( "pcf_get_bdf_property:" )); - FT_TRACE1(( " too large integer 0x%x is truncated\n" )); + FT_TRACE1(( "pcf_get_bdf_property:" + " too large integer 0x%lx is truncated\n", + prop->value.l )); } /* diff --git a/lib/freetype/src/pcf/pcfdrivr.h b/lib/freetype/src/pcf/pcfdrivr.h index 73db0823d..d46539374 100644 --- a/lib/freetype/src/pcf/pcfdrivr.h +++ b/lib/freetype/src/pcf/pcfdrivr.h @@ -28,8 +28,7 @@ THE SOFTWARE. #ifndef PCFDRIVR_H_ #define PCFDRIVR_H_ -#include <ft2build.h> -#include FT_INTERNAL_DRIVER_H +#include <freetype/internal/ftdrv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/pcf/pcferror.h b/lib/freetype/src/pcf/pcferror.h index 2e69d1d21..8b9e9902a 100644 --- a/lib/freetype/src/pcf/pcferror.h +++ b/lib/freetype/src/pcf/pcferror.h @@ -25,7 +25,7 @@ #ifndef PCFERROR_H_ #define PCFERROR_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -33,7 +33,7 @@ #define FT_ERR_PREFIX PCF_Err_ #define FT_ERR_BASE FT_Mod_Err_PCF -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* PCFERROR_H_ */ diff --git a/lib/freetype/src/pcf/pcfread.c b/lib/freetype/src/pcf/pcfread.c index 2ffe22d71..8817682cd 100644 --- a/lib/freetype/src/pcf/pcfread.c +++ b/lib/freetype/src/pcf/pcfread.c @@ -25,11 +25,10 @@ THE SOFTWARE. */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/ftobjs.h> #include "pcf.h" #include "pcfread.h" @@ -122,7 +121,7 @@ THE SOFTWARE. toc->count > 9 ) { FT_TRACE0(( "pcf_read_TOC: adjusting number of tables" - " (from %d to %d)\n", + " (from %ld to %ld)\n", toc->count, FT_MIN( stream->size >> 4, 9 ) )); toc->count = FT_MIN( stream->size >> 4, 9 ); @@ -242,7 +241,7 @@ THE SOFTWARE. if ( tables[i].type == (FT_UInt)( 1 << j ) ) name = tableNames[j]; - FT_TRACE4(( " %d: type=%s, format=0x%X," + FT_TRACE4(( " %d: type=%s, format=0x%lX," " size=%ld (0x%lX), offset=%ld (0x%lX)\n", i, name, tables[i].format, @@ -661,7 +660,7 @@ THE SOFTWARE. { properties[i].value.l = props[i].value; - FT_TRACE4(( " %d\n", properties[i].value.l )); + FT_TRACE4(( " %ld\n", properties[i].value.l )); } } @@ -798,7 +797,7 @@ THE SOFTWARE. metrics->descent = 0; FT_TRACE0(( "pcf_get_metrics:" - " invalid metrics for glyph %d\n", i )); + " invalid metrics for glyph %ld\n", i )); } } @@ -918,11 +917,11 @@ THE SOFTWARE. sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX( format )]; - FT_TRACE4(( " %ld-bit padding implies a size of %lu\n", + FT_TRACE4(( " %d-bit padding implies a size of %lu\n", 8 << i, bitmapSizes[i] )); } - FT_TRACE4(( " %lu bitmaps, using %ld-bit padding\n", + FT_TRACE4(( " %lu bitmaps, using %d-bit padding\n", nbitmaps, 8 << PCF_GLYPH_PAD_INDEX( format ) )); FT_TRACE4(( " bitmap size: %lu\n", sizebitmaps )); @@ -1252,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 %d\n", + FT_TRACE0(( "pfc_get_accel: clamping font ascent to value %ld\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 %d\n", + FT_TRACE0(( "pfc_get_accel: clamping font descent to value %ld\n", accel->fontDescent )); } @@ -1631,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 %d\n", + FT_TRACE0(( "pcf_load_font: clamping point size to value %ld\n", bsize->size )); } else @@ -1650,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 %d\n", + FT_TRACE0(( "pcf_load_font: clamping pixel size to value %ld\n", bsize->y_ppem )); } else diff --git a/lib/freetype/src/pcf/pcfread.h b/lib/freetype/src/pcf/pcfread.h index bed30e503..a54648fbf 100644 --- a/lib/freetype/src/pcf/pcfread.h +++ b/lib/freetype/src/pcf/pcfread.h @@ -29,7 +29,6 @@ THE SOFTWARE. #define PCFREAD_H_ -#include <ft2build.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/pcf/pcfutil.c b/lib/freetype/src/pcf/pcfutil.c index 045c42d60..5d3c00791 100644 --- a/lib/freetype/src/pcf/pcfutil.c +++ b/lib/freetype/src/pcf/pcfutil.c @@ -32,7 +32,6 @@ in this Software without prior written authorization from The Open Group. /* Modified for use with FreeType */ -#include <ft2build.h> #include "pcfutil.h" diff --git a/lib/freetype/src/pcf/pcfutil.h b/lib/freetype/src/pcf/pcfutil.h index be986e756..a197c1559 100644 --- a/lib/freetype/src/pcf/pcfutil.h +++ b/lib/freetype/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/lib/freetype/src/pfr/Jamfile b/lib/freetype/src/pfr/Jamfile deleted file mode 100644 index e42d0db85..000000000 --- a/lib/freetype/src/pfr/Jamfile +++ /dev/null @@ -1,35 +0,0 @@ -# FreeType 2 src/pfr Jamfile -# -# Copyright (C) 2002-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) pfr ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = pfrcmap - pfrdrivr - pfrgload - pfrload - pfrobjs - pfrsbit - ; - } - else - { - _sources = pfr ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/pfr Jamfile diff --git a/lib/freetype/src/pfr/pfr.c b/lib/freetype/src/pfr/pfr.c index 5dea6fa34..9264c77df 100644 --- a/lib/freetype/src/pfr/pfr.c +++ b/lib/freetype/src/pfr/pfr.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "pfrcmap.c" #include "pfrdrivr.c" diff --git a/lib/freetype/src/pfr/pfrcmap.c b/lib/freetype/src/pfr/pfrcmap.c index 3f64ba8b0..ebc7b8439 100644 --- a/lib/freetype/src/pfr/pfrcmap.c +++ b/lib/freetype/src/pfr/pfrcmap.c @@ -16,8 +16,7 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include "pfrcmap.h" #include "pfrobjs.h" diff --git a/lib/freetype/src/pfr/pfrcmap.h b/lib/freetype/src/pfr/pfrcmap.h index b90e8a101..a6d920c30 100644 --- a/lib/freetype/src/pfr/pfrcmap.h +++ b/lib/freetype/src/pfr/pfrcmap.h @@ -19,8 +19,7 @@ #ifndef PFRCMAP_H_ #define PFRCMAP_H_ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftobjs.h> #include "pfrtypes.h" diff --git a/lib/freetype/src/pfr/pfrdrivr.c b/lib/freetype/src/pfr/pfrdrivr.c index 2028c8e11..b14320875 100644 --- a/lib/freetype/src/pfr/pfrdrivr.c +++ b/lib/freetype/src/pfr/pfrdrivr.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_SERVICE_PFR_H -#include FT_SERVICE_FONT_FORMAT_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/services/svpfr.h> +#include <freetype/internal/services/svfntfmt.h> #include "pfrdrivr.h" #include "pfrobjs.h" diff --git a/lib/freetype/src/pfr/pfrdrivr.h b/lib/freetype/src/pfr/pfrdrivr.h index 865ec8188..7646b4d1b 100644 --- a/lib/freetype/src/pfr/pfrdrivr.h +++ b/lib/freetype/src/pfr/pfrdrivr.h @@ -20,8 +20,7 @@ #define PFRDRIVR_H_ -#include <ft2build.h> -#include FT_INTERNAL_DRIVER_H +#include <freetype/internal/ftdrv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/pfr/pfrerror.h b/lib/freetype/src/pfr/pfrerror.h index 2dbeedfe1..33460ef4f 100644 --- a/lib/freetype/src/pfr/pfrerror.h +++ b/lib/freetype/src/pfr/pfrerror.h @@ -25,7 +25,7 @@ #ifndef PFRERROR_H_ #define PFRERROR_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -33,7 +33,7 @@ #define FT_ERR_PREFIX PFR_Err_ #define FT_ERR_BASE FT_Mod_Err_PFR -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* PFRERROR_H_ */ diff --git a/lib/freetype/src/pfr/pfrgload.c b/lib/freetype/src/pfr/pfrgload.c index 7d57ae153..aa640c3b0 100644 --- a/lib/freetype/src/pfr/pfrgload.c +++ b/lib/freetype/src/pfr/pfrgload.c @@ -19,7 +19,7 @@ #include "pfrgload.h" #include "pfrsbit.h" #include "pfrload.h" /* for macro definitions */ -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include "pfrerror.h" @@ -451,7 +451,7 @@ case 1: /* 16-bit absolute value */ PFR_CHECK( 2 ); cur->x = PFR_NEXT_SHORT( p ); - FT_TRACE7(( " x.%d", cur->x )); + FT_TRACE7(( " x.%ld", 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.%d", cur->y )); + FT_TRACE7(( " y.%ld", cur->y )); break; case 2: /* 8-bit delta */ diff --git a/lib/freetype/src/pfr/pfrload.c b/lib/freetype/src/pfr/pfrload.c index 6eeed2824..a2832e55c 100644 --- a/lib/freetype/src/pfr/pfrload.c +++ b/lib/freetype/src/pfr/pfrload.c @@ -17,8 +17,8 @@ #include "pfrload.h" -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> #include "pfrerror.h" diff --git a/lib/freetype/src/pfr/pfrload.h b/lib/freetype/src/pfr/pfrload.h index 7d113df27..7615b9ce1 100644 --- a/lib/freetype/src/pfr/pfrload.h +++ b/lib/freetype/src/pfr/pfrload.h @@ -20,7 +20,7 @@ #define PFRLOAD_H_ #include "pfrobjs.h" -#include FT_INTERNAL_STREAM_H +#include <freetype/internal/ftstream.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/pfr/pfrobjs.c b/lib/freetype/src/pfr/pfrobjs.c index 9bc90a4b6..918e7fd49 100644 --- a/lib/freetype/src/pfr/pfrobjs.c +++ b/lib/freetype/src/pfr/pfrobjs.c @@ -21,10 +21,10 @@ #include "pfrgload.h" #include "pfrcmap.h" #include "pfrsbit.h" -#include FT_OUTLINE_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H -#include FT_TRUETYPE_IDS_H +#include <freetype/ftoutln.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftcalc.h> +#include <freetype/ttnameid.h> #include "pfrerror.h" diff --git a/lib/freetype/src/pfr/pfrsbit.c b/lib/freetype/src/pfr/pfrsbit.c index 00669e13f..a6691e6d1 100644 --- a/lib/freetype/src/pfr/pfrsbit.c +++ b/lib/freetype/src/pfr/pfrsbit.c @@ -18,8 +18,8 @@ #include "pfrsbit.h" #include "pfrload.h" -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> #include "pfrerror.h" @@ -745,7 +745,7 @@ ypos + (FT_Long)ysize < FT_INT_MIN ) { FT_TRACE1(( "pfr_slot_load_bitmap:" )); - FT_TRACE1(( "huge bitmap glyph %dx%d over FT_GlyphSlot\n", + FT_TRACE1(( "huge bitmap glyph %ldx%ld over FT_GlyphSlot\n", xpos, ypos )); error = FT_THROW( Invalid_Pixel_Size ); } diff --git a/lib/freetype/src/pfr/pfrtypes.h b/lib/freetype/src/pfr/pfrtypes.h index dfc47beff..06fb82d51 100644 --- a/lib/freetype/src/pfr/pfrtypes.h +++ b/lib/freetype/src/pfr/pfrtypes.h @@ -19,8 +19,7 @@ #ifndef PFRTYPES_H_ #define PFRTYPES_H_ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftobjs.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/psaux/Jamfile b/lib/freetype/src/psaux/Jamfile deleted file mode 100644 index 9a13816cb..000000000 --- a/lib/freetype/src/psaux/Jamfile +++ /dev/null @@ -1,45 +0,0 @@ -# FreeType 2 src/psaux Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) psaux ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = afmparse - psauxmod - psconv - psobjs - t1cmap - t1decode - cffdecode - psarrst - psblues - pserror - psfont - psft - pshints - psintrp - psread - psstack - ; - } - else - { - _sources = psaux ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/psaux Jamfile diff --git a/lib/freetype/src/psaux/afmparse.c b/lib/freetype/src/psaux/afmparse.c index b957158ae..2d6a0d9a1 100644 --- a/lib/freetype/src/psaux/afmparse.c +++ b/lib/freetype/src/psaux/afmparse.c @@ -15,10 +15,9 @@ * */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/freetype.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/psaux.h> #ifndef T1_CONFIG_OPTION_NO_AFM diff --git a/lib/freetype/src/psaux/afmparse.h b/lib/freetype/src/psaux/afmparse.h index 50f4834b3..16a3a3e90 100644 --- a/lib/freetype/src/psaux/afmparse.h +++ b/lib/freetype/src/psaux/afmparse.h @@ -20,8 +20,7 @@ #define AFMPARSE_H_ -#include <ft2build.h> -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/internal/psaux.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/psaux/cffdecode.c b/lib/freetype/src/psaux/cffdecode.c index 172e3b23a..3d2da1e03 100644 --- a/lib/freetype/src/psaux/cffdecode.c +++ b/lib/freetype/src/psaux/cffdecode.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_SERVICE_H -#include FT_SERVICE_CFF_TABLE_LOAD_H +#include <freetype/freetype.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftserv.h> +#include <freetype/internal/services/svcfftl.h> #include "cffdecode.h" #include "psobjs.h" diff --git a/lib/freetype/src/psaux/cffdecode.h b/lib/freetype/src/psaux/cffdecode.h index 5dc968b25..77a496269 100644 --- a/lib/freetype/src/psaux/cffdecode.h +++ b/lib/freetype/src/psaux/cffdecode.h @@ -20,8 +20,7 @@ #define CFFDECODE_H_ -#include <ft2build.h> -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/internal/psaux.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/psaux/psarrst.c b/lib/freetype/src/psaux/psarrst.c index 011803b41..8751d275f 100644 --- a/lib/freetype/src/psaux/psarrst.c +++ b/lib/freetype/src/psaux/psarrst.c @@ -37,7 +37,7 @@ #include "psft.h" -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include "psglue.h" #include "psarrst.h" diff --git a/lib/freetype/src/psaux/psaux.c b/lib/freetype/src/psaux/psaux.c index 96d2484e9..f4282222a 100644 --- a/lib/freetype/src/psaux/psaux.c +++ b/lib/freetype/src/psaux/psaux.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "afmparse.c" #include "psauxmod.c" diff --git a/lib/freetype/src/psaux/psauxerr.h b/lib/freetype/src/psaux/psauxerr.h index df8b09ff7..8b9a958ae 100644 --- a/lib/freetype/src/psaux/psauxerr.h +++ b/lib/freetype/src/psaux/psauxerr.h @@ -26,7 +26,7 @@ #ifndef PSAUXERR_H_ #define PSAUXERR_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -34,7 +34,7 @@ #define FT_ERR_PREFIX PSaux_Err_ #define FT_ERR_BASE FT_Mod_Err_PSaux -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* PSAUXERR_H_ */ diff --git a/lib/freetype/src/psaux/psauxmod.c b/lib/freetype/src/psaux/psauxmod.c index bb520792e..e73ba2245 100644 --- a/lib/freetype/src/psaux/psauxmod.c +++ b/lib/freetype/src/psaux/psauxmod.c @@ -16,7 +16,6 @@ */ -#include <ft2build.h> #include "psauxmod.h" #include "psobjs.h" #include "t1decode.h" @@ -171,9 +170,9 @@ }; - FT_CALLBACK_TABLE_DEF - const FT_Module_Class psaux_module_class = - { + FT_DEFINE_MODULE( + psaux_module_class, + 0, sizeof ( FT_ModuleRec ), "psaux", @@ -185,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/lib/freetype/src/psaux/psauxmod.h b/lib/freetype/src/psaux/psauxmod.h index 6e2eb6704..a6bebe4b9 100644 --- a/lib/freetype/src/psaux/psauxmod.h +++ b/lib/freetype/src/psaux/psauxmod.h @@ -20,10 +20,9 @@ #define PSAUXMOD_H_ -#include <ft2build.h> -#include FT_MODULE_H +#include <freetype/ftmodapi.h> -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/internal/psaux.h> FT_BEGIN_HEADER @@ -35,10 +34,24 @@ 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/lib/freetype/src/psaux/psblues.c b/lib/freetype/src/psaux/psblues.c index 89738ce47..3878e9bde 100644 --- a/lib/freetype/src/psaux/psblues.c +++ b/lib/freetype/src/psaux/psblues.c @@ -37,7 +37,7 @@ #include "psft.h" -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include "psblues.h" #include "pshints.h" diff --git a/lib/freetype/src/psaux/psconv.c b/lib/freetype/src/psaux/psconv.c index c813a0596..4cf5cd5d8 100644 --- a/lib/freetype/src/psaux/psconv.c +++ b/lib/freetype/src/psaux/psconv.c @@ -16,9 +16,8 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/psaux.h> +#include <freetype/internal/ftdebug.h> #include "psconv.h" #include "psauxerr.h" diff --git a/lib/freetype/src/psaux/psconv.h b/lib/freetype/src/psaux/psconv.h index 2cd5c60e4..833e82736 100644 --- a/lib/freetype/src/psaux/psconv.h +++ b/lib/freetype/src/psaux/psconv.h @@ -20,8 +20,7 @@ #define PSCONV_H_ -#include <ft2build.h> -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/internal/psaux.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/psaux/pserror.h b/lib/freetype/src/psaux/pserror.h index b2156b331..5738853fa 100644 --- a/lib/freetype/src/psaux/pserror.h +++ b/lib/freetype/src/psaux/pserror.h @@ -40,7 +40,7 @@ #define PSERROR_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -49,7 +49,8 @@ #define FT_ERR_BASE FT_Mod_Err_CF2 -#include FT_ERRORS_H +#include <freetype/fterrors.h> +#include <freetype/internal/compiler-macros.h> #include "psft.h" diff --git a/lib/freetype/src/psaux/psfont.c b/lib/freetype/src/psaux/psfont.c index 00e421081..0db1f0c5b 100644 --- a/lib/freetype/src/psaux/psfont.c +++ b/lib/freetype/src/psaux/psfont.c @@ -36,8 +36,7 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_CALC_H +#include <freetype/internal/ftcalc.h> #include "psft.h" diff --git a/lib/freetype/src/psaux/psfont.h b/lib/freetype/src/psaux/psfont.h index 8fbacbb6e..836fce4e4 100644 --- a/lib/freetype/src/psaux/psfont.h +++ b/lib/freetype/src/psaux/psfont.h @@ -40,7 +40,7 @@ #define PSFONT_H_ -#include FT_SERVICE_CFF_TABLE_LOAD_H +#include <freetype/internal/services/svcfftl.h> #include "psft.h" #include "psblues.h" diff --git a/lib/freetype/src/psaux/psft.c b/lib/freetype/src/psaux/psft.c index 50b40bf8f..41c16542c 100644 --- a/lib/freetype/src/psaux/psft.c +++ b/lib/freetype/src/psaux/psft.c @@ -37,7 +37,7 @@ #include "psft.h" -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include "psfont.h" #include "pserror.h" @@ -45,11 +45,11 @@ #include "cffdecode.h" #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include FT_MULTIPLE_MASTERS_H -#include FT_SERVICE_MULTIPLE_MASTERS_H +#include <freetype/ftmm.h> +#include <freetype/internal/services/svmm.h> #endif -#include FT_SERVICE_CFF_TABLE_LOAD_H +#include <freetype/internal/services/svcfftl.h> #define CF2_MAX_SIZE cf2_intToFixed( 2000 ) /* max ppem */ diff --git a/lib/freetype/src/psaux/psft.h b/lib/freetype/src/psaux/psft.h index 4c930f0d7..3da454e60 100644 --- a/lib/freetype/src/psaux/psft.h +++ b/lib/freetype/src/psaux/psft.h @@ -40,17 +40,17 @@ #define PSFT_H_ +#include <freetype/internal/compiler-macros.h> #include "pstypes.h" - /* TODO: disable asserts for now */ #define CF2_NDEBUG -#include FT_SYSTEM_H +#include <freetype/ftsystem.h> #include "psglue.h" -#include FT_INTERNAL_POSTSCRIPT_AUX_H /* for PS_Decoder */ +#include <freetype/internal/psaux.h> /* for PS_Decoder */ FT_BEGIN_HEADER diff --git a/lib/freetype/src/psaux/pshints.c b/lib/freetype/src/psaux/pshints.c index 1cbecd2b1..ce8cfca71 100644 --- a/lib/freetype/src/psaux/pshints.c +++ b/lib/freetype/src/psaux/pshints.c @@ -37,7 +37,7 @@ #include "psft.h" -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include "psglue.h" #include "psfont.h" @@ -310,7 +310,7 @@ CF2_Hint hint = &hintmap->edge[i]; - FT_TRACE6(( " %3d %7.2f %7.2f %5d %s%s%s%s\n", + FT_TRACE6(( " %3ld %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/lib/freetype/src/psaux/psintrp.c b/lib/freetype/src/psaux/psintrp.c index 0a8414553..519c69444 100644 --- a/lib/freetype/src/psaux/psintrp.c +++ b/lib/freetype/src/psaux/psintrp.c @@ -37,8 +37,8 @@ #include "psft.h" -#include FT_INTERNAL_DEBUG_H -#include FT_SERVICE_CFF_TABLE_LOAD_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/services/svcfftl.h> #include "psglue.h" #include "psfont.h" diff --git a/lib/freetype/src/psaux/psobjs.c b/lib/freetype/src/psaux/psobjs.c index b37a78832..defc4d4fc 100644 --- a/lib/freetype/src/psaux/psobjs.c +++ b/lib/freetype/src/psaux/psobjs.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H -#include FT_DRIVER_H +#include <freetype/internal/psaux.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftcalc.h> +#include <freetype/ftdriver.h> #include "psobjs.h" #include "psconv.h" @@ -1233,7 +1232,7 @@ bbox->xMax = FT_RoundFix( temp[2] ); bbox->yMax = FT_RoundFix( temp[3] ); - FT_TRACE4(( " [%d %d %d %d]", + FT_TRACE4(( " [%ld %ld %ld %ld]", bbox->xMin / 65536, bbox->yMin / 65536, bbox->xMax / 65536, @@ -1287,7 +1286,7 @@ bbox->xMax = FT_RoundFix( temp[i + 2 * max_objects] ); bbox->yMax = FT_RoundFix( temp[i + 3 * max_objects] ); - FT_TRACE4(( " [%d %d %d %d]", + FT_TRACE4(( " [%ld %ld %ld %ld]", bbox->xMin / 65536, bbox->yMin / 65536, bbox->xMax / 65536, diff --git a/lib/freetype/src/psaux/psobjs.h b/lib/freetype/src/psaux/psobjs.h index d37638d0c..fdad672b6 100644 --- a/lib/freetype/src/psaux/psobjs.h +++ b/lib/freetype/src/psaux/psobjs.h @@ -20,9 +20,8 @@ #define PSOBJS_H_ -#include <ft2build.h> -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_INTERNAL_CFF_OBJECTS_TYPES_H +#include <freetype/internal/psaux.h> +#include <freetype/internal/cffotypes.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/psaux/psread.c b/lib/freetype/src/psaux/psread.c index 86bfc03c6..7f657f2cd 100644 --- a/lib/freetype/src/psaux/psread.c +++ b/lib/freetype/src/psaux/psread.c @@ -37,7 +37,7 @@ #include "psft.h" -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include "psglue.h" diff --git a/lib/freetype/src/psaux/psstack.c b/lib/freetype/src/psaux/psstack.c index 665906800..7ae5256ef 100644 --- a/lib/freetype/src/psaux/psstack.c +++ b/lib/freetype/src/psaux/psstack.c @@ -37,7 +37,7 @@ #include "psft.h" -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include "psglue.h" #include "psfont.h" @@ -59,12 +59,12 @@ CF2_Stack stack = NULL; - if ( !FT_NEW( stack ) ) - { - /* initialize the structure; FT_NEW zeroes it */ - stack->memory = memory; - stack->error = e; - } + if ( FT_NEW( stack ) ) + return NULL; + + /* 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/lib/freetype/src/psaux/psstack.h b/lib/freetype/src/psaux/psstack.h index 18cd39bc6..b9ef9edf1 100644 --- a/lib/freetype/src/psaux/psstack.h +++ b/lib/freetype/src/psaux/psstack.h @@ -39,6 +39,7 @@ #ifndef PSSTACK_H_ #define PSSTACK_H_ +#include <freetype/internal/compiler-macros.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/psaux/pstypes.h b/lib/freetype/src/psaux/pstypes.h index 041287e8d..435ef7e1f 100644 --- a/lib/freetype/src/psaux/pstypes.h +++ b/lib/freetype/src/psaux/pstypes.h @@ -39,8 +39,7 @@ #ifndef PSTYPES_H_ #define PSTYPES_H_ -#include <ft2build.h> -#include FT_FREETYPE_H +#include <freetype/freetype.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/psaux/t1cmap.c b/lib/freetype/src/psaux/t1cmap.c index 451b27653..e21e93ca2 100644 --- a/lib/freetype/src/psaux/t1cmap.c +++ b/lib/freetype/src/psaux/t1cmap.c @@ -18,7 +18,7 @@ #include "t1cmap.h" -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include "psauxerr.h" diff --git a/lib/freetype/src/psaux/t1cmap.h b/lib/freetype/src/psaux/t1cmap.h index 541191383..031796510 100644 --- a/lib/freetype/src/psaux/t1cmap.h +++ b/lib/freetype/src/psaux/t1cmap.h @@ -19,9 +19,8 @@ #ifndef T1CMAP_H_ #define T1CMAP_H_ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_TYPE1_TYPES_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/t1types.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/psaux/t1decode.c b/lib/freetype/src/psaux/t1decode.c index fa1745d9e..2ed27ca19 100644 --- a/lib/freetype/src/psaux/t1decode.c +++ b/lib/freetype/src/psaux/t1decode.c @@ -16,12 +16,11 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H -#include FT_INTERNAL_HASH_H -#include FT_OUTLINE_H +#include <freetype/internal/ftcalc.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/pshints.h> +#include <freetype/internal/fthash.h> +#include <freetype/ftoutln.h> #include "t1decode.h" #include "psobjs.h" @@ -1238,8 +1237,8 @@ FT_UNUSED( orig_y ); - /* the `metrics_only' indicates that we only want to compute */ - /* the glyph's metrics (lsb + advance width), not load the */ + /* `metrics_only' indicates that we only want to compute the */ + /* glyph's metrics (lsb + advance width) without loading the */ /* rest of it; so exit immediately */ if ( builder->metrics_only ) { @@ -1273,8 +1272,8 @@ x = ADD_LONG( builder->pos_x, top[0] ); y = ADD_LONG( builder->pos_y, top[1] ); - /* the `metrics_only' indicates that we only want to compute */ - /* the glyph's metrics (lsb + advance width), not load the */ + /* `metrics_only' indicates that we only want to compute the */ + /* glyph's metrics (lsb + advance width) without loading the */ /* rest of it; so exit immediately */ if ( builder->metrics_only ) { @@ -1728,7 +1727,7 @@ #ifdef FT_DEBUG_LEVEL_TRACE if ( bol ) { - FT_TRACE5(( " (%d)", decoder->top - decoder->stack )); + FT_TRACE5(( " (%ld)", decoder->top - decoder->stack )); bol = FALSE; } #endif @@ -1750,8 +1749,6 @@ case 7: case 8: case 9: - case 10: - case 11: case 14: case 15: case 21: @@ -1760,6 +1757,13 @@ case 31: goto No_Width; + case 10: + op = op_callsubr; + break; + case 11: + op = op_return; + break; + case 13: op = op_hsbw; break; @@ -1899,13 +1903,20 @@ #ifdef FT_DEBUG_LEVEL_TRACE - if ( op != op_div ) + switch ( op ) { + 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 %d, expected %d)\n", + " (seen %ld, expected %d)\n", top - decoder->stack, num_args )); + break; } #endif /* FT_DEBUG_LEVEL_TRACE */ @@ -1926,8 +1937,8 @@ builder->advance.y = 0; /* we only want to compute the glyph's metrics */ - /* (lsb + advance width), not load the rest of */ - /* it; so exit immediately */ + /* (lsb + advance width) without loading the */ + /* rest of it; so exit immediately */ FT_TRACE4(( "\n" )); return FT_Err_Ok; @@ -1945,8 +1956,8 @@ builder->advance.y = top[3]; /* we only want to compute the glyph's metrics */ - /* (lsb + advance width), not load the rest of */ - /* it; so exit immediately */ + /* (lsb + advance width), without loading the */ + /* rest of it; so exit immediately */ FT_TRACE4(( "\n" )); return FT_Err_Ok; @@ -1962,6 +1973,91 @@ 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/lib/freetype/src/psaux/t1decode.h b/lib/freetype/src/psaux/t1decode.h index 231947e85..b793504ac 100644 --- a/lib/freetype/src/psaux/t1decode.h +++ b/lib/freetype/src/psaux/t1decode.h @@ -20,9 +20,8 @@ #define T1DECODE_H_ -#include <ft2build.h> -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_INTERNAL_TYPE1_TYPES_H +#include <freetype/internal/psaux.h> +#include <freetype/internal/t1types.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/pshinter/Jamfile b/lib/freetype/src/pshinter/Jamfile deleted file mode 100644 index 1442d9860..000000000 --- a/lib/freetype/src/pshinter/Jamfile +++ /dev/null @@ -1,34 +0,0 @@ -# FreeType 2 src/pshinter Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) pshinter ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = pshalgo - pshglob - pshmod - pshpic - pshrec - ; - } - else - { - _sources = pshinter ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/pshinter Jamfile diff --git a/lib/freetype/src/pshinter/pshalgo.c b/lib/freetype/src/pshinter/pshalgo.c index 57dfa3da9..920b9a74b 100644 --- a/lib/freetype/src/pshinter/pshalgo.c +++ b/lib/freetype/src/pshinter/pshalgo.c @@ -16,10 +16,9 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftcalc.h> #include "pshalgo.h" #include "pshnterr.h" diff --git a/lib/freetype/src/pshinter/pshglob.c b/lib/freetype/src/pshinter/pshglob.c index d9f835f99..cdc1c3af0 100644 --- a/lib/freetype/src/pshinter/pshglob.c +++ b/lib/freetype/src/pshinter/pshglob.c @@ -17,10 +17,9 @@ */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_CALC_H +#include <freetype/freetype.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftcalc.h> #include "pshglob.h" #ifdef DEBUG_HINTER diff --git a/lib/freetype/src/pshinter/pshglob.h b/lib/freetype/src/pshinter/pshglob.h index cd2f3122f..8181324e5 100644 --- a/lib/freetype/src/pshinter/pshglob.h +++ b/lib/freetype/src/pshinter/pshglob.h @@ -20,8 +20,8 @@ #define PSHGLOB_H_ -#include FT_FREETYPE_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H +#include <freetype/freetype.h> +#include <freetype/internal/pshints.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/pshinter/pshinter.c b/lib/freetype/src/pshinter/pshinter.c index 6009db518..3cca0ad7c 100644 --- a/lib/freetype/src/pshinter/pshinter.c +++ b/lib/freetype/src/pshinter/pshinter.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "pshalgo.c" #include "pshglob.c" diff --git a/lib/freetype/src/pshinter/pshmod.c b/lib/freetype/src/pshinter/pshmod.c index 686859b3e..e0abd386f 100644 --- a/lib/freetype/src/pshinter/pshmod.c +++ b/lib/freetype/src/pshinter/pshmod.c @@ -16,10 +16,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftobjs.h> #include "pshrec.h" #include "pshalgo.h" +#include "pshmod.h" /* the Postscript Hinter module structure */ diff --git a/lib/freetype/src/pshinter/pshmod.h b/lib/freetype/src/pshinter/pshmod.h index c44112e9d..2a6eb1c46 100644 --- a/lib/freetype/src/pshinter/pshmod.h +++ b/lib/freetype/src/pshinter/pshmod.h @@ -20,8 +20,7 @@ #define PSHMOD_H_ -#include <ft2build.h> -#include FT_MODULE_H +#include <freetype/ftmodapi.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/pshinter/pshnterr.h b/lib/freetype/src/pshinter/pshnterr.h index c4e9f42d2..d67955c41 100644 --- a/lib/freetype/src/pshinter/pshnterr.h +++ b/lib/freetype/src/pshinter/pshnterr.h @@ -25,7 +25,7 @@ #ifndef PSHNTERR_H_ #define PSHNTERR_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -33,7 +33,7 @@ #define FT_ERR_PREFIX PSH_Err_ #define FT_ERR_BASE FT_Mod_Err_PShinter -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* PSHNTERR_H_ */ diff --git a/lib/freetype/src/pshinter/pshrec.c b/lib/freetype/src/pshinter/pshrec.c index a81c6f712..bddccf2a6 100644 --- a/lib/freetype/src/pshinter/pshrec.c +++ b/lib/freetype/src/pshinter/pshrec.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H +#include <freetype/freetype.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftcalc.h> #include "pshrec.h" #include "pshalgo.h" @@ -875,7 +874,7 @@ if ( error ) { FT_ERROR(( "ps_hints_stem: could not add stem" - " (%d,%d) to hints table\n", stems[0], stems[1] )); + " (%ld,%ld) to hints table\n", stems[0], stems[1] )); hints->error = error; return; diff --git a/lib/freetype/src/pshinter/pshrec.h b/lib/freetype/src/pshinter/pshrec.h index a8bc5aeec..b13c7be13 100644 --- a/lib/freetype/src/pshinter/pshrec.h +++ b/lib/freetype/src/pshinter/pshrec.h @@ -32,8 +32,7 @@ #define PSHREC_H_ -#include <ft2build.h> -#include FT_INTERNAL_POSTSCRIPT_HINTS_H +#include <freetype/internal/pshints.h> #include "pshglob.h" diff --git a/lib/freetype/src/psnames/Jamfile b/lib/freetype/src/psnames/Jamfile deleted file mode 100644 index 9bd6b569f..000000000 --- a/lib/freetype/src/psnames/Jamfile +++ /dev/null @@ -1,31 +0,0 @@ -# FreeType 2 src/psnames Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) psnames ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = psmodule - pspic - ; - } - else - { - _sources = psnames ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/psnames Jamfile diff --git a/lib/freetype/src/psnames/psmodule.c b/lib/freetype/src/psnames/psmodule.c index bb3ff0702..b38f9d3b1 100644 --- a/lib/freetype/src/psnames/psmodule.c +++ b/lib/freetype/src/psnames/psmodule.c @@ -16,10 +16,9 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_OBJECTS_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/services/svpscmap.h> #include "psmodule.h" diff --git a/lib/freetype/src/psnames/psmodule.h b/lib/freetype/src/psnames/psmodule.h index 955f699f3..c85a9ecad 100644 --- a/lib/freetype/src/psnames/psmodule.h +++ b/lib/freetype/src/psnames/psmodule.h @@ -20,8 +20,7 @@ #define PSMODULE_H_ -#include <ft2build.h> -#include FT_MODULE_H +#include <freetype/ftmodapi.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/psnames/psnamerr.h b/lib/freetype/src/psnames/psnamerr.h index fb9058e61..154c701d0 100644 --- a/lib/freetype/src/psnames/psnamerr.h +++ b/lib/freetype/src/psnames/psnamerr.h @@ -26,7 +26,7 @@ #ifndef PSNAMERR_H_ #define PSNAMERR_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -34,7 +34,7 @@ #define FT_ERR_PREFIX PSnames_Err_ #define FT_ERR_BASE FT_Mod_Err_PSnames -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* PSNAMERR_H_ */ diff --git a/lib/freetype/src/psnames/psnames.c b/lib/freetype/src/psnames/psnames.c index 5ac3897d2..cff36851b 100644 --- a/lib/freetype/src/psnames/psnames.c +++ b/lib/freetype/src/psnames/psnames.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "psmodule.c" diff --git a/lib/freetype/src/raster/Jamfile b/lib/freetype/src/raster/Jamfile deleted file mode 100644 index c001c2c89..000000000 --- a/lib/freetype/src/raster/Jamfile +++ /dev/null @@ -1,32 +0,0 @@ -# FreeType 2 src/raster Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) raster ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = ftraster - ftrend1 - rastpic - ; - } - else - { - _sources = raster ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/raster Jamfile diff --git a/lib/freetype/src/raster/ftraster.c b/lib/freetype/src/raster/ftraster.c index 35655a634..9f0a7976f 100644 --- a/lib/freetype/src/raster/ftraster.c +++ b/lib/freetype/src/raster/ftraster.c @@ -62,10 +62,9 @@ #else /* !STANDALONE_ */ -#include <ft2build.h> #include "ftraster.h" -#include FT_INTERNAL_CALC_H /* for FT_MulDiv and FT_MulDiv_No_Round */ -#include FT_OUTLINE_H /* for FT_Outline_Get_CBox */ +#include <freetype/internal/ftcalc.h> /* for FT_MulDiv and FT_MulDiv_No_Round */ +#include <freetype/ftoutln.h> /* for FT_Outline_Get_CBox */ #endif /* !STANDALONE_ */ @@ -226,8 +225,8 @@ #else /* !STANDALONE_ */ -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H /* for FT_TRACE, FT_ERROR, and FT_THROW */ +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> /* for FT_TRACE, FT_ERROR, and FT_THROW */ #include "rasterrs.h" @@ -460,6 +459,11 @@ #define IS_TOP_OVERSHOOT( x ) \ (Bool)( x - FLOOR( x ) >= ras.precision_half ) + /* Smart dropout rounding to find which pixel is closer to span ends. */ + /* To mimick Windows, symmetric cases break down indepenently of the */ + /* precision. */ +#define SMART( p, q ) FLOOR( ( (p) + (q) + ras.precision * 63 / 64 ) >> 1 ) + #if FT_RENDER_POOL_SIZE > 2048 #define FT_MAX_BLACK_POOL ( FT_RENDER_POOL_SIZE / sizeof ( Long ) ) #else @@ -674,13 +678,13 @@ if ( overshoot ) ras.cProfile->flags |= Overshoot_Bottom; - FT_TRACE6(( " new ascending profile = %p\n", ras.cProfile )); + FT_TRACE6(( " new ascending profile = %p\n", (void *)ras.cProfile )); break; case Descending_State: if ( overshoot ) ras.cProfile->flags |= Overshoot_Top; - FT_TRACE6(( " new descending profile = %p\n", ras.cProfile )); + FT_TRACE6(( " new descending profile = %p\n", (void *)ras.cProfile )); break; default: @@ -737,7 +741,7 @@ FT_TRACE6(( " ending profile %p, start = %ld, height = %ld\n", - ras.cProfile, ras.cProfile->start, h )); + (void *)ras.cProfile, ras.cProfile->start, h )); ras.cProfile->height = h; if ( overshoot ) @@ -2242,11 +2246,10 @@ /* in high-precision mode, we need 12 digits after the comma to */ /* represent multiples of 1/(1<<12) = 1/4096 */ - FT_TRACE7(( " y=%d x=[%.12f;%.12f], drop-out=%d", + FT_TRACE7(( " y=%d x=[% .12f;% .12f]", y, x1 / (double)ras.precision, - x2 / (double)ras.precision, - dropOutControl )); + x2 / (double)ras.precision )); /* Drop-out control */ @@ -2274,7 +2277,7 @@ if ( e2 >= ras.bWidth ) e2 = ras.bWidth - 1; - FT_TRACE7(( " -> x=[%d;%d]", e1, e2 )); + FT_TRACE7(( " -> x=[%ld;%ld]", e1, e2 )); c1 = (Short)( e1 >> 3 ); c2 = (Short)( e2 >> 3 ); @@ -2316,7 +2319,7 @@ Short c1, f1; - FT_TRACE7(( " y=%d x=[%.12f;%.12f]", + FT_TRACE7(( " y=%d x=[% .12f;% .12f]", y, x1 / (double)ras.precision, x2 / (double)ras.precision )); @@ -2353,8 +2356,6 @@ Int dropOutControl = left->flags & 7; - FT_TRACE7(( ", drop-out=%d", dropOutControl )); - if ( e1 == e2 + ras.precision ) { switch ( dropOutControl ) @@ -2364,7 +2365,7 @@ break; case 4: /* smart drop-outs including stubs */ - pxl = FLOOR( ( x1 + x2 - 1 ) / 2 + ras.precision_half ); + pxl = SMART( x1, x2 ); break; case 1: /* simple drop-outs excluding stubs */ @@ -2413,7 +2414,7 @@ if ( dropOutControl == 1 ) pxl = e2; else - pxl = FLOOR( ( x1 + x2 - 1 ) / 2 + ras.precision_half ); + pxl = SMART( x1, x2 ); break; default: /* modes 2, 3, 6, 7 */ @@ -2448,7 +2449,7 @@ if ( e1 >= 0 && e1 < ras.bWidth ) { - FT_TRACE7(( " -> x=%d (drop-out)", e1 )); + FT_TRACE7(( " -> x=%ld", e1 )); c1 = (Short)( e1 >> 3 ); f1 = (Short)( e1 & 7 ); @@ -2457,7 +2458,7 @@ } Exit: - FT_TRACE7(( "\n" )); + FT_TRACE7(( " dropout=%d\n", left->flags & 7 )); } @@ -2495,44 +2496,68 @@ PProfile left, PProfile right ) { + Long e1, e2; + FT_UNUSED( left ); FT_UNUSED( right ); - if ( x2 - x1 < ras.precision ) - { - Long e1, e2; + FT_TRACE7(( " x=%d y=[% .12f;% .12f]", + y, + x1 / (double)ras.precision, + x2 / (double)ras.precision )); + /* We should not need this procedure but the vertical sweep */ + /* mishandles horizontal lines through pixel centers. So we */ + /* have to check perfectly aligned span edges here. */ + /* */ + /* XXX: Can we handle horizontal lines better and drop this? */ - FT_TRACE7(( " x=%d y=[%.12f;%.12f]", - y, - x1 / (double)ras.precision, - x2 / (double)ras.precision )); + e1 = CEILING( x1 ); - e1 = CEILING( x1 ); - e2 = FLOOR ( x2 ); + if ( x1 == e1 ) + { + e1 = TRUNC( e1 ); - if ( e1 == e2 ) + if ( e1 >= 0 && (ULong)e1 < ras.target.rows ) { - e1 = TRUNC( e1 ); - - if ( e1 >= 0 && (ULong)e1 < ras.target.rows ) - { - Byte f1; - PByte bits; + Byte f1; + PByte bits; - FT_TRACE7(( " -> y=%d (drop-out)", e1 )); + bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.target.pitch; + f1 = (Byte)( 0x80 >> ( y & 7 ) ); - bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.target.pitch; - f1 = (Byte)( 0x80 >> ( y & 7 ) ); + FT_TRACE7(( bits[0] & f1 ? " redundant" + : " -> y=%ld edge", e1 )); - bits[0] |= f1; - } + bits[0] |= f1; } + } + + e2 = FLOOR ( x2 ); + + if ( x2 == e2 ) + { + e2 = TRUNC( e2 ); + + if ( e2 >= 0 && (ULong)e2 < ras.target.rows ) + { + Byte f1; + PByte bits; + - FT_TRACE7(( "\n" )); + bits = ras.bOrigin + ( y >> 3 ) - e2 * ras.target.pitch; + f1 = (Byte)( 0x80 >> ( y & 7 ) ); + + FT_TRACE7(( bits[0] & f1 ? " redundant" + : " -> y=%ld edge", e2 )); + + bits[0] |= f1; + } } + + FT_TRACE7(( "\n" )); } @@ -2548,7 +2573,7 @@ Byte f1; - FT_TRACE7(( " x=%d y=[%.12f;%.12f]", + FT_TRACE7(( " x=%d y=[% .12f;% .12f]", y, x1 / (double)ras.precision, x2 / (double)ras.precision )); @@ -2574,8 +2599,6 @@ Int dropOutControl = left->flags & 7; - FT_TRACE7(( ", dropout=%d", dropOutControl )); - if ( e1 == e2 + ras.precision ) { switch ( dropOutControl ) @@ -2585,7 +2608,7 @@ break; case 4: /* smart drop-outs including stubs */ - pxl = FLOOR( ( x1 + x2 - 1 ) / 2 + ras.precision_half ); + pxl = SMART( x1, x2 ); break; case 1: /* simple drop-outs excluding stubs */ @@ -2609,7 +2632,7 @@ if ( dropOutControl == 1 ) pxl = e2; else - pxl = FLOOR( ( x1 + x2 - 1 ) / 2 + ras.precision_half ); + pxl = SMART( x1, x2 ); break; default: /* modes 2, 3, 6, 7 */ @@ -2645,7 +2668,7 @@ if ( e1 >= 0 && (ULong)e1 < ras.target.rows ) { - FT_TRACE7(( " -> y=%d (drop-out)", e1 )); + FT_TRACE7(( " -> y=%ld", e1 )); bits = ras.bOrigin + ( y >> 3 ) - e1 * ras.target.pitch; f1 = (Byte)( 0x80 >> ( y & 7 ) ); @@ -2654,7 +2677,7 @@ } Exit: - FT_TRACE7(( "\n" )); + FT_TRACE7(( " dropout=%d\n", left->flags & 7 )); } diff --git a/lib/freetype/src/raster/ftraster.h b/lib/freetype/src/raster/ftraster.h index 833d30f23..1b2ee3c01 100644 --- a/lib/freetype/src/raster/ftraster.h +++ b/lib/freetype/src/raster/ftraster.h @@ -22,8 +22,9 @@ #include <ft2build.h> #include FT_CONFIG_CONFIG_H -#include FT_IMAGE_H +#include <freetype/ftimage.h> +#include <freetype/internal/compiler-macros.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/raster/ftrend1.c b/lib/freetype/src/raster/ftrend1.c index 944279a8d..57fed9bc1 100644 --- a/lib/freetype/src/raster/ftrend1.c +++ b/lib/freetype/src/raster/ftrend1.c @@ -16,10 +16,9 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_OBJECTS_H -#include FT_OUTLINE_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/ftoutln.h> #include "ftrend1.h" #include "ftraster.h" diff --git a/lib/freetype/src/raster/ftrend1.h b/lib/freetype/src/raster/ftrend1.h index dc972b1bc..3f6be5367 100644 --- a/lib/freetype/src/raster/ftrend1.h +++ b/lib/freetype/src/raster/ftrend1.h @@ -20,8 +20,7 @@ #define FTREND1_H_ -#include <ft2build.h> -#include FT_RENDER_H +#include <freetype/ftrender.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/raster/raster.c b/lib/freetype/src/raster/raster.c index 08431c850..cd37943bf 100644 --- a/lib/freetype/src/raster/raster.c +++ b/lib/freetype/src/raster/raster.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "ftraster.c" #include "ftrend1.c" diff --git a/lib/freetype/src/raster/rasterrs.h b/lib/freetype/src/raster/rasterrs.h index 379e1d3e8..a29651a6c 100644 --- a/lib/freetype/src/raster/rasterrs.h +++ b/lib/freetype/src/raster/rasterrs.h @@ -26,7 +26,7 @@ #ifndef RASTERRS_H_ #define RASTERRS_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -34,7 +34,7 @@ #define FT_ERR_PREFIX Raster_Err_ #define FT_ERR_BASE FT_Mod_Err_Raster -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* RASTERRS_H_ */ diff --git a/lib/freetype/src/sfnt/Jamfile b/lib/freetype/src/sfnt/Jamfile deleted file mode 100644 index 8f88f61e5..000000000 --- a/lib/freetype/src/sfnt/Jamfile +++ /dev/null @@ -1,42 +0,0 @@ -# FreeType 2 src/sfnt Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) sfnt ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = pngshim - sfdriver - sfntpic - sfobjs - ttbdf - ttcmap - ttcolr - ttcpal - ttkern - ttload - ttmtx - ttpost - ttsbit - ; - } - else - { - _sources = sfnt ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/sfnt Jamfile diff --git a/lib/freetype/src/sfnt/pngshim.c b/lib/freetype/src/sfnt/pngshim.c index 523b30a74..584ff9409 100644 --- a/lib/freetype/src/sfnt/pngshim.c +++ b/lib/freetype/src/sfnt/pngshim.c @@ -17,16 +17,16 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/tttags.h> #include FT_CONFIG_STANDARD_LIBRARY_H #if defined( TT_CONFIG_OPTION_EMBEDDED_BITMAPS ) && \ defined( FT_CONFIG_OPTION_USE_PNG ) +#error bug /* We always include <setjmp.h>, so make libpng shut up! */ #define PNG_SKIP_SETJMP_CHECK 1 #include <png.h> @@ -61,7 +61,12 @@ /* 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. */ -#if ( ( defined( __GNUC__ ) && \ + /* */ + /* Intel compilers do not currently support __builtin_shuffle; */ + + /* The Intel check must be first. */ +#if !defined( __INTEL_COMPILER ) && \ + ( ( defined( __GNUC__ ) && \ ( ( __GNUC__ >= 5 ) || \ ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 7 ) ) ) ) || \ ( defined( __clang__ ) && \ @@ -328,6 +333,13 @@ if ( populate_map_and_metrics ) { + /* reject too large bitmaps similarly to the rasterizer */ + if ( imgHeight > 0x7FFF || imgWidth > 0x7FFF ) + { + error = FT_THROW( Array_Too_Large ); + goto DestroyExit; + } + metrics->width = (FT_UShort)imgWidth; metrics->height = (FT_UShort)imgHeight; @@ -336,13 +348,6 @@ map->pixel_mode = FT_PIXEL_MODE_BGRA; map->pitch = (int)( map->width * 4 ); map->num_grays = 256; - - /* reject too large bitmaps similarly to the rasterizer */ - if ( map->rows > 0x7FFF || map->width > 0x7FFF ) - { - error = FT_THROW( Array_Too_Large ); - goto DestroyExit; - } } /* convert palette/gray image to rgb */ diff --git a/lib/freetype/src/sfnt/pngshim.h b/lib/freetype/src/sfnt/pngshim.h index d2c9e2b9b..2d6e83d69 100644 --- a/lib/freetype/src/sfnt/pngshim.h +++ b/lib/freetype/src/sfnt/pngshim.h @@ -21,7 +21,6 @@ #define PNGSHIM_H_ -#include <ft2build.h> #include "ttload.h" diff --git a/lib/freetype/src/sfnt/sfdriver.c b/lib/freetype/src/sfnt/sfdriver.c index 6ca4f3c26..0460339a7 100644 --- a/lib/freetype/src/sfnt/sfdriver.c +++ b/lib/freetype/src/sfnt/sfdriver.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_SFNT_H -#include FT_INTERNAL_OBJECTS_H -#include FT_TRUETYPE_IDS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/sfnt.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/ttnameid.h> #include "sfdriver.h" #include "ttload.h" @@ -43,21 +42,21 @@ #ifdef TT_CONFIG_OPTION_BDF #include "ttbdf.h" -#include FT_SERVICE_BDF_H +#include <freetype/internal/services/svbdf.h> #endif #include "ttcmap.h" #include "ttkern.h" #include "ttmtx.h" -#include FT_SERVICE_GLYPH_DICT_H -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_SFNT_H -#include FT_SERVICE_TT_CMAP_H +#include <freetype/internal/services/svgldict.h> +#include <freetype/internal/services/svpostnm.h> +#include <freetype/internal/services/svsfnt.h> +#include <freetype/internal/services/svttcmap.h> #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include FT_MULTIPLE_MASTERS_H -#include FT_SERVICE_MULTIPLE_MASTERS_H +#include <freetype/ftmm.h> +#include <freetype/internal/services/svmm.h> #endif @@ -195,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%08x\n", + FT_TRACE0(( "Ignore glyph names for invalid GID 0x%08x - 0x%08lx\n", FT_UINT_MAX, face->num_glyphs )); for ( i = 0; i < max_gid; i++ ) diff --git a/lib/freetype/src/sfnt/sfdriver.h b/lib/freetype/src/sfnt/sfdriver.h index d108ee200..1ac270632 100644 --- a/lib/freetype/src/sfnt/sfdriver.h +++ b/lib/freetype/src/sfnt/sfdriver.h @@ -20,8 +20,7 @@ #define SFDRIVER_H_ -#include <ft2build.h> -#include FT_MODULE_H +#include <freetype/ftmodapi.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/sfnt/sferrors.h b/lib/freetype/src/sfnt/sferrors.h index fbfca0e52..55c3e76b6 100644 --- a/lib/freetype/src/sfnt/sferrors.h +++ b/lib/freetype/src/sfnt/sferrors.h @@ -25,7 +25,7 @@ #ifndef SFERRORS_H_ #define SFERRORS_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -33,7 +33,7 @@ #define FT_ERR_PREFIX SFNT_Err_ #define FT_ERR_BASE FT_Mod_Err_SFNT -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* SFERRORS_H_ */ diff --git a/lib/freetype/src/sfnt/sfnt.c b/lib/freetype/src/sfnt/sfnt.c index 9db7935ae..471239ff0 100644 --- a/lib/freetype/src/sfnt/sfnt.c +++ b/lib/freetype/src/sfnt/sfnt.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "pngshim.c" #include "sfdriver.c" diff --git a/lib/freetype/src/sfnt/sfobjs.c b/lib/freetype/src/sfnt/sfobjs.c index 2c66a9b64..39460be2e 100644 --- a/lib/freetype/src/sfnt/sfobjs.c +++ b/lib/freetype/src/sfnt/sfobjs.c @@ -16,23 +16,22 @@ */ -#include <ft2build.h> #include "sfobjs.h" #include "ttload.h" #include "ttcmap.h" #include "ttkern.h" #include "sfwoff.h" #include "sfwoff2.h" -#include FT_INTERNAL_SFNT_H -#include FT_INTERNAL_DEBUG_H -#include FT_TRUETYPE_IDS_H -#include FT_TRUETYPE_TAGS_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_SFNT_NAMES_H +#include <freetype/internal/sfnt.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/ttnameid.h> +#include <freetype/tttags.h> +#include <freetype/internal/services/svpscmap.h> +#include <freetype/ftsnames.h> #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include FT_SERVICE_MULTIPLE_MASTERS_H -#include FT_SERVICE_METRICS_VARIATIONS_H +#include <freetype/internal/services/svmm.h> +#include <freetype/internal/services/svmetric.h> #endif #include "sferrors.h" @@ -547,8 +546,8 @@ /* Stream may have changed in sfnt_open_font. */ stream = face->root.stream; - FT_TRACE2(( "sfnt_init_face: %08p (index %d)\n", - face, + FT_TRACE2(( "sfnt_init_face: %p (index %d)\n", + (void *)face, face_instance_index )); face_index = FT_ABS( face_instance_index ) & 0xFFFF; @@ -821,7 +820,7 @@ /* it doesn't contain outlines. */ /* */ - FT_TRACE2(( "sfnt_load_face: %08p\n\n", face )); + FT_TRACE2(( "sfnt_load_face: %p\n\n", (void *)face )); /* do we have outlines in there? */ #ifdef FT_CONFIG_OPTION_INCREMENTAL diff --git a/lib/freetype/src/sfnt/sfobjs.h b/lib/freetype/src/sfnt/sfobjs.h index d8438a483..e8e304208 100644 --- a/lib/freetype/src/sfnt/sfobjs.h +++ b/lib/freetype/src/sfnt/sfobjs.h @@ -20,9 +20,8 @@ #define SFOBJS_H_ -#include <ft2build.h> -#include FT_INTERNAL_SFNT_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/sfnt.h> +#include <freetype/internal/ftobjs.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/sfnt/sfwoff.c b/lib/freetype/src/sfnt/sfwoff.c index d1e330f67..f0a32e1e0 100644 --- a/lib/freetype/src/sfnt/sfwoff.c +++ b/lib/freetype/src/sfnt/sfwoff.c @@ -16,12 +16,11 @@ */ -#include <ft2build.h> #include "sfwoff.h" -#include FT_TRUETYPE_TAGS_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_GZIP_H +#include <freetype/tttags.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/ftgzip.h> /************************************************************************** diff --git a/lib/freetype/src/sfnt/sfwoff.h b/lib/freetype/src/sfnt/sfwoff.h index c1789d33d..d177ab116 100644 --- a/lib/freetype/src/sfnt/sfwoff.h +++ b/lib/freetype/src/sfnt/sfwoff.h @@ -20,9 +20,8 @@ #define SFWOFF_H_ -#include <ft2build.h> -#include FT_INTERNAL_SFNT_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/sfnt.h> +#include <freetype/internal/ftobjs.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/sfnt/sfwoff2.c b/lib/freetype/src/sfnt/sfwoff2.c index 201193799..41cd24edb 100644 --- a/lib/freetype/src/sfnt/sfwoff2.c +++ b/lib/freetype/src/sfnt/sfwoff2.c @@ -15,12 +15,11 @@ * */ -#include <ft2build.h> #include "sfwoff2.h" #include "woff2tags.h" -#include FT_TRUETYPE_TAGS_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H +#include <freetype/tttags.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> #ifdef FT_CONFIG_OPTION_USE_BROTLI @@ -43,7 +42,8 @@ #define READ_BASE128( var ) FT_SET_ERROR( ReadBase128( stream, &var ) ) -#define ROUND4( var ) ( ( var + 3 ) & ~3 ) + /* `var' should be FT_ULong */ +#define ROUND4( var ) ( ( var + 3 ) & ~3UL ) #define WRITE_USHORT( p, v ) \ do \ @@ -63,12 +63,12 @@ \ } while ( 0 ) -#define WRITE_SHORT( p, v ) \ - do \ - { \ - *(p)++ = ( (v) >> 8 ); \ - *(p)++ = ( (v) >> 0 ); \ - \ +#define WRITE_SHORT( p, v ) \ + do \ + { \ + *(p)++ = (FT_Byte)( (v) >> 8 ); \ + *(p)++ = (FT_Byte)( (v) >> 0 ); \ + \ } while ( 0 ) #define WRITE_SFNT_BUF( buf, s ) \ @@ -124,10 +124,10 @@ Read255UShort( FT_Stream stream, FT_UShort* value ) { - static const FT_Int oneMoreByteCode1 = 255; - static const FT_Int oneMoreByteCode2 = 254; - static const FT_Int wordCode = 253; - static const FT_Int lowestUCode = 253; + const FT_Byte oneMoreByteCode1 = 255; + const FT_Byte oneMoreByteCode2 = 254; + const FT_Byte wordCode = 253; + const FT_UShort lowestUCode = 253; FT_Error error = FT_Err_Ok; FT_Byte code; @@ -280,12 +280,12 @@ /* Calculate table checksum of `buf'. */ - static FT_Long + static FT_ULong compute_ULong_sum( FT_Byte* buf, FT_ULong size ) { FT_ULong checksum = 0; - FT_ULong aligned_size = size & ~3; + FT_ULong aligned_size = size & ~3UL; FT_ULong i; FT_ULong v; @@ -317,7 +317,9 @@ { #ifdef FT_CONFIG_OPTION_USE_BROTLI - FT_ULong uncompressed_size = dst_size; + /* this cast is only of importance on 32bit systems; */ + /* we don't validate it */ + FT_Offset uncompressed_size = (FT_Offset)dst_size; BrotliDecoderResult result; @@ -536,12 +538,12 @@ FT_ULong* glyph_size ) { FT_UInt flag_offset = 10 + ( 2 * n_contours ) + 2 + instruction_len; - 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_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_UInt xy_bytes; FT_UInt i; FT_UInt x_offset; @@ -553,9 +555,9 @@ { const WOFF2_PointRec point = points[i]; - FT_Int flag = point.on_curve ? GLYF_ON_CURVE : 0; - FT_Int dx = point.x - last_x; - FT_Int dy = point.y - last_y; + FT_Byte 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 ) @@ -632,7 +634,7 @@ if ( dx == 0 ) ; else if ( dx > -256 && dx < 256 ) - dst[x_offset++] = FT_ABS( dx ); + dst[x_offset++] = (FT_Byte)FT_ABS( dx ); else { pointer = dst + x_offset; @@ -645,7 +647,7 @@ if ( dy == 0 ) ; else if ( dy > -256 && dy < 256 ) - dst[y_offset++] = FT_ABS( dy ); + dst[y_offset++] = (FT_Byte)FT_ABS( dy ); else { pointer = dst + y_offset; @@ -917,7 +919,7 @@ bbox_bitmap_offset = substreams[BBOX_STREAM].offset; /* Size of bboxBitmap = 4 * floor((numGlyphs + 31) / 32) */ - bitmap_length = ( ( num_glyphs + 31 ) >> 5 ) << 2; + bitmap_length = ( ( num_glyphs + 31U ) >> 5 ) << 2; substreams[BBOX_STREAM].offset += bitmap_length; glyph_buf_size = WOFF2_DEFAULT_GLYPH_BUF; @@ -1195,7 +1197,7 @@ /* Store x_mins, may be required to reconstruct `hmtx'. */ if ( n_contours > 0 ) - info->x_mins[i] = x_min; + info->x_mins[i] = (FT_Short)x_min; } info->glyf_table->dst_length = dest_offset - info->glyf_table->dst_offset; @@ -1219,7 +1221,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 = %09x\n", *loca_checksum )); + FT_TRACE4(( " checksum = %09lx\n", *loca_checksum )); /* Set pointer `sfnt_bytes' to its correct value. */ *sfnt_bytes = sfnt; @@ -1286,6 +1288,12 @@ 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; @@ -1337,7 +1345,7 @@ if ( FT_STREAM_SEEK( glyf_offset ) || FT_STREAM_SKIP( 2 ) ) return error; - if ( FT_READ_USHORT( info->x_mins[i] ) ) + if ( FT_READ_SHORT( info->x_mins[i] ) ) return error; } @@ -1564,7 +1572,7 @@ WOFF2_TableRec table = *( indices[nn] ); - FT_TRACE3(( "Seeking to %d with table size %d.\n", + FT_TRACE3(( "Seeking to %ld with table size %ld.\n", table.src_offset, table.src_length )); FT_TRACE3(( "Table tag: %c%c%c%c.\n", (FT_Char)( table.Tag >> 24 ), @@ -1605,7 +1613,7 @@ checksum = compute_ULong_sum( transformed_buf + table.src_offset, table.src_length ); - FT_TRACE4(( "Checksum = %09x.\n", checksum )); + FT_TRACE4(( "Checksum = %09lx.\n", checksum )); if ( WRITE_SFNT_BUF( transformed_buf + table.src_offset, table.src_length ) ) @@ -1630,7 +1638,7 @@ memory ) ) goto Fail; - FT_TRACE4(( "Checksum = %09x.\n", checksum )); + FT_TRACE4(( "Checksum = %09lx.\n", checksum )); } else if ( table.Tag == TTAG_loca ) @@ -1706,7 +1714,7 @@ WRITE_ULONG( buf_cursor, font_checksum ); - FT_TRACE2(( "Final checksum = %09x.\n", font_checksum )); + FT_TRACE2(( "Final checksum = %09lx.\n", font_checksum )); woff2->actual_sfnt_size = dest_offset; @@ -1803,15 +1811,15 @@ if ( FT_STREAM_READ_FIELDS( woff2_header_fields, &woff2 ) ) return error; - FT_TRACE4(( "signature -> 0x%X\n", woff2.signature )); + FT_TRACE4(( "signature -> 0x%lX\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 -> %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 )); + 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 )); /* Make sure we don't recurse back here. */ if ( woff2.flavor == TTAG_wOF2 ) @@ -1843,9 +1851,11 @@ FT_NEW_ARRAY( indices, woff2.num_tables ) ) goto Exit; - FT_TRACE2(( "\n" - " tag flags transform origLen transformLen\n" - " --------------------------------------------------\n" )); + FT_TRACE2(( + "\n" + " tag flags transform origLen transformLen offset\n" + " -----------------------------------------------------------\n" )); + /* " XXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX" */ for ( nn = 0; nn < woff2.num_tables; nn++ ) { @@ -1915,7 +1925,7 @@ src_offset += table->TransformLength; table->flags = flags; - FT_TRACE2(( " %c%c%c%c %08d %08d %08ld %08ld\n", + FT_TRACE2(( " %c%c%c%c %08d %08d %08ld %08ld %08ld\n", (FT_Char)( table->Tag >> 24 ), (FT_Char)( table->Tag >> 16 ), (FT_Char)( table->Tag >> 8 ), @@ -1924,7 +1934,6 @@ ( table->FlagByte >> 6 ) & 0x03, table->dst_length, table->TransformLength, - table->src_length, table->src_offset )); indices[nn] = table; @@ -1970,7 +1979,7 @@ goto Exit; } - FT_TRACE4(( "Number of fonts in TTC: %ld\n", woff2.num_fonts )); + FT_TRACE4(( "Number of fonts in TTC: %d\n", woff2.num_fonts )); if ( FT_NEW_ARRAY( woff2.ttc_fonts, woff2.num_fonts ) ) goto Exit; @@ -1988,7 +1997,7 @@ if ( FT_NEW_ARRAY( ttc_font->table_indices, ttc_font->num_tables ) ) goto Exit; - FT_TRACE5(( "Number of tables in font %d: %ld\n", + FT_TRACE5(( "Number of tables in font %d: %d\n", nn, ttc_font->num_tables )); #ifdef FT_DEBUG_LEVEL_TRACE diff --git a/lib/freetype/src/sfnt/sfwoff2.h b/lib/freetype/src/sfnt/sfwoff2.h index 7ae6e2c06..798f66bd0 100644 --- a/lib/freetype/src/sfnt/sfwoff2.h +++ b/lib/freetype/src/sfnt/sfwoff2.h @@ -20,9 +20,8 @@ #define SFWOFF2_H_ -#include <ft2build.h> -#include FT_INTERNAL_SFNT_H -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/sfnt.h> +#include <freetype/internal/ftobjs.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/sfnt/ttbdf.c b/lib/freetype/src/sfnt/ttbdf.c index bc35284cc..a287d3afc 100644 --- a/lib/freetype/src/sfnt/ttbdf.c +++ b/lib/freetype/src/sfnt/ttbdf.c @@ -16,10 +16,9 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/tttags.h> #include "ttbdf.h" #include "sferrors.h" diff --git a/lib/freetype/src/sfnt/ttbdf.h b/lib/freetype/src/sfnt/ttbdf.h index c340f6631..e60c01cb8 100644 --- a/lib/freetype/src/sfnt/ttbdf.h +++ b/lib/freetype/src/sfnt/ttbdf.h @@ -20,9 +20,8 @@ #define TTBDF_H_ -#include <ft2build.h> #include "ttload.h" -#include FT_BDF_H +#include <freetype/ftbdf.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/sfnt/ttcmap.c b/lib/freetype/src/sfnt/ttcmap.c index 2c34efb5c..556a71219 100644 --- a/lib/freetype/src/sfnt/ttcmap.c +++ b/lib/freetype/src/sfnt/ttcmap.c @@ -16,14 +16,13 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> -#include "sferrors.h" /* must come before FT_INTERNAL_VALIDATE_H */ +#include "sferrors.h" /* must come before `ftvalid.h' */ -#include FT_INTERNAL_VALIDATE_H -#include FT_INTERNAL_STREAM_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include <freetype/internal/ftvalid.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/services/svpscmap.h> #include "ttload.h" #include "ttcmap.h" #include "ttpost.h" @@ -3752,6 +3751,7 @@ static const TT_CMap_Class tt_cmap_classes[] = { +#undef TTCMAPCITEM #define TTCMAPCITEM( a ) &a, #include "ttcmapc.h" NULL, @@ -3788,8 +3788,9 @@ p += 2; num_cmaps = TT_NEXT_USHORT( p ); - limit = table + face->cmap_size; + FT_TRACE4(( "tt_face_build_cmaps: %d cmaps\n", num_cmaps )); + limit = table + face->cmap_size; for ( ; num_cmaps > 0 && p + 8 <= limit; num_cmaps-- ) { FT_CharMapRec charmap; diff --git a/lib/freetype/src/sfnt/ttcmap.h b/lib/freetype/src/sfnt/ttcmap.h index 4bf49e2d4..c7d7c21d2 100644 --- a/lib/freetype/src/sfnt/ttcmap.h +++ b/lib/freetype/src/sfnt/ttcmap.h @@ -20,10 +20,9 @@ #define TTCMAP_H_ -#include <ft2build.h> -#include FT_INTERNAL_TRUETYPE_TYPES_H -#include FT_INTERNAL_VALIDATE_H -#include FT_SERVICE_TT_CMAP_H +#include <freetype/internal/tttypes.h> +#include <freetype/internal/ftvalid.h> +#include <freetype/internal/services/svttcmap.h> FT_BEGIN_HEADER @@ -91,6 +90,11 @@ 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/lib/freetype/src/sfnt/ttcolr.c b/lib/freetype/src/sfnt/ttcolr.c index b37fa7b09..9025e356c 100644 --- a/lib/freetype/src/sfnt/ttcolr.c +++ b/lib/freetype/src/sfnt/ttcolr.c @@ -27,11 +27,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H -#include FT_COLOR_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/tttags.h> +#include <freetype/ftcolor.h> #ifdef TT_CONFIG_OPTION_COLOR_LAYERS @@ -40,9 +39,9 @@ /* NOTE: These are the table sizes calculated through the specs. */ -#define BASE_GLYPH_SIZE 6 -#define LAYER_SIZE 4 -#define COLR_HEADER_SIZE 14 +#define BASE_GLYPH_SIZE 6U +#define LAYER_SIZE 4U +#define COLR_HEADER_SIZE 14U typedef struct BaseGlyphRecord_ diff --git a/lib/freetype/src/sfnt/ttcolr.h b/lib/freetype/src/sfnt/ttcolr.h index 8da6b3aa1..641216266 100644 --- a/lib/freetype/src/sfnt/ttcolr.h +++ b/lib/freetype/src/sfnt/ttcolr.h @@ -22,7 +22,6 @@ #define __TTCOLR_H__ -#include <ft2build.h> #include "ttload.h" diff --git a/lib/freetype/src/sfnt/ttcpal.c b/lib/freetype/src/sfnt/ttcpal.c index 165423e30..9c514bafe 100644 --- a/lib/freetype/src/sfnt/ttcpal.c +++ b/lib/freetype/src/sfnt/ttcpal.c @@ -27,11 +27,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H -#include FT_COLOR_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/tttags.h> +#include <freetype/ftcolor.h> #ifdef TT_CONFIG_OPTION_COLOR_LAYERS @@ -40,8 +39,8 @@ /* NOTE: These are the table sizes calculated through the specs. */ -#define CPAL_V0_HEADER_BASE_SIZE 12 -#define COLOR_SIZE 4 +#define CPAL_V0_HEADER_BASE_SIZE 12U +#define COLOR_SIZE 4U /* all data from `CPAL' not covered in FT_Palette_Data */ @@ -140,7 +139,7 @@ 3U * 4 > table_size ) goto InvalidTable; - p += face->palette_data.num_palettes * 2; + p += face->palette_data.num_palettes * 2U; type_offset = FT_NEXT_ULONG( p ); label_offset = FT_NEXT_ULONG( p ); @@ -150,7 +149,7 @@ { if ( type_offset >= table_size ) goto InvalidTable; - if ( face->palette_data.num_palettes * 2 > + if ( face->palette_data.num_palettes * 2U > table_size - type_offset ) goto InvalidTable; @@ -171,7 +170,7 @@ { if ( label_offset >= table_size ) goto InvalidTable; - if ( face->palette_data.num_palettes * 2 > + if ( face->palette_data.num_palettes * 2U > table_size - label_offset ) goto InvalidTable; @@ -192,7 +191,7 @@ { if ( entry_label_offset >= table_size ) goto InvalidTable; - if ( face->palette_data.num_palette_entries * 2 > + if ( face->palette_data.num_palette_entries * 2U > table_size - entry_label_offset ) goto InvalidTable; diff --git a/lib/freetype/src/sfnt/ttcpal.h b/lib/freetype/src/sfnt/ttcpal.h index f2e116ba2..b544be696 100644 --- a/lib/freetype/src/sfnt/ttcpal.h +++ b/lib/freetype/src/sfnt/ttcpal.h @@ -22,7 +22,6 @@ #define __TTCPAL_H__ -#include <ft2build.h> #include "ttload.h" diff --git a/lib/freetype/src/sfnt/ttkern.c b/lib/freetype/src/sfnt/ttkern.c index 1d34acbd1..d4a70c785 100644 --- a/lib/freetype/src/sfnt/ttkern.c +++ b/lib/freetype/src/sfnt/ttkern.c @@ -17,10 +17,9 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/tttags.h> #include "ttkern.h" #include "sferrors.h" diff --git a/lib/freetype/src/sfnt/ttkern.h b/lib/freetype/src/sfnt/ttkern.h index 6560a283a..f44b5bdeb 100644 --- a/lib/freetype/src/sfnt/ttkern.h +++ b/lib/freetype/src/sfnt/ttkern.h @@ -21,9 +21,8 @@ #define TTKERN_H_ -#include <ft2build.h> -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_TRUETYPE_TYPES_H +#include <freetype/internal/ftstream.h> +#include <freetype/internal/tttypes.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/sfnt/ttload.c b/lib/freetype/src/sfnt/ttload.c index d4e4ee4f1..4b46f4135 100644 --- a/lib/freetype/src/sfnt/ttload.c +++ b/lib/freetype/src/sfnt/ttload.c @@ -17,10 +17,9 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/tttags.h> #include "ttload.h" #include "sferrors.h" @@ -65,8 +64,8 @@ #endif - FT_TRACE4(( "tt_face_lookup_table: %08p, `%c%c%c%c' -- ", - face, + FT_TRACE4(( "tt_face_lookup_table: %p, `%c%c%c%c' -- ", + (void *)face, (FT_Char)( tag >> 24 ), (FT_Char)( tag >> 16 ), (FT_Char)( tag >> 8 ), @@ -363,7 +362,7 @@ }; - FT_TRACE2(( "tt_face_load_font_dir: %08p\n", face )); + FT_TRACE2(( "tt_face_load_font_dir: %p\n", (void *)face )); /* read the offset table */ @@ -1315,7 +1314,7 @@ /* we don't load the glyph names, we do that in another */ /* module (ttpost). */ - FT_TRACE3(( "FormatType: 0x%x\n", post->FormatType )); + FT_TRACE3(( "FormatType: 0x%lx\n", post->FormatType )); FT_TRACE3(( "isFixedPitch: %s\n", post->isFixedPitch ? " yes" : " no" )); diff --git a/lib/freetype/src/sfnt/ttload.h b/lib/freetype/src/sfnt/ttload.h index 49d40655f..4e53d8b78 100644 --- a/lib/freetype/src/sfnt/ttload.h +++ b/lib/freetype/src/sfnt/ttload.h @@ -21,9 +21,8 @@ #define TTLOAD_H_ -#include <ft2build.h> -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_TRUETYPE_TYPES_H +#include <freetype/internal/ftstream.h> +#include <freetype/internal/tttypes.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/sfnt/ttmtx.c b/lib/freetype/src/sfnt/ttmtx.c index e18ff877e..021123336 100644 --- a/lib/freetype/src/sfnt/ttmtx.c +++ b/lib/freetype/src/sfnt/ttmtx.c @@ -16,13 +16,12 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/tttags.h> #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include FT_SERVICE_METRICS_VARIATIONS_H +#include <freetype/internal/services/svmetric.h> #endif #include "ttmtx.h" diff --git a/lib/freetype/src/sfnt/ttmtx.h b/lib/freetype/src/sfnt/ttmtx.h index c98c79ec5..dba65ca9b 100644 --- a/lib/freetype/src/sfnt/ttmtx.h +++ b/lib/freetype/src/sfnt/ttmtx.h @@ -20,9 +20,8 @@ #define TTMTX_H_ -#include <ft2build.h> -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_TRUETYPE_TYPES_H +#include <freetype/internal/ftstream.h> +#include <freetype/internal/tttypes.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/sfnt/ttpost.c b/lib/freetype/src/sfnt/ttpost.c index f7be71621..e93a4bf1b 100644 --- a/lib/freetype/src/sfnt/ttpost.c +++ b/lib/freetype/src/sfnt/ttpost.c @@ -25,10 +25,9 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/tttags.h> #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES @@ -54,7 +53,7 @@ #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES -#include FT_SERVICE_POSTSCRIPT_CMAPS_H +#include <freetype/internal/services/svpscmap.h> #define MAC_NAME( x ) (FT_String*)psnames->macintosh_name( (FT_UInt)(x) ) @@ -240,7 +239,7 @@ break; else { - FT_TRACE6(( "load_format_20: %d byte left in post table\n", + FT_TRACE6(( "load_format_20: %ld byte left in post table\n", post_limit - FT_STREAM_POS() )); if ( FT_READ_BYTE( len ) ) diff --git a/lib/freetype/src/sfnt/ttpost.h b/lib/freetype/src/sfnt/ttpost.h index 547f2ff84..94c7d1680 100644 --- a/lib/freetype/src/sfnt/ttpost.h +++ b/lib/freetype/src/sfnt/ttpost.h @@ -23,7 +23,7 @@ #include <ft2build.h> #include FT_CONFIG_CONFIG_H -#include FT_INTERNAL_TRUETYPE_TYPES_H +#include <freetype/internal/tttypes.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/sfnt/ttsbit.c b/lib/freetype/src/sfnt/ttsbit.c index 3f8730f7f..9dd441971 100644 --- a/lib/freetype/src/sfnt/ttsbit.c +++ b/lib/freetype/src/sfnt/ttsbit.c @@ -19,11 +19,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H -#include FT_BITMAP_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/tttags.h> +#include <freetype/ftbitmap.h> #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS @@ -348,7 +347,7 @@ FT_TRACE2(( "tt_face_load_strike_metrics:" " sanitizing invalid ascender and descender\n" " " - " values for strike %d (%dppem, %dppem)\n", + " values for strike %ld (%dppem, %dppem)\n", strike_index, metrics->x_ppem, metrics->y_ppem )); diff --git a/lib/freetype/src/sfnt/ttsbit.h b/lib/freetype/src/sfnt/ttsbit.h index dfeb88683..b867e43a6 100644 --- a/lib/freetype/src/sfnt/ttsbit.h +++ b/lib/freetype/src/sfnt/ttsbit.h @@ -20,7 +20,6 @@ #define TTSBIT_H_ -#include <ft2build.h> #include "ttload.h" diff --git a/lib/freetype/src/sfnt/woff2tags.c b/lib/freetype/src/sfnt/woff2tags.c index 246f7fa06..fd9f2e6c5 100644 --- a/lib/freetype/src/sfnt/woff2tags.c +++ b/lib/freetype/src/sfnt/woff2tags.c @@ -16,9 +16,8 @@ */ -#include <ft2build.h> -#include FT_TRUETYPE_TAGS_H - +#include <freetype/tttags.h> +#include "woff2tags.h" /* * Return tag from index in the order given in WOFF2 specification. diff --git a/lib/freetype/src/sfnt/woff2tags.h b/lib/freetype/src/sfnt/woff2tags.h index 13d242e11..c437c77aa 100644 --- a/lib/freetype/src/sfnt/woff2tags.h +++ b/lib/freetype/src/sfnt/woff2tags.h @@ -4,7 +4,7 @@ * * WOFFF2 Font table tags (specification). * - * Copyright (C) 1996-2020 by + * Copyright (C) 2019-2020 by * Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -20,8 +20,8 @@ #define WOFF2TAGS_H -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/compiler-macros.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/smooth/Jamfile b/lib/freetype/src/smooth/Jamfile deleted file mode 100644 index 97d6f683c..000000000 --- a/lib/freetype/src/smooth/Jamfile +++ /dev/null @@ -1,32 +0,0 @@ -# FreeType 2 src/smooth Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) smooth ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = ftgrays - ftsmooth - ftspic - ; - } - else - { - _sources = smooth ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/smooth Jamfile diff --git a/lib/freetype/src/smooth/ftgrays.c b/lib/freetype/src/smooth/ftgrays.c index 93538331a..681900fd4 100644 --- a/lib/freetype/src/smooth/ftgrays.c +++ b/lib/freetype/src/smooth/ftgrays.c @@ -278,12 +278,11 @@ typedef ptrdiff_t FT_PtrDist; #else /* !STANDALONE_ */ -#include <ft2build.h> #include "ftgrays.h" -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H -#include FT_OUTLINE_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftcalc.h> +#include <freetype/ftoutln.h> #include "ftsmerrs.h" @@ -1649,7 +1648,7 @@ typedef ptrdiff_t FT_PtrDist; if ( !ras.invalid ) gray_record_cell( RAS_VAR ); - FT_TRACE7(( "band [%d..%d]: %d cell%s\n", + FT_TRACE7(( "band [%d..%d]: %ld cell%s\n", ras.min_ey, ras.max_ey, ras.num_cells, diff --git a/lib/freetype/src/smooth/ftgrays.h b/lib/freetype/src/smooth/ftgrays.h index e10fd039a..caba63283 100644 --- a/lib/freetype/src/smooth/ftgrays.h +++ b/lib/freetype/src/smooth/ftgrays.h @@ -28,7 +28,7 @@ #include "ftimage.h" #else #include <ft2build.h> -#include FT_IMAGE_H +#include <freetype/ftimage.h> #endif diff --git a/lib/freetype/src/smooth/ftsmerrs.h b/lib/freetype/src/smooth/ftsmerrs.h index 3f8567b0f..e93f3df9b 100644 --- a/lib/freetype/src/smooth/ftsmerrs.h +++ b/lib/freetype/src/smooth/ftsmerrs.h @@ -26,7 +26,7 @@ #ifndef FTSMERRS_H_ #define FTSMERRS_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -34,7 +34,7 @@ #define FT_ERR_PREFIX Smooth_Err_ #define FT_ERR_BASE FT_Mod_Err_Smooth -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* FTSMERRS_H_ */ diff --git a/lib/freetype/src/smooth/ftsmooth.c b/lib/freetype/src/smooth/ftsmooth.c index 072045cbc..5d66bd6fc 100644 --- a/lib/freetype/src/smooth/ftsmooth.c +++ b/lib/freetype/src/smooth/ftsmooth.c @@ -16,46 +16,15 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_OBJECTS_H -#include FT_OUTLINE_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/ftoutln.h> #include "ftsmooth.h" #include "ftgrays.h" #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; - -#elif 0 /* or else, once ClearType patents expire */ - - 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, @@ -107,14 +76,359 @@ 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; - /* convert a slot's glyph image into a bitmap */ +#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING + + /* initialize renderer -- init its raster */ static FT_Error - ft_smooth_render_generic( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - const FT_Vector* origin, - FT_Render_Mode required_mode ) + 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.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; + + + /* Reject outlines that are too wide for 16-bit FT_Span. */ + /* Other limits are applied upstream with the same error code. */ + if ( bitmap->width * SCALE > 0x7FFF ) + return FT_THROW( Raster_Overflow ); + + /* Set up direct rendering to average oversampled spans. */ + 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 + + static FT_Error + ft_smooth_render( FT_Renderer render, + FT_GlyphSlot slot, + FT_Render_Mode mode, + const FT_Vector* origin ) { FT_Error error = FT_Err_Ok; FT_Outline* outline = &slot->outline; @@ -122,10 +436,6 @@ 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 */ @@ -136,7 +446,10 @@ } /* check mode */ - if ( mode != required_mode ) + if ( mode != FT_RENDER_MODE_NORMAL && + mode != FT_RENDER_MODE_LIGHT && + mode != FT_RENDER_MODE_LCD && + mode != FT_RENDER_MODE_LCD_V ) { error = FT_THROW( Cannot_Render_Glyph ); goto Exit; @@ -181,188 +494,57 @@ if ( x_shift || y_shift ) FT_Outline_Translate( outline, x_shift, y_shift ); - /* 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 ( mode == FT_RENDER_MODE_NORMAL || + mode == FT_RENDER_MODE_LIGHT ) { - 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; - } - - /* render outline into the bitmap */ - error = render->raster_render( render->raster, ¶ms ); - - /* deflate outline if needed */ - { - FT_Vector* points = outline->points; - FT_Vector* points_end = FT_OFFSET( points, outline->n_points ); - FT_Vector* vec; + if ( outline->flags & FT_OUTLINE_OVERLAP ) + error = ft_smooth_raster_overlap( render, outline, bitmap ); + else + { + FT_Raster_Params params; - if ( hmul ) - for ( vec = points; vec < points_end; vec++ ) - vec->x /= 3; + params.target = bitmap; + params.source = outline; + params.flags = FT_RASTER_FLAG_AA; - if ( vmul ) - for ( vec = points; vec < points_end; vec++ ) - vec->y /= 3; + error = render->raster_render( render->raster, ¶ms ); + } } - - if ( error ) - goto Exit; - - /* finally apply filtering */ - if ( hmul || vmul ) + else { - FT_Byte* lcd_weights; - FT_Bitmap_LcdFilterFunc lcd_filter_func; + 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 ); +#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING - /* Per-face LCD filtering takes priority if set up. */ - if ( slot->face && slot->face->internal->lcd_filter_func ) + /* finally apply filtering */ { - 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; - } + FT_Byte* lcd_weights; + FT_Bitmap_LcdFilterFunc lcd_filter_func; - if ( lcd_filter_func ) - lcd_filter_func( bitmap, lcd_weights ); - } - -#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++ ) + /* Per-face LCD filtering takes priority if set up. */ + if ( slot->face && slot->face->internal->lcd_filter_func ) { - temp[3 * j ] = line[j]; - temp[3 * j + 1] = line[j + width]; - temp[3 * j + 2] = line[j + width + width]; + lcd_weights = slot->face->internal->lcd_weights; + lcd_filter_func = slot->face->internal->lcd_filter_func; } - FT_MEM_COPY( line, temp, pitch ); + 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 ); } - 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 */ -#endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ + } Exit: if ( !error ) @@ -383,45 +565,6 @@ } - /* convert a slot's glyph image into a bitmap */ - static FT_Error - ft_smooth_render( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - const FT_Vector* origin ) - { - if ( mode == FT_RENDER_MODE_LIGHT ) - mode = FT_RENDER_MODE_NORMAL; - - return ft_smooth_render_generic( render, slot, mode, origin, - FT_RENDER_MODE_NORMAL ); - } - - - /* convert a slot's glyph image into a horizontal LCD bitmap */ - static FT_Error - ft_smooth_render_lcd( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - const FT_Vector* origin ) - { - return ft_smooth_render_generic( render, slot, mode, origin, - FT_RENDER_MODE_LCD ); - } - - - /* convert a slot's glyph image into a vertical LCD bitmap */ - static FT_Error - ft_smooth_render_lcd_v( FT_Renderer render, - FT_GlyphSlot slot, - FT_Render_Mode mode, - const FT_Vector* origin ) - { - return ft_smooth_render_generic( render, slot, mode, origin, - FT_RENDER_MODE_LCD_V ); - } - - FT_DEFINE_RENDERER( ft_smooth_renderer_class, @@ -449,58 +592,4 @@ ) - FT_DEFINE_RENDERER( - ft_smooth_lcd_renderer_class, - - FT_MODULE_RENDERER, - sizeof ( FT_RendererRec ), - - "smooth-lcd", - 0x10000L, - 0x20000L, - - NULL, /* module specific interface */ - - (FT_Module_Constructor)ft_smooth_init, /* module_init */ - (FT_Module_Destructor) NULL, /* module_done */ - (FT_Module_Requester) NULL, /* get_interface */ - - FT_GLYPH_FORMAT_OUTLINE, - - (FT_Renderer_RenderFunc) ft_smooth_render_lcd, /* render_glyph */ - (FT_Renderer_TransformFunc)ft_smooth_transform, /* transform_glyph */ - (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, /* get_glyph_cbox */ - (FT_Renderer_SetModeFunc) ft_smooth_set_mode, /* set_mode */ - - (FT_Raster_Funcs*)&ft_grays_raster /* raster_class */ - ) - - - FT_DEFINE_RENDERER( - ft_smooth_lcdv_renderer_class, - - FT_MODULE_RENDERER, - sizeof ( FT_RendererRec ), - - "smooth-lcdv", - 0x10000L, - 0x20000L, - - NULL, /* module specific interface */ - - (FT_Module_Constructor)ft_smooth_init, /* module_init */ - (FT_Module_Destructor) NULL, /* module_done */ - (FT_Module_Requester) NULL, /* get_interface */ - - FT_GLYPH_FORMAT_OUTLINE, - - (FT_Renderer_RenderFunc) ft_smooth_render_lcd_v, /* render_glyph */ - (FT_Renderer_TransformFunc)ft_smooth_transform, /* transform_glyph */ - (FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, /* get_glyph_cbox */ - (FT_Renderer_SetModeFunc) ft_smooth_set_mode, /* set_mode */ - - (FT_Raster_Funcs*)&ft_grays_raster /* raster_class */ - ) - - /* END */ diff --git a/lib/freetype/src/smooth/ftsmooth.h b/lib/freetype/src/smooth/ftsmooth.h index ee5d2ff61..22a88d54e 100644 --- a/lib/freetype/src/smooth/ftsmooth.h +++ b/lib/freetype/src/smooth/ftsmooth.h @@ -20,8 +20,7 @@ #define FTSMOOTH_H_ -#include <ft2build.h> -#include FT_RENDER_H +#include <freetype/ftrender.h> FT_BEGIN_HEADER @@ -29,10 +28,6 @@ FT_BEGIN_HEADER FT_DECLARE_RENDERER( ft_smooth_renderer_class ) - FT_DECLARE_RENDERER( ft_smooth_lcd_renderer_class ) - - FT_DECLARE_RENDERER( ft_smooth_lcdv_renderer_class ) - FT_END_HEADER diff --git a/lib/freetype/src/smooth/module.mk b/lib/freetype/src/smooth/module.mk index ad8b47dab..9b1507f1e 100644 --- a/lib/freetype/src/smooth/module.mk +++ b/lib/freetype/src/smooth/module.mk @@ -18,10 +18,6 @@ FTMODULE_H_COMMANDS += SMOOTH_RENDERER define SMOOTH_RENDERER $(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_renderer_class $(CLOSE_DRIVER) $(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer$(ECHO_DRIVER_DONE) -$(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_lcd_renderer_class $(CLOSE_DRIVER) -$(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for LCDs$(ECHO_DRIVER_DONE) -$(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_lcdv_renderer_class $(CLOSE_DRIVER) -$(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for vertical LCDs$(ECHO_DRIVER_DONE) endef # EOF diff --git a/lib/freetype/src/smooth/smooth.c b/lib/freetype/src/smooth/smooth.c index 6ad9424f0..04b531c08 100644 --- a/lib/freetype/src/smooth/smooth.c +++ b/lib/freetype/src/smooth/smooth.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "ftgrays.c" #include "ftsmooth.c" diff --git a/lib/freetype/src/tools/Jamfile b/lib/freetype/src/tools/Jamfile deleted file mode 100644 index 475161e07..000000000 --- a/lib/freetype/src/tools/Jamfile +++ /dev/null @@ -1,5 +0,0 @@ -# Jamfile for src/tools -# -SubDir FT2_TOP src tools ; - -Main apinames : apinames.c ; diff --git a/lib/freetype/src/tools/ftrandom/ftrandom.c b/lib/freetype/src/tools/ftrandom/ftrandom.c index ab5cfc98b..ab6242978 100644 --- a/lib/freetype/src/tools/ftrandom/ftrandom.c +++ b/lib/freetype/src/tools/ftrandom/ftrandom.c @@ -45,8 +45,8 @@ #include <time.h> #include <ft2build.h> -#include FT_FREETYPE_H -#include FT_OUTLINE_H +#include <freetype/freetype.h> +#include <freetype/ftoutln.h> #define true 1 #define false 0 diff --git a/lib/freetype/src/tools/make_distribution_archives.py b/lib/freetype/src/tools/make_distribution_archives.py new file mode 100644 index 000000000..f29eb128c --- /dev/null +++ b/lib/freetype/src/tools/make_distribution_archives.py @@ -0,0 +1,208 @@ +#!/usr/bin/env python3 +"""Generate distribution archives for a given FreeType 2 release.""" + +from __future__ import print_function + +import argparse +import atexit +import os +import shutil +import subprocess +import sys +import tempfile + +_TOP_DIR = os.path.abspath(os.path.join(__file__, "..", "..", "..")) +_SCRIPT_DIR = os.path.dirname(os.path.join(_TOP_DIR, "builds", "meson", "")) + + +def get_cmd_output(cmd, cwd=None): + """Run a command and return its output as a string.""" + if cwd is not None: + out = subprocess.check_output(cmd, cwd=cwd) + else: + out = subprocess.check_output(cmd) + return out.decode("utf-8").rstrip() + + +def is_git_dir_clean(git_dir): + """Return True iff |git_dir| is a git directory in clean state.""" + out = get_cmd_output(["git", "status", "--porcelain"], cwd=git_dir) + return len(out) == 0 + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + + parser.add_argument( + "--source_dir", default=_TOP_DIR, help="Source directory path." + ) + + parser.add_argument( + "--version", + help=( + "Specify alternate FreeType version (it is otherwise extracted" + " from current sources by default)." + ), + ) + + parser.add_argument( + "--gnu-config-dir", + help=( + "Path of input directory containing recent `config.guess` and" + " `config.sub` files from GNU config." + ), + ) + + parser.add_argument( + "--build-dir", + help="Specify build directory. Only used for debugging this script.", + ) + + parser.add_argument( + "--ignore-clean-check", + action="store_true", + help=( + "Do not check for a clean source git repository. Only used for" + " debugging this script." + ), + ) + + parser.add_argument( + "output_dir", help="Output directory for generated archives." + ) + + args = parser.parse_args() + + git_dir = args.source_dir if args.source_dir else _TOP_DIR + if not args.ignore_clean_check and not is_git_dir_clean(git_dir): + sys.stderr.write( + "ERROR: Your git repository is not in a clean state: %s\n" + % git_dir + ) + return 1 + + if args.version: + version = args.version + else: + # Extract FreeType version from sources. + version = get_cmd_output( + [ + sys.executable, + os.path.join(_SCRIPT_DIR, "extract_freetype_version.py"), + os.path.join(_TOP_DIR, "include", "freetype", "freetype.h"), + ] + ) + + # Determine the build directory. This will be a temporary file that is + # cleaned up on script exit by default, unless --build-dir=DIR is used, + # in which case we only create and empty the directory, but never remove + # its content on exit. + if args.build_dir: + build_dir = args.build_dir + if not os.path.exists(build_dir): + os.makedirs(build_dir) + else: + # Remove anything from the build directory, if any. + for item in os.listdir(build_dir): + file_path = os.path.join(build_dir, item) + if os.path.isdir(file_path): + shutil.rmtree(file_path) + else: + os.unlink(file_path) + else: + # Create a temporary directory, and ensure it is removed on exit. + build_dir = tempfile.mkdtemp(prefix="freetype-dist-") + + def clean_build_dir(): + shutil.rmtree(build_dir) + + atexit.register(clean_build_dir) + + # Copy all source files known to git into $BUILD_DIR/freetype-$VERSION + # with the exception of .gitignore and .mailmap files. + source_files = [ + f + for f in get_cmd_output(["git", "ls-files"], cwd=git_dir).split("\n") + if os.path.basename(f) not in (".gitignore", ".mailmap") + ] + + freetype_dir = "freetype-" + version + tmp_src_dir = os.path.join(build_dir, freetype_dir) + os.makedirs(tmp_src_dir) + + for src in source_files: + dst = os.path.join(tmp_src_dir, src) + dst_dir = os.path.dirname(dst) + if not os.path.exists(dst_dir): + os.makedirs(dst_dir) + shutil.copy(os.path.join(git_dir, src), dst) + + # Run autogen.sh in directory. + subprocess.check_call(["/bin/sh", "autogen.sh"], cwd=tmp_src_dir) + shutil.rmtree( + os.path.join(tmp_src_dir, "builds", "unix", "autom4te.cache") + ) + + # Copy config.guess and config.sub if possible! + if args.gnu_config_dir: + for f in ("config.guess", "config.sub"): + shutil.copy( + os.path.join(args.gnu_config_dir, f), + os.path.join(tmp_src_dir, "builds", "unix", f), + ) + + # Generate reference documentation under docs/ + subprocess.check_call( + [ + sys.executable, + os.path.join(_SCRIPT_DIR, "generate_reference_docs.py"), + "--input-dir", + tmp_src_dir, + "--version", + version, + "--output-dir", + os.path.join(tmp_src_dir, "docs"), + ] + ) + + shutil.rmtree(os.path.join(tmp_src_dir, "docs", "markdown")) + os.unlink(os.path.join(tmp_src_dir, "docs", "mkdocs.yml")) + + # Generate our archives + freetype_tar = freetype_dir + ".tar" + + subprocess.check_call( + ["tar", "-H", "ustar", "-chf", freetype_tar, freetype_dir], + cwd=build_dir, + ) + + subprocess.check_call( + ["gzip", "-9", "--keep", freetype_tar], cwd=build_dir + ) + + subprocess.check_call(["xz", "--keep", freetype_tar], cwd=build_dir) + + ftwinversion = "ft" + "".join(version.split(".")) + subprocess.check_call( + ["zip", "-qlr9", ftwinversion + ".zip", freetype_dir], cwd=build_dir + ) + + # Copy file to output directory now. + if not os.path.exists(args.output_dir): + os.makedirs(args.output_dir) + + for f in ( + freetype_tar + ".gz", + freetype_tar + ".xz", + ftwinversion + ".zip", + ): + shutil.copy( + os.path.join(build_dir, f), os.path.join(args.output_dir, f) + ) + + # Done! + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/lib/freetype/src/tools/test_afm.c b/lib/freetype/src/tools/test_afm.c index 8de619bb0..a4b226898 100644 --- a/lib/freetype/src/tools/test_afm.c +++ b/lib/freetype/src/tools/test_afm.c @@ -2,10 +2,9 @@ * gcc -DFT2_BUILD_LIBRARY -I../../include -o test_afm test_afm.c \ * -L../../objs/.libs -lfreetype -lz -static */ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/freetype.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/psaux.h> void dump_fontinfo( AFM_FontInfo fi ) { diff --git a/lib/freetype/src/tools/test_bbox.c b/lib/freetype/src/tools/test_bbox.c index 64b82c384..d9fd93299 100644 --- a/lib/freetype/src/tools/test_bbox.c +++ b/lib/freetype/src/tools/test_bbox.c @@ -1,6 +1,5 @@ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_BBOX_H +#include <freetype/freetype.h> +#include <freetype/ftbbox.h> #include <time.h> /* for clock() */ diff --git a/lib/freetype/src/tools/test_trig.c b/lib/freetype/src/tools/test_trig.c index 99ac1cf17..4f3410ab3 100644 --- a/lib/freetype/src/tools/test_trig.c +++ b/lib/freetype/src/tools/test_trig.c @@ -1,6 +1,5 @@ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_TRIGONOMETRY_H +#include <freetype/freetype.h> +#include <freetype/fttrigon.h> #include <math.h> #include <stdio.h> diff --git a/lib/freetype/src/truetype/Jamfile b/lib/freetype/src/truetype/Jamfile deleted file mode 100644 index bf81088e1..000000000 --- a/lib/freetype/src/truetype/Jamfile +++ /dev/null @@ -1,37 +0,0 @@ -# FreeType 2 src/truetype Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) truetype ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = ttdriver - ttgload - ttgxvar - ttinterp - ttobjs - ttpic - ttpload - ttsubpix - ; - } - else - { - _sources = truetype ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/truetype Jamfile diff --git a/lib/freetype/src/truetype/truetype.c b/lib/freetype/src/truetype/truetype.c index 1f15b29bb..41b6808a8 100644 --- a/lib/freetype/src/truetype/truetype.c +++ b/lib/freetype/src/truetype/truetype.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "ttdriver.c" /* driver interface */ #include "ttgload.c" /* glyph loader */ diff --git a/lib/freetype/src/truetype/ttdriver.c b/lib/freetype/src/truetype/ttdriver.c index 90fab46e2..bf830b141 100644 --- a/lib/freetype/src/truetype/ttdriver.c +++ b/lib/freetype/src/truetype/ttdriver.c @@ -16,22 +16,21 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_SFNT_H -#include FT_SERVICE_FONT_FORMAT_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/sfnt.h> +#include <freetype/internal/services/svfntfmt.h> #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT -#include FT_MULTIPLE_MASTERS_H -#include FT_SERVICE_MULTIPLE_MASTERS_H -#include FT_SERVICE_METRICS_VARIATIONS_H +#include <freetype/ftmm.h> +#include <freetype/internal/services/svmm.h> +#include <freetype/internal/services/svmetric.h> #endif -#include FT_SERVICE_TRUETYPE_ENGINE_H -#include FT_SERVICE_TRUETYPE_GLYF_H -#include FT_SERVICE_PROPERTIES_H -#include FT_DRIVER_H +#include <freetype/internal/services/svtteng.h> +#include <freetype/internal/services/svttglyf.h> +#include <freetype/internal/services/svprop.h> +#include <freetype/ftdriver.h> #include "ttdriver.h" #include "ttgload.h" diff --git a/lib/freetype/src/truetype/ttdriver.h b/lib/freetype/src/truetype/ttdriver.h index d1cfa47c8..ee1438eb6 100644 --- a/lib/freetype/src/truetype/ttdriver.h +++ b/lib/freetype/src/truetype/ttdriver.h @@ -20,8 +20,7 @@ #define TTDRIVER_H_ -#include <ft2build.h> -#include FT_INTERNAL_DRIVER_H +#include <freetype/internal/ftdrv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/truetype/tterrors.h b/lib/freetype/src/truetype/tterrors.h index 71d66023c..efeafd3a1 100644 --- a/lib/freetype/src/truetype/tterrors.h +++ b/lib/freetype/src/truetype/tterrors.h @@ -26,7 +26,7 @@ #ifndef TTERRORS_H_ #define TTERRORS_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -34,7 +34,7 @@ #define FT_ERR_PREFIX TT_Err_ #define FT_ERR_BASE FT_Mod_Err_TrueType -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* TTERRORS_H_ */ diff --git a/lib/freetype/src/truetype/ttgload.c b/lib/freetype/src/truetype/ttgload.c index 2a1742839..1dd319dcb 100644 --- a/lib/freetype/src/truetype/ttgload.c +++ b/lib/freetype/src/truetype/ttgload.c @@ -17,15 +17,15 @@ #include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include FT_CONFIG_CONFIG_H -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_SFNT_H -#include FT_TRUETYPE_TAGS_H -#include FT_OUTLINE_H -#include FT_DRIVER_H -#include FT_LIST_H +#include <freetype/internal/ftcalc.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/sfnt.h> +#include <freetype/tttags.h> +#include <freetype/ftoutln.h> +#include <freetype/ftdriver.h> +#include <freetype/ftlist.h> #include "ttgload.h" #include "ttpload.h" @@ -60,7 +60,7 @@ #define SAME_X 0x10 #define Y_POSITIVE 0x20 /* two meanings depending on Y_SHORT_VECTOR */ #define SAME_Y 0x20 -#define OVERLAP_SIMPLE 0x40 /* we ignore this value */ +#define OVERLAP_SIMPLE 0x40 /* retained as FT_OUTLINE_OVERLAP */ /************************************************************************** @@ -77,7 +77,7 @@ #define WE_HAVE_A_2X2 0x0080 #define WE_HAVE_INSTR 0x0100 #define USE_MY_METRICS 0x0200 -#define OVERLAP_COMPOUND 0x0400 /* we ignore this value */ +#define OVERLAP_COMPOUND 0x0400 /* retained as FT_OUTLINE_OVERLAP */ #define SCALED_COMPONENT_OFFSET 0x0800 #define UNSCALED_COMPONENT_OFFSET 0x1000 @@ -137,6 +137,11 @@ face->horizontal.Descender ); } +#ifdef FT_DEBUG_LEVEL_TRACE + if ( !face->vertical_info ) + FT_TRACE5(( " [vertical metrics missing, computing values]\n" )); +#endif + FT_TRACE5(( " advance height (font units): %d\n", *ah )); FT_TRACE5(( " top side bearing (font units): %d\n", *tsb )); } @@ -333,9 +338,9 @@ loader->bbox.yMax = FT_NEXT_SHORT( p ); FT_TRACE5(( " # of contours: %d\n", loader->n_contours )); - FT_TRACE5(( " xMin: %4d xMax: %4d\n", loader->bbox.xMin, + FT_TRACE5(( " xMin: %4ld xMax: %4ld\n", loader->bbox.xMin, loader->bbox.xMax )); - FT_TRACE5(( " yMin: %4d yMax: %4d\n", loader->bbox.yMin, + FT_TRACE5(( " yMin: %4ld yMax: %4ld\n", loader->bbox.yMin, loader->bbox.yMax )); loader->cursor = p; @@ -489,6 +494,10 @@ } } + /* retain the overlap flag */ + if ( n_points && outline->tags[0] & OVERLAP_SIMPLE ) + gloader->base.outline.flags |= FT_OUTLINE_OVERLAP; + /* reading the X coordinates */ vec = outline->points; @@ -2183,6 +2192,11 @@ goto Exit; } } + + /* retain the overlap flag */ + if ( gloader->base.num_subglyphs && + gloader->base.subglyphs[0].flags & OVERLAP_COMPOUND ) + gloader->base.outline.flags |= FT_OUTLINE_OVERLAP; } /***********************************************************************/ @@ -2981,8 +2995,6 @@ error = compute_glyph_metrics( &loader, glyph_index ); } - tt_loader_done( &loader ); - /* Set the `high precision' bit flag. */ /* This is _critical_ to get correct output for monochrome */ /* TrueType glyphs at all sizes using the bytecode interpreter. */ @@ -2991,6 +3003,15 @@ size->metrics->y_ppem < 24 ) glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION; + FT_TRACE1(( " subglyphs = %u, contours = %hd, points = %hd," + " flags = 0x%.3x\n", + loader.gloader->base.num_subglyphs, + glyph->outline.n_contours, + glyph->outline.n_points, + glyph->outline.flags )); + + tt_loader_done( &loader ); + Exit: #ifdef FT_DEBUG_LEVEL_TRACE if ( error ) diff --git a/lib/freetype/src/truetype/ttgload.h b/lib/freetype/src/truetype/ttgload.h index 9a8c3e71d..8f72cd558 100644 --- a/lib/freetype/src/truetype/ttgload.h +++ b/lib/freetype/src/truetype/ttgload.h @@ -20,7 +20,6 @@ #define TTGLOAD_H_ -#include <ft2build.h> #include "ttobjs.h" #ifdef TT_USE_BYTECODE_INTERPRETER diff --git a/lib/freetype/src/truetype/ttgxvar.c b/lib/freetype/src/truetype/ttgxvar.c index 110f24a11..b462263de 100644 --- a/lib/freetype/src/truetype/ttgxvar.c +++ b/lib/freetype/src/truetype/ttgxvar.c @@ -40,14 +40,14 @@ #include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include FT_CONFIG_CONFIG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_SFNT_H -#include FT_TRUETYPE_TAGS_H -#include FT_TRUETYPE_IDS_H -#include FT_MULTIPLE_MASTERS_H -#include FT_LIST_H +#include <freetype/internal/ftstream.h> +#include <freetype/internal/sfnt.h> +#include <freetype/tttags.h> +#include <freetype/ttnameid.h> +#include <freetype/ftmm.h> +#include <freetype/ftlist.h> #include "ttpload.h" #include "ttgxvar.h" @@ -1729,7 +1729,7 @@ if ( tuple_coords[i] == 0 ) { - FT_TRACE6(( " tuple coordinate is zero, ignore\n", i )); + FT_TRACE6(( " tuple coordinate is zero, ignore\n" )); continue; } diff --git a/lib/freetype/src/truetype/ttgxvar.h b/lib/freetype/src/truetype/ttgxvar.h index 11664e997..26e89bcf7 100644 --- a/lib/freetype/src/truetype/ttgxvar.h +++ b/lib/freetype/src/truetype/ttgxvar.h @@ -20,7 +20,6 @@ #define TTGXVAR_H_ -#include <ft2build.h> #include "ttobjs.h" diff --git a/lib/freetype/src/truetype/ttinterp.c b/lib/freetype/src/truetype/ttinterp.c index 321504097..0c3cb10ae 100644 --- a/lib/freetype/src/truetype/ttinterp.c +++ b/lib/freetype/src/truetype/ttinterp.c @@ -20,13 +20,12 @@ /* issues; many thanks! */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H -#include FT_TRIGONOMETRY_H -#include FT_SYSTEM_H -#include FT_DRIVER_H -#include FT_MULTIPLE_MASTERS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftcalc.h> +#include <freetype/fttrigon.h> +#include <freetype/ftsystem.h> +#include <freetype/ftdriver.h> +#include <freetype/ftmm.h> #include "ttinterp.h" #include "tterrors.h" @@ -294,7 +293,7 @@ FT_Error error; - FT_TRACE1(( "Init_Context: new object at 0x%08p\n", exec )); + FT_TRACE1(( "Init_Context: new object at %p\n", (void *)exec )); exec->memory = memory; exec->callSize = 32; @@ -319,7 +318,7 @@ return FT_Err_Ok; Fail_Memory: - FT_ERROR(( "Init_Context: not enough memory for %p\n", exec )); + FT_ERROR(( "Init_Context: not enough memory for %p\n", (void *)exec )); TT_Done_Context( exec ); return error; @@ -1956,8 +1955,8 @@ * distance :: * The distance (not) to round. * - * compensation :: - * The engine compensation. + * color :: + * The engine compensation color. * * @Return: * The compensated distance. @@ -1965,12 +1964,11 @@ static FT_F26Dot6 Round_None( TT_ExecContext exc, FT_F26Dot6 distance, - FT_F26Dot6 compensation ) + FT_Int color ) { + FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; - FT_UNUSED( exc ); - if ( distance >= 0 ) { @@ -2000,8 +1998,8 @@ * distance :: * The distance to round. * - * compensation :: - * The engine compensation. + * color :: + * The engine compensation color. * * @Return: * Rounded distance. @@ -2009,12 +2007,11 @@ static FT_F26Dot6 Round_To_Grid( TT_ExecContext exc, FT_F26Dot6 distance, - FT_F26Dot6 compensation ) + FT_Int color ) { + FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; - FT_UNUSED( exc ); - if ( distance >= 0 ) { @@ -2046,8 +2043,8 @@ * distance :: * The distance to round. * - * compensation :: - * The engine compensation. + * color :: + * The engine compensation color. * * @Return: * Rounded distance. @@ -2055,12 +2052,11 @@ static FT_F26Dot6 Round_To_Half_Grid( TT_ExecContext exc, FT_F26Dot6 distance, - FT_F26Dot6 compensation ) + FT_Int color ) { + FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; - FT_UNUSED( exc ); - if ( distance >= 0 ) { @@ -2094,8 +2090,8 @@ * distance :: * The distance to round. * - * compensation :: - * The engine compensation. + * color :: + * The engine compensation color. * * @Return: * Rounded distance. @@ -2103,12 +2099,11 @@ static FT_F26Dot6 Round_Down_To_Grid( TT_ExecContext exc, FT_F26Dot6 distance, - FT_F26Dot6 compensation ) + FT_Int color ) { + FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; - FT_UNUSED( exc ); - if ( distance >= 0 ) { @@ -2139,8 +2134,8 @@ * distance :: * The distance to round. * - * compensation :: - * The engine compensation. + * color :: + * The engine compensation color. * * @Return: * Rounded distance. @@ -2148,12 +2143,11 @@ static FT_F26Dot6 Round_Up_To_Grid( TT_ExecContext exc, FT_F26Dot6 distance, - FT_F26Dot6 compensation ) + FT_Int color ) { + FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; - FT_UNUSED( exc ); - if ( distance >= 0 ) { @@ -2185,8 +2179,8 @@ * distance :: * The distance to round. * - * compensation :: - * The engine compensation. + * color :: + * The engine compensation color. * * @Return: * Rounded distance. @@ -2194,12 +2188,11 @@ static FT_F26Dot6 Round_To_Double_Grid( TT_ExecContext exc, FT_F26Dot6 distance, - FT_F26Dot6 compensation ) + FT_Int color ) { + FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; - FT_UNUSED( exc ); - if ( distance >= 0 ) { @@ -2231,8 +2224,8 @@ * distance :: * The distance to round. * - * compensation :: - * The engine compensation. + * color :: + * The engine compensation color. * * @Return: * Rounded distance. @@ -2246,8 +2239,9 @@ static FT_F26Dot6 Round_Super( TT_ExecContext exc, FT_F26Dot6 distance, - FT_F26Dot6 compensation ) + FT_Int color ) { + FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; @@ -2286,8 +2280,8 @@ * distance :: * The distance to round. * - * compensation :: - * The engine compensation. + * color :: + * The engine compensation color. * * @Return: * Rounded distance. @@ -2299,8 +2293,9 @@ static FT_F26Dot6 Round_Super_45( TT_ExecContext exc, FT_F26Dot6 distance, - FT_F26Dot6 compensation ) + FT_Int color ) { + FT_F26Dot6 compensation = exc->tt_metrics.compensations[color]; FT_F26Dot6 val; @@ -2899,7 +2894,7 @@ Ins_ODD( TT_ExecContext exc, FT_Long* args ) { - args[0] = ( ( exc->func_round( exc, args[0], 0 ) & 127 ) == 64 ); + args[0] = ( ( exc->func_round( exc, args[0], 3 ) & 127 ) == 64 ); } @@ -2913,7 +2908,7 @@ Ins_EVEN( TT_ExecContext exc, FT_Long* args ) { - args[0] = ( ( exc->func_round( exc, args[0], 0 ) & 127 ) == 0 ); + args[0] = ( ( exc->func_round( exc, args[0], 3 ) & 127 ) == 0 ); } @@ -3243,10 +3238,7 @@ Ins_ROUND( TT_ExecContext exc, FT_Long* args ) { - args[0] = exc->func_round( - exc, - args[0], - exc->tt_metrics.compensations[exc->opcode - 0x68] ); + args[0] = exc->func_round( exc, args[0], exc->opcode & 3 ); } @@ -3260,10 +3252,7 @@ Ins_NROUND( TT_ExecContext exc, FT_Long* args ) { - args[0] = Round_None( - exc, - args[0], - exc->tt_metrics.compensations[exc->opcode - 0x6C] ); + args[0] = Round_None( exc, args[0], exc->opcode & 3 ); } @@ -5733,9 +5722,6 @@ { FT_F26Dot6 dx, dy; FT_UShort point; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - FT_Int B1, B2; -#endif #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL FT_Bool in_twilight = FT_BOOL( exc->GS.gep0 == 0 || exc->GS.gep1 == 0 || @@ -5770,8 +5756,12 @@ } else #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY ) + if ( SUBPIXEL_HINTING_INFINALITY && + exc->ignore_x_mode ) { + FT_Int B1, B2; + + /* If not using ignore_x_mode rendering, allow ZP2 move. */ /* If inline deltas aren't allowed, skip ZP2 move. */ /* If using ignore_x_mode rendering, allow ZP2 point move if: */ @@ -5780,72 +5770,57 @@ /* - the glyph is specifically set to allow SHPIX moves */ /* - the move is on a previously Y-touched point */ - if ( exc->ignore_x_mode ) + /* save point for later comparison */ + B1 = exc->zp2.cur[point].y; + + if ( exc->face->sph_compatibility_mode ) { - /* save point for later comparison */ + if ( exc->sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) + dy = FT_PIX_ROUND( B1 + dy ) - B1; + + /* skip post-iup deltas */ + if ( exc->iup_called && + ( ( exc->sph_in_func_flags & SPH_FDEF_INLINE_DELTA_1 ) || + ( exc->sph_in_func_flags & SPH_FDEF_INLINE_DELTA_2 ) ) ) + goto Skip; + + if ( !( exc->sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) && + ( ( exc->is_composite && exc->GS.freeVector.y != 0 ) || + ( exc->zp2.tags[point] & FT_CURVE_TAG_TOUCH_Y ) || + ( exc->sph_tweak_flags & SPH_TWEAK_DO_SHPIX ) ) ) + Move_Zp2_Point( exc, point, 0, dy, TRUE ); + + /* save new point */ if ( exc->GS.freeVector.y != 0 ) - B1 = exc->zp2.cur[point].y; - else - B1 = exc->zp2.cur[point].x; - - if ( !exc->face->sph_compatibility_mode && - exc->GS.freeVector.y != 0 ) { - Move_Zp2_Point( exc, point, dx, dy, TRUE ); + B2 = exc->zp2.cur[point].y; - /* save new point */ - if ( exc->GS.freeVector.y != 0 ) - { - B2 = exc->zp2.cur[point].y; - - /* reverse any disallowed moves */ - if ( ( exc->sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) && - ( B1 & 63 ) != 0 && - ( B2 & 63 ) != 0 && - B1 != B2 ) - Move_Zp2_Point( exc, - point, - NEG_LONG( dx ), - NEG_LONG( dy ), - TRUE ); - } + /* reverse any disallowed moves */ + if ( ( B1 & 63 ) == 0 && + ( B2 & 63 ) != 0 && + B1 != B2 ) + Move_Zp2_Point( exc, point, 0, NEG_LONG( dy ), TRUE ); } - else if ( exc->face->sph_compatibility_mode ) - { - if ( exc->sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) - { - dx = FT_PIX_ROUND( B1 + dx ) - B1; - dy = FT_PIX_ROUND( B1 + dy ) - B1; - } - - /* skip post-iup deltas */ - if ( exc->iup_called && - ( ( exc->sph_in_func_flags & SPH_FDEF_INLINE_DELTA_1 ) || - ( exc->sph_in_func_flags & SPH_FDEF_INLINE_DELTA_2 ) ) ) - goto Skip; - - if ( !( exc->sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) && - ( ( exc->is_composite && exc->GS.freeVector.y != 0 ) || - ( exc->zp2.tags[point] & FT_CURVE_TAG_TOUCH_Y ) || - ( exc->sph_tweak_flags & SPH_TWEAK_DO_SHPIX ) ) ) - Move_Zp2_Point( exc, point, 0, dy, TRUE ); - - /* save new point */ - if ( exc->GS.freeVector.y != 0 ) - { - B2 = exc->zp2.cur[point].y; + } + else if ( exc->GS.freeVector.y != 0 ) + { + Move_Zp2_Point( exc, point, dx, dy, TRUE ); - /* reverse any disallowed moves */ - if ( ( B1 & 63 ) == 0 && - ( B2 & 63 ) != 0 && - B1 != B2 ) - Move_Zp2_Point( exc, point, 0, NEG_LONG( dy ), TRUE ); - } - } - else if ( exc->sph_in_func_flags & SPH_FDEF_TYPEMAN_DIAGENDCTRL ) - Move_Zp2_Point( exc, point, dx, dy, TRUE ); + /* save new point */ + B2 = exc->zp2.cur[point].y; + + /* reverse any disallowed moves */ + if ( ( exc->sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) && + ( B1 & 63 ) != 0 && + ( B2 & 63 ) != 0 && + B1 != B2 ) + Move_Zp2_Point( exc, + point, + NEG_LONG( dx ), + NEG_LONG( dy ), + TRUE ); } - else + else if ( exc->sph_in_func_flags & SPH_FDEF_TYPEMAN_DIAGENDCTRL ) Move_Zp2_Point( exc, point, dx, dy, TRUE ); } else @@ -5893,22 +5868,8 @@ { FT_UShort point = 0; FT_F26Dot6 distance; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - FT_F26Dot6 control_value_cutin = 0; - FT_F26Dot6 delta; - if ( SUBPIXEL_HINTING_INFINALITY ) - { - control_value_cutin = exc->GS.control_value_cutin; - - if ( exc->ignore_x_mode && - exc->GS.freeVector.x != 0 && - !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) - control_value_cutin = 0; - } -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - point = (FT_UShort)args[0]; if ( BOUNDS( point, exc->zp1.n_points ) || @@ -5931,16 +5892,25 @@ distance = PROJECT( exc->zp1.cur + point, exc->zp0.cur + exc->GS.rp0 ); #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - delta = SUB_LONG( distance, args[1] ); - if ( delta < 0 ) - delta = NEG_LONG( delta ); - /* subpixel hinting - make MSIRP respect CVT cut-in; */ - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.x != 0 && - delta >= control_value_cutin ) - distance = args[1]; + if ( SUBPIXEL_HINTING_INFINALITY && + exc->ignore_x_mode && + exc->GS.freeVector.x != 0 ) + { + FT_F26Dot6 control_value_cutin = exc->GS.control_value_cutin; + FT_F26Dot6 delta; + + + if ( !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) + control_value_cutin = 0; + + delta = SUB_LONG( distance, args[1] ); + if ( delta < 0 ) + delta = NEG_LONG( delta ); + + if ( delta >= control_value_cutin ) + distance = args[1]; + } #endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ exc->func_move( exc, @@ -5987,18 +5957,10 @@ if ( SUBPIXEL_HINTING_INFINALITY && exc->ignore_x_mode && exc->GS.freeVector.x != 0 ) - distance = SUB_LONG( - Round_None( exc, - cur_dist, - exc->tt_metrics.compensations[0] ), - cur_dist ); + distance = SUB_LONG( Round_None( exc, cur_dist, 3 ), cur_dist ); else #endif - distance = SUB_LONG( - exc->func_round( exc, - cur_dist, - exc->tt_metrics.compensations[0] ), - cur_dist ); + distance = SUB_LONG( exc->func_round( exc, cur_dist, 3 ), cur_dist ); } else distance = 0; @@ -6024,21 +5986,10 @@ FT_UShort point; FT_F26Dot6 distance; FT_F26Dot6 org_dist; - FT_F26Dot6 control_value_cutin; - - control_value_cutin = exc->GS.control_value_cutin; - cvtEntry = (FT_ULong)args[1]; - point = (FT_UShort)args[0]; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.x != 0 && - exc->GS.freeVector.y == 0 && - !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) - control_value_cutin = 0; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ + cvtEntry = (FT_ULong)args[1]; + point = (FT_UShort)args[0]; if ( BOUNDS( point, exc->zp0.n_points ) || BOUNDSL( cvtEntry, exc->cvtSize ) ) @@ -6082,7 +6033,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 @@ -6098,9 +6049,19 @@ if ( ( exc->opcode & 1 ) != 0 ) /* rounding and control cut-in flag */ { + FT_F26Dot6 control_value_cutin = exc->GS.control_value_cutin; FT_F26Dot6 delta; +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY + if ( SUBPIXEL_HINTING_INFINALITY && + exc->ignore_x_mode && + exc->GS.freeVector.x != 0 && + exc->GS.freeVector.y == 0 && + !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) + control_value_cutin = 0; +#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ + delta = SUB_LONG( distance, org_dist ); if ( delta < 0 ) delta = NEG_LONG( delta ); @@ -6112,14 +6073,10 @@ if ( SUBPIXEL_HINTING_INFINALITY && exc->ignore_x_mode && exc->GS.freeVector.x != 0 ) - distance = Round_None( exc, - distance, - exc->tt_metrics.compensations[0] ); + distance = Round_None( exc, distance, 3 ); else #endif - distance = exc->func_round( exc, - distance, - exc->tt_metrics.compensations[0] ); + distance = exc->func_round( exc, distance, 3 ); } exc->func_move( exc, &exc->zp0, point, SUB_LONG( distance, org_dist ) ); @@ -6141,18 +6098,8 @@ FT_Long* args ) { FT_UShort point = 0; - FT_F26Dot6 org_dist, distance, minimum_distance; - + FT_F26Dot6 org_dist, distance; - minimum_distance = exc->GS.minimum_distance; - -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.x != 0 && - !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) - minimum_distance = 0; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ point = (FT_UShort)args[0]; @@ -6226,27 +6173,29 @@ if ( SUBPIXEL_HINTING_INFINALITY && exc->ignore_x_mode && exc->GS.freeVector.x != 0 ) - distance = Round_None( - exc, - org_dist, - exc->tt_metrics.compensations[exc->opcode & 3] ); + distance = Round_None( exc, org_dist, exc->opcode & 3 ); else #endif - distance = exc->func_round( - exc, - org_dist, - exc->tt_metrics.compensations[exc->opcode & 3] ); + distance = exc->func_round( exc, org_dist, exc->opcode & 3 ); } else - distance = Round_None( - exc, - org_dist, - exc->tt_metrics.compensations[exc->opcode & 3] ); + distance = Round_None( exc, org_dist, exc->opcode & 3 ); /* minimum distance flag */ if ( ( exc->opcode & 8 ) != 0 ) { + FT_F26Dot6 minimum_distance = exc->GS.minimum_distance; + + +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY + if ( SUBPIXEL_HINTING_INFINALITY && + exc->ignore_x_mode && + exc->GS.freeVector.x != 0 && + !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) + minimum_distance = 0; +#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ + if ( org_dist >= 0 ) { if ( distance < minimum_distance ) @@ -6290,30 +6239,13 @@ FT_F26Dot6 cvt_dist, distance, cur_dist, - org_dist, - control_value_cutin, - minimum_distance; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - FT_Int B1 = 0; /* pacify compiler */ - FT_Int B2 = 0; - FT_Bool reverse_move = FALSE; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ + org_dist; FT_F26Dot6 delta; - minimum_distance = exc->GS.minimum_distance; - control_value_cutin = exc->GS.control_value_cutin; - point = (FT_UShort)args[0]; - cvtEntry = (FT_ULong)( ADD_LONG( args[1], 1 ) ); - -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.x != 0 && - !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) - control_value_cutin = minimum_distance = 0; -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ + point = (FT_UShort)args[0]; + cvtEntry = (FT_ULong)( ADD_LONG( args[1], 1 ) ); /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */ @@ -6371,19 +6303,6 @@ cvt_dist = NEG_LONG( cvt_dist ); } -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.y != 0 && - ( exc->sph_tweak_flags & SPH_TWEAK_TIMES_NEW_ROMAN_HACK ) ) - { - if ( cur_dist < -64 ) - cvt_dist -= 16; - else if ( cur_dist > 64 && cur_dist < 84 ) - cvt_dist += 32; - } -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - /* control value cut-in and round */ if ( ( exc->opcode & 4 ) != 0 ) @@ -6393,6 +6312,9 @@ if ( exc->GS.gep0 == exc->GS.gep1 ) { + FT_F26Dot6 control_value_cutin = exc->GS.control_value_cutin; + + /* XXX: According to Greg Hitchcock, the following wording is */ /* the right one: */ /* */ @@ -6413,10 +6335,7 @@ cvt_dist = org_dist; } - distance = exc->func_round( - exc, - cvt_dist, - exc->tt_metrics.compensations[exc->opcode & 3] ); + distance = exc->func_round( exc, cvt_dist, exc->opcode & 3 ); } else { @@ -6427,6 +6346,22 @@ exc->ignore_x_mode && exc->GS.gep0 == exc->GS.gep1 ) { + FT_F26Dot6 control_value_cutin = exc->GS.control_value_cutin; + + + if ( exc->GS.freeVector.x != 0 && + !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) + control_value_cutin = 0; + + if ( exc->GS.freeVector.y != 0 && + ( exc->sph_tweak_flags & SPH_TWEAK_TIMES_NEW_ROMAN_HACK ) ) + { + if ( cur_dist < -64 ) + cvt_dist -= 16; + else if ( cur_dist > 64 && cur_dist < 84 ) + cvt_dist += 32; + } + delta = SUB_LONG( cvt_dist, org_dist ); if ( delta < 0 ) delta = NEG_LONG( delta ); @@ -6436,16 +6371,24 @@ } #endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - distance = Round_None( - exc, - cvt_dist, - exc->tt_metrics.compensations[exc->opcode & 3] ); + distance = Round_None( exc, cvt_dist, exc->opcode & 3 ); } /* minimum distance test */ if ( ( exc->opcode & 8 ) != 0 ) { + FT_F26Dot6 minimum_distance = exc->GS.minimum_distance; + + +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY + if ( SUBPIXEL_HINTING_INFINALITY && + exc->ignore_x_mode && + exc->GS.freeVector.x != 0 && + !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) + minimum_distance = 0; +#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ + if ( org_dist >= 0 ) { if ( distance < minimum_distance ) @@ -6459,60 +6402,51 @@ } #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY ) + if ( SUBPIXEL_HINTING_INFINALITY && + exc->ignore_x_mode && + exc->GS.freeVector.y != 0 ) { + FT_Int B1, B2; + + B1 = exc->zp1.cur[point].y; /* Round moves if necessary */ - if ( exc->ignore_x_mode && - exc->GS.freeVector.y != 0 && - ( exc->sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) ) + if ( exc->sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) distance = FT_PIX_ROUND( B1 + distance - cur_dist ) - B1 + cur_dist; - if ( exc->ignore_x_mode && - exc->GS.freeVector.y != 0 && - ( exc->opcode & 16 ) == 0 && + if ( ( exc->opcode & 16 ) == 0 && ( exc->opcode & 8 ) == 0 && ( exc->sph_tweak_flags & SPH_TWEAK_COURIER_NEW_2_HACK ) ) distance += 64; - } -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - exc->func_move( exc, - &exc->zp1, - point, - SUB_LONG( distance, cur_dist ) ); + exc->func_move( exc, + &exc->zp1, + point, + SUB_LONG( distance, cur_dist ) ); -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - if ( SUBPIXEL_HINTING_INFINALITY ) - { B2 = exc->zp1.cur[point].y; /* Reverse move if necessary */ - if ( exc->ignore_x_mode ) - { - if ( exc->face->sph_compatibility_mode && - exc->GS.freeVector.y != 0 && + if ( ( exc->face->sph_compatibility_mode && ( B1 & 63 ) == 0 && - ( B2 & 63 ) != 0 ) - reverse_move = TRUE; - - if ( ( exc->sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) && - exc->GS.freeVector.y != 0 && - ( B2 & 63 ) != 0 && - ( B1 & 63 ) != 0 ) - reverse_move = TRUE; - } - - if ( reverse_move ) + ( B2 & 63 ) != 0 ) || + ( ( exc->sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) && + ( B1 & 63 ) != 0 && + ( B2 & 63 ) != 0 ) ) exc->func_move( exc, &exc->zp1, point, SUB_LONG( cur_dist, distance ) ); } - + else #endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ + exc->func_move( exc, + &exc->zp1, + point, + SUB_LONG( distance, cur_dist ) ); + Fail: exc->GS.rp1 = exc->GS.rp0; @@ -7185,10 +7119,9 @@ FT_UShort A; FT_ULong C, P; FT_Long B; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - FT_UShort B1, B2; +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY if ( SUBPIXEL_HINTING_INFINALITY && exc->ignore_x_mode && exc->iup_called && @@ -7269,6 +7202,9 @@ /* rules, always skipping deltas in subpixel direction. */ else if ( exc->ignore_x_mode && exc->GS.freeVector.y != 0 ) { + FT_UShort B1, B2; + + /* save the y value of the point now; compare after move */ B1 = (FT_UShort)exc->zp0.cur[A].y; @@ -7846,7 +7782,7 @@ num_twilight_points = 0xFFFFU; FT_TRACE5(( "TT_RunIns: Resetting number of twilight points\n" - " from %d to the more reasonable value %d\n", + " from %d to the more reasonable value %ld\n", exc->twilight.n_points, num_twilight_points )); exc->twilight.n_points = (FT_UShort)num_twilight_points; @@ -7881,11 +7817,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 %d\n", exc->loopcall_counter_max )); + " to %ld\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 %d\n", exc->neg_jump_counter_max )); + " to %ld\n", exc->neg_jump_counter_max )); /* set PPEM and CVT functions */ exc->tt_metrics.ratio = 0; @@ -7922,14 +7858,14 @@ /* if tracing level is 7, show current code position */ /* and the first few stack elements also */ FT_TRACE6(( " " )); - FT_TRACE7(( "%06d ", exc->IP )); + FT_TRACE7(( "%06ld ", 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(( " %d", exc->stack[exc->top - n] )); + FT_TRACE7(( " %ld", exc->stack[exc->top - n] )); FT_TRACE6(( "\n" )); } #endif /* FT_DEBUG_LEVEL_TRACE */ @@ -8647,7 +8583,7 @@ } while ( !exc->instruction_trap ); LNo_Error_: - FT_TRACE4(( " %d instruction%s executed\n", + FT_TRACE4(( " %ld instruction%s executed\n", ins_counter, ins_counter == 1 ? "" : "s" )); return FT_Err_Ok; diff --git a/lib/freetype/src/truetype/ttinterp.h b/lib/freetype/src/truetype/ttinterp.h index 07e4ad689..6a83705a6 100644 --- a/lib/freetype/src/truetype/ttinterp.h +++ b/lib/freetype/src/truetype/ttinterp.h @@ -19,7 +19,6 @@ #ifndef TTINTERP_H_ #define TTINTERP_H_ -#include <ft2build.h> #include "ttobjs.h" @@ -52,7 +51,7 @@ FT_BEGIN_HEADER typedef FT_F26Dot6 (*TT_Round_Func)( TT_ExecContext exc, FT_F26Dot6 distance, - FT_F26Dot6 compensation ); + FT_Int color ); /* Point displacement along the freedom vector routine */ typedef void diff --git a/lib/freetype/src/truetype/ttobjs.c b/lib/freetype/src/truetype/ttobjs.c index 730a5b8cd..06d456955 100644 --- a/lib/freetype/src/truetype/ttobjs.c +++ b/lib/freetype/src/truetype/ttobjs.c @@ -16,12 +16,11 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H -#include FT_INTERNAL_SFNT_H -#include FT_DRIVER_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/tttags.h> +#include <freetype/internal/sfnt.h> +#include <freetype/ftdriver.h> #include "ttgload.h" #include "ttpload.h" @@ -1116,10 +1115,10 @@ /* The Apple specification says that the compensation for */ /* `gray' is always zero. FreeType doesn't do any */ /* compensation at all. */ - tt_metrics->compensations[0] = 0; /* gray */ - tt_metrics->compensations[1] = 0; /* black */ - tt_metrics->compensations[2] = 0; /* white */ - tt_metrics->compensations[3] = 0; /* the same as gray */ + tt_metrics->compensations[0] = 0; /* gray */ + tt_metrics->compensations[1] = 0; /* black */ + tt_metrics->compensations[2] = 0; /* white */ + tt_metrics->compensations[3] = 0; /* zero */ } /* allocate function defs, instruction defs, cvt, and storage area */ diff --git a/lib/freetype/src/truetype/ttobjs.h b/lib/freetype/src/truetype/ttobjs.h index 7c3fc7ef8..d986deabc 100644 --- a/lib/freetype/src/truetype/ttobjs.h +++ b/lib/freetype/src/truetype/ttobjs.h @@ -20,9 +20,8 @@ #define TTOBJS_H_ -#include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_TRUETYPE_TYPES_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/tttypes.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/truetype/ttpload.c b/lib/freetype/src/truetype/ttpload.c index d35393a8b..b1255b88c 100644 --- a/lib/freetype/src/truetype/ttpload.c +++ b/lib/freetype/src/truetype/ttpload.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_TAGS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftstream.h> +#include <freetype/tttags.h> #include "ttpload.h" @@ -124,7 +123,7 @@ if ( face->num_locations != (FT_ULong)face->root.num_glyphs + 1 ) { - FT_TRACE2(( "glyph count mismatch! loca: %d, maxp: %d\n", + FT_TRACE2(( "glyph count mismatch! loca: %ld, maxp: %ld\n", face->num_locations - 1, face->root.num_glyphs )); /* we only handle the case where `maxp' gives a larger value */ @@ -165,7 +164,7 @@ face->num_locations = (FT_ULong)face->root.num_glyphs + 1; table_len = new_loca_len; - FT_TRACE2(( "adjusting num_locations to %d\n", + FT_TRACE2(( "adjusting num_locations to %ld\n", face->num_locations )); } else @@ -173,7 +172,7 @@ face->root.num_glyphs = face->num_locations ? (FT_Long)face->num_locations - 1 : 0; - FT_TRACE2(( "adjusting num_glyphs to %d\n", + FT_TRACE2(( "adjusting num_glyphs to %ld\n", face->root.num_glyphs )); } } @@ -238,7 +237,7 @@ if ( pos1 > face->glyf_len ) { FT_TRACE1(( "tt_face_get_location:" - " too large offset (0x%08lx) found for glyph index %ld,\n" + " too large offset (0x%08lx) found for glyph index %d,\n" " " " exceeding the end of `glyf' table (0x%08lx)\n", pos1, gindex, face->glyf_len )); @@ -252,7 +251,7 @@ if ( gindex == face->num_locations - 2 ) { FT_TRACE1(( "tt_face_get_location:" - " too large size (%ld bytes) found for glyph index %ld,\n" + " too large size (%ld bytes) found for glyph index %d,\n" " " " truncating at the end of `glyf' table to %ld bytes\n", pos2 - pos1, gindex, face->glyf_len - pos1 )); @@ -261,7 +260,7 @@ else { FT_TRACE1(( "tt_face_get_location:" - " too large offset (0x%08lx) found for glyph index %ld,\n" + " too large offset (0x%08lx) found for glyph index %d,\n" " " " exceeding the end of `glyf' table (0x%08lx)\n", pos2, gindex + 1, face->glyf_len )); @@ -429,7 +428,7 @@ if ( FT_FRAME_EXTRACT( table_len, face->font_program ) ) goto Exit; - FT_TRACE2(( "loaded, %12d bytes\n", face->font_program_size )); + FT_TRACE2(( "loaded, %12ld bytes\n", face->font_program_size )); } Exit: @@ -492,7 +491,7 @@ if ( FT_FRAME_EXTRACT( table_len, face->cvt_program ) ) goto Exit; - FT_TRACE2(( "loaded, %12d bytes\n", face->cvt_program_size )); + FT_TRACE2(( "loaded, %12ld bytes\n", face->cvt_program_size )); } Exit: diff --git a/lib/freetype/src/truetype/ttpload.h b/lib/freetype/src/truetype/ttpload.h index 3bbd4add1..bb669e027 100644 --- a/lib/freetype/src/truetype/ttpload.h +++ b/lib/freetype/src/truetype/ttpload.h @@ -20,8 +20,7 @@ #define TTPLOAD_H_ -#include <ft2build.h> -#include FT_INTERNAL_TRUETYPE_TYPES_H +#include <freetype/internal/tttypes.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/truetype/ttsubpix.c b/lib/freetype/src/truetype/ttsubpix.c index 828981886..56667deaf 100644 --- a/lib/freetype/src/truetype/ttsubpix.c +++ b/lib/freetype/src/truetype/ttsubpix.c @@ -15,14 +15,13 @@ * */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_SFNT_H -#include FT_TRUETYPE_TAGS_H -#include FT_OUTLINE_H -#include FT_DRIVER_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftcalc.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/sfnt.h> +#include <freetype/tttags.h> +#include <freetype/ftoutln.h> +#include <freetype/ftdriver.h> #include "ttsubpix.h" diff --git a/lib/freetype/src/truetype/ttsubpix.h b/lib/freetype/src/truetype/ttsubpix.h index 23adf7e8d..229a6cf05 100644 --- a/lib/freetype/src/truetype/ttsubpix.h +++ b/lib/freetype/src/truetype/ttsubpix.h @@ -19,7 +19,6 @@ #ifndef TTSUBPIX_H_ #define TTSUBPIX_H_ -#include <ft2build.h> #include "ttobjs.h" #include "ttinterp.h" diff --git a/lib/freetype/src/type1/Jamfile b/lib/freetype/src/type1/Jamfile deleted file mode 100644 index e96611b75..000000000 --- a/lib/freetype/src/type1/Jamfile +++ /dev/null @@ -1,35 +0,0 @@ -# FreeType 2 src/type1 Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) type1 ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = t1afm - t1driver - t1gload - t1load - t1objs - t1parse - ; - } - else - { - _sources = type1 ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/type1 Jamfile diff --git a/lib/freetype/src/type1/t1afm.c b/lib/freetype/src/type1/t1afm.c index 0866e7bf9..b9cd66b04 100644 --- a/lib/freetype/src/type1/t1afm.c +++ b/lib/freetype/src/type1/t1afm.c @@ -16,11 +16,10 @@ */ -#include <ft2build.h> #include "t1afm.h" -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/psaux.h> #include "t1errors.h" diff --git a/lib/freetype/src/type1/t1afm.h b/lib/freetype/src/type1/t1afm.h index 40ce8f975..edf919c79 100644 --- a/lib/freetype/src/type1/t1afm.h +++ b/lib/freetype/src/type1/t1afm.h @@ -19,9 +19,8 @@ #ifndef T1AFM_H_ #define T1AFM_H_ -#include <ft2build.h> #include "t1objs.h" -#include FT_INTERNAL_TYPE1_TYPES_H +#include <freetype/internal/t1types.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/type1/t1driver.c b/lib/freetype/src/type1/t1driver.c index 75a5698e8..b786a8781 100644 --- a/lib/freetype/src/type1/t1driver.c +++ b/lib/freetype/src/type1/t1driver.c @@ -16,7 +16,6 @@ */ -#include <ft2build.h> #include "t1driver.h" #include "t1gload.h" #include "t1load.h" @@ -27,20 +26,20 @@ #include "t1afm.h" #endif -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_HASH_H -#include FT_INTERNAL_POSTSCRIPT_PROPS_H -#include FT_DRIVER_H - -#include FT_SERVICE_MULTIPLE_MASTERS_H -#include FT_SERVICE_GLYPH_DICT_H -#include FT_SERVICE_FONT_FORMAT_H -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_SERVICE_POSTSCRIPT_INFO_H -#include FT_SERVICE_PROPERTIES_H -#include FT_SERVICE_KERNING_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/fthash.h> +#include <freetype/internal/ftpsprop.h> +#include <freetype/ftdriver.h> + +#include <freetype/internal/services/svmm.h> +#include <freetype/internal/services/svgldict.h> +#include <freetype/internal/services/svfntfmt.h> +#include <freetype/internal/services/svpostnm.h> +#include <freetype/internal/services/svpscmap.h> +#include <freetype/internal/services/svpsinfo.h> +#include <freetype/internal/services/svprop.h> +#include <freetype/internal/services/svkern.h> /************************************************************************** diff --git a/lib/freetype/src/type1/t1driver.h b/lib/freetype/src/type1/t1driver.h index 84b3e041c..e7eae0b88 100644 --- a/lib/freetype/src/type1/t1driver.h +++ b/lib/freetype/src/type1/t1driver.h @@ -20,8 +20,7 @@ #define T1DRIVER_H_ -#include <ft2build.h> -#include FT_INTERNAL_DRIVER_H +#include <freetype/internal/ftdrv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/type1/t1errors.h b/lib/freetype/src/type1/t1errors.h index 1b119b843..ad03a3d32 100644 --- a/lib/freetype/src/type1/t1errors.h +++ b/lib/freetype/src/type1/t1errors.h @@ -25,7 +25,7 @@ #ifndef T1ERRORS_H_ #define T1ERRORS_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -33,7 +33,7 @@ #define FT_ERR_PREFIX T1_Err_ #define FT_ERR_BASE FT_Mod_Err_Type1 -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* T1ERRORS_H_ */ diff --git a/lib/freetype/src/type1/t1gload.c b/lib/freetype/src/type1/t1gload.c index fcaf66c40..d16b81f24 100644 --- a/lib/freetype/src/type1/t1gload.c +++ b/lib/freetype/src/type1/t1gload.c @@ -16,15 +16,14 @@ */ -#include <ft2build.h> #include "t1gload.h" -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_OUTLINE_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_INTERNAL_CFF_TYPES_H -#include FT_DRIVER_H +#include <freetype/internal/ftcalc.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/ftoutln.h> +#include <freetype/internal/psaux.h> +#include <freetype/internal/cfftypes.h> +#include <freetype/ftdriver.h> #include "t1errors.h" @@ -334,7 +333,7 @@ else advances[nn] = 0; - FT_TRACE5(( " idx %d: advance width %d font unit%s\n", + FT_TRACE5(( " idx %d: advance width %ld font unit%s\n", first + nn, advances[nn], advances[nn] == 1 ? "" : "s" )); diff --git a/lib/freetype/src/type1/t1gload.h b/lib/freetype/src/type1/t1gload.h index 59fae82b6..9947507c8 100644 --- a/lib/freetype/src/type1/t1gload.h +++ b/lib/freetype/src/type1/t1gload.h @@ -20,7 +20,6 @@ #define T1GLOAD_H_ -#include <ft2build.h> #include "t1objs.h" diff --git a/lib/freetype/src/type1/t1load.c b/lib/freetype/src/type1/t1load.c index d0ea36bad..84986007b 100644 --- a/lib/freetype/src/type1/t1load.c +++ b/lib/freetype/src/type1/t1load.c @@ -61,12 +61,12 @@ #include <ft2build.h> -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> #include FT_CONFIG_CONFIG_H -#include FT_MULTIPLE_MASTERS_H -#include FT_INTERNAL_TYPE1_TYPES_H -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_HASH_H +#include <freetype/ftmm.h> +#include <freetype/internal/t1types.h> +#include <freetype/internal/ftcalc.h> +#include <freetype/internal/fthash.h> #include "t1load.h" #include "t1errors.h" @@ -1063,7 +1063,7 @@ map->design_points[p] = T1_ToInt( parser ); map->blend_points [p] = T1_ToFixed( parser, 0 ); - FT_TRACE4(( " [%d %f]", + FT_TRACE4(( " [%ld %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 %d)\n", + " (from %d to %ld)\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 %d)\n", + " (from %d to %ld)\n", num_glyphs, ( limit - cur ) >> 3 )); num_glyphs = ( limit - cur ) >> 3; } diff --git a/lib/freetype/src/type1/t1load.h b/lib/freetype/src/type1/t1load.h index 9cac0f6fb..4396415c2 100644 --- a/lib/freetype/src/type1/t1load.h +++ b/lib/freetype/src/type1/t1load.h @@ -20,10 +20,9 @@ #define T1LOAD_H_ -#include <ft2build.h> -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H -#include FT_MULTIPLE_MASTERS_H +#include <freetype/internal/ftstream.h> +#include <freetype/internal/psaux.h> +#include <freetype/ftmm.h> #include "t1parse.h" diff --git a/lib/freetype/src/type1/t1objs.c b/lib/freetype/src/type1/t1objs.c index 80ee0e265..3b918b733 100644 --- a/lib/freetype/src/type1/t1objs.c +++ b/lib/freetype/src/type1/t1objs.c @@ -16,12 +16,11 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_CALC_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_TRUETYPE_IDS_H -#include FT_DRIVER_H +#include <freetype/internal/ftcalc.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/ttnameid.h> +#include <freetype/ftdriver.h> #include "t1gload.h" #include "t1load.h" @@ -32,8 +31,8 @@ #include "t1afm.h" #endif -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/internal/services/svpscmap.h> +#include <freetype/internal/psaux.h> /************************************************************************** @@ -347,8 +346,8 @@ if ( error ) goto Exit; - FT_TRACE2(( "T1_Face_Init: %08p (index %d)\n", - face, + FT_TRACE2(( "T1_Face_Init: %p (index %d)\n", + (void *)face, face_index )); /* if we just wanted to check the format, leave successfully now */ diff --git a/lib/freetype/src/type1/t1objs.h b/lib/freetype/src/type1/t1objs.h index 6bc902cc8..536be8ba1 100644 --- a/lib/freetype/src/type1/t1objs.h +++ b/lib/freetype/src/type1/t1objs.h @@ -21,9 +21,9 @@ #include <ft2build.h> -#include FT_INTERNAL_OBJECTS_H +#include <freetype/internal/ftobjs.h> #include FT_CONFIG_CONFIG_H -#include FT_INTERNAL_TYPE1_TYPES_H +#include <freetype/internal/t1types.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/type1/t1parse.c b/lib/freetype/src/type1/t1parse.c index ec30355bf..74cf38bde 100644 --- a/lib/freetype/src/type1/t1parse.c +++ b/lib/freetype/src/type1/t1parse.c @@ -33,10 +33,9 @@ */ -#include <ft2build.h> -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/psaux.h> #include "t1parse.h" diff --git a/lib/freetype/src/type1/t1parse.h b/lib/freetype/src/type1/t1parse.h index edf79b0a8..1ea0110b5 100644 --- a/lib/freetype/src/type1/t1parse.h +++ b/lib/freetype/src/type1/t1parse.h @@ -20,9 +20,8 @@ #define T1PARSE_H_ -#include <ft2build.h> -#include FT_INTERNAL_TYPE1_TYPES_H -#include FT_INTERNAL_STREAM_H +#include <freetype/internal/t1types.h> +#include <freetype/internal/ftstream.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/type1/type1.c b/lib/freetype/src/type1/type1.c index 95dbaeb50..cadee7899 100644 --- a/lib/freetype/src/type1/type1.c +++ b/lib/freetype/src/type1/type1.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "t1afm.c" #include "t1driver.c" diff --git a/lib/freetype/src/type42/Jamfile b/lib/freetype/src/type42/Jamfile deleted file mode 100644 index 1c32dd145..000000000 --- a/lib/freetype/src/type42/Jamfile +++ /dev/null @@ -1,32 +0,0 @@ -# FreeType 2 src/type42 Jamfile -# -# Copyright (C) 2002-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) type42 ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = t42drivr - t42objs - t42parse - ; - } - else - { - _sources = type42 ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/type42 Jamfile diff --git a/lib/freetype/src/type42/t42drivr.c b/lib/freetype/src/type42/t42drivr.c index 4b2cab347..90898b432 100644 --- a/lib/freetype/src/type42/t42drivr.c +++ b/lib/freetype/src/type42/t42drivr.c @@ -39,12 +39,12 @@ #include "t42drivr.h" #include "t42objs.h" #include "t42error.h" -#include FT_INTERNAL_DEBUG_H +#include <freetype/internal/ftdebug.h> -#include FT_SERVICE_FONT_FORMAT_H -#include FT_SERVICE_GLYPH_DICT_H -#include FT_SERVICE_POSTSCRIPT_NAME_H -#include FT_SERVICE_POSTSCRIPT_INFO_H +#include <freetype/internal/services/svfntfmt.h> +#include <freetype/internal/services/svgldict.h> +#include <freetype/internal/services/svpostnm.h> +#include <freetype/internal/services/svpsinfo.h> #undef FT_COMPONENT #define FT_COMPONENT t42 diff --git a/lib/freetype/src/type42/t42drivr.h b/lib/freetype/src/type42/t42drivr.h index 7e7ec70f9..8bf2afc75 100644 --- a/lib/freetype/src/type42/t42drivr.h +++ b/lib/freetype/src/type42/t42drivr.h @@ -20,8 +20,7 @@ #define T42DRIVR_H_ -#include <ft2build.h> -#include FT_INTERNAL_DRIVER_H +#include <freetype/internal/ftdrv.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/type42/t42error.h b/lib/freetype/src/type42/t42error.h index 6d3617e92..e48132ec0 100644 --- a/lib/freetype/src/type42/t42error.h +++ b/lib/freetype/src/type42/t42error.h @@ -25,7 +25,7 @@ #ifndef T42ERROR_H_ #define T42ERROR_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -33,7 +33,7 @@ #define FT_ERR_PREFIX T42_Err_ #define FT_ERR_BASE FT_Mod_Err_Type42 -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* T42ERROR_H_ */ diff --git a/lib/freetype/src/type42/t42objs.c b/lib/freetype/src/type42/t42objs.c index 8d1e63ffc..6acfcdf40 100644 --- a/lib/freetype/src/type42/t42objs.c +++ b/lib/freetype/src/type42/t42objs.c @@ -19,9 +19,9 @@ #include "t42objs.h" #include "t42parse.h" #include "t42error.h" -#include FT_INTERNAL_DEBUG_H -#include FT_LIST_H -#include FT_TRUETYPE_IDS_H +#include <freetype/internal/ftdebug.h> +#include <freetype/ftlist.h> +#include <freetype/ttnameid.h> #undef FT_COMPONENT diff --git a/lib/freetype/src/type42/t42objs.h b/lib/freetype/src/type42/t42objs.h index ecb495e8f..69f5cffd4 100644 --- a/lib/freetype/src/type42/t42objs.h +++ b/lib/freetype/src/type42/t42objs.h @@ -19,15 +19,14 @@ #ifndef T42OBJS_H_ #define T42OBJS_H_ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_TYPE1_TABLES_H -#include FT_INTERNAL_TYPE1_TYPES_H +#include <freetype/freetype.h> +#include <freetype/t1tables.h> +#include <freetype/internal/t1types.h> #include "t42types.h" -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_DRIVER_H -#include FT_SERVICE_POSTSCRIPT_CMAPS_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H +#include <freetype/internal/ftobjs.h> +#include <freetype/internal/ftdrv.h> +#include <freetype/internal/services/svpscmap.h> +#include <freetype/internal/pshints.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/type42/t42parse.c b/lib/freetype/src/type42/t42parse.c index 7f26d0417..98507699f 100644 --- a/lib/freetype/src/type42/t42parse.c +++ b/lib/freetype/src/type42/t42parse.c @@ -18,9 +18,9 @@ #include "t42parse.h" #include "t42error.h" -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/psaux.h> /************************************************************************** @@ -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 %d)\n", + " (from %d to %ld)\n", loader->num_glyphs, ( limit - parser->root.cursor ) >> 2 )); loader->num_glyphs = ( limit - parser->root.cursor ) >> 2; diff --git a/lib/freetype/src/type42/t42parse.h b/lib/freetype/src/type42/t42parse.h index de54a46cf..2ccf052d7 100644 --- a/lib/freetype/src/type42/t42parse.h +++ b/lib/freetype/src/type42/t42parse.h @@ -21,7 +21,7 @@ #include "t42objs.h" -#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include <freetype/internal/psaux.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/type42/t42types.h b/lib/freetype/src/type42/t42types.h index f66f09db8..ba0cc2142 100644 --- a/lib/freetype/src/type42/t42types.h +++ b/lib/freetype/src/type42/t42types.h @@ -20,11 +20,10 @@ #define T42TYPES_H_ -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_TYPE1_TABLES_H -#include FT_INTERNAL_TYPE1_TYPES_H -#include FT_INTERNAL_POSTSCRIPT_HINTS_H +#include <freetype/freetype.h> +#include <freetype/t1tables.h> +#include <freetype/internal/t1types.h> +#include <freetype/internal/pshints.h> FT_BEGIN_HEADER diff --git a/lib/freetype/src/type42/type42.c b/lib/freetype/src/type42/type42.c index 4739b3c33..012559e2f 100644 --- a/lib/freetype/src/type42/type42.c +++ b/lib/freetype/src/type42/type42.c @@ -17,7 +17,6 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#include <ft2build.h> #include "t42drivr.c" #include "t42objs.c" diff --git a/lib/freetype/src/winfonts/Jamfile b/lib/freetype/src/winfonts/Jamfile deleted file mode 100644 index 4b7ce0715..000000000 --- a/lib/freetype/src/winfonts/Jamfile +++ /dev/null @@ -1,16 +0,0 @@ -# FreeType 2 src/winfonts Jamfile -# -# Copyright (C) 2001-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. - -SubDir FT2_TOP $(FT2_SRC_DIR) winfonts ; - -Library $(FT2_LIB) : winfnt.c ; - -# end of src/winfonts Jamfile diff --git a/lib/freetype/src/winfonts/fnterrs.h b/lib/freetype/src/winfonts/fnterrs.h index f98e68435..550de386f 100644 --- a/lib/freetype/src/winfonts/fnterrs.h +++ b/lib/freetype/src/winfonts/fnterrs.h @@ -26,7 +26,7 @@ #ifndef FNTERRS_H_ #define FNTERRS_H_ -#include FT_MODULE_ERRORS_H +#include <freetype/ftmoderr.h> #undef FTERRORS_H_ @@ -34,7 +34,7 @@ #define FT_ERR_PREFIX FNT_Err_ #define FT_ERR_BASE FT_Mod_Err_Winfonts -#include FT_ERRORS_H +#include <freetype/fterrors.h> #endif /* FNTERRS_H_ */ diff --git a/lib/freetype/src/winfonts/winfnt.c b/lib/freetype/src/winfonts/winfnt.c index 9b466e8f2..e83312d16 100644 --- a/lib/freetype/src/winfonts/winfnt.c +++ b/lib/freetype/src/winfonts/winfnt.c @@ -18,17 +18,16 @@ */ -#include <ft2build.h> -#include FT_WINFONTS_H -#include FT_INTERNAL_DEBUG_H -#include FT_INTERNAL_STREAM_H -#include FT_INTERNAL_OBJECTS_H -#include FT_TRUETYPE_IDS_H +#include <freetype/ftwinfnt.h> +#include <freetype/internal/ftdebug.h> +#include <freetype/internal/ftstream.h> +#include <freetype/internal/ftobjs.h> +#include <freetype/ttnameid.h> #include "winfnt.h" #include "fnterrs.h" -#include FT_SERVICE_WINFNT_H -#include FT_SERVICE_FONT_FORMAT_H +#include <freetype/internal/services/svwinfnt.h> +#include <freetype/internal/services/svfntfmt.h> /************************************************************************** * diff --git a/lib/freetype/src/winfonts/winfnt.h b/lib/freetype/src/winfonts/winfnt.h index 391f4448a..3367c7715 100644 --- a/lib/freetype/src/winfonts/winfnt.h +++ b/lib/freetype/src/winfonts/winfnt.h @@ -21,9 +21,8 @@ #define WINFNT_H_ -#include <ft2build.h> -#include FT_WINFONTS_H -#include FT_INTERNAL_DRIVER_H +#include <freetype/ftwinfnt.h> +#include <freetype/internal/ftdrv.h> FT_BEGIN_HEADER |