ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/Client.xs
(Generate patch)

Comparing deliantra/Deliantra-Client/Client.xs (file contents):
Revision 1.104 by root, Mon Jun 5 00:17:47 2006 UTC vs.
Revision 1.107 by root, Mon Jun 5 05:23:19 2006 UTC

418} 418}
419 419
420void 420void
421pango_init () 421pango_init ()
422 CODE: 422 CODE:
423{
424 // delayed, so it can pick up new fonts added by AddFontResourceEx 423 // delayed, so it can pick up new fonts added by AddFontResourceEx
424{
425 {
425 ft2_fontmap = pango_ft2_font_map_new (); 426 ft2_fontmap = pango_ft2_font_map_new ();
426 pango_ft2_font_map_set_default_substitute ((PangoFT2FontMap *)ft2_fontmap, substitute_func, 0, 0); 427 pango_ft2_font_map_set_default_substitute ((PangoFT2FontMap *)ft2_fontmap, substitute_func, 0, 0);
427 ft2_context = pango_ft2_font_map_create_context ((PangoFT2FontMap *)ft2_fontmap); 428 ft2_context = pango_ft2_font_map_create_context ((PangoFT2FontMap *)ft2_fontmap);
428 429 }
430 {
431 cairo_font_options_t *fopt = cairo_font_options_create ();
429 cairo_fontmap = pango_cairo_font_map_get_default (); 432 cairo_fontmap = pango_cairo_font_map_get_default ();
430 cairo_context = pango_cairo_font_map_create_context ((PangoCairoFontMap *)cairo_fontmap); 433 cairo_context = pango_cairo_font_map_create_context ((PangoCairoFontMap *)cairo_fontmap);
434#ifdef _WIN32
435 // cairo looks like shit eaten twice on windows
436 cairo_font_options_set_antialias (fopt, CAIRO_ANTIALIAS_NONE);
437#else
438 cairo_font_options_set_antialias (fopt, CAIRO_ANTIALIAS_GRAY);
439#endif
440 cairo_font_options_set_hint_style (fopt, CAIRO_HINT_STYLE_FULL);
441 cairo_font_options_set_hint_metrics (fopt, CAIRO_HINT_METRICS_ON);
442 pango_cairo_context_set_font_options (cairo_context, fopt);
443 cairo_font_options_destroy (fopt);
444 }
431} 445}
432 446
433int 447int
434SDL_Init (U32 flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO) 448SDL_Init (U32 flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO)
435 449
717MODULE = CFClient PACKAGE = CFClient::Layout 731MODULE = CFClient PACKAGE = CFClient::Layout
718 732
719CFClient::Layout 733CFClient::Layout
720new (SV *class, int rgba = 0) 734new (SV *class, int rgba = 0)
721 CODE: 735 CODE:
722#if _WIN32
723 //rgba = 0;//D makes text nicer, breaks TextView
724#endif
725 rgba=1;//D
726 New (0, RETVAL, 1, struct cf_layout); 736 New (0, RETVAL, 1, struct cf_layout);
727 737
728 RETVAL->pl = pango_layout_new (rgba ? cairo_context : ft2_context); 738 RETVAL->pl = pango_layout_new (rgba ? cairo_context : ft2_context);
729 RETVAL->rgba = rgba; 739 RETVAL->rgba = rgba;
730 RETVAL->r = 1.; 740 RETVAL->r = 1.;
774 784
775SV * 785SV *
776get_text (CFClient::Layout self) 786get_text (CFClient::Layout self)
777 CODE: 787 CODE:
778 RETVAL = newSVpv (pango_layout_get_text (self->pl), 0); 788 RETVAL = newSVpv (pango_layout_get_text (self->pl), 0);
779 SvUTF8_on (RETVAL); 789 sv_utf8_decode (RETVAL);
780 OUTPUT: 790 OUTPUT:
781 RETVAL 791 RETVAL
782 792
783void 793void
784set_foreground (CFClient::Layout self, float r, float g, float b, float a = 1.) 794set_foreground (CFClient::Layout self, float r, float g, float b, float a = 1.)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines