Jump to content
  • Sign Up
  • 0

Объединение начертаний шрифта


maxakagaret

Question

Приветствую профессионалов и новичков верстки.

Столкнулся на днях со проблемой использоапния шрифтов на сайте. Прежде активно пользовался гугловским сервисом, однако последнее время стали наблюдаться перебои в его работе и в итоге на странице текст отображается шрифтом по умолчанию, что никак не устраивает (это я еще молчу про время, которое требуется из-за этого на открытие страницы). Поэтому появилась необходимость отказаться от гугла и грузить шрифт с сервера. Вот тут и появилась сложность. К примеру шрифт Dosis. У него различные начертания (Dosis-Book, Dosis-Medium, Dosis-Light, Dosis-SemiBold ...) расположены в разных файлах. Когда шрифт подключался через гугл, то использовалось только имя шрифта, а начертание задавалось при помощи font-weight (например, для Dosis Medium font-wieght:500, для Dosis-Semibold font-wieght:600). Можно ли подключить этот шрифт без гугла так же под именем Dosis, и очертание задавать font-weight'ом при помощи средств HTML/CSS или, в крайнем случае, JS. Или же можно сам шрифт объединить в один файл?

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Например

@font-face {   font-family: 'Dosis';   src: url('../font/Dosis/Dosis-regular.woff');   font-weight: 400;       font-style: normal;}@font-face {        font-family: 'Dosis';   src: url('../font/Dosis/Dosis-italic.woff');    font-weight: 400;       font-style: italic;}@font-face {        font-family: 'Dosis';   src: url('../font/Dosis/Dosis-bold.woff');      font-weight: 700;       font-style: normal;}@font-face {        font-family: 'Dosis';   src: url('../font/Dosis/Dosis-bold-italic.woff');       font-weight: 700;       font-style: italic;}body {        font-family: 'Dosis';}
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy