Skip to content

Commit 458c428

Browse files
committed
fixup! fixup! update release.md
1 parent 44f908b commit 458c428

File tree

4 files changed

+54
-5
lines changed

4 files changed

+54
-5
lines changed

frontends/rioterm/src/renderer/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,8 @@ impl Renderer {
456456

457457
if should_expand_width {
458458
style.width = 2.0;
459-
// Skip the next column since this character now occupies 2 cells
459+
style.should_scale = true; // Mark for scaling
460+
// Skip the next column since this character now occupies 2 cells
460461
if !is_last {
461462
skip_next_column = true;
462463
}

sugarloaf/src/components/rich_text/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,9 @@ impl RichTextBrush {
492492
dimensions.height = line_height.round();
493493
}
494494

495-
// Calculate effective font size for PUA characters with width 2.0
496-
let effective_font_size = if char_width >= 2.0 {
497-
// Scale font size for wide PUA characters
495+
// Calculate effective font size for characters that should be scaled
496+
let effective_font_size = if run.span.should_scale {
497+
// Scale font size for characters marked for scaling
498498
run.size * 1.6 // Conservative scaling to fit within 2 cells
499499
} else {
500500
run.size

sugarloaf/src/layout/content.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ pub struct FragmentStyle {
272272
pub media: Option<Graphic>,
273273
/// Drawable character
274274
pub drawable_char: Option<DrawableChar>,
275+
/// Whether this character should be scaled
276+
pub should_scale: bool,
275277
}
276278

277279
impl Default for FragmentStyle {
@@ -291,6 +293,7 @@ impl Default for FragmentStyle {
291293
decoration_color: None,
292294
media: None,
293295
drawable_char: None,
296+
should_scale: false,
294297
}
295298
}
296299
}

sugarloaf/src/sugarloaf/primitives.rs

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,15 @@ pub enum CornerType {
5656

5757
#[inline]
5858
pub fn is_private_user_area(character: &char) -> bool {
59-
matches!(character, '\u{E000}'..='\u{F8FF}')
59+
matches!(
60+
character,
61+
// Private Use Area (BMP)
62+
'\u{E000}'..='\u{F8FF}' |
63+
// Supplementary Private Use Area-A
64+
'\u{F0000}'..='\u{FFFFD}' |
65+
// Supplementary Private Use Area-B
66+
'\u{100000}'..='\u{10FFFD}'
67+
)
6068
}
6169

6270
#[inline]
@@ -2339,3 +2347,40 @@ const OCTANT_PATTERNS: [u8; 230] = [
23392347
0b11111101, // 1CDE4;BLOCK OCTANT-1345678
23402348
0b11111110, // 1CDE5;BLOCK OCTANT-2345678
23412349
];
2350+
2351+
#[cfg(test)]
2352+
mod tests {
2353+
use super::*;
2354+
2355+
#[test]
2356+
fn test_is_private_user_area() {
2357+
// Test Private Use Area (BMP) - U+E000 to U+F8FF
2358+
assert!(is_private_user_area(&'\u{E000}'));
2359+
assert!(is_private_user_area(&'\u{F000}'));
2360+
assert!(is_private_user_area(&'\u{F8FF}'));
2361+
2362+
// Test Nerd Font character (U+F01C4) - this is the specific character mentioned
2363+
assert!(is_private_user_area(&'\u{F01C4}'));
2364+
2365+
// Test Supplementary Private Use Area-A - U+F0000 to U+FFFFD
2366+
assert!(is_private_user_area(&'\u{F0000}'));
2367+
assert!(is_private_user_area(&'\u{F5000}'));
2368+
assert!(is_private_user_area(&'\u{FFFFD}'));
2369+
2370+
// Test Supplementary Private Use Area-B - U+100000 to U+10FFFD
2371+
assert!(is_private_user_area(&'\u{100000}'));
2372+
assert!(is_private_user_area(&'\u{105000}'));
2373+
assert!(is_private_user_area(&'\u{10FFFD}'));
2374+
2375+
// Test regular characters that should NOT be private use area
2376+
assert!(!is_private_user_area(&'A'));
2377+
assert!(!is_private_user_area(&'z'));
2378+
assert!(!is_private_user_area(&'0'));
2379+
assert!(!is_private_user_area(&'€'));
2380+
assert!(!is_private_user_area(&'\u{1F600}')); // 😀 emoji
2381+
2382+
// Test boundary cases
2383+
assert!(!is_private_user_area(&'\u{D7FF}')); // Just before surrogates
2384+
assert!(!is_private_user_area(&'\u{F900}')); // Just after PUA
2385+
}
2386+
}

0 commit comments

Comments
 (0)