Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need embed fonts to be optional #158

Closed
davidburns573 opened this issue Nov 29, 2023 · 5 comments · Fixed by #183
Closed

Need embed fonts to be optional #158

davidburns573 opened this issue Nov 29, 2023 · 5 comments · Fixed by #183

Comments

@davidburns573
Copy link

davidburns573 commented Nov 29, 2023

Our team uses a number of font families that are very large when included in the <style/> tag of the exported svg. This results in image files that are 10000x larger. We would like to optionally disable the embedFonts step of the conversion process.

We've temporarily forked this repo and made our change, but it would be great if we could include this here since others may benefit as well!

Forked repo: https://github.com/davidburns573/dom-to-image-more

@YujiaCheng1996
Copy link

Agree! Just can't disable it with current apis.

@IDisposable
Copy link
Member

IDisposable commented Aug 8, 2024 via email

@YujiaCheng1996
Copy link

This should be relatively easy. I will dig into that this weekend. Do you have a test example jsfiddle

On Thu, Aug 8, 2024, 01:27 YujiaCheng1996 @.> wrote: Agree! Just can't disable it with current apis. — Reply to this email directly, view it on GitHub <#158 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGVMSZM3M4CB2SMFDDZEVTZQMFTPAVCNFSM6AAAAABMFY76G6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZVGA2DMMZTGY . You are receiving this because you are subscribed to this thread.Message ID: @.>

Doesn't need a test example.
It just adds all the font-face(s) found to the SVG without any means to disable it.
His solution is working.
0c4a634
Just add an option to disable the process or use a more intelligent algorithm to rule out the unrelated font-face(s).

@IDisposable
Copy link
Member

IDisposable commented Aug 9, 2024 via email

@YujiaCheng1996
Copy link

https://jsfiddle.net/fu01mxh7/1/
This shows an example with totally unrelated and huge fonts included in the global CSS.

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

Successfully merging a pull request may close this issue.

3 participants