2303 Commits

Author SHA1 Message Date
Cosimo Lupo
11c40b7de9 Merge pull request #462 from anthrotype/asctime
timeTools: define platform-independent 'asctime' function
2016-01-12 14:17:54 +00:00
Cosimo Lupo
a54a794f81 timeTools: define platform-independent 'asctime' function
Fixes https://github.com/behdad/fonttools/issues/455
2016-01-12 12:33:22 +00:00
Sascha Brawer
bfc3bff0e3 [feaLib] Support CID glyph names
Resolves https://github.com/behdad/fonttools/issues/459
2016-01-12 10:58:00 +01:00
Sascha Brawer
f2806c4de2 [feaLib] For testing, use dates without leading zeroes
On Windows, some Python versions format "Jan 01" while others
format "Jan  1"; this caused test failures on the build farm.
By using a date without leading zeros (2011-12-13), we can
work around this.

https://github.com/behdad/fonttools/issues/455
2016-01-11 19:36:19 +01:00
Sascha Brawer
67686691c4 [feaLib] Also handle feature aalt without any custom lookups
Before this change, feaLib did not handle feature files that specified
`feature aalt` whose block just was referring to other features without
defining any lookups on its own. After this change, we can handle it.

Resolves https://github.com/behdad/fonttools/issues/441
2016-01-11 18:12:23 +01:00
Sascha Brawer
38f4ee7908 [feaLib] Implement table head with FontRevision statement 2016-01-11 18:01:47 +01:00
Sascha Brawer
2de6fc7744 [feaLib] Imlement special support for feature aalt 2016-01-11 16:00:52 +01:00
Sascha Brawer
03796cf3a4 [feaLib] Use specification example for table GDEF as unit test 2016-01-11 07:18:18 +01:00
Cosimo Lupo
79eb7d11f7 Merge pull request #454 from amitdo/setup-remove-expat-check
Remove obsolete code - 'xml.parsers.expat' is part of Python's stdlib
2016-01-10 11:54:20 +00:00
amitdo
bf51c78d72 Remove obsolete code - 'xml.parsers.expat' is part of
Python's stdlib

The 'xml.parsers.expat' module has been a part of Python's Standard Library since version 2.0. Link: https://docs.python.org/2/library/pyexpat.html#module-xml.parsers.expat . FontTools requires Python 2.7, or Python 3.3 or later. Checking for the existence of this module is not necessary anymore.
2016-01-10 12:45:32 +02:00
Sascha Brawer
5696b50fac [feaLib] Implement the GlyphClassDef statement 2016-01-08 19:06:52 +01:00
Sascha Brawer
c79e005d77 [feaLib] Refactor GDEF building
The code for building GDEF tables had grown quite a bit, so it was
hard to understand what was going on. After this change, each GDEF
subtable gets built by a separate method. This increases legibility.
2016-01-08 17:38:49 +01:00
Sascha Brawer
13d23401f2 [feaLib] Parse GlyphClassDef statements
No output is generated yet; this will come in a later change.
2016-01-08 17:15:04 +01:00
Sascha Brawer
2b2d529404 [feaLib] Fix typo in comment for test case 2016-01-08 11:14:13 +01:00
Sascha Brawer
657a4463f3 [feaLib] Merge multiple LigatureCaret statements for the same glyph
The current OpenType Feature File specification is silent about
what the proper behavior should be when a single glyph has multiple
LigatureCaretByPos or LigatureCaretByIndex statements.  After
this change, we match the behavior of Adobe's `makeotf` tool.

Arguably, `makeotf` might not be optimal in its current behavior,
but it seems better to match the existing toolchain than to have
two conflicting interpretations of an ambiguous spec.  Once the
specification gets clarified, we will of course follow.

See https://github.com/adobe-type-tools/afdko/issues/95 for the
spec discussion.
2016-01-08 11:03:46 +01:00
Sascha Brawer
89ac1b2d0d [feaLib] Implement the Attach statement 2016-01-08 08:32:47 +01:00
Sascha Brawer
f8987125e7 [feaLib] Implement the LigatureCaretByIndex statement 2016-01-07 17:22:31 +01:00
Sascha Brawer
a44d8c5364 [feaLib] Implement the LigatureCaretByPos statement 2016-01-07 16:39:35 +01:00
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