Paint ligature boxes as their component letters

This commit is contained in:
gloamxun committed 2026-10-20 22:59:31 +08:00
1 parent 67915402a6
commit ff3fff343d
3 files changed
+32 -3

No files matched your search

+12 -1
View File
@@ -250,6 +250,17 @@ fn escape(text: &str) -> String {
.replace('>', ">")
}
fn character_text(character: char) -> String {
match character {
'\u{FB00}' => "ff".to_owned(),
'\u{FB01}' => "fi".to_owned(),
'\u{FB02}' => "fl".to_owned(),
'\u{FB03}' => "ffi".to_owned(),
'\u{FB04}' => "ffl".to_owned(),
_ => character.to_string(),
}
}
impl Halign {
/// Convert the table into text and rule primitives, with the table origin
/// at `(0, 0)`.
@@ -403,7 +414,7 @@ impl Page {
x,
y: baseline,
size,
text: character.to_string(),
text: character_text(character),
});
}
x += box_.width;