diff options
author | Glenn Watson <gw@intuitionlibrary.com> | 2014-08-12 08:01:36 +1000 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2014-08-12 08:01:36 +1000 |
commit | 6fd396757acf174de13fac8e9b0abc55dcb349c5 (patch) | |
tree | 4ff2f0c784e79f15bced0c5cafb7a74027b64a15 /src/components/layout/text.rs | |
parent | aaa8982b60821629a9b312ff2bdd872db68feeb2 (diff) | |
download | servo-6fd396757acf174de13fac8e9b0abc55dcb349c5.tar.gz servo-6fd396757acf174de13fac8e9b0abc55dcb349c5.zip |
Change line-height to be read from the font itself, rather than
a hard-coded estimate.
Diffstat (limited to 'src/components/layout/text.rs')
-rw-r--r-- | src/components/layout/text.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/components/layout/text.rs b/src/components/layout/text.rs index 40ce9193af3..8aa162fd624 100644 --- a/src/components/layout/text.rs +++ b/src/components/layout/text.rs @@ -293,10 +293,10 @@ pub fn computed_style_to_font_style(style: &ComputedValues) -> FontStyle { } /// Returns the line block-size needed by the given computed style and font size. -pub fn line_height_from_style(style: &ComputedValues) -> Au { +pub fn line_height_from_style(style: &ComputedValues, metrics: &FontMetrics) -> Au { let font_size = style.get_font().font_size; let from_inline = match style.get_inheritedbox().line_height { - line_height::Normal => font_size.scale_by(1.14), + line_height::Normal => metrics.line_gap, line_height::Number(l) => font_size.scale_by(l), line_height::Length(l) => l }; |