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

Can't load icon font #4351

Closed
SpiritPixels opened this issue Jul 28, 2016 · 8 comments
Closed

Can't load icon font #4351

SpiritPixels opened this issue Jul 28, 2016 · 8 comments

Comments

@SpiritPixels
Copy link

SpiritPixels commented Jul 28, 2016

Hi.

I just can't find solution for icon font not loading on pages. It is a local Windows install, everything updated to latest version through npm. Didn't do any customizations to theme files so far. It is a clean install.

I see that component icon.css is importing icons from url(".../themes/default/assets/fonts/icons.eot"); (There is " \ " after first dot, but Github doesn't outputs it). Where " \ " should be "/ ".

Tried for testing purposes to change that to url("./../themes/default/assets/fonts/icons.eot"); but it still doesn't load, in debuger I see error:
downloadable font: download failed (font-family: "Icons" style:normal weight:normal stretch:normal src index:3): bad URI or cross-site access not allowed source: file:///E:/GoogleDrive/PROJECTS/my-framework/semantic/dist/themes/default/assets/fonts/icons.ttf

If you could tell me am I doing something wrong and how to fix it, or is it a bug in Semantic.

@SpiritPixels
Copy link
Author

SpiritPixels commented Jul 28, 2016

Ok, I found the reason why url("./../themes/default/assets/fonts/icons.eot"); did not work. I transfered it to local server and it loaded icon font.

But when I run gulp build it makes url(".../themes/default/assets/fonts/icons.eot"); again. (There is " \ " after first dot, but Github doesn't outputs it)

How to overide that?

@rlightner
Copy link

I had this same issue. Had to modify the template.

@fontName: 'icons';
@fallbackSRC: url("/Content/@{fontPath}/@{fontName}.eot");
@src:
  url("/Content/@{fontPath}/@{fontName}.eot?#iefix") format('embedded-opentype'),
  url("/Content/@{fontPath}/@{fontName}.woff2") format('woff2'),
  url("/Content/@{fontPath}/@{fontName}.woff") format('woff'),
  url("/Content/@{fontPath}/@{fontName}.ttf") format('truetype'),
  url("/Content/@{fontPath}/@{fontName}.svg#icons") format('svg')
;

@Dr-Dev
Copy link

Dr-Dev commented Aug 1, 2016

i just removed dots before "\themes" in semantic.css
it's working now
@font-face { font-family: 'Icons'; src: url("\themes/default/assets/fonts/icons.eot"); src: url("\themes/default/assets/fonts/icons.eot?#iefix") format('embedded-opentype'), url("\themes/default/assets/fonts/icons.woff2") format('woff2'), url("\themes/default/assets/fonts/icons.woff") format('woff'), url("\themes/default/assets/fonts/icons.ttf") format('truetype'), url("\themes/default/assets/fonts/icons.svg#icons") format('svg');

@rlightner
Copy link

rlightner commented Aug 1, 2016

Still an invalid url though, so not the best way to go. @jlukic I know you're busy, but is this a Windows thing? Looks like this might have something to do with #4174?

@SpiritPixels
Copy link
Author

I have a partial fix. I am using Windows 7. It is the most stable environment for me still.

Added @fontPath: "./../themes/default/assets/fonts"; to semantic/src/site/elements/icon.variables and it fixed path in dist/components/icon.css

Added also @fontPath: "./themes/default/assets/fonts"; to semantic/src/site/global/site.variables but it did not fix the path in dist/semantic.css but outputs the same path as in dist/components/icon.css

Maybe @jlukic can help with that?

@designosis
Copy link

@rlightner "Had to modify the template."

WHICH template?

@awgv
Copy link
Member

awgv commented Jul 7, 2017

I know it’s been a while, but apparently it was fixed somewhere in-between.

@grinich
Copy link

grinich commented Oct 22, 2018

Fixed for semantic-ui-less here: Semantic-Org/Semantic-UI-LESS#51

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

5 participants