Difference between revisions of "Dabo.ui.fontMetricFromDrawObject"

From Dabo Wiki
Jump to: navigation, search
(Created page with "== Signature: == <syntaxhighlight lang="python"> dabo.ui.fontMetricFromDrawObject(obj) </syntaxhighlight> == Description: == Given a drawn text object, returns the width and...")
 
(No difference)

Latest revision as of 16:05, 14 May 2020

Signature:

dabo.ui.fontMetricFromDrawObject(obj)

Description:

Given a drawn text object, returns the width and height of the text. See the section on DrawObjects for information on the drawText() function.

Returns:

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

Comments:

If you're using the drawing primitives to create text, this method will take the drawn object and return the size of the text as it will be drawn.