Having trouble getting fonts to work I was using Berlin Sans Serif but
it
was working so I tried downloading another font to replace it but that’s
not working either
I placed the font in app/assets/fonts and in my stylesheet i put the
following:
config.assets.paths << Rails.root.join(“app”, “assets”, “fonts”)
to application.rb, i did that and restarted the server but it didn’t
help
It also said for rails 4 you don’t have to do anything but place the
font
file in assets/fonts but otherwise for rails 4.2+ I’m using rails 4.18
and
it doesn’t say anything specifically to 4.1+ so can i assume my version
should
be treated as 4, i don’t know
I changed
src: url(/assets/fonts/ufonts.com_
metrolis-negro-opentype.otf) format(“truetype”);
to
src: font-url(/assets/fonts/ufonts.com_
metrolis-negro-opentype.otf) format(“truetype”);
and that got me a syntax error expected “)” was “.otf…”
that error goes away and the page comes back if i put single quotes
src: url(’/assets/fonts/ufonts.com_
metrolis-negro-opentype.otf’) format(“truetype”);
but the font still doesn’t get applied
config.assets.paths << Rails.root.join(“app”, “assets”, “fonts”)
to application.rb, i did that and restarted the server but it didn’t help
It also said for rails 4 you don’t have to do anything but place the font
file in assets/fonts but otherwise for rails 4.2+ I’m using rails 4.18 and
it doesn’t say anything specifically to 4.1+ so can i assume my version
should
be treated as 4, i don’t know
There is no Rails 4.18
Colin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.