2536 Commits

Author SHA1 Message Date
Sascha Brawer
4daf0601b2 [feaLib] Adjust test case to use example from feature file format spec v1.17
In earlier versions of the OpenType Feature File Format specification,
the example was mal-formed so we had invented our own test case.
Adobe has kindly fixed the format specification:
https://github.com/adobe-type-tools/afdko/issues/88

This change revealed a bug in the parser where mark classes did
not get recognized as glyph classes; this is now fixed, too.
2016-01-07 13:02:21 +01:00
Sascha Brawer
adbf7ec4b1 [feaLib] Treat vkrn, vpal, vhal, valt as vertical features
Resolves https://github.com/behdad/fonttools/issues/449
2016-01-07 12:31:28 +01:00
Sascha Brawer
b7a7577750 [feaLib] Add test case for chaining to another chaining substitution 2016-01-07 12:03:22 +01:00
Sascha Brawer
db49f20d6b [feaLib] Support compact syntax for chaining to alternate substitutions
https://github.com/behdad/fonttools/issues/445

Not sure whether it makes much sense to define a contextual chain
that points to a GSUB type 3, but the OpenType feature file syntax
does not explicitly forbid it.  Adobe's `makeotf` tool rejects this
kind of input with "Contextual alternate rule not yet supported";
this implies that the construct is valid (albeit definitely exotic).
2016-01-07 11:32:54 +01:00
Sascha Brawer
e19d5a8cbe [feaLib] Add an overlooked test case to the suite of unittests
Because the test case had not been executed, there was a typo
in the expected output; this is now fixed.
2016-01-07 10:36:08 +01:00
Sascha Brawer
931bbc50c1 [feaLib] Support compact syntax for chaining to ligature substitutions
https://github.com/behdad/fonttools/issues/445
2016-01-07 10:31:13 +01:00
Sascha Brawer
b19c6b3dec [feaLib] Add test case for chaining GSUB type 6 to GSUB type 1 2016-01-07 09:25:08 +01:00
Sascha Brawer
e2405c9aef [feaLib] Implement explicit lookup references as calls
Before this change, the compiler had (essentially) implemented lookup
references by inlining the statements of the invoked lookup into the
current feature block. After this change, the lookup gets compiled
separately, and any call sites make explicit calls.
2016-01-07 08:57:34 +01:00
Sascha Brawer
7eee900ea3 [feaLib] Add test for rejecting inconsistent flags in a named lookup block 2016-01-06 17:53:26 +01:00
Sascha Brawer
45cc496bed [feaLib] Support compact syntax for chaining to multiple substitutions
https://github.com/behdad/fonttools/issues/445
2016-01-06 17:33:34 +01:00
Sascha Brawer
6c5cb7f06e [feaLib] Fix typo on header comment 2016-01-06 16:24:43 +01:00
Sascha Brawer
a543b2e3b9 [feaLib] Support compact syntax for chaining to single substitutions
Resolves https://github.com/behdad/fonttools/issues/445 for single
substitutions. The compact forms for chaining to other GSUB types
are not yet supported; these will get fixed in follow-up changes.
2016-01-06 16:15:26 +01:00
Behdad Esfahbod
adc2862bbb Merge pull request #442 from adrientetar/patch-1
setup.py: add feaLib and mtiLib
2016-01-03 14:02:07 +00:00
Adrien Tétar
ed5b9d9b57 setup.py: add feaLib and mtiLib 2016-01-02 16:38:17 +01:00
Sascha Brawer
654c086574 [feaLib] Do not use glyph class 0 when building ClassDef2 tables
See https://github.com/adobe-type-tools/afdko/issues/90 for context.
2015-12-23 15:14:00 +01:00
Sascha Brawer
6254974112 [feaLib] Support GPOS type 2, format 2: Class-based kerning tables 2015-12-23 11:35:49 +01:00
Sascha Brawer
26c02e4d95 [feaLib] Add helper for creating glyph class definition tables
The helper will be used for building class-based kerning tables.
2015-12-22 14:42:13 +01:00
Sascha Brawer
dd23788a53 [feaLib] Raise a not-yet-implemented error for class-based kerning
Before this change, we silently generated bad fonts. After this
change, we emit the exact same output like `makeotf` for specific
kerning pairs, and reject the input file for the not yet implemented
class-based kerning. (The implementation of class-based kerning
is coming soon).
2015-12-21 16:06:59 +01:00
Sascha Brawer
3812e992c1 [feaLib] Enumerate also the second glyph class in enum pos statements
Before this change, the compiler would enumerate only the first
glyph class of a kerning pair. However, that behavior did not match
the behavior of the `makeotf` tool.
2015-12-21 15:16:47 +01:00
Behdad Esfahbod
1a43064d06 README.md: Update appveyor badge to point to my repo 2015-12-15 16:49:24 +01:00
Cosimo Lupo
8d23b9367a README.md: set URL of Appveyor build status badge to behdad/fonttools 2015-12-15 15:37:11 +00:00
Cosimo Lupo
7c63234ca6 Merge pull request #437 from anthrotype/fix-macres-overflow
macRes: fix OverflowError while reading resource on 32-bit Python
2015-12-15 11:27:15 +00:00
Behdad Esfahbod
462496ce32 [mtiLib] Minor 2015-12-15 12:09:19 +01:00
Behdad Esfahbod
fd84ac769b [mtiLib] Disable lookupMap until we fix forward references 2015-12-15 12:09:19 +01:00
Cosimo Lupo
e4ab85e90a macRes: fix OverflowError while reading resource on 32-bit Python
Fixes https://github.com/behdad/fonttools/issues/436
2015-12-15 11:01:26 +00:00
Sascha Brawer
cba2220446 [feaLib] Pass syntax tree nodes for kerned glyphs to builder
For GPOS type 2, the OpenType Feature File format makes a semantic
difference between `glyph` and `[glyph]`, so we need to pass the
syntax tree for the kerned glyphs and glyph classes down to the builder.

Previously, we were expanding syntax tree nodes to glyphSets at
parsing time. Therefore, the builder could not distinguish a statement
for kerning two single glyphs from a statement for kerning two glyph
glasses, where each glyph class would consist of a singleton
glyph. (Debating whether or not it makes much sense to have this
distinction is outside the scope of fonttools; we want to implement
the language in its present form).

The builder does not yet use this information for building different
tables. This change is just about plumbing.
2015-12-14 12:33:07 +01:00
Cosimo Lupo
ad987674dc Merge pull request #435 from anthrotype/travis-multi-os
Travis multi-os setup
2015-12-12 19:58:48 +00:00
Cosimo Lupo
007a038bcf .appveyor.yml: add email notifications to fonttools@googlegroups.com on build failure and status changed 2015-12-12 19:57:23 +00:00
Cosimo Lupo
a63e1ed5d3 .travis.yml: also test with built-in Python 2.7 on OSX 10.11 2015-12-12 19:28:59 +00:00
Cosimo Lupo
0227945781 _t_r_a_k: do not import unicode_literals as it makes struct fail on some old Python 2.7.x
On the latest Python 2.7.10, struct accepts both unicode and str as 'fmt'.
However on Travis for py27 we use the built-in OSX Python, which on OSX 10.9 is Python 2.7.5.

Travis log: https://travis-ci.org/anthrotype/fonttools/jobs/96473892#L3010

Python issue: https://bugs.python.org/issue19099
2015-12-12 19:28:59 +00:00
Cosimo Lupo
8d4f59b4c3 .travis/install.sh: install pyenv only if it isn't already 2015-12-12 19:28:58 +00:00
Cosimo Lupo
c5b96cfe98 .travis.yml: run tox command using run.sh script 2015-12-12 19:28:58 +00:00
Cosimo Lupo
da981c754e .travis/run.sh: shell script to activate virtual environment and run tox 2015-12-12 19:28:58 +00:00
Cosimo Lupo
8bc30bc4d2 ttLib.__init__: replace '>>>' with '>>' in docstring to avoid triggering pytest doctests discovery
the docstring references an example 'afont.ttf' file which obviously doesn't exist.
2015-12-12 18:11:59 +00:00
Cosimo Lupo
bcc95eebfa .travis.yml: run tests on both Linux and OSX; use tox to setup virtual env and install deps, and pytest to discover/run tests 2015-12-12 18:11:59 +00:00
Cosimo Lupo
12e5007b1d tox.ini: configure tox test environment; set up py.test to discover both doctest and unittest tests 2015-12-12 18:11:59 +00:00
Cosimo Lupo
c6c1a96136 .travis/install.sh: shell script to install pyenv (used to install various Pythons); install virtualenv and tox 2015-12-12 18:11:59 +00:00
Sascha Brawer
0dd370760e [feaLib] Clean up the handling of markClass statements 2015-12-12 12:55:21 +01:00
Cosimo Lupo
e537f17b7c README.md: remove 'Credits' section
with many thanks to Adam and Hannes!
(don't worry, everything is kept in the git history)
2015-12-11 18:40:50 +00:00
Cosimo Lupo
de583f8bbc Merge pull request #434 from anthrotype/appveyor-badge
README.md: add Appveyor's status badge
2015-12-11 18:06:59 +00:00
Cosimo Lupo
da31c3cdb9 README.md: add Appveyor's status badge 2015-12-11 18:03:22 +00:00
Cosimo Lupo
024b637482 Merge pull request #433 from anthrotype/appveyor
add Appveyor support
2015-12-11 17:56:09 +00:00
Cosimo Lupo
2af6ccb302 appveyor.yml: must add build: false 2015-12-11 17:34:05 +00:00
Cosimo Lupo
859dddff7c Add support for running tests on Windows Python using Appveyor CI 2015-12-11 17:27:47 +00:00
Cosimo Lupo
499c36fc87 run-test.sh: exit immediately if any subcommands return non-zero value 2015-12-11 16:10:51 +00:00
Behdad Esfahbod
a9a5bd6d28 [mtiLib] Make backward lookup and feature name references work 2015-12-11 16:38:33 +01:00
Behdad Esfahbod
3d289927a4 [mtiLib] Remove unused function 2015-12-11 16:38:25 +01:00
Behdad Esfahbod
e9738c655e [mtiLib] Allow intermixing of lookups and feature / script tables 2015-12-11 16:38:21 +01:00
Behdad Esfahbod
942cdd8477 [mtiLib] Towards recognizing symbolic references 2015-12-11 16:38:18 +01:00
Sascha Brawer
dcae8fd8ba [feaLib] Represent mark class names as nodes in the syntax tree
Again, this will be needed for eventually distinguishing `glyph`
from `[glyph]` or `@CLASS`, which makes a semantic difference
when building GPOS type 2 tables.
2015-12-11 16:30:20 +01:00