Width for bounding box of highly tilted characters

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Width for bounding box of highly tilted characters

DMathog
This Inkscape bug:

   https://bugs.launchpad.net/inkscape/+bug/1283194

has been tracked down to an issue with the Queensland font (and some
other highly tilted fonts) and Pango.

The problem is this, we need to calculate a bounding box on one of these
tilted characters, but the width currently being used is too small.  The
ascend and descend values from the face are fine.  The width from the
font itself is also fine, here are the values (using FreeType to open
the font and pull out the characters):

    letter:J advance = 1472 width = 4928

The problem is that it looks like what we need to use for the width of
this bounding box is MAX(advance,width), but what is currently being
used is PangoGlyphGeometry which holds the advance only (I think).  On a
normal font like Arial that would be fine, as the advance is larger than
the width:

   letter:J advance = 1600 width = 1280

For Queensland though, it is the other way around.  We don't want the
bounding
box for the entire string, just the one glyph.  If all one has to work
with is

   glyphs[glyph_index]

and

   glyphs[glyph_index].geometry.width

is the wrong value (advance, narrower than the glyph), how does one
retrieve from Pango the width (bounding box xmax - xmin) of the glyph?

Thank you,

David Mathog
[hidden email]
Manager, Sequence Analysis Facility, Biology Division, Caltech
_______________________________________________
gtk-i18n-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Width for bounding box of highly tilted characters

Behdad Esfahbod-5
On 15-05-20 11:38 AM, mathog wrote:
> how does one retrieve from Pango the width (bounding box xmax - xmin) of the
> glyph?

pango_font_get_glyph_extents()
_______________________________________________
gtk-i18n-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-i18n-list
Loading...