Re: Drawing glyph bounding box on rendered text?



Try this instead:

> for (i = 0; i < pRun->glyphs->num_glyphs; i++)
>      {
> 
>      pango_font_get_glyph_extents(font, glyphID, &glyphbox, NULL);
                                                   ^^^^^^^^^^^^^^^
Note we are getting ink box now, not logical box.


>       cairo_rectangle(context, glyphX + glyphbox.x, glyphY + glyphbox.y,
>                                glyphbox.width, glyphbox.height);
>       cairo_stroke(context);
> 
>       glyphX += pango_to_ink * pRun->glyphs->glyphs[i].geometry.width;
>       }


behdad


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