308 Commits

Author SHA1 Message Date
James Godfrey-Kittle
0b3b83f765 [TTGlyphPen] Don't special case ignoring anchors
There's no need to special case this, it happens anyways.
2015-11-05 15:12:18 -08:00
James Godfrey-Kittle
f5b9ec0186 [TTGlyphPen] Add a new e2e test 2015-11-05 14:11:51 -08:00
James Godfrey-Kittle
b511b2b0d8 [TTGlyphPen] Go back to using AbstractPen
Using BasePen breaks on quadratic splines, since there's no way to
know if a on-curve point was added by the pen or in the original
glyph. Should have considered this before....
2015-11-05 13:57:53 -08:00
James Godfrey-Kittle
7767683ea4 [TTGlyphPen] Abstract out a _popPoint method 2015-11-05 13:57:06 -08:00
James Godfrey-Kittle
9f5c51897c [TTGlyphPen] Move checks for closed contours
We probably don't want to raise errors in init, which allows a drawer
to reset the pen state.
2015-11-05 13:54:51 -08:00
James Godfrey-Kittle
943d258bdb [TTGlyphPen] Add a test using existing test data 2015-11-04 18:01:34 -08:00
James Godfrey-Kittle
fa82fcd213 [TTGlyphPen] Make components with correct defaults
This seems consistent with what one sees opening up an existing TTF.
2015-11-04 17:59:57 -08:00
James Godfrey-Kittle
8c61d08d94 [TTGlyphPen] Remove last point in closed contours
When a pen adds the first point to a contour at the end to close it,
we should remove it for the TrueType outline.
2015-11-04 17:58:27 -08:00
James Godfrey-Kittle
1c73a1942a Don't use lineTo in moveTo
It shouldn't make a difference, but semantically this is now correct.
2015-11-04 17:21:17 -08:00
James Godfrey-Kittle
b83ed7ab2b Allow a TTGlyph pen to be used more than once 2015-11-04 17:19:58 -08:00
James Godfrey-Kittle
58dd55c0ae Use BasePen instead of AbstractPen in TTGlyphPen 2015-11-04 17:18:03 -08:00
James Godfrey-Kittle
5d7f3a9a1f Fix author name typo 2015-10-30 10:32:04 -07:00
James Godfrey-Kittle
e85b975f3a Fix imports in t2CharStringPen
We don't need the array module here, and it looks like py23.* should
be imported everywhere.
2015-10-23 11:36:46 -07:00
James Godfrey-Kittle
82e53f020c Use Python3-compatible arguments for roundIntPoint 2015-10-23 11:23:21 -07:00
James Godfrey-Kittle
7b3ac62db7 Add pen which draws to Type 2 charstrings 2015-10-23 11:15:16 -07:00
James Godfrey-Kittle
8b4c3b7892 Add assertion and comments to ttGlyphPen 2015-10-06 09:14:04 -07:00
James Godfrey-Kittle
b916c5bb93 ttGlyphPen: handle qcurves with no on-curve points 2015-10-06 09:12:15 -07:00
James Godfrey-Kittle
b0c03b86d6 Add pen which draws to TrueType glyphs. 2015-10-01 15:12:20 -07: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
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
bf0e336d31 replace all 'StringIO' with 'BytesIO' 2015-08-07 17:25:22 +01:00
Sascha Brawer
3cb5c9ca7c Replace calls to obsolete unittest.assertEquals()
Since Python 2.7, unittest.assertEquals() has been deprecated.
https://docs.python.org/2.7/library/unittest.html#deprecated-aliases
2015-06-25 10:11:52 +02:00
Sascha Brawer
79bdf00587 Unit tests for PointInsidePen 2015-05-29 09:52:09 +02:00
Sascha Brawer
c84975299e Unit tests for BoundsPen 2015-05-26 11:32:11 +02:00
Sascha Brawer
4bdf5140c4 Unit tests for BasePen 2015-05-09 13:20:56 +02:00
Behdad Esfahbod
7c9ab300c2 Add standard imports to all python sources
Previously, the trivial files didn't have them.
2015-04-14 17:26:59 -07:00
Adrien Tétar
65be78bd59 pens: qtPen tuple unpacking (py3/PEP3113)
http://legacy.python.org/dev/peps/pep-3113/
2014-09-25 22:15:23 +02:00
Adrien Tétar
8ed8e46659 pens: add a Qt pen 2014-09-20 10:21:33 +02:00
Behdad Esfahbod
1ae29591ef from __future__ import absolute_import
Such that our Python 2 is closer to Python 3.

Part of https://github.com/behdad/fonttools/issues/77
2014-01-14 15:07:50 +08:00
Behdad Esfahbod
153ec40209 Fix a few pychecker warnings
Fixes https://github.com/behdad/fonttools/issues/58
2013-12-04 01:15:46 -05:00
Behdad Esfahbod
32c10eecff py23 from __future__ import division and adjust divisions 2013-11-28 17:32:42 -05:00
Behdad Esfahbod
30e691edd0 py23 from __future__ import print_function 2013-11-27 17:27:45 -05:00
Behdad Esfahbod
7ed91eca1e py23 import in all nontrivial source files and unused import cleanup 2013-11-27 15:25:00 -05:00
Behdad Esfahbod
3ec6a25823 2to3 --fix=print with manual fixup 2013-11-27 04:57:33 -05:00
Behdad Esfahbod
ac1b435946 2to3 --fix=idioms 2013-11-27 04:15:34 -05:00
Behdad Esfahbod
3a9fd30180 2to3 equivalent to --fix=tuple_params
I hope I got this all right...
2013-11-27 03:30:21 -05:00
Behdad Esfahbod
cd5aad92f2 2to3 --fix=raise 2013-11-27 02:42:28 -05:00
Behdad Esfahbod
285d7b81d3 [subset] Fixup CFF hint stripping
Two things:

1. Put back glyph width after stripping hints,

2. Ignore what I believe is broken fonts.

I still see glyph width messup.  Debugging.
2013-09-10 20:30:47 -04:00
jvr
91bca42442 merging fixes & changes from delft-sprint-2012
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@611 4cde692c-a291-49d1-8350-778aa11640f8
2012-10-18 12:49:22 +00:00
jvr
a5c92986dd avoid glyphSet.get(): not all glyphsets in use implement it.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@498 4cde692c-a291-49d1-8350-778aa11640f8
2005-04-10 13:18:42 +00:00
jvr
2e4cc02ca3 BasePen should not fail if a base glyph does not exist in the glyph set; added get() method to _TTGlyphSet class
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@497 4cde692c-a291-49d1-8350-778aa11640f8
2005-03-08 09:50:56 +00:00
jvr
3a98ae5baf added _endPath method; without it, we'd fail on open paths (which requires pen.endPath() to be called instead of pen.closePath())
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@496 4cde692c-a291-49d1-8350-778aa11640f8
2005-03-08 09:40:25 +00:00
jvr
05e2541b49 Fixed subtle bug in curve intersection logic: due to floating point errors,
sometimes a legitimate solution is ever so slightly over 1.0. Those used to
be filtered out; now checking for 1.0 + 1e-10.


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@460 4cde692c-a291-49d1-8350-778aa11640f8
2003-10-14 20:30:07 +00:00
jvr
0b0fec3b08 debogofied doc string, added another one
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@453 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-16 10:14:48 +00:00
jvr
cc580ac0f8 Added Pen for reportlab.graphics.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@451 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-15 12:26:10 +00:00
jvr
fbff58cd78 Correctly deal with the TT-no-on-curve special case.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@449 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-09 23:29:45 +00:00
jvr
23cb200532 Factored out the SuperBezier and TT-implied-point algorithms, as the
may be useful separately from pens.


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@448 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-07 09:41:28 +00:00
jvr
40cde70f16 - added endPath() method to the Pen protocol, as a counterpart for
closePath() for *open* sub paths. This allows pen implementations
  to reliably detect the end of a sub path.
- improved various doc strings.


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@447 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-06 16:00:03 +00:00
jvr
49b5521f2e ensure that the current point is always set correctly
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@446 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-05 14:18:26 +00:00