TIP 564: ttk font sizes in points

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Author:         Francois Vogel <[email protected]>
State:          Final
Type:           Project
Vote:           Done
Created:        9-Feb-2020
Post-History:   
Keywords:       Tk Ttk x11 font size
Tcl-Version:    8.7
Tcl-Branch:     bug-dccd82bdc7

Abstract

This TIP proposes to change the font sizes defined for ttk widgets on x11 from absolute sizes to sizes in points.

Rationale

Currently, the fonts defined for Ttk on x11 in library/ttk/fonts.tcl are specified as absolute numbers of pixels:

	set F(size) -12
	set F(ttsize) -10
	set F(capsize) -14
	set F(fixedsize) -12

This is historically justified in the header of the same file as follows:

#	Font size specified in pixels on X11, not points.
#	This is Theoretically Wrong, but in practice works better; using
#	points leads to huge inconsistencies across different servers.

Today these absolute font sizes seem to create more problems than they fix anything. Several Linux distributions (Debian, Ubuntu, Fedora at least) are already patching Tk by changing these font sizes for sizes in points. See example for Debian.

A ticket has been opened for Tk exactly on this topic in order to request that Tk applies this change directly in its source code.

This is the purpose of the present proposal.

Specification

Apply patch b441746a60. This is a change for x11 only.

On Windows and macOS Ttk font sizes are already set in points in library/ttk/fonts.tcl so there is nothing to change.

Implementation

See the bug-dccd82bdc7 branch, aka tip-564.

This branch targets 8.7.

Copyright

This document has been placed in the public domain.