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

You can change textedit's color via: $TextEdit.add_color_override("font_color", Color8(254,171,31)) but you cannot change the font size via $TextEdit.add_font_override("font_size",100) #42405

Closed
BracerJack opened this issue Sep 29, 2020 · 3 comments

Comments

@BracerJack
Copy link

BracerJack commented Sep 29, 2020

Godot version:
3.2.2

OS/device including version:

Issue description:
You can change textedit's color via: $TextEdit.add_color_override("font_color", Color8(254,171,31)) but you cannot change the font size via $TextEdit.add_font_override("font_size",100) ? Why the inconsistency ?

Steps to reproduce:
I am using dynamic font.

Minimal reproduction project:

@BracerJack BracerJack changed the title You can change textedit's color via: $TextEdit.add_color_override("font_color", Color8(254,171,31)) but you cannot change the font size via $TextEdit.add_font_override("font_size",100) ? You can change textedit's color via: $TextEdit.add_color_override("font_color", Color8(254,171,31)) but you cannot change the font size via $TextEdit.add_font_override("font_size",100) Sep 29, 2020
@KoBeWi
Copy link
Member

KoBeWi commented Sep 29, 2020

font_size is not a property of TextEdit, but of the Font resource. Fonts don't have any color assigned, so whatever draws the text decides the color, hence why font_color is a property of certain controls. This looks like inconsistency, but makes sense if you understand the difference.

See also #5557 and related discussion.

@akien-mga
Copy link
Member

Moreover, look at the documentation for Control.add_font_override(): https://docs.godotengine.org/en/stable/classes/class_control.html#class-control-method-add-font-override

The first parameter is the name of a font in the current Theme: https://docs.godotengine.org/en/stable/classes/class_theme.html#class-theme-method-get-font-list

@BracerJack
Copy link
Author

BracerJack commented Sep 29, 2020

Thank you KoBeWi, I have read through the whole of #5557.

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

No branches or pull requests

4 participants