I'm not a UI developer but sometimes I work on it because of lack of human resources in my team. Latest I tried to use custom font to be included in LESS. I'd done it before in CSS. When I tried to complied LESS file using grunt, the console notified me that compilation was error because I don't use bulletproof font face. What is bulletproof font face?
When you declare a font-face you must include more than one type of fonts so your style will be run well in every types of browser. Maybe you just use this code to declare custom font-face:
@font-face {
font-family: 'MyFont';
src: url('myfont.ttf')
}
But that isn't bulletproof. That declaration can cause unwanted output, for example in Internet Explorer or other old browsers. You should use this one:
@font-face {
font-family: 'MyFont';
src: url('myfont.eot?#iefix') format('embedded-opentype'),
url('myfon.woff') format('woff'),
url('myfont.ttf') format('truetype'),
url('myfont.svg#svgFontName') format('svg');
}
It's better that you include some other font formats and add some parameters on it. If you have only one type of font format, there are plenty of free web tools to convert fonts. These are some links:
Comments
Post a Comment