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

129 commits

Author SHA1 Message Date
attila
b72343cf8c Fix font sizing with the software and OpenGL renderers when ascent override is used 2025-10-24 11:22:15 +02:00
Anthony Nicholls
667b3fae86 LruCache: Make the LRU cache implementation thread safe 2025-09-25 14:56:34 +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
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
Oli
9374f2c9f7 Graphics: Use preferred temporary image type for transparency layers
Co-authored-by: Matt Gonzalez <matt@echoaudio.com>
2025-04-24 13:58:23 +01:00
attila
29327144db
StackBasedLowLevelGraphicsContext: Prefer using RectangleListRegion clip when possible
This reverts a tiny part of 19061e6d17.
2024-08-06 17:36:19 +01:00
reuk
9dda9d65a7
RenderingHelpers: Allow software renderer to replace content of filled rects 2024-06-27 18:10:22 +01:00
reuk
5b2f9d4019
GraphicsContext: Avoid attempting to paint empty rectangles in all renderers 2024-05-20 12:49:56 +01:00
reuk
e11b8f5ccb
CoreGraphics: Slightly shrink excluded clip regions in order to draw transformed opaque components without border artefacts
Previously, drawing an opaque, scaled component with CoreGraphics could
lead to visible artefacts around the edge of the component.

When drawing the parent of an opaque component, the area covered by the
opaque component is excluded from the clip region. If the clip region is
non-integral when transformed into device space, anti-aliasing will be
applied on the edges of the clip region. Similarly, when drawing the
opaque component itself, anti-aliasing will be applied at the edges of
the component. When the two drawings are superimposed, the foreground
anti-aliased pixels will be blended with the background anti-aliased
pixels, leading to a noticeable border around the component. Ideally,
only the foreground anti-aliasing should be applied, and the background
should not be anti-aliased around its edges.
2024-05-20 12:49:55 +01:00
reuk
acae73e980
RenderingHelpers: DRY implementation of fillRectWithColour 2024-04-29 16:08:24 +01:00
reuk
19061e6d17
Direct2D: Add initial support 2024-04-18 14:16:02 +01:00
reuk
7e87d3e7a6
RenderingHelpers: Fix transformed linear gradients
Previously, the software renderer could render transformed gradients
incorrectly. This could be seen in the backgrounds of the tabs in the
ComponentTransformsDemo when the view was rotated through around 45
degrees.

The new behaviour appears more consistent with the other renderers.
2024-04-18 14:16:02 +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
reuk
4f2c287f9b
Font: Deprecate old Font constructors 2024-04-18 14:16:00 +01:00
reuk
4e90ef831b
Typeface: Add support for rendering COLRv0 glyphs and png-based glyphs
This is sufficient for initial support of the system emoji fonts on each
platform:

- Noto Color Emoji on Linux and Android, png-based
- Apple Color Emoji on macOS and iOS, png-based
- Segoe UI Emoji on Windows 10 and 11, COLRv0-based
    - This font also provides COLRv1 support, at least on Windows 11,
      but JUCE will ignore that and use the COLRv0 data instead
2024-04-18 14:15:59 +01:00
reuk
72819437e7
RenderingHelpers: Move drawGlyph to a common location 2024-04-18 14:15:59 +01:00
reuk
722ff41d66
RenderingHelpers: Individually template ClipRegion types 2024-04-18 14:15:59 +01:00
reuk
830bccd05f
RenderingHelpers: Disable gamma correction, which breaks colour emoji rendering 2024-04-18 14:15:59 +01:00
reuk
c40da067cd
RenderingHelpers: Implement GlyphCache in terms of LruCache 2024-04-18 14:15:59 +01:00
reuk
bc654f8007
RenderingHelpers: Reduce templating of GlyphCache 2024-04-18 14:15:58 +01:00
reuk
f5017be881
RenderingHelpers: Reduce templating of CachedGlyphEdgeTable 2024-04-18 14:15:58 +01:00
reuk
0d2e34f34c
Typeface: Implement platform typefaces using Harfbuzz hb_font_t 2024-04-17 14:41:00 +01:00
Tom Poole
94d98a2b10 Update licensing information 2024-04-16 11:39:35 +01:00
Anthony Nicholls
158220ddfa Formatting: Use nested namespace definitions 2023-10-09 14:49:18 +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
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
31a7c62baf
Windows: Fix and suppress some analysis warnings
This fixes warnings that are emitted when building with the `-analyze`
flag enabled.
2021-05-26 15:34:26 +01:00
ed
009d685179 Updated all license headers 2020-06-29 08:30:22 +01:00
Tom Poole
894e7d2bd2 Updated all license headers 2020-04-23 17:30:39 +01:00
reuk
5f348c3040 Warnings: Add warning-wrangling header 2020-04-13 13:16:05 +01:00
reuk
327f817b9b Copyrights: Update commercial/gpl headers to be gpl-only 2020-04-09 15:22:56 +01:00
ed
26c9468dc5 Deprecated AffineTransform::getScaleFactor() as it was producing incorrect values for transforms containing rotations. Added getDeterminant() method for getting the determinant of the transform 2020-03-30 18:34:19 +01:00
ed
59a058fdc6 Fixed some warnings flagged up when enabling -Wswitch-enum, -Wswitch-default, -Wredundant-decls, and -Wimplicit-fallthrough 2020-03-09 17:39:28 +00:00
jules
f58eacc135 Added more unique_ptr use, for functions that create LowLevelGraphicsContext or ImageType objects. 2019-05-15 12:08:38 +01:00
Tom Poole
4e0adb2af8 GCC 9 compatibility fixes 2019-04-30 17:46:15 +01:00
ed
a234721110 Added various clang-tidy modernize-* fixes 2019-01-31 15:15:31 +00:00
jules
6fda0bffca Fixed some stray zeros that were still being passed as null pointers 2018-10-05 12:15:04 +01:00
Tom Poole
0e1722e387 Multiple spelling fixes 2018-08-20 18:16:24 +01:00
Tom Poole
08d67c763f Made some JUCE classes TriviallyCopyable 2018-07-11 09:17:31 +01:00
jules
1e6bbb8da9 Added some methods to allow ReferenceCountedObjectPtrs to be constructed or copied from references as well as pointers - as well as increasing safety, this actually makes things a bit more efficient as it skips a nullptr check. Updated lots of places in the code that could take advantage of this 2018-07-03 11:51:13 +01:00
Tom Poole
102ed4a9f2 Fixed some compiler warnings 2018-06-27 17:02:25 +01:00
jules
49aa9c9db4 Added flag JUCE_STRICT_REFCOUNTEDPOINTER which is recommended to avoid accidental leaks when using ref-counted pointers. Enabled this flag in the demo projects, and used it to help tidy up some dubious smart-pointer use 2018-06-26 14:06:52 +01:00
jules
974b4a8351 Removed some legacy friend class declarations that are no longer needed with modern compilers 2018-06-13 17:11:37 +01:00
jules
38295f332b Converted some old typedefs to using declarations 2018-05-03 09:59:05 +01:00
Tom Poole
ab863a6dc2 Replaced all usage of ScopedPointer with std::unique_ptr 2018-04-19 20:27:47 +01:00
ed
cdbc28c18b Add documentation tags 2018-03-15 12:10:32 +00:00