Jump to content

gfX

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gfX's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. OK I am getting close! After reading on Stackoverflow here is what I have now: http://www.autoshopgarage.com/new-era/test2.php?text=testing+%3Cb%3Escript%3C/b%3E%20this%20is%20so%20cool%20i%20love%20it That does what I want, the only problem with this is now I can't get the wordwrap to work! It should wrap to the next line, but I cannot seem to get it. Here is the new PHP code: <?php header('Content-type: image/png'); $im = imagecreatefrompng ( "banner_blank.png" ); $color = imagecolorallocate($image, 0, 0, 0); $tmp = $_GET['text']; $words = explode(" ", $tmp); $x = array(0,0,230); // DUMMY ARRAY WITH X POSITION FOR FIRST WORD $addSpace = 0; foreach($words as $word) { if($addSpace) $word = " ".$word; // IF WORD IS NOT THE FIRST ONE, THEN ADD SPACE if(stristr($word, "<b>")) { $font = 'HelveticaNeueLTStd-BdEx.ttf'; // BOLD FONT $replace = str_replace(array("<b>","</b>"), "", $word); $x = imagettftext($im, 20, 0, $x[2], 20, $color, $font, $replace); } else { $font = 'HelveticaNeueLTStd-LtEx.ttf'; // NORMAL FONT $x = imagettftext($im, 20, 0, $x[2], 20, $color, $font, $word); } $addSpace = 1; } imagepng($im); imagedestroy($im); ?> Anyone have any ideas? Thanks!
  2. Hi guys, Here is what I have so far: http://www.autoshopgarage.com/new-era/generate.php What I am trying to do is instead of having Line 1 and Line 2, I want to just have one big textarea so I don't have to limit the user so much. I did it this way because I want to have two versions of text, the light version and the bold version. Is it possible to have two different fonts with just one textarea of text? Right now I have two functions: So I would limit that to just 1, and it would automatically wordwrap but what would I put for the $font variable? Is this even possible? I was thinking of just using BBCode so they could type in [b*]Bold Text[/b*] and it would use the Bold version of the font if it sees that. Any help is appreciated. Thanks! Here is the full code:
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.