rio: update to 0.3.1

This commit is contained in:
i0ntempest
2026-04-05 23:47:14 +10:00
parent d3b96614d2
commit 8f00db085e
2 changed files with 285 additions and 170 deletions
+275 -162
View File
File diff suppressed because it is too large Load Diff
+10 -8
View File
@@ -26,10 +26,10 @@ index 34494793f5..759f2e9f6a 100644
if flags.contains(Flags::INVERSE) {
std::mem::swap(&mut background_color, &mut foreground_color);
diff --git a/sugarloaf/src/components/rich_text/image_cache/glyph.rs b/sugarloaf/src/components/rich_text/image_cache/glyph.rs
diff --git a/sugarloaf/src/components/renderer/image_cache/glyph.rs b/sugarloaf/src/components/rich_text/image_cache/glyph.rs
index 7b53001412..e176ab8c84 100644
--- a/sugarloaf/src/components/rich_text/image_cache/glyph.rs
+++ b/sugarloaf/src/components/rich_text/image_cache/glyph.rs
--- a/sugarloaf/src/renderer/image_cache/glyph.rs
+++ b/sugarloaf/src/renderer/image_cache/glyph.rs
@@ -135,6 +135,7 @@ impl GlyphCacheSession<'_> {
let font_data = font_library_data.get(&self.font);
let should_embolden = font_data.should_embolden;
@@ -64,21 +64,21 @@ diff --git a/sugarloaf/src/font/mod.rs b/sugarloaf/src/font/mod.rs
index fb6848ab9f..31183af6d1 100644
--- a/sugarloaf/src/font/mod.rs
+++ b/sugarloaf/src/font/mod.rs
@@ -19,7 +19,7 @@ use crate::font_introspector::text::cluster::Token;
@@ -19,7 +19,7 @@
use crate::font_introspector::text::cluster::{CharCluster, Status};
use crate::font_introspector::text::Codepoint;
use crate::font_introspector::text::Script;
-use crate::font_introspector::{CacheKey, FontRef, Synthesis};
+use crate::font_introspector::{Attributes, CacheKey, FontRef, Synthesis};
use crate::layout::FragmentStyle;
use crate::layout::SpanStyle;
use crate::SugarloafErrors;
use dashmap::DashMap;
@@ -672,7 +672,14 @@ impl FontData {
@@ -672,8 +672,15 @@
let should_embolden = font_spec.weight >= Some(700) && weight < Weight(700);
let stretch = attributes.stretch();
- let synth = attributes.synthesize(attributes);
+
+ let requested_weight = font_spec.weight.map(Weight).unwrap_or(Weight::NORMAL);
+ let requested_style = match font_spec.style {
+ SugarloafFontStyle::Italic => Style::Italic,
@@ -86,6 +86,8 @@ index fb6848ab9f..31183af6d1 100644
+ };
+ let requested_attrs = Attributes::new(stretch, requested_weight, requested_style);
+ let synth = attributes.synthesize(requested_attrs);
+
let data = (!evictable).then_some(data);
Ok(Self {