html - Font-face trouble (sharp edges) in Firefox -


i'm using font:

https://material.io/guidelines/resources/roboto-noto-fonts.html

(roboto-regular.ttf , roboto-medium.ttf)

and in css (less) define @font-face way:

@font-face {   font-family: 'roboto';   src: url('roboto-regular.ttf') format('truetype'); }  @font-face {   font-family: 'roboto-medium';   src: url('roboto-medium.ttf') format('truetype'); } 

later use so:

html {   font-size: 62.5%; }  body {   font-family: 'roboto', sans-serif;   -webkit-font-smoothing: antialiased;   -moz-osx-font-smoothing: grayscale; }  .some-element {   font: 2.2rem 'roboto'; } 

and in every browser, except firefox , ie ok.

in browsers got:

enter image description here

in chrome fine:

enter image description here

edges aren't smooth, don't know, why? wrong? btw: cannot use google-fonts

for whatever reason, font doesn't seem optimized web, though material page says "the latest version of roboto designed both mobile , web usage."

however, there free services convert ttf font general webfont, font squirrel. used tool convert "roboto regular" font webfont , looks fine. setup demo you, since requires hosting file, put demo on personal website - http://www.mcoker.com/font/

so use tool create webfont package each of roboto fonts want use... however, unless have specific reason host webfont yourself, use google fonts cdn.

html {    font-size: 62.5%;  }  body {    font-family: 'roboto';    -webkit-font-smoothing: antialiased;    -moz-osx-font-smoothing: grayscale;    font-size: large;  }  .some-element {    font-size: 5em;    margin: 0;  }
<link href="https://fonts.googleapis.com/css?family=roboto:400,500" rel="stylesheet">  <p class="some-element">foo bar</p>  <p> lorem ipsum dolor sit amet, consectetur adipiscing elit. proin ut enim vitae arcu vestibulum eleifend. quisque leo mi, facilisis sed massa non, cursus ornare tortor. integer sem magna, porttitor @ dui at, pharetra iaculis risus. aliquam @ viverra velit. morbi condimentum, elit eu ultricies imperdiet, elit urna vulputate urna, commodo lacus est in lorem. donec ultricies hendrerit volutpat. donec arcu nisl, rhoncus et auctor convallis, cursus sit amet nisl. vivamus laoreet augue id congue sollicitudin. </p>


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -