245 Commits

Author SHA1 Message Date
Garret Rieger
201f02c2c2 [subset] Fix lint. 2024-10-24 00:30:38 +00:00
Garret Rieger
4a38610072 [subset] consider variation selectors subsetting cmap14
cmap14 subsetting code was not considering variation selectors in the input unicode set when deciding which variant glyphs to keep. This updates subsetting to only keeps variant glyphs if their variation selector code point is in the input unicodes set.
2024-10-23 21:39:33 +00:00
Mark Elliot
4cd0b0d87d Escape \ in subset docs 2024-09-23 12:42:15 -06:00
Roel Nieskens
11343ed64c Add instructions to escape question mark
Arguments without it will not work in zsh and possibly other shells.
2024-09-10 11:17:33 -06:00
Roel Nieskens
d871fd3a08 Remove dotslash from examples 2024-09-10 11:17:33 -06:00
Behdad Esfahbod
973dc5c9a7 [varc] Use Condition instead of ConditionSet
With more Condition formats.

df7dcc4618
https://github.com/harfbuzz/boring-expansion-spec/issues/147
2024-05-22 18:46:07 -06:00
Behdad Esfahbod
74f870f4ef [varc] Add ConditionSets 2024-05-22 18:46:07 -06:00
Behdad Esfahbod
bc82985581 [VARC] Speed up subsetting
Don't decode the whole table.
2024-05-22 18:46:07 -06:00
Behdad Esfahbod
a7ca67ada8 [VARC] Update subsetting 2024-05-22 18:46:07 -06:00
Behdad Esfahbod
3c60c0ea35 [VARC/subset] Fix closure
Was closing over everything.
2024-05-22 18:46:06 -06:00
Behdad Esfahbod
5c278464e0 [subset/VARC] Subset MultiVarStore 2024-05-22 18:45:28 -06:00
Behdad Esfahbod
f37f2e4a03 [subset] Close over MATH before GSUB
I *think* that's the correct way.
2024-05-22 18:45:28 -06:00
Behdad Esfahbod
15141589ff [subset] Support VARC
We don't prune the MultiVarStore currently. :(
2024-05-22 18:45:28 -06:00
Khaled Hosny
dbe1264b34 [subset] Prune unused user name IDs even with --name-IDs='*'
This option should affect only pre-defined name IDs, user name IDs
should be pruned when nit used, as usual.

Fixes https://github.com/fonttools/fonttools/issues/3508
2024-05-17 19:26:19 +03:00
Behdad Esfahbod
1418b4c916 [designspaceLib] Add a roundtripping __main__
Works as a normalizer as well.
2024-02-05 09:58:51 -07:00
Cosimo Lupo
49bd8adbc4
[subset] only prune codepage ranges for OS/2.version >= 1
Fixes #3334
2023-11-15 12:21:02 +00:00
Khaled Hosny
28735a6d0a [subset] Add --prune-codepage-ranges 2023-11-11 01:54:00 +02:00
Qunxin Liu
38345e8a19 fix indentation 2023-10-27 11:00:38 -07:00
Qunxin Liu
62fcec4838 [subset] fix another null-offset error in MarkLigPos 2023-10-27 10:51:11 -07:00
Behdad Esfahbod
ec9986d3b8 [subset] black
Oops.
2023-10-23 21:57:11 -06:00
Behdad Esfahbod
1d0f3c27fc [subset] Handle a null-offset error in MarkLigPos
As reported by @rsheeter.
2023-10-23 21:39:28 -06:00
Cosimo Lupo
5d6e1c750c
[subset] keep East Asian spacing vhal, halt, chws, vchw by default
https://github.com/harfbuzz/harfbuzz/issues/4451
2023-10-19 10:46:47 +01:00
Behdad Esfahbod
31c531dd04 [subset] Fix extension of subset font (again)
Fixes https://github.com/fonttools/fonttools/issues/1298#issuecomment-1768849326
2023-10-18 10:11:51 -06:00
Behdad Esfahbod
d27cc3abf8 Revert "Merge pull request #3214 from fonttools/subset-speed-regression"
This reverts commit f7965ba0086ebad9e3fa103935dc2edf41ffe780, reversing
changes made to 31319a7ef218237eea7cd6713ec29032a5cdd752.
2023-07-20 10:16:04 -06:00
Cosimo Lupo
f0d601a5f2
[subset] Revert use of NameVisitor in subsetter which may be causing speed regression
Intended to fix #3213

Revert "Implement Cosimo feedback"

This reverts commit cfede76fd93012a79457232d79884b3c885bf81b.

Revert "remove redundant CPAL name removal code"

This reverts commit b5639410abe9b57d9764639839621d9f1995c873.

Revert "convert name table _prune_pre_subset to prune_post_subset"

This reverts commit 0a6e8bf1c308c843fbbf65e06e4eb5734aa941a2.

Revert "Use NameRecordVisitor in subsetter"

This reverts commit edf8891fba54015c5d37a6397b7b95f14dfe5662.
2023-07-20 10:26:28 +01:00
Marc Foley
cfede76fd9 Implement Cosimo feedback 2023-07-10 15:01:40 +01:00
Marc Foley
b5639410ab remove redundant CPAL name removal code 2023-06-28 17:18:12 +01:00
Marc Foley
0a6e8bf1c3 convert name table _prune_pre_subset to prune_post_subset 2023-06-28 17:02:34 +01:00
Marc Foley
edf8891fba Use NameRecordVisitor in subsetter 2023-06-27 15:23:56 +01:00
Behdad Esfahbod
65598197c8 [subset] Remove quotation marks from command-line samples
Those have confused Windows users before.

Fixes https://github.com/fonttools/fonttools/issues/3149
2023-06-05 09:42:17 -06:00
Khaled Hosny
7089635305 [subset] Make sure GDEF is processed before GSUB and GPOS
See https://github.com/fonttools/fonttools/pull/3114#pullrequestreview-1437266522
2023-05-22 23:22:44 +03:00
Khaled Hosny
04975b9a14 [subset] Prune GDEF.MarkGlyphSetsDef
Remove empty sets and fixup Lookup.MarkFilteringSet to use the new
indices.
2023-05-22 13:28:50 +03:00
Jany Belluz
760c7376fe [subset] Compute xAvgCharWidth even when --no-prune-unicode-ranges is given 2023-03-01 16:28:51 +00:00
Nikolaus Waxweiler
d584daa8fd Blacken code 2022-12-13 11:26:36 +00:00
Jack McCabe
eeba234ee0 [subset] PR feedback implementation 2022-09-30 15:59:11 +01:00
Jack McCabe
14ce08bd75 [subset] extend CPALv1 test 2022-09-30 15:41:14 +01:00
Jack McCabe
70112b947d [subset] prevent CPAL nameIDs from being dropped 2022-09-30 12:36:28 +01:00
Jack McCabe
b945fd6305 [subset] Fix enumeration of palette entry labels 2022-09-30 11:40:39 +01:00
Cosimo Lupo
276f6aaf44 [subset] keep and don't prune CPAL if OT-SVG table is present
Fixes #2814

or at least is a workaround until a proper 'fix'
2022-09-14 12:55:40 -06:00
Cosimo Lupo
25a05c72ab subset: add --no-lazy option to load font eagerly as TTFont(lazy=False) 2022-09-08 15:42:34 +01:00
Behdad Esfahbod
27965842eb [subset] Fix subsetting of variable fonts
Fixes https://github.com/fonttools/fonttools/issues/2769
2022-08-24 10:12:32 -06:00
Behdad Esfahbod
24c9fb6ffa [cliTools] Rename fragment to suffix 2022-08-22 06:26:30 -06:00
Behdad Esfahbod
e146ddfd86 [cliTools.makeOutputFileName] Add fragment argument
And use it from subsetter and instancer.

Related to https://github.com/fonttools/fonttools/issues/1156
2022-08-19 12:20:21 -06:00
Behdad Esfahbod
5295ebe966
Update Lib/fontTools/subset/__init__.py
Co-authored-by: Jany Belluz <jany.belluz@daltonmaag.com>
2022-06-03 05:48:03 -06:00
Behdad Esfahbod
a1fabd0fcb [subset] Update default feature tags
Corresponding to HarfBuzz commits:
40193adbfc
40d7d56e53
2022-06-03 05:41:31 -06:00
Cosimo Lupo
0e43b0e2c3 [subset] Fix subsetting SinglePosFormat2 when ValueFormat=0
If a font has SinglePosFormat2 subtable with ValueFormat=0, then it contains a Value list with all None values.
Even though we don't build such inefficient tables, they do exist in the wild, as #2602 demostrates so we should handle those nicely, by downgrading them to Format1 with a single None value
2022-04-27 16:03:23 +01:00
Cosimo Lupo
bb1dbf4198 drop the 'X' from recalcAvgCharWidth method name 2022-04-21 19:02:39 +01:00
Cosimo Lupo
12942feb6b [subset] use recalcXAvgCharWidth method 2022-04-21 18:46:11 +01:00
Cosimo Lupo
af6804bed5 make USE_HARFBUZZ_REPACKER a 3-state option, defaults to auto
if explicitly enabled, it will raise ImportError if uharfbuzz is not found, and will propagate the uharfbuzz error instead of silently falling back to the pure-python serializer
2022-04-21 18:11:20 +01:00
Cosimo Lupo
1bb9607b72 [subset] add --no-harfbuzz-repacker CLI flag 2022-04-21 15:46:12 +01:00