Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.

Optimizing pdf file size #32

Open
HackbrettXXX opened this issue Jan 11, 2018 · 4 comments
Open

Optimizing pdf file size #32

HackbrettXXX opened this issue Jan 11, 2018 · 4 comments

Comments

@HackbrettXXX
Copy link
Contributor

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

@sphilee
Copy link
Owner

sphilee commented Jan 12, 2018

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.

@HackbrettXXX
Copy link
Contributor Author

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...

@sphilee
Copy link
Owner

sphilee commented Jan 13, 2018

It's okay. Thanks for your interest in the project. Let me know if there is something strange at any time.

@jean343
Copy link

jean343 commented Feb 2, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants