--- deliantra/Deliantra-Client/Client.xs 2006/06/05 03:33:09 1.105 +++ deliantra/Deliantra-Client/Client.xs 2006/06/12 14:55:41 1.112 @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -87,9 +88,15 @@ static void substitute_func (FcPattern *pattern, gpointer data) { - FcPatternAddBool (pattern, FC_HINTING , 1); - //FcPatternAddBool (pattern, FC_AUTOHINT, 1); + FcPatternAddBool (pattern, FC_HINTING, 1); +#ifdef FC_HINT_STYLE + FcPatternAddBool (pattern, FC_HINT_STYLE, FC_HINT_FULL); +#endif +#ifdef _WIN32 + FcPatternAddBool (pattern, FC_AUTOHINT, 1); +#else FcPatternAddBool (pattern, FC_AUTOHINT, 0); +#endif } static void @@ -424,12 +431,16 @@ pango_ft2_font_map_set_default_substitute ((PangoFT2FontMap *)ft2_fontmap, substitute_func, 0, 0); ft2_context = pango_ft2_font_map_create_context ((PangoFT2FontMap *)ft2_fontmap); } - { cairo_font_options_t *fopt = cairo_font_options_create (); cairo_fontmap = pango_cairo_font_map_get_default (); cairo_context = pango_cairo_font_map_create_context ((PangoCairoFontMap *)cairo_fontmap); +#ifdef _WIN32 + // cairo looks like shit eaten twice on windows + cairo_font_options_set_antialias (fopt, CAIRO_ANTIALIAS_NONE); +#else cairo_font_options_set_antialias (fopt, CAIRO_ANTIALIAS_GRAY); +#endif cairo_font_options_set_hint_style (fopt, CAIRO_HINT_STYLE_FULL); cairo_font_options_set_hint_metrics (fopt, CAIRO_HINT_METRICS_ON); pango_cairo_context_set_font_options (cairo_context, fopt); @@ -695,7 +706,12 @@ #ifdef _WIN32 MessageBox (0, message, "Crossfire+ Fatal Error", MB_OK | MB_ICONERROR); #endif - exit (1); + _exit (1); + +void +_exit (int retval) + CODE: + _exit (retval); MODULE = CFClient PACKAGE = CFClient::Font @@ -726,10 +742,6 @@ CFClient::Layout new (SV *class, int rgba = 0) CODE: -#if _WIN32 - //rgba = 0;//D makes text nicer, breaks TextView -#endif - rgba=1;//D New (0, RETVAL, 1, struct cf_layout); RETVAL->pl = pango_layout_new (rgba ? cairo_context : ft2_context); @@ -783,7 +795,7 @@ get_text (CFClient::Layout self) CODE: RETVAL = newSVpv (pango_layout_get_text (self->pl), 0); - SvUTF8_on (RETVAL); + sv_utf8_decode (RETVAL); OUTPUT: RETVAL @@ -1049,6 +1061,7 @@ { map_clear (self); Safefree (self->face); + Safefree (self->tex); Safefree (self); }