mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-09 08:18:02 +02:00
label-freetype: Fix loading debug message
The freetype plugin was calling printf instead of ply-trace when a font failed to load. Also, it didnt list the failure reason. This commit fixes things up a bit.
This commit is contained in:
parent
b4e01e90c0
commit
0fb9f0c6f1
1 changed files with 5 additions and 3 deletions
|
|
@ -33,6 +33,7 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#include "ply-logger.h"
|
||||
#include "ply-pixel-buffer.h"
|
||||
#include "ply-pixel-display.h"
|
||||
#include "ply-utils.h"
|
||||
|
|
@ -158,11 +159,12 @@ set_font_with_fallback (ply_label_plugin_control_t *label,
|
|||
const char *fallback_font_path)
|
||||
{
|
||||
FT_Error error;
|
||||
if (primary_font_path)
|
||||
if (primary_font_path != NULL)
|
||||
error = FT_New_Face (label->library, primary_font_path, 0, &label->face);
|
||||
|
||||
if (!fallback_font_path || error) {
|
||||
printf ("label-ft: trying font fallback\n");
|
||||
if (fallback_font_path != NULL && error != 0) {
|
||||
ply_trace ("Could not load font '%s', trying fallback font '%s' (error %d)",
|
||||
primary_font_path?: "(unset)", fallback_font_path, (int) error);
|
||||
error = FT_New_Face (label->library, fallback_font_path, 0, &label->face);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue