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

Does not embed multiple font weights; not sensitive to CSS font-weight #7

Open
GrahamHannington opened this issue Nov 12, 2021 · 2 comments

Comments

@GrahamHannington
Copy link

Could you please enhance svg-buddy to embed multiple font weights (e.g. bold); ideally, also multiple font styles (e.g. italic)?

CSS snippet from an SVG file exported from CorelDRAW 2021:

.fnt1 {font-weight:normal;font-size:156.25px;font-family:'IBM Plex Sans'}
.fnt0 {font-weight:bold;font-size:156.25px;font-family:'IBM Plex Sans'}

svg-buddy embeds only the normal font weight:

 <style type="text/css"><![CDATA[@font-face {
    font-family:'IBM Plex Sans';
    src:url('data:application/font-woff2;charset=utf-8;base64,[base64-encoded-woff2-font]') format("woff2");
    font-weight:normal;
    font-style:normal;
}]]></style>

The browser displaying the SVG must approximate the bold weight ("faux bold").

While modern browsers are getting pretty good at this, it's not ideal.

If I zoom in on an SVG with this issue on my iPhone in Safari, I can see that Safari has attempted to approximate bold by closely overlapping two instances of the text in normal weight.

On older browsers, the approximation can look downright buggy.

@GrahamHannington
Copy link
Author

For now, I'm using this to get the missing @font-face at-rules:

https://amio.github.io/embedded-google-fonts/

and then "manually" (using a text editor) inserting them into the SVG files.

@GrahamHannington
Copy link
Author

GrahamHannington commented Nov 15, 2021

I've belatedly realized that this issue is a duplicate—or at least, near-duplicate—of issue #4.

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

No branches or pull requests

1 participant