# font

A bitmap or TTF-based font object storing glyph data.
Used for measuring/drawing text. Freed when GC sees no references.


### linegap <sub>accessor</sub>

Get or set the font's additional line spacing above the built-in metrics.



**value**: (when setting) The new line gap.


**Returns**: The current line gap (when getting), or None (when setting).


### height <sub>accessor</sub>

(read only)

The baseline-to-baseline height in pixels.



**Returns**: The font's total height in px.


### ascent <sub>accessor</sub>

(read only)

How far above the baseline the font extends.



**Returns**: A scalar float for ascent.


### descent <sub>accessor</sub>

(read only)

How far below baseline the font extends.



**Returns**: A scalar float for descent.


### text_size(text, letterSpacing, wrap) <sub>function</sub>

Measure a piece of text's width/height when rendered with this font.



**text**: The string to measure.

**letterSpacing**: Extra spacing between characters.

**wrap**: If nonzero, word-wrap to this maximum width.


**Returns**: [width, height] as a float array.

