britzl / defold-richtext

Defold-RichText is a system to create styled text based on an HTML inspired markup language
MIT License
75 stars 12 forks source link

Return height of generated text #3

Closed britzl closed 6 years ago

britzl commented 6 years ago

Return height of generated text from richtext.create()

dapetcu21 commented 6 years ago

Width is also important. Metered width can be smaller than the max width that gets passed to create.

britzl commented 6 years ago

Text metrics are now returned:

local nodes,metrics = richtext.create(...)
print(metrics.width, metrics.height)