This plugin will replace the encapsulated text within the tag with a graphical representation of those words using any true type font you save to your website. It will save the image it creates for future use in the folder defined in the plugins’ configuration section to reduce server load and faster page loads once the image has been created. The image background can be a solid color or transparent using alpha blends for perfect edges. All <img> tags are created with the original text as the alt text.
See it in action @ damagedovertime.com I used this plugin to generate the menu links, the entry headings, the pagination links, and a few odds and ends here and there
Plugin Usage:
Wrap anything you want to be processed between the tag pairs.
{exp:gd2_font font_id="somefont.ttf" font_size="18" font_color="000000" bg_color="FFFFFF" transparency="100"} sometext {/exp:gd2_font}
Parameters:
font_id: This is the name of the font you wish to use. This font must be in you “fonts” folder as defined in the plugins configuration.
font_size: Sets the size of the font to use in pixels
font_color: Sets the color of the font. Use hex values here
bg_color Sets the background color of the image created. Use hex color codes here as well.
transparency: Sets the background of the image transparency. Ranges from “100” for full transparency to “0” for fully opaque.
Plugin Tips:
1) Your server MUST have the GD2 library with PNG support installed and enabled for this plugin to function.
2) The default directories can be changed by changing the lines:
var $url = “http://somesite.com”; // enter your sites url here
var $doc_root = “/var/www”; // your sites document root folder
var $font_folder="/fonts"; // your fonts folder relative to doc_root
var $img_folder="/images/gd"; // your image folder relative to doc_root
to the appropriate values in the pi.gd2_font.php file.
3) The images folder should be chmoded 777 for the plugin to be able to save images there. If its not the plugin will fail.
4) Text to be processed should be PLAIN-TEXT but GD2_font will do it’s best to preserve any markup it encapluates. When wrapping other pluggins or EE tags, ‘parse=”inward”’ may be required in the {exp:gd2_font} tag.
5) As it is, this plugin will work fine inside templates, but can be used inside entries if you use the “Allow EE code” plugin in conjuntion with “GD2_font”.
6) If you are having alignment issues with your generated images, check your css. You may need to define a ruleset for your image. ie: you used GD2_font to make font based text link in a list based menu <pre><code><ul id=’menu’> <li> <a href=’somelink’> {exp:gd2_font font_id="somefont.ttf" font_size="18" font_color="000000" bg_color="FFFFFF" transparency="100"} sometext {/exp:gd2_font} </a> </li> … </ul></code></pre>
you should have a matching img css rule in your sites css:
#menu ul li a img {
padding: 0px 0px 15px 10px; //just an example
vertical-align: top; //another example
}
I’ve been used sIFR, which is a pain in the ass, but works.
I like this method too, but I wonder if the author is still around and supporting it.
One thing that must be address in text replacement is line-height for multi-line headers. sIFR 3 now handles this ok. Before that, multi-line text overlapped itself.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.