Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions Text To Handwriting.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@
try:
txt=open(argv[1], "r")
except IndexError:
print("No file entered. Using default file...")
txt=open(fileName, "r")
except FileNotFoundError:
print("Could not find file. Using default file...")
txt=open(fileName, "r")


BG=Image.open("myfont/bg.png") #path of page(background)photo (I have used blank page)
sheet_width=BG.width
gap, ht = 0, 0


# for each letter in the uploaded txt file, read the unicode value and replace it with
# the corresponding handwritten file in the "myfont" folder.
for i in txt.read().replace("\n",""):
for i in txt.read():
if(i == '\n'):
gap, ht=0, ht+140
else:
cases = Image.open("myfont/{}.png".format(str(ord(i))))
BG.paste(cases, (gap, ht))
size = cases.width
Expand Down
Binary file added myfont/.DS_Store
Binary file not shown.
Binary file added myfont/39.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added myfont/58.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added myfont/9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.