1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

Use ShapedTextOptions::withAdditiveLineSpacing where appropriate

After reviewing the NSAttributedString API it seems justified to have
two different functions for additive and multiplicative line spacing
settings. For NSAttributedString they are setLineSpacing and
setLineHeightMultiple.

Using this function, when appropriate, exercises it lessening the
likelihood of code rot.
This commit is contained in:
attila 2025-05-06 17:10:29 +02:00 committed by Attila Szarvas
parent f908e52bdf
commit 787f7a4694

View file

@ -228,7 +228,7 @@ void GlyphArrangement::addJustifiedText (const Font& font, const String& text,
ShapedText st { text, ShapedText::Options{}.withMaxWidth (maxLineWidth)
.withJustification (horizontalLayout)
.withFont (font)
.withLeading (1.0f + leading / font.getHeight())
.withAdditiveLineSpacing (leading)
.withBaselineAtZero()
.withTrailingWhitespacesShouldFit (false) };