Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8a7b9ee

Browse files
Testing next example, still need to use our own implementation of Bézier
path by default.
1 parent 369d965 commit 8a7b9ee

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

Basics/E05_Drawing/E04_TextInPath.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,20 @@
2525
FILENAME = path2FileName(__file__)
2626

2727
def makeDrawing(contextName):
28+
'''
29+
Traceback (most recent call last):
30+
File "./E04_TextInPath.py", line 72, in <module>
31+
makeDrawing(contextName)
32+
File "./E04_TextInPath.py", line 36, in makeDrawing
33+
path = context.BezierPath()
34+
File "/Users/michiel/VirtualEnvironments/pagebot/lib/python3.8/site-packages/pagebot/contexts/basecontext/basecontext.py", line 1206, in BezierPath
35+
return self.b.BezierPath(path=path, glyphSet=glyphSet)
36+
AttributeError: module 'flat' has no attribute 'BezierPath'
37+
'''
38+
2839
exportPath = '%s/%s-%s.pdf' % (EXPORT, FILENAME, contextName)
29-
context = getContext('DrawBot')
40+
context = getContext(contextName)
3041
font = findFont(DEFAULT_FONT)
31-
32-
# FIXME: don't use DrawBot functions.
33-
#from drawBot import BezierPath, width, height, translate, scale, drawPath, \
34-
# font, fontSize, fill, textBox, saveImage
35-
3642
path = context.BezierPath()
3743
context.fill(1)
3844
# draw some text

Basics/E05_Drawing/E07_ParametricAxes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
# Supporting Flat, xxyxyz.org/flat
1212
# -----------------------------------------------------------------------------
1313
#
14-
# E21_MakeParametricAxes.py
14+
# E05_ParametricAxes.py
1515
#
16-
# This script is using getContext(), so it should be able to run it with flexContext.
1716
#
1817

1918
from pagebot import getContext
@@ -23,6 +22,7 @@
2322

2423
f = findFont('Amstelvar-Roman-VF')
2524
W = H = 1000
25+
2626
# Scale em of 2048 back to page size.
2727
s = 0.5
2828
FILENAME = path2FileName(__file__)

0 commit comments

Comments
 (0)