diff --git a/src/servo/text/font.rs b/src/servo/text/font.rs index da75d040348..f0671e55758 100644 --- a/src/servo/text/font.rs +++ b/src/servo/text/font.rs @@ -55,12 +55,11 @@ pub impl Font : FontMethods { // TODO: alter advance direction for RTL // TODO(Issue #98): using inter-char and inter-word spacing settings when measuring text let mut advance = au(0); - let mut bounds = Rect(Point2D(au(0), -self.metrics.ascent), - Size2D(au(0), self.metrics.ascent + self.metrics.descent)); do run.glyphs.iter_glyphs_for_range(offset, length) |_i, glyph| { advance += glyph.advance(); - bounds = bounds.translate(&Point2D(glyph.advance(), au(0))); } + let mut bounds = Rect(Point2D(au(0), -self.metrics.ascent), + Size2D(advance, self.metrics.ascent + self.metrics.descent)); // TODO(Issue #125): support loose and tight bounding boxes; using the // ascent+descent and advance is sometimes too generous and