1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-13 00:04:19 +00:00
Commit graph

18 commits

Author SHA1 Message Date
attila
9dd8a2af13 Fix SimpleShapedText::getTextRange() when the input text contains hard breaks
The issue prior to this commit would be observable when using the
GlyphArrangement functions e.g. addFittedText.

This is a fix for a regression introduced in
9223805b9c.
2024-12-17 18:27:30 +01:00
attila
9223805b9c Refactor shaping to eliminate false soft break points at shaping parameter boundaries
Prior to this a soft break could occur between two characters printed in
different fonts, even though there was no break opportunity there in the
Unicode string.
2024-12-04 16:52:57 +01:00
attila
82080f9372 ShapedText: Apply the horizontal scaling to the extra kerning
This fixes an undesired behaviour where squashing the text using
GlyphArrangement::addFittedText would only squash the visible glyphs but
not the additional kerning space between them.
2024-10-21 15:34:42 +02:00
attila
8693507ead ShapedText: Apply extra kerning only before clusters
This avoids inserting tracking between glyphs in a single cluster e.g. a
base glyph and diacritic marks.
2024-10-21 15:34:42 +02:00
attila
503788fd0c ShapedText: Fix falsely marking glyphs with missing extent information as whitespace 2024-10-21 15:34:42 +02:00
attila
bd14d47211 SimpleShapedText: Restore and tidy up earlier line breaking logic
This commit isn't fixing any known bugs, but restores the soft break
iteration logic to its state prior to
5e4016b4fb, which accidentally changed it.
2024-10-21 15:34:42 +02:00
Anthony Nicholls
0e608f77fa SimpleShapedText: Avoid MSVC compiler bug for C++20 builds
There appears to be a bug in the MSVC compiler relating to cpaturing
a instance of a struct defined inside a lambda
2024-09-20 17:29:05 +01:00
attila
5e4016b4fb GlyphArrangement::addFittedText: Break words across multiple lines if necessary
This behaviour, previously available in JUCE 7, was missing since the
JUCE 8 changes related to Unicode text drawing.

With this commit, words that are too long to fit in a line are again
broken up, with the caveat, that we can expect this approach to produce
quirks with bidirectional text. We don't expect that such a feature
could be satisfactorily provided for bidirectional text, so this is a
stopgap measure for legacy applications.
2024-09-19 15:35:53 +02:00
reuk
9076639742
UnicodeBidi: Replace implementation with SheenBidi 2024-09-18 19:13:08 +01:00
attila
04d9d36b15 TextLayout: Fix ignored AttributedText::getLineSpacing() parameter 2024-07-22 13:16:06 +02:00
reuk
b35688d9a4
SimpleShapedText: Avoid wrapping when WordWrap::none is requested 2024-07-11 18:00:07 +01:00
attila
ef8417023e Represent tab characters with non-breaking space during shaping
This avoids assertions raised when shaping text containing tabs.
2024-06-27 15:31:57 +00:00
attila
17611f74ca Minor code cleanup 2024-06-10 17:51:26 +02:00
attila
c2b461026b Fix shaping for text that uses a single CR for line breaking 2024-06-10 17:51:26 +02:00
Oliver James
38f299a054 TextLayout: Respect the ReadingDirection parameter of AttributedString 2024-05-30 12:21:35 +01:00
attila
d794fac44c SimpleShapedText: Fix line break behaviour with text trailing whitespaces
This fixes an issue with the text wrapping logic for text chunks ending
in a whitespace.

When trying to fit a text chunk, the logic works with two values: width
with trailing whitespace, and width without trailing whitespace.

When the trailingWhitespacesShouldFit option is false, the logic
checks if "withoutTrailingWhitespace" can still fit inside the remaining
width.

Prior to this fix, it then decremented the remaining width with
"withoutTrailingWhitespace", but it should have used
"withTrailingWhitespace" for the decrement operation, always, regardless
of the value of the withTrailingWhitespacesShouldFit option.

This mistake only caused an observable issue when multiple fonts were
used for the shaping operation, and a different font would be used
immediately after a whitespace falling at the end of a line.
2024-05-29 15:11:57 +02:00
reuk
19061e6d17
Direct2D: Add initial support 2024-04-18 14:16:02 +01:00
attila
d84bacb3bb
Add ShapedText
Co-authored-by: Oliver James <oli@juce.com>
2024-04-18 14:16:01 +01:00