mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-13 01:10:38 +01:00
svg-font: return SVG_FONT_ERROR on error
This commit is contained in:
parent
2c557d7cea
commit
cbcf962da2
12 changed files with 14 additions and 5 deletions
|
|
@ -405,6 +405,7 @@ _cairo_debug_status_to_string (cairo_int_status_t status)
|
|||
case CAIRO_INT_STATUS_WIN32_GDI_ERROR: return "WIN32_GDI_ERROR";
|
||||
case CAIRO_INT_STATUS_TAG_ERROR: return "TAG_ERROR";
|
||||
case CAIRO_INT_STATUS_DWRITE_ERROR: return "DWRITE_ERROR";
|
||||
case CAIRO_INT_STATUS_SVG_FONT_ERROR: return "SVG_FONT_ERROR";
|
||||
|
||||
case CAIRO_INT_STATUS_LAST_STATUS: return "LAST_STATUS";
|
||||
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@ _cairo_device_create_in_error (cairo_status_t status)
|
|||
case CAIRO_STATUS_WIN32_GDI_ERROR:
|
||||
case CAIRO_STATUS_TAG_ERROR:
|
||||
case CAIRO_STATUS_DWRITE_ERROR:
|
||||
case CAIRO_STATUS_SVG_FONT_ERROR:
|
||||
default:
|
||||
_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
|
||||
return (cairo_device_t *) &_nil_device;
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ enum _cairo_int_status {
|
|||
CAIRO_INT_STATUS_WIN32_GDI_ERROR,
|
||||
CAIRO_INT_STATUS_TAG_ERROR,
|
||||
CAIRO_INT_STATUS_DWRITE_ERROR,
|
||||
CAIRO_INT_STATUS_SVG_FONT_ERROR,
|
||||
|
||||
CAIRO_INT_STATUS_LAST_STATUS,
|
||||
|
||||
|
|
|
|||
|
|
@ -2982,9 +2982,6 @@ _cairo_ft_scaled_glyph_init_record_svg_glyph (cairo_ft_scaled_font_t *scaled_fon
|
|||
palette,
|
||||
num_palette_entries,
|
||||
cr);
|
||||
if (status == CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED)
|
||||
status = CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
status = cairo_status (cr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -176,6 +176,8 @@ cairo_status_to_string (cairo_status_t status)
|
|||
return "invalid tag name, attributes, or nesting";
|
||||
case CAIRO_STATUS_DWRITE_ERROR:
|
||||
return "Window Direct Write error";
|
||||
case CAIRO_STATUS_SVG_FONT_ERROR:
|
||||
return "error occured while rendering an OpenType-SVG font";
|
||||
default:
|
||||
case CAIRO_STATUS_LAST_STATUS:
|
||||
return "<unknown error status>";
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ _cairo_region_create_in_error (cairo_status_t status)
|
|||
case CAIRO_STATUS_WIN32_GDI_ERROR:
|
||||
case CAIRO_STATUS_TAG_ERROR:
|
||||
case CAIRO_STATUS_DWRITE_ERROR:
|
||||
case CAIRO_STATUS_SVG_FONT_ERROR:
|
||||
default:
|
||||
_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
|
||||
return (cairo_region_t *) &_cairo_region_nil;
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ _cairo_scan_converter_create_in_error (cairo_status_t status)
|
|||
case CAIRO_STATUS_WIN32_GDI_ERROR:
|
||||
case CAIRO_STATUS_TAG_ERROR:
|
||||
case CAIRO_STATUS_DWRITE_ERROR:
|
||||
case CAIRO_STATUS_SVG_FONT_ERROR:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -251,6 +252,7 @@ _cairo_span_renderer_create_in_error (cairo_status_t status)
|
|||
case CAIRO_STATUS_WIN32_GDI_ERROR: RETURN_NIL;
|
||||
case CAIRO_STATUS_TAG_ERROR: RETURN_NIL;
|
||||
case CAIRO_STATUS_DWRITE_ERROR: RETURN_NIL;
|
||||
case CAIRO_STATUS_SVG_FONT_ERROR: RETURN_NIL;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3151,6 +3151,7 @@ _cairo_surface_create_in_error (cairo_status_t status)
|
|||
case CAIRO_STATUS_WIN32_GDI_ERROR:
|
||||
case CAIRO_INT_STATUS_DWRITE_ERROR:
|
||||
case CAIRO_STATUS_TAG_ERROR:
|
||||
case CAIRO_STATUS_SVG_FONT_ERROR:
|
||||
default:
|
||||
_cairo_error_throw (CAIRO_STATUS_NO_MEMORY);
|
||||
return (cairo_surface_t *) &_cairo_surface_nil;
|
||||
|
|
|
|||
|
|
@ -3141,7 +3141,7 @@ _cairo_render_svg_glyph (const char *svg_document,
|
|||
/* First parse elements into a tree and populate ids hash table */
|
||||
if (!parse_svg (svg_render, svg_document)) {
|
||||
print_error (svg_render, "Parse SVG document failed");
|
||||
status = CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED;
|
||||
status = CAIRO_STATUS_SVG_FONT_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -372,7 +372,8 @@ static const cairo_t _cairo_nil[] = {
|
|||
DEFINE_NIL_CONTEXT (CAIRO_STATUS_FREETYPE_ERROR),
|
||||
DEFINE_NIL_CONTEXT (CAIRO_STATUS_WIN32_GDI_ERROR),
|
||||
DEFINE_NIL_CONTEXT (CAIRO_STATUS_TAG_ERROR),
|
||||
DEFINE_NIL_CONTEXT (CAIRO_STATUS_DWRITE_ERROR)
|
||||
DEFINE_NIL_CONTEXT (CAIRO_STATUS_DWRITE_ERROR),
|
||||
DEFINE_NIL_CONTEXT (CAIRO_STATUS_SVG_FONT_ERROR)
|
||||
};
|
||||
COMPILE_TIME_ASSERT (ARRAY_LENGTH (_cairo_nil) == CAIRO_STATUS_LAST_STATUS - 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -358,6 +358,7 @@ typedef enum _cairo_status {
|
|||
CAIRO_STATUS_WIN32_GDI_ERROR,
|
||||
CAIRO_STATUS_TAG_ERROR,
|
||||
CAIRO_STATUS_DWRITE_ERROR,
|
||||
CAIRO_STATUS_SVG_FONT_ERROR,
|
||||
|
||||
CAIRO_STATUS_LAST_STATUS
|
||||
} cairo_status_t;
|
||||
|
|
|
|||
|
|
@ -1600,6 +1600,7 @@ _status_to_string (cairo_status_t status)
|
|||
f(WIN32_GDI_ERROR);
|
||||
f(TAG_ERROR);
|
||||
f(DWRITE_ERROR);
|
||||
f(SVG_FONT_ERROR);
|
||||
case CAIRO_STATUS_LAST_STATUS:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue