The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

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 Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012