3 * \file NoGuiFontMetrics.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Abdelrazak Younes
9 * Full author contact details are available in file CREDITS.
12 #ifndef LYX_NO_GUI_FONT_METRICS_H
13 #define LYX_NO_GUI_FONT_METRICS_H
15 #include "frontends/FontMetrics.h"
17 #include "support/docstring.h"
22 class NoGuiFontMetrics: public FontMetrics
28 virtual ~NoGuiFontMetrics() {}
30 virtual int maxAscent() const { return 1; }
32 virtual int maxDescent() const { return 1; }
34 virtual int ascent(lyx::char_type) const { return 1; }
36 int descent(lyx::char_type) const { return 1; }
38 virtual int lbearing(lyx::char_type) const { return 1; }
40 virtual int rbearing(lyx::char_type) const { return 1; }
42 virtual int width(lyx::char_type const *, size_t n) const { return n; }
44 virtual int signedWidth(lyx::docstring const & s) const
47 return -FontMetrics::width(s.substr(1, s.length() - 1));
49 return FontMetrics::width(s);
52 virtual void rectText(lyx::docstring const &,
55 int & descent) const {};
57 virtual void buttonText(lyx::docstring const &,
60 int & descent) const {};
63 } // namespace frontend
66 #endif // LYX_NO_GUI_FONT_METRICS_H