You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As it stands, CharFXTransform's Font property is an RID, which means only font-related functionality from TextServer can be used. This disallows the use of any of Font's functions, such as get_string_size, since the RID can't be used to reconstruct the Font from the buffer. The only other way to use Font-exclusive functionality that doesn't exist on TextServer is to get the theme, then get all the fonts, and compare each font's RID until it matches the one inside the CharFXTransform. This makes certain operations inside RichTextEffect cumbersome to perform.
Solutions to this could come in many forms, such as storing the font's string ID (which would make getting it from the theme much easier, i.e. without iterating) or by adding a function to get the used Font (or one of its derivative types) directly. Alternatively, maybe a way to use the font's RID to (re)construct one of the Font classes from the buffer.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As it stands, CharFXTransform's Font property is an RID, which means only font-related functionality from TextServer can be used. This disallows the use of any of Font's functions, such as
get_string_size
, since the RID can't be used to reconstruct the Font from the buffer. The only other way to use Font-exclusive functionality that doesn't exist on TextServer is to get the theme, then get all the fonts, and compare each font's RID until it matches the one inside the CharFXTransform. This makes certain operations inside RichTextEffect cumbersome to perform.Solutions to this could come in many forms, such as storing the font's string ID (which would make getting it from the theme much easier, i.e. without iterating) or by adding a function to get the used
Font
(or one of its derivative types) directly. Alternatively, maybe a way to use the font's RID to (re)construct one of theFont
classes from the buffer.Beta Was this translation helpful? Give feedback.
All reactions