Skip to content

Commit

Permalink
Add some notes to the readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
LettError committed Apr 4, 2018
1 parent a0b30cc commit b677db2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Lib/ufoProcessor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def getUFOVersion(ufoPath):
return p.get('formatVersion')

def swapGlyphNames(font, oldName, newName, swapNameExtension = "_______________swap"):
# In font swap the glyphs oldName and newName.
# Also swap the names in components in order to preserve appearance.
# Also swap the names in font groups.
if not oldName in font or not newName in font:
return None
swapName = oldName + swapNameExtension
Expand All @@ -123,7 +126,6 @@ def swapGlyphNames(font, oldName, newName, swapNameExtension = "_______________s
font[oldName].drawPoints(p)
font[swapName].width = font[oldName].width
# lib?

font[oldName].clear()
p = font[oldName].getPointPen()
font[newName].drawPoints(p)
Expand Down Expand Up @@ -186,6 +188,7 @@ def swapGlyphNames(font, oldName, newName, swapNameExtension = "_______________s
for r in remove:
del font[r]


class DecomposePointPen(object):

def __init__(self, glyphSet, outPointPen):
Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# ufoProcessor
Python package based on the **designSpaceDocument** (now fontTools.designSpaceLib) specifically to process and generate UFO files.
Python package based on the **designSpaceDocument** (now [fontTools.designspaceLib](https://github.com/fonttools/fonttools/tree/master/Lib/fontTools/designspaceLib)) specifically to process and generate UFO files.

When the dust of the move has settled I'll make the remove `designSpaceDocument.py` and point to the current file at fontTools. In the mean time and for the sake of continuity (and keeping some things running) it is here.
* Collect source materials
* Provide Mutators for specific glyphs, font info, kerning so that other tools can generate partial instances.
* Generate actual UFO instances in formats 2 and 3.
* Round geometry as requested
* Try to stay up to date with fontTools
*

## Usage
The easiest way to use ufoProcessor is to call `build(designspacePath)`

* documentPath: path to the designspace file.
* outputUFOFormatVersion: integer, 2, 3. Format for generated UFOs. Note: can be different from source UFO format.
* roundGeometry: bool, if the geometry needs to be rounded to whole integers.
* processRules: bool, execute designspace rules as swaps.
* logger: optional logger object.

0 comments on commit b677db2

Please sign in to comment.