Add comment about building in a font.

Check for NULL return value from cairo_ft_font_create.
This commit is contained in:
Carl Worth 2003-12-12 12:00:50 +00:00
parent e232072c12
commit 2309a8b98a
5 changed files with 24 additions and 0 deletions

View file

@ -1,5 +1,11 @@
2003-12-12 Carl Worth <cworth@east.isi.edu>
* src/cairo_font.c (_cairo_font_create): Add comment about
building in a font.
* src/cairo_ft_font.c (_cairo_ft_font_create): Check for NULL
return value from cairo_ft_font_create.
* src/cairo.h:
* src/cairo-features.h.in:
* src/Makefile.am (libcairo_ps_sources): Add conditionals for

View file

@ -34,6 +34,12 @@ _cairo_font_create (const char *family,
{
const struct cairo_font_backend *backend = CAIRO_FONT_BACKEND_DEFAULT;
/* XXX: The current freetype backend may return NULL, (for example
* if no fonts are installed), but I would like to guarantee that
* the toy API always returns at least *some* font, so I would
* like to build in some sort fo font here, (even a really lame,
* ugly one if necessary). */
return backend->create (family, slant, weight);
}

View file

@ -175,6 +175,9 @@ _cairo_ft_font_create (const char *family,
}
font = cairo_ft_font_create (ft_library, pat);
if (font == NULL)
return NULL;
ft_font = (cairo_ft_font_t *) font;
ft_font->owns_ft_library = 1;

View file

@ -34,6 +34,12 @@ _cairo_font_create (const char *family,
{
const struct cairo_font_backend *backend = CAIRO_FONT_BACKEND_DEFAULT;
/* XXX: The current freetype backend may return NULL, (for example
* if no fonts are installed), but I would like to guarantee that
* the toy API always returns at least *some* font, so I would
* like to build in some sort fo font here, (even a really lame,
* ugly one if necessary). */
return backend->create (family, slant, weight);
}

View file

@ -175,6 +175,9 @@ _cairo_ft_font_create (const char *family,
}
font = cairo_ft_font_create (ft_library, pat);
if (font == NULL)
return NULL;
ft_font = (cairo_ft_font_t *) font;
ft_font->owns_ft_library = 1;