[TextServer] Improvements for line breaking, "Fill" alignment, overrun, and interaction between these modes.

Fix "Fill" alignment processing wrong side of the text if overrun trim was applied.
Improve "Fill" alignment to avoid adding excessive subsequent spaces or elongations.
Add font detection to the overrun, to correctly add ellipsis (was using last glyph font, which doesn't necessary have dot character).
Improve line breaking to avoid adding excessive subsequent soft break points for languages without word separator.
Port missing overrun/justification code to the Fallback text server.
Fix inferred text direction detection by controls.
Add tests for "Fill" alignment and line breaking glyph flags.
This commit is contained in:
bruvzg 2022-01-10 17:24:03 +02:00
parent 2f4d76f068
commit baec983d8a
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38
13 changed files with 566 additions and 163 deletions

View file

@ -1051,6 +1051,13 @@
Returns composite character's bounds as offsets from the start of the line.
</description>
</method>
<method name="shaped_text_get_inferred_direction" qualifiers="const">
<return type="int" enum="TextServer.Direction" />
<argument index="0" name="shaped" type="RID" />
<description>
Returns direction of the text, inferred by the BiDi algorithm.
</description>
</method>
<method name="shaped_text_get_line_breaks" qualifiers="const">
<return type="PackedInt32Array" />
<argument index="0" name="shaped" type="RID" />

View file

@ -1061,6 +1061,13 @@
Returns composite character's bounds as offsets from the start of the line.
</description>
</method>
<method name="_shaped_text_get_inferred_direction" qualifiers="virtual const">
<return type="int" />
<argument index="0" name="shaped" type="RID" />
<description>
Returns direction of the text, inferred by the BiDi algorithm.
</description>
</method>
<method name="_shaped_text_get_line_breaks" qualifiers="virtual const">
<return type="PackedInt32Array" />
<argument index="0" name="shaped" type="RID" />