]> git.lyx.org Git - lyx.git/blobdiff - src/font.C
Remove unused font variable which caused a warning.
[lyx.git] / src / font.C
index 65e2b427665992486acba1ed41f683d6b117e32e..ef93daa5f91e623baba57cf6d243ff588e5ba143 100644 (file)
@@ -186,7 +186,7 @@ int lyxfont::width(XChar2b const * s, int n, LyXFont const & f)
                                result += ::XTextWidth16(getXFontstruct(smallfont), &c, 1);
                        } else {
                                result += ::XTextWidth16(getXFontstruct(f), &s[i], 1);
-                       }
+               }
                }
                return result;
        }
@@ -209,5 +209,28 @@ void lyxfont::XSetFont(Display * display, GC gc, LyXFont const & f)
        ::XSetFont(display, gc, getFontID(f));
 }
 
+
+void lyxfont::rectText(string const & str, LyXFont const & font,
+             int & width, int & ascent, int & descent)
+{
+       static int const d = 2;
+       width = lyxfont::width(str, font) + d * 2 + 2;
+       ascent = lyxfont::maxAscent(font) + d;
+       descent = lyxfont::maxDescent(font) + d;
+}
+
+
+
+void lyxfont::buttonText(string const & str, LyXFont const & font,
+               int & width, int & ascent, int & descent)
+{
+       static int const d = 3;
+       
+       width = lyxfont::width(str, font) + d * 2 + 2;
+       ascent = lyxfont::maxAscent(font) + d;
+       descent = lyxfont::maxDescent(font) + d;
+}
+
+
 //} // end of namespace font
 //} // end of namespace lyx