From f60cea793528807251f8ff8393dec7f5d28ffc30 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Mon, 8 Sep 2014 12:10:53 -0700 Subject: [PATCH] Double the point size on "Retina" displays. --- interface/src/ui/TextRenderer.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/interface/src/ui/TextRenderer.cpp b/interface/src/ui/TextRenderer.cpp index 18279d3914..5e7666594a 100644 --- a/interface/src/ui/TextRenderer.cpp +++ b/interface/src/ui/TextRenderer.cpp @@ -9,11 +9,14 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#include +#include #include #include #include #include #include +#include #include "InterfaceConfig.h" #include "TextRenderer.h" @@ -25,10 +28,17 @@ Glyph::Glyph(int textureID, const QPoint& location, const QRect& bounds, int wid _textureID(textureID), _location(location), _bounds(bounds), _width(width) { } -TextRenderer::TextRenderer(const char* family, int pointSize, int weight, - bool italic, EffectType effectType, int effectThickness, QColor color) - : _font(family, pointSize, weight, italic), _metrics(_font), _effectType(effectType), - _effectThickness(effectThickness), _x(IMAGE_SIZE), _y(IMAGE_SIZE), _rowHeight(0), _color(color) { +TextRenderer::TextRenderer(const char* family, int pointSize, int weight, bool italic, + EffectType effectType, int effectThickness, QColor color) : + _font(family, pointSize * QApplication::desktop()->windowHandle()->devicePixelRatio(), weight, italic), + _metrics(_font), + _effectType(effectType), + _effectThickness(effectThickness), + _x(IMAGE_SIZE), + _y(IMAGE_SIZE), + _rowHeight(0), + _color(color) { + _font.setKerning(false); }