| Ticket UUID: | 220849 | |||
| Title: | bug in font actual | |||
| Type: | Bug | Version: | final: 8.1.1, 8.6.18, 9.0.5, 9.1b1 | |
| Submitter: | welch | Created on: | 2000-11-01 01:29:57 | |
| Subsystem: | 46. Unix Fonts | Assigned To: | hobbs | |
| Priority: | 5 Medium | Severity: | ||
| Status: | Open | Last Modified: | 2026-09-29 19:38:45 | |
| Resolution: | None | Closed By: | ||
| Closed on: | ||||
| Description: |
OriginalBugID: 2216 Bug
Version: 8.1.1
SubmitDate: '1999-06-15'
LastModified:
Severity: LOW
Status: UnAssn
Submitter: techsupp
OS: Other
OSVersion: NetBSD-1.3.3/i386 XFree-?
Machine: NA
Name:
Hume Smith
ReproducibleScript:
(copy of interactive session)
aurora> wish
% label .a -text Howdy -font {times -12}
.a
% label .b -text Howdy -font {times -13}
.b
% pack .a .b
% font actual [.a cget -font]
-family times -size 12 -weight normal -slant roman -underline 0
-overstrike 0
% font actual [.b cget -font]
-family times -size 12 -weight normal -slant roman -underline 0
-overstrike 0
% info patchlevel
8.1.1
% winfo reqwidth .a
40
% winfo reqwidth .b
46
%
ObservedBehavior:
font actual reports the same sizes for the two fonts; but .b has a
larger label than .a, as perhaps you can see from the requested widths.
This is obviously quite sensitive to things like X server, the font
implementation, dot pitch...
DesiredBehavior:
font atual should report different sizes
| |||
| User Comments: |
serhiy.storchaka added on 2026-09-29 19:38:45:
Still present in 8.6 and 9.x, on all platforms; also reported in python/cpython#143990. How the actual size is calculated:
In all cases the actual size is a fractional number of points, but it is rounded to an integer when returned. There are two possible solutions; both change the result of
I implemented both variants, but choosing between them needs a wide discussion. pcaffin added on 2008-03-13 17:08:24: Logged In: YES user_id=2029956 Originator: NO Whoops. In the above, change "the technical discrepancy (-7 vs 12, -13 vs 10)" to "the technical discrepancy (9 vs -12, 10 vs -13)". pcaffin added on 2008-03-13 17:02:27: Logged In: YES
user_id=2029956
Originator: NO
I've tested this with Tk 8.5.2.0.284581 (teapot) on Linux and the bug's still present.
Tested with Tk 8.5.2.0.284581 (teapot) on Windows XP Pro SP2 (using the same values which the reporter used) and got the following:
(bin) 4 % font actual [.a cget -font]
-family {Times New Roman} -size 9 -weight normal -slant roman -underline 0 -overstrike 0
(bin) 5 % font actual [.b cget -font]
-family {Times New Roman} -size 10 -weight normal -slant roman -underline 0 -overstrike 0
Seems okay, but, the technical discrepancy (-7 vs 12, -13 vs 10) might be useful in tracking down the issue on X11.
hobbs added on 2001-12-28 03:32:24: Logged In: YES
user_id=72656
Note also:
[ #220838 ] font size taken wrong from X font
[ #220836 ] Font {times 14} is larger than {times 15}
[ #220886 ] possible "font actual" bug
hobbs added on 2001-12-28 02:16:20: Logged In: YES user_id=72656 This seems to be a Unix-only problem, confirmed in 8.3.4. | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki