➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author epaine
Recipients epaine, hejin517, serhiy.storchaka
Date 2021-12-28.20:31:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1640723476.37.0.477315816522.issue46189@roundup.psfhosted.org>
In-reply-to
Content
I have been able to reproduce this in Wish built from the current head. Interestingly, the cut-off seems to be 1px off what `font measure` gives (see attached). Though in this behaviour is a problem, the man page does note the following:
> The return value is the total width in pixels of text, not including the extra pixels used by highly exaggerated characters such as cursive “f” [https://www.tcl.tk/man/tcl/TkCmd/font.html#M10]

Tkinter is simply a thin wrapper of Tk, so I suggest you take it up with that team so they can fix it upstream (a minimal equivalent of your code in Tcl can be found below): https://core.tcl-lang.org/tk/reportlist

pack [canvas .c -width 250 -height 500]
font create .f -family "Times New Roman" -size -500
set t [.c create text 0 250 -text f -font .f -anchor w]
update ; # A window render is required for the bug to occur
.c itemconfigure $t -fill red
set x [font measure .f f]
.c create line $x 0 $x 500
History
Date User Action Args
2021-12-28 20:31:16epainesetrecipients: + epaine, serhiy.storchaka, hejin517
2021-12-28 20:31:16epainesetmessageid: <1640723476.37.0.477315816522.issue46189@roundup.psfhosted.org>
2021-12-28 20:31:16epainelinkissue46189 messages
2021-12-28 20:31:16epainecreate