mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 13:28:03 +02:00
ft: Report FILE_NOT_FOUND if creating a font with a specified nonexistent file
If the FcPattern used to create a font specifies an exact file to use and it does not exist we will fail much later with an ambiguous NO_MEMORY error. As suggested by Behdad Esfahbod we should report this back to the user so that they can take the appropriate action rather than providing an automatic fallback. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
ee7f560719
commit
a7d505d40f
1 changed files with 2 additions and 1 deletions
|
|
@ -564,7 +564,8 @@ _cairo_ft_unscaled_font_create_for_pattern (FcPattern *pattern,
|
|||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
|
||||
goto DONE;
|
||||
}
|
||||
} else
|
||||
return _cairo_error (CAIRO_STATUS_FILE_NOT_FOUND);
|
||||
}
|
||||
|
||||
/* The pattern contains neither a face nor a filename, resolve it later. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue