cairo halo patch via @springmeyer ( #1624 )
This commit is contained in:
parent
f759964dbf
commit
e91908206b
1 changed files with 30 additions and 3 deletions
|
@ -457,19 +457,46 @@ void cairo_context::add_text(text_path const& path,
|
|||
matrix.yy = text_size * std::cos(angle);
|
||||
matrix.x0 = 0;
|
||||
matrix.y0 = 0;
|
||||
|
||||
set_font_matrix(matrix);
|
||||
|
||||
set_font_face(manager, glyph->get_face());
|
||||
|
||||
glyph_path(glyph->get_index(), sx + x, sy - y);
|
||||
set_line_width(2.0 * c->format->halo_radius * scale_factor);
|
||||
set_line_join(ROUND_JOIN);
|
||||
set_color(c->format->halo_fill);
|
||||
stroke();
|
||||
}
|
||||
}
|
||||
|
||||
path.rewind();
|
||||
|
||||
for (int iii = 0; iii < path.num_nodes(); iii++)
|
||||
{
|
||||
char_info_ptr c;
|
||||
double x, y, angle;
|
||||
|
||||
path.vertex(c, x, y, angle);
|
||||
|
||||
face_set_ptr faces = font_manager.get_face_set(c->format->face_name, c->format->fontset);
|
||||
double text_size = c->format->text_size * scale_factor;
|
||||
faces->set_character_sizes(text_size);
|
||||
|
||||
glyph_ptr glyph = faces->get_glyph(c->c);
|
||||
|
||||
if (glyph)
|
||||
{
|
||||
cairo_matrix_t matrix;
|
||||
matrix.xx = text_size * std::cos(angle);
|
||||
matrix.xy = text_size * std::sin(angle);
|
||||
matrix.yx = text_size * -std::sin(angle);
|
||||
matrix.yy = text_size * std::cos(angle);
|
||||
matrix.x0 = 0;
|
||||
matrix.y0 = 0;
|
||||
set_font_matrix(matrix);
|
||||
set_font_face(manager, glyph->get_face());
|
||||
set_color(c->format->fill);
|
||||
show_glyph(glyph->get_index(), sx + x, sy - y);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue