X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffont.h;h=eb4b71ca2a5d73160aefde574ff9b6f76cd8a6b9;hb=98c966c64594611e469313314abd1e59524adb4a;hp=95a55951514e7a88ee6c9d7745368c8565f950e3;hpb=d705c75da9d67b3a99c09f1c935958cbed06be59;p=lyx.git diff --git a/src/font.h b/src/font.h index 95a5595151..eb4b71ca2a 100644 --- a/src/font.h +++ b/src/font.h @@ -1,11 +1,11 @@ // -*- C++ -*- /* This file is part of - * ====================================================== - * + * ====================================================== + * * LyX, The Document Processor - * + * * Copyright 1995 Matthias Ettrich - * Copyright 1995-2000 The LyX Team. + * Copyright 1995-2001 The LyX Team. * * ====================================================== */ @@ -56,13 +56,13 @@ struct lyxfont { static int width(string const & s, LyXFont const & f) { if (s.empty()) return 0; - return width(s.c_str(), s.length(), f); + return width(s.data(), s.length(), f); } /// - static - int width(char const * s, LyXFont const & f) { - return width(s, strlen(s), f); - } + //static + //int width(char const * s, LyXFont const & f) { + // return width(s, strlen(s), f); + //} /// static int signedWidth(string const & s, LyXFont const & f); @@ -78,6 +78,15 @@ struct lyxfont { /// static void XSetFont(Display * display, GC gc, LyXFont const & f); + // A couple of more high-level metrics + /// + static + void rectText(string const & str, LyXFont const & font, + int & width, int & ascent, int & descent); + /// + static + void buttonText(string const & str, LyXFont const & font, + int & width, int & ascent, int & descent); }; //} // end of namespace font