[cairo-commit] cairo/src cairo_font.c,1.15,1.16 cairo_ft_font.c,1.8,1.9

Carl Worth commit at pdx.freedesktop.org
Fri Dec 12 12:00:52 PST 2003


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory pdx:/tmp/cvs-serv9804/src

Modified Files:
	cairo_font.c cairo_ft_font.c 
Log Message:

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


Index: cairo_font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_font.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** cairo_font.c	11 Dec 2003 19:12:59 -0000	1.15
--- cairo_font.c	12 Dec 2003 20:00:50 -0000	1.16
***************
*** 35,38 ****
--- 35,44 ----
      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);
  }

Index: cairo_ft_font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_ft_font.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** cairo_ft_font.c	11 Dec 2003 19:12:59 -0000	1.8
--- cairo_ft_font.c	12 Dec 2003 20:00:50 -0000	1.9
***************
*** 176,179 ****
--- 176,182 ----
  
      font = cairo_ft_font_create (ft_library, pat);
+     if (font == NULL)
+ 	return NULL;
+ 
      ft_font = (cairo_ft_font_t *) font;
  





More information about the cairo-commit mailing list