--- deliantra/Deliantra-Client/Client.xs 2006/04/11 13:14:36 1.15 +++ deliantra/Deliantra-Client/Client.xs 2006/04/11 13:27:48 1.16 @@ -27,6 +27,9 @@ static void layout_get_pixel_size (CFClient__Layout self, int *w, int *h) { + PangoFontDescription *font = pango_context_get_font_description (context); + pango_font_description_set_absolute_size (font, self->base_height * PANGO_SCALE); + pango_layout_get_pixel_size (self->pl, w, h); *w = (*w + 3) & ~3; @@ -108,6 +111,11 @@ } void +set_height (CFClient::Layout self, int base_height) + CODE: + self->base_height = base_height; + +void set_width (CFClient::Layout self, int max_width = -1) CODE: pango_layout_set_width (self->pl, max_width < 0 ? max_width : max_width * PANGO_SCALE); @@ -118,9 +126,6 @@ { int w, h; - PangoFontDescription *font = pango_context_get_font_description (context); - pango_font_description_set_absolute_size (font, self->base_height * PANGO_SCALE); - layout_get_pixel_size (self, &w, &h); EXTEND (SP, 2);