From 10063f66c531cbd5c3cf92dd38a39d88d04d68f2 Mon Sep 17 00:00:00 2001 From: Akash Bora <89206401+Akascape@users.noreply.github.com> Date: Mon, 15 Aug 2022 12:32:22 +0530 Subject: [PATCH] Minor Bug fixes --- Ascify-Art.py | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/Ascify-Art.py b/Ascify-Art.py index 3f9a850..adfed82 100644 --- a/Ascify-Art.py +++ b/Ascify-Art.py @@ -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() @@ -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() @@ -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=".. ") @@ -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 @@ -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 @@ -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() @@ -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("", 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)