5566 Commits

Author SHA1 Message Date
Behdad Esfahbod
40f9e2cdc4 [merge] Move layout code into merge.layout 2021-12-16 08:47:44 -07:00
Behdad Esfahbod
eaaeb7ab28 [merge] Move most tables into merge.base module 2021-12-16 08:41:14 -07:00
Behdad Esfahbod
bb1e1bdf98 [merge] Split some code into merge.util 2021-12-16 08:37:36 -07:00
Behdad Esfahbod
3eff0a47e4 [merge] Move code into module directory 2021-12-16 08:26:56 -07:00
Behdad Esfahbod
d2983cce51 [merge] Add --drop-tables 2021-12-16 08:18:46 -07:00
Behdad Esfahbod
584c748951 [merge] Downgrade duplicates-resolution missing-GSUB from assert to warn 2021-12-16 08:18:46 -07:00
Behdad Esfahbod
31dcd03bff [merge] Ignore shape of Default_Ignorable glyphs
Data should be moved to unicodedata module eventually.
2021-12-16 08:13:28 -07:00
Behdad Esfahbod
2e4b8cea59 [merge] Show tolerance re glyph comparison for empty glyphs' width 2021-12-16 08:09:28 -07:00
Behdad Esfahbod
b63f6413ca [merge] Remove _glyphsAreSame() check
This was removing semantically-significant difference amongst glyphs
such as two identical glyphs one in Noto Sans Tamil one in Noto Sans
Grantha as in the following issue:

Part of fixing https://github.com/fonttools/fonttools/issues/2475
2021-12-16 08:03:38 -07:00
Behdad Esfahbod
672b4032ad [merger] Fix duplicate-glyph-resolution GSUB-lookup generation code
Part of fixing https://github.com/fonttools/fonttools/issues/2475

Old code was mistakenly only adding the synthetic-generated feature
to the first language-system. In the case of merging Noto Grantha
and Noto Tamil fonts, Noto Tamil had two script systems: 'taml' and
'tml2', and we were adding the synthetic 'locl' feature only to the
DefaultLangSys of the 'taml' script, not the 'tml2' script. That was
the main bug.

A second issue was that the lookup was being added twice to the same
(synthetic) feature. Check before adding lookup, to avoid that.
2021-12-16 08:03:38 -07:00
Cosimo Lupo
22266631d9 plistlib: fix PlistEncodable typing annotations to appease mypy
https://github.com/fonttools/fonttools/runs/4545664923?check_suite_focus=true#step:5:12
2021-12-16 10:24:49 +00:00
Behdad Esfahbod
1b8f16b11f [merge] Remove obsolete comment 2021-12-15 20:54:45 -07:00
Behdad Esfahbod
4de9ffcdd5 [merge] Move CFF.desubroutinize to proper place 2021-12-15 20:53:29 -07:00
Cosimo Lupo
1355769766 Bump version: 4.28.4 → 4.28.5.dev0 2021-12-15 17:23:21 +00:00
Cosimo Lupo
071ea963d4 Release 4.28.4 2021-12-15 17:23:20 +00:00
Cosimo Lupo
5af9c74cad
Merge pull request #2471 from fonttools/svg-pen-round
svgPathPen: add option to customize number formatting (e.g. rounding)
2021-12-15 16:39:48 +00:00
Cosimo Lupo
fe2ba42811
Merge pull request #2467 from aschmitz/subset-hotspots
subset: speed up subsetting of large fonts
2021-12-15 16:34:02 +00:00
Behdad Esfahbod
b8615f9de6 [merge] Merge GDEF marksets in Lookups properly 2021-12-15 09:21:16 -07:00
Simon Cozens
ed07df39da
Die noisily (#2472) 2021-12-14 19:26:50 +00:00
Cosimo Lupo
fce1fa2da8 svgPathPen: add option to customize number formatting (e.g. rounding)
Using a RoundingPen as a filter doesn't work for TrueType quadratic splines (qCurveTo), because the rounding would occur too early, before these get split into atomic quadratic Bezier segments (by the superclass BasePen.qCurveTo method), thus leaving unwanted floating-point coordinates in the SVG output.
So here we add a 'ntos' parameter (by default simpli calls str()) that takes a Callable[[float], str] and can be used to customize the formatting of the numbers in SVG path coordinates.
2021-12-14 13:19:50 +00:00
Cosimo Lupo
d190a7c206 otTables: no need get LayerRecordCount by name, we already have it in scope
Fixes #2468
2021-12-13 11:17:08 +00:00
Khaled Hosny
6481cff159
Merge pull request #2464 from simoncozens/demystify-deduplication
Demystify deduplication
2021-12-12 22:13:31 +02:00
aschmitz
d9f9466d63 subset: speed up subsetting of large fonts
Two small changes that significantly speed up subsetting of large fonts
such as Noto Sans CJK:

1. When emptying a charstring, simply empty its program rather than
attempting to decompile it first. (Only relevant when retaining GIDs.)

2. When reindexing charstrings, swap an accidentally-quadratic
implementation for one that is linear in the number of retained glyphs.
2021-12-09 23:44:57 -06:00
Simon Cozens
fa0eae6658 Don’t put extension lookups into an extension lookup, obviously 2021-12-08 09:02:24 -07:00
Simon Cozens
f7b866573b Speculatively promote lookups to extension 2021-12-08 09:02:24 -07:00
Simon Cozens
c04639af70 Add comment to demystify deduplication 2021-12-06 11:15:12 +00:00
Cosimo Lupo
482a0b96de Bump version: 4.28.3 → 4.28.4.dev0 2021-12-03 11:52:50 +00:00
Cosimo Lupo
2d7b76aba3 Release 4.28.3 2021-12-03 11:52:49 +00:00
Cosimo Lupo
9b613b67c2
Merge pull request #2462 from fonttools/fix-subset-colr
subset/COLR: fix struct.error while subsetting Bungee COLR
2021-12-03 11:33:37 +00:00
Cosimo Lupo
780f2428b6 subset: when subsetting COLR only include glyphs after COLR closure, excluding glyf closure
Fixes #2461
2021-12-02 18:12:04 +00:00
Simon Cozens
3e0caa881e
[docs] Fully document the glyf table (#2457)
* Fully document the glyf table

* Correct docs for getGlyphName/getGlyphId

* Fix typo

* Grammar nits
2021-12-02 15:32:20 +00:00
Simon Cozens
f887389d59
[docs] Fully document the cmap table (#2454)
* Fully document the cmap table

* Try not to completely break cmap handling while writing docs, Simon
2021-12-02 15:32:03 +00:00
Simon Cozens
0f03e6529a
[docs] Fix sphinx warnings (#2453)
* Add default auto doc options

* Ensure all references are unique

* Use anonymous links to avoid duplicate references

* Remove default options, fix wrong module name

* Don’t index repeated class

* Remove repeated classes included through automodule

* Fix warnings

* We don’t use our own static directory

* Correctly format XML in docs

* Fix indentation

* Fix overline

* Bring TOC to top

* Fix definition list

* Offset definition lists and examples

* Fix erroneous markup

* Fix markup

* Already included in automodule

* Fix args markup

* Correct markup for example

* Don’t reindex repeated module

* Correct XML code block markup

* Fix markup errors, change example to doctest

* Correct list markup

* Make ttx docstring both valid RST and valid help output

* Various other boring markup fixes

* Fix example indenting

* Make docstring valid RST and valid help output

* Mock import for reportlab

* It’s ok if manual links don’t appear in toctrees

* Oops typo, I guess doctests are useful
2021-12-02 15:31:49 +00:00
Cosimo Lupo
180bb18673 colorLib.unbuilder: fix CLI by deleting no longer existing parameter 2021-11-25 15:01:19 +00:00
Khaled Hosny
bc6f748ee4 Bump version: 4.28.2 → 4.28.3.dev0 2021-11-22 02:18:37 +02:00
Khaled Hosny
5b62a8846f Release 4.28.2 2021-11-22 02:18:37 +02:00
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
40f82a8515 [merge] Support --output-file 2021-11-18 22:09:02 +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