diff --git a/interface/src/ui/overlays/TextOverlay.cpp b/interface/src/ui/overlays/TextOverlay.cpp index ccad3bd295..3f033d9266 100644 --- a/interface/src/ui/overlays/TextOverlay.cpp +++ b/interface/src/ui/overlays/TextOverlay.cpp @@ -170,3 +170,11 @@ QSizeF TextOverlay::textSize(const QString& text) const { return QSizeF(extents.x, extents.y); } + +void TextOverlay::setFontSize(int fontSize) { + _fontSize = fontSize; + + auto oldTextRenderer = _textRenderer; + _textRenderer = TextRenderer::getInstance(SANS_FONT_FAMILY, _fontSize, DEFAULT_FONT_WEIGHT); + delete oldTextRenderer; +} diff --git a/interface/src/ui/overlays/TextOverlay.h b/interface/src/ui/overlays/TextOverlay.h index de2597cf9a..32786c3220 100644 --- a/interface/src/ui/overlays/TextOverlay.h +++ b/interface/src/ui/overlays/TextOverlay.h @@ -48,7 +48,7 @@ public: void setText(const QString& text) { _text = text; } void setLeftMargin(int margin) { _leftMargin = margin; } void setTopMargin(int margin) { _topMargin = margin; } - void setFontSize(int fontSize) { _fontSize = fontSize; } + void setFontSize(int fontSize); virtual void setProperties(const QScriptValue& properties); virtual TextOverlay* createClone() const;