--- deliantra/Deliantra-Client/Client.xs 2006/08/14 01:21:01 1.138 +++ deliantra/Deliantra-Client/Client.xs 2006/08/14 03:04:17 1.139 @@ -146,12 +146,21 @@ static void layout_get_pixel_size (CFPlus__Layout self, int *w, int *h) { - pango_layout_get_pixel_size (self->pl, w, h); + PangoRectangle rect; - if (!*w) *w = 1; - if (!*h) *h = 1; + // get_pixel_* wrongly rounds down + pango_layout_get_extents (self->pl, 0, &rect); - *w = (*w + 3) & ~3; + rect.width = (rect.width + PANGO_SCALE - 1) / PANGO_SCALE; + rect.height = (rect.height + PANGO_SCALE - 1) / PANGO_SCALE; + + if (!rect.width) rect.width = 1; + if (!rect.height) rect.height = 1; + + rect.width = (rect.width + 3) & ~3; + + *w = rect.width; + *h = rect.height; } typedef uint16_t mapface;