Skip to content

Commit c9887d2

Browse files
committed
Merge pull request #102342 from bruvzg/no_font_set
Make `CharFXTransform.font` property read only, add some extra documentation notes.
2 parents af8a5fd + 50740c4 commit c9887d2

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

doc/classes/CharFXTransform.xml

+13-7
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,34 @@
2525
[/codeblock]
2626
</member>
2727
<member name="font" type="RID" setter="set_font" getter="get_font" default="RID()">
28-
Font resource used to render glyph.
28+
[TextServer] RID of the font used to render glyph, this value can be used with [code]TextServer.font_*[/code] methods to retrieve font information.
29+
[b]Note:[/b] Read-only. Setting this property won't affect drawing.
2930
</member>
3031
<member name="glyph_count" type="int" setter="set_glyph_count" getter="get_glyph_count" default="0">
31-
Number of glyphs in the grapheme cluster. This value is set in the first glyph of a cluster. Setting this property won't affect drawing.
32+
Number of glyphs in the grapheme cluster. This value is set in the first glyph of a cluster.
33+
[b]Note:[/b] Read-only. Setting this property won't affect drawing.
3234
</member>
3335
<member name="glyph_flags" type="int" setter="set_glyph_flags" getter="get_glyph_flags" default="0">
34-
Glyph flags. See [enum TextServer.GraphemeFlag] for more info. Setting this property won't affect drawing.
36+
Glyph flags. See [enum TextServer.GraphemeFlag] for more info.
37+
[b]Note:[/b] Read-only. Setting this property won't affect drawing.
3538
</member>
3639
<member name="glyph_index" type="int" setter="set_glyph_index" getter="get_glyph_index" default="0">
37-
Font specific glyph index.
40+
Glyph index specific to the [member font]. If you want to replace this glyph, use [method TextServer.font_get_glyph_index] with [member font] to get a new glyph index for a single character.
3841
</member>
3942
<member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)">
4043
The position offset the character will be drawn with (in pixels).
4144
</member>
4245
<member name="outline" type="bool" setter="set_outline" getter="is_outline" default="false">
43-
If [code]true[/code], FX transform is called for outline drawing. Setting this property won't affect drawing.
46+
If [code]true[/code], FX transform is called for outline drawing.
47+
[b]Note:[/b] Read-only. Setting this property won't affect drawing.
4448
</member>
4549
<member name="range" type="Vector2i" setter="set_range" getter="get_range" default="Vector2i(0, 0)">
46-
Absolute character range in the string, corresponding to the glyph. Setting this property won't affect drawing.
50+
Absolute character range in the string, corresponding to the glyph.
51+
[b]Note:[/b] Read-only. Setting this property won't affect drawing.
4752
</member>
4853
<member name="relative_index" type="int" setter="set_relative_index" getter="get_relative_index" default="0">
49-
The character offset of the glyph, relative to the current [RichTextEffect] custom block. Setting this property won't affect drawing.
54+
The character offset of the glyph, relative to the current [RichTextEffect] custom block.
55+
[b]Note:[/b] Read-only. Setting this property won't affect drawing.
5056
</member>
5157
<member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D(1, 0, 0, 1, 0, 0)">
5258
The current transform of the current glyph. It can be overridden (for example, by driving the position and rotation from a curve). You can also alter the existing value to apply transforms on top of other effects.

scene/gui/rich_text_label.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,6 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o
12241224
char_xform = charfx->transform;
12251225
fx_offset = charfx->offset;
12261226
font_color = charfx->color;
1227-
frid = charfx->font;
12281227
gl = charfx->glyph_index;
12291228
txt_visible &= charfx->visibility;
12301229
}

0 commit comments

Comments
 (0)