[util] Fix argument order and root transform PNGs
This commit is contained in:
parent
529dc40d7d
commit
7accbe97d8
|
@ -944,11 +944,15 @@ struct CBDT
|
||||||
if (unlikely (blob == hb_blob_get_empty ()))
|
if (unlikely (blob == hb_blob_get_empty ()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (unlikely (!get_extents (font, glyph, &extents)))
|
if (unlikely (!hb_font_get_glyph_extents (font, glyph, &extents)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
funcs->push_root_transform (data, font);
|
||||||
|
|
||||||
funcs->image (data, blob, HB_PAINT_IMAGE_FORMAT_PNG, &extents);
|
funcs->image (data, blob, HB_PAINT_IMAGE_FORMAT_PNG, &extents);
|
||||||
|
|
||||||
|
funcs->pop_root_transform (data);
|
||||||
|
|
||||||
hb_blob_destroy (blob);
|
hb_blob_destroy (blob);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,11 +245,15 @@ struct sbix
|
||||||
if (blob == hb_blob_get_empty ())
|
if (blob == hb_blob_get_empty ())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!get_extents (font, glyph, &extents))
|
if (!hb_font_get_glyph_extents (font, glyph, &extents))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
funcs->push_root_transform (data, font);
|
||||||
|
|
||||||
funcs->image (data, blob, HB_PAINT_IMAGE_FORMAT_PNG, &extents);
|
funcs->image (data, blob, HB_PAINT_IMAGE_FORMAT_PNG, &extents);
|
||||||
|
|
||||||
|
funcs->pop_root_transform (data);
|
||||||
|
|
||||||
hb_blob_destroy (blob);
|
hb_blob_destroy (blob);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,9 +123,10 @@ read_blob (void *closure,
|
||||||
return CAIRO_STATUS_SUCCESS;
|
return CAIRO_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
void
|
void
|
||||||
hb_cairo_paint_glyph_image (hb_font_t *font,
|
hb_cairo_paint_glyph_image (cairo_t *cr,
|
||||||
cairo_t *cr,
|
hb_font_t *font,
|
||||||
hb_blob_t *blob,
|
hb_blob_t *blob,
|
||||||
hb_tag_t format,
|
hb_tag_t format,
|
||||||
hb_glyph_extents_t *extents)
|
hb_glyph_extents_t *extents)
|
||||||
|
@ -146,10 +147,6 @@ hb_cairo_paint_glyph_image (hb_font_t *font,
|
||||||
cairo_matrix_t matrix = {(double) width, 0, 0, (double) height, 0, 0};
|
cairo_matrix_t matrix = {(double) width, 0, 0, (double) height, 0, 0};
|
||||||
cairo_pattern_set_matrix (pattern, &matrix);
|
cairo_pattern_set_matrix (pattern, &matrix);
|
||||||
|
|
||||||
hb_position_t x_scale, y_scale;
|
|
||||||
hb_font_get_scale (font, &x_scale, &y_scale);
|
|
||||||
cairo_scale (cr, +1./x_scale, -1./y_scale);
|
|
||||||
|
|
||||||
cairo_translate (cr, extents->x_bearing, extents->y_bearing);
|
cairo_translate (cr, extents->x_bearing, extents->y_bearing);
|
||||||
cairo_scale (cr, extents->width, extents->height);
|
cairo_scale (cr, extents->width, extents->height);
|
||||||
cairo_set_source (cr, pattern);
|
cairo_set_source (cr, pattern);
|
||||||
|
|
Loading…
Reference in New Issue