I have following problem... I wanted to render a ttf text into a png file... this was not a problem... my problem is.. how can I use the antialiasing and hinting options in PHP that are included in the FreeType library..

without antialiasing the outline of the ttf is to hard not smooth..

thanks..

    According to the Manual:

    "Using the negative of a color index has the effect of turning off antialiasing"

    Make sure when you create the TTF text, that the color index you use is positive.

    Max

      I used following code :

      ImageTTFText ($image, 14, 0, 90, 136, $black, "MtBdF___.TTF", "$artderspeisen");

      when I use the code above the font is not displayed with the antialiasing and hinting option...

      the outline of the ttf text are very hard... I could not do it so.. that the outlines have a blur effect... I mean sooth outlines...

      thanks

      Nizar

        The problem might lie in your $black variable.

        For hard black text:
        $black = ImageColorAllocate ($im,-255,-255,-255);

        For antialiased black text:
        $black = ImageColorAllocate($im,0,0,0);

        It may also be that certain fonts cannot be antialiased, though I am unsure of this.

        Max

          Write a Reply...