Help/text2pngPlugin

Note: You are viewing an old revision of this page. View the current version.

Convert text into a png image using GD without using WikiPluginCached. The images are stored in a private <PHPWIKI_DIR>/images/<LANG> subdirectory instead, which are not timestamp checked at all. Delete the .png file(s) if you change anything.

This is a really simple and stupid plugin, which might need some work.

Usage

<<text2png text="some text">>

Arguments

text
some text to display
lang
language subdirectory
_force
set to 1 to recreate the image
fontsize
18. with GD1 it's the pixelsize, with GD2 the pointsize
with_shadow
1
fontcolor
#000000
shadowcolor
#AFAFAF
backcolor
#ffffff

Configurable Options

See the sourcecode. You'd probably need to adjust $ttfont and text2png_debug.

Example

<<text2png text='Hello WikiWorld!'>>

would produce:


PhpWiki Warning: (8, Undefined variable: l, /var/www/phpwiki/lib/plugin/text2png.php, 126)
PhpWiki Warning: (8, Undefined variable: l, /var/www/phpwiki/lib/plugin/text2png.php, 129)
PhpWiki Warning: (2, mkdir(): Permission denied, /var/www/phpwiki/lib/plugin/text2png.php, 137)
PhpWiki Warning: (2, mkdir(): Permission denied, /var/www/phpwiki/lib/plugin/text2png.php, 138)
PhpWiki Warning: (2, imagettfbbox(): Could not find/open font, /var/www/phpwiki/lib/plugin/text2png.php, 166)
PhpWiki Warning: (2, imagettftext(): Could not find/open font, /var/www/phpwiki/lib/plugin/text2png.php, 183)
PhpWiki Warning: (2, imagettftext(): Could not find/open font, /var/www/phpwiki/lib/plugin/text2png.php, 188)
PhpWiki Warning: (2, imagepng(): Unable to open '/var/www/phpwiki/uploads/text2png-image//Hello+WikiWorld%21.png' for writing: No such file or directory, /var/www/phpwiki/lib/plugin/text2png.php, 201)
PhpWiki Warning: (1024, couldn't open file “/var/www/phpwiki/uploads/text2png-image//Hello+WikiWorld%21.png” for writing, /var/www/phpwiki/lib/plugin/text2png.php, 229)

See Also



Our Founder
ToolboxClick to hide/show
RecentChanges Click to hide/show

lib/plugin/text2png.php (In template 'browse' < 'body' < 'html'):126 Notice: "Undefined variable: l"

lib/plugin/text2png.php (In template 'browse' < 'body' < 'html'):129 Notice: "Undefined variable: l"

lib/plugin/text2png.php (In template 'browse' < 'body' < 'html'):137 Warning: "mkdir(): Permission denied"

lib/plugin/text2png.php (In template 'browse' < 'body' < 'html'):138 Warning: "mkdir(): Permission denied"

lib/plugin/text2png.php (In template 'browse' < 'body' < 'html'):166 Warning: "imagettfbbox(): Could not find/open font"