O'Reilly logo

Practical Programming in Tcl & Tk, Third Edition by Brent B. Welch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Font Metrics

The font metrics command returns measurement information for fonts. It returns general information about all the characters in the font:

font metrics {times 10}
-ascent 9 -descent 2 -linespace 11 -fixed 0
					

The fixed setting is true for fonts where each character fits into the same-sized bounding box. The linespace is the distance between the baselines of successive lines. The ascent and descent are illustrated in Example 39-2:

Example 39-2 Font metrics.

The font measure command returns the width of a string that will be displayed in a given font. The width does not account for heavily slanted letters that overhang their bounding box, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required