From f89393fd6244e38ff4abed1f7a317d29599dc453 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 2 Sep 2018 18:08:49 +0400 Subject: [PATCH] Validate 'ttf resolution' option value --- apps/openmw/mwgui/windowmanagerimp.cpp | 2 +- docs/source/reference/modding/settings/GUI.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 493a14a1cb..03cbc3ef2a 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -309,7 +309,7 @@ namespace MWGui // to allow to configure font size via config file, without need to edit XML file. // Also we should take UI scaling factor in account int resolution = Settings::Manager::getInt("ttf resolution", "GUI"); - resolution = std::max(0, resolution); + resolution = std::min(960, std::max(48, resolution)); float uiScale = Settings::Manager::getFloat("scaling factor", "GUI"); diff --git a/docs/source/reference/modding/settings/GUI.rst b/docs/source/reference/modding/settings/GUI.rst index 3fe943b6f6..2092096c93 100644 --- a/docs/source/reference/modding/settings/GUI.rst +++ b/docs/source/reference/modding/settings/GUI.rst @@ -27,7 +27,7 @@ ttf resolution -------------- :Type: integer -:Range: > 0 +:Range: 48 to 960 :Default: 96 Allows to specify resolution for in-game TrueType fonts.