<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>

    <title>A List Apart: Comments on: Dynamic Text Replacement</title>
    <link>{url_title_path=articles/}</link>
    <description></description>
    <dc:language>en</dc:language>
    <dc:rights>Copyright 2012</dc:rights>
    <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />




    <item>
      <title>Posted by: kadavy</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/#1</link>
      <guid>http://www.alistapart.com/comments/dynatext/#1</guid>         
	  
      <description><![CDATA[That is all.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Colm</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/#2</link>
      <guid>http://www.alistapart.com/comments/dynatext/#2</guid>         
	  
      <description><![CDATA[Is it not an Accessibility requirement that you must be able to resize text? with this method I don't see the possiblity of increasing the size of the dynamic images?

Other than that minor flaw, the method is excellent!]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Chris</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/#3</link>
      <guid>http://www.alistapart.com/comments/dynatext/#3</guid>         
	  
      <description><![CDATA[Good question, however, if we look at accessibility in a logical way, it does not make sense to only zoom the text anyway. Screen magnifying software (every OS these days has inbuilt ones) magnify the whole screen. So does Opera, btw. It would be interesting to see how much more users use these tools rather than the hard to find (at least in IE) browser zooms.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: amon&#45;re</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/#4</link>
      <guid>http://www.alistapart.com/comments/dynatext/#4</guid>         
	  
      <description><![CDATA[One method to solve the accessibility method is to add a JavaScript script which doesn't just increase the font size, but also loads new images.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: CM Harrington</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/#5</link>
      <guid>http://www.alistapart.com/comments/dynatext/#5</guid>         
	  
      <description><![CDATA[Interesting idea. Personally I find it a bit heavy and limited, as you can't kern or otherwise manipulate the headline image dynamically. This could lead to fitting problems.

The other flaw is that this doesn't work for screen readers. Most modern screen readers use IE as the rendering engine, and merely speak everything that it sees. If the javascript replaces the headlines with images, they will no longer be read. 

This however is untrue in regard to text-only browsers. Obviously they will work "properly", as the text will not be replaced.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Andy Moss</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/#6</link>
      <guid>http://www.alistapart.com/comments/dynatext/#6</guid>         
	  
      <description><![CDATA[Does this method allow for different coloured matts? or are the images using an alpha channel? Also is it possible to set the images to render with only one picture as the volume of connections this would create could affect busy sites. Im certainly not criticising this. I think its a wonderful idea, just some thought for version 2 :)]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: oVan</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/#7</link>
      <guid>http://www.alistapart.com/comments/dynatext/#7</guid>         
	  
      <description><![CDATA[Anyone care to make an asp.net version of this? Microsoft uses dynamically generated in a lot of places now: see the gray banner "Microsoft Windows Small Business Server 2003" at http://www.microsoft.com/windowsserver2003/sbs/howtobuy/default.mspx
They use an asp.net script with the text to display encrypted as parameter to generate these headers: http://www.microsoft.com/library/toolbar/3.0/subbanner.aspx?t=TWljcm9zb2Z0IFdpbmRvd3MgU21hbGwgQnVzaW5lc3MgU2VydmVyIDIwMDM=&f=FFFFFF&b=757575&s=A7A7A7&r=False&font=Segoe,+13pt&v=0&c=HgjbLWiigY01WAeFBYwa4dzXjGY=
]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: amon&#45;re</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/#8</link>
      <guid>http://www.alistapart.com/comments/dynatext/#8</guid>         
	  
      <description><![CDATA[I believe this could be fixed by specifying an "alt" attribute, no? :)]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stewart Rosenberger</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/#9</link>
      <guid>http://www.alistapart.com/comments/dynatext/#9</guid>         
	  
      <description><![CDATA[To answer some questions posted here:

1) Yes, this method allows for different matte colors. The matte color (if transparency is chosen) will be the $background_color variable. No alpha channels are being used (because of IE's lack of support), but this script could be altered to do so, if you were inclined.

2) As mentioned above, screen readers should all read this text correctly, because the ALT tag is maintained throughout this process. To my knowledge, no screen reader will ignore an ALT tag, if it is present.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Ned Baldessin</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/#10</link>
      <guid>http://www.alistapart.com/comments/dynatext/#10</guid>         
	  
      <description><![CDATA[Safari (v1.2.2) doesn't store the replaced images in cache, so each time you reload the page you have to wait for the images to load. This doesn't occur in Moz (and I haven't tried yet in other browsers).

The HTTP headers sent by the PHP script are :
Date: Tue, 15 Jun 2004 14:17:51 GMT
Server: Apache
X-Powered-By: PHP/4.3.7
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: image/png

Maybe adding headers like "Expires", "Cache-Control" and "Pragma" will force Safari to store them ?

Cheers.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: waylman</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P10/#11</link>
      <guid>http://www.alistapart.com/comments/dynatext/#11</guid>         
	  
      <description><![CDATA[Very interesting solution. However, if I understand things right you have to edit a php file to change the color and a js file to change the font (or is it the php file for both?). Not exactley convienient. What happens when you want an alternate stylesheet with different colors and/or fonts? While this method may work great for some, I just don't see it working for everyone. Now, if there was a way to define the color, font, textsize, etc in the css and use that data to create the images I could see this as a more usefull solution.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: ceejayoz</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P10/#12</link>
      <guid>http://www.alistapart.com/comments/dynatext/#12</guid>         
	  
      <description><![CDATA[Replacing text with a link in it seems to lose the link... any workaround?

&lt;h1&gt;[url="#"]link[/url]&lt;/h1&gt;

becomes a nonclickable heading...]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: matt</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P10/#13</link>
      <guid>http://www.alistapart.com/comments/dynatext/#13</guid>         
	  
      <description><![CDATA[
Have you tried the &lt;h1&gt;'s on the outside of the &lt;a&gt;'s?]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Roel Van Gils</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P10/#14</link>
      <guid>http://www.alistapart.com/comments/dynatext/#14</guid>         
	  
      <description><![CDATA[Chris: it is true that modern browsers like Opera allow you to scale everything on a webpage, including the images. Hoewever, if you're visually impaired (like me), it's not nice to read titles that look like ugly pixelated bitmaps when they're enlarged.

If you would use vector titles (Flash or SVG), then the enlarged titles would still look crisp and be a lot easier on the eyes. Opera does a very good job on enlarging pages that consists of plain HTM text and Flash applets (don't know about SVG), but bitmaps will be bitmaps...

btw: enlarging an image is also possible in Firefox. The Mouse Gestures extension has a very intuitive and elegant way tot do that and I use it a lot when I need to read small bitmap print on webpages. To read the small vector fonts in Flash applets, I usually just use the 'Zoom in' function on the context menu of a Flash movie. 
]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stewart Rosenberger</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P10/#15</link>
      <guid>http://www.alistapart.com/comments/dynatext/#15</guid>         
	  
      <description><![CDATA[waylman: Both the font and the colors are stored in the PHP file, which generates the images. Although it would be nice to store this image in a CSS file, and dynamically apply it, it would require a lot more Javascript to do so, and the JS file here is already 8k in size. Either way, it's still better than specifying your font/colors in Photoshop.

ceejayoz: You can make linked-headings work by replacing the link tag, not the heading. If you replace the heading, the link will be wiped out.

]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: ceejayoz</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P10/#16</link>
      <guid>http://www.alistapart.com/comments/dynatext/#16</guid>         
	  
      <description><![CDATA[I'll try that, thanks! :-)

Wonderful script, btw.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Ryan Schroeder</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P10/#17</link>
      <guid>http://www.alistapart.com/comments/dynatext/#17</guid>         
	  
      <description><![CDATA[I was under the impression that PNGs aren't properly supported by certain browsers...

Is there a particular reason you don't use GIFs?]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Peter Zsodlos</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P10/#18</link>
      <guid>http://www.alistapart.com/comments/dynatext/#18</guid>         
	  
      <description><![CDATA[Haven't tested it yet, but this is how I would go about doing it:

Modify the image generating script to take its parameters from the $_GET array. In the php script specify some defaults, and update the appropriate properties supplied to the script.

In javascript create an additional function (get_font_style(selector)), which would determine the style information for the text which is to be replaced.

Then just sit back, and call
replaceSelector(selector,get_font_style(selector),true);]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Peter Zsoldos</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P10/#19</link>
      <guid>http://www.alistapart.com/comments/dynatext/#19</guid>         
	  
      <description><![CDATA[correctly spelled is: Peter Zsoldos. I think I just my rights to make fun out of all my non-HUngarian friends who can't spell it. ouch.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Hanan Cohen</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P20/#20</link>
      <guid>http://www.alistapart.com/comments/dynatext/#20</guid>         
	  
      <description><![CDATA[Create a PHP file with one command that will tell you everything about the environment.

&lt;?
info();
?&gt;
]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: phnk</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P20/#21</link>
      <guid>http://www.alistapart.com/comments/dynatext/#21</guid>         
	  
      <description><![CDATA[This article is very impressive. Font restriction is quite a frustration when you move from DTP to web design. This solution is just great, thanks a lot.

]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Rob Brackett</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P20/#22</link>
      <guid>http://www.alistapart.com/comments/dynatext/#22</guid>         
	  
      <description><![CDATA[This is definitely a neat technique, but it seems a bit processor and bandwidth intensive, especially for a large, content managed site (which seems to be where it's targeted).  Why not generate the images when the content is added?  While it would require modifying the CMS slightly, it might be a better overall solution.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: atmos</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P20/#23</link>
      <guid>http://www.alistapart.com/comments/dynatext/#23</guid>         
	  
      <description><![CDATA[I used a strikingly similar method for a while(pure php, no javascript), but eventually realized straight up text was ok for me. :)  I used http://mmcc.cx/php_imlib/ which has some interesting text manipulation routines text direction, bluring, layering etc.  At the time(a year or so ago) I hadn't yet embraced pure xhtml/css so I simply had a php function any of my pages could call.  get_path_for_text($str) It returned the img block with appropriate alt tags etc filled in.  
If you wanted something hackish but controlable via your css sheet you could take on a method like the following.  Setup a generic class that isn't being used elsewhere in your xhtml, and have your text generation script parse the color,size,font,etc from your css(using php of course)  This would still work with the caching mechanism, but you'd have to check to make sure your css file was older than your cached image, you can do this with stat(a php builtin function).  If your image was older than your css, you treat it as non-existent and generate(overwrite) a new one.  This wouldn't be hard functionality to add to the script posted with this article. ]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: atmos</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P20/#24</link>
      <guid>http://www.alistapart.com/comments/dynatext/#24</guid>         
	  
      <description><![CDATA[I got burned by trying to use  tags. :(]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Chris Barr</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P20/#25</link>
      <guid>http://www.alistapart.com/comments/dynatext/#25</guid>         
	  
      <description><![CDATA[I was wondering if dynamically creating images in this fashion will take up extra bandwidth or server resources. On a large site it would seem that a technique like this could cause extra work for the server and possibly slow down your page.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: atmos</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P20/#26</link>
      <guid>http://www.alistapart.com/comments/dynatext/#26</guid>         
	  
      <description><![CDATA[Yeah, images are gonna be larger than simply transmitting the text.  They're not gonna be huge though, and that's a trade off for getting a slightly more artistic presentation.  Note that they're not regenerated every time the page is loaded, when it generates the images the first time it keeps them on disk.  So the next time it realizes "Hey ! I've got one of those right here, no need to bother creating it."  It allows you to not have to go into photoshop/the gimp everytime you need a new image for your templatized text.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Ryan Masuga</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P20/#27</link>
      <guid>http://www.alistapart.com/comments/dynatext/#27</guid>         
	  
      <description><![CDATA[I think this technique is superb. The main problem I have with any text-replacement method is the fact that there is no line-wrap. I've come very close to getting the Flash Image Replacement to successfully wrap, but haven't quite got that to work. This looks like a great solution to some of the more difficult gif-based dynamic text solutions I have seen. I appreciate the PHP, but is there anyone out there skilled enough to make this work in ColdFusion?

Thanks for a great article.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Chris</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P20/#28</link>
      <guid>http://www.alistapart.com/comments/dynatext/#28</guid>         
	  
      <description><![CDATA[First of all, it is an alt ATTRIBUTE, please stop using the term alt TAG. Secondly, all windows based screen readers do use the IE engine, but read out the content on the screen, not generated content via DOM. It is easy to claim a lot about things not being accessible, another to simply check it in the real environment. 

]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stewart Rosenberger</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P20/#29</link>
      <guid>http://www.alistapart.com/comments/dynatext/#29</guid>         
	  
      <description><![CDATA[As others have pointed out, my code only generates each image once, and then stores it. Sending the image again has negligible overhead.

I wouldn't recommend DTR for a site that needed to replace more than a handful of headings per page. But on a page with even half a dozen headings, this method saves a lot of effort, and doesn't significantly add to page load time.

Ryan: Line wrapping is, in fact, supported by this technique. By setting a simple flag in the Javascript, you can have it generate a separate image for each word. As long as this images have  the same baseline (which this PHP script ensures), the words will line up and wrap correctly.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Iolaire McFadden</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P30/#30</link>
      <guid>http://www.alistapart.com/comments/dynatext/#30</guid>         
	  
      <description><![CDATA[I wile back I was playing around with this due to some samples on Marc Liyanage's Mac OS X PHP pages and found it very hard to find TrueType fonts that worked.

Here is a link to my solution using the X11 application PfaEdit to covert Mac OS X true type or type 1 fonts to a usable true type format for PHP:
http://iolaire.net/current_site/blog.php?m=200402#74
iolaire]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Su</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P30/#31</link>
      <guid>http://www.alistapart.com/comments/dynatext/#31</guid>         
	  
      <description><![CDATA[If I turn line-wrapping on in the JS file, I get a bunch word-images butting right up against each other. Is anybody else having this problem? It's happened with two completely unrelated(different foundry and designer) fonts so far.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: two brains</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P30/#32</link>
      <guid>http://www.alistapart.com/comments/dynatext/#32</guid>         
	  
      <description><![CDATA[:: is it not an Accessibility requirement that you must be able to resize text? 
:: with this method I don't see the possiblity of increasing the size of the dynamic images?

Use relative sizing of images
http://www.wats.ca/resources/relativesizing/20]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: David Grant</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P30/#33</link>
      <guid>http://www.alistapart.com/comments/dynatext/#33</guid>         
	  
      <description><![CDATA[Haven't read it yet!]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Chris</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P30/#34</link>
      <guid>http://www.alistapart.com/comments/dynatext/#34</guid>         
	  
      <description><![CDATA[Thanks for sharing.
]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Justin</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P30/#35</link>
      <guid>http://www.alistapart.com/comments/dynatext/#35</guid>         
	  
      <description><![CDATA[I've been thinking about this very idea for quite some time now, in ASP.NET of course. I've written several handy image manipulation/generation objects for my own personal use (auto thumbnail creation, importing images from my digital camera) and have had some ASP.NET code that was fairly well suited for this purpose sitting around, just begging me to apply it to this very subject.

As ALA always does, the fire under my butt has been lit and I've got a nice working script available:

http://software.enjoybeing.net/dev/gen_heading/generator.aspx?h_text=Look+At+This+Auto+Generated+Text!

The thing I am now struggling with is retrofitting the JS code from the article to work with my .NET page.

Something I don't understand is the usage of the testURL and test image. The JS seems to initially request a PNG image and appends a querystring value to it... this seems quite odd because what is an image going to do with a query string value?

I think the idea of generating header text OTF (on-the-fly) is the way to go, makes other image replacement techniques look stone-age. 

As not to fill up this discussion with technical talk about ASP.NET solutions to this idea, feel free to drop me a line via:
http://software.enjoybeing.net/contact/

Great article!]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stewart Rosenberger</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P30/#36</link>
      <guid>http://www.alistapart.com/comments/dynatext/#36</guid>         
	  
      <description><![CDATA[Justin: The testUrl.src has a query string appended to it as a precautionary measure. We append the current time (in milliseconds) to the URL string so that it never requests the same URL twice. This should prevent browsers from caching the test image.

Although caching the test image might sound like a good thing, this idea was put forth by Peter-Paul Koch to prevent browsers that cache the image from not firing the Image.onload function (since the image is already loaded). If the testImage.onload function does not fire, we can't be sure that the browser supports images at all, which is a key factor in this technique.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Javan</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P30/#37</link>
      <guid>http://www.alistapart.com/comments/dynatext/#37</guid>         
	  
      <description><![CDATA[Is there any way to apply this only to tags with a specific class like &#123;h2 class="font"&#125; ?

I would like to be able to use this to generate just one letter in a heading like &#123;h2&#125;&#123;span class="letter"&#125;H&#123;/span&#125;ello&#123;/h2&#125;, but it seems I can't do it without eating up the whole span tag.

Any ideas?]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Marty M.</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P30/#38</link>
      <guid>http://www.alistapart.com/comments/dynatext/#38</guid>         
	  
      <description><![CDATA[Can this technique be done straight up without converting to images?

As in can you load a font onto your server, and then have the font appear on your site, without it being converted to an image - and the other person still being able to see that font?

(I'm going to guess no, but if it's a possibility I'll be more than happy to hear that solution.)

]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Brendan Taylor</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P30/#39</link>
      <guid>http://www.alistapart.com/comments/dynatext/#39</guid>         
	  
      <description><![CDATA[As long as you're not using alpha transparencies, Internet Explorer (and every other modern browser) should support PNG just fine.

PNGs are preferable to GIFs in most cases; they allow a wider range of colours and compress better.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Justin</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P40/#40</link>
      <guid>http://www.alistapart.com/comments/dynatext/#40</guid>         
	  
      <description><![CDATA[Got that ASP.NET version completed, changed the image type to GIF and had to make the test image (test.gif). I just changed the URL's for the h1 and h2, changed the test image to a GIF, that's it.

I also had to modify my .NET code a little bit, changed the querystring parameter name. Therefore my previous example I posted no longer works. This is because I originally used "h_text" for the querystring key, now it uses the same key as the PHP equivilent, which is just "text".

Here's the final product:
http://software.enjoybeing.net/dev/gen_heading/

Since I apply an underline to the image text, it is obvious that the JS code sends a request for each individual word rather than the entire string of text enclosed in the H2 tag... isn't this a waste of resources (not to mention the underline effect is lost). Also, it would be problematic if the dynamic image performed more advanced techniques, such as gradients or predefined images before/after the string of text.

Let me know how it works, again, feedback here:
http://software.enjoybeing.net/contact/]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stewart Rosenberger</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P40/#41</link>
      <guid>http://www.alistapart.com/comments/dynatext/#41</guid>         
	  
      <description><![CDATA[Javan: By customizing the javascript code, you can change which selector is used to find replaceable images. So instead of writing "h2", you could tell it to replace "h2 span" which -- like the equivalent CSS selector -- would only target &lt;span&gt; tags that are inside &lt;h2&gt; tags.

marty: unfortunately, it's not possible to do this without images. Font embedding is supported by IE/Win, but it's not standards-compliant. Until a better solution is supported by different browsers, we're stuck with either images or Flash.
]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Marty M.</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P40/#42</link>
      <guid>http://www.alistapart.com/comments/dynatext/#42</guid>         
	  
      <description><![CDATA[For the prompt reply. 

I figured as much. Cool article, and we will attempt to use this technique in the near future.

M.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Justin</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P40/#43</link>
      <guid>http://www.alistapart.com/comments/dynatext/#43</guid>         
	  
      <description><![CDATA[Compare the above example with this one:
http://software.enjoybeing.net/dev/gen_heading/generator.aspx?text=this+is+just+some+random+text+that+is+really+long+and+should+show+a+single+underline

The underline carries through the entire string of text, as it should. I'm sure it's a quick modification to get the JS working as I had hoped. Just an FYI.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Joe Burke</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P40/#44</link>
      <guid>http://www.alistapart.com/comments/dynatext/#44</guid>         
	  
      <description><![CDATA[I can't be absolutely certain, but there is an ancient IE filter AlphaImageLoader which will work with Win IE to produce alpha transparencies.

ALA has an article by Michael Lovitt relating to the subject at http://www.alistapart.com/articles/pngopacity

Hopefully this will help.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Frank S.</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P40/#45</link>
      <guid>http://www.alistapart.com/comments/dynatext/#45</guid>         
	  
      <description><![CDATA[IE and FIrefox (pc) are not loading the images.

On Mac, Safari loads it fine but not firefox.  Help :)]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Rajeev</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P40/#46</link>
      <guid>http://www.alistapart.com/comments/dynatext/#46</guid>         
	  
      <description><![CDATA[Just in case anyone is trying to do this, there is a quick and easy way to turn of antialiasing of fonts, which is pretty much nessecary for bitmap fonts and obtaining the "pixely" effect. Just go to line 94 of the PHP script and insert a - (negative/minus sign) before $font_color. (For the people who aren't fluent in basic programming, that just negates the number, or the color index in this case.) For some reason, that's the only way to disable anti-aliasing when using the imagettftext() funtion.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Frank S.</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P40/#47</link>
      <guid>http://www.alistapart.com/comments/dynatext/#47</guid>         
	  
      <description><![CDATA[Nevermind...  I forgot to add the test.png.  On a related note, Safari seems to be able to work w/ out it.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: brian</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P40/#48</link>
      <guid>http://www.alistapart.com/comments/dynatext/#48</guid>         
	  
      <description><![CDATA[If you want to resize the font you can simply send that as another parameter in the image tag. So 
heading.php?text=URLs Are Fun
becomes
heading.php?text=URLs Are Fun&font_size=72

then some minor edits in the PHP file and you can dynamically resize, re-colour, and re-font, all your headline images at once!]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Thomas</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P40/#49</link>
      <guid>http://www.alistapart.com/comments/dynatext/#49</guid>         
	  
      <description><![CDATA[The downside of »display:none« for the print text in a browser that doesn't load images *and* stylesheets: Doubled text.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stewart Rosenberger</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P50/#50</link>
      <guid>http://www.alistapart.com/comments/dynatext/#50</guid>         
	  
      <description><![CDATA[The only browsers that support images and javascript but not CSS are older browsers, and this script uses object-detection to ignore them. So Navigator 4.0, for example, will not apply this technique.

It's conceivable that someone could manually disable CSS in a modern browser, but why would anyone do that? And if they did, why would they leave regular images enabled? 

I don't believe this is a serious concern.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: tom lyczko</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P50/#51</link>
      <guid>http://www.alistapart.com/comments/dynatext/#51</guid>         
	  
      <description><![CDATA[i am not a javascript guru, etc., but here is an idea:

extend the php/GD/etc. script to create multiple images with different appearances, give them names that can be referenced within javascripts or css code that perform rollover and style-switching in the manner described in several other ALA articles??

i imagine this would require standardizing the image filenames created by the php/GD/etc. script so the javascript knows what to do...

seems also possible that the php code could also dynamically create the actual javascript code or know which javascript filename to write into the code...

this would make a good part 2 / part 3 follow-up to this excellent article.

thank you for reading this...

:) tom]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Russell</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P50/#52</link>
      <guid>http://www.alistapart.com/comments/dynatext/#52</guid>         
	  
      <description><![CDATA[Wow! This quite the trick.

Im excited (mabet a little to excited!) by how much impact this will add to my sites using content management systems and how easily it will be to plug-in.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stewart Rosenberger</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P50/#53</link>
      <guid>http://www.alistapart.com/comments/dynatext/#53</guid>         
	  
      <description><![CDATA[I was not aware when I wrote this article, but Shaun Inman (http://www.shauninman.com) developed an similar technique in April of this year. His technique uses Flash exclusively, rather than PHP images, but the principle is virtually identical. 

While I believe that both of our methods have benefits over one another, Shaun very clearly came up with this idea first. Had I done better research beforehand, I would have either credited Shaun with the development or decided against writing the article entirely.

Anyone who's interested should check out Shaun's fantastic replacement technique at http://www.shauninman.com/mentary/past/ifr_revisited_and_revised.php]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Ian Anderson</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P50/#54</link>
      <guid>http://www.alistapart.com/comments/dynatext/#54</guid>         
	  
      <description><![CDATA[I just wanted to add my $0.02 about accessibility issues with this technique.
1. "if images are requested then the user can use them". This is false. Most people with visual impairments or blindness surf with IE win and images on. You can't tell whether the user will be able to see the images in any way from the server end. Very few special needs users use text-only browsers.
2. Images cannot be recoloured on the fly or resized unless the user has special software such as the screen magnifier SuperNova and knows how to use it. There are many serious accessibility issues caused by these limitations. These issues can be minimised by ensuring that there is high contrast between the foreground and background colours, that a sans-serif font is used, that the text size used is large enough to compare with IE's large setting for body copy, that the design does not use commonly confusable colours such as red on black, red on brown etc etc, that the images are not placed over a background image.
3. The bottom line is that yes, you are compromising accessibility using any of the image replacement techniques; In real world web design we need techniques like these, but the question is whether you apply some common sense to minimise the additional problems you are causing.
]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Chris Hester</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P50/#55</link>
      <guid>http://www.alistapart.com/comments/dynatext/#55</guid>         
	  
      <description><![CDATA[No-one has yet pointed out the issue of copyright. I assume it would be illegal to upload your favourite fonts to the server. Can freeware fonts be copied in this way? Or does it not matter since the fonts are turned into images? (I can see the law defining uploading the font as "copying" it, and even distributing it as the server contents are mirrored, that's all.)]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Ansgar</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P50/#56</link>
      <guid>http://www.alistapart.com/comments/dynatext/#56</guid>         
	  
      <description><![CDATA[I have been playing around with this script (i.e. these scripts) for a while. Great idea. And some great hints in this discussion either. However, I was wondering about special characters that you might need in foreign languages. 

Is there any way to have a &ouml; character? It is said that this should cause no trouble to the script, but in fact it does not work.

Any ideas?
Ansgar]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: apartness</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P50/#57</link>
      <guid>http://www.alistapart.com/comments/dynatext/#57</guid>         
	  
      <description><![CDATA[Shaun shared his IFR technique with us as a potential ALA article before publishing it on his site after we decided to pass on it. 

We thought Shaun's technique was marvelous and innovative, but we had some problems with it, and declined it.

With the present article, no such problems presented themselves, so we approved and published Dynamic Text Replacement.

The two techniques are different and were evolved independently. Both have their strong pluses. For us, the accessibility benefits of DTR made this article an easy buy.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: apartness</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P50/#58</link>
      <guid>http://www.alistapart.com/comments/dynatext/#58</guid>         
	  
      <description><![CDATA[&gt;&gt;No-one has yet pointed out the issue of copyright. I assume it would be illegal to upload your favourite fonts to the server.

I'm no expert on intellectual copyright law, but I don't see why you make that assumption. 

This method does not embed copyrighted fonts on the page. This method simply creates GIF images of text. It's no different than opening Photoshop and manually creating type GIF images, except that the process is automated.

Is your concern that someone might hack their way into the system and download the font without paying for it? If that is your concern, I must say it seems unlikely to me that a dedicated hacker would expend energy trying to steal a font from myclient.com. For one thing, said hacker would have to KNOW that the type GIFs on the page are being dynamically generated via a font stored on the server. And how would he or she know that? 

Besides, why rob a lemonade stand when you can rob a bank? It seems to me that any dedicated hacker determined to download fonts without paying for them would spend his or her time trying to attack Adobe.com or Veer.com — not my clients' sites.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Rich</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P50/#59</link>
      <guid>http://www.alistapart.com/comments/dynatext/#59</guid>         
	  
      <description><![CDATA[You normally pay for the use of a typeface on a X x CPU licence basis. 

In effect you pay to use on an agreed number of computers (normally 1x, unless its a bulk licenses) - uploading it to a server (as you need to do in this example) is an additional CPU.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Josh</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P60/#60</link>
      <guid>http://www.alistapart.com/comments/dynatext/#60</guid>         
	  
      <description><![CDATA[WOW. Using PHP to dynamically create an image (or 3-4 or however many) on every page hit CERTAINLY won't be a resource drain on a server... right? Doh! Even with image caching this still seems unreasonably wasteful.

Shouldn't we be designing in a more typeface independent manner in the first place?]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stewart Rosenberger</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P60/#61</link>
      <guid>http://www.alistapart.com/comments/dynatext/#61</guid>         
	  
      <description><![CDATA[Sending cached images to a browser incurs almost no overhead. The processor requirements for loading a PHP file and checking whether the file exists is virtually nothing. Compared to something like database access, sending a static file is practically a day off for the server.

There is something to be said for designing in a "typeface independent" manner. Let's be pragmatic, though: current web design only provides maybe seven universally accessible fonts to choose from: That's not a lot of choice, and this method is simply another option for designers who have tighter requirements.

Having just visited your website, I can see that you're not in total disagreement: Well over half of the words on your home page are represented as images.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Josh</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P60/#62</link>
      <guid>http://www.alistapart.com/comments/dynatext/#62</guid>         
	  
      <description><![CDATA[Argh! I salute you, that was a masterful retort.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stuart Robertson</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P60/#63</link>
      <guid>http://www.alistapart.com/comments/dynatext/#63</guid>         
	  
      <description><![CDATA[This is a really great article, and something that I'll find very helpful on my next project.

I also had trouble with no spaces appearing between the words.  I added this line to function javascript_to_html($text)

$text = $text.' ';  

which seemed to do the trick... although I'm guessing there's probably an easier / cleaner way to fix the problem.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Sean Burke</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P60/#64</link>
      <guid>http://www.alistapart.com/comments/dynatext/#64</guid>         
	  
      <description><![CDATA[Cool article, but... 

Ever since I viewed the demo, my fonts have been screwed up.  If I view some emails in Outlook or view some websites, the font that was used will show up.  It's quite annoying.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: rADo</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P60/#65</link>
      <guid>http://www.alistapart.com/comments/dynatext/#65</guid>         
	  
      <description><![CDATA[This is a great example of a technique, which is a plus for sales, for getting bigger profit from your CMS. This technique will please customers. It will generate more cash.

I love it :)]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: apartness</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P60/#66</link>
      <guid>http://www.alistapart.com/comments/dynatext/#66</guid>         
	  
      <description><![CDATA[&gt;You normally pay for the use of a typeface on a X x CPU licence basis. In effect you pay to use on an agreed number of computers (normally 1x, unless its a bulk licenses) - uploading it to a server (as you need to do in this example) is an additional CPU.

Aha. Now I'm with you. Yup, you might have to pay a licensing fee for storing an additional copy of a font on a server, depending on the font house and its licensing fee structures.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Andrew Dunning</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P60/#67</link>
      <guid>http://www.alistapart.com/comments/dynatext/#67</guid>         
	  
      <description><![CDATA[Another legal issue I'd be concerned with is people downloading the font — either someone with FTP access or someone who just figured out the URL. I'm probably just being paranoid, but I can see it happening.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stuart</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P60/#68</link>
      <guid>http://www.alistapart.com/comments/dynatext/#68</guid>         
	  
      <description><![CDATA[If you were concerned about someone downloading the font by figuring out the URL, couldn't you just rename the font file X3CR3L.TFF or something similar?]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Christopher</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P60/#69</link>
      <guid>http://www.alistapart.com/comments/dynatext/#69</guid>         
	  
      <description><![CDATA[Some sanity checking should probably be added to limit the total number of cached images as this could be used as a DoS on the servers' available disk space.

Otherwise, someone could just run through the dictionary and start creating boatloads of images of worss.

Just a thought.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Mathieu Pigeon</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P70/#70</link>
      <guid>http://www.alistapart.com/comments/dynatext/#70</guid>         
	  
      <description><![CDATA[&gt;Shouldn't we be designing in a more typeface independent manner in the first place?

If by “designing” you imply “communicating in a visual medium”, I’d have to say no. Designing without typography is akin to writing without verbs. You may get understood, but it’s crude, as is the typographically poor web of today. Good typography is the result a few thousand years of development; it should not be dismissed because current technology isn’t (yet) able to fully exploit it.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Matthew Sweet</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P70/#71</link>
      <guid>http://www.alistapart.com/comments/dynatext/#71</guid>         
	  
      <description><![CDATA[Does this system re-renerate the images every time the page is loaded, or once a session, or are the images saved to a temp dir or to the websites webspace.

The reason I ask is because image generation can be a pretty taxing thing for an application server, particularly for highly traffiked websites.

Any thoughts?]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Keith Harper</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P70/#72</link>
      <guid>http://www.alistapart.com/comments/dynatext/#72</guid>         
	  
      <description><![CDATA[OK, I do everything with standards now, but I am coding a freelance 300page website that needs to work all the way back to the dreaded Netscape 4.77 and IE 5.0, for education. We figure for an education site, schools could very well be using old browsers + computers.

So my question, does this PHP script work with legacy browsers like N4.77? if it does, awesome! I really don't want to wind up producing hundreds of image headers]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Sandy McArthur</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P70/#73</link>
      <guid>http://www.alistapart.com/comments/dynatext/#73</guid>         
	  
      <description><![CDATA[I found adding:

image.border = 0;

to replacement.js at line 96 to be helpful.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Cameron</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P70/#74</link>
      <guid>http://www.alistapart.com/comments/dynatext/#74</guid>         
	  
      <description><![CDATA[Great article, just one question though, when comparing the dynamic headings with those I created in Photoshop, the dynamic ones are far inferior in quality - to the extent I couldn't bring myself to switch over.

I'm using the same font size, background & foreground colour, etc, and have played around with the settings in the scripts but to no avail. As an example, here's one of my PS headers - [img]http://pacepro.cameronyule.com/images/welcome.gif[/img] and here's a dynamic one http://pacepro.cameronyule.com/heading.php?text=Welcome to Pace

Any ideas? Or is it back to manual graphics for me :mad:]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Juan Tamad</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P70/#75</link>
      <guid>http://www.alistapart.com/comments/dynatext/#75</guid>         
	  
      <description><![CDATA[Pardon me but I'm not much of a PHP coder. I've been trying to implement dynamic text replacement but somehow the text graphics are not showing up on my page.

I know my webserver has PHP version 4.3.5 with gd enabled. I have my font and files in the right places. The php code is being executed without any error messages but no images appear, I get the icon for broken image links instead. What am I doing wrong, or are there server-side issues I have to troubleshoot first? Thanks.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Erik Foppen</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P70/#76</link>
      <guid>http://www.alistapart.com/comments/dynatext/#76</guid>         
	  
      <description><![CDATA[Has anyone had problems with IE caching images sizes with this technique?

When I change fonts or sizes, IE still uses the image sizes of previous fonts, so the text look really ugly.

Mozilla and Opera (obviously) don't have this problem.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Erik Foppen</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P70/#77</link>
      <guid>http://www.alistapart.com/comments/dynatext/#77</guid>         
	  
      <description><![CDATA[by adding a boolean called clearcache in de javascript file, and by adding this to line 90 of that file:

[div class="codeblock"]<code><span style="color: #000000">
<span style="color: #007700">if(</span><span style="color: #0000BB">clearcache</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">url&nbsp;</span><span style="color: #007700">+=&nbsp;</span><span style="color: #DD0000">"?date="&nbsp;</span><span style="color: #007700">+&nbsp;(new&nbsp;</span><span style="color: #0000BB">Date</span><span style="color: #007700">()).</span><span style="color: #0000BB">getTime</span><span style="color: #007700">();&nbsp;</span>
</span>
</code>[/div]

you force IE to clear its image size cache.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stewart Rosenberger</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P70/#78</link>
      <guid>http://www.alistapart.com/comments/dynatext/#78</guid>         
	  
      <description><![CDATA[I noticed that IE bug as well. Your fix works, but by addding a unique string to the end of the image's URL, you're preventing *any* caching, which may not be ideal. 

I've found it better to slightly change the URL of my PHP file whenever I alter the font-settings. That way, my visitors can cache the images without worrying about this stupid IE bug making the headings pixilated.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Dan Williams</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P70/#79</link>
      <guid>http://www.alistapart.com/comments/dynatext/#79</guid>         
	  
      <description><![CDATA[The php itself could cache the images so that they are only generated once per heading change, otherwise the php redirects to the cached image saving server load of GDI.  Not a huge deal on low traffic websites but every processor cycle helps on larger ones.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Dan Williams</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P80/#80</link>
      <guid>http://www.alistapart.com/comments/dynatext/#80</guid>         
	  
      <description><![CDATA[Didn't get enough sleep!]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Joe</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P80/#81</link>
      <guid>http://www.alistapart.com/comments/dynatext/#81</guid>         
	  
      <description><![CDATA[if you have a CRLF and/or TAB after the opening tag, but before the characters, Mozilla will pass PHP the escaped CRLF and TAB characters to render in the images.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Len Hardy</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P80/#82</link>
      <guid>http://www.alistapart.com/comments/dynatext/#82</guid>         
	  
      <description><![CDATA[I'm having a problem with one TT font file in particular.  I have no problems with any other font that I try.  For this problem font, the image shows up as a series of "boxes" instead of the text.  The font looks fine in any other vehicle that I use to view it.  

Of course, this problem font is the font that I really want to use :-)

Anybody have any ideas?]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Seb Frost</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P80/#83</link>
      <guid>http://www.alistapart.com/comments/dynatext/#83</guid>         
	  
      <description><![CDATA[A very very good point!  On a static site you could get around this by generating (by whatever method) a list of all the words in the headings on the site whenever a new revision is uploaded and only letting the php script return those, but on a dynamic site you may find that your headings are dynamic (is the case for me) so that's not a viable option...]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Seb Frost</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P80/#84</link>
      <guid>http://www.alistapart.com/comments/dynatext/#84</guid>         
	  
      <description><![CDATA[PHP is a server-side language, that means it's operation is completely unaffected by the browsing medium.  This is as opposed to Javascript which is a client=side language.

With Netscape 4.7 you may have troubles running the JS file, though I'm sure someone here could make it work - but that person isn't me, I shamelessly turn a blind eye to anything prior to Netscape 7 ;)]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Mark James</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P80/#85</link>
      <guid>http://www.alistapart.com/comments/dynatext/#85</guid>         
	  
      <description><![CDATA[As mentioned in the article, it is possible to use this technique to replace tags with dynamic Flash movie.

A simple test page exists with downlaods available for additional/altered files at http://www.famfamfam.com/flash/dtr

These do not have the overhead of running PHP scripts to create image content, although they do have problems as you can most likely see; Flashes of unstyled/unsized content, and differing appearance on various browsers are among the current bugs. Most, if not all of the bugs with this are fixable for anyone who has the time. I hope someone is interested enough to finish off this alternative method for a great technique.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Bruno Torres</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P80/#86</link>
      <guid>http://www.alistapart.com/comments/dynatext/#86</guid>         
	  
      <description><![CDATA[Isn't there any possibility to use this script in a server that has only php 4.1?
I asked the admin, and he said he can't upgrade php. I could change the server, but this is from a friend and is free to me.
Is there any modification i can do to make this technique works in php4.1?
the gd is installed in the server.
The technique is great, i'd like to use it.
Thanks.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Brian LePore</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P80/#87</link>
      <guid>http://www.alistapart.com/comments/dynatext/#87</guid>         
	  
      <description><![CDATA[In IE for Windows, if you go to Internet Options -&gt; Security -&gt; Internet and set it to High, then this does not get run at all. If it's set to Medium it runs, but not on High.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stewart Rosenberger</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P80/#88</link>
      <guid>http://www.alistapart.com/comments/dynatext/#88</guid>         
	  
      <description><![CDATA[Bruno: PHP 4.1 did not come with the GD library support by default, but if it is installed on the server, and the module is included in PHP, then this technique will work fine.

Brian: IE with "high security" disables all ActiveScripting support, which includes Javascript. So, naturally, that would disable this technique entirely. However, if the Javascript does not execute, the standard headers will still remain, and they can still be styled using standard CSS techniques as a fallback.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Perry Johnson</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P80/#89</link>
      <guid>http://www.alistapart.com/comments/dynatext/#89</guid>         
	  
      <description><![CDATA[I've implemented a similar technique on a new site, but the prospect of a little unobtrusive automation intrigued me.  The problem is that I have several headings that need replacement, all with different styles and colors.  My solution moves most of the configuration into the page calling the scripts.  

The javascript in the main document is like this:
[removed]
function imageHeader(selector,phpfile,wordwrap)&#123;
 this.selector = selector;
 this.phpfile = phpfile;
 this.wordwrap = wordwrap;
  
&#125;
var imageHeaders = [
 new imageHeader("h5","heading.php?font_size=14&font_color=00ABE4&background_color=FFFFFF",true),
 new imageHeader("h2","heading.php?font_size=22&font_color=FFFFFF&background_color=CCC592",true)
]
[removed]

In replacement.js , I've replaced this code
replaceSelector("h2","heading.php",true);

with this code

for (var i = 0; i &lt; imageHeaders.length; i++) &#123;
replaceSelector(imageHeaders[i].selector,imageHeaders[i].phpfile,imageHeaders[i].wordwrap);
&#125;

Also in replacement.js , replace this code:
 var url = items[i].url + "?text="+escape(tokens[k]+' ')+"&selector;="+escape(items[i].selector);
    
with this code:
 var url = items[i].url + "&text;="+escape(tokens[k]+' ')+"&selector;="+escape(items[i].selector);
    
Finally, in heading.php , set up the PHP script to accept those variables from the query string

if($_GET['font_size'])&#123; $font_size = $_GET['font_size']; &#125;
if($_GET['font_size'])&#123; $background_color = $_GET['background_color']; &#125;
if($_GET['font_size'])&#123; $font_color = $_GET['font_color']; &#125;

It would be so nice if the javascript could parse the CSS color: , background-color:, white-space: and font-size: properties to populate that query string for the PHP script.  This way, we'd only have to include the javascript in the head and ALL the styles would remain in the stylesheet where they belong.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Bruno Torres</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P90/#90</link>
      <guid>http://www.alistapart.com/comments/dynatext/#90</guid>         
	  
      <description><![CDATA[Ok, but the server where i host my site has PHP 4.1 with GD support and it doesn't work there. I get lots of "The server could not create this heading image" errors.
Is there anything i can do to solve this?
Besides having GD support, my php must have any other functionality? May it be necessary any modification in the script?
I hope so...
Thank you..]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Michael Carvin</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P90/#91</link>
      <guid>http://www.alistapart.com/comments/dynatext/#91</guid>         
	  
      <description><![CDATA[Likewise, in heading.php you could add this at line 25, just below $cache_folder...

$selector = $_GET['selector'] ;

if($selector == "h2") &#123;
 $font_file  = 'supercoolfont.ttf' ;
 $font_size  = 12 ;
 $font_color = '#ff6600' ;
 $background_color = '#ffffff' ;
 $transparent_background  = true ;
 $cache_images = false ;
 $cache_folder = '/whatever' ;
&#125;

I'm publishing this site over the weekend (save for a few Flash bugs), and found it works quite easily. I don't feel comfortable in Javascript yet, but a simple if() statement in PHP doesn't frighten me off.

Still have to thank Perry for a kick in the right direction though.
]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Andrew Booth</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P90/#92</link>
      <guid>http://www.alistapart.com/comments/dynatext/#92</guid>         
	  
      <description><![CDATA[(Perhaps suggested before, but...) Why not use a class as the replacement selector, gets round the linking issue? Even cleverer would be to use a CSS parser as with the whatever:hover fix for IE to read the font info from the stylesheet rather than hard coded in the PHP (or do this parsing on the server).

In fact having a more generic javascript CSS parser alongside getElementBySelector would be a great toolkit for CSS techniques.

&lt;h1&gt;&lt;a class="replace"&gt;Title&lt;/a&gt;&lt;/h1&gt;
&lt;h2 class="replace"&gt;Text&lt;/h2&gt;

&lt;style&gt;

h1.replace, h1 a.replace &#123;
 font-size: 16px;
 font-family: font1, serif;  
&#125;

h2.replace, h2 a.replace &#123;
 font-size: 12px;
 font-family: font2, serif;
&#125;

&lt;/style&gt;

But ideally I'd do the replacement when the content is created and embed the names of the cached images in element id's.

&lt;h1&gt;&lt;a id="cache_1" class="replace"&gt;Title&lt;/a&gt;&lt;/h1&gt;
&lt;h2 id="cache_2" class="replace"&gt;Text&lt;/h2&gt;]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: LazyJim</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P90/#93</link>
      <guid>http://www.alistapart.com/comments/dynatext/#93</guid>         
	  
      <description><![CDATA[has anyone thought how many images you will be adding to the download time of your pages?

A new image must be downloaded EVERY time the same words come up because it's dynamically created.

Why not just have images for every letter of the alphabet and replace each letter on your page with a single-character image? Users then only need download about 30 images per font size (including CAPS), and then each letter would be retrieved from the cache!
(Not recommended for body text - but then again images aren't recommended for ANY text!)]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stewart Rosenberger</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P90/#94</link>
      <guid>http://www.alistapart.com/comments/dynatext/#94</guid>         
	  
      <description><![CDATA[For normal use, each of these headings will be between 1k and 3k. Placing even three or four of these on a site is not a large addition to the download time of a site. Many things in web development are a trade-off. 

Using individual characters would not work, because 1) the kerning of characters would be destroyed and 2) the ALT attributes of each image would be rendered entirely useless, making this technique unaccessible.

I don't think *anyone* is recommending this technique for body text. It's simply one more option for headings.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: LazyJim</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P90/#95</link>
      <guid>http://www.alistapart.com/comments/dynatext/#95</guid>         
	  
      <description><![CDATA["I don't think *anyone* is recommending this technique for body text."

Ah good!

oh yes the alt text would become meaningless!

As a header-image-generator this is an excellent tool!

But to me it just feels wrong some how :/]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Nevel</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P90/#96</link>
      <guid>http://www.alistapart.com/comments/dynatext/#96</guid>         
	  
      <description><![CDATA[First of all, I love the idea and the creativity behind it.

Quote from a previous post:

"Now, if there was a way to define the color, font, textsize, etc in the css and use that data to create the images I could see this as a more usefull solution."

First of all, I think it's a choice, whether or not to use CSS. When using replacing images, you obviously don't think CSS is good enough to serve your needs.

And if you do want to control your images trhough CSS, it might not require that much JS, I guess. Just from the top of my head(haven't had the time to test this yet):

var newEl = document.createElement('span');
newEl.className = 'imgStyle';
var color = newEl.style.color;

Or am I being silly here?]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Dave</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P90/#97</link>
      <guid>http://www.alistapart.com/comments/dynatext/#97</guid>         
	  
      <description><![CDATA[I'm hoping I don't get flamed w/ a bunch of RTFMs here but here goes...

I have downloaded the replacement.js, layout.css and the .php file provided in the article, but how do I implement it? 

Obviously the .js and .css gets included in the head but what do I do with the .php file? Include is just like a js file with the script src tag?

I have php 4.3.6 installed and running, but I am a CF programmer and know pretty much NOTHING about php. Can I include the php file with cfinclude?

Also...how do I know if I have the GD graphics library? And if I don't have it, where do I get it?

Please forgive my "newbieness".

]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Dave</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P90/#98</link>
      <guid>http://www.alistapart.com/comments/dynatext/#98</guid>         
	  
      <description><![CDATA[Allow me to thwart the RTFMs before they begin. 

It works! It took some work to get the php_gd2.dll as it is not installed by default like its said to be.

But it's working great. Thanks Stewart for the great article and ALA for providing such great info!]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: iG.STUDiO</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P90/#99</link>
      <guid>http://www.alistapart.com/comments/dynatext/#99</guid>         
	  
      <description><![CDATA[It's so amazing to observe the evolution of the idea in a creative environment. This is why I love ALA discussions.
There is, I believe, an infinite number of ways for driving a nail into a board - starting from a hammer and working your way up to a microscope - and most of them get the work done. What to use - is entirely up to us.
This article introduce yet another way - great. Even better, it works! Anyone wants to port it to .NET or any other platform - go right ahead, and don't forget to share.
Waste of bandwidth? Hard to fathom without testing under real load; I would say, it might cause some issues in some cases, but this is not the point. The point is - the more ways of skinning the cat we discuss, the larger the world population of the skinned felines will grow.
Ewe.
I meant it in a positive way, actually. Hmm.
Anyway, great work, great concept, and great discussion.
Keep it up.

Sidetrack:
[LazyJim] ...Why not just have images for every letter of the alphabet and replace each letter on your page with a single-character image?...
This is yet another way. And, you don't even need  PHP or any other server-side technology to implement it, you can get away with simple [removed] take a string of text, split it between characters, loop through the resulting array and write to the page whatever structure you wish to insert "YourArray[i].gif" image for each letter. Assuming that you have all the images pre-made and uploaded to the server.
Here is the sample:
http://javascript.internet.com/messages/print-line.html
I wasn't entirely happy with this solution, because each line of text would require numerous server trips on the first load (not only that, there was an issue with illegal characters in a file name, like " .gif", "?.gif", "..gif", etc.), so later I revised the script, using single image as a shifting background for the series of floating DIV's and a set of CSS rules to position the background:
http://www.gerasimenko.com
The next iteration of the script does, in fact, dynamically replace the H1, H2, etc. tags it finds on page onload. I was going to submit a tutorial on this matter to ALA for a while, and finally did earlier this week, inspired by the article we are discussing now (I wonder if this post will be considered a "previous publication" and ALA will dismiss my submission because of that).
Yet another way.

[Stewart] ...Using individual characters would not work, because 1) the kerning of characters would be destroyed and 2) the ALT attributes of each image would be rendered entirely useless, making this technique inaccessible...
The kerning will be affected, yes, but not destroyed, it's just a matter of dynamic positioning of each letter. Kerning in Photoshop is not bulletproof either, and highly typeface-dependable. The ALT attributes will make sense no more, true, but there is also TITLE you may be able to apply to the parent node element to make it up.

[Nevel] ...When using replacing images, you obviously don't think CSS is good enough to serve your needs...
True. It isn't. At least not yet. This is why Stewart developed this technique in a first place.
]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Dave</title>
	  
	      <link>http://www.alistapart.com/comments/dynatext/P100/#100</link>
      <guid>http://www.alistapart.com/comments/dynatext/#100</guid>         
	  
      <description><![CDATA[I set the font_size parameter to 14 (rather than the default 50), but the resulting images are still the same size and the type is all fuzzy. Is there another parameter I need to set somewhere?]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>


    </channel>
</rss>
