mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-22 07:21:06 +01:00
[paint] Continue returning bool from paint_image()
https://github.com/harfbuzz/harfbuzz/commit/6ccbfabd4fcc5d4cca99be10552c270205fd7792#commitcomment-94127307
This commit is contained in:
1 parent
6ccbfabd4f
commit
f70c5d6f0d
4 files changed
+28
-25
No files matched your search
+10
-7
@@ -882,13 +882,16 @@ hb_ft_paint_glyph (hb_font_t *font,
|
||||
if (!hb_font_get_glyph_extents (font, gid, &extents))
|
||||
goto out;
|
||||
|
||||
paint_funcs->image (paint_data,
|
||||
blob,
|
||||
bitmap.width,
|
||||
bitmap.rows,
|
||||
HB_PAINT_IMAGE_FORMAT_BGRA,
|
||||
font->slant_xy,
|
||||
&extents);
|
||||
if (!paint_funcs->image (paint_data,
|
||||
blob,
|
||||
bitmap.width,
|
||||
bitmap.rows,
|
||||
HB_PAINT_IMAGE_FORMAT_BGRA,
|
||||
font->slant_xy,
|
||||
&extents))
|
||||
{
|
||||
/* TODO Try a forced outline load and paint? */
|
||||
}
|
||||
|
||||
out:
|
||||
hb_blob_destroy (blob);
|
||||
|
||||
@@ -961,17 +961,17 @@ struct CBDT
|
||||
extents.x_bearing + extents.width,
|
||||
extents.y_bearing + extents.height);
|
||||
|
||||
funcs->image (data,
|
||||
blob,
|
||||
pixel_extents.width, -pixel_extents.height,
|
||||
HB_PAINT_IMAGE_FORMAT_PNG,
|
||||
font->slant_xy,
|
||||
&extents);
|
||||
bool ret = funcs->image (data,
|
||||
blob,
|
||||
pixel_extents.width, -pixel_extents.height,
|
||||
HB_PAINT_IMAGE_FORMAT_PNG,
|
||||
font->slant_xy,
|
||||
&extents);
|
||||
|
||||
funcs->pop_clip (data);
|
||||
|
||||
hb_blob_destroy (blob);
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -253,15 +253,15 @@ struct sbix
|
||||
if (unlikely (!get_extents (font, glyph, &pixel_extents, false)))
|
||||
return false;
|
||||
|
||||
funcs->image (data,
|
||||
blob,
|
||||
pixel_extents.width, -pixel_extents.height,
|
||||
HB_PAINT_IMAGE_FORMAT_PNG,
|
||||
font->slant_xy,
|
||||
&extents);
|
||||
bool ret = funcs->image (data,
|
||||
blob,
|
||||
pixel_extents.width, -pixel_extents.height,
|
||||
HB_PAINT_IMAGE_FORMAT_PNG,
|
||||
font->slant_xy,
|
||||
&extents);
|
||||
|
||||
hb_blob_destroy (blob);
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
+4
-4
@@ -97,15 +97,15 @@ struct hb_paint_funcs_t
|
||||
{ func.color (this, paint_data,
|
||||
is_foreground, color,
|
||||
!user_data ? nullptr : user_data->color); }
|
||||
void image (void *paint_data,
|
||||
bool image (void *paint_data,
|
||||
hb_blob_t *image,
|
||||
unsigned width, unsigned height,
|
||||
hb_tag_t format,
|
||||
float slant,
|
||||
hb_glyph_extents_t *extents)
|
||||
{ func.image (this, paint_data,
|
||||
image, width, height, format, slant, extents,
|
||||
!user_data ? nullptr : user_data->image); }
|
||||
{ return func.image (this, paint_data,
|
||||
image, width, height, format, slant, extents,
|
||||
!user_data ? nullptr : user_data->image); }
|
||||
void linear_gradient (void *paint_data,
|
||||
hb_color_line_t *color_line,
|
||||
float x0, float y0,
|
||||
|
||||
Reference in new issue
Block a user