Discuss: Dynamic Text Replacement
by Stewart Rosenberger
- Editorial Comments
12 links in replacement?
Replacing text with a link in it seems to lose the link… any workaround?
<h1>[url=”#”]link[/url]</h1>
becomes a nonclickable heading…
posted at 08:51 am on June 15, 2004 by ceejayoz
13 re: links
Have you tried the <h1>‘s on the outside of the <a>‘s?
posted at 08:59 am on June 15, 2004 by matt
14 Enlarging bitmap titles
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.
posted at 08:59 am on June 15, 2004 by Roel Van Gils
15 addressing some concerns
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.
posted at 09:04 am on June 15, 2004 by Stewart Rosenberger
16 thanks!
I’ll try that, thanks! :-)
Wonderful script, btw.
posted at 09:09 am on June 15, 2004 by ceejayoz
17 A question about PNGs
I was under the impression that PNGs aren’t properly supported by certain browsers…
Is there a particular reason you don’t use GIFs?
posted at 09:15 am on June 15, 2004 by Ryan Schroeder
18 font style from CSS
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);
posted at 09:25 am on June 15, 2004 by Peter Zsodlos
19 mispelled my name, can't believe it
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.
posted at 09:27 am on June 15, 2004 by Peter Zsoldos
20 No need to ask the host
Create a PHP file with one command that will tell you everything about the environment.
<?
info();
?>
posted at 09:35 am on June 15, 2004 by Hanan Cohen
Discussion Closed
New comments are not being accepted, but you are welcome to explore what people said before we closed the door.
Got something to say?
Discuss this article. We reserve the right to delete flames, trolls, and wood nymphs.
Create a new account or sign in below if you’d like to leave a comment.
Subscribe to this article's comments: RSS (what’s this?)






11 style not defined in style sheet
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.
posted at 08:51 am on June 15, 2004 by waylman