<?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>DivitoDesign &#187; FLIR</title> <atom:link href="http://divitodesign.com/tag/flir/feed/" rel="self" type="application/rss+xml" /><link>http://divitodesign.com</link> <description>Articles, Tutorials and Resources for the Webdesigner</description> <lastBuildDate>Fri, 07 Oct 2011 18:47:18 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>Install FLIR &#8211; Typography Solution For The Web</title><link>http://divitodesign.com/typography/install-flir-typography-solution-for-the-web/</link> <comments>http://divitodesign.com/typography/install-flir-typography-solution-for-the-web/#comments</comments> <pubDate>Sun, 12 Oct 2008 15:50:40 +0000</pubDate> <dc:creator>Stefan Vervoort</dc:creator> <category><![CDATA[Typography]]></category> <category><![CDATA[FLIR]]></category><guid isPermaLink="false">http://www.divitodesign.com/?p=867</guid> <description><![CDATA[As we&#8217;ve talked about before, I am not happy with the lack of support for awesome typography on the internet. The possibilities are just limited, so we looked for alternatives. We have discussed sIFR3 in the past, so today it&#8217;s time we will experiment with another typography alternative: FLIR. Basic Information about FLIR Facelift Image [...]]]></description> <content:encoded><![CDATA[<p>As we&#8217;ve talked about before, I am not happy with the lack of support for awesome typography on the internet. The possibilities are just limited, so we looked for alternatives. We have discussed <a href="http://www.divitodesign.com/2008/09/implant-sifr3-healthy-alternative-browser-tex/">sIFR3</a> in the past, so today it&#8217;s time we will experiment with another typography alternative: <strong>FLIR</strong>.</p><p><img title="flir" src="http://www.divitodesign.com/wp-content/uploads/2008/10/flir.jpg" alt="" width="435" height="105" /></p><h2>Basic Information about FLIR</h2><p><a href="http://facelift.mawhorter.net/">Facelift Image Replacement</a> or FLIR has been build because the author <a href="http://www.mawhorter.net/">Cory Mawhorter</a> got tired with the basic Arial and Times New Roman (who doesn&#8217;t?), and he didn&#8217;t like the way sIFR was solving this problem.</p><p>So he decided to develop an alternative called FLIR. It works with JavaScript, PHP and CSS, and doesn&#8217;t use Flash at all.</p><h2>How does FLIR work?</h2><p>When you have installed FLIR on your website and your visitor loads a webpage, your browser detects the JavaScript file. The text that is identified as &#8220;FLIR&#8221; text get send to your PHP server which will generate images with the fonts you specified. The original text will remain in the source and that makes FLIR search engine friendly.</p><p>This whole process is faster than sIFR and your visitors will not notice anything.<br /> <span id="more-867"></span></p><h2>What if Javascript isn&#8217;t supported?</h2><p>If Javascript isn&#8217;t supported the browser will simply return normal browser text and therefore FLIR is a very accessible technique that works anywhere.</p><h2 class="tag">FLIR Installation</h2><p>When I was researching this technique I found out it is very easy to install FLIR to your website. We will install FLIR via 4 easy-to-follow steps:</p><p><em> </em></p><ul><li><em>Download the files</em></li><li><em>Configuring</em></li><li><em>Add to the website</em></li><li><em>Styling</em></li></ul><p><em></em></p><h2>1. Download the files</h2><p>The first things you need are the files to make everything work. We need to download the latest version of FLIR files from the <a href="http://facelift.mawhorter.net/download/">official download page</a>. The version I use in this tutorial is <strong>1.2</strong>.</p><h2>2. Configuring</h2><p>We need to configure the <em>config-flir.php</em> file to define the fonts we would like to use. Open the file and find the following lines:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
</pre><pre><span class="php"><span class="php-brackets">}</span><span class="php-script-tag">&lt;?php</span>
<span class="php-comment">// Each font you want to use should have an entry in the fonts array.
</span>
<span class="php-var">$fonts</span> <span class="php-operator">=</span> <span class="php-keyword">array</span><span class="php-brackets">(</span><span class="php-brackets">)</span>;
<span class="php-var">$fonts</span><span class="php-brackets">[</span><span class="php-string">'illuminating'</span><span class="php-brackets">]</span>     <span class="php-operator">=</span> <span class="php-string">'ArtOfIlluminating.ttf'</span>;
<span class="php-var">$fonts</span><span class="php-brackets">[</span><span class="php-string">'okolaks'</span><span class="php-brackets">]</span>     <span class="php-operator">=</span> <span class="php-string">'okolaksBold.ttf'</span>;
<span class="php-var">$fonts</span><span class="php-brackets">[</span><span class="php-string">'wanta'</span><span class="php-brackets">]</span>         <span class="php-operator">=</span> <span class="php-string">'wanta_091.ttf'</span>; <span class="php-script-tag">?&gt;<span class="html"></span></span></span></pre></div><p>If you would like to add &#8216;arial&#8217; for example, you need to copy the <em>arial.tff</em> file to the <em>fonts</em> folder. Next you need to add the following lines of codes:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="php"><span class="php-script-tag">&lt;?php</span> <span class="php-var">$fonts</span><span class="php-brackets">[</span><span class="php-string">'arial'</span><span class="php-brackets">]</span>         <span class="php-operator">=</span> <span class="php-string">'arial.ttf'</span>; <span class="php-script-tag">?&gt;<span class="html"></span></span></span></pre></div><p>Add as many fonts as you need on your site. There are more options that you can change but remember everything you do could have consequences for the output.</p><h2>3. Add to the website</h2><p>Once you have saved the <em>config-flir.php</em> file you are ready to implant FLIR in your website.</p><p>Add this line of codes between your <em>&lt;head&gt;</em> tags and <strong>after your stylesheet(s).</strong></p><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="html"><span class="html-script-element">&lt;script src=<span class="html-attribute">&quot;/path-to-flir/js/flir.js&quot;</span> type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span></span></pre></div><p> Next, you need to find the <em>&lt;/body</em>&gt; tag and you should add these codes <strong>before</strong> this tag.<div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
</pre><pre><span class="html"><span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js"><span class="js-operator">&lt;</span><span class="js-operator">!</span><span class="js-operator">-</span><span class="js-operator">-</span>
FLIR.init<span class="js-bracket">(</span> <span class="js-bracket">{</span> path<span class="js-operator">:</span> <span class="js-string">'/path-to-flir/'</span> <span class="js-bracket">}</span> <span class="js-bracket">)</span>;
FLIR.<span class="js-native-keyword">replace</span><span class="js-bracket">(</span><span class="js-bracket">)</span>;
<span class="js-comment">// --&gt;</span></span></span>&lt;/script&gt;</span></span></pre></div><p>These steps are important and if you don&#8217;t do it exactly like this, FLIR will not work correctly.</p><h2>4. Styling</h2><p>By default FLIR styles h1 to h5, but you could add more elements to this list. For example, you may want to style <em>strong</em> or <em>em</em> elements, or others. You can do that in this way:</p><p>Find the <strong>FLIR.replace();</strong> attribute you&#8217;ve just added before the <em>&lt;/body&gt;</em> tag. You can edit that attribute like this:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
</pre><pre><span class="js">FLIR.<span class="js-native-keyword">replace</span><span class="js-bracket">(</span> <span class="js-string">'h2'</span>, <span class="js-reserved-keyword">new</span> FLIRStyle<span class="js-bracket">(</span><span class="js-bracket">{</span> cFont<span class="js-operator">:</span><span class="js-string">'some font'</span> <span class="js-bracket">}</span><span class="js-bracket">)</span> <span class="js-bracket">)</span>
FLIR.<span class="js-native-keyword">replace</span><span class="js-bracket">(</span> <span class="js-string">'div#entries h3'</span>, <span class="js-reserved-keyword">new</span> FLIRStyle<span class="js-bracket">(</span><span class="js-bracket">{</span> cFont<span class="js-operator">:</span><span class="js-string">'some font'</span> <span class="js-bracket">}</span><span class="js-bracket">)</span> <span class="js-bracket">)</span></span></pre></div><p>As you can see, you can add multiple elements to this list and give them a specific font.</p><p>If you would like to specify a default font, you can do it with the other FLIR function you&#8217;ve added before called <em>FLIR.init();</em></p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
</pre><pre><span class="html"><span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js"><span class="js-operator">&lt;</span><span class="js-operator">!</span><span class="js-operator">-</span><span class="js-operator">-</span>
FLIR.init<span class="js-bracket">(</span> <span class="js-bracket">{</span> path<span class="js-operator">:</span> <span class="js-string">'/path-to-flir/'</span> <span class="js-bracket">}</span>, <span class="js-reserved-keyword">new</span> FLIRStyle<span class="js-bracket">(</span><span class="js-bracket">{</span> cFont<span class="js-operator">:</span><span class="js-string">'your font'</span>
<span class="js-bracket">}</span><span class="js-bracket">)</span> <span class="js-bracket">)</span>;
<span class="js-comment">// --&gt;</span></span></span>&lt;/script&gt;</span></span></pre></div><h3>CSS</h3><p>Styling the elements you have included in the <em>FLIR.auto();</em> is very easy and can be done with normal CSS.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
</pre><pre><span class="css">h1#permalink{
<span class="css-property">font-family<span class="css-selector">:</span><span class="css-value"> <span class="css-string">'your custom font'</span>, Arial, Helvetica, sans-serif</span></span>;
}</span></pre></div><p>You should replace <strong>your custom font </strong>with a font you have added in step 2, in the <em>flir-config.php</em>. FLIR should be working fine now.</p><h3>Other CSS styles</h3><p>There is more. You can style your FLIR images exactly how you can style your browser text. For example:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
</pre><pre><span class="css">h1#permalink{
<span class="css-property">font-family<span class="css-selector">:</span><span class="css-value"> <span class="css-string">'your custom font'</span>, Arial, Helvetica, sans-serif</span></span>;
<span class="css-property">font-size<span class="css-selector">:</span><span class="css-value">30px</span></span>; <span class="css-comment">/* All font-sizes are supported */</span>
<span class="css-property">color<span class="css-selector">:</span><span class="css-value">#ccc</span></span>;
<span class="css-property">text-align<span class="css-selector">:</span><span class="css-value">center</span></span>;
}</span></pre></div><h2>Tips &amp; Tricks</h2><p>The basic installation is finished, FLIR should be working correctly right now. Here are some links related to FLIR that might interest you as well.</p><ul><li><a href="http://facelift.mawhorter.net/">FLIR homepage</a></li><li><a href="http://facelift.mawhorter.net/examples/">FLIR examples</a> | <a href="http://facelift.mawhorter.net/examples/"></a><a href="http://facelift.mawhorter.net/detailed-examples/">detailed examples</a></li><li><a href="http://wordpress.org/extend/plugins/facelift-image-replacement">FLIR WordPress Plugin</a></li><li><a href="http://facelift.mawhorter.net/preview/?mode=&amp;url=http%3A%2F%2Fwww.divitodesign.com">FLIR on DivitoDesign</a></li></ul><h2>sIFR vs FLIR?</h2><p>After testing and <a href="http://www.divitodesign.com/2008/09/implant-sifr3-healthy-alternative-browser-tex/">documenting</a> both techniques I came to the conclusion they are both awesome alternatives to the default CSS typography. FLIR loads fast on your website and has a very easy implantation process, while sIFR uses Flash and has a more advanced installation method.</p><p>I would <strong>recommend choosing FLIR</strong>, because the ease of implantation and loading time compared to sIFR.</p><h2>What The Author Has To Say</h2><p>Because I am absolutely no expert in FLIR or Javascript, I wasn&#8217;t sure if I&#8217;ve covered everything FLIR can do, so I emailed the author <a href="http://www.mawhorter.net">Cory Mawhorter</a> and he gave me some tips to improve the tutorial. He also wanted to respond to a couple of comments that have been made about the issues FLIR might have.</p><p><strong>Scalability</strong> (<a href="http://www.divitodesign.com/2008/10/install-flir-typography-solution-for-the-web/#comment-7727">comment</a>)<br /> You can use the the RefreshImages plugin included with FLIR to actually do a<br /> better job than sIFR at resizing text.  Any browser that actually changes<br /> the font size when you zoom will be detected and the image updated.  If the<br /> element is set to wrap, this will also be detected.  So if you resize the<br /> browser window, the elements will wrap properly instead of travel off the<br /> page.</p><p><strong>Selectability</strong> (<a href="http://www.divitodesign.com/2008/10/install-flir-typography-solution-for-the-web/#comment-7768">comment</a>)<br /> It is true FLIR lacks a bit in this department.  I see it more as a browser<br /> drawback, though.  Copying works as expected in FF but not in other<br /> browsers.  In FF, when you select and copy a replaced image the ALT text is<br /> grabbed, which gives you the desired result and actually allows you to copy<br /> blocks of text.  (In sIFR, you cannot copy the header that is replaced and<br /> also the paragraph below it.)</p><p>Also, since FLIR was built with plugins in mind you could write a plugin to<br /> handle the copying and pasting.  I plan on eventually doing this but haven&#8217;t<br /> yet.</p><p><strong>Kerning Issues</strong> (<a href="http://www.divitodesign.com/2008/10/install-flir-typography-solution-for-the-web/#comment-7746">comment</a>)<br /> The issue with the &#8220;I&#8221; isn&#8217;t a kerning issue but is actually a problem with<br /> PHP and GD and the way it handles alpha transparency with font glyphs.<br /> There are already multiple workarounds available that I have not implemented<br /> on my own site (which is why it is still like that).  They include, simply<br /> changing the output from PNG to GIF or using the FancyFonts plugin, if you<br /> need to maintain transparency.</p><p>To output GIF:  		FLIRStyle({ output:&#8217;gif&#8217; })<br /> To use FancyFonts:  	FLIRStyle({ mode:&#8217;fancyfonts&#8217; })</p> ]]></content:encoded> <wfw:commentRss>http://divitodesign.com/typography/install-flir-typography-solution-for-the-web/feed/</wfw:commentRss> <slash:comments>43</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 9/14 queries in 0.004 seconds using disk: basic
Object Caching 321/325 objects using disk: basic

Served from: divitodesign.com @ 2012-05-22 10:36:12 -->
