mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 20:35:42 +02:00
font: use FT_Set_Pixel_Sizes() instead of FT_Set_Char_Size()
And bail out if we fail
This commit is contained in:
parent
feddc19b36
commit
7e8617f090
1 changed files with 8 additions and 2 deletions
10
font.c
10
font.c
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue