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

Default Text initialization with no font specified #1201

Closed
eliasreid opened this issue Jan 3, 2021 · 1 comment
Closed

Default Text initialization with no font specified #1201

eliasreid opened this issue Jan 3, 2021 · 1 comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior

Comments

@eliasreid
Copy link

Bevy version

0.4.0

Operating system & version

Windows 10

What you did

Spawned a TextBundle using a mostly defaulted Text struct (only specified the value).

  commands
    .spawn(CameraUiBundle::default())
    .spawn(TextBundle{
      text: Text{
        value: "test text".to_string(),
        ..Default::default()
      },
      ..Default::default()
    })

What you expected to happen

I expected that one of two things would happen:

  1. Error message due to trying to render text without specifying a font. (either compile time by not having Text be default-able, or run time)
  2. Have a default font be used.

What actually happened

The app builds and runs fine, but the text doesn't show on screen (which makes sense, as there is no font specified).

Initializing the Text struct with a font worked as expected. (adding ...font: asset_server.load("fonts/font_name.ttf"),...

Additional information

This may be intended behaviour, but I found it unexpected as a new user of Bevy. I see that there exists an issue for adding a built-in font (#1017), which would address the issue.

@eliasreid eliasreid changed the title Default Text behaviour with no font Default Text initialization with no font specified Jan 3, 2021
@Moxinilian
Copy link
Member

Related to #1017.
I'll keep this one open so we can track we at least need better error report.

@Moxinilian Moxinilian added C-Bug An unexpected or incorrect behavior A-UI Graphical user interfaces, styles, layouts, and widgets labels Jan 15, 2021
@nicopap nicopap closed this as completed Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests

3 participants