107 Commits

Author SHA1 Message Date
Nikolaus Waxweiler
01328213c7 Remove __future__ imports 2019-08-09 12:20:13 +01:00
Cosimo Lupo
7a2fea9843
[ttx] should also white-list 'no-recalc-timestamp' for getopt to work
aargh..

Follow up from #1455
2019-01-17 15:02:01 +00:00
Cosimo Lupo
0e47ea1fac
[ttx] add --no-recalc-timestamp option to keep original head.modified
Fixes #46
2019-01-17 13:26:59 +00:00
Mickaël Schoentgen
52e855e4a4 Use the 'with' context manager when dealing with files 2018-10-01 08:42:45 +02:00
Chris Simpkins
267d314233 [ttx] remove unreachable code 2018-05-21 23:50:26 -04:00
Bill Amidei
abed27fd8c
Update for UFO naming of glyph files and make -g ttx parameter force -s 2018-02-28 11:29:33 +00:00
Cosimo Lupo
232e2b8467
Revert "Merge pull request #1130 from anthrotype/temp-revert-split-glyphs"
This reverts commit 060f856f92e0fb2d8e60f6be080c89c08528bacb, reversing
changes made to 1e42224af741fac73e20f7193d8115cfda7d3594.
2018-02-28 11:24:19 +00:00
justvanrossum
ce639f0064 increase the width of the length and offset fields by one, to accommodate sizes and offsets in the 10s of megabytes. 2018-02-13 11:21:16 -08:00
Cosimo Lupo
56a84ae905 Temporarily revert PR #1035 bamidei/split_g_l_y_f_to_one_per_file
The split-glyf-to-one-glyph-per-file feature is only partially implemented,
as it was discussed here:

https://github.com/fonttools/fonttools/issues/153#issuecomment-346677171

I need to cut a bugfix release today, but I don't want to ship this as is.
I prefer to temporarily rever, tag a release from master branch, then
revert it again to its present state so that bamidei can complete his
work.

---

Revert "[glyf] make splitGlyphs output more compact"

This reverts commit d08d635a93289982b028aacd3b9039fbe742f3e8.

Revert "more whitespace"

This reverts commit bd030f61c6b360fd360632bbc6c19abb057c9a24.

Revert "minor whitespace"

This reverts commit f2a8c787b13b92ae0e0f61477e584316144747c7.

Revert "Merge pull request #1035 from bamidei/split_g_l_y_f_to_one_per_file"

This reverts commit 17b89d9dde7691dbbb6815efba92eff446af62ac, reversing
changes made to b8482d9666f08d3603ee93d3ca52931550f715fc.
2017-12-18 12:00:43 +00:00
Cosimo Lupo
f2a8c787b1 minor whitespace 2017-11-23 18:39:11 +01:00
Bill Amidei
feb4c0d2ed Another white-space update to align 2017-11-23 07:53:07 -08:00
Bill Amidei
818a4a2d1e Review comment update: Updated white-space and removed unused test data 2017-11-23 07:51:05 -08:00
Bill Amidei
b5edc7e9f5 Add ability to split glyphs to 1 glyph per ttx file. Addresses Issue #153 2017-08-23 12:33:25 -07:00
Cosimo Lupo
ae89c0d5ca [ttx] drop the 'n' from "an TTX" 2017-07-25 20:35:55 +01:00
Cosimo Lupo
2d9ca0b2bd [ttx] remove mention to otf2ttf.py Snippet from help message
https://github.com/fonttools/fonttools/pull/1016#issuecomment-317847536
2017-07-25 20:33:41 +01:00
Dave Crossland
32fa8bc86b ttx.py Clarify help text
Confusion reported at https://groups.google.com/forum/#!topic/fonttools/7ocZWHbsCLw
2017-07-25 11:16:47 -04:00
justvanrossum
a785f72367 Applying the super useful padding of short table tags such as 'CFF' to the '-x' option, too. 2017-06-07 11:47:11 +02:00
Miguel Sousa
ddf9f2334b [ttx] unnecessary lower()
Valid XML files always start with a lowercase declaration
187b886fde (commitcomment-21508520)
2017-03-28 03:43:01 -07:00
Miguel Sousa
fefe5d5c46 [ttx] Strip the BOM only in XML files 2017-03-28 03:43:01 -07:00
Miguel Sousa
076e2ba33a [ttx] Close file before returning, to prevent ResourceWarnings in py3 2017-03-28 03:43:01 -07:00
Miguel Sousa
4fce7a0b7b [ttx] Strip BOM from beginning of file
Fixes #896
2017-03-28 03:43:01 -07:00
Cosimo Lupo
46d487c728
the Zopfli bindings are finally available from PyPI, change url in the docstring 2017-03-01 14:01:15 +00:00
Cosimo Lupo
ee4f4695e6
[ttx] ignore missing 'head' if no --recalc-timestamp option is passed 2017-02-28 22:54:30 +00:00
Cosimo Lupo
8af488a1b3
Revert "explicitly require 'head' table in TTFont.save()"
This reverts commit b39f3b613c861539f9ae6e18f5064979f7ad6365.

Requiring 'head' makes it hard to build partial fonts

See https://github.com/fonttools/fonttools/pull/854#issuecomment-283177719
2017-02-28 22:48:28 +00:00
Cosimo Lupo
b39f3b613c
explicitly require 'head' table in TTFont.save()
it's implicitly required anyway, e.g. by ttx's ttCompile, maxp's recalc, OS/2 compile, etc.
2017-02-21 12:57:34 +00:00
Cosimo Lupo
ff247f9be4
[ttx] fix typo in --help 2017-01-18 12:01:32 +00:00
Cosimo Lupo
a0e74f7e69
move ttx.makeOutputFileName to new misc.cliTools module
so it can be reused for other console scripts
2017-01-13 11:16:01 +00:00
Cosimo Lupo
b7bb391033
don't use sys.exit(...) inside main(), but only under if __name__ == "__main__"
The convention is that sys.exit(...) is called only if a module is run as a script,
and that main() entry points use return statements to report exit codes: 0 (or None)
for successful execution, or any non-zero integer for errors.

E.g. see the console scripts generated when installing with pip.
2017-01-11 12:10:58 +00:00
Cosimo Lupo
ae05b2a583
[logging] for runnable modules, spell out module name instead of using __name__
If a module is run as script, as in `python module.py` or when using
`runpy.run_module()`, then __name__ == "__main__".

So when we instantiate modules' loggers with `logging.getLogger(__name__)`,
those loggers' name may become "__main__" when run as scripts, and hence
fall outside of the "fontTools" logging namespace.

fontTools.configureLogger() by default only configures the "fontTools"
library loggers, anything outside of it (e.g. logger called "__main__")
is not attached a handler.

So here I name loggers explicitly instead of relying on __name__, but
only for modules which can be run as "__main__".

Fixes #801
2017-01-11 11:58:17 +00:00
Cosimo Lupo
ce609addd0 [ttx] add --newline option to explicitly control line endings 2016-10-20 17:22:12 +01:00
Cosimo Lupo
b1fae3fe32 ttx/ttLib: use from fontTools import version as before 2016-10-10 15:26:04 +01:00
Cosimo Lupo
33fb81a282 [ttx] add --version option that prints fontTools.version.__version__ 2016-09-27 00:40:33 +01:00
Cosimo Lupo
3c187c590a [ttx] minor: don't suppress SystemExit on win32 platform 2016-03-30 14:56:40 +01:00
Cosimo Lupo
d8004de04c [ttx] remove redundant continue in parseOptions loop
`git blame` says that was my fault:
e5b6be00a0 (diff-fce6b83de86f2e83411202adc745ffb2R316)

Ouch.
2016-03-28 18:07:59 +02:00
Cosimo Lupo
94976c01a1 [ttx] add --with-zopfli option 2016-01-31 14:20:17 +00:00
Cosimo Lupo
e5b6be00a0 [ttx] replace print with logger; make -v and -q mutually exclusive; don't use deprecated 'verbose' and 'quiet' arguments
The default logger level for TTX is set to logging.INFO. Anything equal or above that level
will be logged. Anything below that will not.
If the -v option is passed, the threshold is lowered to logging.DEBUG.
If the -q option is passed, the threshold is increased to logging.WARNING.
2016-01-27 19:02:48 +00:00
Miguel Sousa
d1a1f1dc69 [ttx] minor addition to options' info 2016-01-24 18:42:41 -08:00
Miguel Sousa
a45a149b21 [ttx] don't print error when command is 'ttx -h' 2016-01-24 18:39:53 -08:00
Cosimo Lupo
e12aec52ed ttx: use ljust to pad tags with space (more Pythonic)
as suggested by @adrientetar
2015-12-08 12:45:22 +00:00
Cosimo Lupo
79c2b8cbc1 ttx: pad tags with space if length is less than 4
so that you don't need to do `-t "CFF "` anymore.

Fixes https://github.com/behdad/fonttools/issues/265
2015-12-08 10:11:26 +00:00
Cosimo Lupo
e5b67b2451 [ttx] raise GetoptError and print messages to sys.stderr 2015-09-09 13:13:17 +01:00
Cosimo Lupo
27e31e7e22 [ttx] add --flavor option for compiling to 'woff' or 'woff2' 2015-09-09 13:00:35 +01:00
Cosimo Lupo
867ad325bf [ttx] add support for dumping WOFF2 fonts to TTX 2015-08-07 18:23:41 +01:00
Cosimo Lupo
7fffdb8815 [ttx] don't create output file if action is 'ttList' 2015-06-23 11:15:56 +01:00
Behdad Esfahbod
a7e1524d2a Merge pull request #278 from anthrotype/timestamp
[ttx] use TTX mtime for 'modified' (default), optionally "--recalc-timestamp"
2015-06-16 15:12:12 -07:00
Cosimo Lupo
eae49fd67c [ttx] use TTX file modification time for the font 'modified' (default) 2015-06-16 22:44:57 +01:00
Behdad Esfahbod
82b19a0d08 Merge pull request #279 from anthrotype/racecondition
[ttx] 'touch' output file to avoid race condition in choosing file names
2015-06-15 15:36:30 -07:00
Cosimo Lupo
1d510c61a2 [ttx] 'touch' output file to avoid race condition in choosing file names
Fixes https://github.com/behdad/fonttools/issues/45
2015-06-13 22:42:10 +01:00
Cosimo Lupo
291b41a13c [ttx] add option to provide custom UnicodeData.txt
Fixes https://github.com/behdad/fonttools/issues/82
2015-05-23 18:56:33 +01:00
Cosimo Lupo
175a16209c [setup.py] use setuptools if available, or fall back to distutils
modify scripts to work as setuptools 'console_scripts', where the main
function takes no arguments;
add empty identifier "" in 'packages' argument of setup, to install the
standalone sstruct.py and xmlWriter.py for legacy support;
remove py2exe since it is made redundant by setuptools 'console_scripts';
remove custom 'build_ext' command since the eexecOpmodule.c is no longer
present.
2015-05-20 11:02:43 +01:00