Fix: GetDefaultFontHeight() is static, don't use ->
This commit is contained in:

committed by
Tyler Trahan

parent
888c9172e0
commit
8599041ce4
@@ -65,14 +65,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 = ScaleGUITrad(this->GetDefaultFontHeight(this->fs));
|
||||
int scaled_height = ScaleGUITrad(FontCache::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 - ScaleGUITrad(this->GetDefaultFontHeight(FS_SMALL));
|
||||
int diff = scaled_height - ScaleGUITrad(FontCache::GetDefaultFontHeight(FS_SMALL));
|
||||
/* Clamp() is not used as scaled_height could be greater than MAX_FONT_SIZE, which is not permitted in Clamp(). */
|
||||
pixels = std::min(std::max(std::min<int>(head->Lowest_Rec_PPEM, MAX_FONT_MIN_REC_SIZE) + diff, scaled_height), MAX_FONT_SIZE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user