mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-29 09:34:05 +01:00
Use hb-raster glyph convenience APIs in raster tools
This commit is contained in:
1 parent
2bafa74e3a
commit
f67799a819
2 files changed
+9
-11
No files matched your search
@@ -159,9 +159,9 @@ main (int argc, char **argv)
|
||||
if (hb_font_get_glyph_extents (font, gid, &gext) &&
|
||||
hb_raster_paint_set_glyph_extents (pnt, &gext))
|
||||
{
|
||||
hb_bool_t painted = hb_font_paint_glyph_or_fail (font, gid,
|
||||
hb_raster_paint_get_funcs (), pnt,
|
||||
0, HB_COLOR (0, 0, 0, 255));
|
||||
hb_raster_paint_set_transform (pnt, 1.f, 0.f, 0.f, 1.f, 0.f, 0.f);
|
||||
hb_bool_t painted = hb_raster_paint_glyph (pnt, font, gid, 0.f, 0.f,
|
||||
0, HB_COLOR (0, 0, 0, 255));
|
||||
if (painted)
|
||||
img = hb_raster_paint_render (pnt);
|
||||
}
|
||||
@@ -175,8 +175,8 @@ main (int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (!hb_font_draw_glyph_or_fail (font, gid, hb_raster_draw_get_funcs (), rdr))
|
||||
break;
|
||||
hb_raster_draw_set_transform (rdr, 1.f, 0.f, 0.f, 1.f, 0.f, 0.f);
|
||||
hb_raster_draw_glyph (rdr, font, gid, 0.f, 0.f);
|
||||
|
||||
img = hb_raster_draw_render (rdr);
|
||||
if (img)
|
||||
|
||||
@@ -200,8 +200,8 @@ struct raster_output_t : output_options_t<true>
|
||||
{
|
||||
float pen_x = g.x + off_x;
|
||||
float pen_y = g.y + off_y;
|
||||
hb_raster_draw_set_transform (rdr, 1.f, 0.f, 0.f, 1.f, pen_x, pen_y);
|
||||
hb_font_draw_glyph (font, g.gid, hb_raster_draw_get_funcs (), rdr);
|
||||
hb_raster_draw_set_transform (rdr, 1.f, 0.f, 0.f, 1.f, 0.f, 0.f);
|
||||
hb_raster_draw_glyph (rdr, font, g.gid, pen_x, pen_y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,12 +302,10 @@ struct raster_output_t : output_options_t<true>
|
||||
float pen_x = g.x + off_x;
|
||||
float pen_y = g.y + off_y;
|
||||
|
||||
hb_raster_paint_set_transform (pnt, 1.f, 0.f, 0.f, 1.f, pen_x, pen_y);
|
||||
hb_raster_paint_set_transform (pnt, 1.f, 0.f, 0.f, 1.f, 0.f, 0.f);
|
||||
hb_raster_paint_set_extents (pnt, &ext);
|
||||
|
||||
hb_font_paint_glyph (font, g.gid,
|
||||
hb_raster_paint_get_funcs (), pnt,
|
||||
0, fg_color);
|
||||
hb_raster_paint_glyph (pnt, font, g.gid, pen_x, pen_y, 0, fg_color);
|
||||
|
||||
hb_raster_image_t *img = hb_raster_paint_render (pnt);
|
||||
if (img)
|
||||
|
||||
Reference in new issue
Block a user