[cairo] GTKCairo development

Bill Spitzak spitzak at d2.com
Tue May 4 16:20:11 PDT 2004

On Tuesday 04 May 2004 01:42 pm, Owen Taylor wrote:

> Have you thought about:

I don't think this is as hard as people are making it out to be. Here are my 
initial answers to these questions:

>  Metrics: What do you report for the metrics for this "combined font".
>   Is it always going to have a huge descent because it contains
>   Arabic somewhere in there?

A "union bounding box" around all the glyphs is useless, and there should be 
no interface to return it. If Pango or anything is interested in the area the 
letters are covering, it has to get bounding boxes for the individual glyphs. 
Or maybe you could have an interface to return the union bounding box for a 
given subset of glyphs, specified as a range or a string, but I really doubt 
that is useful.

"descent" is strictly for back-compatability and only has to do something 
useful for Latin fonts. I prefer the defintion: The "ascent" and "descent" 
are provided so that if you want to vertically center Latin letters in a 
vertical space of size h, you position the glyph origin at (h-a+d)/2 above 
the bottom edge of that space. You can also act as though the bounding box of 
any Latin glyph is no more than a above the origin and d below it, but this 
is not guaranteed.

>  Language tagging: when creating fontsets you want to prefer the fonts
>   that have all the characters of the language of the text.

My proposal will always draw something for every Unicode character, so the 
only reason for selecting a font is for aesthetics. I believe in any 
real-world example the entire set of glyphs the user is interested in making 
look "right" are contained in a single font, so limiting the interface to the 
selection of one font is not a problem.

>  OpenType and other layout tables: Fonts aren't just collections of
>   glyphs, they also have other tables that determine how these
>   fonts interact. (Ligatures, substitutions, etc.)

A call to return the system-specific Font structure that a given code belongs 
to would let you get at all this information. Substitutions would be done 
inside Cairo, though Pango can look at them.

>  Integration with native font systems: On Windows, Pango works on top
>   of Uniscribe. Uniscribe needs the individual fonts.

Cairo would hide this Uniscribe interface, with a set that consists of one 
named font, plus the built-in fallback set. Use the above "return the font 
this glyph belongs to" to get those font structures.

>  Combining accents: If I have LATIN SMALL LETTER A followed by
>    COMBINING ACUTE ACCENT, how do I select the font that doesn't

If you select such a font you will get the 'a' from that font printed over 
with the acute accent from the fallback font.

                   ,~,~,~,~ ~ ~ ~ ~
     /\_       _|_========___         Bill Spitzak
 ~~~/\/\\~~~~~~\____________/~~~~~~~~ spitzak at d2.com

More information about the cairo mailing list