mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-06 13:48:22 +02:00
label-freetype: fix fallback not working when fc-match isn't available
The new font loading functions introduced in544e62ac41assume that popen() returns NULL when fc-match is unavailable or fails. This is incorrect, since popen() will always start a shell to run the passed command and return a stream to that shell's stdin and stdout. This results in an non-null but empty font name being passed to FT_New_Face(), which fails. This commit fixes this by also using the fallback font when the font path read from the popen() stream is empty. Fixes #239 Fixes regression caused by544e62ac41
This commit is contained in:
parent
18590a2159
commit
792fe7474a
1 changed files with 6 additions and 0 deletions
|
|
@ -135,6 +135,9 @@ find_default_font_path (void)
|
|||
|
||||
pclose (fp);
|
||||
|
||||
if (strcmp (fc_match_out, "") == 0)
|
||||
return FONT_FALLBACK;
|
||||
|
||||
return fc_match_out;
|
||||
}
|
||||
|
||||
|
|
@ -152,6 +155,9 @@ find_default_monospace_font_path (void)
|
|||
|
||||
pclose (fp);
|
||||
|
||||
if (strcmp (fc_match_out, "") == 0)
|
||||
return FONT_FALLBACK;
|
||||
|
||||
return fc_match_out;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue