0

After following this guide I'm still not able to use my custom font in my Rails application.

This is my new Assets file structure:

|-app/

|---assets/

|-----fonts/ |-----images/ |-----javascripts/ |-----stylesheets/

In the fonts directory I placed a file named: "Hurme Design - HurmeGeometricSans3 Regular"

I edited my config/application.rb which now looks like so:

require File.expand_path('../boot', __FILE__)

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Criteofootball
  class Application < Rails::Application

    config.assets.paths << Rails.root.join("app", "assets", "fonts")

    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :de
  end
end

In my scss file I wrote the following in order to apply the font to all my HTML elements:

@font-face {
  font-family: "Hurme Design";
  src: font-url(Hurme Design - HurmeGeometricSans3 Regular);
}

html *
{

   font-family: "Hurme Design" !important;
}

Thanks a lot in advance!

ilrock
  • 573
  • 8
  • 24

0 Answers0