417 Commits

Author SHA1 Message Date
Behdad Esfahbod
5988cc32cb Make BaseTable a new-style object 2013-11-19 17:40:46 -05:00
Olivier Berten
aa37c0aa7d Support for OS/2 table version 5 as proposed by Microsoft
https://github.com/fontforge/fontforge/issues/956
2013-11-19 00:44:38 +01:00
Behdad Esfahbod
fc4f438496 Fix parsing of hinting instructions that end in a PUSHB
Sounds useless, but MReifutaiM-Regular.ttf seems to have that, and the
parsing back from XML was failing because we expected a token whereas
after dropping whitespace there wasn't any left.
2013-11-18 16:06:01 -05:00
Behdad Esfahbod
17700bf926 Handle and warn about out-of-order Coverage table entries
Apparently the SIL Gentium fonts have wrong sorting in Coverage
tables.  That's broken by the spec, but shapers still work with
such fonts.  So, we warn when reading, and when writing, such
out-of-order coverage tables.
2013-11-18 16:05:00 -05:00
Behdad Esfahbod
6e70667659 Support loading broken Coverage tables
Hit by Google Fonts's font "Cabin" for example and a handful
of others.
2013-11-15 17:00:38 -05:00
Behdad Esfahbod
67fef70631 Support decode/encoding of unknown glyf hinting instructions
New instructions can be defined in the prep program.  We don't
check that the "unknown" instruction was actually defined.  Just
pass it through.

Fixes ttx with Skia.ttf on the Mac OS X.

Fixes https://github.com/behdad/fonttools/issues/21
2013-11-14 20:25:21 -05:00
Behdad Esfahbod
4ff7712131 Restructure code
In anticipation of upcoming change.
2013-11-14 20:16:41 -05:00
Behdad Esfahbod
4fab60ca5b Remove unused instruction name propagation
No functional change whatsoever.
2013-11-14 20:14:10 -05:00
Behdad Esfahbod
978b1ea877 Indent 2013-11-14 19:18:11 -05:00
Behdad Esfahbod
246301acc9 Fixup hhea recalc after 9222b8ef93fd6b41f9c4dcf152593cd0c80f0ba4 2013-11-14 18:55:35 -05:00
Roozbeh Pournader
c360f04754 Separate out the logic of computing advanceWidthMax from minLeftSideBearing, minRightSideBearing, and xMaxExtent for minimal fonts. 2013-11-14 18:53:20 -05:00
Roozbeh Pournader
dec666aa05 Only modify the loca table is there is such a table. 2013-11-14 18:52:15 -05:00
Behdad Esfahbod
7bdf6d39fc Minor 2013-11-14 17:27:15 -05:00
Behdad Esfahbod
9222b8ef93 Consider composite glyphs when recalcing 'hhea' values
Fixes https://github.com/behdad/fonttools/issues/20
2013-11-14 17:22:47 -05:00
Behdad Esfahbod
335f182a58 Consider advance width of all glyphs when recalcing 'hhea'
Part of https://github.com/behdad/fonttools/issues/20
2013-11-14 17:18:56 -05:00
Behdad Esfahbod
cd4fac4f4a Avoid overflow when compiling glyf table
https://github.com/behdad/fonttools/pull/25
2013-11-14 17:07:35 -05:00
Behdad Esfahbod
c55d592661 Remove unreachable code 2013-11-14 17:07:16 -05:00
Behdad Esfahbod
94118dcea4 Fix cmap subtable sort order
https://github.com/behdad/fonttools/issues/22
2013-10-28 12:16:41 +01:00
Behdad Esfahbod
0ba7aa7ab5 Make __cmp__() functions stable 2013-10-28 12:07:15 +01:00
Behdad Esfahbod
d95db25720 Indent 2013-10-26 22:03:46 +02:00
Denis Jacquerye
1e0ad3a9a8 remove non utf-8 character in unmaintainted code 2013-10-13 10:17:49 +01:00
Roozbeh Pournader
51a17826be Add support for cmap format 13. 2013-10-09 15:55:07 -07:00
Denis Jacquerye
cff3740f14 * wrong indentation after else 2013-10-09 12:13:40 +02:00
Roozbeh Pournader
d7921e33d9 Improved support for minimal fonts (with no visible glyphs). 2013-10-08 21:29:22 -07:00
Behdad Esfahbod
1e4c89f83a Update SVG table implementation
New drop from Read Roberts.
2013-10-07 17:23:35 -04:00
Behdad Esfahbod
805caae0d5 Merge pull request #5 from davelab6/master
New -q for Quiet mode
2013-10-01 15:36:55 -07:00
Behdad Esfahbod
2e998ea692 Fix GlyphCoordinates slicing
Based on patch from Roozbeh.
2013-09-29 14:02:27 -04:00
Behdad Esfahbod
043108cbdb [subset] Fix glyf component closure
https://github.com/behdad/fonttools/pull/11
2013-09-27 16:29:50 -04:00
Behdad Esfahbod
bb56ddb971 Fix composite glyph coordinate routines
Ouch, was modifying the component's own coordinates before.
2013-09-20 16:36:10 -04:00
Behdad Esfahbod
70fee1648a Fix glyph removeHinting re padding 2013-09-20 16:36:05 -04:00
Behdad Esfahbod
626107c833 Move some methods from subset.py to 'glyf' table implementation 2013-09-20 16:36:00 -04:00
Behdad Esfahbod
9d7dc22299 Add copyright notices 2013-09-19 20:03:02 -04:00
Behdad Esfahbod
8413c108d2 Move sstruct under fontTools.misc
Our footprint in the Python module namespace is all under
fontTools now.  User code importing sstruct should be updated
to say "from fontTools.misc import sstruct".
2013-09-17 16:59:39 -04:00
Behdad Esfahbod
f65033e277 Move xmlWriter into fontTools.misc
Trying to cleanup our footprint in the Python namespace.
2013-09-17 16:41:32 -04:00
Dave Crossland
a9b7e14f9b Merge http://github.com/behdad/fonttools 2013-09-04 18:53:41 +01:00
Behdad Esfahbod
9316a90e32 Fixup from numpy removal 2013-09-04 13:50:38 -04:00
Dave Crossland
1e50d94487 Merge http://github.com/behdad/fonttools 2013-09-04 15:51:58 +01:00
Behdad Esfahbod
2058dcfb68 More GlyphCoordinates fixup
I'm sure it's correct this time, though I couldn't reproduce the latest
issue Dave was hitting.
2013-09-04 10:49:21 -04:00
Dave Crossland
a2fb9508fb Merge http://github.com/behdad/fonttools 2013-09-04 15:42:31 +01:00
Behdad Esfahbod
e9ea5a0a10 Really fix GlyphCoordinates this time
Argh.  I should stop committing without proper time to test first.

https://github.com/behdad/fonttools/issues/4
2013-09-04 10:39:51 -04:00
Dave Crossland
c7e0cf4754 Merge http://github.com/behdad/fonttools 2013-09-04 15:20:38 +01:00
Behdad Esfahbod
71d76fa1b8 Fix GlyphCoordinates
It's embarrassing that I failed to test ttx completely.

https://github.com/behdad/fonttools/issues/4
2013-09-04 10:14:44 -04:00
Dave Crossland
d7efd5692c Make parsing XML quiet 2013-09-04 14:51:16 +01:00
Dave Crossland
85af40e7d8 Adding quiet mode to xmlImport 2013-09-04 13:30:21 +01:00
Behdad Esfahbod
562400ea10 Update table list for SVG 2013-08-29 16:15:14 -04:00
Behdad Esfahbod
ddcca79308 Add 'SVG ' table implementation from Read Roberts (Adobe) 2013-08-28 17:25:16 -04:00
Behdad Esfahbod
c4af3964fb Revert "Make GlyphOrder object iterable"
This reverts commit e4a670cc7da93d3a12ba23d8cfefdeb0ec7be01f.

As Read Roberts wrote to me:

"you changed the definition of the GlyphOrder class to take a ttFont as
the argument for the __init__ function, rather than just the
tag, as before, I think so that the glyph order is defined when the
table is instantiated, rather than only when to/fromXML() is called

The problem with this is that the ttx.py compile function passes in a tag,
so compiling a font from an ttx file fails here, and in
xmlImport.startElementHandler(). I discovered this because a number of my
scripts use the same logic. What is the reason for this change? I have no
problem with changing the several FDK scripts that build a new TTF font
from scratch, to pass in the ttFont rather than a tag, but wanted to be
sure that this was necessary. The main issues are that when reading in an
entire TTX file, the table has to be instantiated before the data can be
provided, and the GylphOrder initialization is then different than  for
all the other tables"""

As such revert.  This means that GlyphOrder is again non-iterable.  Will
have to fix in some other way later.
2013-08-28 17:12:12 -04:00
Behdad Esfahbod
4b3df49b5b Fix XML encoding
1. Write out using utf-8 encoding.  Shouldn't matter really since
we don't generate non-ASCII data,

2. When parsing, DON'T override the file's encoding!
2013-08-20 15:29:19 -04:00
Behdad Esfahbod
d8b32bf6e2 Minor import cleanup 2013-08-19 15:27:14 -04:00
Behdad Esfahbod
e4a670cc7d Make GlyphOrder object iterable 2013-08-19 14:17:11 -04:00