Skip to content

Commit 029d100

Browse files
committed
fixup! fixup! update release.md
1 parent 092929b commit 029d100

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
@@ -404,7 +404,8 @@ impl Renderer {
404404

405405
if should_expand_width {
406406
style.width = 2.0;
407-
// Skip the next column since this character now occupies 2 cells
407+
style.should_scale = true; // Mark for scaling
408+
// Skip the next column since this character now occupies 2 cells
408409
if !is_last {
409410
skip_next_column = true;
410411
}

sugarloaf/src/components/rich_text/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -731,9 +731,9 @@ impl RichTextBrush {
731731
}
732732
}
733733

734-
// Calculate effective font size for PUA characters with width 2.0
735-
let effective_font_size = if char_width >= 2.0 {
736-
// Scale font size for wide PUA characters
734+
// Calculate effective font size for characters that should be scaled
735+
let effective_font_size = if run.span.should_scale {
736+
// Scale font size for characters marked for scaling
737737
run.size * 1.6 // Conservative scaling to fit within 2 cells
738738
} else {
739739
run.size

sugarloaf/src/layout/content.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ pub struct FragmentStyle {
326326
pub media: Option<Graphic>,
327327
/// Drawable character
328328
pub drawable_char: Option<DrawableChar>,
329+
/// Whether this character should be scaled
330+
pub should_scale: bool,
329331
}
330332

331333
impl Default for FragmentStyle {
@@ -345,6 +347,7 @@ impl Default for FragmentStyle {
345347
decoration_color: None,
346348
media: None,
347349
drawable_char: None,
350+
should_scale: false,
348351
}
349352
}
350353
}

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

0 commit comments

Comments
 (0)