Mike© : ImageTTFText - Fontprobleme (MS nach Linux)

Beitrag lesen

Moin Achim,

Aber vielleicht ist sonst was im Skript, was die Probleme verursacht.

das wage ich zu bezweifeln :-)))

Hast Du irgendwo den Code zum Anschauen? (Allerdings komme ich erst morgen dazu, bin gleich offline)

Dto zu offline

Hier der ganze Code. Danke nochmal für deine Geduld:

<? @session_start();

$sid = session_name().'='.session_id();

$Table_Color = $_SESSION['Table_Color']; $Main_Color = $_SESSION['Main_Color'];

$Online = $_SESSION['online'];

include("settings.php");

if ( $Online != 1 )    {  header("Location: index.php");  exit;    }

$Anrede = $_SESSION['Anrede']; $Name = $_SESSION['Name']; $ID = $_SESSION['ID'];

if ( isset ($_POST['break']) )    {  header("Location: http://$_SERVER[HTTP_HOST]/pinwand.php?$sid");  exit;    }

if ( isset ($_POST['preview']) )    {  $Line1=$_POST['line1'];  $Line2=$_POST['line2'];  $Line3=$_POST['line3'];  $Line4=$_POST['line4'];  $Line5=$_POST['line5'];  $Line6=$_POST['line6'];  $Line7=$_POST['line7'];    }

if ( isset ($_POST['save']) )    {  $Line1=$_POST['line1'];  $Line2=$_POST['line2'];  $Line3=$_POST['line3'];  $Line4=$_POST['line4'];  $Line5=$_POST['line5'];  $Line6=$_POST['line6'];  $Line7=$_POST['line7'];

$img_timestamp=time();

$Footer=sprintf("%s %s",$Anrede,$Name);

$image_path=sprintf("./images/post_it_%s.png",$img_timestamp);

$Current_Date=date("d/m/Y");  $Current_DD=date("d");  $Current_MM=date("m");  $Current_YY=date("Y");

$Delete_Timestamp=mktime(0,0,0,$Current_MM+1,$Current_DD-1,$Current_YY);

$db_pointer = mysql_connect($HOST, $DB_USER, $DB_PW);  mysql_select_db($DB_NAME, $db_pointer);

$query = "insert into pinwand ( user_id, entry_timestamp, line1, line2, line3, line4, line5, line6, line7, footer, delete_timestamp) VALUES ('".$ID."',$img_timestamp, '".$Line1."', '".$Line2."', '".$Line3."', '".$Line4."', '".$Line5."', '".$Line6."', '".$Line7."', '".$Footer."',$Delete_Timestamp)";  $result = mysql_query($query, $db_pointer);

mysql_close($db_pointer);

$im = imageCreateFromPng("./images/postit.png");

$black = ImageColorAllocate ($im, 0, 0, 0);  ImageTTFText ($im, 10, 0, 54, 45, $black, "lucon","$Line1");  ImageTTFText ($im, 10, 0, 52, 65, $black, "./fonts/lucon.ttf","$Line2");  ImageTTFText ($im, 10, 0, 50, 85, $black, "./fonts/lucon.ttf","$Line3");  ImageTTFText ($im, 10, 0, 48, 105, $black, "./fonts/lucon.ttf","$Line4");  ImageTTFText ($im, 10, 0, 44, 125, $black, "./fonts/lucon.ttf","$Line5");  ImageTTFText ($im, 10, 0, 40, 145, $black, "./fonts/lucon.ttf","$Line6");  ImageTTFText ($im, 10, 0, 32, 165, $black, "./fonts/lucon.ttf","$Line7");  ImageTTFText ($im, 10, 0, 22, 180, $black, "./fonts/lucon.ttf","$Footer");

ImagePNG($im,"$image_path");  imagedestroy($im);

header("Location: http://$_SERVER[HTTP_HOST]/pinwand.php?$sid");  exit;    }

echo ' <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html> <head>

<title>Kita - Weidenstrasse</title>

'.$Header_Settings.'';

if ( $Fast_Mode == 0 )    {  echo '  <script language="javascript" type="text/javascript" src="menu.js"></script>';    }

echo ' <script type="text/javascript"> <!--

function set_cursor() {  document.Pinwand.line1.focus(); }

//--> </script> </head>';

if ( $Fast_Mode == 0 )    {  echo '  <body onload="preloadImages(); set_cursor();" style="background-color:'.$Main_Color.';">';    } else    {  echo '  <body onload="set_cursor();" style="background-color:'.$Main_Color.';">';    }

echo ' <table style="width:100%; height:100%;" border="0" align="center"> <tr>  <td width="20%" align="center" bgcolor="'.$Table_Color.'">';

if ( $Fast_Mode == 0 )        {   $current_menu=16;   include("menu.php");     }  else        {   include("menu_fast.php");     }

echo '  </td>

<td width="80%" align="center" valign="top">';

if ( $Fast_Mode == 0 )        {   echo '

<table style="width:100%;" border="0" align="center">   <tr>

<td width="135" align="center">    <img src="./images/diddl_still.gif" width="132" height="90" alt="Hallo" border="0">    </td>

<td align="center">    <img src="./images/pinwand_logo.gif" width="315" height="59" alt="Pinwand" border="0">    </td>

<td width="135" align="center">    <img src="./images/diddl_still.gif" width="132" height="90" alt="Hallo" border="0">    </td>   </tr>   </table>';        }  else     {   echo '   <span class="TextHeader">   Kita - Pinwand   </span>';     }

echo '

<div style="padding:5pt; border:thin solid blue; width:90%;">  <span class="TextSmall">  Ihr Zettel bleibt mindestens einen Monat h&auml;ngen, danach wird er abgeh&auml;ngt.  <br>  Sie k&ouml;nnen Ihren eigenen Zettel auch jederzeit selbst abh&auml;ngen.  </span>  </div>

<br>

<form style="display:inline;" name="Pinwand" action="pinwand_entry.php" method="POST" target="_self">

<table style="width:95%;" border="0" align="center">  <tr>   <td width="50%" align="center" bgcolor="'.$Main_Color.'">   <span class="Text">   Text eingeben:   </span>   </td>

<td width="50%" align="center" bgcolor="'.$Main_Color.'">   <span class="Text">   Vorschau:   </span>   </td>  </tr>

<tr>   <td width="50%" align="center" bgcolor="'.$Main_Color.'">   <input type="text" name="line1" size="25" maxlength="22" style="color:#000000; font-size:10pt; font-family:Lucida Console;" value="'.$Line1.'">   <input type="text" name="line2" size="25" maxlength="22" style="color:#000000; font-size:10pt; font-family:Lucida Console;" value="'.$Line2.'">   <input type="text" name="line3" size="25" maxlength="22" style="color:#000000; font-size:10pt; font-family:Lucida Console;" value="'.$Line3.'">   <input type="text" name="line4" size="25" maxlength="22" style="color:#000000; font-size:10pt; font-family:Lucida Console;" value="'.$Line4.'">   <input type="text" name="line5" size="25" maxlength="22" style="color:#000000; font-size:10pt; font-family:Lucida Console;" value="'.$Line5.'">   <input type="text" name="line6" size="25" maxlength="22" style="color:#000000; font-size:10pt; font-family:Lucida Console;" value="'.$Line6.'">   <input type="text" name="line7" size="25" maxlength="22" style="color:#000000; font-size:10pt; font-family:Lucida Console;" value="'.$Line7.'">   </td>';

if ( $Fast_Mode == 0 )      {    echo '    <td width="50%" align="center" bgcolor="'.$Main_Color.'">';      }   else      {    echo '    <td width="50%" align="left" bgcolor="'.$Main_Color.'">';      }

$Footer=sprintf("%s %s",$Anrede,$Name);

$image_temp=sprintf("./images_png/postit_%s.png",time());

if ( $Fast_Mode == 0 )      {    $im = imageCreateFromPng("./images/postit.png");

$black = ImageColorAllocate ($im, 0, 0, 0);    ImageTTFText ($im, 10, 0, 54, 45, $black, "/usr/X11R6/lib/X11/fonts/TTF/lucon.ttf","$Line1");    ImageTTFText ($im, 10, 0, 52, 65, $black, "/usr/X11R6/lib/X11/fonts/TTF/lucon.ttf","$Line2");    ImageTTFText ($im, 10, 0, 50, 85, $black, "/usr/X11R6/lib/X11/fonts/TTF/lucon.ttf","$Line3");    ImageTTFText ($im, 10, 0, 48, 105, $black, "/usr/X11R6/lib/X11/fonts/TTF/lucon.ttf","$Line4");    ImageTTFText ($im, 10, 0, 44, 125, $black, "/usr/X11R6/lib/X11/fonts/TTF/lucon.ttf","$Line5");    ImageTTFText ($im, 10, 0, 40, 145, $black, "/usr/X11R6/lib/X11/fonts/TTF/lucon.ttf","$Line6");    ImageTTFText ($im, 10, 0, 32, 165, $black, "/usr/X11R6/lib/X11/fonts/TTF/lucon.ttf","$Line7");    ImageTTFText ($im, 10, 0, 22, 180, $black, "/usr/X11R6/lib/X11/fonts/TTF/lucon.ttf","$Footer");

ImagePNG($im,"$image_temp");    imagedestroy($im);

echo '    <br>    <img src="'.$image_temp.'" width="244" height="207" alt="Vorschau" border="0">    <br><br>';      }   else      {    echo '    <div style="padding:5pt; border:thin solid blue; width:244; height:207;">    <span class="TextPinwand">    '.$Line1.'    <br><br>    '.$Line2.'    <br><br>    '.$Line3.'    <br><br>    '.$Line4.'    <br><br>    '.$Line5.'    <br><br>    '.$Line6.'    <br><br>    '.$Line7.'    <br><br>    '.$Footer.'    </span>    </div>';      }

echo '   </td>  </tr>

<tr>   <td width="100%" align="center" bgcolor="'.$Main_Color.'" colspan="2">   <input type="hidden" name="file" value="'.$image_temp.'">   <input style="cursor:pointer; display:inline; width:150px;" type="submit" name="preview" value="Vorschau">   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';

if ( !empty($Line1) || !empty($Line2) || !empty($Line3) || !empty($Line4) || !empty($Line5) || !empty($Line6) || !empty($Line7) )      {    echo '    <input style="cursor:pointer; display:inline; width:150px;" type="submit" name="save" value="Speichern">    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';      }

echo '   <input style="cursor:pointer; display:inline; width:150px;" type="submit" name="break" value="Abbrechen">

</td>  </tr>  </table>  </form>  </td> </tr> </table>

</body>

</html>'; ?>

regds Mike©

--
Freunde kommen und gehen. Feinde sammeln sich an.