JavaScript Editor Ajax software     Free javascripts 



Main Page

2.
In
php.ini
, remove the leading semicolon in the front of the following line. The semicolon
comments the line; if there is no semicolon, then GD2 is already enabled on your system.
extension=php_gd2.dll
3.
Restart the Apache web server for the new configuration to take effect.
4.
Create a folder named
dynatext
in your
seophp
folder.
5.
Copy the font files you want to use for headers to your
dynatext
folder. On a Windows machine,
you can find the font files in the hidden
\Windows\Fonts
folder, or via the Fonts applet that you
can find in Control Panel. For the purposes of this exercise, copy
trebuc.ttf
to the
dynatext
folder.
For legal reasons, we’re not including any font files in the code download of this book. If you use the
code download, you’ll still need to copy a font file to your
dynatext
folder before this exercise will
work properly.
6.
Download
http://www.alistapart.com/d/dynatext/heading.php.txt
and save it as
heading.php
in your
dynatext
folder.
7.
Modify
heading.php
by setting
$font_file
to the font file name that you copied earlier to
the
dynatext
folder, and change
$font_size
to 23:
<?php
/*
Dynamic Heading Generator
By Stewart Rosenberger
http://www.stewartspeak.com/headings/
This script generates PNG images of text, written in
the font/size that you specify. These PNG images are passed
back to the browser. Optionally, they can be cached for later use.
If a cached image is found, a new image will not be generated,
and the existing copy will be sent to the browser.
Additional documentation on PHP’s image handling capabilities can
be found at http://www.php.net/image/
*/
$font_file = ‘trebuc.ttf’ ;
$font_size = 23 ;
$font_color = ‘#000000’ ;
$background_color = ‘#ffffff’ ;
$transparent_background = true ;
$cache_images = true ;
$cache_folder = ‘cache’ ;
8.
Download
http://www.alistapart.com/d/dynatext/replacement.js
and save the file to
your
dynatext
folder.
9.
Modify the
replaceSelector
function call at the beginning of
replacement.js
by changing
h2
to
h1
, and changing the value of
hideFlickerTimeout
to a small value, such as
100
. Also,
138
Chapter 6: SE-Friendly HTML and JavaScript
c06.qxd:c06 10:55 138


JavaScript Editor Ajax software     Free javascripts