mirror of
https://github.com/tiennm99/godot.git
synced 2026-08-09 06:23:04 +00:00
[TextServer] Add invalid font scaling check, restrict Linux/BSD system fonts lookup to TrueType/CFF only.
(cherry picked from commit 8d501a2dc3)
This commit is contained in:
@@ -1386,7 +1386,9 @@ _FORCE_INLINE_ bool TextServerAdvanced::_ensure_cache_for_size(FontAdvanced *p_f
|
||||
FT_Select_Size(fd->face, best_match);
|
||||
} else {
|
||||
FT_Set_Pixel_Sizes(fd->face, 0, double(fd->size.x * fd->oversampling));
|
||||
fd->scale = ((double)fd->size.x * fd->oversampling) / (double)fd->face->size->metrics.y_ppem;
|
||||
if (fd->face->size->metrics.y_ppem != 0) {
|
||||
fd->scale = ((double)fd->size.x * fd->oversampling) / (double)fd->face->size->metrics.y_ppem;
|
||||
}
|
||||
}
|
||||
|
||||
fd->hb_handle = hb_ft_font_create(fd->face, nullptr);
|
||||
|
||||
Reference in New Issue
Block a user