From 787f7a469441cd1ee58d2f207e463ac69c1ce5e2 Mon Sep 17 00:00:00 2001 From: attila Date: Tue, 6 May 2025 17:10:29 +0200 Subject: [PATCH] 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. --- modules/juce_graphics/fonts/juce_GlyphArrangement.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp b/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp index 60f514d789..2b6721b5f2 100644 --- a/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp +++ b/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp @@ -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) };