2017-01-05 16:07:20 +01:00
|
|
|
#ifndef FONTS_H
|
|
|
|
#define FONTS_H
|
|
|
|
|
2017-01-11 01:08:20 +01:00
|
|
|
#include <QFont>
|
|
|
|
#include <QFontMetrics>
|
2017-01-05 16:07:20 +01:00
|
|
|
|
2017-01-18 21:30:23 +01:00
|
|
|
namespace chatterino {
|
|
|
|
|
2017-01-05 16:07:20 +01:00
|
|
|
class Fonts
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum Type : char {
|
|
|
|
Medium,
|
|
|
|
MediumBold,
|
|
|
|
MediumItalic,
|
|
|
|
Small,
|
|
|
|
Large,
|
|
|
|
VeryLarge
|
|
|
|
};
|
|
|
|
|
2017-01-11 18:52:09 +01:00
|
|
|
static QFont &getFont(Type type);
|
|
|
|
static QFontMetrics &getFontMetrics(Type type);
|
2017-01-05 16:07:20 +01:00
|
|
|
|
2017-01-15 16:38:30 +01:00
|
|
|
static int
|
2017-01-18 04:33:30 +01:00
|
|
|
getGeneration()
|
2017-01-15 16:38:30 +01:00
|
|
|
{
|
2017-01-18 04:33:30 +01:00
|
|
|
return generation;
|
2017-01-15 16:38:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
incGeneration()
|
|
|
|
{
|
2017-01-18 04:33:30 +01:00
|
|
|
generation++;
|
2017-01-15 16:38:30 +01:00
|
|
|
}
|
|
|
|
|
2017-01-05 16:07:20 +01:00
|
|
|
private:
|
|
|
|
Fonts();
|
|
|
|
|
2017-01-11 18:52:09 +01:00
|
|
|
static QFont *medium;
|
|
|
|
static QFont *mediumBold;
|
|
|
|
static QFont *mediumItalic;
|
|
|
|
static QFont *small;
|
|
|
|
static QFont *large;
|
|
|
|
static QFont *veryLarge;
|
2017-01-11 01:08:20 +01:00
|
|
|
|
2017-01-11 18:52:09 +01:00
|
|
|
static QFontMetrics *metricsMedium;
|
|
|
|
static QFontMetrics *metricsMediumBold;
|
|
|
|
static QFontMetrics *metricsMediumItalic;
|
|
|
|
static QFontMetrics *metricsSmall;
|
|
|
|
static QFontMetrics *metricsLarge;
|
|
|
|
static QFontMetrics *metricsVeryLarge;
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-01-18 04:33:30 +01:00
|
|
|
static int generation;
|
2017-01-05 16:07:20 +01:00
|
|
|
};
|
2017-01-18 21:30:23 +01:00
|
|
|
}
|
2017-01-05 16:07:20 +01:00
|
|
|
|
2017-01-11 18:52:09 +01:00
|
|
|
#endif // FONTS_H
|