Alexei Podtelezhnikov
dcb5fc5bcd
* src/sfnt/ttload.c: Trace formatting updates.
2 years ago
Alexei Podtelezhnikov
d53c114165
* src/psaux/psobjs.c (ps_table_release): Remove redundant casting.
2 years ago
Alexei Podtelezhnikov
480be443b7
* src/base/ftobjs.c (Mac_Read_sfnt_Resource): Reduce casting.
2 years ago
Alexei Podtelezhnikov
039b9071f3
[cache] Remove some casts, clean up tracing.
...
* src/cache/ftcbasic.c (FTC_ImageCache_Lookup, FTC_SBitCache_Lookup):
Clean up tracing types.
* src/cache/ftccache.c (ftc_node_destroy): Ditto.
* src/cache/ftcmanag.c (FTC_Manager_Check): Ditto.
(FTC_Manager_Check, FTC_Node_Unref): Remove a cast.
* src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto.
2 years ago
Alexei Podtelezhnikov
a18ad83e8b
[autofit] Updated to reduce casting (cont'd).
...
* src/autofit/afmodule.h (AF_ModuleRec): Change `default_script` type.
* src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
Remove casting.
* src/autofit/afmodule.c (af_property_{set,get}): Updated accordingly.
2 years ago
Alexei Podtelezhnikov
4f195185ee
[autofit] Updated to reduce casting.
...
* src/autofit/afglobal.h (AF_FaceGlobalsRec): Change `glyph_count` type.
* src/autofit/afglobal.c (af_face_globals_compute_style_coverage,
af_face_globals_get_metrics, af_face_globals_is_digit,
af_face_globals_new): Changed local types and updated accordingly.
* src/autofit/aflatin.c (af_latin_metrics_init_blues): Ditto.
2 years ago
Alexei Podtelezhnikov
9de432f7f2
[psaux] Remove unused structure field.
...
* include/freetype/internal/psaux.h (PS_TableRec): Remove `num_elems`.
* src/psaux/psobjs.c (ps_table_new): Remoove its initialization.
2 years ago
Dominik Röttsches
919561ca8c
[sfnt] Implement VarClipBox.
...
* src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Depending on the
format, read `var_index_base`, then retrieve and apply scaled deltas.
2 years ago
Dominik Röttsches
649352ab73
[sfnt] Fix typo in clip box computation.
...
* src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Use appropriate
scale factor for `yMin` and `yMax`.
2 years ago
Alexei Podtelezhnikov
ee72e28503
[autofit] Use unsigned accounting for hints.
...
* src/autofit/afhints.h (AF_AxisHintsRec): Use unsigned types.
* src/autofit/afhints.c (af_axis_hints_new_{segment,edge},
af_glyph_hints_get_num_segments, af_glyph_hints_get_segment_offset):
Updated accordingly.
* src/autofit/aflatin.c (af_cjk_hints_compute_edges): Ditto.
* src/autofit/afcjk.c (af_cjk_hints_compute_edges): Ditto.
2 years ago
Alexei Podtelezhnikov
fd02c369da
* src/autofit/afhints.h: Remove dead code.
2 years ago
Werner Lemberg
2af6903b15
* src/base/ftglyph.c (FT_Get_Glyph): Set `*aglyph` to NULL in case of error.
2 years ago
Werner Lemberg
a3749a64cd
Fix compilation if `TT_CONFIG_OPTION_GX_VAR_SUPPORT` is not set.
...
* src/sfnt/ttcolr.c: Protect relevant code with
`TT_CONFIG_OPTION_GX_VAR_SUPPORT`.
2 years ago
Werner Lemberg
38dc768a42
Fix clang14 compiler warnings.
...
* include/freetype/internal/ftstream.h (FT_GET_SHORT_LE, FT_GET_USHORT_LE):
Fix type.
* src/sfnt/ttcolr.c (get_deltas_for_var_index_base): Always return boolean
value.
(tt_face_get_colorline_stops): Fix type of `var_index_base`.
2 years ago
Alexei Podtelezhnikov
284956b5b1
[pfr] Fortify the kerning code.
...
Any array index must be strictly less then the array size. Therefore,
we must reject indexes that are equal to the array size. Alternatively,
we should move the bounds check before the index decrement but that
would be confusing.
In addition, it is ok to decrement zero (.notdef) and get UINT_MAX,
which is then automatically rejected in the bounds check.
* src/pfr/pfrobjs.c (pfr_face_get_kerning): Fix the bounds checking.
2 years ago
Werner Lemberg
182295cbcf
[pfr] Add some safety guards.
...
* src/pfr/pfrload.c (pfr_phy_font_load): Check resolutions and number of
characters.
Fixes #1174 .
2 years ago
Werner Lemberg
1f005c0918
* src/pfr/*.c: Trivial improvements and formatting.
2 years ago
Werner Lemberg
9a00282efc
* configure: s/egrep/grep -E/
...
`egrep` is deprecated.
2 years ago
Ben Wagner
0417e54bec
[base] Build outlines in amortized constant time.
...
When resizing the loader's points and contours, resize them to at least 1.5
times their current size. The code currently only reserves as much space as
is currently required, leading to O(n^2) runtime when adding points one at a
time.
This change does not attempt to ever shrink the loader's point and contour
storage since this was not attempted previously either. The 1.5 multiple
was chosen as a trade-off between potentially unused space and the runtime.
* src/base/ftgloader.c (FT_GlyphLoader_CheckPoints): Implement it.
Fixes #1173 .
2 years ago
Dominik Röttsches
275b116b40
[sfnt] Support variable 'COLR' v1 `PaintVarSkew*`.
...
* src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration values
`FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW`,
`FT_COLR_PAINTFORMAT_INTERNAL_SKEW_CENTER`, and
`FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW_CENTER`.
(read_paint): Handle new enumeration values.
3 years ago