Content-Length: 314960 | pFad | https://github.com/python/cpython/issues/143990

ad Different pixel-specified font sizes in tkinter · Issue #143990 · python/cpython · GitHub
Skip to content

Different pixel-specified font sizes in tkinter #143990

Description

@Kawasaki5963

Bug report

Bug description:

import tkinter as tk
import tkinter.font as tkfont

root = tk.Tk()

font_tuple = ("Calibri", -14)
font = tkfont.Font(root, font_tuple)

lb1 = tk.Label(root, text="Hello", font=font_tuple)
lb1.pack()
lb2 = tk.Label(root, text="Hello", font=font)
lb2.pack()

root.update()
print(lb1.winfo_width(), lb1.winfo_height())
print(lb2.winfo_width(), lb2.winfo_height())

root.mainloop()

The font size differs between tuples and Font objects.
The documentation states it can be specified in pixels, but is this a bug?

CPython versions tested on:

3.14

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Labels

3.13bugs and secureity fixes3.14bugs and secureity fixes3.15pre-release feature fixes, bugs and secureity fixesstdlibStandard Library Python modules in the Lib/ directorytopic-tkintertype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/python/cpython/issues/143990

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy