This removes the next set of macros remaining from the PIC support.
* include/freetype/internal/ftobjs.h (FT_DECLARE_GLYPH, FT_DEFINE_GLYPH):
Removed.
* include/freetype/ftglyph.h (FT_Glyph_Class): Make const always.
* src/*: Update all users.
These macros were relics of PIC code removed some time ago. They only hid
the class initializations. We make those explicit again.
* include/freetype/internal/ftobjs.h (FT_DECLARE_MODULE, FT_DEFINE_MODULE,
FT_DECLARE_RENDERER, FT_DEFINE_RENDERER): Removed.
* include/freetype/internal/ftdrv.h (FT_DECLARE_DRIVER, FT_DEFINE_DRIVER):
Removed.
* src/*: Updated all former users.
This is done for consistency with FT_Module_Class and FT_Renderer_Class.
All of these classes are constant and used similarly. The 'Rec' suffix
suggests that these classes are modifiable, when they are not. The old
alias is deprecated.
* include/freetype/internal/ftdrv.h: Do it.
* builds/*, include/*, src/*: Update all users.
All uses of FT_Module_Class are decorated with const now. Therefore,
it make sense to declare it as such to begin with.
* include/freetype/ftmodapi.h (FT_Module_Class): Decorate with const.
* include/freetype/internal/ftobjs.h (FT_Module): Updated.
* src/*: Update all other users.
This is intended to warn against modifying any fields in the class,
at compile-time and avoid crashes at run-time.
* include/freetype/internal/ftobjs.h (FT_ModuleRec): Do it.
* src/base/ftobjs.c (Destroy_Module, FT_Add_Module): Updated.
* include/freetype/internal/ftcalc.h [__VMS]: Undefine `FT_MulFix`.
* src/base/ftcalc.c [vms_auto64_source]: Define `FT_MulFix`.
* vms_make.com: Also create 32bit version of the FreeType library.
* include/freetype/internal/services/svmetric.h (FT_Size_Reset_Func):
Update typedef, do not return error.
* src/truetype/ttobjs.c (tt_size_reset_height): Move the PPem error
handling from here...
(tt_size_reset): ... to here to improve readability.
src/truetype/ttobjs.h (tt_size_reset_height): Update prototype.
The previous code had a fundamental flaw: it didn't validate the necessary
parts of the 'GPOS' table before accessing it, causing crashes with
malformed data (since `TT_CONFIG_OPTION_GPOS_KERNING` is off by default,
standard fuzzers don't catch these problems). Additionally, it did a lot of
parsing while accessing kerning data, making it rather slow.
The new implementation fixes this. After validation, offsets to the 'GPOS'
lookup subtables used in the 'kern' feature that correspond to 'simple'
kerning (i.e., similar to 'kern' table kerning) are stored in `TT_Face`;
this greatly simplifies and accelerates access to the kerning data.
Testing with font `SF-Pro.ttf` version '1.00', the validation time for the
'GPOS' table increases the start-up time of `FT_New_Face` by less than 1%,
while calls to `FT_Get_Kerning` become about 3.5 times faster.
* include/freetype/internal (gpos_kerning_available): Replace with...
(gpos_lookups_kerning, num_gpos_lookups_kerning): ... these new fields.
Update callers.
* src/ttgpos.c [TT_CONFIG_OPTION_GPOS_KERNING]: A new implementation.
This reduces dereferencing when calling the interpreter.
* include/freetype/internal/tttypes.h (TT_Face): Move it from here...
* src/truetype/ttinterp.h (TT_ExecContext): ... to here.
* src/truetype/ttobjs.c (tt_size_init_bytecode): Move its initialization
* src/truetype/ttinterp.c (TT_New_Context): ... to here.
(TT_Run_Context): Updated.
Even if it was explicitly set by either design or normalized APIs.
Also update documentation.
* src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design): Use value -2
of `error` to indicate that we have a non-default instance.
(TT_Set_Named_Instance): Updated.
* src/base/ftmm.c (FT_Set_Var_Design_Coordinates,
FT_Set_Var_Blend_Coordinates): Updated.
We now request HarfBuzz version 2.6.8 (published in June 2020) or newer to
simplify the setup; this version introduced function
`hb_ot_layout_lookup_get_glyph_alternates`, which we need for the adjustment
database of the auto-hinter.
No CMake support yet for dynamic loading.
* include/freetype/config/ftoption.h, devel/ftoption.h
(FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC): New configuration macro.
* builds/unix/configure.raw: Implement `--with-harfbuzz=dynamic`.
This gets tested automatically if we can't link with `libharfbuzz`.
(ft_option_set, ft_option_unset): Refine.
Require at least HarfBuzz version 2.6.8.
* meson.build: Do the same as `configure.raw`.
* meson_options.txt: Updated.
* CMakeLists.txt: Require at least HarfBuzz version 2.6.8.
Resolves inconsistencies in 64-bit multiplication discussed in !355. Importantly, FT_MulFix arguments and return value is FT_Long, whatever sizeof FT_Long is on 64-bit platforms: 8 bytes on Linux or 4 bytes on Windows. * include/freetype/internal/ftcalc.h (FT_MulFix_x86_64): Removed. (FT_MulFix_64): Generalize and prioritize the inline implementation
for all 64-bit platforms ifdef FT_INT64. * src/base/ftcalc.c (FT_MulFix)[FT_INT64]: Call 'FT_MulFix_64'. * src/base/ftbase.c: Include 'ftcalc.c' after the FT_MulFix callers to enable its inlining.
==========================
Tag sources with `VER-2-13-3'.
* docs/VERSION.TXT: Add entry for version 2.13.3.
* docs/CHANGES: Updated.
* docs/release, docs/README, builds/macs/README: 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.13.2/2.13.3/, s/2132/2133/.
* include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
* builds/unix/configure.raw (version_info): Set to 26:2:20.
* CMakeLists.txt (VERSION_PATCH): Set to 3.