Allocate and share native PDF font objects
This commit is contained in:
1 parent
d12c4b034b
commit
51451813dc
12 files changed
+345
-20
No files matched your search
@@ -226,6 +226,17 @@ impl JobFontMap {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(super) fn scalable_object(
|
||||
&mut self, font: &NativeFont, files: &mut impl SourceProvider,
|
||||
) -> Result<bool, String> {
|
||||
if self.bindings.is_none() {
|
||||
self.initialize(true, &font.resource.version.path, files)?;
|
||||
}
|
||||
self.bind(font.id, &font.name);
|
||||
let entry = self.bindings.as_ref().expect("initialized font map").font(font)?;
|
||||
Ok(selected_outline(font, entry.as_deref(), false)?.is_some())
|
||||
}
|
||||
|
||||
fn bind(&mut self, id: FontId, name: &str) {
|
||||
let bindings = self.bindings.as_mut().unwrap();
|
||||
if bindings.fonts.contains_key(&id) {
|
||||
|
||||
Reference in new issue
Block a user