Skip to content

Commit

Permalink
[Text Overrun] Add option to set custom ellipsis character, add suppo…
Browse files Browse the repository at this point in the history
…rt for system font fallback.
  • Loading branch information
bruvzg committed Oct 9, 2023
1 parent 6916349 commit c586d87
Show file tree
Hide file tree
Showing 20 changed files with 599 additions and 333 deletions.
3 changes: 3 additions & 0 deletions doc/classes/Label.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<member name="clip_text" type="bool" setter="set_clip_text" getter="is_clipping_text" default="false">
If [code]true[/code], the Label only shows the text that fits inside its bounding rectangle and will clip text horizontally.
</member>
<member name="ellipsis_char" type="String" setter="set_ellipsis_char" getter="get_ellipsis_char" default="&quot;&quot;">
Ellipsis character used for text clipping.
</member>
<member name="horizontal_alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0">
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
</member>
Expand Down
3 changes: 3 additions & 0 deletions doc/classes/TextLine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
<member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0">
Text writing direction.
</member>
<member name="ellipsis_char" type="String" setter="set_ellipsis_char" getter="get_ellipsis_char" default="&quot;&quot;">
Ellipsis character used for text clipping.
</member>
<member name="flags" type="int" setter="set_flags" getter="get_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="3">
Line alignment rules. For more info see [TextServer].
</member>
Expand Down
3 changes: 3 additions & 0 deletions doc/classes/TextParagraph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@
<member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0">
Text writing direction.
</member>
<member name="ellipsis_char" type="String" setter="set_ellipsis_char" getter="get_ellipsis_char" default="&quot;&quot;">
Ellipsis character used for text clipping.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
</member>
Expand Down
15 changes: 15 additions & 0 deletions doc/classes/TextServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,13 @@
Returns array of the composite character boundaries.
</description>
</method>
<method name="shaped_text_get_custom_ellipsis" qualifiers="const">
<return type="int" />
<param index="0" name="shaped" type="RID" />
<description>
Returns ellipsis character used for text clipping.
</description>
</method>
<method name="shaped_text_get_custom_punctuation" qualifiers="const">
<return type="String" />
<param index="0" name="shaped" type="RID" />
Expand Down Expand Up @@ -1532,6 +1539,14 @@
Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
</description>
</method>
<method name="shaped_text_set_custom_ellipsis">
<return type="void" />
<param index="0" name="shaped" type="RID" />
<param index="1" name="char" type="int" />
<description>
Sets ellipsis character used for text clipping.
</description>
</method>
<method name="shaped_text_set_custom_punctuation">
<return type="void" />
<param index="0" name="shaped" type="RID" />
Expand Down
13 changes: 13 additions & 0 deletions doc/classes/TextServerExtension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,12 @@
<description>
</description>
</method>
<method name="_shaped_text_get_custom_ellipsis" qualifiers="virtual const">
<return type="int" />
<param index="0" name="shaped" type="RID" />
<description>
</description>
</method>
<method name="_shaped_text_get_custom_punctuation" qualifiers="virtual const">
<return type="String" />
<param index="0" name="shaped" type="RID" />
Expand Down Expand Up @@ -1316,6 +1322,13 @@
<description>
</description>
</method>
<method name="_shaped_text_set_custom_ellipsis" qualifiers="virtual">
<return type="void" />
<param index="0" name="shaped" type="RID" />
<param index="1" name="char" type="int" />
<description>
</description>
</method>
<method name="_shaped_text_set_custom_punctuation" qualifiers="virtual">
<return type="void" />
<param index="0" name="shaped" type="RID" />
Expand Down
Loading

0 comments on commit c586d87

Please sign in to comment.