Sascha Brawer
bc8279bab1
[feaLib] Parse ignore sub
and ignore substitute
statements
2015-08-10 11:17:52 +02:00
Sascha Brawer
482c498943
[feaLib] Improve unit tests for subtitution rules
2015-08-10 11:17:52 +02:00
Sascha Brawer
08d01bb24d
[feaLib] Parse substitution rules for LookupTypes 1 and 3
...
The parsed representation should handle most of other LookupTypes
as well, but the parser cannot recognize them yet.
2015-08-10 11:17:52 +02:00
Sascha Brawer
37fa652fa9
[feaLib] Add unit test for scoping of valueRecordDef statements
2015-08-10 11:17:52 +02:00
Sascha Brawer
402726f02c
[feaLib] Clarify an error message
2015-08-10 11:17:52 +02:00
Sascha Brawer
5270a978a9
[feaLib] Support hexadecimal numbers
...
The OpenType Feature File specification does not specify hex numbers
as explicit token type, but they appear several times in the examples
given by the spec.
2015-08-10 11:17:52 +02:00
Sascha Brawer
c06a377aa3
[feaLib] Implement valueRecordDef statements
2015-08-10 11:17:52 +02:00
Sascha Brawer
4169e584cc
[feaLib] Clarify error message for malformed glyph class references
...
The new message makes clearer what exactly the parser was looking for
when processing a glyph class reference.
2015-08-10 11:17:52 +02:00
Sascha Brawer
bb5a7e7caf
[feaLib] Make symbol tables separate objects
...
For example, named value records follow the same scoping rules
as named glyph classes.
2015-08-10 11:17:52 +02:00
Sascha Brawer
944fab8a5f
[feaLib] Implement parsing of feature blocks
2015-08-10 11:17:52 +02:00
Sascha Brawer
3936e334f1
[feaLib] Resolve references to glyph classes
2015-08-10 11:17:52 +02:00
Sascha Brawer
a0bbd5fab9
[feaLib] Detect duplicate glyph class definitions
2015-08-10 11:17:52 +02:00
Sascha Brawer
d72aac035e
[feaLib] Restrict length of glyph class names to 30 characters
...
This is required by the OpenType Feature File specification,
section 2.g.ii "Named glyph classes".
2015-08-10 11:17:52 +02:00
Sascha Brawer
ba238344b1
[feaLib] Implement top-level glyph class definitions
2015-08-10 11:17:52 +02:00
Sascha Brawer
b86e30d7c6
[feaLib] Rename features.py to ast.py, for Abstract Syntax Tree
2015-08-10 11:17:52 +02:00
Sascha Brawer
23997cfd95
[feaLib] Prevent deprecation warnings on Python 3
...
In Python 3, the method unittest.TestCase.assertRaisesRegexp
has been renamed to "assertRaisesRegex", and the frameworks spits
out deprecation warnings when using the method name from Python 2.
2015-08-10 11:17:52 +02:00
Sascha Brawer
05fe077654
[feaLib] Parse languagesystem
2015-08-10 11:17:52 +02:00
Sascha Brawer
f4ed6b5a85
Make pretty error messages for LexerError
2015-08-10 11:17:52 +02:00
Sascha Brawer
efbcba79a4
Handle inclusion of OpenType feature files
2015-08-10 11:17:52 +02:00
Sascha Brawer
ac700b0af5
Support FILENAME tokens when lexing OpenType feature files
...
When the lexer encounters the "include" keyword, it now enters
a special mode for scanning file names. After having scanned over
the file name, the lexer goes back to normal. The exact format
of file name strings is not defined by the OpenType feature file
specification, so we accept any character that is not a closing
parenthesis.
2015-08-10 11:17:52 +02:00
Sascha Brawer
612d2122ad
Store file path in Lexer
...
This simplifies the implementation of the parser for
OpenType feature files, since it can now just keep
token locations returned by the lexer. Before this
change, the parser had to un-pack the location tuples
and build new tuples that included the file path.
2015-08-10 11:17:52 +02:00
Sascha Brawer
da29d22748
Add lexer for OpenType feature files
2015-08-10 11:17:52 +02:00
Cosimo Lupo
915b8c303a
Merge pull request #332 from miguelsousa/mixed_indents
...
fix "indentation contains mixed spaces and tabs" errors reported by Landscape
2015-08-09 13:21:30 +01:00
Cosimo Lupo
c31ee9362f
Merge pull request #333 from miguelsousa/misc_errors
...
fix two misc errors reported by Landscape
2015-08-09 09:03:45 +01:00
Miguel Sousa
d28a942683
fix two misc errors reported by Landscape
2015-08-09 00:40:31 -07: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
2a713bfd79
[woff2/woff2_test] replace 'StringIO' with 'BytesIO'
2015-08-07 18:23:55 +01:00
Cosimo Lupo
7c35e848fb
[travis] install gcc 4.8 for better C++11 support (required to build Brotli)
2015-08-07 18:23:41 +01:00
Cosimo Lupo
8d02c3a680
[travis] install brotli via pip requirements.txt
2015-08-07 18:23:41 +01:00
Cosimo Lupo
682971b524
add pip requirements.txt file containing brotli's git url
...
Check out Brotli repository at the commit afbec11 (current HEAD)
2015-08-07 18:23:41 +01:00
Cosimo Lupo
867ad325bf
[ttx] add support for dumping WOFF2 fonts to TTX
2015-08-07 18:23:41 +01:00
Cosimo Lupo
eb266373fd
[subset] specify woff2 among supported flavors in __doc__
2015-08-07 18:23:41 +01:00
Cosimo Lupo
2591a1075d
[Snippets] add woff_compress.py and woff2_decompress.py sample scripts
2015-08-07 18:23:41 +01:00
Cosimo Lupo
0d21b67162
[woff2_test] add unit tests for woff2 module
2015-08-07 18:23:41 +01:00
Cosimo Lupo
4fc34de9e6
[ttLib] add 'test_data' folder containing font data to use in unit tests
2015-08-07 18:23:41 +01:00
Cosimo Lupo
b6ce7ae668
[woff2] add woff2 module with support for reading/writing single WOFF2 fonts (no font collections yet)
2015-08-07 18:23:41 +01:00
Cosimo Lupo
77ffbab995
[glyf] pad glyph data upon compile if self has attribute 'padding'
2015-08-07 18:23:41 +01:00
Cosimo Lupo
98e47a8746
[textTools] add 'pad' function to pad strings with null bytes
2015-08-07 18:23:41 +01:00
Cosimo Lupo
d50af59a52
[ttLib] pass if _getGlyphNamesFromCmap raises KeyError on 'cmap'
...
when _getGlyphNamesFromCmap gets called by the cmap parser itself, the
partially loaded subtable is removed and then restored later.
However, when a TTFont instance is imported from XML rather than from
binary file, its 'reader' attribute is None, and so the line:
tempcmap = self['cmap'].getcmap(3, 1)
will make TTFont.__getitem__ raise KeyError. It's better to fail nicely,
and return a dummy glyphOrder based on maxp numGlyphs.
2015-08-07 18:23:41 +01:00
Cosimo Lupo
2996c2e308
[sfnt] ovveride __new__ methods of SFNTReader and SFNTWriter to return flavor-compatible instances
2015-08-07 18:23:41 +01:00
Cosimo Lupo
baf2179fc3
Merge pull request #330 from anthrotype/unicodeio
...
[py23] disambiguate bytes vs unicode in-memory streams
2015-08-07 18:15:28 +01:00
Cosimo Lupo
bf0e336d31
replace all 'StringIO' with 'BytesIO'
2015-08-07 17:25:22 +01:00
Cosimo Lupo
2e058808fe
[py23] define BytesIO, StringIO and 'UnicodeIO' to disambiguate bytes vs unicode in-memory streams
2015-08-07 17:24:42 +01:00
Cosimo Lupo
852e4e6593
Merge pull request #327 from anthrotype/escape_cr
...
[xmlWriter] escape carriage returns '\r' using XML character entity '&13#;'
2015-07-27 19:29:57 +01:00
Cosimo Lupo
9f846d3687
[xmlReader_test] test newlines gets normalised by expat parser, unless escaped
2015-07-27 19:24:02 +01:00
Cosimo Lupo
5102353afb
[xmlWriter] escape carriage returns '\r' using XML character entity '&13#;'
...
Fixes https://github.com/behdad/fonttools/issues/318
2015-07-27 12:58:02 +01:00
Cosimo Lupo
fcd31fdf19
[xmlWriter_test] test carriage returns '\r' are escaped with ' '
2015-07-27 12:58:02 +01:00
Sascha Brawer
f928c9a32b
Merge pull request #326 from anthrotype/xmlReader_read_utf8
...
[xmlReader] open file for reading bytes (and revert two previous commits...)
2015-07-26 19:09:25 +02:00
Cosimo Lupo
13d7d38259
[xmlReader_test] test that xmlReader correctly decodes UTF-8 bytes
2015-07-26 15:34:58 +01:00
Cosimo Lupo
edeb2c6c98
[xmlReader] open file for reading bytes
2015-07-24 16:59:07 +01:00