Khaled Hosny
0a7164a452
Merge pull request #2447 from fonttools/merge-cff-rebased
...
Merge CFF rebased
2021-11-19 14:20:26 +02:00
Khaled Hosny
1fa579f6b8
[merge] Add CFF merging integration test
2021-11-18 22:14:41 +02:00
Khaled Hosny
40f82a8515
[merge] Support --output-file
2021-11-18 22:09:02 +02:00
Khaled Hosny
c20a63a166
[merge] Move test to its own dir
2021-11-18 21:27:01 +02:00
Khaled Hosny
10c05b8eed
[merge] Remove subroutines debug code
...
We are not doing anything about subroutines (and there shouldn’t be any
since the tables are desubroutinized), so this code is just making it
look noisy.
2021-11-18 16:39:41 +02:00
Khaled Hosny
d7c3a967cf
[merge] Support non-indexed CharStrings
2021-11-18 16:37:09 +02:00
Khaled Hosny
18236ca91d
Merge pull request #2440 from dscorbett/dedupe-buildCoverage
...
[otlLib] Remove duplicates when building coverage
2021-11-18 15:36:37 +02:00
Simon Cozens
e0dc30aa2d
[docs] Improve documentation for fontTools.ttLib.ttFont ( #2442 )
2021-11-18 13:06:02 +00:00
Simon Cozens
af9dfc94e7
Forbid empty classes (take 2) ( #2446 )
2021-11-18 11:31:49 +00:00
Simon Cozens
00f37ea6b6
[docs] Split table docs into individual pages ( #2444 )
2021-11-18 09:01:27 +00:00
Khaled Hosny
753a841de6
[merge] Minor and comment
2021-11-17 21:03:52 +02:00
Khaled Hosny
6acf76996e
[merge] Don’t process CFF before all other tables
...
I don’t know why this code was there, but my tests make no difference
with or without it.
2021-11-17 21:03:52 +02:00
Khaled Hosny
a53ded3b31
[merge] Don’t create TTFont then throw it away
...
The font is opened later, so use that.
2021-11-17 21:03:52 +02:00
Khaled Hosny
5299a3cb83
[merge] Simplify renaming CFF CharStrings
2021-11-17 21:03:52 +02:00
Khaled Hosny
8e9ab24c11
[cffLib] Move desubroutinize from subset module to CFFFontSet
...
This way we can use it from both subset and merge modules.
2021-11-17 21:03:49 +02:00
Cosimo Lupo
e5e69852ed
merge: various cleanups (WIP)
2021-11-17 21:03:12 +02:00
Cosimo Lupo
a75e01204d
Revert "Revert "Merge pull request #1289 from BlackFoundry/master""
...
This reverts commit 6deeb70acbe8f75dba29f1ea8c8d2cd6842bcbdc.
2021-11-17 21:03:12 +02:00
Cosimo Lupo
f15ed2dab0
Merge pull request #2448 from verbosus/checksum-comment
...
Removed comment about missing “start” optional argument to `calcChecksum`
2021-11-16 17:25:57 +00:00
Cosimo Lupo
9abfc00b71
Merge pull request #2452 from fonttools/subset-svg
...
Add support for subsetting OT-SVG table
2021-11-16 17:14:04 +00:00
Cosimo Lupo
247fa84b98
only rename glyph element ids when clash actually occurs
2021-11-16 14:28:14 +00:00
Cosimo Lupo
155ff60797
use any([<list comprehension>]) to avoid short-circuit function with side effect
2021-11-16 14:06:24 +00:00
Cosimo Lupo
dbcb9d6cee
parametrize test_subset_single_glyph_per_svg, as per review
2021-11-16 14:06:24 +00:00
Cosimo Lupo
07455790b1
simplify ranges() generator
2021-11-16 14:06:24 +00:00
Cosimo Lupo
66ec30c073
subset/svg: decorate xpath with lru_cache
2021-11-16 14:06:24 +00:00
Cosimo Lupo
d45da5df4c
factor out method to resolve href targets as per review
2021-11-16 12:27:12 +00:00
Cosimo Lupo
27e4052380
encode bytes before fromstring; decode to str after tostring
...
when decompiled from binary, the SVG.docList contains (unicode) strings, decoded as UTF-8. lxml fromstring accepts either bytes or str, but when given str with the xml header declaring an explicit encoding, it rejects them (since the header is lying). So we encode to bytes before calling fromstring in case the SVG contains an explicit encoding (UTF-8 is the only one allowed anyway). When serializing to XML with tostring, we similarly decode to str as UTF-8. Not only to match SVG decompile (which gives us str), but if we didn't do that, then attempting to dump to XML would fail, because XMLWriter.writecdata expects str, not bytes.
2021-11-15 19:06:38 +00:00
Cosimo Lupo
1d19cc6e23
add comment for reason not to short-circuit with any()
2021-11-15 18:17:19 +00:00
Cosimo Lupo
12ed8b752c
simplify and do el.attrib.get('id') as per review
2021-11-15 17:46:42 +00:00
Cosimo Lupo
92470ea361
rename parmeter ids => retained_ids for clarity as per review
2021-11-15 17:41:42 +00:00
Cosimo Lupo
863c9de57c
subset/svg_test: test more complex document with cross-references
2021-11-15 17:08:55 +00:00
Cosimo Lupo
a7216ae766
subset: drop svg doc if subsetted to empty
2021-11-15 17:08:55 +00:00
Cosimo Lupo
d1f2481fa0
fix invalid escape sequence in GID_RE pattern
2021-11-15 17:08:55 +00:00
Cosimo Lupo
361544ffe2
bump lxml==4.6.4 version to latest
2021-11-15 17:08:55 +00:00
Cosimo Lupo
a79106d09a
add simple subset/svg_test.py
2021-11-15 17:08:55 +00:00
Cosimo Lupo
a4df567718
subset/svg: support resolving cross-references and pruning elements
...
With this I can finally follow xlink:href and url(#...) sort of
references within the SVG doc and subset the elements accordingly so
that only those that are reachable from the initial set of glyph
elements are kept.
2021-11-15 16:07:18 +00:00
Cosimo Lupo
05e6d577cd
subset: add --pretty-svg option to enable lxml pretty_print
...
False (more compact) by default
2021-11-15 16:07:18 +00:00
Cosimo Lupo
0dc2be3e78
require lxml to subset SVG
...
support for namespaces and xpath is insufficient in built-in ElementTree; supporting both lxml and ElementTree is too complicated, let's simply require lxml to be able to subset SVG for now
2021-11-15 16:07:18 +00:00
Cosimo Lupo
d44af9f2d7
basic subset.svg impl that simply remaps id='glyphXXX'
...
this drops svg document records when they no longer intersect the subset. It keeps them in their entirety (for now) when they still intersect the subset, only renaming all the id='glyphXXX' to point to the new glyph indices after subsetting. Unused, unreferenced elements are not pruned yet.
2021-11-15 16:07:18 +00:00
Cosimo Lupo
16249d1fb8
subset: store original glyphOrder and map from old to new indexes in Subsetter instance
...
so that SVG tables' subset_glyphs method can use it to get glyph names from GISs and to remap from old to new GIDs
2021-11-15 16:07:18 +00:00
Cosimo Lupo
bd47bdae97
subset: don't drop SVG table, add WIP subset/svg.py stub
...
simply pass-through for now
2021-11-15 16:07:18 +00:00
Cosimo Lupo
425e1afd36
subset: move _add_method and _uniq_sort to subset/util submodule
2021-11-15 16:07:18 +00:00
Cosimo Lupo
0dc2f820bd
cu2qu/cli: latest ufoLib2 no longer does Font(path); must use Font.open(path)
...
https://github.com/fonttools/fonttools/runs/4211314586?check_suite_focus=true#step:5:598
2021-11-15 12:22:33 +00:00
Cosimo Lupo
2e6b010834
Update requirements.txt
2021-11-15 12:06:51 +00:00
Antonio Cavedoni
e3338bc837
Removed comment about missing “start” optional argument to calcChecksum
2021-11-11 10:09:19 +01:00
Simon Cozens
b29ae8003b
[docs] Add interrogate configuration ( #2443 )
2021-11-10 10:55:06 +00:00
Cosimo Lupo
8c6930810b
Bump version: 4.28.1 → 4.28.2.dev0
2021-11-08 12:51:44 +00:00
Cosimo Lupo
497c449db1
Release 4.28.1
2021-11-08 12:51:44 +00:00
Cosimo Lupo
e605706c07
Update NEWS.rst [skip ci]
2021-11-08 12:50:41 +00:00
Cosimo Lupo
8d6a7617a2
minor: fix 4-space indentation from PR 2441
2021-11-08 12:27:26 +00:00
Cosimo Lupo
de58709fd3
Merge pull request #2441 from fonttools/i2438
...
Traverse when there is no layer list
2021-11-08 12:24:13 +00:00