WheeQo.web.id

R. Bambang Widiatmoko's Blog | Sharing Knowledge to the World

Non-System Web Font with HTML5 @font-face Syntax

| 2 Comments


In this post I just want to try the new feature of HTML5 that is non-system web font support, to be used in my blog which is using WordPress. Well I’ve read some reference to implement this feature which will use @font-face syntax. You can read:
Bulletproof @font-face syntax article for the tutorial and @font-face Generator which will generate files like .eot (used by Internet Explorer to support css @font-face declarations), .svg, .html, and .css; so that you can learn @font-face syntax from those files. For converter .ttf or .otf to .eot you can use application to convert TTF files to EOT. Don’t forget to read the wiki how to use the application.

I will show short tutorial how to implement @font-face syntax. Prepare .ttf or .otf font and .eot file. Upload it to folder of your template where there is css file. For the example I use Yikes font.

Edit css and insert this code:

@font-face {
	font-family: 'Yikes';
	src: url('yikes.eot');
	src: local('☺'), url('yikes.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
}

.yikes1 {font: 2em 'Yikes', Arial, sans-serif;}

If you use wordpress change to HTML mode when create new post, then insert this code (for example):

R. Bambang WidiatmokoFeaturing Yikes font

And here is the result:

R. Bambang Widiatmoko
Featuring Yikes font

Try to select the text ^^ *only works for HTML 5 support browser*

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.