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

ALIGN_JUSTIFY last line bug #68

Closed Bethleem closed 3 years ago

Bethleem commented 3 years ago

When a richtext is created with ALIGN_JUSTIFY parameter and the last line is´nt a full line, the extra space from the last character to the right border is divided and added as space between the words of the line, even if you end the line with a \
or \

. It is "justifying" all that free space that should remain as a whole before the last character of that last line.

imagen

britzl commented 3 years ago

Could you please share the string you used? I'm unable to reproduce it.

Bethleem commented 3 years ago

anchoPantalla, altoPantalla = window.get_size()

local settings = { position = vmath.vector3(0, altoPantalla, 0), align = richtext.ALIGN_JUSTIFY, width=anchoPantalla, fonts = { Roboto = ROBOTO } }

richtext.create(tostring(anchoPantalla).." "..tostring(altoPantalla).." Lorem ipsum tocoto moren na\
\

no way \
\

", "Roboto", settings)

Project display width and height are set to 385 and 680.

britzl commented 3 years ago

Thanks for the repro!