From cdb4745aefe866909f1e1dab2580bd789591243d Mon Sep 17 00:00:00 2001 From: Jaro Date: Fri, 24 Feb 2023 03:41:56 +0100 Subject: [PATCH] Use CSS-compatible line height settings. --- src/Data/Text/ParagraphLayout/Plain.hs | 9 +++++---- test/Data/Text/ParagraphLayout/PlainSpec.hs | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Data/Text/ParagraphLayout/Plain.hs b/src/Data/Text/ParagraphLayout/Plain.hs index e643a13..0807767 100644 --- a/src/Data/Text/ParagraphLayout/Plain.hs +++ b/src/Data/Text/ParagraphLayout/Plain.hs @@ -72,11 +72,12 @@ data ParagraphOptions = ParagraphOptions data LineHeight - = Absolute Int32 - -- ^ Set line height independently of the font. + = Normal + -- ^ Determine the preferred line height automatically using its ascent and + -- descent metrics. - | Relative Float - -- ^ Set line height as a multiplier of the font's built-in value. + | Absolute Int32 + -- ^ Set the preferred line height independently of the font. -- | The resulting layout of the whole paragraph. data ParagraphLayout = ParagraphLayout diff --git a/test/Data/Text/ParagraphLayout/PlainSpec.hs b/test/Data/Text/ParagraphLayout/PlainSpec.hs index 68a75d0..4edf3a7 100644 --- a/test/Data/Text/ParagraphLayout/PlainSpec.hs +++ b/test/Data/Text/ParagraphLayout/PlainSpec.hs @@ -71,7 +71,7 @@ emptySpanLayout :: ParagraphLayout emptySpanLayout = ParagraphLayout (Rect 0 0 0 0) [SpanLayout []] opts :: Font -> ParagraphOptions -opts font = ParagraphOptions font (Relative 1.5) 20000 +opts font = ParagraphOptions font Normal 20000 spec :: Spec spec = do -- 2.30.2