-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInterpolation_Proof.py
44 lines (33 loc) · 1.29 KB
/
Interpolation_Proof.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from datetime import datetime
margin = 30
paths = ["Maurizio-HairlineItalic.otf", "Maurizio-ThinItalic.otf", "Maurizio-UltraLightItalic.otf", "Maurizio-LightItalic.otf", "Maurizio-RegularItalic.otf", "Maurizio-MediumItalic.otf", "Maurizio-BoldItalic.otf", "Maurizio-ExtraBoldItalic.otf", "Maurizio-BlackItalic.otf"]
fontNames = []
pageNumber = 1
timestamp = datetime.now().strftime('%Y-%m-%d %H:%M')
timestampFile = datetime.now().strftime('%Y-%m-%d_%H-%M')
for path in paths:
fontNames.append(installFont(path))
print(fontNames)
font("Maurizio-HairlineItalic")
allGlyphs = listFontGlyphNames()
txt = FormattedString()
txt.fontSize(100)
txt.lineHeight(115)
#goes through all glyphs in the font
for glyph in allGlyphs:
#goes throug all weights imported
for font in fontNames:
txt.font(font)
txt.appendGlyph(glyph)
# make new page when text flows over
while txt:
newPage("A4Landscape")
textBox(txt, (margin, margin, width()-margin*2, height()-margin*2))
txt = textOverflow(txt, (margin, margin, width()-margin*2, height()-margin*2))
fontSize(12)
text(str(pageNumber), (width()-margin, 20), align="right")
pageNumber+=1
text(timestamp, (margin, 20))
saveImage("instance_proof"+timestampFile+".pdf")
# uninstall font
uninstallFont(path)