diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2008-12-24 15:43:17 -0500 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2008-12-24 15:43:17 -0500 |
commit | 0656e947f11356877014df93bd083123c7313dc3 (patch) | |
tree | bcb4b3bf282f9a0b6abe89886e3321f173881a31 /src/cairo-font-face-twin.c | |
parent | 9d493fcd16fb770f21fa732b08834f3a435fe1f2 (diff) | |
download | cairo-0656e947f11356877014df93bd083123c7313dc3.tar.gz |
[twin] Implement slant
Diffstat (limited to 'src/cairo-font-face-twin.c')
-rw-r--r-- | src/cairo-font-face-twin.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/cairo-font-face-twin.c b/src/cairo-font-face-twin.c index c116df8d9..41032ddd2 100644 --- a/src/cairo-font-face-twin.c +++ b/src/cairo-font-face-twin.c @@ -301,10 +301,13 @@ twin_scaled_font_render_glyph (cairo_scaled_font_t *scaled_font, g = twin_glyph_draw(b); w = twin_glyph_right(b); + cairo_set_tolerance (cr, 0.01); + + /* Prepare face */ + props = cairo_font_face_get_user_data (cairo_scaled_font_get_font_face (scaled_font), &twin_face_properties_key); - cairo_set_tolerance (cr, 0.01); - /* The weight is tuned to match DejaVu Sans' */ + lw = props->weight * (5.5 / 64 / TWIN_WEIGHT_NORMAL); cairo_set_line_width (cr, lw); @@ -316,6 +319,10 @@ twin_scaled_font_render_glyph (cairo_scaled_font_t *scaled_font, CAIRO_LINE_CAP_SQUARE : */ CAIRO_LINE_CAP_ROUND); + if (props->slant != CAIRO_FONT_SLANT_NORMAL) { + cairo_matrix_t shear = { 1, 0, -.2, 1, 0, 0}; + cairo_transform (cr, &shear); + } cairo_translate (cr, lw, 0); /* for margin */ |