Showing the changes to interface/src/ui/TextRenderer.cpp (1 of 1 file). Show all
Unified · Split
| @@ -30,7 +30,7 @@ Glyph::Glyph(int textureID, const QPoint& location, const QRect& bounds, int wid · 29 unmodified lines | |||
| 30 | 30 | ||
| 31 | TextRenderer::TextRenderer(const char* family, int pointSize, int weight, bool italic, | 31 | TextRenderer::TextRenderer(const char* family, int pointSize, int weight, bool italic, |
| 32 | EffectType effectType, int effectThickness, QColor color) : | 32 | EffectType effectType, int effectThickness, QColor color) : |
| 33 | _font(family, pointSize * QApplication::desktop()->windowHandle()->devicePixelRatio(), weight, italic), | 33 | _font(family, pointSize, weight, italic), |
| 34 | _metrics(_font), | 34 | _metrics(_font), |
| 35 | _effectType(effectType), | 35 | _effectType(effectType), |
| 36 | _effectThickness(effectThickness), | 36 | _effectThickness(effectThickness), |
| @@ -40,6 +40,12 @@ TextRenderer::TextRenderer(const char* family, int pointSize, int weight, bool i · 3 unmodified lines | |||
| 40 | _color(color) { | 40 | _color(color) { |
| 41 | 41 | ||
| 42 | _font.setKerning(false); | 42 | _font.setKerning(false); |
| 43 | |||
| 44 | // double the font size for "Retina" displays | ||
| 45 | float ratio = QApplication::desktop()->windowHandle()->devicePixelRatio(); | ||
| 46 | if (ratio != 1.0f) { | ||
| 47 | _font.setPointSize(_font.pointSize() * ratio); | ||
| 48 | } | ||
| 43 | } | 49 | } |
| 44 | 50 | ||
| 45 | TextRenderer::~TextRenderer() { | 51 | TextRenderer::~TextRenderer() { |