Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Text Overrun] Add option to set custom ellipsis character, add support for system font fallback. #82661

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1243,6 +1243,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 @@ -1547,6 +1554,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 @@ -1073,6 +1073,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 @@ -1329,6 +1335,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
Loading