[fonttools/fonttools] c80fbb: Raise TTLibError on recursive components in recalc...

1 view
Skip to first unread message

Cosimo Lupo

unread,
Aug 20, 2026, 8:54:27 AM (7 days ago) Aug 20
to fontto...@googlegroups.com
Branch: refs/heads/main
Home: https://github.com/fonttools/fonttools
Commit: c80fbb9d093c8eeb3a7b2bd393c0041d6e349123
https://github.com/fonttools/fonttools/commit/c80fbb9d093c8eeb3a7b2bd393c0041d6e349123
Author: Vincent Gao <gaobi...@gmail.com>
Date: 2026-06-30 (Tue, 30 Jun 2026)

Changed paths:
M Lib/fontTools/ttLib/tables/_g_l_y_f.py
M Tests/ttLib/tables/_g_l_y_f_test.py

Log Message:
-----------
Raise TTLibError on recursive components in recalcBounds fast path

Glyph.recalcBounds()'s integer-translate fast path
(tryRecalcBoundsComposite) recursed without bound on composite glyphs with
a cyclic component reference, letting a raw RecursionError escape to the
caller. The slow path, Glyph.getCoordinates(), already catches
RecursionError and re-raises it as TTLibError('glyph X contains a recursive
component reference'); the fast path simply omitted that guard. Wrap the
recursive recalcBounds call the same way so both paths behave identically.

Fixes #3899.


Commit: c922c608a3b7c3cf4f26da54c16f9f6312866a92
https://github.com/fonttools/fonttools/commit/c922c608a3b7c3cf4f26da54c16f9f6312866a92
Author: gaoflow <gaobi...@gmail.com>
Date: 2026-07-31 (Fri, 31 Jul 2026)

Changed paths:
M Tests/ttLib/tables/_g_l_y_f_test.py

Log Message:
-----------
Split recursive-component recalcBounds tests into three unit tests


Commit: e18b63cbf929256ff2fefd5d961285c08fb2e91d
https://github.com/fonttools/fonttools/commit/e18b63cbf929256ff2fefd5d961285c08fb2e91d
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-08-20 (Thu, 20 Aug 2026)

Changed paths:
M Lib/fontTools/ttLib/tables/_g_l_y_f.py
M Tests/ttLib/tables/_g_l_y_f_test.py

Log Message:
-----------
Merge pull request #4116 from gaoflow/recalcbounds-recursive-component

Raise TTLibError (not RecursionError) on recursive components in recalcBounds (#3899)


Compare: https://github.com/fonttools/fonttools/compare/0312befe139e...e18b63cbf929

To unsubscribe from these emails, change your notification settings at https://github.com/fonttools/fonttools/settings/notifications
Reply all
Reply to author
Forward
0 new messages