Commit d8e783af authored by Yao Wei (魏銘廷)'s avatar Yao Wei (魏銘廷)

New upstream version 0.8.2

parent 8e37fa84
......@@ -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"
......@@ -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>