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

1354 commits

Author SHA1 Message Date
reuk
50b51f512a
juce_audio_processors_headless: Remove juce_graphics dependency 2025-09-17 12:50:08 +01:00
reuk
1c9947b80e
Android: Use AFontMatcher to locate generic system fonts on supported platforms 2025-09-17 12:50:06 +01:00
Tom Poole
360dfe5f3d Bump version number to 8.0.10 2025-09-15 09:30:11 +01:00
reuk
81e4d59da2
Direct2D: Avoid unnecessarily transforming solid colour brush
The changes were not cleared between frames, so they could end up
accumulating and causing floating-point exceptions.
2025-09-11 14:28:23 +01:00
reuk
641497918c
Direct2D: Always call SetTransform for gradient/image brushes
This partly reverts commit ad28684b10.
Prior to that change, getBrush() would always end up calling
SetTransform on gradient/image brushes. This is important because, when
drawing text, we combine the current brush transform with the text
transform. If we don't reset the brush transform each time, these
transforms end up accumulating across frames.
2025-09-09 11:32:00 +01:00
reuk
5a02f5231d
SimpleShapedText: Silence conversion warning 2025-09-08 11:54:30 +01:00
Tom Poole
cb9ec7e38f Bump version number to 8.0.9 2025-09-01 14:44:25 +01:00
Oli
4263efb96a Jpeg: Disable "extern C" in jpeglib.h 2025-08-20 09:51:28 +01:00
attila
ad28684b10 Tidying: Remove unused code 2025-08-19 16:51:15 +01:00
attila
35fe3ac714 Direct2D: Fix gradient fill when the brush is transformed with not just translation
The code contains a performance optimisation for cases where the world
transform is translation only. In this case instead of applying the
brush transformation first and then the world translation, the order is
reversed. The translation is applied first and then the brush
transformation.

Flipping the transformations however is only correct in the special case
when both transformations are translation only.
2025-08-19 16:51:15 +01:00
attila
bb5a9cbac9 Direct2D: Fix wrong brush transform calculation
This change is practically a no-op, because if the affected branch is
taken, then the world transform was not applied, so transform is a
unity matrix. But if transform was non-unity, then the wrong ordering
would cause an observable error.

Logically the brush transformation is nested inside the world
transformation so the right order is applying the brush transform first
followed by the world transform.
2025-08-19 16:51:15 +01:00
reuk
2712f63628
Graphics: Use unique_ptr instead of raw pointers in RenderingHelpers 2025-08-14 14:13:09 +01:00
attila
fa0ed2801d Fix J8 vertical text placement regression in the software renderer 2025-08-13 17:28:30 +01:00
Oli
8dc4dcd56b TextLayout: Implement better line balancing algorithm
The previous implementation was unstable when 'by character' line
breaking was used on long lines of text.

Co-authored-by: Tom Poole <tom@juce.com>
2025-08-13 14:20:20 +01:00
Oliver James
7a30354ce9 TextLayout: Enforce character wrapping attribute 2025-08-13 14:20:20 +01:00
attila
f97355b9f6 Direct2D: Fix seams between tiles for large bitmaps 2025-07-25 20:45:17 +02:00
attila
19906c9d2f Direct2DGraphicsContextTests: Ignore the image edges to allow for differences in anti-aliasing 2025-07-25 20:45:17 +02:00
attila
3f898f6fee Direct2D: Fix jitter when drawing bitmaps with non-unity scaling
Reverts ca3abbb96d.

Prior to this fix gradually changing the Component scale would lead to
the jittery movement of drawn bitmaps, as their position would be
snapped to an arbitrary integral representation.
2025-07-25 20:45:17 +02:00
attila
5bc44c301f Make Direct2DGraphicsContextTests acceptance criteria stricter 2025-07-25 20:45:17 +02:00
Anthony Nicholls
36d07a6ce3 Docs: Replace doxygen preprocessor conditionals with @cond and @endconds 2025-07-21 18:11:43 +02:00
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