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

1374 commits

Author SHA1 Message Date
reuk
a381fdf81d
Font: Allow overriding typeface ascent and descent metrics 2025-01-29 13:36:28 +00:00
reuk
f12d29899c
Direct2D: Remove SetDpi call in startFrame
Previously, plugins and standalone apps could produce slightly different
visual results, particularly anti-aliasing, when displaying on a display
with native scaling applied. The discrepancy was caused by SetDpi being
called with a larger-than-default value (e.g. 192 DPI on a 200% scaled
display) in a standalone app, whereas SetDpi would always be called with
the default value of 96 in a plugin.

Keeping the default value seems to produce better results, so standalone
apps will now retain the default DPI.
2025-01-29 11:00:44 +00:00
reuk
c3e8b6bff3
CoreGraphics: Use Image NativeExtensions to avoid dynamic casts in graphics context 2025-01-23 12:21:33 +00:00
reuk
d3ca5961e7
Direct2D: Use Image NativeExtensions to avoid dynamic casts in graphics context 2025-01-23 12:21:33 +00:00
reuk
9b08c8fd51
Image: Add NativeExtensions type to help with inspecting images from graphics context implementations
This type isn't used anywhere in this commit, but this change lays the
foundation for the following commits.
2025-01-23 12:21:33 +00:00
reuk
55e5e2082c
Image: Add new backup-extensions interface to support images with no main-memory backup 2025-01-23 12:21:33 +00:00
reuk
ada2c88b03
ImagePixelData: Update signatures of functions providing whole-image effects 2025-01-23 12:21:33 +00:00
reuk
8cb8c5e572
Image: Add new BitmapData constructor accepting a Rectangle 2025-01-23 12:20:27 +00:00
reuk
5f7d6d70fc
Direct2DContext: Remove unnecessary public constants 2025-01-23 12:20:27 +00:00
tpoole
0baffff182 Bump version number to 8.0.6 2025-01-10 09:29:00 +00:00
tpoole
902ddc7567 Bump version number to 8.0.5 2025-01-08 14:23:21 +00:00
attila
d73b1768a7 Fall back to default sans serif font if resolution would fail otherwise
This restores the JUCE 7 behaviour when the JUCE 8 font fallback
mechanism fails to resolve a non-null Typeface::Ptr. This behaviour is
significant when the base font specified is not available on the system.
2025-01-07 17:29:43 +01:00
attila
ba61c9edb9 Fix crash when no valid Typeface::Ptr can be resolved 2025-01-07 17:29:43 +01:00
Anthony Nicholls
ad3457434e SimpleShapedText: Prevent running tests when no default typefaces can be found 2024-12-18 17:55:27 +00:00
Anthony Nicholls
7a1f397de6 Fonts (Linux): Return a null typeface when no default typefaces can be found 2024-12-18 16:00:44 +00:00
tpoole
df14e83838 Image: Remove an unused function 2024-12-18 13:04:27 +00:00
attila
9dd8a2af13 Fix SimpleShapedText::getTextRange() when the input text contains hard breaks
The issue prior to this commit would be observable when using the
GlyphArrangement functions e.g. addFittedText.

This is a fix for a regression introduced in
9223805b9c.
2024-12-17 18:27:30 +01:00
reuk
52beda1396 ImagePixelData: Speed up format conversions by hoisting switch statements out of tight loops 2024-12-13 14:49:46 +00:00
reuk
f887979ec0 Direct2D: Fix performance issue when drawing transformed unclipped regions
This issue could be observed in the GraphicsDemo's SVG pane, when the
"rotation" option was enabled.

Drawables internally enable the unclipped painting flag, which normally
prevents slow clipping when drawing subcomponents of the drawable.

The Direct2D graphics context was using the frame area as the default
area, used to signal that no clipping should be applied. However, when
non-axis-aligned transform was active, this area was incorrectly applied
as a geometric clipping region. D2D geometric clips are relatively slow,
so this caused large slowdowns.

This solution adds a flag that is set whenever a clip is explicitly
requested. If no clip is explicitly requested, then clipping will be
entirely bypassed. This can make rendering of Drawables significantly
faster.
2024-12-13 14:49:46 +00:00
reuk
336dcfc08c Direct2DImage: Update interface to accept a Device instead of a DeviceContext 2024-12-13 14:43:06 +00:00
reuk
f05031a898 Image: Convert structs to lambdas in implementation 2024-12-13 14:42:26 +00:00
reuk
dcca72484f Image: Update return type of getPixelData to avoid dangling pointers 2024-12-13 14:42:26 +00:00
Anthony Nicholls
880b76983e Graphics: Use cached glyph shaping when only the position of text changes 2024-12-13 14:41:26 +00:00
attila
6f4a2f6b6a Upgrade to harfbuzz 10.1.0 2024-12-10 13:43:51 +01:00
reuk
a6fa345ccc SheenBidi: Disable implicit-fallthrough warning for clang/gcc 2024-12-08 22:25:11 +00:00
attila
9223805b9c Refactor shaping to eliminate false soft break points at shaping parameter boundaries
Prior to this a soft break could occur between two characters printed in
different fonts, even though there was no break opportunity there in the
Unicode string.
2024-12-04 16:52:57 +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
reuk
a889149cbd
PixelRGB: Fix pixel order issue when creating CGImages on iOS 2024-12-03 11:28:07 +00:00
reuk
4b9253dc76
DirectX: Make it easier to enable debug logging output 2024-12-02 17:20:42 +00:00
Anthony Nicholls
5e803ded5f Deprecations: Add ignore deprecation warning macros 2024-11-27 11:07:04 +00:00
reuk
01bfa98827 CoreGraphics: Fix incorrect behaviour of non-solid-colour text fills
Previously, filling a string containing a space or other non-rendered
character with a gradient would end up filling the entire clip region.

The correct behaviour is to completely skip filling any empty paths.
2024-11-20 13:11:36 +00:00
Tom Poole
71af005543 Bump version number to 8.0.4 2024-11-18 10:12:15 +00:00
無常
a784d5776b TextLayout: Fix getStringBounds of empty strings 2024-10-24 19:40:42 +01:00
reuk
90f37e27ea Windows: Fix DLL build
There were a few "ambiguous operator new/delete" errors that were due to
inheriting from a private base class that used the leak detector. These
errors are resolved by adding the leak detector to the derived classes.

JUCE_API was missing from a few useful types, notably the ARA hosting
types.
2024-10-22 13:24:46 +01:00
attila
82080f9372 ShapedText: Apply the horizontal scaling to the extra kerning
This fixes an undesired behaviour where squashing the text using
GlyphArrangement::addFittedText would only squash the visible glyphs but
not the additional kerning space between them.
2024-10-21 15:34:42 +02:00
attila
8693507ead ShapedText: Apply extra kerning only before clusters
This avoids inserting tracking between glyphs in a single cluster e.g. a
base glyph and diacritic marks.
2024-10-21 15:34:42 +02:00
attila
503788fd0c ShapedText: Fix falsely marking glyphs with missing extent information as whitespace 2024-10-21 15:34:42 +02:00
attila
bd14d47211 SimpleShapedText: Restore and tidy up earlier line breaking logic
This commit isn't fixing any known bugs, but restores the soft break
iteration logic to its state prior to
5e4016b4fb, which accidentally changed it.
2024-10-21 15:34:42 +02: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
reuk
14f663bc0e
CoreGraphics: Fix issue where text using simulated italic could be drawn at the wrong point
This was evident in the FontsDemo when using the CoreGraphics renderer,
selecting a font without an italic face, and enabling the italic style.
The glyph anchor positions were incorrectly transformed by the text
matrix, causing the left margin of the text to become tilted.

We now correct for the slant and scale specified in the text matrix when
computing glyph anchor positions.
2024-10-20 22:59:38 +01:00
reuk
7f52509c78
Direct2D: Simplify SwapChain buffer creation 2024-10-16 10:36:53 +01:00
reuk
80ac9a78a0
Singleton: Add new macros to simplify singleton creation
The INLINE macros allow singletons to be declared and defined in one
line, without requiring a separate JUCE_IMPLEMENT_SINGLETON statement.
2024-10-16 10:36:52 +01:00
Tom Poole
14c8d06fb0 Bump version number to 8.0.3 2024-10-15 22:16:12 +01:00
Tom Poole
0f3bad8152 Font: Avoid a crash on systems with no fonts installed 2024-10-15 14:27:23 +01:00
reuk
f5cc7902b1 Direct2D: Avoid using dirty rects when painting full frame
This fixes an issue where Direct2D will emit an error when using dirty
rects on the first full frame after resizing.

The issue isn't present on all hardware/drivers, but was observed on a
Windows 11 computer with a 890M iGPU.
2024-10-14 11:13:26 +01:00
attila
83dc660a30 Fonts: MacOS: Return styles in the order reported by the system
This is more likely to place the regular/default style first in the list
of styles. This change partially reverts a behavioural change in
68d0ea9dfb.
2024-10-10 17:53:10 +02:00
reuk
97cd4fc162
Direct2D: Reinstate multithreading support for D2D factory
Partially reverts a change made in
362a1cc070.

The factory needs to be multithreading-enabled in order to support e.g.
drawing to the screen on the main thread and drawing to an Image on a
background thread, even when no resources other than the graphics device
are shared between the two threads.
2024-10-10 16:11:24 +01:00
reuk
362a1cc070
Direct2D: Convert unnecessary multi-threaded factory to single-threaded 2024-10-10 11:47:18 +01:00