FontFamily.isMonospace

A monospace font is a font designed for text display where the the characters form a regular grid.

For Western languages this would mean that the advance width of all characters are the same, but this categorization also includes Asian fonts which include double-width characters: characters that occupy two grid cells. glib.global.unicharIswide returns a result that indicates whether a character is typically double-width in a monospace font.

The best way to find out the grid-cell size is to call pango.font_metrics.FontMetrics.getApproximateDigitWidth, since the results of pango.font_metrics.FontMetrics.getApproximateCharWidth may be affected by double-width characters.

class FontFamily
bool
isMonospace
()

Return Value

Type: bool

true if the family is monospace.