Improve font size related docs (#9320)

# Objective

Fixes #7273
Closes #7578

This PR also drive-by fixes a broken doc link.
This commit is contained in:
Rob Parrett 2023-08-03 00:48:11 -07:00 committed by GitHub
parent d9702d35f1
commit 90f77beca2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -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,
}

View file

@ -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,
}