#include <QFontMetrics>
#include <QHash>
-
namespace lyx {
namespace frontend {
{
public:
GuiFontMetrics(QFont const & font);
- GuiFontMetrics(QFont const & font, QFont const & smallcaps_font);
virtual ~GuiFontMetrics() {}
int width(QString const & str) const;
private:
- int smallcapsWidth(char_type c) const;
-
/// Metrics on the font
QFontMetrics metrics_;
- QFontMetrics smallcaps_metrics_;
-
- bool smallcaps_shape_;
/// Cache of char widths
mutable QHash<char_type, int> width_cache_;
struct AscendDescend {
- short int ascent;
- short int descent;
+ int ascent;
+ int descent;
};
/// Cache of char ascends and descends
mutable QHash<char_type, AscendDescend> metrics_cache_;