0
votes

I am having trouble getting fonts to work on my sass website. I am new to sass and compass and everything is working except the fonts.

I generated the font-face files and put them in a folder library/font

In the config.rb file I added the following lines:

css_dir = "/"
sass_dir = "library/sass"
images_dir = "library/img"
fonts_dir = "library/font"
javascripts_dir = "library/js"

The generated font-face path in the style.css has a forward slash at the start.

src: url('///fonts/fontawesome-webfont-webfont.ttf') format('truetype'), url('///fonts/fontawesome-webfont-webfont.svg') format('svg'), url('///fonts/fontawesome-webfont-webfont.woff') format('woff'), url('///fonts/fontawesome-webfont-webfont.eot') format('embedded-opentype');

Any ideas what I am doing wrong?

1
What does the Sass look like that calls your font file? - cimmanon
It's not only the slash. The resulting path is completely different from what you've got in the config. - Andrey Mikhaylov - lolmaus

1 Answers

1
votes

Yes the font names called in the scr: were incorrect doh. However that did not solve my problem.

The fonts were being generated and had a / before the path name to the fonts folder. So I had to add this line in the config.rb file to fix it:

relative_assets = true

I am not sure if this was the correct way to get it all working. So any suggestions for next time would be great.

Thank you people for your time.