78 Commits

Author SHA1 Message Date
Behdad Esfahbod
9d5a468781 [merge] Define lookup_id() and feature_id()
Prepare to merge ScriptRecords properly
2017-09-15 00:58:42 -04:00
Cosimo Lupo
a4861a16cc
use logging.warning() instead of deprecated logging.warn()
functionality is identical, the latter is deprecated:
https://docs.python.org/3/library/logging.html#logging.Logger.warning
2017-05-24 09:49:37 +01:00
Behdad Esfahbod
1f372cc8ed [merge] Add TODO item re merging duplicate items 2017-03-22 15:03:52 -07:00
Behdad Esfahbod
b73c61a3ab Revert "Revert "[merge] Fix for ClassDef.Format and Coverage.Format""
This reverts commit 7406e06aae34300cc2a17f990af5f33abc579afc.

Ouch. The revert of revert was not what I meant. :|
2017-03-08 12:49:56 -08:00
Behdad Esfahbod
7406e06aae Revert "[merge] Fix for ClassDef.Format and Coverage.Format"
This reverts commit 53d78d9956dbbfe50395bf8002b0308b375c02a9.

Now that Format is back in, merge it.

Should fix https://github.com/fonttools/fonttools/pull/878
2017-03-08 12:12:55 -08:00
Bo Song
b45fcf0fd6 Change gasp merge logic to 'first' (#862)
* change gasp merge logic to first

* fix typo

* add comment

* fix typo
2017-02-27 19:34:48 +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
Behdad Esfahbod
a11bc5655d [merge] Ignore LangSys if None
Fixes https://github.com/fonttools/fonttools/issues/739
for now, though proper fix is more complicated.

This was hit now because the subsetter was changed a while back
to retain script systems even if empty...  I don't like that.
2016-11-08 14:06:50 -08:00
Michael Yin
18b905b06d [ttLib/pyftmerge] Handle cmap merge better (#635)
Changed the merge algorithm to properly handle cmap subtables
of type 4 and 12 with platform id and encoding ids of 3/1 and 3/10
respectively. All other subtables are not merged and ignored.
The resulting merged cmap table includes a subtable of format 4/3/1
and a format 12 subtable iff there are mappings outside of the BMP.

If one font has two codepoints that point to the same glyph,
and another font has the same code points pointing to two other glyphs,
keep the behavior where the first replacement glyph is stored in 'locl'
and output the third glpyh (or more) to let the user know that they were
dropped, instead of failing to merge the font.

Fixes #444
Fixes #322
2016-07-13 14:00:36 -07:00
Behdad Esfahbod
3b8387fa45 [merge] Sort FeatureList by feature tag
Fixes https://github.com/behdad/fonttools/issues/444
2016-07-11 17:02:26 -07:00
Behdad Esfahbod
53d78d9956 [merge] Fix for ClassDef.Format and Coverage.Format
Part of https://github.com/behdad/fonttools/issues/444
2016-07-11 16:30:14 -07:00
Cosimo Lupo
6544482d92 [merge] remove custom Logger and use logging instead
this follows the same changes applied to subset.py module in d03ce32
2016-01-27 19:05:05 +00:00
Behdad Esfahbod
02b0169a8a [merge] Fix for f0eb7e98ca0642f17ac82433db8c957fffd6a9d3 2016-01-13 17:03:31 +00:00
Miguel Sousa
a7aef47695 fix "indentation contains mixed spaces and tabs" errors reported by Landscape 2015-08-09 00:33:50 -07:00
Cosimo Lupo
72481f5050 [merge] fix TabError: inconsistent use of tabs and spaces in indentation 2015-06-14 19:45:20 +01:00
Behdad Esfahbod
6df41da4ff Use timestampNow() in merge.py 2015-06-12 16:11:31 -07:00
Behdad Esfahbod
37e6e6a380 Use dict comprehension now that we don't support Python 2.6 2015-06-11 17:05:15 -07: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
Behdad Esfahbod
df2906b0ad Fix a few issues found by landscape.io 2015-04-26 02:17:13 -04:00
Behdad Esfahbod
b30e12ae00 More whitespace 2015-04-26 02:01:01 -04:00
Behdad Esfahbod
bd67253118 Some more whitespace fixes from pep8 tool 2015-04-26 01:59:01 -04:00
Behdad Esfahbod
19dadb37d6 One can't import fontTools.subset and fontTools.merge together
Fixes https://github.com/behdad/fonttools/issues/177
2014-10-07 17:37:29 -07:00
Behdad Esfahbod
68921c97ea [merge] Fails if 'GSUB' table not present
Fixes https://github.com/behdad/fonttools/issues/135

Or does it?
2014-07-09 17:13:16 -04:00
Behdad Esfahbod
d04dc9df11 [merge] Add preliminary support for BASE table 2014-07-03 14:01:44 -04:00
Behdad Esfahbod
6cc8bc3dbd [merge] Support Extension lookups 2014-07-03 13:46:23 -04:00
Behdad Esfahbod
14f13a993e [merge] Remove Python 2.7 dict comprehension syntax
Hopefully 2.6-happy again.
2014-04-02 18:54:53 -07:00
Behdad Esfahbod
8fec68796d [merge] Map duplicate glyphs using synthesized GSUB 'locl' tables 2014-03-28 17:41:01 -07:00
Behdad Esfahbod
d0903e3bb3 . 2014-03-28 16:39:49 -07:00
Behdad Esfahbod
2772d8496e [merge] Minor 2014-03-28 15:37:18 -07:00
Behdad Esfahbod
59a2c05137 [merge] Minor 2014-03-28 15:13:10 -07:00
Behdad Esfahbod
0884507c0e [merge] Minor 2014-03-28 15:02:40 -07:00
Behdad Esfahbod
201a681821 [merge] Minor 2014-03-28 14:58:12 -07:00
Behdad Esfahbod
0e235becc5 [merge] Comment 2014-03-28 14:56:27 -07:00
Behdad Esfahbod
7765421ab7 [merge] Allow merging OS/2 tables of different versions 2014-03-28 14:48:09 -07:00
Behdad Esfahbod
82c54638e3 [merge] Install merged dict on object 2014-03-28 14:41:53 -07:00
Behdad Esfahbod
0d5fcf498c [merge] Rename 2014-03-28 14:39:31 -07:00
Behdad Esfahbod
5a5d0affff [merge] Support missing GSUB/GPOS/etc
This is a hack for now.  Will clean up in upcoming commits.
2014-03-28 14:11:38 -07:00
Behdad Esfahbod
b8039e2653 [merge] Rename 2014-03-28 13:54:37 -07:00
Behdad Esfahbod
477dad1ee8 [merge] Improve assert 2014-03-28 13:52:48 -07:00
Behdad Esfahbod
f480c7cf21 [merge] Use CmapSubtable.isUnicode() 2014-03-12 12:18:47 -07:00
Behdad Esfahbod
5080331251 [merge] Map recursive lookups
Fixes https://github.com/behdad/fonttools/issues/109
2014-02-10 18:14:37 -05:00
Behdad Esfahbod
27c71f9f60 Retain hinting for first font
Part of https://github.com/behdad/fonttools/issues/95
2014-01-27 21:01:45 -05:00
Behdad Esfahbod
1ae29591ef from __future__ import absolute_import
Such that our Python 2 is closer to Python 3.

Part of https://github.com/behdad/fonttools/issues/77
2014-01-14 15:07:50 +08:00
Behdad Esfahbod
972af5af63 [merge] Sort script records 2013-12-31 18:16:36 +08:00
Behdad Esfahbod
233663207d [merge] Minor 2013-12-31 18:12:53 +08:00
Roozbeh Pournader
642eaf135d Properly merge head.flags and OS/2.fsType
Also install the merge script.
2013-12-22 15:33:25 -05:00
Behdad Esfahbod
35e3c7270d Minor 2013-12-20 21:34:09 -05:00
Behdad Esfahbod
b76d6ff14a [merge] Remove BaseTable.__hash__ need 2013-12-20 20:24:27 -05:00
Roozbeh Pournader
7a27214fcb Added merging tables for 'name' and 'gasp'. 2013-12-20 20:13:55 -05:00