- Сообщений: 10
- Спасибо получено: 0
Очень неновая, но по-прежнему эффектная галерея изображений ImageFlow - на новеньком Ruby on Rails 7.
@font-face {
font-family: 'Name of Font';
src: url('/path-to/font-file.file-extension')
}
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
app/assets/fonts
font-url
@font-face {
font-family: 'Font_Name';
src: font-url('Font_Name.ttf');
}
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.
yotson пишет: Хотя следую совету продвинутой девушки по ссылке:
@font-face {
font-family: 'Name of Font';
src: url('/path-to/font-file.file-extension')
}
You have two main options here:
1. Update the path request:
So use /assets/amaze.ttf instead of /fonts/amaze.ttf.
Be aware that in order for the path /assets/fonts/amaze.ttf to work you would need to put the amaze.ttf font in /app/assets/fonts/fonts/ or /vendor/assets/fonts/fonts/. The double fonts directory ensures there is a fonts directory in /public/assets after the assets are compiled. See this answer for more info.
2. Move your fonts directory to your public directory:
Since the requested path doesn't utilize the Asset Pipeline anyway, you can simply move your fonts directory to the /public/ directory and the web server will automatically serve it. So your font(s) should be located at /public/fonts/amaze.ttf, etc.
That should do it!
Пожалуйста Войти или Регистрация, чтобы присоединиться к беседе.