Skip to content

Commit

Permalink
Minor Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Akascape authored Aug 15, 2022
1 parent 24a101e commit 10063f6
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions Ascify-Art.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
os.system('python -m pip install '+y)
from PIL import Image, ImageDraw, ImageFont
import matplotlib.font_manager
pass
elif res=="no":
print("Error: Required modules not available! \nWithout the modules you can't use this program. Please install them first!")
sys.exit()
Expand Down Expand Up @@ -106,7 +105,7 @@ def prestep():
messagebox.showinfo("Done! :)","Image Ascified!")
def Convert(file):
try:
Log.place(x=185,y=235)
Log.place(x=185,y=240)
Log.config(text=". ")
Disabled()
root.update_idletasks()
Expand Down Expand Up @@ -137,7 +136,7 @@ def getChar(inputInt):
s=Size.get()
fnt = ImageFont.truetype(final, int(s))
width, height = im.size
im = im.resize((int(scaleFactor*width), int(scaleFactor*height*(oneCharWidth/oneCharHeight))), Image.NEAREST)
im = im.resize((int(scaleFactor*width), int(scaleFactor*height*(oneCharWidth/oneCharHeight))), Image.Resampling.NEAREST)
width, height = im.size
pix = im.load()
Log.config(text=".. ")
Expand Down Expand Up @@ -177,7 +176,7 @@ def info():
"\n➤ Then choose the desired font, size and character you want in the output"
"\n➤ Then simply click the CREATE button, the output image and text file will be saved in the same root diretory."
"\n\nDeveloper: Akash Bora (a.k.a. Akascape)\nIf you have any issue then contact me on Github."
"\nVersion-0.3")
"\nVersion-0.4")
def Disabled():
Img['state']=DISABLED
CharEntry['state']=DISABLED
Expand All @@ -188,7 +187,7 @@ def Disabled():
def Enabled():
Img['state']=NORMAL
CharEntry['state']=NORMAL
fontbox['state']=NORMAL
fontbox['state']="readonly"
Size['state']=NORMAL
btn['state']=NORMAL
tbox['state']=NORMAL
Expand All @@ -213,10 +212,10 @@ def switch2():
root.columnconfigure(0,weight=1)
root.geometry("400x300")
root.configure(bg='#FFFFFF')
Label(root, text="ASCIFY-ART", font=("Impact",17),bd=1, fg="#5DBCD2", bg="#FFFFFF").grid()
Label(root, text="ASCIFY-ART", font=("Calibri",17),bd=1, fg="#5DBCD2", bg="#FFFFFF").grid()
firstLabel=Label(root, text="Choose Image", font=("Calibri",10), fg="#5DBCD2", bg="#FFFFFF")
firstLabel.grid()
Img=Button(root, width=50,bg="#82CC6C",fg="white",highlightthickness=1,borderwidth=0.2,text="OPEN",relief="groove", command=openfile)
Img=Button(root, width=50,bg="#82CC6C",fg="white",highlightthickness=1,borderwidth=0.2,text="OPEN",font=("Calibri",10),relief="groove", command=openfile)
Img.grid()
Label(root, text="Choose Font", font=("Calibri",10), fg="#5DBCD2", bg="#FFFFFF").place(x=100,y=80)
fonts= matplotlib.font_manager.findSystemFonts()
Expand All @@ -227,37 +226,37 @@ def switch2():
p=os.path.dirname(i)
flist.append(f)
plist.append(p)
fontbox=ttk.Combobox(root,values=sorted(flist), font="Verdana 10", width=10, height=9)
fontbox=ttk.Combobox(root,values=sorted(flist), font=("Calibri",11), state="readonly", width=15, height=9)
fontbox.current(0)
fontbox.place(x=90,y=105)
fontbox.place(x=75,y=105)
EntryVar= StringVar()
Label(root, text="Characters", font=("Calibri",10), fg="#5DBCD2", bg="#FFFFFF").place(x=165,y=132)
CharEntry=Entry(root,bg="light blue",width=50,borderwidth=3,textvariable=EntryVar)
CharEntry=Entry(root,bg="light blue",width=50,borderwidth=3,textvariable=EntryVar,font=("Calibri",9))
EntryVar.set("$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\\|()1{}[]?-_+~<>i!lI;:,\"^`'. ")
CharEntry.place(x=40,y=155)
Label(root, text="Size", font=("Calibri",10), fg="#5DBCD2", bg="#FFFFFF").place(x=250,y=80)
sizevar=IntVar()
Size=Entry(root,bg="light blue",width=3,borderwidth=3,textvariable=sizevar)
Size=Entry(root,bg="light blue",width=3,borderwidth=3,font=("Calibri",9),textvariable=sizevar)
sizevar.set(15)
Size.place(x=250,y=105)
btn=Button(width=25, height=2,text="CREATE",font=("Cambria", 9),bg="#5DBCD2",fg="#FFFFFF",borderwidth=0,highlightthickness=2,padx=0,pady=0,command=prestep)
btn=Button(width=25, height=2,text="CREATE",font=("Calibri",10),bg="#5DBCD2",fg="#FFFFFF",borderwidth=0,highlightthickness=2,padx=0,pady=0,command=prestep)
btn.place(x=110,y=200)
Log=Label(root,text="", font=("Calibri",20), fg="#5DBCD2", bg="#FFFFFF")
dev=Label(root, text='Developed by Akascape | ',bg='#FFFFFF',fg="#6D76CD", font=("Impact",10))
dev=Label(root, text='Developed by Akascape | ',bg='#FFFFFF',fg="#6D76CD", font=("Calibri",10))
dev.place(x=5,y=280)
link=Label(root, text="Github Link",font=('Impact',10),bg='#FFFFFF',fg="#6D76CD", cursor="hand2")
link.place(x=140,y=280)
link=Label(root, text="Github Link",font=("Calibri",10),bg='#FFFFFF',fg="#6D76CD", cursor="hand2")
link.place(x=145,y=280)
link.bind("<Button-1>", lambda e:
callback("https://github.com/Akascape/Ascify-Art"))
infobtn= Button(root, width=2,bg="#FFFFFF",fg="black", text="ⓘ",font=(10),relief="sunken",cursor='hand2', highlightthickness=0,borderwidth=0,padx=0,pady=0,command=info)
infobtn= Button(root, width=2,bg="#FFFFFF",fg="black", text="ⓘ",font=("Calibri",12),relief="sunken",cursor='hand2', highlightthickness=0,borderwidth=0,padx=0,pady=0,command=info)
infobtn.place(x=377,y=275)
rebtn= Button(root, width=2,bg="#FFFFFF",fg="black", text="⟳",font=(10),relief="sunken",cursor='hand2', highlightthickness=0,borderwidth=0,padx=0,pady=0,command=switch)
rebtn= Button(root, width=2,bg="#FFFFFF",fg="black", text="⟳",font=("Calibri",12),relief="sunken",cursor='hand2', highlightthickness=0,borderwidth=0,padx=0,pady=0,command=switch)
rebtn.place(x=350,y=153)
Change=Button(root, width=2,bg="#FFFFFF",fg="black", text="🔃",font=(10),relief="sunken",cursor='hand2', highlightthickness=0,borderwidth=0,padx=0,pady=0,command=switch2)
Change.place(x=355,y=29)
Change=Button(root, width=2,bg="#FFFFFF",fg="black", text="",font=("Calibri",12), relief="sunken",cursor='hand2', highlightthickness=0,borderwidth=0,padx=0,pady=0,command=switch2)
Change.place(x=355,y=25)
var5 = IntVar()
var5.set(0)
tbox=Checkbutton(root, text="Export Text",bg="#FFFFFF",variable=var5,onvalue=1, offvalue=0)
tbox=Checkbutton(root, text="Export Text",bg="#FFFFFF",font=("Calibri",10),variable=var5,onvalue=1, offvalue=0)
tbox.place(x=340,y=250, anchor='center')
root.mainloop()
#By Akash Bora(a.k.a Akascape)

0 comments on commit 10063f6

Please sign in to comment.