mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-01 22:56:54 -06:00
M2.1: keep BIFF8 font family and charset when importing .xls fonts
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
c82a138462
commit
f2a75eca1b
@@ -183,7 +183,9 @@ fn read_font(c: &mut Cursor<'_, '_>) -> Option<(Font, u16)> {
|
||||
let weight = c.u16().ok()?;
|
||||
let script = c.u16().ok()?;
|
||||
let underline = c.u8().ok()?;
|
||||
c.skip(3).ok()?; // family, character set, unused
|
||||
let family = c.u8().ok()?;
|
||||
let charset = c.u8().ok()?;
|
||||
c.skip(1).ok()?; // reserved
|
||||
let name = c.short_string().ok()?;
|
||||
let mut f = Font::default();
|
||||
let name: String = name.chars().filter(|ch| *ch != '\0').take(255).collect();
|
||||
@@ -209,6 +211,8 @@ fn read_font(c: &mut Cursor<'_, '_>) -> Option<(Font, u16)> {
|
||||
0x22 => Underline::DoubleAccounting,
|
||||
_ => Underline::None,
|
||||
};
|
||||
f.family = Some(family);
|
||||
f.charset = Some(charset);
|
||||
Some((f, icv))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user