Difference between revisions of "Dabo.ui.fontMetric"

From Dabo Wiki
Jump to: navigation, search
(Created page with "== Signature: == <syntaxhighlight lang="python"> dabo.ui.fontMetric(txt=None, wind=None, face=None, size=None, bold=None, italic=None) </syntaxhighlight> == Description: ==...")
 
(No difference)

Latest revision as of 16:06, 14 May 2020

Signature:

dabo.ui.fontMetric(txt=None, wind=None, face=None, size=None, bold=None, italic=None)

Description:

Calculate the width and height of the given text using the supplied font information. If any font parameters are missing, they are taken from the specified window, or, if no window is specified, the currently active form. If no form is active, the app's MainForm is used.

Returns:

A 2-tuple containing the (width, height) of the specified text.

Comments:

Sometimes it is necessary to see just how big a given bit of text will be. This method allows you to specify as many aspects about the text's appearance, and will return the width and height for those specs.