mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 11:28:02 +02:00
[test/user-font] Document glyph-not-found situation
This commit is contained in:
parent
d9408041aa
commit
597bfa922a
1 changed files with 5 additions and 3 deletions
|
|
@ -97,8 +97,8 @@ test_scaled_font_unicode_to_glyph (cairo_scaled_font_t *scaled_font,
|
||||||
return CAIRO_STATUS_SUCCESS;
|
return CAIRO_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fall through and default to undefined glyph. */
|
/* Not found. Default to glyph 0 */
|
||||||
return CAIRO_STATUS_INVALID_INDEX;
|
return CAIRO_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cairo_status_t
|
static cairo_status_t
|
||||||
|
|
@ -114,6 +114,8 @@ test_scaled_font_render_glyph (cairo_scaled_font_t *scaled_font,
|
||||||
div_t d;
|
div_t d;
|
||||||
double x, y;
|
double x, y;
|
||||||
|
|
||||||
|
/* FIXME: We simply crash on out-of-bound glyph indices */
|
||||||
|
|
||||||
metrics->x_advance = glyphs[glyph].width / 4.0;
|
metrics->x_advance = glyphs[glyph].width / 4.0;
|
||||||
|
|
||||||
cairo_set_line_width (cr, 0.1);
|
cairo_set_line_width (cr, 0.1);
|
||||||
|
|
@ -160,7 +162,7 @@ get_user_font_face (void)
|
||||||
* 13 14 15
|
* 13 14 15
|
||||||
*/
|
*/
|
||||||
static const test_scaled_font_glyph_t glyphs [] = {
|
static const test_scaled_font_glyph_t glyphs [] = {
|
||||||
{ '\0', 0, { END_GLYPH } }, /* Poppler has a bug assuming glyph 0 is .notdef */
|
{ '\0', 1, { END_GLYPH } }, /* Poppler has a bug assuming glyph 0 is .notdef */
|
||||||
{ ' ', 1, { END_GLYPH } },
|
{ ' ', 1, { END_GLYPH } },
|
||||||
{ '-', 2, { 7, 8, STROKE, END_GLYPH } },
|
{ '-', 2, { 7, 8, STROKE, END_GLYPH } },
|
||||||
{ '.', 1, { 10, 10, STROKE, END_GLYPH } },
|
{ '.', 1, { 10, 10, STROKE, END_GLYPH } },
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue