40 Commits

Author SHA1 Message Date
Behdad Esfahbod
7fadfa4e81 Revert "refactor: pass isfinal argument spelled-out not a number"
This reverts commit 6d65a87301b6c746ae0ec1dc1cf0df75c0c21d63.

https://github.com/fonttools/fonttools/pull/3669#issuecomment-2428475144
2024-10-22 01:34:48 -06:00
Robin
6d65a87301 refactor: pass isfinal argument spelled-out not a number 2024-10-22 01:28:05 -06:00
Cosimo Lupo
e8f8a6c40d xmlReader: join consecutive text data that had been cut by buffered parser
Fixes https://github.com/fonttools/fonttools/issues/2614
2023-05-22 12:22:41 +01:00
Nikolaus Waxweiler
d584daa8fd Blacken code 2022-12-13 11:26:36 +00:00
Just van Rossum
b01ea60e9e
[ttLib] when importing XML, only set sfntVersion if the font has no reader and is empty (#2376)
* Only set sfntVersion if the font has no reader and is empty

* test that sfntVersion is only set if the TTFont instance is new/empty
2021-07-24 11:12:37 +02:00
Just van Rossum
5fc65d7168
Misc py23 cleanups (#2243)
* Replaced all from ...py23 import * with explicit name imports, or removed completely when possible.
* Replaced tounicode() with tostr()
* Changed all BytesIO ans StringIO imports to from io import ..., replaced all UnicodeIO with StringIO.
* Replaced all unichr() with chr()
* Misc minor tweaks and fixes
2021-03-29 11:45:58 +02:00
Nikolaus Waxweiler
01328213c7 Remove __future__ imports 2019-08-09 12:20:13 +01:00
Cosimo Lupo
6473cc9349
add more tests for userNameToFilename function
plus minor whitespace
2018-02-28 12:26:52 +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
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
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
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
b61b92a96a Fix inconsistent tab/space usage, for Python 3 2017-01-03 16:35:37 +01:00
Behdad Esfahbod
3820a3006f XMLReader: Allow parsing XML without <ttFont> root element 2017-01-02 23:23:44 -05:00
Cosimo Lupo
e8c8bb75b1 xmlReader: must import sys
used at line 22 to read from stdin
2016-04-10 22:59:02 +01:00
Cosimo Lupo
de5dca010b [xmlReader] replace print with logger; deprecate 'quiet' argument 2016-01-27 19:01:12 +00:00
Cosimo Lupo
8933062db0 xmlReader: make xmlReader accept file objects
Fixes https://github.com/behdad/fonttools/issues/404

Also, fixed typo for ProgressPrinter method call: 'setlabel' -> 'setLabel'
2015-12-07 19:31:33 +00:00
Cosimo Lupo
edeb2c6c98 [xmlReader] open file for reading bytes 2015-07-24 16:59:07 +01:00
Cosimo Lupo
76c05ae052 Revert "[xmlReader] always open files using UTF-8 encoding"
This reverts commit 6b4567fcde138b069b1323d3127c103d007592cd.
2015-07-24 16:59:06 +01:00
Cosimo Lupo
fbdab03a1d Revert "[xmlReader] make expat parser use UTF-8"
This reverts commit fe76598a80b16ed078606090470f491e4aadb660.
2015-07-24 16:59:06 +01:00
Cosimo Lupo
fe76598a80 [xmlReader] make expat parser use UTF-8 2015-07-23 17:03:31 +01:00
Cosimo Lupo
6b4567fcde [xmlReader] always open files using UTF-8 encoding
If no "encoding" argument is provided to Python3 `open`, the default plaftorm's encoding (cp1252 on Windows) is used when decoding bytes to unicode strings.
So, we use the `io.open` function (i.e. a backport of Python3 default file interface) with `encoding="utf_8"` argument.

Fixes https://github.com/behdad/fonttools/issues/323
2015-07-23 16:36:48 +01:00
Behdad Esfahbod
b30e12ae00 More whitespace 2015-04-26 02:01:01 -04:00
Behdad Esfahbod
bd67253118 Some more whitespace fixes from pep8 tool 2015-04-26 01:59:01 -04:00
Behdad Esfahbod
e3d7d71b7a Allow setting 'raw' attrs on XML for tables to be loaded from hex
Previously one had to set the 'ERROR' attribute.  Accept raw also.
So, for example one can say:

  <cmap raw="1">
    <!-- Hand-coded format13 table mapping all Unicode
         characters to .notdef glyph. -->
    <hexdata>
      0000 0001 <!-- version numTables -->
        0000 0006 <!-- platformID encodingID -->
        0000000C  <!-- offset -->
          000D 0000 <!-- format reserved -->
          0000001C  <!-- length -->
          00000000  <!-- language -->
          00000001  <!-- nGroups -->
            00000001  <!-- startCharCode -->
            0010FFFE  <!-- endCharCode -->
            00000001  <!-- glyphID -->
    </hexdata>
  </cmap>
2014-01-31 18:06:24 -05: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
cc43f3a15c Fixup 2013-12-04 01:17:21 -05: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
e388db566b py23 Use new-style classes
Such that we get the same semantics in both Python 2 and 3.
2013-11-28 18:53:30 -05:00
Behdad Esfahbod
5f6418d9e1 py23 Turn Unicode XML parsing on; more bytes fixes 2013-11-28 17:32:43 -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
180ace6a5f 2to3 --fix=ne 2013-11-27 02:40:30 -05:00
Behdad Esfahbod
bc5e1cb195 2to3 --fix=has_key 2013-11-27 02:33:03 -05:00
Behdad Esfahbod
3ebfea491e Move fontTools.ttLib.importXML to fontTools.misc.xmlReader
Better matches xmlWriter.
2013-11-24 19:00:59 -05:00