- /* Leave a little more slack */
- overall.lbearing -= (bw * 2);
- overall.rbearing += (bw * 2);
- overall.ascent += (bw * 2);
- overall.descent += (bw * 2);
-
- w->width = overall.rbearing - overall.lbearing + bw + bw;
- w->height = overall.ascent + overall.descent + bw + bw;
+ /* Leave a little more slack. Not entirely clear on what's going on here,
+ but maybe it's fonts with goofy metrics. */
+ slack = (overall.ascent + overall.descent) * 0.25;
+ if (slack < bw*2) slack = bw*2;
+ overall.lbearing -= slack;
+ overall.rbearing += slack;
+ overall.ascent += slack;
+ overall.descent += slack;
+
+ w->width = overall.rbearing - overall.lbearing;
+ w->height = overall.ascent + overall.descent;