mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 07:38:22 +02:00
Add comment about building in a font.
Check for NULL return value from cairo_ft_font_create.
This commit is contained in:
parent
e232072c12
commit
2309a8b98a
5 changed files with 24 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue