...
 
Commits (3)
......@@ -35,20 +35,26 @@ def clipExecute(subjectContours, clipContours, operation, subjectFillType="nonZe
pc = pyclipper.Pyclipper()
for i, subjectContour in enumerate(subjectContours):
# ignore paths with no area
if pyclipper.Area(subjectContour):
try:
pc.AddPath(subjectContour, pyclipper.PT_SUBJECT)
except pyclipper.ClipperException:
try:
pc.AddPath(subjectContour, pyclipper.PT_SUBJECT)
except pyclipper.ClipperException:
# skip invalid paths with no area
if pyclipper.Area(subjectContour) != 0:
raise InvalidSubjectContourError("contour %d is invalid for clipping" % i)
for j, clipContour in enumerate(clipContours):
# ignore paths with no area
if pyclipper.Area(clipContour):
try:
pc.AddPath(clipContour, pyclipper.PT_CLIP)
except pyclipper.ClipperException:
try:
pc.AddPath(clipContour, pyclipper.PT_CLIP)
except pyclipper.ClipperException:
# skip invalid paths with no area
if pyclipper.Area(clipContour) == 0:
raise InvalidClippingContourError("contour %d is invalid for clipping" % j)
bounds = pc.GetBounds()
if (bounds.bottom, bounds.left, bounds.top, bounds.right) == (0, 0, 0, 0):
# do nothing if there are no paths
return []
try:
solution = pc.Execute(_operationMap[operation],
_fillTypeMap[subjectFillType],
......
......@@ -3,20 +3,14 @@ environment:
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.x"
PYTHON_ARCH: "32"
TOXENV: "py27"
TOXPYTHON: "C:\\Python27\\python.exe"
- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "64"
TOXENV: "py36"
TOXPYTHON: "C:\\Python36-x64\\python.exe"
- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7.0"
PYTHON_ARCH: "64"
TOXENV: "py37"
TOXPYTHON: "C:\\Python37-x64\\python.exe"
init:
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
......@@ -41,4 +35,4 @@ install:
build: false
test_script:
- "tox"
- "tox -e py"
python-booleanoperations (0.8.2-1) UNRELEASED; urgency=medium
* New upstream version 0.8.2
-- Yao Wei (魏銘廷) <mwei@debian.org> Sat, 22 Dec 2018 20:31:47 +0800
python-booleanoperations (0.8.1-1) unstable; urgency=medium
* New upstream version 0.8.1
......
......@@ -24,20 +24,20 @@ if hasMojo:
for g in f:
g.leftMargin = 0
g.rightMargin = 0
n = g.naked()
n = g.naked()
d = g.getLayer("union")
d.clear()
d.appendGlyph(g)
d.removeOverlap(round=0)
if len(g) > 1:
for method in "xor", "difference", "intersection":
d = g.getLayer(method)
for method in "xor", "difference", "intersection":
d = g.getLayer(method)
d.clear()
func = getattr(booleanOperations, method)
func([n[0]], n[1:], d.getPointPen())
f.save()
f.save()
if hasMojo:
setDefault("glyphViewRoundValues", glyphViewRoundValues)
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ascender</key>
<integer>750</integer>
<key>capHeight</key>
<integer>750</integer>
<key>descender</key>
<integer>-250</integer>
<key>guidelines</key>
<array/>
<key>postscriptBlueValues</key>
<array/>
<key>postscriptFamilyBlues</key>
<array/>
<key>postscriptFamilyOtherBlues</key>
<array/>
<key>postscriptOtherBlues</key>
<array/>
<key>postscriptStemSnapH</key>
<array/>
<key>postscriptStemSnapV</key>
<array/>
<key>unitsPerEm</key>
<integer>1000</integer>
<key>xHeight</key>
<integer>500</integer>
</dict>
<dict>
<key>ascender</key>
<integer>750</integer>
<key>capHeight</key>
<integer>750</integer>
<key>descender</key>
<integer>-250</integer>
<key>guidelines</key>
<array/>
<key>postscriptBlueValues</key>
<array/>
<key>postscriptFamilyBlues</key>
<array/>
<key>postscriptFamilyOtherBlues</key>
<array/>
<key>postscriptOtherBlues</key>
<array/>
<key>postscriptStemSnapH</key>
<array/>
<key>postscriptStemSnapV</key>
<array/>
<key>unitsPerEm</key>
<integer>1000</integer>
<key>xHeight</key>
<integer>500</integer>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Q</key>
<string>Q_.glif</string>
<key>QTail_reversed</key>
<string>Q_T_ail_reversed.glif</string>
<key>ovalOval</key>
<string>ovalO_val.glif</string>
<key>ovalOval_reversed</key>
<string>ovalO_val_reversed.glif</string>
<key>ovalRect</key>
<string>ovalR_ect.glif</string>
<key>ovalRect_reversed</key>
<string>ovalR_ect_reversed.glif</string>
<key>rectOval</key>
<string>rectO_val.glif</string>
<key>rectOval_reversed</key>
<string>rectO_val_reversed.glif</string>
<key>rectRect</key>
<string>rectR_ect.glif</string>
<key>rectRect_reversed</key>
<string>rectR_ect_reversed.glif</string>
</dict>
<dict>
<key>Q</key>
<string>Q_.glif</string>
<key>QTail_reversed</key>
<string>Q_T_ail_reversed.glif</string>
<key>ovalOval</key>
<string>ovalO_val.glif</string>
<key>ovalOval_reversed</key>
<string>ovalO_val_reversed.glif</string>
<key>ovalRect</key>
<string>ovalR_ect.glif</string>
<key>ovalRect_reversed</key>
<string>ovalR_ect_reversed.glif</string>
<key>rectOval</key>
<string>rectO_val.glif</string>
<key>rectOval_reversed</key>
<string>rectO_val_reversed.glif</string>
<key>rectRect</key>
<string>rectR_ect.glif</string>
<key>rectRect_reversed</key>
<string>rectR_ect_reversed.glif</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>color</key>
<string>0,1,1,0.7</string>
<key>lib</key>
<dict>
<key>com.typemytype.robofont.segmentType</key>
<string>curve</string>
</dict>
</dict>
<dict>
<key>color</key>
<string>0,1,1,0.7</string>
<key>lib</key>
<dict>
<key>com.typemytype.robofont.segmentType</key>
<string>curve</string>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Q</key>
<string>Q_.glif</string>
<key>QTail_reversed</key>
<string>Q_T_ail_reversed.glif</string>
<key>ovalOval</key>
<string>ovalO_val.glif</string>
<key>ovalOval_reversed</key>
<string>ovalO_val_reversed.glif</string>
<key>ovalRect</key>
<string>ovalR_ect.glif</string>
<key>ovalRect_reversed</key>
<string>ovalR_ect_reversed.glif</string>
<key>rectOval</key>
<string>rectO_val.glif</string>
<key>rectOval_reversed</key>
<string>rectO_val_reversed.glif</string>
<key>rectRect</key>
<string>rectR_ect.glif</string>
<key>rectRect_reversed</key>
<string>rectR_ect_reversed.glif</string>
</dict>
<dict>
<key>Q</key>
<string>Q_.glif</string>
<key>QTail_reversed</key>
<string>Q_T_ail_reversed.glif</string>
<key>ovalOval</key>
<string>ovalO_val.glif</string>
<key>ovalOval_reversed</key>
<string>ovalO_val_reversed.glif</string>
<key>ovalRect</key>
<string>ovalR_ect.glif</string>
<key>ovalRect_reversed</key>
<string>ovalR_ect_reversed.glif</string>
<key>rectOval</key>
<string>rectO_val.glif</string>
<key>rectOval_reversed</key>
<string>rectO_val_reversed.glif</string>
<key>rectRect</key>
<string>rectR_ect.glif</string>
<key>rectRect_reversed</key>
<string>rectR_ect_reversed.glif</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>color</key>
<string>0,0.25,1,0.7</string>
<key>lib</key>
<dict>
<key>com.typemytype.robofont.segmentType</key>
<string>curve</string>
</dict>
</dict>
<dict>
<key>color</key>
<string>0,0.25,1,0.7</string>
<key>lib</key>
<dict>
<key>com.typemytype.robofont.segmentType</key>
<string>curve</string>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Q</key>
<string>Q_.glif</string>
<key>QTail_reversed</key>
<string>Q_T_ail_reversed.glif</string>
<key>oval</key>
<string>oval.glif</string>
<key>ovalOval</key>
<string>ovalO_val.glif</string>
<key>ovalOval_reversed</key>
<string>ovalO_val_reversed.glif</string>
<key>ovalRect</key>
<string>ovalR_ect.glif</string>
<key>ovalRect_reversed</key>
<string>ovalR_ect_reversed.glif</string>
<key>oval_differentStartPoint</key>
<string>oval_differentS_tartP_oint.glif</string>
<key>rect</key>
<string>rect.glif</string>
<key>rectOval</key>
<string>rectO_val.glif</string>
<key>rectOval_reversed</key>
<string>rectO_val_reversed.glif</string>
<key>rectRect</key>
<string>rectR_ect.glif</string>
<key>rectRect_reversed</key>
<string>rectR_ect_reversed.glif</string>
<key>rect_differentStartPoint</key>
<string>rect_differentS_tartP_oint.glif</string>
</dict>
<dict>
<key>Q</key>
<string>Q_.glif</string>
<key>QTail_reversed</key>
<string>Q_T_ail_reversed.glif</string>
<key>oval</key>
<string>oval.glif</string>
<key>ovalOval</key>
<string>ovalO_val.glif</string>
<key>ovalOval_reversed</key>
<string>ovalO_val_reversed.glif</string>
<key>ovalRect</key>
<string>ovalR_ect.glif</string>
<key>ovalRect_reversed</key>
<string>ovalR_ect_reversed.glif</string>
<key>oval_differentStartPoint</key>
<string>oval_differentS_tartP_oint.glif</string>
<key>rect</key>
<string>rect.glif</string>
<key>rectOval</key>
<string>rectO_val.glif</string>
<key>rectOval_reversed</key>
<string>rectO_val_reversed.glif</string>
<key>rectRect</key>
<string>rectR_ect.glif</string>
<key>rectRect_reversed</key>
<string>rectR_ect_reversed.glif</string>
<key>rect_differentStartPoint</key>
<string>rect_differentS_tartP_oint.glif</string>
<key>zeroArea</key>
<string>zeroA_rea.glif</string>
<key>zeroAreaSelfIntersecting</key>
<string>zeroA_reaS_elfI_ntersecting.glif</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>color</key>
<string>0.5,1,0,0.7</string>
<key>lib</key>
<dict>
<key>com.typemytype.robofont.segmentType</key>
<string>curve</string>
</dict>
</dict>
<dict>
<key>color</key>
<string>0.5,1,0,0.7</string>
<key>lib</key>
<dict>
<key>com.typemytype.robofont.segmentType</key>
<string>curve</string>
</dict>
</dict>
</plist>
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="zeroArea" format="2">
<advance width="400"/>
<outline>
</outline>
</glyph>
\ No newline at end of file
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="zeroAreaSelfIntersecting" format="2">
<advance width="500"/>
<outline>
<contour>
<point x="0" y="200" type="line"/>
<point x="400" y="0" type="line"/>
<point x="200" y="200" type="line"/>
<point x="400" y="200" type="line"/>
<point x="0" y="400" type="line"/>
<point x="200" y="200" type="line"/>
</contour>
</outline>
</glyph>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Q</key>
<string>Q_.glif</string>
<key>QTail_reversed</key>
<string>Q_T_ail_reversed.glif</string>
<key>ovalOval</key>
<string>ovalO_val.glif</string>
<key>ovalOval_reversed</key>
<string>ovalO_val_reversed.glif</string>
<key>ovalRect</key>
<string>ovalR_ect.glif</string>
<key>ovalRect_reversed</key>
<string>ovalR_ect_reversed.glif</string>
<key>rectOval</key>
<string>rectO_val.glif</string>
<key>rectOval_reversed</key>
<string>rectO_val_reversed.glif</string>
<key>rectRect</key>
<string>rectR_ect.glif</string>
<key>rectRect_reversed</key>
<string>rectR_ect_reversed.glif</string>
</dict>
<dict>
<key>Q</key>
<string>Q_.glif</string>
<key>QTail_reversed</key>
<string>Q_T_ail_reversed.glif</string>
<key>ovalOval</key>
<string>ovalO_val.glif</string>
<key>ovalOval_reversed</key>
<string>ovalO_val_reversed.glif</string>
<key>ovalRect</key>
<string>ovalR_ect.glif</string>
<key>ovalRect_reversed</key>
<string>ovalR_ect_reversed.glif</string>
<key>rectOval</key>
<string>rectO_val.glif</string>
<key>rectOval_reversed</key>
<string>rectO_val_reversed.glif</string>
<key>rectRect</key>
<string>rectR_ect.glif</string>
<key>rectRect_reversed</key>
<string>rectR_ect_reversed.glif</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>color</key>
<string>0,1,0.25,0.7</string>
<key>lib</key>
<dict>
<key>com.typemytype.robofont.segmentType</key>
<string>curve</string>
</dict>
</dict>
<dict>
<key>color</key>
<string>0,1,0.25,0.7</string>
<key>lib</key>
<dict>
<key>com.typemytype.robofont.segmentType</key>
<string>curve</string>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Q</key>
<string>Q_.glif</string>
<key>QTail_reversed</key>
<string>Q_T_ail_reversed.glif</string>
<key>oval</key>
<string>oval.glif</string>
<key>ovalOval</key>
<string>ovalO_val.glif</string>
<key>ovalOval_reversed</key>
<string>ovalO_val_reversed.glif</string>
<key>ovalRect</key>
<string>ovalR_ect.glif</string>
<key>ovalRect_reversed</key>
<string>ovalR_ect_reversed.glif</string>
<key>oval_differentStartPoint</key>
<string>oval_differentS_tartP_oint.glif</string>
<key>rect</key>
<string>rect.glif</string>
<key>rectOval</key>
<string>rectO_val.glif</string>
<key>rectOval_reversed</key>
<string>rectO_val_reversed.glif</string>
<key>rectRect</key>
<string>rectR_ect.glif</string>
<key>rectRect_reversed</key>
<string>rectR_ect_reversed.glif</string>
<key>rect_differentStartPoint</key>
<string>rect_differentS_tartP_oint.glif</string>
</dict>
<dict>
<key>Q</key>
<string>Q_.glif</string>
<key>QTail_reversed</key>
<string>Q_T_ail_reversed.glif</string>
<key>oval</key>
<string>oval.glif</string>
<key>ovalOval</key>
<string>ovalO_val.glif</string>
<key>ovalOval_reversed</key>
<string>ovalO_val_reversed.glif</string>
<key>ovalRect</key>
<string>ovalR_ect.glif</string>
<key>ovalRect_reversed</key>
<string>ovalR_ect_reversed.glif</string>
<key>oval_differentStartPoint</key>
<string>oval_differentS_tartP_oint.glif</string>
<key>rect</key>
<string>rect.glif</string>
<key>rectOval</key>
<string>rectO_val.glif</string>
<key>rectOval_reversed</key>
<string>rectO_val_reversed.glif</string>
<key>rectRect</key>
<string>rectR_ect.glif</string>
<key>rectRect_reversed</key>
<string>rectR_ect_reversed.glif</string>
<key>rect_differentStartPoint</key>
<string>rect_differentS_tartP_oint.glif</string>
<key>zeroArea</key>
<string>zeroA_rea.glif</string>
<key>zeroAreaSelfIntersecting</key>
<string>zeroA_reaS_elfI_ntersecting.glif</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>color</key>
<string>1,0.75,0,0.7</string>
<key>lib</key>
<dict>
<key>com.typemytype.robofont.segmentType</key>
<string>curve</string>
</dict>
</dict>
<dict>
<key>color</key>
<string>1,0.75,0,0.7</string>
<key>lib</key>
<dict>
<key>com.typemytype.robofont.segmentType</key>
<string>curve</string>
</dict>
</dict>
</plist>
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="zeroArea" format="2">
<advance width="400"/>
<outline>
<contour>
<point x="0.0" y="200.0" type="line"/>
<point x="400.0" y="200.0" type="line"/>
</contour>
</outline>
</glyph>
\ No newline at end of file
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="zeroAreaSelfIntersecting" format="2">
<advance width="400"/>
<outline>
<contour>
<point x="0.0" y="200.0" type="line"/>
<point x="400.0" y="200.0" type="line"/>
<point x="0.0" y="400.0" type="line"/>
<point x="400.0" y="0.0" type="line"/>
</contour>
</outline>
</glyph>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<array>
<string>foreground</string>
<string>glyphs</string>
</array>
<array>
<string>union</string>
<string>glyphs.union</string>
</array>
<array>
<string>xor</string>
<string>glyphs.xor</string>
</array>
<array>
<string>difference</string>
<string>glyphs.difference</string>
</array>
<array>
<string>intersection</string>
<string>glyphs.intersection</string>
</array>
</array>
<array>
<array>
<string>foreground</string>
<string>glyphs</string>
</array>
<array>
<string>union</string>
<string>glyphs.union</string>
</array>
<array>
<string>xor</string>
<string>glyphs.xor</string>
</array>
<array>
<string>difference</string>
<string>glyphs.difference</string>
</array>
<array>
<string>intersection</string>
<string>glyphs.intersection</string>
</array>
</array>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>public.glyphOrder</key>
<array>
<string>oval</string>
<string>rect</string>
<string>rectRect</string>
<string>ovalRect</string>
<string>rectOval</string>
<string>ovalOval</string>
<string>Q</string>
<string>QTail_reversed</string>
<string>ovalOval_reversed</string>
<string>ovalRect_reversed</string>
<string>rectOval_reversed</string>
<string>rectRect_reversed</string>
<string>rectOval_reversed</string>
<string>rectRect_reversed</string>
<string>oval_differentStartPoint</string>
<string>rect_differentStartPoint</string>
<string>oval_differentStartPoint</string>
<string>rect_differentStartPoint</string>
</array>
</dict>
<dict>
<key>com.typemytype.robofont.segmentType</key>
<string>curve</string>
<key>public.glyphOrder</key>
<array>
<string>oval</string>
<string>rect</string>
<string>rectRect</string>
<string>ovalRect</string>
<string>rectOval</string>
<string>ovalOval</string>
<string>Q</string>
<string>QTail_reversed</string>
<string>ovalOval_reversed</string>
<string>ovalRect_reversed</string>
<string>rectOval_reversed</string>
<string>rectRect_reversed</string>
<string>oval_differentStartPoint</string>
<string>rect_differentStartPoint</string>
<string>zeroAreaSelfIntersecting</string>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>creator</key>
<string>org.robofab.ufoLib</string>
<key>formatVersion</key>
<integer>3</integer>
</dict>
<dict>
<key>creator</key>
<string>com.github.fonttools.ufoLib</string>
<key>formatVersion</key>
<integer>3</integer>
</dict>
</plist>
# run in DrawBot RoboFont extension
border = 20
dotSize = 10
offDotSize = dotSize * .5
try:
CurrentFont
except NameError:
class CurrentFont(dict):
glyphOrder = []
def save(self, path=None):
pass
try:
saveImage
except NameError:
def saveImage(*args, **kwargs):
pass
f = CurrentFont()
def drawOffCurve(anchor, off):
x, y = anchor
offx, offy = off
if offx or offy:
offx += x
offy += y
with savedState():
stroke(1, 0, 0)
fill(1, 0, 0)
line((x, y), (offx, offy))
oval(offx - offDotSize, offy - offDotSize, offDotSize * 2, offDotSize * 2)
def drawGlyphWithPoints(glyph):
fill(0, .1)
stroke(0)
drawGlyph(glyph)
stroke(None)
for contour in glyph:
fill(0, 1, 0)
for point in contour.bPoints:
x, y = point.anchor
drawOffCurve((x, y), point.bcpIn)
drawOffCurve((x, y), point.bcpOut)
oval(x - dotSize, y - dotSize, dotSize * 2, dotSize * 2)
fill(1, 0, 0)
for glyphName in f.glyphOrder:
if glyphName not in f:
continue
g = f[glyphName]
bounds = g.bounds
if not bounds:
continue
minx, miny, maxx, maxy = bounds
w = maxx - minx
h = maxy - miny
layerCount = len(f.layers)
newPage((w + border) * layerCount + border, h + border * 2 + 100)
translate(border, border + 100)
translate(-minx, -miny)
fontSize(20)
stroke()
text("%s" % g.name, (w * .5, -100 + miny), align="center")
drawGlyphWithPoints(g)
translate(w + border, 0)
for layer in f.layers:
if layer.name == "foreground":
continue
fill(0)
text(layer.name, (w * .5, -100 + miny), align="center")
if g.name not in layer:
translate(w + border)
continue
lg = layer[g.name]
drawGlyphWithPoints(lg)
translate(w + border)
saveImage("visualTest.pdf")
\ No newline at end of file
......@@ -2,13 +2,6 @@
envlist = py{27,36,37}
[testenv]
basepython =
# we use TOXPYTHON env variable to specify the location of Appveyor Python
py27: {env:TOXPYTHON:python2.7}
py34: {env:TOXPYTHON:python3.4}
py35: {env:TOXPYTHON:python3.5}
py36: {env:TOXPYTHON:python3.6}
py37: {env:TOXPYTHON:python3.7}
deps =
defcon
fontPens
......