Closed rileyjshaw closed 10 years ago
validate-generate.sh currently creates the following css rules:
@font-face { font-family: 'FantasqueSansMono-RegItalic'; src: url('FantasqueSansMono-RegItalic.eot'); /* IE 9 Compatibility Mode */ src: url('FantasqueSansMono-RegItalic.eot?#iefix') format('embedded-opentype'), /* IE < 9 */ url('FantasqueSansMono-RegItalic.woff') format('woff'), /* Firefox >= 3.6, any other modern browser */ url('FantasqueSansMono-RegItalic.ttf') format('truetype'), /* Safari, Android, iOS */ url('FantasqueSansMono-RegItalic.svg#FantasqueSansMono-RegItalic') format('svg'); /* Chrome < 4, Legacy iOS */ } @font-face { font-family: 'FantasqueSansMono-Regular'; src: url('FantasqueSansMono-Regular.eot'); /* IE 9 Compatibility Mode */ src: url('FantasqueSansMono-Regular.eot?#iefix') format('embedded-opentype'), /* IE < 9 */ url('FantasqueSansMono-Regular.woff') format('woff'), /* Firefox >= 3.6, any other modern browser */ url('FantasqueSansMono-Regular.ttf') format('truetype'), /* Safari, Android, iOS */ url('FantasqueSansMono-Regular.svg#FantasqueSansMono-Regular') format('svg'); /* Chrome < 4, Legacy iOS */ } // ...etc.
This means that when assigning fonts, style and weight are determined by the font-family name. A cleaner pattern is the following:
@font-face { font-family: 'FantasqueSansMono'; src: url('FantasqueSansMono-RegItalic.eot'); /* IE 9 Compatibility Mode */ src: url('FantasqueSansMono-RegItalic.eot?#iefix') format('embedded-opentype'), /* IE < 9 */ url('FantasqueSansMono-RegItalic.woff') format('woff'), /* Firefox >= 3.6, any other modern browser */ url('FantasqueSansMono-RegItalic.ttf') format('truetype'), /* Safari, Android, iOS */ url('FantasqueSansMono-RegItalic.svg#FantasqueSansMono-RegItalic') format('svg'); /* Chrome < 4, Legacy iOS */ font-weight: normal; font-style: italic; } @font-face { font-family: 'FantasqueSansMono'; src: url('FantasqueSansMono-Regular.eot'); /* IE 9 Compatibility Mode */ src: url('FantasqueSansMono-Regular.eot?#iefix') format('embedded-opentype'), /* IE < 9 */ url('FantasqueSansMono-Regular.woff') format('woff'), /* Firefox >= 3.6, any other modern browser */ url('FantasqueSansMono-Regular.ttf') format('truetype'), /* Safari, Android, iOS */ url('FantasqueSansMono-Regular.svg#FantasqueSansMono-Regular') format('svg'); /* Chrome < 4, Legacy iOS */ font-weight: normal; font-style: normal; } // ...etc.
This way a general font-family: 'FantastiqueSansMono' rule can be used and font-weight and font-style will work as expected.
Awesome!! Thanks :)
You're welcome! Here is the resulting file: https://gist.github.com/belluzj/9454852
validate-generate.sh currently creates the following css rules:
This means that when assigning fonts, style and weight are determined by the font-family name. A cleaner pattern is the following:
This way a general font-family: 'FantastiqueSansMono' rule can be used and font-weight and font-style will work as expected.