1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
Commit graph

33 commits

Author SHA1 Message Date
attila
10b6289295 SimpleShapedText: Fix overallocating s32 buffer
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.
2025-05-12 16:49:05 +02:00
attila
d2d5e9bdd2 TextEditor: Fix setLineSpacing
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.
2025-04-23 18:11:26 +02:00
attila
9083cd9135 Fix TextEditor crash when Font resolution fails 2025-04-02 15:33:27 +02:00
attila
9c0aeb9e00 ShapedText: Fix potential crash caused by invalid Unicode strings
This change also fixes bad access that could happen with \r\n
line terminators. An incorrectly sized buffer meant that \n was
clobbered by the null terminator.
2025-04-02 15:33:27 +02:00
attila
bdc515e424 ShapedText: Fix crash caused by failing to find a fallback font for all codepoints 2025-04-02 15:33:27 +02:00
attila
5f5a247f82 TextEditor: Fix centred and right alignment when word wrap is disabled 2025-03-20 21:12:32 +01:00
attila
432a7e1c9a Fix C++20 compilation 2025-03-14 10:03:11 +01:00
attila
427852836c ShapedText: Break ligatures into multiple iterable placeholder glyphs 2025-03-13 12:16:16 +01:00
attila
bc093fa64c Ranges: ShapedText: Use out params for improving TextEditor performance 2025-03-13 12:16:16 +01:00
attila
a4f73a37af ShapedText: Fix input text range calculation logic during wrapping 2025-03-13 12:16:16 +01:00
attila
bfbdc4844d ShapedTextOptions: Fix uninitialised member variable 2025-03-13 12:16:16 +01:00
attila
50863c144e ShapedTextOptions: Add equality operators 2025-03-13 12:16:16 +01:00
attila
d72df5faa3 ShapedText: Add bidirectional lookup functions relating positions, input indices and glyph indices 2025-03-13 12:16:16 +01:00
attila
6cf697bd6d Ranges: Add equality operators 2025-03-13 12:16:16 +01:00
attila
2842c8ef8e Add detail::Ranges::getRanges() 2025-03-13 12:16:16 +01:00
attila
6c3043f082 Add detail::UnicodeHelpers::getLineBreaks 2025-03-13 12:16:16 +01:00
attila
a07098d479 Add ShapedText::getHeight() 2025-03-13 12:16:16 +01:00
attila
213d3fb56a Add RangedValues::getIntersectionsStartingAtZeroWith 2025-03-13 12:16:16 +01:00
attila
2d24504cd1 Change the return type of RangedValues::getIntersectionsWith
This is to avoid converting the returned value to RangedValues at the
call site.
2025-03-13 12:16:16 +01:00
attila
8dccb38081 Make IntersectingRangedValues independent from the RangedValues type
With this change you can use makeIntersectingRangedValues() not just for
RangedValues objects, but any object that has a begin() and end()
function returning a RangedValuesIterator.
2025-03-13 12:16:16 +01:00
attila
5b04493fb8 Ranges: Make RangedValuesIterator independent from the RangedValues type
This commit also relaxes the requirements imposed on the types for which
RangedValuesIterators can be created.
2025-03-13 12:16:16 +01:00
attila
43608a5208 Ranges: Store more information in Split and Change operations
This allows implementing more sophisticated logic in types wrapping
Ranges and RangedValue objects.
2025-03-13 12:16:16 +01:00
attila
ef840b7472 Use detail::RangedValues<Font> on ShapedText related interfaces
Previously using the FontForRange type was motivated by hiding the
RangedValues type in case we wanted to expose the ShapedText API. This
introduced unnecessary conversions between FontForRange and
RangedValues<Font>.
2025-03-13 12:16:16 +01:00
attila
ad43702e88 Add detail::RangedValues::shift 2025-03-13 12:16:16 +01:00
attila
fab1de34ab Add ShapedText::accessTogetherWith and remove ShapedText::access
Since the original function template has been exposed, we can now use it
directly. Also ShapedText::Detail has been removed, because it wouldn't
work across module boundaries.
2025-03-13 12:16:16 +01:00
attila
1b595311d0 Move ShapedText to the detail namespace and expose it in the headers
This makes it accessible for the new TextEditor implementation in
juce_gui_basics.
2025-03-13 12:16:16 +01:00
attila
0474dacd31 Add Ranges::covers 2024-12-04 16:50:36 +01:00
attila
c69119a7b7 Add Ranges::find and RangedValues::find 2024-12-04 16:50:36 +01:00
attila
0dc97de993 Add Ranges::eraseUpTo 2024-12-04 16:48:12 +01:00
Anthony Nicholls
1dd2b3c90e Formatting: Whitespace 2024-09-06 15:40:39 +00:00
attila
adbb0850ed Fix compilation error with C++20 2024-06-24 15:07:16 +00:00
attila
453e57bade Add erase() and drop() to Ranges and RangedValues 2024-06-18 15:29:42 +02:00
attila
a2c7f1ea37
Add new Range related types that help working with attributed text 2024-04-18 14:16:01 +01:00