Ejemplo n.º 1
0
void wxGetTextExtent(WXDisplay* display, const wxFont& font, double scale,
                     const wxString& str,
                     int* width, int* height, int* ascent, int* descent)
{
    XRectangle ink, logical;
    WXFontSet fset = font.GetFontSet(scale, display);

    XmbTextExtents( (XFontSet)fset, str.mb_str(), str.length(), &ink, &logical);

    if( width ) *width = logical.width;
    if( height ) *height = logical.height;
    if( ascent ) *ascent = -logical.y;
    if( descent ) *descent = logical.height + logical.y;
}