shethjenil
commited on
Commit
•
c073004
1
Parent(s):
50c7418
Upload 2 files
Browse files- .gitattributes +1 -0
- HandWriteMachine.exe +3 -0
- HandWriteMachine.py +31 -0
.gitattributes
CHANGED
@@ -45,3 +45,4 @@ RUNAPP filter=lfs diff=lfs merge=lfs -text
|
|
45 |
AIMAGE.exe filter=lfs diff=lfs merge=lfs -text
|
46 |
YTSEARCH.exe filter=lfs diff=lfs merge=lfs -text
|
47 |
ProgInject.exe filter=lfs diff=lfs merge=lfs -text
|
|
|
|
45 |
AIMAGE.exe filter=lfs diff=lfs merge=lfs -text
|
46 |
YTSEARCH.exe filter=lfs diff=lfs merge=lfs -text
|
47 |
ProgInject.exe filter=lfs diff=lfs merge=lfs -text
|
48 |
+
HandWriteMachine.exe filter=lfs diff=lfs merge=lfs -text
|
HandWriteMachine.exe
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:297d158628097b6eb7b62af9e016914365732f4ebfafb585330295cecaa8691b
|
3 |
+
size 34880161
|
HandWriteMachine.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from PIL.Image import open as open_image , Image
|
2 |
+
from tkinter.simpledialog import askstring
|
3 |
+
from tkinter.filedialog import asksaveasfilename
|
4 |
+
from os import chdir
|
5 |
+
import sys
|
6 |
+
chdir(sys._MEIPASS)
|
7 |
+
def condition(cont: str) -> Image:
|
8 |
+
back = open_image("zback.png")
|
9 |
+
width,height = 50,0
|
10 |
+
for letter in cont:
|
11 |
+
if letter in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+,.-? ":
|
12 |
+
if letter == " ":
|
13 |
+
letter = "zspace"
|
14 |
+
if letter.isupper():
|
15 |
+
letter = "c"+letter.lower()
|
16 |
+
if letter == ",":
|
17 |
+
letter = "coma"
|
18 |
+
if letter == ".":
|
19 |
+
letter = "fs"
|
20 |
+
if letter == "?":
|
21 |
+
letter = "que"
|
22 |
+
if width + 150 >= back.width:
|
23 |
+
height = height + 227
|
24 |
+
width = 50
|
25 |
+
cases = open_image(letter+".png")
|
26 |
+
back.paste(cases,(width,height))
|
27 |
+
width += cases.width
|
28 |
+
return back
|
29 |
+
img = condition(askstring("TEXT","Hand Written Text"))
|
30 |
+
img.show()
|
31 |
+
img.save(asksaveasfilename(filetypes=[("Image Files","*.png *jpg *jpeg *ico")],initialfile="Handwriting.png"))
|