Re: Displaying Formatted Text



Hello!

On 09 Dec 2000 09:08:31 -0500, Jay Bloodworth wrote:
> Thanks for the continuing help.  A couple more questions:
> 
> 1) What is the purpopse of the affine element of the hacktext canvas item.  What
> does this represent that is not represented in the base class's xform element.

HackText has "x" and "y" parameters. It's private affine takes those
into account. But mostly it is relict from old hacktext version, where
one had to use affine during ::render method. Now it uses GnomePGL
(which encapsulates affine), so maybe I'll remove that one day.

> 2) I've got a handle on GnomeFont versus GnomeRFont now.  Could you give a quick
> rundown of the relationship between GnomeFont and GnomeFace and a few of the most
> relevant methods?

GnomeFontFace is unscaled typeface. All glyph/font metrics are secified in
1000x1000 unit em square.
GnomeFontFace is also base of all 3 objects, and handles the actual
font file. Many GnomeFont calls are actually defined simply, as wrapper
ones, calling parallel methods from GnomeFontFace.

Usually you need:

gnome_font_face_new ()
gnome_font_face_lookup_default ()
gnome_font_face_get_font ()

and

gnome_font_get_glyph_stdbbox ()
gnome_font_get_glyph_stdadvance ()

I.e. fontmap queries and glyph mapping is handled by face (base unscaled
object)
For actual metrics you want to use already scaled version.

> 3) How is the implementation in the gnome-font module different from the gnomefont
> stuff in gnome-print?

gnome-font modules was my experimentation ground. It uses FreeType instead
of libgt1, so it is able to read both Type1 and TrueType fonts. I want to
keep the API-s in sync - but sometimes they diverge. As gnome-print is
stable package and required by many applications, I cannot experiment with
it very freely.
gnome-font already is capable (to some extent) of real grid-aligning
stuff. This is one of the main reasons for the existence 3-level font system.

I.e. you can do:

fonta = gnome_font_face_get_font (myface, 300, 300)
fontb = gnome_font_face_get_font (myface, 600, 600)

And the metrics of fonta and fontb are slightly different - fonta is
optimized for 300dpi printing, fontb for 600dpi printing.

Lauris









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