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

Improve font size related docs #9320

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/bevy_text/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ pub struct TextPlugin;
/// [`TextPlugin`] settings
#[derive(Resource)]
pub struct TextSettings {
/// Maximum number of font atlases supported in a ['FontAtlasSet']
/// Maximum number of font atlases supported in a [`FontAtlasSet`].
pub max_font_atlases: NonZeroUsize,
/// Allows font size to be set dynamically exceeding the amount set in max_font_atlases.
/// Allows font size to be set dynamically exceeding the amount set in `max_font_atlases`.
/// Note each font size has to be generated which can have a strong performance impact.
pub allow_dynamic_font_size: bool,
}
Expand Down
7 changes: 7 additions & 0 deletions crates/bevy_text/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ impl From<TextAlignment> for glyph_brush_layout::HorizontalAlign {
#[derive(Clone, Debug, Reflect)]
pub struct TextStyle {
pub font: Handle<Font>,
/// The vertical height of rasterized glyphs in the font atlas in pixels.
///
/// This is multiplied by the window scale factor and `UiScale`, but not the text entity
/// transform or camera projection.
///
/// A new font atlas is generated for every combination of font handle and scaled font size
/// which can have a strong performance impact.
pub font_size: f32,
pub color: Color,
}
Expand Down