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

57 commits

Author SHA1 Message Date
Oliver James
fc80bb29ca GlyphArrangement: Extend glyph bounds to encapsulate ligature characters
Previously, bounds for text with ligatures were miscalculated, leading to
incorrect positioning and getStringWidth values.
2025-07-15 14:01:58 +01:00
reuk
5208b3ffc0
GlyphArrangement: Use portable string trimming 2025-06-03 16:12:00 +01:00
attila
0e4287df52 ShapedTextOptions: Rename maxWidth to wordWrapWidth
The old name didn't communicate it clearly enough what the parameter was
used for. This started to show when alignmentWidth was added.
2025-05-21 17:47:20 +02:00
attila
283ea12958 Fix addFittedText overflowing the bounds when line spacing and height multiple is non-default 2025-05-13 18:32:01 +02:00
attila
c61158ed3a Add GlyphArrangementOptions for addFittedText and drawFittedText
The new options can be used to affect line spacing.
2025-05-09 13:39:11 +02:00
attila
787f7a4694 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.
2025-05-09 13:39:11 +02: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
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
b545b79cb3 GlyphArrangement: Make drawFittedText squashing behaviour more similar to JUCE 7
This commit fixes a regression added during the ShapedText based rewrite
of the class. The minimumHorizontalScale parameter was mistakenly
interpreted as an absolute scale, whereas its meaning in the old
implementation was a relative scalar applied to the Font's horizontal
scale.
2024-10-21 15:34:42 +02: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
attila
7cbdd14da9 GlyphArrangement::addFittedText: Fix scaling and squashing behaviour 2024-09-19 15:35:53 +02:00
Anthony Nicholls
1dd2b3c90e Formatting: Whitespace 2024-09-06 15:40:39 +00:00
reuk
66a29f9762
GlyphArrangement: Avoid divide-by-zero in addFittedText 2024-05-31 11:43:29 +01:00
attila
0d93e15d50 GlyphArrangement: Fix incorrect positioning with Justification::top 2024-04-19 16:55:09 +02:00
attila
20afcb5bf3
GlyphArrangement: Use ShapedText 2024-04-18 14:16:01 +01:00
reuk
1560f87111
LowLevelGraphicsContext: Replace glyph drawing functions with single drawGlyphs() 2024-04-18 14:16:01 +01:00
reuk
c2fce879c5
Font: Allow switching between legacy non-portable metrics, and new portable metrics 2024-04-18 14:16:00 +01:00
Tom Poole
94d98a2b10 Update licensing information 2024-04-16 11:39:35 +01:00
Tom Poole
4153d59e39 Formatting 2023-10-02 15:42:20 +01:00
reuk
28414a6af8
Global: Avoid floating-point equality checks where possible 2023-04-04 19:55:11 +01:00
Tom Poole
2ec861d99e Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00
Tom Poole
dea3fe60e4 Update copyright banners 2022-04-04 12:36:32 +01:00
reuk
6a1a96247b
GlyphArrangement: Avoid breaking on non-breaking spaces 2022-01-28 16:09:59 +00:00
reuk
3768349a05
Font: Make Font and TypefaceCache threadsafe
Previously, it wasn't safe to access Font instances from multiple
threads because there was a chance that they might reference the same
shared internal state. In this case, calling getTypeface() or getAscent from
two threads simultaneously would cause a race on the typeface and ascent
data members, even though the Font instances appeared to be disjoint.

With this change in place, it is now safe to use Font instances from
multiple threads simultaneously.

It is still an error to modify the same Font instance from multiple
threads without synchronization!

    // Fine:
    Font a;
    Font b = a;

    auto futureA = std::async (std::launch::async, [&a] { /* do something with a */ });
    auto futureB = std::async (std::launch::async, [&b] { /* do something with b */ });

    // Bad idea:
    Font f;

    auto futureA = std::async (std::launch::async, [&f] { /* do something with f */ });
    auto futureB = std::async (std::launch::async, [&f] { /* do something with f */ });
2021-09-23 10:28:47 +01:00
reuk
394c4fd475 Clang: Fix warnings when building with clang 10 2020-07-01 10:00:43 +01:00
ed
009d685179 Updated all license headers 2020-06-29 08:30:22 +01:00
reuk
4cf66d6522 Cleanup: Remove redundant inlines 2020-04-27 10:22:06 +01:00
Tom Poole
894e7d2bd2 Updated all license headers 2020-04-23 17:30:39 +01:00
reuk
327f817b9b Copyrights: Update commercial/gpl headers to be gpl-only 2020-04-09 15:22:56 +01:00
Tom Poole
47f138464f macOS: Fixed a CoreGraphics text layout bug 2020-01-17 16:34:50 +00:00
Tom Poole
79d3e8b3f5 Windows: Removed some VS2013 workarounds 2019-07-11 15:28:41 +01:00
ed
06da4f2daf Added a font 'leading' parameter for multiline text layouts 2019-03-11 16:43:21 +00:00
ed
eaf0f990d4 Replaced all uses of static_cast<Type&&> with std::move 2018-11-28 17:29:20 +00:00
Tom Poole
cff37f5b6a Fixed some const violation errors 2017-12-19 12:44:24 +00:00
tpoole
51b3eaebb2 Fixed some VS2013 compiler errors 2017-10-18 11:05:40 +01:00
jules
5c854b49a8 Fixed a problem in GlyphArrangement which could cause multiple lines to all be given ellipsis 2017-10-16 17:50:48 +01:00
jules
eda613c6db Moved all "namespace juce" declarations from module headers to the individual .h and .cpp source files. This makes life a lot easier for Intellisense and other IDE autocompletion tools 2017-09-08 08:59:55 +01:00
hogliux
b5afccc37c Updated file headers and the README with the JUCE 5 license 2017-04-27 14:43:04 +01:00
jules
89ad7eb0a4 Modernised some code in some text layout classes, and made TextLayout draw underlining where the font asks for it 2017-04-06 10:55:48 +01:00
hogliux
9f3fb1c0a6 Added a compiler error if your compiler is too old and removed numerous code checks for old compilers which are now deprecated 2017-02-01 17:18:06 +00:00
jules
7a27686d96 Fix for a layout truncation problem in GlyphArrangement when splitting across many lines. 2015-09-28 17:12:37 +01:00
hogliux
c7b8e77031 Update copyright notice 2015-07-22 15:59:34 +01:00
jules
844d9e8d86 Added method Font::getDefaultMinimumHorizontalScaleFactor() to make it possible to change the global minimum font squashing amount. 2015-03-17 11:41:14 +00:00
jules
94a0793a09 Prevented drawFittedText from messing up the graphics context's current font. 2015-02-02 13:00:48 +00:00
jules
36e7c12504 Fix for some VC compiler warnings. 2014-07-01 18:50:42 +01:00
jules
02460bb95b A bit of refactoring inside GlyphArrangement, to avoid som edge-cases where the wrong number of lines is chosen. 2014-06-29 14:34:26 +01:00
jules
45b56e2e20 Minor clean-ups around the Justification class. 2013-08-20 17:27:41 +01:00
jules
03c2801f3f Copyright header update in all module files. juce_core modules are now ISC licensed. All other modules are GPLv2/3/AGPLv3 2013-06-13 13:17:12 +01:00