Skip to content

Replace from_ constructors on TextFont with From impls #20450

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

amedoeyes
Copy link

Objective

Solution

  • Removed TextFont::from_font and TextFont::from_line_height.
  • Updated examples/testbed/2d.rs to use the Form impl.
  • Added migration guide.

Copy link
Contributor

github-actions bot commented Aug 7, 2025

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@greeble-dev greeble-dev added C-Code-Quality A section of code that is hard to understand or change A-Text Rendering and layout for characters D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide and removed D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Aug 7, 2025
@james7132 james7132 removed the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Aug 8, 2025
@james7132 james7132 added this pull request to the merge queue Aug 8, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 8, 2025
Comment on lines +9 to +13
// 0.16
let text_font = TextFont::from_font(font_handle);
let text_font = TextFont::from_line_height(line_height);

// 0.17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed 0.17 cutoff so:

Suggested change
// 0.16
let text_font = TextFont::from_font(font_handle);
let text_font = TextFont::from_line_height(line_height);
// 0.17
// 0.17
let text_font = TextFont::from_font(font_handle);
let text_font = TextFont::from_line_height(line_height);
// 0.18

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the intent here for this PR to wait until 0.17's release to get this change in? This otherwise seems trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Text Rendering and layout for characters A-UI Graphical user interfaces, styles, layouts, and widgets C-Code-Quality A section of code that is hard to understand or change C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace from_field constructors on TextFont with From impls
4 participants