Commit graph

8543 commits

Author SHA1 Message Date
Alexei Podtelezhnikov
2c041d32fa * src/base/ftbitmap.c (FT_Bitmap_Blend): Refactor to avoid warnings. 2026-05-09 09:03:57 -04:00
Alexei Podtelezhnikov
a1dd8f8d68 .gitlab-ci.yml: Update Windows pipeline. 2026-05-09 07:11:58 -04:00
Alexei Podtelezhnikov
8cbc8a7758 * src/smooth/ftgrays.c: Comments expanded. 2026-05-08 21:21:45 -04:00
Alexei Podtelezhnikov
7c08535abd * docs/CHANGES: Draft recent changes. 2026-05-08 18:34:38 -04:00
Alexei Podtelezhnikov
a39ef7632e [smooth] Dynamic pool allocation.
The fixed pool allocation on stack is very fast and works very well
for rendering glyphs smaller than 40 pixels. Larger glyphs have to be
split and rendered piecewise, which is slower.  This commit introduces
dynamic pool allocation for larger glyphs.  Complex large glyphs are
now rendered about 2x faster.

* src/smooth/ftgrays.c (gray_convert_glyph): Use simpler banding schema
in case of rendering emergency.
(gray_raster_render): Allocate larger pools dynamically.

* include/freetype/config/ftoption.h: Explain the render pool size.
* devel/ftoption.h: Ditto.
2026-05-08 18:14:53 -04:00
Werner Lemberg
a1bbf07413 * builds/windows/vc2010/index.html: Update file descriptions.
Fixes issue #1434.
2026-05-08 05:38:23 +02:00
Mateusz Jurczyk
7e3750982b * src/truetype/ttinterp.c (TT_RunIns): Remove dead code.
Fixes #1433.
2026-05-07 13:25:40 +00:00
Mateusz Jurczyk
968af86bec * src/psaux/psintrp.c (cf2_interpT2CharString): Fix off-by-one in the subroutine nesting depth check.
Fixes #1432.
2026-05-07 13:16:55 +00:00
Mateusz Jurczyk
1ec3406aef * src/psaux/psstack.c (cf2_stack_roll): Process top stack elements instead of bottom ones.
Fixes #1431.
2026-05-07 13:13:16 +00:00
Mateusz Jurczyk
287206a96b * src/truetype/ttinterp.c (Ins_WCVTF): Add missing CVT copy-on-write protection.
Fixes #1430.
2026-05-07 13:00:15 +00:00
Mateusz Jurczyk
df2fb115bf * src/psaux/psintrp.c (cf2_doBlend): Implement proper bounds check accounting for all operands.
Fixes #1429.
2026-05-07 12:47:52 +00:00
Mateusz Jurczyk
1f705ffb71 * src/psaux/psstack.c (cf2_stack_setReal): Fix off-by-one in index check.
Fixes #1428.
2026-05-07 12:31:59 +00:00
Alexei Podtelezhnikov
b6bcd2177f * src/base/ftbitmap.c (FT_Bitmap_Blend): Check final dimensions.
Fixes #1413.
2026-05-03 13:21:19 -04:00
Alexei Podtelezhnikov
53850f3cd5 * src/base/ftbitmap.c (FT_Bitmap_Blend): Refactor. 2026-05-03 13:10:01 -04:00
Alexei Podtelezhnikov
cbe12767ea * src/base/ftobjs.c (FT_Render_Glyph_Internal): Protect FT_LOAD_COLOR.
Now only *scalable* COLRv0 layers can be rendered with FT_LOAD_COLOR,
in accordance with Chromium. Fixes #1425, also see !424.
2026-05-02 15:17:35 -04:00
Alexei Podtelezhnikov
590b77014b * src/base/ftobjs.c (FT_Render_Glyph_Internal): Formatting. 2026-05-02 15:09:51 -04:00
Alexei Podtelezhnikov
6d9fc45fc4 * src/truetype/ttgxvar.c (tt_delta_shift): Use unsigned references. 2026-04-28 18:56:18 -04:00
Alexei Podtelezhnikov
0d45c7f191 [truetype/GX] Fix signed overflow.
Fixes #1423.

* src/truetype/ttgxvar.c (tt_interpolate_deltas, tt_delta_interpolate):
Use unsigned counters.
2026-04-27 22:33:16 -04:00
Alexei Podtelezhnikov
5d1099341f [truetype] Reduce zone copying.
* src/truetype/ttinterp.c (Compute_Point_Displacement): Reduce
zone copying and return reference on demand only.
(Ins_SHP, Ins_SHC, Ins_SHZ): Updated accordingly.
2026-04-26 09:38:34 -04:00
Alexei Podtelezhnikov
c8c8b4b8a0 [truetype] Simplify shift conditions.
* src/truetype/ttinterp.c (Compute_Point_Displacement,
Ins_SHP, Ins_SHPIX): Use 'FT_UInt" as point references.
(Ins_SHC, Ins_SHZ): Ditto and simplify repeated condition.
2026-04-26 08:36:25 -04:00
Alexei Podtelezhnikov
85c20f4e78 * src/truetype/ttinterp.c (Move_Zp2_Point): Remove 'touch'.
Update all callers.
2026-04-26 08:32:13 -04:00
Alexei Podtelezhnikov
6d0ae3ae94 [truetype] Fix SHZ according to specifications.
SHZ must shift the zone specified by its arguments. Previously,
it was shifting zp2 instead.

* src/truetype/ttinterp.c (Ins_SHZ): Rewrite to specifications.
2026-04-26 08:26:52 -04:00
Alexei Podtelezhnikov
7d600a022e * src/truetype/ttinterp.c (Ins_SHZ): Fix the range limit (cont'd).
Fixes
    https://issues.oss-fuzz.com/issues/505900175
2026-04-23 21:54:58 -04:00
Alexei Podtelezhnikov
1803559c4e * src/truetype/ttinterp.c (Ins_SHZ): Fix the range limit.
Fixes #1419 and #1420, as well as
    https://issues.oss-fuzz.com/issues/499455833
2026-04-22 20:49:51 -04:00
Alexei Podtelezhnikov
7974be74d8 * src/truetype/ttinterp.c (Ins_IUP): Use unsigned counter.
Fixes #1421.
2026-04-22 16:04:14 -04:00
Yaroslav Kolomiiets
f2b3f96901 [build] Add a Plan 9 port.
* mkfile: Build instructions.
* build/plan9/p9lib.h: Standard lib replacement.
* build/plan9/README: Docs.
2026-04-22 09:01:21 -04:00
Alexei Podtelezhnikov
ce4105f913 * include/freetype/fttypes.h: Do not include stddef.h. 2026-04-21 19:52:37 -04:00
Werner Lemberg
867c296b90 * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Use FT_MulDiv.
Problem reported as

  https://issues.oss-fuzz.com/issues/505058300
2026-04-21 22:12:09 +02:00
Alexei Podtelezhnikov
0db9ecac02 * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use unsigned counts.
This helps Plan 9 compilation.
2026-04-21 14:00:19 -04:00
Alexei Podtelezhnikov
a6d486002d * src/truetype/ttdriver.cv (tt_glyph_load): Remover redundancies.
Fixes #1417, found by `cppcheck`.
2026-04-12 22:46:32 -04:00
Alexei Podtelezhnikov
18a463c2fb * src/sdf/ftsdf.c (sdf_*_to): Remover redundant checks.
Fixes #1417, found by `cppcheck`.
2026-04-12 22:34:21 -04:00
Alexei Podtelezhnikov
ca53609f3c [pcf] Limit bitmap allocation and loading.
Loading huge bitmaps now requires selecting huge size, fixes #1411.

* src/pcf/pcfread.c (pcf_get_metrics): Remove/delay sanity checks.
* src/pcf/pcfdrivr.c (PCF_Glyph_Load): Sanitize bitmap dimensions.
2026-04-12 12:00:47 -04:00
Alexei Podtelezhnikov
3221895b3f * src/smooth/ftsmooth.c (ft_smooth_raster_lcd): Fix clip_box.
The bug is discussed in #1412, without security repercussions.
2026-04-11 11:12:02 -04:00
Alexei Podtelezhnikov
32c0722622 * src/type1/t1parse.c (T1_Get_Private_Dict): Minor.
Fixes #1416.
2026-04-11 09:31:18 -04:00
Werner Lemberg
ef54557bda [autofit] Prevent signed integer overflow.
Reported as

    https://issues.oss-fuzz.com/issues/499135336

* src/autofit/aflatin.c (af_move_contour_vertically): Use `ADD_LONG`.
2026-04-03 06:27:32 +02:00
Werner Lemberg
cc1adf8d64 [hvf] Correctly initialize driver if no HVF library is available.
Since this font driver is by default enabled in `modules.cfg` and its
availability controlled by `FT_CONFIG_OPTION_HVF`, we need to provide some
stubs so that HVF fonts can be correctly rejected if there is no HVF library
available.

Fixes issue #1409.

* src/hvf/hvfdrv.c (hvf_driver_class): Provide `hvf_face_init` and
  `hvf_slot_load_glyph` unconditionally.

* src/hvf/hvfload.c, src/hvf/hvfload.h (hvf_slot_load_glyph)
  [!FT_CONFIG_OPTION_HVF]: Define stub.
* src/hvf/hvfobjs.c, src/hvf/hvfobjs.h (hvf_face_init)
  [!FT_CONFIG_OPTION_HVF]: Define stub.
2026-04-03 04:20:24 +00:00
Werner Lemberg
675a94f5d0 [autofit] Prevent signed integer overflow.
Reported as

  https://issues.oss-fuzz.com/issues/496105489

* src/autofit/aflatin.c
  (af_glyph_hints_apply_vertical_separation_adjustments): Use `ADD_LONG` and
  `SUB_LONG`.
2026-04-02 07:56:04 +02:00
Suzuki, Toshiya (鈴木俊哉)
07d8d50a63 Update some VisualStudio project files to include HVF module.
* builds/windows/vc2010/freetype.vcxproj: Add hvf.c before ftlzw.c.
* builds/windows/visualc/freetype.vcproj: Add hvf.c before pcf.c.
* builds/windows/visualce/freetype.vcproj: Add hvf.c before pcf.c.
2026-03-23 19:36:36 +01:00
Debbie Goldsmith
8dff1b4b07 * builds/unix/configure.raw: Handle new HVF driver. 2026-03-23 19:36:36 +01:00
Debbie Goldsmith
2228a8b446 * meson.build, meson_option.txt: Handle new HVF driver.
(hvf): New option.
2026-03-23 19:36:36 +01:00
Debbie Goldsmith
39dab7d2cd * CMakeLists.txt: Handle new HVF driver.
(FT_DISABLE_HVF): New option.
2026-03-23 19:36:36 +01:00
Debbie Goldsmith
0c9b8e9e93 Support Hierarchical Variable Fonts (HVF) using Apple's 'libhvf' library.
The new 'hvf' module is a thin wrapper around 'libhvf' with the necessary
boilerplate stuff to integrate it into FreeType.  Note that this currently
works on macOS >= 15.4 and iOS >= 18.4 only.

* include/freetype/tttags.h (TTAG_hvgl, TTAG_hvpm): New macros.
* include/freetype/config/ftmodule.h: Add `hvf_driver_class`.
* include/freetype/internal/fttrace.h: Add tracing tags `hvfdrv`, `hvfobjs`,
  and `hvfload`
* include/freetype/internal/services/svfntfmt.h (FT_FONT_FORMAT_HVF): New
  macro.

* modules.cfg (FONT_MODULES): Add `hvf` module.

* src/sfnt/sfobjc.s (sfnt_init_face): Handle 'hvgl' table.

* src/hvf/*: New files.
2026-03-23 19:36:36 +01:00
Debbie Goldsmith
00e6a1bca9 Add flag FT_CONFIG_OPTION_HVF.
This flag is going to be used to conditionally compile support for Apple's
Hierarchical Variable Font (HVF) format.

* devel/ftoption.h, include/freetype/config/ftoption.h
  (FT_CONFIG_OPTION_HVF): New flag.
2026-03-23 19:36:36 +01:00
Alexei Podtelezhnikov
eb13f81a48 * src/truetype/ttinterp.c (TT_MulFix14_i386): Typo.
Fixes #1408.
2026-03-23 14:26:02 -04:00
Rudi Heitbaum
a3c1a452df * src/base/ftstroke.c (ft_stroke_border_get_counts): Remove variable. 2026-03-23 10:44:12 -04:00
Werner Lemberg
0a0221a134 * Version 2.14.3 released.
==========================

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.
2026-03-22 16:07:10 +01:00
Werner Lemberg
402fa01ad9 * subprojects/harfbuzz.wrap: Updated. 2026-03-22 15:51:57 +01:00
David Pokora
67c52a0b68 [psaux] Avoid stack overflow.
* src/psaux/t1.decode.c (t1_decoder_parse_charstrings) [op_pop]: Check stack
  size.

Fixes issue #1406.
2026-03-22 06:28:57 +01:00
Werner Lemberg
238dd13d7d * src/psaux/t1decide.c (t1_decoder_parse_charstrings): Fix bounds check.
During charstring processing, the `decoder->len_buildchar` field can be
corrupted.  Avoid this by caching this value in a local variable at function
entry.

Based on a patch submitted by David Pokora <david.pokora@trailofbits.com>.

Fixes issue #1405.
2026-03-22 06:22:31 +01:00
Werner Lemberg
78d65241aa ttnameid.h: Minor documentation improvement. 2026-03-20 08:06:02 +01:00