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

when used with svg fonts, font is not loaded #111

Closed
macolo opened this issue Jul 20, 2017 · 2 comments
Closed

when used with svg fonts, font is not loaded #111

macolo opened this issue Jul 20, 2017 · 2 comments

Comments

@macolo
Copy link

macolo commented Jul 20, 2017

I am using svg-url-loader in my webpack config file:

            {
                test: /\.svg$/i,
                // fonts need to be loaded
                // exclude: /fonts/,
                loader: "svg-url-loader",
            },

This CSS is required in main.js, it specifies an svg font:

@font-face {
    font-family: 'Sofia Pro';
    src: url('./_webfonts/sofiapro-bold-webfont.eot');
    src: url('./_webfonts/sofiapro-bold-webfont.eot?#iefix') format('embedded-opentype'),
         url('./_webfonts/sofiapro-bold-webfont.woff2') format('woff2'),
         url('./_webfonts/sofiapro-bold-webfont.woff') format('woff'),
         url('./_webfonts/sofiapro-bold-webfont.ttf') format('truetype'),
         url('./_webfonts/sofiapro-bold-webfont.svg#sofia_probold') format('svg');
    font-weight: bold;
    font-style: normal;
}

In this case, all other font formats also dont work. If uncomment the exclude for svg-url-loader, the woff is loaded correctly.

@Neunerlei
Copy link

I stumbled upon this issue today.
It seems to have an issue with the Hashtag inside the font declarations.
After looking through the source code, there are two solutions to this issue:
Either, set the Encoding to "base64".
Or set the NoQuotes parameter to TRUE.
Both fixes the issues
Cheers!

@bhovhannes
Copy link
Owner

This is no longer an issue, closing this.

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

3 participants