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:
Chris Wilson 2012-08-20 16:43:28 +01:00
parent ee7f560719
commit a7d505d40f

View file

@ -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. */