<?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>font in web page Archives - Sky&#039;s Blog</title>
	<atom:link href="https://blog.red7.com/tag/font-in-web-page/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.red7.com/tag/font-in-web-page/</link>
	<description>Communicating in a networked world</description>
	<lastBuildDate>Mon, 02 Jan 2017 20:15:04 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.red7.com/wp-content/uploads/2018/01/skyhi-wind-icon-256x256-120x120.png</url>
	<title>font in web page Archives - Sky&#039;s Blog</title>
	<link>https://blog.red7.com/tag/font-in-web-page/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Embed web page fonts using @font-face</title>
		<link>https://blog.red7.com/embed-fonts-using-font-face/</link>
					<comments>https://blog.red7.com/embed-fonts-using-font-face/#comments</comments>
		
		<dc:creator><![CDATA[sky]]></dc:creator>
		<pubDate>Mon, 25 Jan 2010 17:15:28 +0000</pubDate>
				<category><![CDATA[Software and online tools]]></category>
		<category><![CDATA[Technology and geeky stuff]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[embed fonts]]></category>
		<category><![CDATA[font in web page]]></category>
		<category><![CDATA[web page]]></category>
		<guid isPermaLink="false">http://sky.dlfound.org/?p=2129</guid>

					<description><![CDATA[<p>In searching for a solution to embed a particular font in one of my games[1] at YBCA, I spent dozens of hours experimenting with the @font-face cross-browser[2] CSS technology. It&#8217;s a technique that allows your browser (like MSIE or Firefox, right?) to read a TrueType (.TTF) or OpenType (.OTF) font file from a server and [&#8230;]</p>
<p>The post <a href="https://blog.red7.com/embed-fonts-using-font-face/">Embed web page fonts using @font-face</a> appeared first on <a href="https://blog.red7.com">Sky&#039;s Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="size-full wp-image-2474 alignleft" style="border: 0pt none; margin: 2px 12px;" title="fontbook" src="/wp-content/uploads/2010/01/fontbook.jpg" alt="" width="128" height="128" /> In searching for a solution to embed a particular font in one of my games<sup>[1]</sup> at <a href="http://ybca.org/" target="_blank">YBCA</a>, I spent dozens of hours experimenting with the <em>@font-face</em> cross-browser<sup>[2]</sup> CSS technology. It&#8217;s a technique that allows your browser (like MSIE or Firefox, right?) to read a TrueType (.TTF) or OpenType (.OTF) font file from a server and then use it to render type on a web page. The headlines on my blog are rendered using this technology<sup>[3]</sup>. I&#8217;m really happy with the results.</p>
<p><em>The idea is to give the designer of the web page the ability to select exactly the font he or she wants to see on the finished page!</em></p>
<p>But, even with this great tech in place, Microsoft is playing its game of insisting on its own solution—they propose it as a &#8220;web standard&#8221; but in real life it’s implemented by nobody except Microsoft (using their .EOT file format). So there are two competing and incompatible ways of adding fonts to a web page—the open-source method, and the Microsoft method.</p>
<p>Initially I was able to devise a solution that works <em>except</em> for FireFox (it failed both on Mac OSX and on Windows and Firefox represents about 40% of my users so I really need it to work)&#8230; and then, by accident&#8230;<span id="more-2129"></span></p>
<p><img decoding="async" class="mceWpPHP" title="php" src="/wp-content/plugins/php-execution-plugin/assets/trans.gif" alt="" />I discovered a hack that made Firefox work!</p>
<p>Look, to give Microsoft a break here, the reason they use their EOT format is to protect fonts from pirates. Each EOT file is tied to a particular domain name, though the same mechanism can be used to make the font free for use everywhere. The theory is that purchased fonts would be tied to a domain (and a license agreement) and free fonts would be freely available to all, but the EOT format would be used in all cases. I purchased a font for the YBCA game, installed it on a particular domain as an EOT, and it works great, but only in Internet Explorer.</p>
<p>Actually it feels like I spent <span style="text-decoration: underline;">days</span> figuring out @font-face. The difficulty is not just that MS has its own standard &#8211; it&#8217;s that the feature is so new that there are differences (actually they&#8217;re bugs) among how the various browsers handle it. Paul explains that the solution is to find a way to trick each browser into using only the portion of the CSS rule that applies to that specific browser. The final trick that enabled Firefox (for me &#8211; and also Opera at the same time) was figuring out when to use and when not to use quotes in the <em>src: url()</em> portion of the CSS rule that reads the fonts.</p>
<p>The most-often-quoted solution page is <a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/" target="_blank">Paul Irish&#8217;s page on @font-face</a>. His solution worked for me, except for FireFox, so you can start with his solution if you wish.</p>
<p>Here’s what worked for me. I just added this to my CSS file for the site, then use class=&#8217;headlines&#8217; to style whatever headline element I want the font used in.</p>
<p>One key trick (for me) is to <em>not</em> put quotes around the filenames in the <em>url()</em> portion of the @font-face declaration. The quotes trip up some browsers. Remember that the URLs are relative to your own web server base.</p>
<blockquote>
<p>@font-face {<br /> font-family: &#8216;Headlines&#8217;;<br /> src: url(/fonts/SF_Cartoonist_Hand.eot);<br /> src: local(&#8216;Headlines Web Regular&#8217;), local(&#8216;Headlines Web&#8217;),<br /> url(/fonts/SF_Cartoonist_Hand.ttf) format(&#8216;truetype&#8217;);<br /> }<br /> .headlines h2.headlines {<br /> font-size: 15pt;<br /> text-decoration: none;<br /> letter-spacing: 1px;<br /> font-family:Headlines, arial, helvetica, sans-serif;<br /> color:#3FC;<br /> }</p>
</blockquote>
<p>The key components are the “@font-face {}” declaration, which points to the EOT file for MSIE, and the TTF file for other browsers, and then the use of the “font-family:Headlines” within the definition of the style “headlines” which style can then be used within HTML pages. You just use it like this:</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="left" width="160px">
<h2 class="headlines">This is a headline</h2>
</td>
<td align="left">(Code below)</td>
</tr>
</tbody>
</table>
<blockquote>
<p>&lt;h2 class=&#8221;headlines&#8221;&gt;This is a headline&lt;/h2&gt;</p>
</blockquote>
<p>Ranked from most useful to least useful:</p>
<p><a href="http://hacks.mozilla.org/2009/06/beautiful-fonts-with-font-face/" target="_blank">Beautiful fonts with @font-face</a> {hacks.mozilla.org} a thorough discussion to get you started</p>
<p><a href="http://inspectelement.com/tutorials/go-beyond-web-safe-fonts-with-css3/" target="_blank">Go Beyond Web-Safe Fonts with CSS3</a> has a few screen shots showing nice uses of fonts {copies a lot of what’s in the others}</p>
<p>Tools:</p>
<p>Microsoft Typography <a href="http://www.microsoft.com/typography/web/embedding/weft3/download.aspx" target="_blank">WEFT tool</a> {download this tool (a Windows EXE) that creates the required EOT file for MSIE if you are starting with only a TrueType font}</p>
<hr class="hr_dashed" />
<p>[1] Pink Yourself at YBCA {revisiting Gran Fury&#8217;s SILENCE=DEATH from the 1980s}</p>
<p>[2] @font-face works (with the various hacks described above) in Internet Explorer 8 {MSIE}, Firefox, Safari, Opera. It does not work in Flock. Google has turned it off in Chrome &#8211; it&#8217;s expected to work at a future date.</p>
<p>[3] The headline font I chose is <span style="font-family: Headlines; font-size: 32px;">SF Cartoonist Hand</span>, downloaded from <a href="http://www.fontsquirrel.com/" target="_blank">FontSquirrel.com </a>&#8211; they have a flurry of <a href="http://www.fontsquirrel.com/fontface" target="_blank">@font-face compatible fonts</a> and &lt;whew!&gt; they provide both the TTF TrueType and the EOT Microsoft-compatible files for each font they offer. This is a great source of dozens of free fonts that are ready to download and install, once you have the CSS syntax worked out.</p>
<p>The post <a href="https://blog.red7.com/embed-fonts-using-font-face/">Embed web page fonts using @font-face</a> appeared first on <a href="https://blog.red7.com">Sky&#039;s Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.red7.com/embed-fonts-using-font-face/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2129</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 

Served from: blog.red7.com @ 2026-04-17 06:29:00 by W3 Total Cache
-->