I have to use a custom font Jameel Noori Nastaleeq in a rails 5 app. I have never worked with assets pipeline in rails before. Here are some of the steps I have taken:
- create
fonts
folder inapp/assets
, and place the extractedttf
font file in it - add
config.assets.paths << Rails.root.join("app", "assets", "fonts")
inconfig/application.rb
add the following in
app/assets/stylesheets/couplets.scss
:@font-face {
font-family: 'Jameel Noori Nastaleeq';
src:asset-url('JameelNooriNastaleeq.ttf') format("truetype");
}
Although there is no error/warnings, the above steps have no effect. Am I missing something.
I have already seen similar questions Custom Font not working in Rails Asset Pipeline Integrating @font-face files into rails asset pipeline but their answers were not helpful.
Complete code in my github repo