Embed a single monospace face to shrink PDFs

This commit is contained in:
gloamxun committed 2026-10-19 21:42:17 +08:00
1 parent 2076da8f21
commit ea14b3edbf
5 files changed
+41 -5

No files matched your search

+10
View File
@@ -115,6 +115,16 @@ impl FontCache {
}
/// Adds the given font family to the cache and returns a reference to it.
pub fn add_font_family_single(&mut self, family: FontFamily<FontData>) -> FontFamily<Font> {
let font = self.add_font(family.regular);
FontFamily {
regular: font,
bold: font,
italic: font,
bold_italic: font,
}
}
pub fn add_font_family(&mut self, family: FontFamily<FontData>) -> FontFamily<Font> {
FontFamily {
regular: self.add_font(family.regular),