I want to load multiple font data.
When load font data, output the following error.
thread 'main' panicked at 'Invalid glyph_ver_side_bearing', /Users/keiya/.cargo/registry/src/github.com-1ecc6299db9ec823/ab_glyph-0.2.12/src/ttfp.rs:334:1
I'm using try_from_slice_and_index to load some font data.
But I don't know how to get next index. If fonts_in_collection is exported, I should be able to get next index.
Is there the way to get fonts collection length like the following ?
let i = owned_ttf_parser::fonts_in_collection().unwrap_or(0);
match FontRef::try_from_slice_and_index(data, i) {
Ok(font) => Ok(font),
Err(_) => Err(Error::InvalidFontBytes),
}
I want to load multiple font data. When load font data, output the following error.
I'm using
try_from_slice_and_index
to load some font data. But I don't know how to get next index. Iffonts_in_collection
is exported, I should be able to get next index.Is there the way to get fonts collection length like the following ?
Thank you.