313 Commits

Author SHA1 Message Date
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
Behdad Esfahbod
d757bfac8a [cffLib] Add remove_hints() and remove_unused_subroutines() methods
From subset.cff.
2024-05-21 13:42:50 -07: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
21124cf9e4
Merge pull request #3336 from fonttools/fix-os2-cp-ranges-error
Fix os2 cp ranges error
2023-11-15 13:58:28 +00:00
Cosimo Lupo
49bd8adbc4
[subset] only prune codepage ranges for OS/2.version >= 1
Fixes #3334
2023-11-15 12:21:02 +00:00
Behdad Esfahbod
a6c30e8c35 [subset.cff] Change a type
Doesn't fix, but related to
https://github.com/fonttools/fonttools/discussions/3332

The list type didn't make any sense. Use None instead.
2023-11-14 11:08:14 -07:00
Khaled Hosny
28735a6d0a [subset] Add --prune-codepage-ranges 2023-11-11 01:54:00 +02:00
Cosimo Lupo
53e71f9eb7
Merge pull request #3309 from fonttools/pyup-scheduled-update-2023-10-23
Scheduled weekly dependency update for week 43
2023-11-03 10:33:00 +00:00
Cosimo Lupo
335a1e56ec re-run black v23.10 on all .py files 2023-11-03 10:25:15 +00: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
Cosimo Lupo
532a771b98 fix minor typo [skip ci] 2023-09-15 16:58:17 +02:00
Cosimo Lupo
9f61271dc1 subset: parse OT-SVG with resolve_entities=False
to guard against XXE attacks as recommended in https://codeql.github.com/codeql-query-help/python/py-xxe/
2023-09-15 16:50:38 +02: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
Cosimo Lupo
20319e02f9
fix 'TypeError: lxml.etree._Attrib is not a mapping' on pypy3
https://github.com/fonttools/fonttools/actions/runs/5070601982/jobs/9105864056#step:5:3610
2023-05-24 16:39:26 +01: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
3eed84da01
Merge pull request #2756 from fonttools/makeOutputFileName-fragment
[cliTools.makeOutputFileName] Add fragment argument
2022-08-22 06:29:19 -06:00
Behdad Esfahbod
24c9fb6ffa [cliTools] Rename fragment to suffix 2022-08-22 06:26:30 -06:00
Behdad Esfahbod
68f31b580c
Merge pull request #2755 from fonttools/scaleUpem-cff
[scaleUpem] Support CFF/CFF2
2022-08-22 06:23:54 -06:00
Behdad Esfahbod
82a523cc17 [subset/CFF] Remove FDSelect workaround from 2014
Fixes https://github.com/fonttools/fonttools/issues/139
2022-08-20 02:41:24 +02: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
d4d8c4ac5b [scaleUpem] Support CFF/CFF2 2022-08-19 11:03:23 -06:00
Cosimo Lupo
dbe60eae80 [subset/svg] use broader ImportError instead of ModuleNotFoundError
Fixes https://github.com/fonttools/fonttools/issues/2696
2022-07-18 11:32:44 +02:00
Cosimo Lupo
be623e257f Clean up svgDoc compression
This is based on bungeman's https://github.com/fonttools/fonttools/pull/2627

Previously, an entire `SVG ` table would be marked as compressed if any
of the decoded SVG documents in it were compressed. Then on encoding all
SVG documents would be considered for compression. The XML format had no
means to indicate if compression was desired.

Instead, mark each svgDoc with its compression status. When decoding
mark the svgDoc as compressed if the data was compressed. When encoding
try to compress the svgDoc if it is marked as compressed. In the XML
format the data itself is always uncompressed, but allow an optional
`compressed` boolean attribute (defaults to false) to indicate the
svgDoc should be compressed when encoded.

We also try to make sure that older code that relies on docList containing
sequences of three items (doc, startGID, endGID) will continue to work
without modification.
2022-06-09 15:15:05 +01:00