[cairo] Re: Cairo font size should be in units

graydon hoare graydon at redhat.com
Wed Sep 29 13:22:50 PDT 2004


On Wed, 29 Sep 2004 14:47:04 -0400, Carl Worth <cworth at east.isi.edu> wrote:

> Actually, I'm not sure we have that much choice here. I'm not a
> typography expert, but a quick scan of various systems suggests to me
> that when a font is describe with a single size, the metric being
> referred to is what is known as the "point size" which is the default
> inter-line spacing, (or the sum of the ascent, the descent, and any
> built-in leading).

if this is true, all the better: the question vanishes. I was,
I must admit, working mostly off of the combination of this page:

http://freetype.sourceforge.net/freetype2/docs/glyphs/glyphs-3.html

which suggests that leading lies outside the EM square, and this
page:

http://freetype.sourceforge.net/freetype2/docs/glyphs/glyphs-2.html

which suggests that it is the EM square alone (minus leading) to which
a font point size or pixel size applies. this interpretation appears
again in the freetype API documentation, but perhaps he has his leadings
confused (or perhaps no modern fonts even talk about additional leading,
so it's a moot point).

> So I think you and Bill are actually in agreement, when you say we have
> to use the "EM size" provided by the font and he says he'd like to
> specify a font size based on line spacing.

well, it hardly matters if we're in agreement; since freetype only
provides this one way of *requesting* a font size (rather than measuring
the results of a request) it's the interface we have to use. and since
no layout systems will use that request number anyways -- they will
always measure the result -- it seems to me little more than a
documentation issue.

> What's left then is to decide the size of a font with an identity
> matrix, (eg. immediately after calling cairo_select_font). I propose
> following the convention of PostScript in that the default font size is
> 1 user-space unit.

ok, you're the boss :)

-graydon




More information about the cairo mailing list