font: use FT_Set_Pixel_Sizes() instead of FT_Set_Char_Size()

Since we're working with pixel sizes anyway...
This commit is contained in:
Daniel Eklöf 2019-11-25 20:14:48 +01:00
parent 36ed308723
commit a277eaeb31
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

10
font.c
View file

@ -142,8 +142,14 @@ from_font_set(FcPattern *pattern, FcFontSet *fonts, int start_idx,
if (ft_err != 0)
LOG_ERR("%s: failed to create FreeType face", face_file);
if ((ft_err = FT_Set_Char_Size(ft_face, size * 64, 0, 0, 0)) != 0)
LOG_WARN("failed to set character size");
if ((ft_err = FT_Set_Pixel_Sizes(ft_face, 0, size)) != 0) {
LOG_WARN("%s: failed to set character size", face_file);
mtx_lock(&ft_lock);
FT_Done_Face(ft_face);
mtx_unlock(&ft_lock);
FcPatternDestroy(final_pattern);
return false;
}
FcBool fc_hinting;
if (FcPatternGetBool(final_pattern, FC_HINTING,0, &fc_hinting) != FcResultMatch)