--- deliantra/Deliantra-Client/Client.xs 2006/06/04 23:05:05 1.103 +++ deliantra/Deliantra-Client/Client.xs 2006/06/05 03:48:49 1.106 @@ -420,14 +420,28 @@ void pango_init () CODE: -{ // delayed, so it can pick up new fonts added by AddFontResourceEx - ft2_fontmap = pango_ft2_font_map_new (); - 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_fontmap = pango_cairo_font_map_get_default (); - cairo_context = pango_cairo_font_map_create_context ((PangoCairoFontMap *)cairo_fontmap); +{ + { + ft2_fontmap = pango_ft2_font_map_new (); + 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); + cairo_font_options_destroy (fopt); + } } int @@ -719,9 +733,6 @@ CFClient::Layout new (SV *class, int rgba = 0) CODE: -#if _WIN32 - //rgba = 0;//D makes text nicer, breaks TextView -#endif New (0, RETVAL, 1, struct cf_layout); RETVAL->pl = pango_layout_new (rgba ? cairo_context : ft2_context); @@ -992,7 +1003,7 @@ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); else gl_BlendFuncSeparate (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, - GL_ONE_MINUS_DST_ALPHA, GL_ONE); + GL_ONE , GL_ONE_MINUS_SRC_ALPHA); glEnable (GL_ALPHA_TEST); glAlphaFunc (GL_GREATER, 0.01f); @@ -1559,9 +1570,10 @@ const_iv (GL_ONE), const_iv (GL_ZERO), const_iv (GL_SRC_ALPHA), - const_iv (GL_SRC_ALPHA_SATURATE), + const_iv (GL_DST_ALPHA), const_iv (GL_ONE_MINUS_SRC_ALPHA), const_iv (GL_ONE_MINUS_DST_ALPHA), + const_iv (GL_SRC_ALPHA_SATURATE), const_iv (GL_RGB), const_iv (GL_RGBA), const_iv (GL_UNSIGNED_BYTE),