PS Font

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Subhash

    #1

    PS Font

    Hello,
    I have been trying to use .pfb fonts (Type 1) to generate dynamic
    images. However the text in the images is very aliased and blurred.
    This is of course not because of the font or the font style itself.
    Please let me know if you have any ideas or opinions about it. Code
    snippet:

    $SIZE = 14;
    $FONT_PATH = "/usr/X11R6/lib/X11/fonts/Type1/hell.pfb";
    $FONT = ImagePSLoadFont ($FONT_PATH);
    $im = ImageCreate(100 , 100);
    $white = ImageColorAlloc ate($im, 255, 255, 255);
    $gray = ImageColorAlloc ate($im, 134, 134, 134);

    // draw
    ImagePSText($im , $str, $FONT, $SIZE, $gray, $gray, 0, $SIZE,0,0,0,16) ;
    ImagePSFreeFont ($FONT);

    Thanks.
  • Chung Leong

    #2
    Re: PS Font

    In general, Type 1 fonts don't look very good at small point sizes. You
    might want to generate the image at a large size and then resample it down.
    Also, if I remember correctly, the FreeType rasterer can perform
    anti-aliasing on true-color bitmaps. Try using imagecreatetrue color()
    instead of imagecreate() and see if you see any improvement.

    Uzytkownik "Subhash" <subhash_daga@y ahoo.com> napisal w wiadomosci
    news:fdffa0fb.0 403111402.72c64 9ab@posting.goo gle.com...[color=blue]
    > Hello,
    > I have been trying to use .pfb fonts (Type 1) to generate dynamic
    > images. However the text in the images is very aliased and blurred.
    > This is of course not because of the font or the font style itself.
    > Please let me know if you have any ideas or opinions about it. Code
    > snippet:
    >
    > $SIZE = 14;
    > $FONT_PATH = "/usr/X11R6/lib/X11/fonts/Type1/hell.pfb";
    > $FONT = ImagePSLoadFont ($FONT_PATH);
    > $im = ImageCreate(100 , 100);
    > $white = ImageColorAlloc ate($im, 255, 255, 255);
    > $gray = ImageColorAlloc ate($im, 134, 134, 134);
    >
    > // draw
    > ImagePSText($im , $str, $FONT, $SIZE, $gray, $gray, 0, $SIZE,0,0,0,16) ;
    > ImagePSFreeFont ($FONT);
    >
    > Thanks.[/color]



    Comment

    Working...