From 232a08210cea94f3a4c794ad0ea43eb33aa80591 Mon Sep 17 00:00:00 2001 From: Jaro Date: Wed, 21 Jun 2023 09:32:02 +0200 Subject: [PATCH] Expose paragraphSafeWidth. --- CHANGELOG.md | 3 +++ lib/Data/Text/ParagraphLayout/Rich.hs | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e10618..f8110c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ * Added option to prevent making boxes invisible when they contain no glyphs and no forced (hard) line breaks. +* Added function `paragraphSafeWidth` to help calculating max-content width + for CSS. + * Text will now overflow the end edge of the paragraph according to the text direction of the root box, instead of always overflowing the right edge. diff --git a/lib/Data/Text/ParagraphLayout/Rich.hs b/lib/Data/Text/ParagraphLayout/Rich.hs index 5d3b0d2..d48530e 100644 --- a/lib/Data/Text/ParagraphLayout/Rich.hs +++ b/lib/Data/Text/ParagraphLayout/Rich.hs @@ -52,6 +52,7 @@ module Data.Text.ParagraphLayout.Rich -- * Output layout , layoutRich , ParagraphLayout (ParagraphLayout, paragraphRect, paragraphFragments) + , paragraphSafeWidth , Fragment ( Fragment , fragmentUserData -- 2.30.2