Re: [HarfBuzz] harfbuzz coordinate system

2010-10-31 Thread Behdad Esfahbod
On 10/29/10 18:19, Jonathan Kew wrote:
 So FWIW, my preference would be to keep the y-axis pointing up. I think 
 that's right for a text-centric API, and I don't think making a change will 
 really gain anything.

I don't completely agree, but since the two responses I got both prefer the
current direction, I let it be as is for now and revisit during the API
hackfest before 1.0.

Thanks,
behdad
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz


Re: [HarfBuzz] harfbuzz coordinate system

2010-10-29 Thread Jonathan Kew
On 29 Oct 2010, at 01:55, Martin Hosken wrote:

 Dear Behdad,
 
 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.
 
 I don't think it matters too much which way you jump on this one so long as:
 
 1. You clearly state the directionality in lots of places in the 
 documentation and code.
 
 2. You make it clear where the different y directionalities are used. For 
 example, what should a call to a font metrics function return? If it is as 
 per a font with y increasing up the page, then where in the code does the y 
 directionality switch?
 
 I sympathise with the quandary: font designers think in terms of y going up 
 the page, while graphics programmers think of y increasing down the page.

Yes, there are arguments either way.

Personally, I'd recommend that harfbuzz keeps y increasing upwards, as I think 
that is the natural way to deal with text -- in the context of horizontal, 
left-to-right (or indeed right-to-left) text, I'd instinctively think of a 
positive y-displacement as raising a glyph.

I'm certainly aware of the potential for y-direction bugs in higher-level 
text+graphics systems, having both made and fixed such errors personally, but I 
don't think flipping harfbuzz's coordinate system will particularly prevent 
this. Whichever way you do it, mistakes will be made, and not noticed until 
people test fonts that actually use y-displacements.

So FWIW, my preference would be to keep the y-axis pointing up. I think that's 
right for a text-centric API, and I don't think making a change will really 
gain anything.

JK

___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz


Re: [HarfBuzz] harfbuzz coordinate system

2010-10-28 Thread Behdad Esfahbod
On 10/27/10 15:56, James Cloos wrote:
 BE == Behdad Esfahbod beh...@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
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz


Re: [HarfBuzz] harfbuzz coordinate system

2010-10-28 Thread Martin Hosken
Dear Behdad,

 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.

I don't think it matters too much which way you jump on this one so long as:

1. You clearly state the directionality in lots of places in the documentation 
and code.

2. You make it clear where the different y directionalities are used. For 
example, what should a call to a font metrics function return? If it is as per 
a font with y increasing up the page, then where in the code does the y 
directionality switch?

I sympathise with the quandary: font designers think in terms of y going up the 
page, while graphics programmers think of y increasing down the page.

Yours,
Martin
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz


Re: [HarfBuzz] harfbuzz coordinate system

2010-10-28 Thread Behdad Esfahbod
On 10/28/10 20:55, Martin Hosken wrote:
 I don't think it matters too much which way you jump on this one so long as:

Right.  What adds to the confusion is that in simple text, y_offset is always
zero, so you can build an entire system without discovering your error...

b
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz


Re: [HarfBuzz] harfbuzz coordinate system

2010-10-27 Thread James Cloos
 BE == Behdad Esfahbod beh...@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.

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

-JimC
-- 
James Cloos cl...@jhcloos.com OpenPGP: 1024D/ED7DAEA6
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz