Nathan Williis
3cafab8d50
Docs: reconfigure ufoLib documentation.
2024-09-17 17:11:39 +01:00
Nathan Williis
e7c78970ce
Docs: fix code-example blocks in ufoLib.
2024-09-03 17:52:20 +01:00
Nathan Williis
c19b1c5148
Docs: move module docstrings to first line of file, as per PEP 257.
2024-09-02 17:18:41 +01:00
Khaled Hosny
cf08265cd5
Black
2024-02-06 15:47:35 +02:00
Nikolaus Waxweiler
d584daa8fd
Blacken code
2022-12-13 11:26:36 +00:00
Cosimo Lupo
5ca57917c6
fix UFOFormatVersion tuple's __str__ in python 3.11
...
python 3.11 doesn't like when a mixin overrides a dunder method like __str__, for some reasons it keep using Enum.__str__, see
https://github.com/fonttools/fonttools/pull/2655
2022-07-06 11:13:55 +01:00
Simon Cozens
0f03e6529a
[docs] Fix sphinx warnings ( #2453 )
...
* Add default auto doc options
* Ensure all references are unique
* Use anonymous links to avoid duplicate references
* Remove default options, fix wrong module name
* Don’t index repeated class
* Remove repeated classes included through automodule
* Fix warnings
* We don’t use our own static directory
* Correctly format XML in docs
* Fix indentation
* Fix overline
* Bring TOC to top
* Fix definition list
* Offset definition lists and examples
* Fix erroneous markup
* Fix markup
* Already included in automodule
* Fix args markup
* Correct markup for example
* Don’t reindex repeated module
* Correct XML code block markup
* Fix markup errors, change example to doctest
* Correct list markup
* Make ttx docstring both valid RST and valid help output
* Various other boring markup fixes
* Fix example indenting
* Make docstring valid RST and valid help output
* Mock import for reportlab
* It’s ok if manual links don’t appear in toctrees
* Oops typo, I guess doctests are useful
2021-12-02 15:31:49 +00:00
Nikolaus Waxweiler
8ca141852d
UFOReader: always expect contents.plist
2020-11-23 14:34:16 +00:00
Nikolaus Waxweiler
8d2a3ae6d2
Add expectContentsFile parameter to GlyphSet
...
For use when reading existing UFOs, to comply with the specification stating that a contents.plist file must exist in a glyph set.
Closes https://github.com/fonttools/fonttools/issues/2111 .
2020-11-23 13:57:32 +00:00
Tom Archer
0b93480808
Change startwith or statement to use tupple of strings rather than or.
2020-05-22 15:56:48 +01:00
Tom Archer
b88f717885
Get test working that shows duplicates are removed
2020-05-22 09:53:40 +01:00
Tom Archer
2b654a1d2a
Add code that removes duplicates when parsing groups.plist
2020-05-20 11:59:16 +01:00
Cosimo Lupo
c57e843d1f
UFOReader: close underlying fs object if UFOLibError raised in constructor
2020-05-07 16:53:38 +01:00
Cosimo Lupo
57f4904363
ufoLib/glifLib: use TupleEnum instead of namedtuple for {UFO,GLIF}FormatVersion
...
Also add dedicated Unsupported{UFO,GLIF}Format exceptions in
fontTools.ufoLib.errors module
2020-05-07 16:53:38 +01:00
Cosimo Lupo
c066cfc4d5
WIP: ufoLib: support UFO formatVersionMinor and GLIF formatMinor
2020-05-05 18:52:30 +01:00
Nikolaus Waxweiler
f30e41b863
[ufoLib] Only write fontinfo.plist when there is content
2020-04-30 11:11:43 +01:00
Cosimo Lupo
8423e01a18
ufoLib: don't crash if UFO2 has openTypeHheaCaretOffset=0.0
...
validators are picky so give them integers when they want integers
2020-02-15 13:25:45 +00:00
Jens Kutilek
6c3edaded2
ufoLib groupnames conversion 2 → 3 ( #1762 )
...
* If a group name is the same as a glyph name, it cannot be a kerning group name
* Add test
2019-11-22 09:51:35 +01:00
Nikolaus Waxweiler
cf2fd0671b
Assume layer and glyph names are always str
2019-09-14 22:11:20 +01:00
Nikolaus Waxweiler
562052bb86
Don't allow byte layer names
2019-09-14 21:55:46 +01:00
Nikolaus Waxweiler
9825553e06
Use !r in-string formatter syntax instead of repr(value)
2019-09-13 18:45:19 +01:00
Nikolaus Waxweiler
b51a2b616e
Minor: revert docstring change
2019-09-13 18:28:08 +01:00
Nikolaus Waxweiler
51c8a7a3e1
Remove some unused imports
2019-09-13 18:27:05 +01:00
Nikolaus Waxweiler
0f5b6e2e83
Reduce use of py23
2019-09-13 18:27:05 +01:00
Nikolaus Waxweiler
66dec63231
Trim now redundant code in ufoLib.utils
2019-09-13 18:27:05 +01:00
Nikolaus Waxweiler
bc344380e8
Upgrade syntax to Python 3.6+
2019-09-13 18:27:05 +01:00
Nikolaus Waxweiler
01328213c7
Remove __future__ imports
2019-08-09 12:20:13 +01:00
justvanrossum
faadb91c8b
remove leftover comma, should fix #1666
2019-07-22 15:53:42 +02:00
Cosimo Lupo
42ab9aba57
[ufoLib] rename deprecated fs.setbytes -> writebytes
...
Follow up of #1445
Fixes #1424
2019-01-15 11:07:04 +00:00
Nikolaus Waxweiler
f47fee933c
ufoLib, fs calls: Replace deprecated getbytes with readbytes ( #1445 )
...
fs 2.2.0 comes with some renamed APIs.
2019-01-15 09:49:24 +00:00
Cosimo Lupo
78f572294f
Revert "UFOReader: have readInfo return a dict"
...
This reverts commit 440c71345a88f32ccad06d662fb30272f9253f07.
2018-10-25 16:55:59 +01:00
Cosimo Lupo
440c71345a
UFOReader: have readInfo return a dict
...
but keep current behavior whereby caller can pass an Info object.
The readInfo method was the only one that takes an output argument,
all the others just return some raw data.
I like to fully construct my classes in their __init__ method.
E.g. Info(**reader.readInfo())
2018-10-25 15:36:08 +01:00
Cosimo Lupo
59d9abf5f3
UFOReader: getFileModificationTime should be without leading underscore
...
that's what it's currently in UFOReader. The UFOWriter and GlyphSet will gain that one for free.
2018-10-24 17:43:47 +01:00
Cosimo Lupo
46ffe7ef42
reuse __enter__, __exit__ and close methods from UFOReader superclass
2018-10-24 14:14:37 +01:00
Cosimo Lupo
8cc613fda3
ufoLib: remove stray print()
...
I forgot this in a previous commit
2018-10-24 12:37:37 +01:00
Cosimo Lupo
7f3bf46096
ufoLib: use a single (abstract) base class for sharing methods between UFOReader, UFOWriter and GlyphSet
2018-10-23 20:41:35 +01:00
Cosimo Lupo
0a9e1e56ef
ufoLib: Add UFOReaderWriter alias of UFOWriter
2018-10-23 20:40:53 +01:00
Cosimo Lupo
3167e31be8
ufoLib: also reuse _readLayerContents method
...
plus fix some redundant 2to3 left-overs
2018-10-23 20:30:52 +01:00
Cosimo Lupo
f997005fb7
make UFOWriter a subclass of UFOReader, use mixins for shared methods
2018-10-23 19:43:37 +01:00
Cosimo Lupo
1a14b38de2
UFOWriter: normalize path by removing trailing slashes
...
or else os.path.dirname(Font.ufo/) would think that the directory doesn't exist...
2018-10-23 19:10:39 +01:00
Cosimo Lupo
fe4381df56
ufoLib: add readData, writeData and removeData methods
2018-10-21 15:42:02 +01:00
Ben Kiel
8bb9d0ed6c
Change UFOLib creator
2018-10-19 11:25:52 -05:00
Cosimo Lupo
176b5f763d
change 'import ufoLib' to 'import fontTools.ufoLib'
2018-10-17 17:43:28 +01:00
Cosimo Lupo
7cd80a37dd
move Lib/ufoLib to Lib/fontTools/ufoLib
2018-10-17 17:05:17 +01:00