summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/FontData.xml3
-rw-r--r--doc/classes/ProjectSettings.xml9
-rw-r--r--doc/classes/TextServer.xml34
-rw-r--r--doc/classes/TextServerExtension.xml15
4 files changed, 59 insertions, 2 deletions
diff --git a/doc/classes/FontData.xml b/doc/classes/FontData.xml
index d16c879566..ccaefc60ee 100644
--- a/doc/classes/FontData.xml
+++ b/doc/classes/FontData.xml
@@ -600,5 +600,8 @@
<member name="style_name" type="String" setter="set_font_style_name" getter="get_font_style_name" default="&quot;&quot;">
Font style name.
</member>
+ <member name="subpixel_positioning" type="int" setter="set_subpixel_positioning" getter="get_subpixel_positioning" enum="TextServer.SubpixelPositioning" default="1">
+ Font glyph sub-pixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of memory usage and font rasterization speed. Use [constant TextServer.SUBPIXEL_POSITIONING_AUTO] to automatically enable it based on the font size.
+ </member>
</members>
</class>
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 51b8f4f438..805f897b63 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -564,6 +564,15 @@
<member name="gui/theme/custom_font" type="String" setter="" getter="" default="&quot;&quot;">
Path to a custom [Font] resource to use as default for all GUI elements of the project.
</member>
+ <member name="gui/theme/default_font_antialiased" type="bool" setter="" getter="" default="true">
+ If set to [code]true[/code], default font uses 8-bit anitialiased glyph rendering. See [member FontData.antialiased].
+ </member>
+ <member name="gui/theme/default_font_hinting" type="int" setter="" getter="" default="1">
+ Default font hinting mode. See [member FontData.hinting].
+ </member>
+ <member name="gui/theme/default_font_subpixel_positioning" type="int" setter="" getter="" default="1">
+ Default font glyph sub-pixel positioning mode. See [member FontData.subpixel_positioning].
+ </member>
<member name="gui/theme/default_theme_scale" type="float" setter="" getter="" default="1.0">
</member>
<member name="gui/timers/incremental_search_max_interval_msec" type="int" setter="" getter="" default="2000">
diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml
index 260386f20e..3157eea436 100644
--- a/doc/classes/TextServer.xml
+++ b/doc/classes/TextServer.xml
@@ -328,6 +328,13 @@
Returns font style name.
</description>
</method>
+ <method name="font_get_subpixel_positioning" qualifiers="const">
+ <return type="int" enum="TextServer.SubpixelPositioning" />
+ <argument index="0" name="font_rid" type="RID" />
+ <description>
+ Returns font sub-pixel glyph positioning mode.
+ </description>
+ </method>
<method name="font_get_supported_chars" qualifiers="const">
<return type="String" />
<argument index="0" name="font_rid" type="RID" />
@@ -613,7 +620,7 @@
<method name="font_set_hinting">
<return type="void" />
<argument index="0" name="font_rid" type="RID" />
- <argument index="1" name="_hinting" type="int" enum="TextServer.Hinting" />
+ <argument index="1" name="hinting" type="int" enum="TextServer.Hinting" />
<description>
Sets font hinting mode. Used by dynamic fonts only.
</description>
@@ -727,7 +734,15 @@
<argument index="0" name="font_rid" type="RID" />
<argument index="1" name="name" type="String" />
<description>
- Set the font style name.
+ Sets the font style name.
+ </description>
+ </method>
+ <method name="font_set_subpixel_positioning">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="subpixel_positioning" type="int" enum="TextServer.SubpixelPositioning" />
+ <description>
+ Sets font sub-pixel glyph positioning mode.
</description>
</method>
<method name="font_set_texture_image">
@@ -1493,6 +1508,21 @@
<constant name="HINTING_NORMAL" value="2" enum="Hinting">
Use the default font hinting mode (crisper but less smooth).
</constant>
+ <constant name="SUBPIXEL_POSITIONING_DISABLED" value="0" enum="SubpixelPositioning">
+ Glyph horizontal position is rounded to the whole pixel size, each glyph is rasterized once.
+ </constant>
+ <constant name="SUBPIXEL_POSITIONING_AUTO" value="1" enum="SubpixelPositioning">
+ Glyph horizontal position is rounded based on font size.
+ - To one quarter of the pixel size if font size is smaller or equal to [code]16[/code].
+ - To one half of the pixel size if font size is smaller or equal to [code]20[/code].
+ - To the whole pixel size for larger fonts.
+ </constant>
+ <constant name="SUBPIXEL_POSITIONING_ONE_HALF" value="2" enum="SubpixelPositioning">
+ Glyph horizontal position is rounded to one half of the pixel size, each glyph is rasterized up to two times.
+ </constant>
+ <constant name="SUBPIXEL_POSITIONING_ONE_QUARTER" value="3" enum="SubpixelPositioning">
+ Glyph horizontal position is rounded to one quarter of the pixel size, each glyph is rasterized up to four times.
+ </constant>
<constant name="FEATURE_BIDI_LAYOUT" value="1" enum="Feature">
TextServer supports bidirectional layouts.
</constant>
diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml
index b15bcde712..f730f28e79 100644
--- a/doc/classes/TextServerExtension.xml
+++ b/doc/classes/TextServerExtension.xml
@@ -328,6 +328,13 @@
Returns font style name.
</description>
</method>
+ <method name="_font_get_subpixel_positioning" qualifiers="virtual const">
+ <return type="int" enum="TextServer.SubpixelPositioning" />
+ <argument index="0" name="font_rid" type="RID" />
+ <description>
+ Returns font sub-pixel glyph positioning mode.
+ </description>
+ </method>
<method name="_font_get_supported_chars" qualifiers="virtual const">
<return type="String" />
<argument index="0" name="font_rid" type="RID" />
@@ -738,6 +745,14 @@
Sets the font style name.
</description>
</method>
+ <method name="_font_set_subpixel_positioning" qualifiers="virtual">
+ <return type="void" />
+ <argument index="0" name="font_rid" type="RID" />
+ <argument index="1" name="subpixel_positioning" type="int" enum="TextServer.SubpixelPositioning" />
+ <description>
+ Sets font sub-pixel glyph positioning mode.
+ </description>
+ </method>
<method name="_font_set_texture_image" qualifiers="virtual">
<return type="void" />
<argument index="0" name="font_rid" type="RID" />