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

Drag a Font file in a 'Font' field to automatically generate a Dynamic/BitmapFont with Font Data #61821

Open
kz-n opened this issue Jun 8, 2022 · 8 comments

Comments

@kz-n
Copy link

kz-n commented Jun 8, 2022

Describe the project you are working on

i dont think it matters

Describe the problem or limitation you are having in your project

Every time I am adding a new Label/TextEdit or anything related, and have to put in a font, I always think having to create a DynamicFont BitmapFont and then assigning the data for it is very cumbersome

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Just drag a font file over a "Font Data" or similiar property field and have it generate a Dynamic/BitmapFont with the data from the dragged file

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

immagine
not sure how to explain this

If this enhancement will not be used often, can it be worked around with a few lines of script?

Not to my knowledge

Is there a reason why this should be core and not an add-on in the asset library?

I think this is a very basic feature and having to install a separate plugin for it to happen could lead people off

Godot Version: 3.4.4
Platform: X11 (Arch Linux)

@KoBeWi
Copy link
Member

KoBeWi commented Jun 8, 2022

This is actually a bug. You can drag font data if you export some Font variable, it just doesn't work with theme overrides for some reason (I remember it was fine until the override layout was changed).

@kz-n
Copy link
Author

kz-n commented Jun 8, 2022

This is actually a bug. You can drag font data if you export some Font variable, it just doesn't work with theme overrides for some reason (I remember it was fine until the override layout was changed).

I may have said something wrong in the title, I mean dragging over a .ttf / otf file in a "Font" field, not necessairly a *FontData resource

@kz-n kz-n changed the title Drag a Dynamic/BitmapFontData in a 'Font' field to automatically generate a Dynamic/BitmapFont with Font Data Drag a Font file in a 'Font' field to automatically generate a Dynamic/BitmapFont with Font Data Jun 8, 2022
@KoBeWi
Copy link
Member

KoBeWi commented Jun 8, 2022

ttf/otf is a FontData.

@kz-n
Copy link
Author

kz-n commented Jun 8, 2022

i see, i can confirm that i do not see this working on any "*Font" field ive tried, apart from script exports

@YuriSizov YuriSizov transferred this issue from godotengine/godot-proposals Jun 8, 2022
@YuriSizov
Copy link
Contributor

I've moved this to the main repository, as it's really just a bug, and a regression to boot. Can you please update the OP to add information about which version of Godot you are using, what system you have, etc?

@KoBeWi
Copy link
Member

KoBeWi commented Jun 8, 2022

Is this 3.5 or 4.0?
I noticed that the code that should handle Fonts wasn't backported for some reason (or it was removed?). In 4.0 it works correctly.

This is in 4.0:

if (p_with_convert) {
if (base == "BaseMaterial3D") {
p_vector->insert("Texture2D");
} else if (base == "ShaderMaterial") {
p_vector->insert("Shader");
} else if (base == "Font") {
p_vector->insert("FontData");
} else if (base == "Texture2D") {
p_vector->insert("Image");
}
}

This is 3.x:
if (p_with_convert) {
if (base == "SpatialMaterial") {
p_vector->insert("Texture");
} else if (base == "ShaderMaterial") {
p_vector->insert("Shader");
}
}

@KoBeWi KoBeWi added this to the 3.x milestone Jun 8, 2022
@YuriSizov
Copy link
Contributor

YuriSizov commented Jun 8, 2022

I noticed that the code that should handle Fonts wasn't backported for some reason (or it was removed?).

Aye, I never backported it when porting the resource picker (#49491). I think I wasn't sure how it's supposed to work in 3.x with Dynamic/BitMap fonts.

Ok, then it's not a regression, but I think we should still keep it as a bug report, as this is either impossible or a missing feature from the linked PR.

@kz-n
Copy link
Author

kz-n commented Jun 9, 2022

I've moved this to the main repository, as it's really just a bug, and a regression to boot. Can you please update the OP to add information about which version of Godot you are using, what system you have, etc?

I use Godot 3.4.4, I've updated the post to reflect that

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

3 participants