freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] Re: The guts of yudit-2.xx


From: Werner LEMBERG
Subject: [Devel] Re: The guts of yudit-2.xx
Date: Wed, 17 Jan 2001 09:24:51 +0100 (CET)

Gaspar,


I took the liberty to forward this mail to both Keith and our Freetype
development mailing list also, since your arguments deserve broader
discussion IMHO.

> > > > PS: Do you plan to add FreeType support again, probably
> > > >     version 2.0?
> >
> > > I thought you would notice it.  The main reason why I have my
> > > own rendering is because of printing.  I use the same canvas to
> > > render and print.  Does freetype plan to provide the same style
> > > of interface for me in the future?  Please take a look at the
> > > swindow library and you will see what I mean.
> > 
> > Sorry, I don't have enough time to read the code (and I'm a poor
> > at C++).  Can you please describe in more detail what FreeType
> > should do for you?  For FreeType 2, we've completely redesigned
> > the library, removing all non-rendering stuff (like OpenType which
> > will become part a library on top of FreeType 2), making it quite
> > modular.  Basically, you open the font, input a character code,
> > get a glyph index, input the glyph index and get a bitmap.  It's
> > much simpler than in FreeType 1, we believe.
> 
> The main improvement [in yudit] is 
>
> 1. When drawing a glyph in a font, font creates a cache name using
> the glyph, actual font, fontsize (not implemented: rotation
> parameter, penwidth), well basically everything minus the
> translation component in the matrix.

FreeType 2 now offers both a outline and a bitmap cache module.

> 2. font tries to write itself on a canvas object using newpath(x, y,
> cachename).
>
> 3. If newpath returns true, the rendered image is cached so nothing
> but fill(pen) is called where pen contains additional parameters
> like linewidth + fore and back colors.
>
> 4. If newpath returns false, the canvas drawing functions are called
> to actually draw the glyph.  Then fill(pen) is called.  This may
> cache the object in canvas unless the cache name is "".
> 
> The actual drawing functions I implemented in yudit are postscript
> drawing functions, as you can see in swindow/SCanvas.h.
>
> - swindow/SPrinter (this is a canvas too!) uses these using
> SPostscript as a printer.  (It does almost nothing but translates the
> drawing functions to strings).  In case of printer I draw the same
> text twice, once to cache all glyphs, second to use cache to do the
> actual printout.
> 
> - swindow/sx11/SX11Window (this is a canvas too, and it is pluggable
> because it is SWindow) uses the swindow/SGEngine as a helper to make
> these drawing functions available in X11.  If X11 starts to support
> some of these functions (like transparency, splines etc.) then
> SGEngine would not be needed at all.

Keith can answer the last point better than I.

BTW, there is a major problem in printing TTF outlines to a PS
printer: overlapping paths must be decomposed.  Especially for
composite CJK TrueType fonts the results are extremely ugly otherwise.
Maybe we find a good guy who can implement such a module for
FreeType...

> This way I can use the save swidget/STextView object for instance,
> to render on screen or printer.
> 
> What did the X11 guys ask you? Do you know how they use freetype?

AFAIK, Keith uses FreeType 2 for the most fundamental operations only,
namely to render an outline to a pixmap.


    Werner



reply via email to

[Prev in Thread] Current Thread [Next in Thread]