--- deliantra/Deliantra-Client/Client.xs 2006/04/11 17:02:35 1.17 +++ deliantra/Deliantra-Client/Client.xs 2006/04/12 18:09:21 1.21 @@ -25,17 +25,26 @@ } *CFClient__Layout; static void +substitute_func (FcPattern *pattern, gpointer data) +{ + FcPatternAddBool (pattern, FC_HINTING , 1); + FcPatternAddBool (pattern, FC_AUTOHINT, 1); +} + +static void layout_update (CFClient__Layout self) { + /* use a random scale factor to account for unknown descenders, 0.8 works + * reasonably well with bitstream vera + */ PangoFontDescription *font = pango_context_get_font_description (context); - pango_font_description_set_absolute_size (font, self->base_height * PANGO_SCALE); + pango_font_description_set_absolute_size (font, self->base_height * (PANGO_SCALE * 8 / 10)); } 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); + layout_update (self); pango_layout_get_pixel_size (self->pl, w, h); @@ -51,6 +60,7 @@ BOOT: { fontmap = pango_ft2_font_map_new (); + pango_ft2_font_map_set_default_substitute ((PangoFT2FontMap *)fontmap, substitute_func, 0, 0); context = pango_ft2_font_map_create_context ((PangoFT2FontMap *)fontmap); } @@ -89,6 +99,12 @@ pango_context_set_font_description (context, font); } +void +wait_events (SV *rfd_, SV *wfd_) + PPCODE: +{ +} + MODULE = CFClient PACKAGE = CFClient::Layout CFClient::Layout @@ -214,8 +230,8 @@ if (items < 5) { - w = SvNV (*hv_fetch (hv, "width", 5, 1)); - h = SvNV (*hv_fetch (hv, "height", 6, 1)); + w = SvNV (*hv_fetch (hv, "w", 1, 1)); + h = SvNV (*hv_fetch (hv, "h", 1, 1)); } glBindTexture (GL_TEXTURE_2D, name);