diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-20 10:32:32 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-20 10:32:32 +0100 |
commit | 923311dea07d81229d0e74970099fdf4ffd7737f (patch) | |
tree | ee0ed78bc50dee6094c1575debe08867b417c3fd | |
parent | f1f6b35b8c840eff55fe5f2b6373f89a6c410fcb (diff) | |
parent | fcf54cabba28b45797093eca9d308868e543f92d (diff) |
Merge pull request #70303 from Calinou/doc-font-outlines-msdf
Document MDSF font outlines may require `msdf_pixel_range` adjustments
-rw-r--r-- | doc/classes/Button.xml | 1 | ||||
-rw-r--r-- | doc/classes/CheckBox.xml | 1 | ||||
-rw-r--r-- | doc/classes/CheckButton.xml | 1 | ||||
-rw-r--r-- | doc/classes/CodeEdit.xml | 1 | ||||
-rw-r--r-- | doc/classes/ColorPickerButton.xml | 1 | ||||
-rw-r--r-- | doc/classes/FontFile.xml | 14 | ||||
-rw-r--r-- | doc/classes/ItemList.xml | 1 | ||||
-rw-r--r-- | doc/classes/Label.xml | 1 | ||||
-rw-r--r-- | doc/classes/LineEdit.xml | 1 | ||||
-rw-r--r-- | doc/classes/LinkButton.xml | 1 | ||||
-rw-r--r-- | doc/classes/MenuBar.xml | 1 | ||||
-rw-r--r-- | doc/classes/MenuButton.xml | 1 | ||||
-rw-r--r-- | doc/classes/OptionButton.xml | 1 | ||||
-rw-r--r-- | doc/classes/PopupMenu.xml | 1 | ||||
-rw-r--r-- | doc/classes/ProgressBar.xml | 1 | ||||
-rw-r--r-- | doc/classes/RichTextLabel.xml | 1 | ||||
-rw-r--r-- | doc/classes/TabBar.xml | 1 | ||||
-rw-r--r-- | doc/classes/TabContainer.xml | 1 | ||||
-rw-r--r-- | doc/classes/TextEdit.xml | 1 | ||||
-rw-r--r-- | doc/classes/Tree.xml | 1 |
20 files changed, 27 insertions, 6 deletions
diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index d2c9a77486..961f3c495a 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -118,6 +118,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="font" data_type="font" type="Font"> [Font] of the [Button]'s text. diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 699e872e99..3ee18cf351 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -43,6 +43,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="font" data_type="font" type="Font"> The [Font] to use for the [CheckBox] text. diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index dfbaa7cbee..03578cafd0 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -43,6 +43,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="font" data_type="font" type="Font"> The [Font] to use for the [CheckButton] text. diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index e7ef5fb289..c313e6c875 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -651,6 +651,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="font" data_type="font" type="Font"> Sets the default [Font]. diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml index b7a0bdfb0c..2a37cc162a 100644 --- a/doc/classes/ColorPickerButton.xml +++ b/doc/classes/ColorPickerButton.xml @@ -79,6 +79,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="font" data_type="font" type="Font"> [Font] of the [ColorPickerButton]'s text. diff --git a/doc/classes/FontFile.xml b/doc/classes/FontFile.xml index 1019c271dc..69a7627774 100644 --- a/doc/classes/FontFile.xml +++ b/doc/classes/FontFile.xml @@ -570,7 +570,7 @@ Weight (boldness) of the font. A value in the [code]100...999[/code] range, normal font weight is [code]400[/code], bold font weight is [code]700[/code]. </member> <member name="force_autohinter" type="bool" setter="set_force_autohinter" getter="is_force_autohinter" default="false"> - If set to [code]true[/code], auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only. + If set to [code]true[/code], auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only (MSDF fonts don't support hinting). </member> <member name="generate_mipmaps" type="bool" setter="set_generate_mipmaps" getter="get_generate_mipmaps" default="false"> If set to [code]true[/code], generate mipmaps for the font textures. @@ -579,25 +579,27 @@ Font hinting mode. Used by dynamic fonts only. </member> <member name="msdf_pixel_range" type="int" setter="set_msdf_pixel_range" getter="get_msdf_pixel_range" default="16"> - The width of the range around the shape between the minimum and maximum representable signed distance. + The width of the range around the shape between the minimum and maximum representable signed distance. If using font outlines, [member msdf_pixel_range] must be set to at least [i]twice[/i] the size of the largest font outline. The default [member msdf_pixel_range] value of [code]16[/code] allows outline sizes up to [code]8[/code] to look correct. </member> <member name="msdf_size" type="int" setter="set_msdf_size" getter="get_msdf_size" default="48"> - Source font size used to generate MSDF textures. + Source font size used to generate MSDF textures. Higher values allow for more precision, but are slower to render and require more memory. Only increase this value if you notice a visible lack of precision in glyph rendering. </member> <member name="multichannel_signed_distance_field" type="bool" setter="set_multichannel_signed_distance_field" getter="is_multichannel_signed_distance_field" default="false"> - If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data. + If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field (MSDF) generated from the dynamic font vector data. Since this approach does not rely on rasterizing the font every time its size changes, this allows for resizing the font in real-time without any performance penalty. Text will also not look grainy for [Control]s that are scaled down (or for [Label3D]s viewed from a long distance). As a downside, font hinting is not available with MSDF. The lack of font hinting may result in less crisp and less readable fonts at small sizes. + [b]Note:[/b] If using font outlines, [member msdf_pixel_range] must be set to at least [i]twice[/i] the size of the largest font outline. + [b]Note:[/b] MSDF font rendering does not render glyphs with overlapping shapes correctly. Overlapping shapes are not valid per the OpenType standard, but are still commonly found in many font files, especially those converted by Google Fonts. To avoid issues with overlapping glyphs, consider downloading the font file directly from the type foundry instead of relying on Google Fonts. </member> <member name="opentype_feature_overrides" type="Dictionary" setter="set_opentype_feature_overrides" getter="get_opentype_feature_overrides" default="{}"> Font OpenType feature set override. </member> <member name="oversampling" type="float" setter="set_oversampling" getter="get_oversampling" default="0.0"> - Font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. Used by dynamic fonts only. + Font oversampling factor. If set to [code]0.0[/code], the global oversampling factor is used instead. Used by dynamic fonts only (MSDF fonts ignore oversampling). </member> <member name="style_name" type="String" setter="set_font_style_name" getter="get_font_style_name" default=""""> 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 subpixel 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. + Font glyph subpixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of higher memory usage and lower 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/ItemList.xml b/doc/classes/ItemList.xml index 844f260971..c485d26e0c 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -459,6 +459,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the item text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="v_separation" data_type="constant" type="int" default="2"> The vertical spacing between items. diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index cd87b4558f..1a8cbf0584 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -111,6 +111,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> Text outline size. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="shadow_offset_x" data_type="constant" type="int" default="1"> The horizontal offset of the text's shadow. diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index e57cc68b36..b8383aaed9 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -424,6 +424,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="font" data_type="font" type="Font"> Font used for the text. diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index 184ba1ba7a..b3938999f3 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -76,6 +76,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="underline_spacing" data_type="constant" type="int" default="2"> The vertical space between the baseline of text and the underline. diff --git a/doc/classes/MenuBar.xml b/doc/classes/MenuBar.xml index e8505937ff..79876e56a3 100644 --- a/doc/classes/MenuBar.xml +++ b/doc/classes/MenuBar.xml @@ -143,6 +143,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="font" data_type="font" type="Font"> [Font] of the menu item's text. diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index 4d5d5a011b..3061149570 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -75,6 +75,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="font" data_type="font" type="Font"> [Font] of the [MenuButton]'s text. diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index e63e822648..a58a6249ae 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -259,6 +259,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="font" data_type="font" type="Font"> [Font] of the [OptionButton]'s text. diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 6810b0e8e4..8dec4eaf86 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -584,6 +584,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the item text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="separator_outline_size" data_type="constant" type="int" default="0"> The size of the labeled separator text outline. diff --git a/doc/classes/ProgressBar.xml b/doc/classes/ProgressBar.xml index 510b8d5bd1..9f89a4e4c3 100644 --- a/doc/classes/ProgressBar.xml +++ b/doc/classes/ProgressBar.xml @@ -42,6 +42,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="font" data_type="font" type="Font"> Font used to draw the fill percentage if [member show_percentage] is [code]true[/code]. diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index f587ababfe..e4bc2db104 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -656,6 +656,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="shadow_offset_x" data_type="constant" type="int" default="1"> The horizontal offset of the font's shadow. diff --git a/doc/classes/TabBar.xml b/doc/classes/TabBar.xml index 713c016651..8d56cbda13 100644 --- a/doc/classes/TabBar.xml +++ b/doc/classes/TabBar.xml @@ -319,6 +319,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the tab text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="font" data_type="font" type="Font"> The font used to draw tab names. diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index e2e7a0c37e..c744c9b439 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -214,6 +214,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the tab text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="side_margin" data_type="constant" type="int" default="8"> The space at the left or right edges of the tab bar, accordingly with the current [member tab_alignment]. diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index d4f5233438..1efd0f9326 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -1396,6 +1396,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="font" data_type="font" type="Font"> Sets the default [Font]. diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 629c271417..584a2a2a7b 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -522,6 +522,7 @@ </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. + [b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. </theme_item> <theme_item name="parent_hl_line_margin" data_type="constant" type="int" default="0"> The space between the parent relationship lines for the selected [TreeItem] and the relationship lines to its siblings that are not selected. |