beetlebug▾
/

font actual

Gives the attributes of a font description or a named font.

font actual FONT ?-displayof WINDOW? ?OPTION? ?--? ?CHAR?

Description

Gives the six attributes of FONT, or the value of one OPTION. An attribute that the description does not give has its default, and a standard font gives the font of the theme. A size in pixels gives the size in points.

ztk accepts -displayof WINDOW and CHAR, and they have no effect on the result.

Returns

A list of options and values, or one value.

Examples

% font actual {Courier 10 bold}
-family Courier -size 10 -weight bold -slant roman -underline 0 -overstrike 0

% font actual {Helvetica 12} -size
12

% font actual TkFixedFont -family
JetBrains Mono

Errors

% font actual
wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"
-errorcode TCL WRONGARGS

% font actual {Helvetica 12 bogus}
font "Helvetica 12 bogus" doesn't exist
-errorcode NONE

% font actual {Helvetica 12} -foo
bad option "-foo": must be -family, -size, -weight, -slant, -underline, or -overstrike
-errorcode NONE

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1

See also