Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Disable anti aliasing for text
#1
I apologize for asking another question, but how can I disable text anti-aliasing in tkinter? I have tried padx= and pady= -1 and -2, but neither works. Will I just have to try to install tkinter 8.4?
Quote
#2
It's amusing to me that googling this issue led to an almost identical question on the old forums: http://www.python-forum.org/viewtopic.php?f=12&t=17418
Larz60+ Wrote:Hello,
 
Quote:I apologise that my first post has to be about asking for help but I have no other choice.

Questions are what this forum is about.

Check out http://stackoverflow.com/questions/30335...in-tkinter
also http://effbot.org/zone/tkinter-aggdraw.htm

Larz60+ 


Anti-aliasing is disabled by default (or at least used to be). Do you have some code we can run to verify the issue?
It's dangerous to go alone!  Take this: https://docs.python.org/3/library/index.html
Kevin Flynn is my spirit animal.
Quote
#3
from tkinter    import *
from tkinter import ttk
root = Tk()
root.overrideredirect(True)
root.geometry('+1000+500')
root.lift()
root.wm_attributes('-topmost', True)
root.wm_attributes('-disabled', True)
root.wm_attributes('-transparentcolor', 'white')
label = Label(root, text='test', bg='white')
label.pack()
root.mainloop
The letters are surrounded by white, reducing readability at small size and in front of the wrong colour.
Quote
#4
I'm not sure there's a way to disable whether or not a font is antialiased, but you can at least use a font that just doesn't have it.  This worked for me (I commented out a few things to make testing easier):
from tkinter import *
from tkinter import ttk
root = Tk()
# root.overrideredirect(True)
root.geometry('+1000+500')
# root.lift()
root.wm_attributes('-topmost', True)
#root.wm_attributes('-disabled', True)
root.wm_attributes('-transparentcolor', 'white')
label = Label(root, text='test', bg='white', font="fixedsys")
label.pack()
root.mainloop()
It's dangerous to go alone!  Take this: https://docs.python.org/3/library/index.html
Kevin Flynn is my spirit animal.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  PyQt4 text edit align text center iFunKtion 3 644 Mar-10-2017, 06:02 PM
Last Post: Larz60+

Forum Jump:


Users browsing this thread: 1 Guest(s)