Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2004
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Wrapping text using imagettftext

    I have this long blob of text that I'm passing in to display as png, but of course the text doesn't wrap and so it's cut off. Is there a way to fix it?

    I tried imagettfbbox and imagecreatefromstring, but I can't seem to specify the font file to use or choose the text color. Any ideas?
    Thanks.

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There are a few ideas in the user comments for imagestring(), here, such as creating the text as an image first then resizing it and adding it to your original image, or wrapping the text to fit the image.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •