shethjenil
commited on
Update HandWriteMachine.py
Browse files- HandWriteMachine.py +5 -1
HandWriteMachine.py
CHANGED
@@ -9,7 +9,7 @@ def condition(cont: str) -> Image:
|
|
9 |
back = open_image("zback.png")
|
10 |
width,height = 50,0
|
11 |
for letter in cont:
|
12 |
-
if letter in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+,.-? ":
|
13 |
if letter == " ":
|
14 |
letter = "zspace"
|
15 |
if letter.isupper():
|
@@ -23,6 +23,10 @@ def condition(cont: str) -> Image:
|
|
23 |
if width + 150 >= back.width:
|
24 |
height = height + 227
|
25 |
width = 50
|
|
|
|
|
|
|
|
|
26 |
cases = open_image(letter+".png")
|
27 |
back.paste(cases,(width,height))
|
28 |
width += cases.width
|
|
|
9 |
back = open_image("zback.png")
|
10 |
width,height = 50,0
|
11 |
for letter in cont:
|
12 |
+
if letter in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+,.-? \n":
|
13 |
if letter == " ":
|
14 |
letter = "zspace"
|
15 |
if letter.isupper():
|
|
|
23 |
if width + 150 >= back.width:
|
24 |
height = height + 227
|
25 |
width = 50
|
26 |
+
if letter == "\n":
|
27 |
+
height += 227
|
28 |
+
width = 50
|
29 |
+
continue
|
30 |
cases = open_image(letter+".png")
|
31 |
back.paste(cases,(width,height))
|
32 |
width += cases.width
|