Behdad Esfahbod
6bac64ff9f
[scale-upem] Implement vhea
2022-08-15 14:25:15 -06:00
Behdad Esfahbod
ec2919cc34
[scale-upem] Implement GDEF
2022-08-15 14:21:31 -06:00
Behdad Esfahbod
c588b2d5b3
[scale-upem] Scale GPOS using register_attrs as well
2022-08-15 14:19:26 -06:00
Behdad Esfahbod
3a6fa9812d
[scale-upem] Implement ItemVariationStore
2022-08-15 14:09:13 -06:00
Behdad Esfahbod
f360cf92ec
[Snippets/scale-upem] Implement gvar scaling
2022-08-15 14:03:42 -06:00
Behdad Esfahbod
ef1a009bea
[visitor] Fix up attrs visiting
2022-08-15 13:59:05 -06:00
Behdad Esfahbod
24d63d068e
[scale-upem] Take scale-factor from command-line
2022-08-15 13:36:28 -06:00
Behdad Esfahbod
f582469cb8
[visitor] Split TTVisitor into its own module
2022-08-15 13:01:46 -06:00
Behdad Esfahbod
61d651e387
[scale-upem] Implement kern table
2022-08-15 12:56:38 -06:00
Behdad Esfahbod
d9338ea539
[Snippets] Rename scale-font.py to scale-upem.py
2022-08-15 12:52:08 -06:00
Behdad Esfahbod
fcc4a875dd
Rename visitor_test to Snippets/scale-font.py
2022-08-15 12:51:07 -06:00
Dave Crossland
1904041dc3
Update Snippets/README.md
2022-01-06 16:24:46 -05:00
Khaled Hosny
232b2ccbc4
Move the rest of py23 module to textTools
...
Change all imports to use textTools module, except the test_py23.py test
which is kept until we decide to remove the module (if ever).
2021-08-20 01:29:45 +02:00
Khaled Hosny
000bf81700
Default to "\n" for newlinestr instead of None
...
If newlinestr is None, os.linesep is used, bu it is the third millennium
and we don’t need or want different line endings per-platform.
2021-07-30 04:12:33 +02:00
Jany Belluz
016aa4cccc
Add docstring to snippet
2021-07-05 17:28:44 +01:00
Jany Belluz
bba5e8b213
Add optional compaction of GPOS PairPos subtables in otlLib.optimize.gpos
...
See pull request: https://github.com/fonttools/fonttools/pull/2326
The new module `otlLib.optimize.gpos` provides `compact` functions that
can reduce the file size of GPOS PairPos lookups by splitting subtables
in a smart way to avoid storing zero-valued pairs.
The compaction methods are called from `otlLib.builder` and
`varLib.merger` so that static and variable fonts can benefit from the
optimization at compile time.
The new module `otlLib.optimize` is also executable, to allow running
the optimization on existing fonts.
The optimization is a trade-off because on the one hand it can reduce
significantly the byte size of the GPOS table (up to 50% in random
Google Fonts) but on the other hand it adds to the compilation time and
may make fonts very slightly bigger once compressed to WOFF2 (because
WOFF2 doesn't mind about zero values and compresses them very well).
As such, the optimization is off by default, and you can activate it by
providing the environment variable `FONTTOOLS_GPOS_COMPACT_MODE=5` for
example (values from 0 = off to 9 = max file size savings, but many more
subtables).
2021-07-05 17:28:43 +01:00
Just van Rossum
5fc65d7168
Misc py23 cleanups ( #2243 )
...
* Replaced all from ...py23 import * with explicit name imports, or removed completely when possible.
* Replaced tounicode() with tostr()
* Changed all BytesIO ans StringIO imports to from io import ..., replaced all UnicodeIO with StringIO.
* Replaced all unichr() with chr()
* Misc minor tweaks and fixes
2021-03-29 11:45:58 +02:00
Cosimo Lupo
3ad201cbe5
Snippets/decompose-ttf: remove overlaps with skia-pathops
2020-07-23 11:19:45 +02:00
justvanrossum
39301b235a
whitespace
2020-07-23 07:12:34 +02:00
justvanrossum
2bc53e75ad
add hashbang and comment; add +x mode
2020-07-23 07:11:11 +02:00
justvanrossum
a95aace05e
add snippet that shows how to decompose glyphs in a TTF
2020-07-23 07:07:01 +02:00
Zachary Scheuren
c88be61b1f
In otf2ttf conversion update LSB in hmtx to match xMin
2020-04-06 09:46:20 -07:00
Cosimo Lupo
7d59ccbed6
Snippets/otf2ttf: use fontTools.pens.cu2quPen
2020-03-31 17:26:53 +01:00
ln_north
9a49b01ec1
fix requirements in svg2glif.py
...
- Remove unused `ufoLib` package
- FontTools => fontTools
2019-12-10 09:39:53 +09:00
Cosimo Lupo
cfc5b44c65
change all scripts' shebangs to use python3
2019-12-05 15:28:19 +00:00
Nikolaus Waxweiler
01328213c7
Remove __future__ imports
2019-08-09 12:20:13 +01:00
Cosimo Lupo
b324839eeb
Snippets: remove woff2_{,de}compress.py; superseded by fonttools ttLib.woff2
2019-06-14 18:30:33 +01:00
Cosimo Lupo
ba41877d10
Snippets/woff2_compress: add --hmtx-trasform option; use argparse
2019-06-13 18:07:14 +01:00
Cosimo Lupo
5d7e750b69
Snippets/woff2_compress: add --disable-transforms option
2019-06-11 15:13:09 +01:00
Cosimo Lupo
67fe931f15
Snippets/svg2glif: import internal copy of glifLib and pointPen modules
2019-02-22 11:08:40 +00:00
Chris Simpkins
1c0a55905b
[Snippets] added usage documentation as a Markdown block in the notebook
2019-01-29 23:55:51 -05:00
Chris Simpkins
33b03e3edd
[Snippets] add name-viewer.ipynb jupyter notebook
2019-01-29 23:30:49 -05:00
Miguel Sousa
fdc4bb7354
otf2ttf. Add option to overwrite existing files
2018-10-10 18:13:02 -07:00
Miguel Sousa
75e3546b3c
otf2ttf. Support multiple input files
2018-10-10 18:01:38 -07:00
Khaled Hosny
24226fd592
Put back __future__ import
2018-10-09 18:43:34 +02:00
Khaled Hosny
e1047a3177
Sort imports
...
Also remove unused __future__ imports.
2018-10-09 17:25:40 +02:00
Khaled Hosny
13de4f30c2
[Snippets] Improve otf2ttf.py post table message
2018-10-09 17:25:40 +02:00
Khaled Hosny
5ad27dfb40
[Snippets] Handle post table overflow in otf2ttf.py
...
Fixes https://github.com/fonttools/fonttools/issues/1329
2018-10-09 17:25:40 +02:00
Khaled Hosny
c9f79af8ce
[Snippets] Allow otf2ttf.py to take in TTC fonts
...
Processes individual faces only, though. No support for writing out font
collections.
2018-10-09 17:25:40 +02:00
Cosimo Lupo
80bfc3ccd5
Snippets: add rename-fonts.py to append a suffix to all family names
2018-06-05 21:41:11 +01:00
Cosimo Lupo
299320d0b1
Snippets/layout-features.py: allow to load from ttx file
2018-05-23 11:50:40 +01:00
Chris Simpkins
53117bcf88
[checksum.py] added description string, corrected file path description
2018-02-26 17:58:12 -05:00
Chris Simpkins
db38156b91
[checksum.py] fixed incorrect variable name in stderr message
2018-02-25 19:35:06 -05:00
Chris Simpkins
d8e5f5cc37
removed header text
2018-02-25 19:32:20 -05:00
Chris Simpkins
362db5c99a
[checksum.py] added file path documentation to source header
2018-02-25 12:06:12 -05:00
Chris Simpkins
0f49e20675
[Snippets/checksum.py] adds checksum.py script for SHA1 hash checksum list generation from font binaries or ttx XML OT table dumps from font files, and checksum testing against valid checksum files
2018-02-24 21:43:59 -05:00
Jens Kutilek
b09c2e0d2b
Add b to bytes
2018-01-09 16:13:35 +01:00
Jens Kutilek
0cae12bdbd
Add snippet manipulating raw table data
2018-01-09 11:18:01 +01:00
Cosimo Lupo
eab152e297
[Snippets] add script to convert SVG outlines to UFO GLIF
...
(requires ufoLib)
2017-09-12 23:09:31 -04:00
Khaled Hosny
7bea4c66c6
Add a snippet to remove LangSys from DFLT script
...
Such fonts violate the spec and OTS rejects them, this snippet should
help quickly fixing such fonts.
2017-06-23 02:46:33 +02:00