jsPDF-CustomFonts-support
jsPDF-CustomFonts-support copied to clipboard
Optimizing pdf file size
Hello,
currently, when I add a font, it is included into the final pdf file as a whole. Is this right? Would it be possible to only include characters or character ranges that are actually used?
I suppose this would massively reduce the file size. Especially if one adds a huge font as fallback-font that supports the whole Unicode range.
Greetings
Hi, @HackbrettXXX Which fonts were all included in the PDF when you used them? I only examined the Unicode used by the user and extracted only the corresponding glyph table.
Oh, so you're already including only subsets of the fonts? I haven't tested it or looked through the code before.
So, sorry for bothering you...
It's okay. Thanks for your interest in the project. Let me know if there is something strange at any time.
Thanks again for your library,
I found something strange, when I embed Batang.ttf as MacRomanEncoding, then the file size is small, however when I embed Lato.ttf as WinAnsiEncoding, then the file is large, even if I do not use the font. Could it be that the different encoding have a different effect?
JP