2170 Commits

Author SHA1 Message Date
moyogo
127cdba11d [voltLib] Add VoltLibError 2016-09-14 17:21:41 +01:00
moyogo
da7f946741 [voltLib]: init 2016-09-14 17:21:41 +01:00
Cosimo Lupo
152c6d81b3 [py23_test] import round2 and round3 in py23_test module 2016-09-13 18:48:18 +02:00
Cosimo Lupo
8de2f44b31 [py23] don't export 'round2' and 'round3' in __all__, only 'round'
No need to pollute the namespace. If one needs one or the other, one can just import that explicitly.
2016-09-13 18:44:30 +02:00
Cosimo Lupo
f07c29c8bc [py23] export 'round' in __all__
(let's see if some of our tests that import * breaks now...)
2016-09-13 07:16:12 +01:00
Cosimo Lupo
b22f8c7310 [py23] in PY2 shadow built-in round with round3; in PY3 simply use built-in round 2016-09-13 07:13:32 +01:00
Cosimo Lupo
c7edcfec30 [py23_test] borrow round() test cases from cpython 2.7 test suite 2016-09-13 07:13:32 +01:00
Cosimo Lupo
ffa03f6566 [py23] add round2 and round3 function for simulating Python 2 and Python 3 built-in round
The implementation is inspired by https://github.com/PythonCharmers/python-future/blob/master/src/future/builtins/newround.py

It adds support for the old Python 2 round, and for negative 'ndigits'
2016-09-13 07:13:32 +01:00
Denis Moyogo Jacquerye
7930106740 feaLib: limit language statements to 1 feature block (#658)
* feaLib: limit language statements to 1 feature block

language exclude_dflt statements should only apply to lookups
defined in their feature block and not to lookups defined
in previous blocks sharing the same feature tag

* feaLib: add BuilderTest::test_FeatureFile_multiple_feature_blocks
2016-08-30 19:44:33 +02:00
JasonAtGithub
a41c60cb88 Fixed encoding error in subset tool in Windows
Fixed encoding error in subset tool in Windows which system default codepage isn't 65001.
For Example: 
When windows default codepage is 936, the command like 'pyftsubset myfont.ttf --text-file=mytextfile.txt' will throw an exception.
2016-08-29 20:43:33 +08:00
Miguel Sousa
f502bbba98 [CPAL] write paletteEntryLabels names 2016-08-28 16:24:58 -07:00
Miguel Sousa
3c6537de88 [CPAL] remove extra newline before palette label name 2016-08-28 16:21:21 -07:00
Cosimo Lupo
855c3b17c9 [woff2_test] adjust 'test_incorrect_compressed_size' to make it work with brotlipy
In the upstream google/brotli, if the `decompress` function receives an empty byte
string, it returns a brotli.error; whereas in 'brotlipy' it does not raise but
returns an empty string b"":
https://github.com/python-hyper/brotlipy/issues/43#issuecomment-240378257

This test case asserts that when 'totalCompressedSize' in the WOFF2 header is
incorrectly set, the woff2 reader fails -- either because the brotli decoder
raises an exception, or it returns a string whose length is not the one expected.
2016-08-17 12:07:02 +01:00
Behdad Esfahbod
8701fedcfe More solveCubic() hardening
It really should be quite solid this time. :-)
2016-08-13 16:29:49 -07:00
Behdad Esfahbod
5bea5f4fd6 Remove unused line 2016-08-13 16:25:09 -07:00
Behdad Esfahbod
ca7f8d8808 Harden solveCubic() some more
Fixes https://github.com/behdad/fonttools/issues/617#issuecomment-239146815
2016-08-12 22:43:20 -07:00
Behdad Esfahbod
9b3660df9f pointInsidePen: Disallow endPath()
https://github.com/behdad/fonttools/issues/621#issuecomment-234764830
2016-08-10 17:31:29 -07:00
Behdad Esfahbod
f3ff2f8881 pointInsidePen: add getWinding()
Resolves https://github.com/behdad/fonttools/issues/621#issuecomment-234764830

Although, leaving contours left open is out of protocol behavior
IMO.
2016-08-10 17:30:33 -07:00
Behdad Esfahbod
5cd0a55635 Ignore up to 4 bytes excess in kern subtables
Fixes https://github.com/behdad/fonttools/issues/314

Previously the warning message was wrong (probably a regression)
as it was reporting the the length of all kern data as "excess".
Fixing that, I see 4 bytes excess in Calibri.  Up to 4 is alright,
since many compilers add padding and wrongly add 4 instead of 0
sometimes.
2016-08-08 13:02:34 -07:00
Behdad Esfahbod
9080151cd5 [varLib] Fix variations for composite glyphs using anchor points 2016-07-29 14:44:02 -07:00
Behdad Esfahbod
fc05fe74ec [varLib] Remove unused code 2016-07-29 14:40:16 -07:00
Behdad Esfahbod
02b415c237 [bezierTools] Speed up a bit 2016-07-29 14:40:10 -07:00
Miguel Sousa
c181805e7e Tests to increase PointInsidePen's coverage 2016-07-28 00:03:04 -07:00
Sascha Brawer
fede51855a Merge pull request #642 from anthrotype/feaLib-ignore-semicolon
[feaLib] ignore stray semicolons
2016-07-28 00:19:43 +02:00
Cosimo Lupo
53232c02bd [feaLib.parser_test] test for stray semicolons 2016-07-27 09:55:11 +01:00
Cosimo Lupo
e9c3686b18 [feaLib.parser] ignore top-level empty statements made up of a single semicolon
makeotf doesn't complain about them either.

Fixes #641
2016-07-27 09:54:08 +01:00
Adrien Tétar
1126e6edda qtPen: use native quads impl 2016-07-25 11:14:13 -07:00
Cosimo Lupo
539a5010e5 subset: --recalc-average-width is disabled by default 2016-07-20 09:33:35 +01:00
Behdad Esfahbod
d96e246532 Make solveCubic() more robust
Fixes https://github.com/behdad/fonttools/issues/621#issuecomment-226671968
2016-07-19 22:50:09 -07:00
Miguel Sousa
2240bcbd22 Example that fails latest PointInsidePen (#638) 2016-07-19 22:39:57 -07:00
Cosimo Lupo
d1a27bd671 subset: add --recalc-average-width command-line option (on by default); log message if xAvgCharWidth changed 2016-07-19 22:54:05 +01:00
Khaled Hosny
efb32d5402 [subset] Recalculate OS/2.xAvgCharWidth 2016-07-18 01:35:18 +02:00
Behdad Esfahbod
10aaac53f2 Fix test 2016-07-16 21:58:41 -07:00
Behdad Esfahbod
81d84e6f85 Fix PointInsidePen
https://github.com/behdad/fonttools/issues/621
2016-07-16 21:47:37 -07:00
Behdad Esfahbod
9c037fc826 [gvar] Add TODO 2016-07-16 21:22:20 -07:00
Miguel Sousa
a00cacea96 Two more tests for pointInsidePen (#622) 2016-07-16 21:22:04 -07:00
Behdad Esfahbod
b1eeaa5151 [gvar] Fix point encoding
Where more than one run is used, it's only the first run's first point
that is absolute, all other values are relative.

Similar fix landing in FreeType soon.  Fixes lizzard glyph (glyphname
"dollar") in Zycon.
2016-07-15 18:15:17 -07: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
5cd1fbaff6 [subset] Clear CFF Encoding vector
Fixes https://github.com/behdad/fonttools/issues/620
2016-07-13 00:33:41 -07:00
Behdad Esfahbod
e9fb97d858 Fix overflow-fixing of Extension subtables
Fixes https://github.com/behdad/fonttools/issues/574
This was broken by 319643ad.  Ouch!
Was quite a debugging session to pin it down.
2016-07-12 23:55:47 -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
Miguel Sousa
8bf1bd4f30 [cff] fix fetching of fdSelectIndex value 2016-07-06 10:27:02 -06:00
Miguel Sousa
c04a6d922c [cff] fdSelect array only exists in CID fonts, so test for the presence of fdArray and set the selector value to None otherwise 2016-07-06 04:23:43 -06:00
James Godfrey-Kittle
797061679a [mtiLib] Make tables in parsers, don't pass in 2016-06-30 14:16:58 -07:00
James Godfrey-Kittle
1b61637473 Add cmap handling to mtiLib 2016-06-30 12:50:39 -07:00
James Godfrey-Kittle
5c723ebfb0 [feaLib] Don't assume feature has lookups in DFLT
It's possible for all of a feature's lookups to be in specific script
and/or language systems, so this code could crash.
2016-06-22 16:19:45 -07:00
James Godfrey-Kittle
e2186dec53 [feaLib] Don't set language when script is unset
Before, if someone tried to set the language before setting the script
a None/language language system would be created (with actual tag
"None" stored in the feature table). This defaults to tag DFLT and
fails when a non-dflt language is set for DFLT, since that's illegal.
2016-06-22 11:29:42 -07:00
James Godfrey-Kittle
aaf9294d97 [feaLib] Add another test for language systems 2016-06-21 16:40:17 -07:00
James Godfrey-Kittle
d1af1cfd4a [feaLib] Fix exclude_dflt handling
This is to fix what I think was a misunderstanding of the exclude_dflt
keyword (and the implicit include_dflt option active by default).

Rather than including the following lookups in the default language
systems, I think it is used to include the lookups specific to default
language systems in the system defined by the current language
statement. Thus instead of registering a lookup in all default
systems when include_dflt is true, we should exclude the lookups
registered with default systems from the current system when
include_dflt is false.
2016-06-21 16:39:27 -07:00