Previously, this code assumed that a single channel image would always
have a pixel stride of 1. For image types where this assumption did not
hold, such as OpenGL, this function would produce incorrect results.
Prior to this commit the returned values were always normalised to the
value returned by getHeightInPoints().
I.e. getAscentInPoints() + getDescentInPoints() would always equal
getHeightInPoints(), even if ascent or descent overrides were in place.
With this change in place getAscentInPoints() + getDescentInPoints()
will always equal
getHeightInPoints() * (getAscentOverride() + getDescentOverride())
JUCE classes don't use this value for layout logic, so this commit
causes no visible changes in how JUCE draws text.
This commit removes the possibility to construct BidiParagraph and
BidiLine objects with non-zero offsets. We don't use these features,
and the assumption that these offsets are always zero simplifies our
visual ordering algorithm.
Prior to this commit we overallocated the s32 buffer. The buffer was
unnecessarily padded by zeros, and the line stating this, wasn't
actually dropping the null terminator.
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 makes Direct2DMetrics and current frameId accessible to implementation subclasses.
It also replaces JUCE_WRITE_TRACE_LOG with JUCE_WRITE_TRACE_LOG_VA as intended in original implementation.
Co-authored-by: Matt Gonzalez <matt@echoaudio.com>
Applies the previously missed line spacing value of the TextEditor.
The changes in JustifiedText fix calculating the vertical position of
the first line for the case where ShapedTextOptions has the following
settings:
isBaselineAtZero() == false,
getHeight().has_value() == false
getLeading() > 1.0f
This case however is only triggered by the TextEditor, as with all
functions in GlyphArrangement at least one setting is different.