You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that every embedded fonts adds about ~ 150–200 KiB to the size of the output file. This quickly leads to a quite large file when using multiple fonts. Running the generated file through ps2pdf reduces the file size to some KiB. As far as I see, this is because printpdf embeds every available glyph into the PDF file.
Would it be possible to keep track of the used characters and only embed the glyphs for the required characters?
The text was updated successfully, but these errors were encountered:
That would be possible, but only with a config / feature flag. For my purpose (creating topographic maps) I need to keep the entire font in the PDF because I send out the resulting PDF files to graphic designers and I want to ship the fonts with the PDF (instead of shipping them as separate files), so that graphic designers can edit / create new text with the same font.
For now it would probably be best if you do process::Command::new("ps2pdf") on the final file, if that is possible. What you're asking for is possible, but I'm not interested in implementing it right now, as I have a lot of other things to do. You can take a look at this function: https://docs.rs/allsorts/latest/allsorts/subset/fn.subset.html which takes a font file + glyph IDs and spits out a new .ttf file with the redundant glyph IDs trimmed from the file.
First of all, thanks for this very useful crate!
I noticed that every embedded fonts adds about ~ 150–200 KiB to the size of the output file. This quickly leads to a quite large file when using multiple fonts. Running the generated file through
ps2pdf
reduces the file size to some KiB. As far as I see, this is becauseprintpdf
embeds every available glyph into the PDF file.Would it be possible to keep track of the used characters and only embed the glyphs for the required characters?
The text was updated successfully, but these errors were encountered: