<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Roger Walsh &#187; css</title>
	<atom:link href="http://www.rogerwalsh.com/category/development/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rogerwalsh.com</link>
	<description></description>
	<lastBuildDate>Tue, 31 May 2011 22:33:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>@font-face &#8211; Adding A Custom Font  To Your Site With CSS</title>
		<link>http://www.rogerwalsh.com/2010/02/14/font-face-adding-a-custom-font-to-your-site-with-css/</link>
		<comments>http://www.rogerwalsh.com/2010/02/14/font-face-adding-a-custom-font-to-your-site-with-css/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 16:17:57 +0000</pubDate>
		<dc:creator>Roger</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.rogerwalsh.com/?p=97</guid>
		<description><![CDATA[Until pretty recently web designers haven&#8217;t had too many options for adding custom typefaces to their site. The only ones we could reliably use were what are known as &#8216;web safe&#8217; (a set of typefaces that are installed by default on all PCs &#8211; fonts like verdana, arial, Times&#8230; the usual suspects). To get around [...]]]></description>
			<content:encoded><![CDATA[<p class="intro">Until pretty recently web designers haven&#8217;t had too many options for adding custom typefaces to their site. The only ones we could reliably use were what are known as &#8216;web safe&#8217; (a set of typefaces that are installed by default on all PCs &#8211; fonts like verdana, arial, Times&#8230; the usual suspects).</p>
<p>To get around this limitation designers used to create graphics for headlines, or use flash based scripts such as sifr. CSS3 allows for easy embedding of fonts on a page, surprisingly it&#8217;s supported well across all browsers.</p>
<p><span id="more-97"></span></p>
<h3>Browser Support for @font-face</h3>
<p>All modern browsers support the @font-face rule in some shape or form. Internet Explorer has supported it since IE4, with the only issue being that they only support embedding of their own proprietry font file &#8211; EOT. Safari, Firefox and Opera should all support True Type or Open Type fonts. Safari on the iPod/iPhone will only support SVG files. With this in mind it&#8217;s always good to pick a web safe back up font to ensure your site degrades nicely.</p>
<h3>Fonts and Licensing</h3>
<p>Fonts aren&#8217;t just free for everyone to use. Make sure that the font you plan on using on your site is bought and the license permits you to use it online. There are plenty of free fonts out there, use one of those if you aren&#8217;t sure. If a client insists on using Helvetica or other commercial font, make sure they buy it first!</p>
<h3>Converting Your Font</h3>
<p>If you have a TTF or OTF font you can convert it online to EOT and SVG using a service like <a href="http://www.fontsquirrel.com/fontface/generator" target="_blank">Font Squirrel</a> (who also provide some great free to use fonts, prepackaged for using on the web.) The typeface I&#8217;m using on this site is Charis which I downloaded from there. </p>
<p>Once you have your font files ftp them up onto your web site.</p>
<h3>The CSS</h3>
<p>Declare the fonts you wish to use at the top of your css file</p>
<pre>
@font-face {
	font-family: 'CharisSILRegular';
	src: url('Fonts/CharisSILR.eot');
	src: local('Charis SIL Regular'), local('CharisSIL'), url('Fonts/CharisSILR.ttf') format('truetype');
}
</pre>
<p><em>font-family</em>: This can be anything you want, it&#8217;s how you will call the font later on in your CSS file.<br /><em>src</em>: This tells the browser where your font is located.url is a location on your server, local would be the name of the file if a user happens to have it already and format is the file type. It&#8217;s always good to give the local name as it would mean that if the user has the font they don&#8217;t need to download it from your server. If the browser doesn&#8217;t find the font locally it will move to the next source. Declare your EOT file seperately from the others.</p>
<p>So now you have declared the font you can use it throughout your CSS in the same way you use other fonts</p>
<pre>h1 { font: 2em CharisSILRegular, Georgia, serif;}</pre>
<p>Don&#8217;t forget to add a fall back font (in this case Georgia, then any other serif font) to ensure maximum degradability. That&#8217;s all there is to it. Just like in print design try not add too many fonts to one design (even more importantly for the web as the browser needs to download every font the user doesn&#8217;t have locally)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rogerwalsh.com/2010/02/14/font-face-adding-a-custom-font-to-your-site-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

