==========================
Tag sources with `VER-2-14-3'.
* docs/VERSION.TXT: Add entry for version 2.14.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.14.2/2.14.3/, s/2142/2143/.
* include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
* builds/unix/configure.raw (version_info): Set to 26:6:20.
* CMakeLists.txt (VERSION_PATCH): Set to 3.
==========================
Tag sources with `VER-2-14-2'.
* docs/VERSION.TXT: Add entry for version 2.14.2.
* 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.14.1/2.14.2/, s/2141/2142/.
* include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.
* builds/unix/configure.raw (version_info): Set to 26:5:20.
* CMakeLists.txt (VERSION_PATCH): Set to 2.
* src/base/src/base/ftobjs.c (ft_glyphslot_alloc_bitmap): Use preset
dimensions and call FT_MEM_ALLOC_MULT.
* include/freetype/internal/ftobjs.h (ft_glyphslot_alloc_bitmap):
Updated signature...
* src/*: ... and all callers.
Applying an LCD filter to spans rather than the entire image improves
the performance of ClearType-like rendering by about 40% at 32 ppem
and much more at larger sizes. Small rounding differences are expected.
* src/smooth/ftsmooth.c (ft_smooth_raster_lcd, ft_smooth_lcd_spans,
ft_smooth_raster_lcdv, ft_smooth_lcdv_spans, TOrigin): Implement it.
* include/freetype/internal/ftobjs.h (FT_LibraryRec): lcd_filter_func gone.
* src/base/ftlcdfil.c (ft_lcd_filter_fir): Removed.
(ft_lcd_padding): Use padding sufficient for any 5-tap filter.
(FT_Library_SetLcdFilterWeights, FT_Library_SetLcdFilter): Updated.
* docs/CHANGES: Updated.
This removes the internal face property that sets the filtering weights.
The global filtering algorithms and weights are now optimized to work
well under all conditions.
* include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Do it.
* include/freetype/freetype.h (FT_Face_Properties): Revised docs.
* include/freetype/ftparams.h (FT_PARAM_TAG_LCD_FILTER_WEIGHTS): Ditto.
* src/base/ftlcdfil.c (ft_lcd_padding): Updated.
* src/base/ftobjs.c (ft_open_face_internal, FT_Face_Properties): Ditto.
* src/smooth/ftsmooth.c (ft_smooth_render): Ditto.
* docs/CHANGES: Updated.
This is a better fix for #1384, which is rather about signed overflow.
* include/freetype/ftimage.h (FT_Span): Use unsigned position.
* src/smooth/ftgrays.c (gray_sweep_direct): Sync with FT_Span.
* src/smooth/ftsmooth.c (ft_smooth_render): Remove redundant shift.
* src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Readjust limits.
Reject rendering of outlines that stretch beyond 32767 pixels from
the origin, which is further restricted to 10922 horizontal pixels
for LCD rendering with ClearType-like algorithms. 16-bit FT_Span is
one of the reasons to have this limit imposed, fixes#1384.
* src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Impose global
rendering limits.
Many rendering timeouts occur when the outline stretches far beyond
the Em size. Limiting the bounding box to 10 Em should reject such
requests. It is still to possible scribble excessively within the set
limits. At least, the memory usage will be curtained.
* src/base/ftobjs.c (ft_glyphslot_free_bitmap): Revise limits based
on ppem when available.
According to the OpenType specification of the 'cmap' table, the pair (0,6)
for platform and encoding IDs is used for format 13 charmap tables. Commit
ba6f3e18 (from 2017-01-17) introduced the `TT_APPLE_ID_FULL_UNICODE` macro
(i.e., encoding_id == 6, added to OpenType 1.8); however, the corresponding
cmap selection code wasn't updated.
Unicode's Last Resort font (https://github.com/unicode-org/last-resort-font)
can be used to test a format 13 charmap.
Fixes issue #1383.
* src/base/ftobjc.s (find_unicode_charmap): Support
`TT_APPLE_ID_FULL_UNICODE`.
Signed-off-by: Celeste Liu <uwu@coelacanthus.name>
==========================
Tag sources with `VER-2-14-1'.
* docs/VERSION.TXT: Add entry for version 2.14.1.
* 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.14.0/2.14.1/, s/2140/2141/.
* include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
* builds/unix/configure.raw (version_info): Set to 26:4:20.
* CMakeLists.txt (VERSION_PATCH): Set to 1.
==========================
Tag sources with `VER-2-14-0'.
* docs/VERSION.TXT: Add entry for version 2.14.0.
* 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.3/2.14.0/, s/2133/2140/.
* include/freetype/freetype.h (FREETYPE_MINOR): Set to 14.
(FREETYPE_PATCH): Set to 0.
* builds/unix/configure.raw (version_info): Set to 26:3:20.
* CMakeLists.txt (VERSION_MINOR): Set to 14.
(VERSION_PATCH): Set to 0.
This avoids cluttering the source code with VMS-specific changes.
* include/freetype/internal/ftcalc.h [__VMS], src/base/ftcalc.c
[vms_auto64_source]: Remove.
* builds/vms/patch_ftcalc.sed: New file.
* vms_make.com: Change macro definitions while this script is running; we
use `GNU sed` to inject the necessary preprocessor code on the fly.
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.
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.
I found that in hb-ft I need to sometime reset the face to the default
instance. However, calling `FT_Set_Var_Design_Coordinates` with no coords
was still slowing down at least the glyph-advance code by processing
variations.
Perhaps there's a better fix, but this handles the easy cases.
* src/base/ftmm.c (FT_Set_Var_Design_Coordinates): Implement it.
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.
Before, we were loading a palette (again and again) even if the
same was requested. Even if the font only had one palette...
For a font like NotoColorEmoji that has over 5000 colors in its
palette, this was dominating the COLRv1 loading times for HarfBuzz
(and I believe all other clients) because they have to set the
palette to get access to the colors.
* src/base/ftcolor.c (FT_Palette_Select): Check the current palette.
In `FT_Stroker_ConicTo` and `FT_Stroker_CubicTo` there is a `bez_stack`.
`arc` is initialized with `arc = bez_stack` and is never set to point
into any different object. The main loop looks like `while ( arc >=
bez_stack )` which is depending on a later `arc -= 2` (or `arc -= 3`) to
make `arc` point to before `bez_stack`. However, using pointer
subtraction to make `arc` point outside the array is undefined behavior,
and attempting to use the value in the loop predicate is "very"
undefined behavior. (C99 "Additive operators" 6.5.6.8.)
This particular undefined behavior was discovered as either hangs or
MemorySantizer issues after "[InstCombine] Infer nuw for gep inbounds
from base of object" [0]. With this change, clang can infer that `arc`
must always point into the `bez_stack` object and therefore cannot be at
a "negative index" so the predicate is always true.
[0] e21ab4d16b
* src/base/ftstroke.c (FT_Stroker_ConicTo, FT_Stroker_CubicTo): test
loop exit condition (there are no more arcs to process) before
decrementing `arc`
Fixes: #1307
* src/base/ftobjs.c (destroy_size, destroy_face): This is such that the
generic destroy can be used to call `FT_Done_Library`. For that to work,
it needs to call it *after* having removed the face from the respective
module.