[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freetype] Re: Your rasterizer (ftgrays.c)
From: |
Francesco Zappa Nardelli |
Subject: |
Re: [Freetype] Re: Your rasterizer (ftgrays.c) |
Date: |
12 Feb 2001 19:08:33 +0100 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) Emacs/20.3 |
Hello.
MP> Do you have any sample code that would help me understand how it works? Do
MP> you have any suggestions as to how I would go about implementing a function
MP> like this:
MP> DrawPolygon(rect *r, int n, char *buf, int w, int h) where r is an array of
MP> n points (x,y) which form a closed polygon and buf is a pointer to a 24bit
MP> bitmap of width w and height h? Would this be simple or very hard to
MP> implement?
DT> I don't have an example handy, but basically, you'd need to:
DT> - convert your polygon to a FT_Outline (see FT_Outline_New,
DT> FT_Outline_Done)
DT> - call FT_Outline_Render, by taking care of providing your
DT> own span callback to write to your own bitmap
A sample code that implements what David suggests is provided by the
/gsft/ patch to Ghostscript: it makes Ghostscript invoke the FT2
rasterizer in order to fill the paths generated by Ghostscript when
rendering Type1 fonts.
ftp://ftp.ens.fr/pub/di/users/zappa/software/gsft-0.0.2.fix2.tar.gz
Hope this helps,
-francesco