Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CharFXTransform.font property read only, add some extra documentation notes. #102342

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Feb 2, 2025

See #102333

In most cases, setting font value will result in incorrect rendering, since it's CharFX is applied after text shaping (and therefor changing font require replicating shaping process and in many cases completely impossible). font value was intended to get replacement glyph indices, not to change it.

@bruvzg bruvzg added this to the 4.4 milestone Feb 2, 2025
@bruvzg bruvzg requested review from a team as code owners February 2, 2025 21:42
@bruvzg
Copy link
Member Author

bruvzg commented Feb 2, 2025

If a way to fully replace text from custom FX is desired, it might be added as a dedicated type of FX which can do shaping on its own. But I'm not sure if there are many uses for it.

@Repiteo Repiteo merged commit c9887d2 into godotengine:master Feb 4, 2025
19 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Feb 4, 2025

Thanks!

@Qubus0
Copy link

Qubus0 commented Feb 5, 2025

Aw, this was handy to both make more complex font changing effects and for custom icon fonts (which could easily be created as .fnt files). way nicer than always needing the full image or font path for [img] and [font]

granted this version mostly works with monospace fonts and has a few flaws for other spacings: godotengine/godot-proposals#3450 (comment) but i think all the methods necessary to retrieve the correct transforms are accessible to gdscript - i just haven't had the time to test my theory after that.

And yes there are quite a few good uses for replacing text with custom fx -> https://github.com/SimonGigant/godot-text_effects_4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants