[HarfBuzz] harfbuzz coordinate system

Behdad Esfahbod behdad at behdad.org
Thu Oct 28 15:17:49 PDT 2010


On 10/27/10 15:56, James Cloos wrote:
>>>>>> "BE" == Behdad Esfahbod <behdad at behdad.org> writes:
> 
> BE> I'm wondering, should increasing y move upwards, or downwards?  Most
> BE> graphics API I've seen (PS-based API being the only exception) has y
> BE> moving downward.  I find that more intuitive in a text layout
> BE> library, so we can say: "in-line glyphs are stacked in the
> BE> increasing x direction, lines are stacked in the increasing y
> BE> direction."
> 
> I've always thought of y going up w/in a font.  It would be weird for
> the capsheight to be negative and descender depth to be positive.

But that's exactly what pango and cairo have been doing.  And FreeType too
IIRC.  And Xft?  I'm sure they are not the only ones.

> Especially since everything else has -ve descenders and +ve ascenders.

That's not true.  Many places where you see ascenders and descenders, both are
positive.  That is, they are in different directions.  Anyway, the HarfBuzz
API doesn't really deal with font-space.  The main API is about shaped glyphs.
 Having top-left corner of the glyphs have a negative y_offset is not unusual.

I think I'm going to make that change, especially since everytime I hooked up
HarfBuzz to another system, it worked the first try except for a missing
negation sign for y_offset.

behdad


> -JimC



More information about the HarfBuzz mailing list