summaryrefslogtreecommitdiff
path: root/src/fontcache.cpp
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2021-05-01 08:48:29 +0100
committerPeterN <peter@fuzzle.org>2021-05-01 10:41:39 +0100
commitce55cd0ce703acb3a731f7d2d783fb3462fab6c8 (patch)
tree37620ff323e8874ad3ccc9f270a36013950afd60 /src/fontcache.cpp
parent49aa3924404615269986e7040455827fe7263001 (diff)
downloadopenttd-ce55cd0ce703acb3a731f7d2d783fb3462fab6c8.tar.xz
Cleanup: Use GetDefaultFontHeight() call instead of direct access.
This makes this part of font size setup in FreeTypeFontCache consist with OSX and Windows variants.
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r--src/fontcache.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index d450deaca..1290777c0 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -428,14 +428,14 @@ void FreeTypeFontCache::SetFontSize(FontSize fs, FT_Face face, int pixels)
{
if (pixels == 0) {
/* Try to determine a good height based on the minimal height recommended by the font. */
- int scaled_height = ScaleFontTrad(_default_font_height[this->fs]);
+ int scaled_height = ScaleFontTrad(this->GetDefaultFontHeight(this->fs));
pixels = scaled_height;
TT_Header *head = (TT_Header *)FT_Get_Sfnt_Table(this->face, ft_sfnt_head);
if (head != nullptr) {
/* Font height is minimum height plus the difference between the default
* height for this font size and the small size. */
- int diff = scaled_height - ScaleFontTrad(_default_font_height[FS_SMALL]);
+ int diff = scaled_height - ScaleFontTrad(this->GetDefaultFontHeight(FS_SMALL));
pixels = Clamp(std::min<uint>(head->Lowest_Rec_PPEM, MAX_FONT_MIN_REC_SIZE) + diff, scaled_height, MAX_FONT_SIZE);
}
} else {