508 Commits

Author SHA1 Message Date
Behdad Esfahbod
81750849fc Allow setting name entries to Unicode strings
Just convert to bytes if needed when compiling table.
2015-04-07 17:58:11 -07:00
Behdad Esfahbod
e3f531783a Don't modify name table object when compiling 2015-04-07 17:56:51 -07:00
Behdad Esfahbod
4458f363e3 [ttx] Write out name table entries as Unicode when possible
https://github.com/behdad/fonttools/issues/54

There's a new attribute named unicode that can choose whether the
text in the XML entry is to be interpretted as Unicode, or as the
target encoding.
2015-04-07 17:52:51 -07:00
Behdad Esfahbod
98aee5f11a Add getEncoding() to name table entries 2015-04-03 10:07:57 -07:00
Behdad Esfahbod
0bf67b50bd [glyf] Implement optimal glyph outline packing; disabled by default
Dynamic-Programming-based algorithm.  Previously we had a greedy
algorithm only.

Unfortunately the savings are truly negligible.  In the order of ~20
bytes for each of the Roboto faces, less so for Noto fonts.  Even on
a 20MB font, it produced less than 100 bytes saving compared to our
greedy packing.  Either I made a huge mistake, or this is so not worth
it.  Anyway, the code is there, but disabled.
2015-03-30 16:47:49 -07:00
Behdad Esfahbod
4e616d2f7f Accept MS Symbol cmap tables as Unicode-compatible
Apparently these days these tables are used to encode symbols in
PUA, so they are still Unicode-compatible...

This follows a similar change in fontconfig.
2015-03-30 16:47:48 -07:00
Behdad Esfahbod
cd1bc34f89 Simplify glyf packing a bit more 2015-03-30 16:47:48 -07:00
Behdad Esfahbod
c72058623b Minor 2015-03-30 16:47:48 -07:00
Behdad Esfahbod
630284e31a Minor 2015-03-30 16:47:48 -07:00
Behdad Esfahbod
0679a7691d Move glyf coordinate delta packing into new function 2015-03-30 16:47:47 -07:00
Behdad Esfahbod
a40b20d0e0 Minor shuffling of glyf compression code 2015-03-30 16:47:47 -07:00
Behdad Esfahbod
a9632a376b Merge pull request #219 from anthrotype/bytesjoin
[_n_a_m_e] fix "can't concat bytes to str" error in python 3
2015-03-20 12:42:53 -07:00
Cosimo Lupo
743e990b5c [_n_a_m_e] fix "can't concat bytes to str" error in py3 2015-03-19 18:11:19 +00:00
Behdad Esfahbod
c511745b2e Work around a Jython bug:
>>> import array; array.array("f", array.array("b", [1,2,3]))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can only extend with array of same kind

>>> import array; array.array("f", list(array.array("b", [1,2,3])))
array('f', [1.0, 2.0, 3.0])
2015-03-17 15:32:57 -07:00
Behdad Esfahbod
b9ac90a8f9 [GX] Add 'fvar' table support
I might change the table format in the future, but it's functional now.
2015-03-11 15:29:35 -07:00
Behdad Esfahbod
61cda14c1b Actually add _f_e_a_t.py
Ouch!
2015-03-11 12:31:44 -07:00
Behdad Esfahbod
612c70dada [SVG] Support gzip-compressed SVG tables
Set font['SVG '].compressed=True to enable.  Here's a snippet to convert a
WOFF-compressed SVG+OpenType font to a compressed SVG+OpenType non-WOFF font:

from fontTools.ttLib import TTFont
font = TTFont("NotoColorEmojiSvg.woff")
font['SVG '].compressed=True
font.flavor=None
font.save("NotoColorEmojiSvgCompressed.ttf")
2015-03-02 15:41:57 -08:00
Behdad Esfahbod
b1f46be65c Minor 2015-03-02 15:22:39 -08:00
Behdad Esfahbod
9fc8ac0559 Whitespace 2015-03-02 13:05:29 -08:00
Behdad Esfahbod
5a7ec608c8 Fix SVG doc length calculations
Patch from Doug Felt.
2015-02-23 14:03:06 -08:00
Behdad Esfahbod
8af5c69ea0 Unbreak backward compatibility re _h_e_a_d.mac_epoch_diff
Fixes https://github.com/behdad/fonttools/issues/210
2015-01-22 11:21:43 -08:00
Behdad Esfahbod
21af87536f [cmap] Split last segment of a format 4 efficiently
Fixes https://github.com/behdad/fonttools/issues/189
2015-01-22 00:10:01 -08:00
Behdad Esfahbod
0d5d12e02a Adjust 'feat' table format
As discussed here:
730bedd3d1
2015-01-21 15:46:30 -08:00
Behdad Esfahbod
8ef5adc4af Move draw() implementation to a better place 2015-01-08 12:28:42 -08:00
schriftgestalt
adfe7f293a add some missing return values 2015-01-08 09:46:13 -08:00
Behdad Esfahbod
a0dfcb496e Align instruction comments at tab stop
Makes them much more readable.
2015-01-05 17:49:38 -08:00
schriftgestalt
5d66d59a1f Add comments with names of TrueType instruction to assembly 2015-01-05 17:45:09 -08:00
Olivier Berten (selapa.net)
ff84e2dadd Regard very low datetimes as unix timestamps 2015-01-03 23:04:10 +01:00
Behdad Esfahbod
8a7a20c4b1 Fix indent 2015-01-02 13:14:26 -08:00
Behdad Esfahbod
b056318ca9 Ignore top four bytes of head table timestamps
Warn instead.
2015-01-02 13:08:57 -08:00
Behdad Esfahbod
15f2bb1e2f Fixup previous commit 2015-01-02 13:02:36 -08:00
Behdad Esfahbod
f0200def0c Refactor timestamp code into misc.timeTools 2015-01-02 12:53:16 -08:00
moyogo
2499ea3521 [TSI1] use tobytes() 2014-12-02 21:58:45 +00:00
moyogo
6021331a70 [TSI1] Use bytes literal 2014-12-02 21:45:21 +00:00
Behdad Esfahbod
3715f2d354 Unbreak Python3
Fixes https://github.com/behdad/fonttools/issues/197
2014-12-01 13:33:19 -08:00
Behdad Esfahbod
730bedd3d1 [AAT] Add support for 'feat' table
Reusing the otData machinery.

See discussion at:
https://github.com/behdad/fonttools/issues/178
https://github.com/behdad/fonttools/pull/180
2014-09-30 19:04:16 -04:00
Behdad Esfahbod
5dd64deacb [otData] add ULong types
In preparation for implementing AAT tables (slowly).
2014-09-30 18:55:57 -04:00
Jens Kutilek
5614845b03 Try again to put padding code for Glyph.graphicType in the right place 2014-09-30 15:16:52 -04:00
Jens Kutilek
c3b3fee638 Cleanup 2014-09-24 13:54:25 +03:00
Jens Kutilek
55d1d367c4 Use safeEval for attributes 2014-09-24 13:54:25 +03:00
Jens Kutilek
ad04a9e200 Dump sbix flags as a bit field 2014-09-24 13:54:25 +03:00
Jens Kutilek
035008bded Pad graphicType if len() < 4 2014-09-24 13:54:25 +03:00
Jens Kutilek
5d004eb936 Rename Bitmap to Glyph 2014-09-24 13:54:25 +03:00
Jens Kutilek
141188bd00 Renamed imageFormatTag to graphicType 2014-09-24 13:54:25 +03:00
Jens Kutilek
3c03e75e9f Nicer names 2014-09-24 13:54:24 +03:00
Jens Kutilek
2c4713ad0b Renamed bitmaps to glyphs 2014-09-24 13:54:24 +03:00
Jens Kutilek
2f94365340 Rename self.bitmapSets to self.strikes etc. 2014-09-24 13:54:24 +03:00
Jens Kutilek
9106d1d8e8 Rename sbixBitmapHeader... to sbixGlyphHeader... 2014-09-24 13:54:24 +03:00
Jens Kutilek
cb905522b1 Renamed sbixBitmapSet... to sbixStrike... 2014-09-24 13:54:24 +03:00
Jens Kutilek
473d57bef1 Renamed BitmapOffset to GlyphDataOffset 2014-09-24 13:54:24 +03:00