How to blit a Surface and shrink it?

I’m using TTF_Font. When the text surface is wider than my display surface how can I blit the overlengthed text in a smaller surface with out losing any character?

Thanks
Phuoc

/_/_/_/_/_/_
www.huaonline.com
My Homepage is my Castle

  Stay connected to the people that matter most with a smarter inbox. Take a look http://au.docs.yahoo.com/mail/smarterinbox

a bit ambiguous question assuming my grasp on english
assuming i know what you are on about-

if you put the text all into a surface of its own then checked to see if the
surtface was wider that your display, if np then plot normally, if yes use
sdlgfx to shrink the width of the text surface to the witdh of the display
surface then plot.

Neil White <neil cloudsprinter.com> writes:

a bit ambiguous question assuming my grasp on english
assuming i know what you are on about-

if you put the text all into a surface of its own then checked to see if the
surtface was wider that your display, if np then plot normally, if yes use
sdlgfx to shrink the width of the text surface to the witdh of the display
surface then plot.


SDL mailing list
SDL lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Or write it yourself. Here’s a tutorial I wrote a time ago:
http://www.sdltutorials.com/sdl-scale-surface/

Creature

Would you like your text to be split into multiple lines when it is
too long to fit on one line? This is usually called “wrapping,” since
the text “wraps” around the width of the screen more than once. The
most common form of wrapping text is “word wrap,” meaning that the
text is broken up so that no words span the gap between the end of one
line and the beginning of the next.

If TTF_Font provides a function for rendering a character string, but
does not provide a function for rendering a character string with word
wrap, I’m afraid you’ll have to add one. Look for a function providing
information on “text extents” to help calculate the length of strings
or individual characters!

Good luck!On Sat, Dec 20, 2008 at 8:35 AM, Phuoc Can Hua wrote:

I’m using TTF_Font. When the text surface is wider than my display surface how can I blit the overlengthed text in a smaller surface with out losing any character?


http://codebad.com/