]> git.lyx.org Git - lyx.git/blobdiff - src/font.C
next step...
[lyx.git] / src / font.C
index 210d10bd60e61a0feccdbd16703736a1a6803b79..c2cb085c084769d93be1a918cbe878d510987dc2 100644 (file)
@@ -114,7 +114,7 @@ int lyxfont::width(char const * s, size_t n, LyXFont const & f)
                Encoding const * encoding = f.language()->encoding();
                //LyXFont const * font = &f;
                LyXFont font(f);
-               if (f.family() == LyXFont::SYMBOL_FAMILY) {
+               if (f.isSymbolFont()) {
 #ifdef USE_UNICODE_FOR_SYMBOLS
                        //LyXFont font2 = f;
                        font.setFamily(LyXFont::ROMAN_FAMILY);
@@ -224,9 +224,11 @@ void lyxfont::rectText(string const & str, LyXFont const & font,
 void lyxfont::buttonText(string const & str, LyXFont const & font,
                int & width, int & ascent, int & descent)
 {
-       width = lyxfont::width(str, font) + 8;
-       ascent = lyxfont::maxAscent(font) + 3;
-       descent = lyxfont::maxDescent(font) + 3;
+       static int const d = 3;
+       
+       width = lyxfont::width(str, font) + d * 2 + 2;
+       ascent = lyxfont::maxAscent(font) + d;
+       descent = lyxfont::maxDescent(font) + d;
 }