Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.


Results 1 to 3 of 3

Thread: GD Alpha Text Outline

  1. #1

    GD Alpha Text Outline

    Just playing with another ugly layout and i want to use Avenir with GD to create text with an alpha background, that is all accomplished. However, there is an ugly, jaggy white single pixel outline that looks like a bag of crap.

    Any idea how to get GD to anti alias, or at least not put out that white?

    Heres a link to what i'm working on:

    And here's the GD that i'm using to make the image(s). (it's also making the subtitles):
    PHP Code:
    $fontsize 60;
    $height 90;
    $font 'avenirheavy.otf';
    $_GET['subtitle']) && $_GET['subtitle'] == "true"){
    $fontsize 30;
    $height 50;
    $font 'avenir.otf';
    $size imagettfbbox($fontsize0$font$text);
    $width $size[2] + $size[0]-50;
    $im imagecreatetruecolor($width$height);
    $_GET['subtitle']) && $_GET['subtitle'] == "true"){
    $white imagecolorallocate($im131313);
    $black imagecolorallocate($im255255255);
    $white imagecolorallocate($im255255255);
    $black imagecolorallocate($im131313);
    imagefilledrectangle$im00$width$height$white );
    $im2 imagecolortransparent($im$white);
    $xcoord = -10;
    $ycoord $height 3;
    $array str_split($text);
    $hpos 0;
    $i=0$i<count($array); $i++){
    $_GET['subtitle']) && $_GET['subtitle'] == "true"){
    $bbox imagettftext$im$fontsize0$hpos$ycoord-12$black$font$array[$i] );
    $hpos $bbox[2];
    $bbox imagettftext$im$fontsize0$hpos$ycoord$black$font$array[$i] );
    $hpos $bbox[2]-5;
    $fileparts split("[.?]",$text);

    member #1 of the "XML-is-a-crutch-to-make-people-feel-elite-club"
    K-Emmys-06: Best Quote K-Emmys-06: Flash Genious

  2. #2

    member #1 of the "XML-is-a-crutch-to-make-people-feel-elite-club"
    K-Emmys-06: Best Quote K-Emmys-06: Flash Genious

  3. #3
    well, good news (I hope)

    I was looking at a site evildrummer sent me to learn about the basics of GD and I think I am correct in saying this could help your antialias

    My Photography

    K-Emmys-06: Best "Newbie"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012