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

1384 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
22d5d7a598
SimpleShapedText: Fix potential heap buffer overflow 2025-07-03 16:15:03 +01:00
reuk
5bb20e8e04
Direct2DImage: Flush CPU-only changes if necessary when copying images 2025-06-30 20:04:56 +01:00
Oli
8fd73d33a8 Graphics: Modify imported libjpeg sources for unity build compatibility 2025-06-19 13:18:43 +01:00
Oli
34c8704a25 Graphics: Import JPEG library code 2025-06-19 13:18:42 +01:00
Oliver James
d651f6740c Fonts: Add OpenType feature support 2025-06-17 12:38:20 +01:00
reuk
fa701a1bd9
SimpleShapedText: Use string with replaced whitspace during fallback font substitution
This is intended to address an assertion that sometimes fired during
shaping text on Android, for example when using the font "Noto Sans
Symbols" and shaping ASCII text including a line break in a multiline
text editor.

The cause of the issue seems to be that the shaper would search for
substitute fonts using the original string content, but would then
replace some characters in the string during shaping. Shaping could then
fail if the font did not contain glyphs for the replaced characters.

We now create a UTF32 string with replaced characters at the beginning
of the shaping process, and use that new string for all queries other
than unicode analysis.
2025-06-16 16:59:55 +01:00
reuk
e5049ad6e9
SimpleShapedText: Avoid UTF8-lookup allocations 2025-06-16 16:59:55 +01:00
reuk
a3d64c7784
Typeface: Enable advanced colour glyph rendering on Android
Android 15+ removed the 'legacy' png-based emoji font. Modern Android
versions may include only a COLR-v1-based font, which JUCE cannot
render itself.

As a workaround, on Android, we use a Canvas object to render each emoji
glyph into a bitmap, and then render that bitmap in the same way as a
legacy png-based glyph. This won't look as crisp as rendering COLRv1
glyphs directly, especially at larger sizes, but this is a sufficient
stop-gap for the time being.
2025-06-16 16:59:55 +01:00
Anthony Nicholls
b6d6ec573d GlyphArrangement: Add documentation tag 2025-06-10 16:13:33 +01:00
reuk
15f05443d0
Graphics: Add missing JUCE_API annotation to ScopedSaveState 2025-06-03 16:12:00 +01:00
reuk
5208b3ffc0
GlyphArrangement: Use portable string trimming 2025-06-03 16:12:00 +01:00
Tom Poole
b0d569c74b Bump version number to 8.0.8 2025-06-02 09:24:54 +01:00
reuk
72e345cdd7
Direct2DImage: Add missing data change notification when creating writable BitmapData
The OpenGL renderer listens for imageDataChanged() to invalidated cached
textures.

Before this change, the SimpleFFTDemo would display a static (outdated)
image on Windows when using the OpenGLRenderer.
2025-05-27 18:01:53 +01:00
reuk
415aed4bea
Direct2DImage: Sync CPU storage when creating a BitmapData view over a subsection of the image
When syncing from CPU->GPU storage, we currently copy the entire image
contents. The contents of the CPU backup completely replace the old GPU
image. Therefore, if any pixels need to retain their existing values, we
need to read those pixels before overwriting them. This in turn implies
that, when a BitmapData refers to a subsection of the image, we should
always flush GPU->CPU storage first, so that the subsequent CPU->GPU
sync doesn't clobber pixels outside of the BitmapData region with
outdated values.

It's clear that copying the entire image back and forth could be
suboptimal when writing to image subsections, but to optimise this
process we'd have to keep track of dirty image regions or similar, which
may in turn pessimise more common cases.
2025-05-27 18:01:53 +01:00
reuk
4012677fdf
Direct2DImage: Mark CPU storage as outdated after modifying GPU storage by copying 2025-05-27 18:01:53 +01:00
attila
a272b35261 TextEditor: Fix lines being invisible beyond the word wrap width 2025-05-21 17:47:20 +02: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
reuk
86732069c7
Image: Respect pixelStride when converting between image formats
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.
2025-05-19 13:32:52 +01:00
reuk
9f4aef4053
Image::BitmapData: Update getters to allow for negative lineStride 2025-05-19 13:30:27 +01:00
attila
7fc75c35f9
Android: Suppress availability macro warning 2025-05-19 13:30:27 +01:00
attila
94fc24e41a iOS: Fix compiling juce_audio_devices when juce_graphics isn't added 2025-05-16 18:08:54 +02:00
attila
724221081b Change the value returned by Font::getAscentInPoints and getDescentInPoints
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.
2025-05-13 18:32:01 +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
b9458fb240 GlyphArrangementOptions: Add missing JUCE_API annotation 2025-05-13 18:32:01 +02:00
attila
a0e429fdd0 Fix bidi ordering 2025-05-12 16:49:05 +02:00
attila
69b2b3ff5d Remove unused internal bidi features
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.
2025-05-12 16:49:05 +02:00
attila
8a27eb3b7c Tidying 2025-05-12 16:49:05 +02:00
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
Mathieu Demange
980926d4a6 Reword isSingularity() brief to avoid Doxygen line break
The last period in "i.e." was previously interpreted as the end of a brief description.
2025-05-09 12:57:02 +01: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
Oli
6972c4f0e3 Direct2D: Fix ETW tracing build errors
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>
2025-04-30 10:50:52 +01:00
reuk
243d3756fc Direct2D: Hide implementation of RectangleListSpriteBatch::fillRectangles 2025-04-24 13:58:24 +01:00
reuk
49948d5dd4 Direct2D: Remove unused declarations 2025-04-24 13:58:24 +01:00
reuk
98d4ddef87 Direct2D: Move MemoryFontFileLoader to DirectX.cpp 2025-04-24 13:58:24 +01:00
reuk
234e75b2be Direct2D: Move MemoryFontFileFileStream to DirectX.cpp 2025-04-24 13:58:24 +01:00
reuk
96683e49a1 Direct2D: Move FontFileEnumerator to DirectX.cpp 2025-04-24 13:58:24 +01:00
reuk
8d29edec92 Direct2D: Move CompositionTree to Direct2DHwndContext.cpp 2025-04-24 13:58:24 +01:00
reuk
1f6c1737eb Direct2D: Remove declaration of makeGradientStopCollection() 2025-04-24 13:58:24 +01:00
reuk
8d33428dcf Direct2D: Move WindowsScopedEvent to Direct2DHwndContext.cpp 2025-04-24 13:58:24 +01:00
reuk
f56c7faf40 Direct2D: Move SwapChain into Direct2DHwndContext.cpp 2025-04-24 13:58:24 +01:00
reuk
43c9f28d59 Direct2D: Move ScopedGeometryWithSink to Direct2DGraphicsContextImpl.cpp 2025-04-24 13:58:24 +01:00
reuk
137d9820b1 Direct2D: Move D2DHelpers to Direct2DGraphicsContext.cpp 2025-04-24 13:58:24 +01:00
reuk
2aed72d0d7 Direct2D: Move paintPrimitive implementation into Direct2DGraphicsContext 2025-04-24 13:58:24 +01:00
reuk
b061d5f5a4 Direct2D: Hide D2D SavedState in .cpp file 2025-04-24 13:58:24 +01:00
reuk
0071f4741c Direct2D: Make protected members of Pimpl private/public as appropriate 2025-04-24 13:58:24 +01:00
reuk
170b463400 Direct2D: Remove unused hwnd data member from D2DGraphicsContext::Pimpl 2025-04-24 13:58:24 +01:00
reuk
93d227b6af Direct2D: Split declaration and definition of Direct2DGraphicsContext::Pimpl 2025-04-24 13:58:24 +01:00
reuk
352f77083d DirectX: Remove unused ScopedMultithread 2025-04-24 13:58:24 +01:00