font: use FT_Set_Pixel_Sizes() instead of FT_Set_Char_Size()

And bail out if we fail
This commit is contained in:
Daniel Eklöf 2019-11-27 21:40:02 +01:00
parent feddc19b36
commit 7e8617f090
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

10
font.c
View file

@ -201,8 +201,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, pixel_size * 64, 0, 0, 0)) != 0)
LOG_WARN("failed to set character size");
if ((ft_err = FT_Set_Pixel_Sizes(ft_face, 0, pixel_size)) != 0) {
LOG_WARN("failed to set pixel size");
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)