Skip to content

Commit 945c6f3

Browse files
committed
adding dummy classes and functions
1 parent efda3d1 commit 945c6f3

2 files changed

Lines changed: 30 additions & 14 deletions

File tree

tests/testData/generateGlyphDataRoboFont.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ def save(self, path=None):
2424
for g in f:
2525
g.leftMargin = 0
2626
g.rightMargin = 0
27-
n = g.naked()
27+
n = g.naked()
2828
d = g.getLayer("union")
2929
d.clear()
3030
d.appendGlyph(g)
3131
d.removeOverlap(round=0)
3232

3333
if len(g) > 1:
34-
for method in "xor", "difference", "intersection":
35-
d = g.getLayer(method)
34+
for method in "xor", "difference", "intersection":
35+
d = g.getLayer(method)
3636
d.clear()
3737
func = getattr(booleanOperations, method)
3838
func([n[0]], n[1:], d.getPointPen())
3939

40-
f.save()
40+
f.save()
4141

4242
if hasMojo:
4343
setDefault("glyphViewRoundValues", glyphViewRoundValues)

tests/testData/visualTest.py

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,30 @@
33
dotSize = 10
44
offDotSize = dotSize * .5
55

6+
try:
7+
CurrentFont
8+
except NameError:
9+
class CurrentFont(dict):
10+
11+
glyphOrder = []
12+
13+
def save(self, path=None):
14+
pass
15+
16+
try:
17+
saveImage
18+
except NameError:
19+
def saveImage(*args, **kwargs):
20+
pass
21+
622

723
f = CurrentFont()
824

925

1026
def drawOffCurve(anchor, off):
1127
x, y = anchor
12-
offx, offy = off
13-
if offx or offy:
28+
offx, offy = off
29+
if offx or offy:
1430
offx += x
1531
offy += y
1632
with savedState():
@@ -25,28 +41,28 @@ def drawGlyphWithPoints(glyph):
2541
stroke(0)
2642
drawGlyph(glyph)
2743
stroke(None)
28-
44+
2945
for contour in glyph:
3046
fill(0, 1, 0)
31-
for point in contour.bPoints:
47+
for point in contour.bPoints:
3248
x, y = point.anchor
3349
drawOffCurve((x, y), point.bcpIn)
34-
drawOffCurve((x, y), point.bcpOut)
50+
drawOffCurve((x, y), point.bcpOut)
3551
oval(x - dotSize, y - dotSize, dotSize * 2, dotSize * 2)
3652
fill(1, 0, 0)
37-
53+
3854

3955
for glyphName in f.glyphOrder:
4056
if glyphName not in f:
41-
continue
57+
continue
4258
g = f[glyphName]
4359
bounds = g.bounds
4460
if not bounds:
4561
continue
4662
minx, miny, maxx, maxy = bounds
4763
w = maxx - minx
4864
h = maxy - miny
49-
layerCount = len(f.layers)
65+
layerCount = len(f.layers)
5066
newPage((w + border) * layerCount + border, h + border * 2 + 100)
5167
translate(border, border + 100)
5268
translate(-minx, -miny)
@@ -63,9 +79,9 @@ def drawGlyphWithPoints(glyph):
6379
if g.name not in layer:
6480
translate(w + border)
6581
continue
66-
lg = layer[g.name]
82+
lg = layer[g.name]
6783
drawGlyphWithPoints(lg)
6884
translate(w + border)
69-
85+
7086

7187
saveImage("visualTest.pdf")

0 commit comments

Comments
 (0)