Compare commits
2 Commits
a48c3ab596
...
573f300fea
Author | SHA1 | Date | |
---|---|---|---|
573f300fea | |||
0f9dc7a886 |
BIN
printer/SilkRemington-Regular.otf
Normal file
BIN
printer/SilkRemington-Regular.otf
Normal file
Binary file not shown.
@@ -11,7 +11,7 @@ import textwrap
|
|||||||
# with open("printer/adverb.txt") as adverb:
|
# with open("printer/adverb.txt") as adverb:
|
||||||
# pass
|
# pass
|
||||||
|
|
||||||
im=Image.open("printer/image.jpg")
|
im=Image.open("printer/image2.jpg")
|
||||||
|
|
||||||
# f = ImageFont.load_default()
|
# f = ImageFont.load_default()
|
||||||
f = ImageFont.truetype("printer/SilkRemington-Regular.otf", 40)
|
f = ImageFont.truetype("printer/SilkRemington-Regular.otf", 40)
|
||||||
@@ -23,6 +23,11 @@ text_long = "In the outdoor area, ask someone would you rather be known for alwa
|
|||||||
|
|
||||||
lines = textwrap.wrap(text_long, width=23)
|
lines = textwrap.wrap(text_long, width=23)
|
||||||
|
|
||||||
|
if len(lines) > 2:
|
||||||
|
im=Image.open("printer/image.jpg")
|
||||||
|
else:
|
||||||
|
im=Image.open("printer/image2.jpg")
|
||||||
|
|
||||||
y = 0
|
y = 0
|
||||||
n = 0
|
n = 0
|
||||||
for line in lines:
|
for line in lines:
|
||||||
@@ -32,7 +37,7 @@ for line in lines:
|
|||||||
y += height
|
y += height
|
||||||
w=txt.rotate(-90, expand=1)
|
w=txt.rotate(-90, expand=1)
|
||||||
print(n)
|
print(n)
|
||||||
im.paste( ImageOps.colorize(w, (0,0,0), (0,0,0)), ( (n-5)*20 + 123, 5), w)
|
im.paste( ImageOps.colorize(w, (0,0,0), (0,0,0)), ( (n-5)*20 + 127, 5), w)
|
||||||
|
|
||||||
im.show()
|
im.show()
|
||||||
im.save("image_tmp.jpg")
|
im.save("image_tmp.jpg")
|
||||||
|
Reference in New Issue
Block a user