Welcome Guest ( Log In | Register )

> Disabling the font resizing, for a 250X100 image
Dukessa
post Dec 4 2008, 03:56 PM
Post #1


Newbie
*

Group: Members
Posts: 3
Joined: 4-December 08
Member No.: 636



I'm using a 250X100 image, and the text looks really ugly...I dont know why, but it has to do with the resizing.
So I'm trying to take off the resizing feature from the code.
If anyone knows how to keep the resizing, but make it suitable for a 250X100 image, please let me know!

Ok so I tried to comment out all the code under:

CODE
# Resize the text so it fits on the image if the default font
# size is too large.


And

CODE
$text_size = size_text($config, $song, $img_size);


But then I get this error:

CODE
Fatal error: Call to undefined function get_song() in /mnt/local/home/***/signature.php on line 139


line 139 is about this stuff:

CODE
# First we need to get all the song information into $SONG hash for later use.
# song_file has the key=value format, with new line as a separator
  get_song($config['song_file']);


So I guess I took off too many things... rolleyes.gif
------

If I try to take off only:

CODE
function size_text(&$config, $song_title, $image_size) {
  $font_size = intval($config['font_size']);
  $padding = intval($config['padding']);
  $text_size = imagettfbbox ($font_size, 0, $config['font_file'], $song_title);
  while($text_size[4] > ($image_size[0] - $padding)) {
    $font_size -= 1;
    $config['text_vertical_offset'] -= 1;
    $text_size = imagettfbbox($font_size, 0, $config['font_file'], $song_title);
  }
  $config['font_size'] = $font_size;
  return (imagettfbbox($font_size, 0, $config['font_file'], $song_title)); //size, angle, name, string
}


...from the resize part... then I dont get errors...but the image doesnt display (i get a red cross)

Any idea?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: