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:
co-authored by
Claude Opus 5.5
parent
d0df520bc1
commit
740faf1c1f
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user