diff --git a/crates/bevy_internal/Cargo.toml b/crates/bevy_internal/Cargo.toml index a9c46dd06a615f..b1447e3b2b7b50 100644 --- a/crates/bevy_internal/Cargo.toml +++ b/crates/bevy_internal/Cargo.toml @@ -69,9 +69,6 @@ async-io = ["bevy_tasks/async-io"] wayland = ["bevy_winit/wayland"] x11 = ["bevy_winit/x11"] -# enable rendering of font glyphs using subpixel accuracy -subpixel_glyph_atlas = ["bevy_text/subpixel_glyph_atlas"] - # Transmission textures in `StandardMaterial`: pbr_transmission_textures = ["bevy_pbr?/pbr_transmission_textures", "bevy_gltf?/pbr_transmission_textures"] diff --git a/crates/bevy_text/src/pipeline.rs b/crates/bevy_text/src/pipeline.rs index b05cd87e07b908..4882552384cc2c 100644 --- a/crates/bevy_text/src/pipeline.rs +++ b/crates/bevy_text/src/pipeline.rs @@ -318,9 +318,9 @@ impl TextPipeline { if !text_settings.allow_dynamic_font_size && !font_atlas_warning.warned - && font_atlas_set.len() > text_settings.max_font_atlases.get() + && font_atlas_set.len() > text_settings.soft_max_font_atlases.get() { - warn!("warning[B0005]: Number of font atlases has exceeded the maximum of {}. Performance and memory usage may suffer.", text_settings.max_font_atlases.get()); + warn!("warning[B0005]: Number of font atlases has exceeded the maximum of {}. Performance and memory usage may suffer.", text_settings.soft_max_font_atlases.get()); font_atlas_warning.warned = true; } @@ -410,8 +410,8 @@ impl TextPipeline { }; Ok(TextMeasureInfo { - min_width_content_size, - max_width_content_size, + min: min_width_content_size, + max: max_width_content_size, font_system: Arc::clone(&self.font_system.0), buffer: Mutex::new(buffer), }) @@ -460,8 +460,8 @@ pub struct TextLayoutInfo { /// /// Generated via [`TextPipeline::create_text_measure`]. pub struct TextMeasureInfo { - pub min_width_content_size: Vec2, - pub max_width_content_size: Vec2, + pub min: Vec2, + pub max: Vec2, buffer: Mutex, font_system: Arc>, } @@ -469,8 +469,8 @@ pub struct TextMeasureInfo { impl std::fmt::Debug for TextMeasureInfo { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("TextMeasureInfo") - .field("min_width_content_size", &self.min_width_content_size) - .field("max_width_content_size", &self.max_width_content_size) + .field("min_width_content_size", &self.min) + .field("max_width_content_size", &self.max) .field("buffer", &"_") .field("font_system", &"_") .finish() diff --git a/crates/bevy_text/src/text.rs b/crates/bevy_text/src/text.rs index c26e2da2bcb665..69ab24a315326a 100644 --- a/crates/bevy_text/src/text.rs +++ b/crates/bevy_text/src/text.rs @@ -188,7 +188,7 @@ pub enum TextAlignment { /// Describes the style of a [`TextSection`]. #[derive(Clone, Debug, Reflect)] pub struct TextStyle { - pub font: FontRef, + pub font: Handle, pub font_size: f32, pub color: Color, } diff --git a/crates/bevy_ui/src/render/mod.rs b/crates/bevy_ui/src/render/mod.rs index f63fd1a0dc36c9..73842bf7ce8767 100644 --- a/crates/bevy_ui/src/render/mod.rs +++ b/crates/bevy_ui/src/render/mod.rs @@ -651,7 +651,7 @@ pub fn extract_text_uinodes( } let atlas = texture_atlases.get(&atlas_info.texture_atlas).unwrap(); - let mut rect = atlas.textures[atlas_info.glyph_index]; + let mut rect = atlas.textures[atlas_info.location.glyph_index]; rect.min *= inverse_scale_factor; rect.max *= inverse_scale_factor; extracted_uinodes.uinodes.insert( diff --git a/crates/bevy_ui/src/widget/text.rs b/crates/bevy_ui/src/widget/text.rs index 42bb78b17877f6..c3e908c63aed8c 100644 --- a/crates/bevy_ui/src/widget/text.rs +++ b/crates/bevy_ui/src/widget/text.rs @@ -67,8 +67,8 @@ impl Measure for TextMeasure { .map_or_else( || match available_width { AvailableSpace::Definite(_) => self.info.compute_size(Vec2::new(x, f32::MAX)), - AvailableSpace::MinContent => Vec2::new(x, self.info.min_width_content_size.y), - AvailableSpace::MaxContent => Vec2::new(x, self.info.max_width_content_size.y), + AvailableSpace::MinContent => Vec2::new(x, self.info.min.y), + AvailableSpace::MaxContent => Vec2::new(x, self.info.max.y), }, |y| Vec2::new(x, y), ) @@ -94,9 +94,7 @@ fn create_text_measure( ) { Ok(measure) => { if text.linebreak_behavior == BreakLineOn::NoWrap { - content_size.set(FixedMeasure { - size: measure.max_width_content_size, - }); + content_size.set(FixedMeasure { size: measure.max }); } else { content_size.set(TextMeasure { info: measure }); }