10170 Commits

Author SHA1 Message Date
Cosimo Lupo
bc690a565d Merge pull request #422 from anthrotype/vdmx-sort
[V_D_M_X_] sort records by yPelHeight when writing toXML
2015-12-07 11:15:10 +00:00
Behdad Esfahbod
a219c6daff Write out XML 2015-12-07 12:12:11 +01:00
Cosimo Lupo
983c21c745 [V_D_M_X_] sort records by yPelHeight when writing toXML 2015-12-07 11:07:56 +00:00
Behdad Esfahbod
c65c16d3f6 Fix previous commit
Humm, no idea how I had committed it locally before.
2015-12-07 12:05:24 +01:00
Behdad Esfahbod
5a08924075 Add high-level API for LigatureSubst
Ala MultipleSubst and AlternateSubst.  For now, just support compiling it.
2015-12-07 12:01:42 +01:00
Sascha Brawer
83dbae1da5 [feaLib] Do not emit any Value if ValueFormat is 0 2015-12-07 11:47:55 +01:00
Sascha Brawer
117683680e [feaLib] Emit SinglePos (GPOS type 1) in format 2 when this is more compact 2015-12-07 11:39:14 +01:00
Behdad Esfahbod
f129f658c9 [subset] Fix Options parsing
Fixes https://github.com/behdad/fonttools/issues/413
Test passes now.
2015-12-07 11:14:04 +01:00
Behdad Esfahbod
59b702c5ca [subset] Add test for subset.Options
Currently fails.
https://github.com/behdad/fonttools/issues/413
2015-12-07 11:13:44 +01:00
Sascha Brawer
1d4fb7925b Merge pull request #421 from moyogo/fealib-device
[feaLib] make Device Table from device tuples
2015-12-05 15:28:30 +01:00
moyogo
c01b956ae7 [feaLib] make Device Table from device tuples 2015-12-05 08:56:46 +00:00
Behdad Esfahbod
1ab0631ba4 Merge pull request #16 from googlei18n/py23
Use __future__ imports to ease Python2/3 compat
2015-12-04 22:44:53 -08:00
jamesgk
a79fb041a2 Use __future__ imports to ease Python2/3 compat 2015-12-04 13:07:32 -08:00
moyogo
38b335e131 feaLib: misnamed function in builder_test.py 2015-12-04 16:56:58 +00:00
Sascha Brawer
5644da31d2 [feaLib] Parse device tables 2015-12-04 17:10:20 +01:00
Sascha Brawer
46c76dbf1f [feaLib] Parse ValueRecord format C
However, not sure how to build the otTables object graph for emitting
GPOS tables with device values; the current code thus silently strips
off any device values. Left a TODO comment for implementing this.
2015-12-04 15:49:04 +01:00
Sascha Brawer
b99f1c9af4 [feaLib] Implement GPOS type 1, Single Adjustment Positioning 2015-12-04 12:22:01 +01:00
Sascha Brawer
f45fab8c3a [feaLib] Sort GSUB glyph coverage tables by glyph ID
Before this change, feaLib would sort coverage tables by glyph name,
which is against the OpenType specification.  The current unittests
happen to use only glyphs where the ordering is identical whether
sorting by name or by ID; but I am about to add unittests (for GPOS)
where the ordering is different.

The ordering cannot be enforced by otTables because otTables does
not have access to the font's glyph order; therefore, the sorting
needs to happen inside feaLib.
2015-12-04 11:11:17 +01:00
Behdad Esfahbod
aba3051aac [benchmark] Print time in micro-seconds 2015-12-03 18:13:27 -08:00
Behdad Esfahbod
1665774752 Merge pull request #15 from googlei18n/optimize
Remove Point class and only use built-ins
2015-12-03 17:53:13 -08:00
Sascha Brawer
cab0067c7e [feaLib] Implement GSUB LookupType 8: Reverse chaining single substitutions 2015-12-03 13:05:42 +01:00
jamesgk
72ebeb1085 Add license to benchmark script 2015-12-01 17:28:19 -08:00
jamesgk
3d4a7872ab Add a benchmarking suite for curve/s_to_quadratic 2015-12-01 17:13:14 -08:00
jamesgk
a787cd2daf Pass tuples to curves_to_quadratic in rf module 2015-12-01 17:12:30 -08:00
jamesgk
561bed0ea0 Remove Point class and only use built-ins
Using built-in types (mostly tuples) seems to cut the running time
overall by about one half. Spelling out linear interpolation in the
bezier_at functions actually cuts the running time by another 10%,
but I'm not sure if it's worth it given that this code looks a bit
nicer.
2015-12-01 13:22:24 -08:00
Behdad Esfahbod
bb79a8bf62 Merge pull request #14 from googlei18n/api
Move geometry module to __init__
2015-12-01 13:03:08 -08:00
jamesgk
97ce534d7b Move geometry.py to __init__.py 2015-12-01 12:30:31 -08:00
jamesgk
ebf1573564 Remove __init__.py (will be replace by geometry.py) 2015-12-01 11:04:48 -08:00
Cosimo Lupo
9f0aa03aec Merge pull request #402 from khaledhosny/subset-colr
[subset] Support subsetting MS color tables
2015-12-01 08:15:53 +00:00
Cosimo Lupo
f06dd27c25 Merge pull request #417 from khaledhosny/fix-setup.py
Fix setup.py to install fontTools.subset
2015-12-01 08:02:47 +00:00
Khaled Hosny
301d2db812 [subset] Support subsetting MS color tables
Add support for subsetting COLR table.

The CPAL table does not need subsetting, but unused palettes should be
pruned, this is not implemented however as it depends on COLR table,
which in turn will not be updated after pruning CPAL.
2015-12-01 11:59:52 +04:00
Khaled Hosny
b39077b64e Fix setup.py to install fontTools.subset
Broken since 29d7edf76f9ca888d120f2018e08e2b337ba7cf8.
2015-12-01 11:58:20 +04:00
Sascha Brawer
152dff4361 [feaLib] Implement GSUB chain substitution rules 2015-11-30 15:02:09 +01:00
Behdad Esfahbod
fdd84fad88 Merge pull request #12 from googlei18n/error-em
Specify tolerance in em through `max_err_em`
2015-11-24 15:38:22 -06:00
Behdad Esfahbod
a9d364ddcb Add URL to spec 2015-11-24 15:01:11 -06:00
Behdad Esfahbod
24f088110e Rename from FontWorker to FontDame
Spec is also available now, at:
https://github.com/Monotype/OpenType_Table_Source/
https://rawgit.com/Monotype/OpenType_Table_Source/master/otl_source.html
2015-11-24 15:00:15 -06:00
jamesgk
bf6b2d9f7e Specify tolerance in em through max_err_em
This way, the `max_err` parameter is consistent with the other
functions (being in font units).
2015-11-24 12:52:03 -08:00
Cosimo Lupo
196254ae1e Merge pull request #414 from anthrotype/py23-import-fix
[py23] fix ImportError when trying to import names when already defined
2015-11-23 12:07:41 +00:00
Cosimo Lupo
2eda1785f6 [py23] fix ImportError when trying to import unichr, basestring or unicode when already defined
When one does `from fontTools.misc.py23 import *`, everything seems to work fine.

However, linters will complain when one uses the asterisk to import all names from a module, since they can't detect when names are left undefined -- asterisks are greedy and will eat all names.

If one avoids the asterik and attempts to import explicitly, like in `from fontTools.misc.py23 import basestring`, the problem then is that, if `py23` does not re-define the name -- e.g. under python2 `basestring` or `unicode` are built-ins -- then the import statement raises `ImportError`.

The same happens for the `unichr` function on a "wide" Python 2 build (in which `sys.maxunicode == 0x10FFFF`).

Now, to work around this, we need to re-assign those built-ins to their very same names. This may look silly, but at least it works.
2015-11-23 12:02:12 +00:00
James Godfrey-Kittle
f82e320395 Merge pull request #5 from googlei18n/error-em
Specify max error in em instead of font units
2015-11-20 14:40:07 -08:00
jamesgk
4f107a9119 Merge branch 'master' into error-em 2015-11-20 14:39:10 -08:00
Behdad Esfahbod
a5e23c01f6 Merge pull request #4 from googlei18n/stats-arg
Take in dictionary of conversion statistics
2015-11-20 14:19:47 -08:00
jamesgk
85821f081d Update readme with max_error param changes 2015-11-20 12:08:28 -08:00
jamesgk
79ea6b4973 Swap order of "max_err" and "max_n" parameters
I like this new order better, since max_err seems to be the more
important parameter, and it corresponds more closely with the actual
font object params (which can be lists) than max_n (which is always
a single value).
2015-11-20 12:06:18 -08:00
jamesgk
e94071a2d8 Specify max error in em instead of font units
This should be more compatible between fonts with different UPM. In
fact, it should work within a single call with such fonts.

The default max error is now 0.0025 em, which is about 5 units for a
2048 UPM font.
2015-11-20 12:04:48 -08:00
jamesgk
5ef46a5bb3 Update readme with API changes 2015-11-19 17:17:56 -08:00
jamesgk
042a392d35 Take in dictionary of conversion stats
This allows stats to be accumulated between function calls.
2015-11-19 17:11:06 -08:00
jamesgk
8bbdb47cf5 Rename "robofab" module to "rf"
Apparently naming this robofab conflicts with the global robofab
module.
2015-11-19 16:59:49 -08:00
jamesgk
68d5213dd1 Update comments -- conversion is always compatible 2015-11-19 16:45:05 -08:00
jamesgk
45364ed045 Move RoboFab-specific code to a "robofab" module 2015-11-19 16:40:52 -08:00