-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Add options to embolden and transform font outlines to simulate bold and italic typefaces. #59013
Conversation
d1bad52
to
fcfd6c5
Compare
ffe9826
to
200e8cb
Compare
Screen.Recording.2022-03-11.at.12.05.55.mov |
Playing a bit with dynamic updates to simplescreenrecorder-2022-03-11_11.42.13.mp4It works well but seems to be fairly expensive, the above drops from 1670 FPS with just the RichTextEffects, to 20 FPS with both If I double the font size from 48 to 96px, I get 5 FPS in Using this code: var fd = get_theme_font("normal_font").get_data(0)
func _process(delta):
fd.slant = sin(Time.get_ticks_msec() / 1000.0)
fd.embolden = clamp(cos(Time.get_ticks_msec() / 500.0), 0.2, 0.8) |
200e8cb
to
3667e15
Compare
Changed Screen.Recording.2022-03-11.at.13.06.12.movOriginal |
Heh I was suggesting this mostly in jest, I don't know if there's a real need for it. It's nice to have the flexibility but at the same time I fear it might not be easy for users to edit the Transform2D directly if what they want is a simple slanting effect. Maybe mention in the I confirm that this still works fine from script (and doesn't seem slower than it was with var fd = get_theme_font("normal_font").get_data(0)
func _process(delta):
fd.transform.x.y = sin(Time.get_ticks_msec() / 600.0)
fd.embolden = abs(cos(Time.get_ticks_msec() / 800.0)) - 0.2 |
…and italic typefaces.
3667e15
to
b32e8d6
Compare
Added Also changed max. font texture cache size to |
It doesn't seem to make much difference in my test project, still ~40 FPS with 64px font and 10 FPS with 65px font when changing |
This should be transition from |
Thanks! |
RichTextLabel
style). With1.2
embolden andTransform2D(1.0, 0.4, 0.0, 1.0, 0.0, 0.0)
transform.Fixes #58988