summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-08-02 15:28:48 +0200
committerGitHub <noreply@github.com>2022-08-02 15:28:48 +0200
commit4f8d31fc68c1b2276cbcbb62a308d59313b9fac6 (patch)
tree7f6f260a19773a9b0c32d6474f15a6d87ed4320f /doc/classes
parent119b2874c39aeb0aff51603fbf00f75b414a1730 (diff)
parent4373a0bb865265f07507d36e6c151a556f3d94e8 (diff)
Merge pull request #54905 from bruvzg/uncode_confusion
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/TextServer.xml21
-rw-r--r--doc/classes/TextServerExtension.xml15
2 files changed, 36 insertions, 0 deletions
diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml
index f4c9ade7d1..9f35ddc353 100644
--- a/doc/classes/TextServer.xml
+++ b/doc/classes/TextServer.xml
@@ -937,6 +937,16 @@
Returns [code]true[/code] if the server supports a feature.
</description>
</method>
+ <method name="is_confusable" qualifiers="const">
+ <return type="int" />
+ <argument index="0" name="string" type="String" />
+ <argument index="1" name="dict" type="PackedStringArray" />
+ <description>
+ Returns index of the first string in [code]dict[/dict] which is visually confusable with the [code]string[/string], or [code]-1[/code] if none is found.
+ [b]Note:[/b] This method doesn't detect invisible characters, for spoof detection use it in combination with [method spoof_check].
+ [b]Note:[/b] Always returns [code]-1[/code] if the server does not support the [constant FEATURE_UNICODE_SECURITY] feature.
+ </description>
+ </method>
<method name="is_locale_right_to_left" qualifiers="const">
<return type="bool" />
<argument index="0" name="locale" type="String" />
@@ -1476,6 +1486,14 @@
Aligns shaped text to the given tab-stops.
</description>
</method>
+ <method name="spoof_check" qualifiers="const">
+ <return type="bool" />
+ <argument index="0" name="string" type="String" />
+ <description>
+ Returns [code]true[/code] if [code]string[/code] is likely to be an attempt at confusing the reader.
+ [b]Note:[/b] Always returns [code]false[/code] if the server does not support the [constant FEATURE_UNICODE_SECURITY] feature.
+ </description>
+ </method>
<method name="string_get_word_breaks" qualifiers="const">
<return type="PackedInt32Array" />
<argument index="0" name="string" type="String" />
@@ -1733,6 +1751,9 @@
<constant name="FEATURE_UNICODE_IDENTIFIERS" value="8192" enum="Feature">
TextServer supports UAX #31 identifier validation, see [method is_valid_identifier].
</constant>
+ <constant name="FEATURE_UNICODE_SECURITY" value="16384" enum="Feature">
+ TextServer supports [url=https://unicode.org/reports/tr36/]Unicode Technical Report #36[/url] and [url=https://unicode.org/reports/tr39/]Unicode Technical Standard #39[/url] based spoof detection features.
+ </constant>
<constant name="CONTOUR_CURVE_TAG_ON" value="1" enum="ContourPointTag">
Contour point is on the curve.
</constant>
diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml
index 482460cb3b..c686a06e5e 100644
--- a/doc/classes/TextServerExtension.xml
+++ b/doc/classes/TextServerExtension.xml
@@ -934,6 +934,14 @@
Returns [code]true[/code] if the server supports a feature.
</description>
</method>
+ <method name="is_confusable" qualifiers="virtual const">
+ <return type="int" />
+ <argument index="0" name="string" type="String" />
+ <argument index="1" name="dict" type="PackedStringArray" />
+ <description>
+ Returns index of the first string in [code]dict[/dict] which is visually confusable with the [code]string[/string], or [code]-1[/code] if none is found.
+ </description>
+ </method>
<method name="is_locale_right_to_left" qualifiers="virtual const">
<return type="bool" />
<argument index="0" name="locale" type="String" />
@@ -1488,6 +1496,13 @@
[b]Note:[/b] This method is used by default line/word breaking methods, and its implementation might be omitted if custom line breaking in implemented.
</description>
</method>
+ <method name="spoof_check" qualifiers="virtual const">
+ <return type="bool" />
+ <argument index="0" name="string" type="String" />
+ <description>
+ Returns [code]true[/code] if [code]string[/code] is likely to be an attempt at confusing the reader.
+ </description>
+ </method>
<method name="string_get_word_breaks" qualifiers="virtual const">
<return type="PackedInt32Array" />
<argument index="0" name="string" type="String" />