summaryrefslogtreecommitdiff
path: root/src/cairo-font-face-twin.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2008-12-26 14:56:32 -0500
committerBehdad Esfahbod <behdad@behdad.org>2008-12-26 14:56:32 -0500
commite133cc14469e8ebb8311bf8db206147f6b07786d (patch)
tree6cbdf216955c3bf0dfe8417276f4d93e84a6c30f /src/cairo-font-face-twin.c
parentdec4d791f4cc626d1fa52d68518f787210240812 (diff)
downloadcairo-e133cc14469e8ebb8311bf8db206147f6b07786d.tar.gz
[twin] Don't stretch pen
Diffstat (limited to 'src/cairo-font-face-twin.c')
-rw-r--r--src/cairo-font-face-twin.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/cairo-font-face-twin.c b/src/cairo-font-face-twin.c
index 5dc7102b2..7c446c9a6 100644
--- a/src/cairo-font-face-twin.c
+++ b/src/cairo-font-face-twin.c
@@ -410,10 +410,6 @@ twin_scaled_font_render_glyph (cairo_scaled_font_t *scaled_font,
/* weight */
weight = props->weight * (4. / 64 / TWIN_WEIGHT_NORMAL);
- /* stretch */
- stretch = 1 + .05 * ((int) props->stretch - (int) TWIN_STRETCH_NORMAL);
- cairo_scale (cr, stretch, 1);
-
/* lock pen matrix */
_twin_compute_pen (cr, scaled_font, weight, &penx, &peny);
cairo_save (cr);
@@ -421,6 +417,10 @@ twin_scaled_font_render_glyph (cairo_scaled_font_t *scaled_font,
/* left margin + pen width, pen width */
cairo_translate (cr, penx * 1.5, -peny * .5);
+ /* stretch */
+ stretch = 1 + .1 * ((int) props->stretch - (int) TWIN_STRETCH_NORMAL);
+ cairo_scale (cr, stretch, 1);
+
/* slant */
if (props->slant != CAIRO_FONT_SLANT_NORMAL) {
cairo_matrix_t shear = { 1, 0, -.2, 1, 0, 0};
@@ -448,8 +448,7 @@ twin_scaled_font_render_glyph (cairo_scaled_font_t *scaled_font,
_twin_compute_snap (cr, scaled_font, &info, b);
/* advance width */
- metrics->x_advance = gw + penx * 3; /* pen width + margin */
- metrics->x_advance *= stretch;
+ metrics->x_advance = gw * stretch + penx * 3; /* pen width + margin */
/* glyph shape */
for (;;) {