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

Double newlines in conjunction with <size> create extra newline #33

Closed dapetcu21 closed 5 years ago

dapetcu21 commented 5 years ago

Here's a minimal reproductible example:

local text = "<size=0.5>The brown fox jumps over the lazy dog. The brown fox jumps over the lazy dog.\n\nThe brown fox jumps over the lazy dog. The brown fox jumps over the lazy dog.</size>"
local words, metrics = richtext.create(text, "Roboto", settings)

And here's how it looks (notice the extra newline in the middle of the second paragraph):

Screenshot 2019-04-12 at 12 52 32