Cosimo Lupo
585b87023f
fixedTools: add otRound to round floats to nearest int towards +Infinity
...
https://github.com/fonttools/fonttools/issues/1248
2018-06-14 17:15:47 +01:00
Cosimo Lupo
c4950ecc8b
py23: add 'zip' (alias to izip in py2) to __all__
2018-06-12 17:29:10 +01:00
Cosimo Lupo
fbab1227ce
loggingTools: memoize 'log' property of LogMixin
...
the logger name is constant (based on the user class's name and module)
so we can cache it.
(this means the LogMixin will only work on regular dict-based classes,
not on 'slotted' classes. But that's ok
2018-06-07 11:40:33 +01:00
Cosimo Lupo
a84c097c10
py23: alias itertools.izip as 'zip'
...
so we consistently use python3 zip iterator on both py2 and py3
2018-06-06 18:21:15 +01:00
justvanrossum
52ea50f4bc
allow an encoding to be specified when parsing a Type 1 font
2018-04-12 14:39:44 +02:00
Andy Clymer
a3307324ae
Includes a suggested fix from @anthrotype
2018-04-03 15:40:54 -04:00
Andy Clymer
241a4474b4
Fixes the eq comparison of the Tag object to work with a None type
2018-04-03 14:54:39 -04:00
Cosimo Lupo
6473cc9349
add more tests for userNameToFilename function
...
plus minor whitespace
2018-02-28 12:26:52 +00:00
Cosimo Lupo
6930eb3b42
filenames: add code's original url, author and copyright notice
2018-02-28 11:44:44 +00:00
Bill Amidei
ccae4687cc
Moving userNameToFileName to its own file, adding unit test
2018-02-28 11:30:33 +00:00
Cosimo Lupo
232e2b8467
Revert "Merge pull request #1130 from anthrotype/temp-revert-split-glyphs"
...
This reverts commit 060f856f92e0fb2d8e60f6be080c89c08528bacb, reversing
changes made to 1e42224af741fac73e20f7193d8115cfda7d3594.
2018-02-28 11:24:19 +00:00
Miguel Sousa
432d9b4034
[misc.testTools] boilerplate unittest classes
2018-02-23 03:02:06 -08:00
Miguel Sousa
603e942f4c
[misc.testTools] tabs to spaces
2018-02-23 03:02:06 -08:00
Miguel Sousa
dd5b52404c
[misc.testTools] minor
2018-02-23 03:02:06 -08:00
Behdad Esfahbod
4fec016862
[cff] Fix calcBound when seac-like components happen in endchar
...
I'm also unimpressed by the copy-pasted bounds logic in hhea and vhea,
and the fact that that's coded in there instead of calling a function
on CFF / glyf tables respectively.
2018-01-26 17:41:53 -08:00
Behdad Esfahbod
c99a731adb
[ttc] Implement saveXML()
2018-01-25 17:50:03 -08:00
Cosimo Lupo
a014e3be88
Merge pull request #1139 from anthrotype/revert-literal-eval
...
textTools: use ast.literal_eval for safeEval
2018-01-25 00:09:43 +01:00
Behdad Esfahbod
524b62a1b2
Add fontTools.ttLib.sfnt.readTTCHeader()
2018-01-23 13:44:56 -08:00
Cosimo Lupo
60f2c741c3
CapturingLogHandler: match the fully formatted log message in assertRegex
...
and not the raw 'msg' attribute which still has the '%' formatting placeholders
2018-01-15 18:38:27 +00:00
Behdad Esfahbod
2d4e76ff0b
[bezierTools] Add calcCubicArcLength() and calcCubicArcLengthC()
...
Fixes https://github.com/fonttools/fonttools/issues/1142
2018-01-09 11:33:57 +01:00
Behdad Esfahbod
f7312fc9d0
[misc.bezierTools] Slightly improve previous commit
...
Part of https://github.com/fonttools/fonttools/issues/1142
2018-01-08 13:43:45 +00:00
Behdad Esfahbod
5dd888da1d
[misc.bezierTools] Implement cusp loop for calcQuadraticArcLength()
...
Part of https://github.com/fonttools/fonttools/issues/1142
2018-01-08 13:41:27 +00:00
Behdad Esfahbod
fe5a2ea870
[misc.bezierTools] Remove approximate_fallback arg from calcQuadraticArcLength()
...
Part of https://github.com/fonttools/fonttools/issues/1142
2018-01-08 13:41:27 +00:00
Cosimo Lupo
2b13c47d3e
textTools: safeEval = ast.literal_eval
...
https://github.com/fonttools/fonttools/pull/1139#pullrequestreview-86720679
2018-01-04 19:41:52 +00:00
Cosimo Lupo
4a20899cb4
textTools: use ast.literal_eval for safeEval
...
go back to using literal_eval, as nobody does complex expressions in TTX files,
and eval is evil.
Fixes https://github.com/fonttools/fonttools/issues/164
2018-01-04 16:53:54 +00:00
Cosimo Lupo
56a84ae905
Temporarily revert PR #1035 bamidei/split_g_l_y_f_to_one_per_file
...
The split-glyf-to-one-glyph-per-file feature is only partially implemented,
as it was discussed here:
https://github.com/fonttools/fonttools/issues/153#issuecomment-346677171
I need to cut a bugfix release today, but I don't want to ship this as is.
I prefer to temporarily rever, tag a release from master branch, then
revert it again to its present state so that bamidei can complete his
work.
---
Revert "[glyf] make splitGlyphs output more compact"
This reverts commit d08d635a93289982b028aacd3b9039fbe742f3e8.
Revert "more whitespace"
This reverts commit bd030f61c6b360fd360632bbc6c19abb057c9a24.
Revert "minor whitespace"
This reverts commit f2a8c787b13b92ae0e0f61477e584316144747c7.
Revert "Merge pull request #1035 from bamidei/split_g_l_y_f_to_one_per_file"
This reverts commit 17b89d9dde7691dbbb6815efba92eff446af62ac, reversing
changes made to b8482d9666f08d3603ee93d3ca52931550f715fc.
2017-12-18 12:00:43 +00:00
Cosimo Lupo
17b89d9dde
Merge pull request #1035 from bamidei/split_g_l_y_f_to_one_per_file
...
Add ability to split glyphs to 1 glyph per ttx file. Issue #153
2017-11-23 18:30:54 +01:00
Bill Amidei
de94613e08
Updates based upon review feedback for glyf to individual files; include table name in contentOnly file; Remove unnecessary parameters from toXML - leaving only the splitGlyphs optional additional parameter
2017-11-23 07:17:35 -08:00
Jens Kutilek
a35707560c
Merge pull request #1101 from fonttools/beziertools
...
Move arc length calculations from pens.perimeterPen to misc.bezierTools
2017-11-14 13:38:10 +01:00
Jens Kutilek
dd558f5df8
Move arc length calculations from pens.perimeterPen to misc.bezierTools
2017-11-14 13:03:58 +01:00
Cosimo Lupo
f1049dcaa5
[arrayTools] fix undefined name in Vector._unaryOp
...
Thanks Miguel
ab02ce49d3 (commitcomment-25599266)
2017-11-14 11:23:12 +00:00
Cosimo Lupo
350b73363b
[py23] must define redirect_stderr for py3.4
2017-11-07 12:08:04 +00:00
Cosimo Lupo
d3251241be
[py23] Add backports for redirect_stdout/stderr context managers
2017-11-07 11:54:28 +00:00
ReadRoberts
508e0e3770
[psCharstring] Simpler version of test for CFF2Charstring vs T2Charstring.
2017-11-05 19:36:41 -08:00
ReadRoberts
4d8f1546d2
[psCharstrings] Whoops. Debug code that escaped review.
2017-11-05 19:34:17 -08:00
ReadRoberts
83379be568
CFF2 Subr items can have values on the stack after the last operator. These were not getting written to XML. Added new class CFFSubr so that we can make an assertion error in this case if the item is not a CFF2 Subr, and otherwise write the last values on the stack to the XML file
2017-11-02 11:36:10 -07:00
ReadRoberts
8b02b5a294
Fixed issue with reading/writing PrivateDict BlueValues to ttx file. To date, BlueValue arguments have been written as absolute coordinate values, reflecting the history of the CFF ttx table format. However, Behdad Esfahbod pointed out that it is not always possible to roundtrip between the absolute values in the ttx file and the CFF2 default font value and the delta list. This update changes the ttx format so that in PrivateDict BlueValues, the default font values are written as absolute coordinates, preserving continuity with how CFF tables are written, but the region values are written as the deltas from the VariationStore delta list.
...
This also fixes fonttools/fonttools/issues/1030.
Although the roundtrip is generally possible when a VariationStore is built from source font data using the Superpolator model, it is possible to build region definitions that do not follow this model. Behdad cited the Skia "Q" example, where the tail of the Q is affected by two regions defined as:
min=0 peak=0.5 max=0.51 delta=+10
min=0.49 peak=0.5 max=0.51 delta=-10
2017-11-02 11:31:47 -07:00
Cosimo Lupo
94c79e4cbd
[fixedTools] add floatToFixedToFloat to __all__
2017-10-22 12:22:56 +01:00
Cosimo Lupo
28bb992c1f
replace int(round(...)) with round(...)
...
We don't need to cast to int when using the round function from py23,
as this is a backport of python3's built-in round and thus it returns
an int when called with a single argument.
2017-10-22 12:03:52 +01:00
Behdad Esfahbod
117f8f0eb3
[varLib.mutator] Quantize normalized location to F2Dot14
2017-10-20 20:13:14 -04:00
Cosimo Lupo
3a97f425b8
[sstruct] handle format strings with unicode_literals
...
properly fixes issue with struct module in python < 2.7.7
https://github.com/fonttools/fonttools/issues/993
2017-10-20 11:09:04 +02:00
Cosimo Lupo
8afa763ad2
[arrayTools] fix mixed indentation
...
This particual file originally contained spaces, so we revert to that...
sorry.
2017-10-11 21:13:23 +01:00
Cosimo Lupo
558dad9028
[arrayTools] add function to iterate over pairs in iterable
2017-10-11 20:43:08 +01:00
Behdad Esfahbod
ab02ce49d3
Implement more ops for arrayTools.Vector
...
Would be nice to add tests for these...
2017-10-10 13:06:15 +02:00
Behdad Esfahbod
c91f0323db
Rename CVTValues to arrayTools.Vector
...
This is generic, and useful in other cases.
2017-10-10 12:43:15 +02:00
Khaled Hosny
4b3a2eb1d9
Respect SOURCE_DATE_EPOCH for time stamp
...
For reproducible builds, check the presence of SOURCE_DATE_EPOCH
environment variable and use it for the time stamp. This affects the
head.modified (and head.created in merge.py).
See https://reproducible-builds.org/specs/source-date-epoch/
2017-10-02 11:37:00 +02:00
Bill Amidei
b5edc7e9f5
Add ability to split glyphs to 1 glyph per ttx file. Addresses Issue #153
2017-08-23 12:33:25 -07:00
Sascha Brawer
57f01b27cb
[morx] Preliminary code for writing AATLookups
...
Needs more work.
2017-08-14 21:34:15 +02:00
Masaya Nakamura
3708f2c8d3
Don't cache charString bounds
...
https://github.com/fonttools/fonttools/pull/970#discussion_r117903692
2017-08-01 10:54:47 +09:00
Masaya Nakamura
a68bfc2458
[psCharStrings] Add recalcBounds() to T2CharString
2017-08-01 10:51:47 +09:00