1 --- bless-0.4.1/src/gui/drawers/Drawer.cs.orig 2006-09-21 17:31:58.000000000 +0200
2 +++ bless-0.4.1/src/gui/drawers/Drawer.cs 2006-09-21 17:33:33.000000000 +0200
4 Pango.Context pangoCtx=widget.PangoContext;
5 Pango.FontMetrics fm=pangoCtx.GetMetrics(fontDescription, lang);
7 - // set the font height and width
8 - height =(int)( (fm.Ascent+fm.Descent)/Pango.Scale.PangoScale);
9 - width =(int) ((fm.ApproximateCharWidth)/Pango.Scale.PangoScale);
11 - // temporary workaround for font width problem
14 - fontWidthFix = Convert.ToInt32(Preferences.Instance["FontWidthFix"]);
16 - catch (Exception e) {
20 - width += fontWidthFix;
21 + // set the font height and width
23 + Pango.Layout layout = new Pango.Layout(pangoCtx);
24 + layout.FontDescription = fontDescription;
25 + layout.SetText("A"); // check for a single character
26 + layout.GetPixelSize(out width, out height);
29 // create the font pixmaps