Results 1 to 4 of 4
  1. #1

    PHP, GD and Bold Text

    I've looked everywhere, high and low, and cannot find a way to make text bold before handing it over to PHP/GD to make an image with text on it (except for the user example in's documentation notes, which does not look good). I can create an image using PHP/GD that has regular text, but I just cant find anything that will allow me to make that text bold.

  2. #2
    Join Date
    May 2005
    Planet Earth

    if you look in your Windows font directory (C:\Windows\Fonts, C:\WINNT\Fonts). You'll notice each font has different version to accomplish such thing ex:


    Arial Bold.ttf
    Arial Italic.ttf
    Arial Bold Italic.ttf

    Take the one you need because there's no way with GD to do such thing.


    G Disrupting traditional file hosting.
    █ Signup Early and enjoy Unlimited space/bandwidth for your files hosting, Forever!
    █ No Ads.
    █ No Countdowns.

  3. #3

    Doesn't work like that...

    I tried that already, thats the obvious first choice. However, "Arial Bold" with a "regular" style gives me something different than "Arial" with a "bold" style, and the latter of the two is what I want. I hate to settle for less, but if nobody knows how to bold text with GD (or if its not possible), that is what I'll have to settle for.

  4. #4
    Join Date
    Mar 2006
    with the current version og GD it's not directly posible, however you can do two things:

    1) use the bold ttf, however as you pointed out it's not always the nicest output as you pointed out
    2) First print the text, and then print the text again 1 pixel to the left/right, this will give a bold'ish effect, however, it's not the 100% bold effect.

    Those are the two methods i know off, and from what i'm able to find out, there are no better/other ways to do it atm... However there is talk of GD in future versions will expand the text features.
    || Semi-professional PHP developer || Exams right now, don't I just feel lucky? ||

Posting Permissions

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