1769 Commits

Author SHA1 Message Date
Just van Rossum
0ffe320b77 [cmap] don't handle expected case in exception handler, to avoid confusing tracebacks, such as seen in #2584 2022-04-18 09:15:01 +02:00
Cosimo Lupo
e92dd05101
Merge pull request #2552 from qxliu76/add_hb_repack
Use Harfbuzz Repacker for packing GSUB/GPOS tables
2022-04-14 20:03:18 +01:00
Qunxin Liu
fe196bf88e Use Harfbuzz Repacker for packing GSUB/GPOS tables 2022-04-14 10:42:50 -07:00
Jany Belluz
abc0441957 [config] Add new config module and use it for GPOS compression level 2022-04-14 15:23:02 +01:00
justvanrossum
c6cd6cf421 [TTFont] sync doc string with the one in _c_m_a_p.py (see also #1367) 2022-04-09 08:31:03 +02:00
Behdad Esfahbod
17f71c0eb7 [cmap] Document rationale for getBestCmap choice of subtable
Fixes https://github.com/fonttools/fonttools/issues/1367
2022-04-08 13:27:44 -06:00
justvanrossum
9ffb2e0f75 removed cringy comments from a long long long long time ago 2022-04-05 17:02:34 +02:00
Cosimo Lupo
25746a3600 add clarifying comment as per review 2022-03-18 09:23:07 +00:00
Cosimo Lupo
ab8fc321a7 otBase: also return name and index from iterSubTables
makes it more useful for constructing generic traversals of trees of otTables
2022-03-17 17:47:41 +00:00
Cosimo Lupo
43d2ee2822 Revert "return self so one can do font=TTFont(file).ensureDecompiled()"
This reverts commit 61e7b294483cbe729b1437804406b4571ae57cfb.
2022-03-17 15:55:20 +00:00
Cosimo Lupo
61e7b29448 return self so one can do font=TTFont(file).ensureDecompiled() 2022-03-17 15:44:02 +00:00
Cosimo Lupo
46f33357cb TTFont: don't load all tables upon opening even with lazy=False
one has to call TTFont.ensureDecompiled to load everything
2022-03-17 13:48:40 +00:00
Cosimo Lupo
795bccd966 TTFont: load all on open w/ lazy=False; add ensureDecompiled
Make lazy=False actually do what it says, 'load everything eagerly'. It feels weird that one has to, not only say, open with lazy=False, but also have to load each tables individually... Didn't I say don't be lazy?!

Also it can be useful to get to a eager, non-lazy font whether or not it was originally loaded lazily, so I added an ensureDecompiled method that decompiles all the tables and calls ensureDecompiled for those (e.g. cmap, glyf and otData-driven tables like GSUB, GPOS, etc.) that respect the lazy attribute.
2022-03-17 13:01:22 +00:00
Cosimo Lupo
ee27b73d7c BaseTTXConverter: add ensureDecompiled method
to unlazify a whole tree of otTables, recursively
2022-03-17 12:54:22 +00:00
Cosimo Lupo
64dc37fc01 otBase: add iterSubTables method to iterate over all BaseTables
can be useful to traverse a tree of otTables
2022-03-17 12:53:06 +00:00
Cosimo Lupo
7f1e5e1fc7 glyf: add ensureDecompiled method
to 'expand' all the lazy glyphs
2022-03-17 12:51:56 +00:00
Cosimo Lupo
4119d8f582 cmap: if lazy=False, decompile all cmap subtables upfront
previously cmap was completely ignoring lazy attribute, always loading lazily
2022-03-17 12:46:57 +00:00
Cosimo Lupo
83ee6bcdab ttCollection: don't close file inside init if lazy=True
Fixes 'seek of closed file' error #2549
2022-03-17 12:30:40 +00:00
Cosimo Lupo
71a5bf1b51
Merge pull request #2544 from fonttools/set-glyf-glyph-order
Also update glyf's glyphOrder when calling TTFont.setGlyphOrder()
2022-03-14 17:11:57 +00:00
Cosimo Lupo
c08bfc1e1a ttCollection: fix 'ResourceWarning: unclosed file'
Thanks Mike L.
2022-03-10 18:12:23 +00:00
Cosimo Lupo
3529a44f75 Update glyf's glyphOrder when calling TTFont.setGlyphOrder()
https://github.com/fonttools/fonttools/issues/2060#issuecomment-1063932428
2022-03-10 11:29:17 +00:00
Olli Meier
5986107b43 based on feedback: Change name and add comments. 2022-02-09 17:57:55 +01:00
Olli Meier
8dddbf4a61 refactor based on feedback. 2022-02-09 17:48:51 +01:00
Olli Meier
1649973800 Make use of 'Best' in names 2022-02-09 17:44:28 +01:00
Olli Meier
6d05b938be fix typo 2022-02-09 17:40:28 +01:00
Olli Meier
79360a30bf Refactor based on feedback. 2022-02-09 17:34:40 +01:00
Olli Meier
c50f38ed0e extend name table with getFamilyName, getSubFamilyName and getNiceFullName + unittests 2022-02-09 17:06:02 +01: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
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
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
Simon Cozens
e0dc30aa2d
[docs] Improve documentation for fontTools.ttLib.ttFont (#2442) 2021-11-18 13:06:02 +00:00
Simon Cozens
00f37ea6b6
[docs] Split table docs into individual pages (#2444) 2021-11-18 09:01:27 +00:00
Antonio Cavedoni
e3338bc837 Removed comment about missing “start” optional argument to calcChecksum 2021-11-11 10:09:19 +01:00
Rod S
7dd3488732 Traverse when there is no layer list 2021-11-06 14:26:27 -07:00
Cosimo Lupo
11c98b04a5 SVG: don't write extra empty newline at beginning of SVG table
it serves no purpose.
2021-10-13 14:51:42 +02:00
Cosimo Lupo
2967f18e35 SVG: on compile reuse offsets when doc bytes are same
https://github.com/fonttools/fonttools/issues/534#issuecomment-934528761
2021-10-13 14:50:08 +02:00
Cosimo Lupo
be8d6e29d5 SVG: remove old deprecated version1 and embedded colorPalettes
Fixes https://github.com/fonttools/fonttools/issues/2426
2021-10-13 14:47:41 +02:00
Behdad Esfahbod
3eef446efe [ttFont] Address review comments 2021-08-23 16:06:18 -06:00
Behdad Esfahbod
ca06c9530c [ttFont] Assume GlyphOrder is never modified after setting
See https://github.com/fonttools/fonttools/pull/2398#discussion_r694271551
2021-08-23 14:59:11 -06:00
Behdad Esfahbod
d5de11d805 [ttFont] Make setGlyphOrder() clear reverseGlyphOrderMap
Part of https://github.com/fonttools/fonttools/pull/2398
2021-08-23 14:01:26 -06:00
Behdad Esfahbod
e5bf2a7f1a [ttFont] Apply review comments 2021-08-22 04:09:29 -06:00
Behdad Esfahbod
7a22c0fb07 [ttFont] Add getGlyphIDMany(); use in otLayout
Fixes https://github.com/fonttools/fonttools/issues/1536
Superced https://github.com/fonttools/fonttools/pull/1654

Part of https://github.com/fonttools/fonttools/pull/2398
2021-08-21 11:23:11 -06:00
Behdad Esfahbod
3ec769907b [ttFont] Add getGlyphNameMany()
Part of fixing https://github.com/fonttools/fonttools/pull/1654
Related https://github.com/fonttools/fonttools/issues/2334
2021-08-20 16:17:48 -06:00
Behdad Esfahbod
322a7b2ead [ttFont] Remove allowVID
Leave the parameter intact for back compat.

Part of https://github.com/fonttools/fonttools/pull/2398
Fixes https://github.com/fonttools/fonttools/issues/2334
2021-08-20 10:01:51 -06:00
Behdad Esfahbod
9988054f3c [ttFont] Remove requireReal
To my knowledge this is not used by anyone.

See https://github.com/fonttools/fonttools/issues/2334#issuecomment-902789001
2021-08-20 09:59:47 -06:00