Re: problem with portability of text extents

On 02/13/2011 08:41 PM, Bogdan Butnaru wrote:
On Sat, Feb 12, 2011 at 19:55, John Ellson <ellson research att com> wrote:
I think logical_rect.y should more usefully represent the maximum ascent of any character in the font.  (Strictly, any font used in the top line of a pango layout.)

I’m sorry if this is a silly question: did you check if the two fonts don’t actually have different maximum ascents? (I can imagine the Linux one having a very tall character, like an integral or something, that doesn’t exist in the Darwin one. I’m not sure from your description if this is the same font file on both systems or just two different Times fonts.)

Its a different font file on the two systems, as far as I can tell (pango doesn't make it easy to work out exactly what font file is being used, nor to specifically request a particular font file.)

I haven't checked, but yes, I too can imagine that there could be extra high glyphs in a given font file, but the API only asks for the logical_rect of the font *family*.  Perhaps that should that be the highest ascent of a standard set of characters - something like the "The quick brown fox.." string that pango uses now (but maybe with more than just 'T' in upper-case).  Perhaps the chosen string should include the integral character, or perhaps not, but my point is that it should be consistent across platforms.

Or perhaps the simplest fix would be to just change the documentation to indicate that logical_rect.y is *not* useful for layout purposes, and to suggest something else?


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