The font chosen may not be noticeable, but without it there would be one raisin, giving the website design is perfection.
There are 2 ways to add custom font to website:
- use cdn, that provide needed font (like https://fonts.google.com/)
- use font from local
For second variant first of all we need to convert current .ttf font, to others format. For this i usually use this service – https://www.web-font-generator.com/ . Just upload .ttf font, and get others. In html file you can use them from this constructure –
1 2 3 4 5 6 7 8 9 |
IF use sass: @include font-face("RobotoRegular", "../fonts/RobotoRegular/RobotoRegular", $file-formats: eot woff ttf svg); If use css: @font-face{font-family:RobotoRegular;font-style:normal;font-weight:400; src:url(../fonts/RobotoRegular/RobotoRegular.eot?#iefix) format("embedded-opentype"), url(../fonts/RobotoRegular/RobotoRegular.woff) format("woff"), url(../fonts/RobotoRegular/RobotoRegular.ttf) format("truetype"), url(../fonts/RobotoRegular/RobotoRegular.svg#RobotoRegular) format("svg")} |