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.18 by root, Tue Apr 11 19:31:17 2006 UTC vs.
Revision 1.19 by root, Tue Apr 11 22:49:13 2006 UTC

23 PangoLayout *pl; 23 PangoLayout *pl;
24 int base_height; 24 int base_height;
25} *CFClient__Layout; 25} *CFClient__Layout;
26 26
27static void 27static void
28substitute_func (FcPattern *pattern, gpointer data)
29{
30 //FcPatternAddBool (pattern, FC_HINTING, 1);
31 //FcPatternAddBool (pattern, FC_AUTOHINT, 1);
32}
33
34static void
28layout_update (CFClient__Layout self) 35layout_update (CFClient__Layout self)
29{ 36{
37 /* use a random scale factor to account for unknown descenders, 0.8 works
38 * reasonably well with bitstream vera
39 */
30 PangoFontDescription *font = pango_context_get_font_description (context); 40 PangoFontDescription *font = pango_context_get_font_description (context);
31 pango_font_description_set_absolute_size (font, self->base_height * PANGO_SCALE); 41 pango_font_description_set_absolute_size (font, self->base_height * (PANGO_SCALE * 8 / 10));
32} 42}
33 43
34static void 44static void
35layout_get_pixel_size (CFClient__Layout self, int *w, int *h) 45layout_get_pixel_size (CFClient__Layout self, int *w, int *h)
36{ 46{
37 PangoFontDescription *font = pango_context_get_font_description (context); 47 layout_update (self);
38 pango_font_description_set_absolute_size (font, self->base_height * PANGO_SCALE);
39 48
40 pango_layout_get_pixel_size (self->pl, w, h); 49 pango_layout_get_pixel_size (self->pl, w, h);
41 50
42 *w = (*w + 3) & ~3; 51 *w = (*w + 3) & ~3;
43 if (!*w) *w = 1; 52 if (!*w) *w = 1;
49PROTOTYPES: ENABLE 58PROTOTYPES: ENABLE
50 59
51BOOT: 60BOOT:
52{ 61{
53 fontmap = pango_ft2_font_map_new (); 62 fontmap = pango_ft2_font_map_new ();
63 pango_ft2_font_map_set_default_substitute ((PangoFT2FontMap *)fontmap, substitute_func, 0, 0);
54 context = pango_ft2_font_map_create_context ((PangoFT2FontMap *)fontmap); 64 context = pango_ft2_font_map_create_context ((PangoFT2FontMap *)fontmap);
55} 65}
56 66
57void 67void
58lowdelay (int fd, int val = 1) 68lowdelay (int fd, int val = 1)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines