Kann mir denn keiner helfen?
OK, dann helf ich mir halt selber.
ImageTTFText aus der Standard-GD-Library in PHP5 hat ein Codierungsproblem mit Umlauten. Für OpenType-Fonts konnte ich das Problem nicht lösen. Für TrueType gibts einen Workaround:
Einfach im File text.php ob dem Bildgenerator diesen Workaround einfügen. Ist zwar nicht schön, aber funktioniert mit TrueType:
Code: Alles auswählen
function umlWorkaround($text) { 
 $text = (string) $text; 
 $text_out = ""; 
 
 for($i = 0, $n = strlen($text); $i < $n; $i++) { 
 $text_out .= "&#" . ord($text[$i]) . ";"; 
 } 
 return $text_out; 
 }
$text = umlWorkaround($text);
Und für die Bequemen hier das ganze File:
Code: Alles auswählen
<?php
/**
 * dynTEXTmaker - Generate dynamic text buttons on the fly
 * 
 * @version 0.1
 * @copyright 19.08.2003
 * @author Marc Giombetti <marc@giombetti.com> 
 * 
 */
include("text_config.inc.php");
 if(isset($PATH_INFO) && $usekinkyurl == "1"){
    
     $vardata = explode('/', $PATH_INFO);
    
     $num_param = count($vardata);
    
     if($num_param % 2 == 0){
        
         $vardata[] = '';
         $num_param++;
         }
    
     for($i = 1; $i < $num_param; $i += 2){
        
         $$vardata[$i] = $vardata[$i + 1];
         }
     $text = urldecode($text);
     }else{
     $text = urldecode($_GET['text']);
     $s = $_GET['s'];
     }
 if(empty($s) || !is_numeric($s)){
     $s = $sizedefault;
     }else{
     if($s < $sizemin){
         $s = $sizemin;
         }
    
     if($s > $sizemax){
         $s = $sizemax;
         }
     }
 if(empty($text)){
     $text = $text_default;
     }
/**
 * hex2dec()
 * 
 * @param string $hex Hexadecimal color
 * @return array array('r','g','b')
 */
 function hex2dec($hex){
    $color = str_replace('#', '', $hex);
     $ret = array(
        'r' => hexdec(substr($color, 0, 2)),
         'g' => hexdec(substr($color, 2, 2)),
         'b' => hexdec(substr($color, 4, 2))
        );
     return $ret;
    }
/**
 * Workaround für Umlaute (nur TrueType-Fonts) 
 * 
 */
function umlWorkaround($text) { 
 $text = (string) $text; 
 $text_out = ""; 
 
 for($i = 0, $n = strlen($text); $i < $n; $i++) { 
 $text_out .= "&#" . ord($text[$i]) . ";"; 
 } 
 return $text_out; 
 }
$text = umlWorkaround($text);
if($usecache == 1){
    $cachestring = md5("$$bg_color|$text_color|$text|$font|$s");
    $imcache = @ImageCreateFromPNG ("$cachefolder$cachestring.png");
    if($imcache){
        ImagePNG($imcache);
        }else{
         Header("Content-type: image/png");
         $size = imagettfbbox($s, 0, $font, $text);
         $dx = abs($size[2] - $size[0]);
         $dy = abs($size[5] - $size[3]);
         $xpad = 9;
         $ypad = 9;
         $im = imagecreate($dx + $xpad, $dy + $ypad);
         $bgc = hex2dec($bg_color);
         $bg = ImageColorAllocate($im, $bgc['r'], $bgc['g'], $bgc['b']);
         $mac = hex2dec($text_color);
         $main = ImageColorAllocate($im, $mac['r'], $mac['g'], $mac['b']);
         ImageTTFText($im, $s, 0, (int)($xpad / 2), $dy + (int)($ypad / 2)-1, $main, $font, $text);
         ImagePng($im, "$cachefolder$cachestring.png");
         $imcache = @ImageCreateFromPNG ("$cachefolder$cachestring.png");
         ImagePNG($imcache);
         }
    }else{
    
     Header("Content-type: image/png");
     $size = imagettfbbox($s, 0, $font, $text);
     $dx = abs($size[2] - $size[0]);
     $dy = abs($size[5] - $size[3]);
     $xpad = 9;
     $ypad = 9;
     $im = imagecreate($dx + $xpad, $dy + $ypad);
     $bgc = hex2dec($bg_color);
     $bg = ImageColorAllocate($im, $bgc['r'], $bgc['g'], $bgc['b']);
     $mac = hex2dec($text_color);
     $main = ImageColorAllocate($im, $mac['r'], $mac['g'], $mac['b']);
     ImageTTFText($im, $s, 0, (int)($xpad / 2), $dy + (int)($ypad / 2)-1, $main, $font, $text);
     ImagePng($im);
     ImageDestroy($im);
    }
?>