M13.12: EPS text (show variants, charpath, stringwidth, embedded Type 1/CFF, fallback fonts)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-03 09:01:10 -04:00
co-authored by Claude Opus 5.5
parent d0df520bc1
commit 740faf1c1f
5 changed files with 530 additions and 64 deletions
+8
View File
@@ -366,6 +366,14 @@ pub struct Cff {
pub encoding: [u16; 256],
}
/// The first font name in a CFF program's Name INDEX.
pub fn font_name(data: &[u8]) -> Option<String> {
let hdr = *data.get(2)? as usize;
let (names, _) = index(data, hdr)?;
let r = names.first()?.clone();
Some(String::from_utf8_lossy(data.get(r)?).into_owned())
}
impl Cff {
pub fn parse(data: &[u8]) -> Option<Cff> {
let d = data;