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:
parent
d9702d35f1
commit
90f77beca2
@ -41,9 +41,9 @@ pub struct TextPlugin;
|
|||||||
/// [`TextPlugin`] settings
|
/// [`TextPlugin`] settings
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
pub struct TextSettings {
|
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,
|
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.
|
/// Note each font size has to be generated which can have a strong performance impact.
|
||||||
pub allow_dynamic_font_size: bool,
|
pub allow_dynamic_font_size: bool,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -167,6 +167,13 @@ impl From<TextAlignment> for glyph_brush_layout::HorizontalAlign {
|
|||||||
#[derive(Clone, Debug, Reflect)]
|
#[derive(Clone, Debug, Reflect)]
|
||||||
pub struct TextStyle {
|
pub struct TextStyle {
|
||||||
pub font: Handle<Font>,
|
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 font_size: f32,
|
||||||
pub color: Color,
|
pub color: Color,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user