Index: pdflib_core.cpp
===================================================================
--- pdflib_core.cpp	(revision 22991)
+++ pdflib_core.cpp	(working copy)
@@ -249,7 +249,7 @@
 					}
 				}
 			}
-			current_x += gl.xadvance;
+			current_x += gl.xadvance * gl.scaleH;
 		}
 	}
 
Index: text/screenpainter.cpp
===================================================================
--- text/screenpainter.cpp	(revision 22991)
+++ text/screenpainter.cpp	(working copy)
@@ -82,8 +82,8 @@
 		cairo_set_font_size(cr, fontSize());
 
 		double current_x = 0.0;
+        cairo_scale(cr, gc.scaleH(), gc.scaleV());
 		for (const GlyphLayout& gl : gc.glyphs()) {
-			cairo_scale(cr, gl.scaleH, gl.scaleV);
 			cairo_glyph_t glyph = { gl.glyph, gl.xoffset + current_x, gl.yoffset };
 			cairo_show_glyphs(cr, &glyph, 1);
 			current_x += gl.xadvance;
