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

601 commits

Author SHA1 Message Date
reuk
a6a336acb8
Typeface: Add support for querying system fallbacks 2024-04-17 14:41:01 +01:00
reuk
ce4f5377dd
Typeface: Switch to using harfbuzz for computing simple advances on all platforms 2024-04-17 14:41:01 +01:00
reuk
0d2e34f34c
Typeface: Implement platform typefaces using Harfbuzz hb_font_t 2024-04-17 14:41:00 +01:00
reuk
bafd0d293b
Android: Bring font metrics in line with other platforms
This updates the behaviour of Typeface::getStringWidth,
Typeface::getGlyphPositions, and Typeface::getEdgeTableForGlyph to match
the documented behaviour of these functions. Previously, these functions
returned results normalised to a size of 1 point. The new (documented)
behaviour is to normalise to a JUCE height of 1.0 - that is, scaled so
that the sum of the ascent and descent is equal to 1.0.
2024-04-16 21:07:45 +01:00
reuk
1f9ba0682c
ComSmartPtr: Make ownership more explicit
COM objects now always start with a refcount of 1, as is convention.
2024-04-16 21:07:45 +01:00
Tom Poole
94d98a2b10 Update licensing information 2024-04-16 11:39:35 +01:00
Anthony Nicholls
525e9e9ded macOS: Prevent an empty RectangleList from incorrectly filling a graphics context 2024-02-29 12:21:10 +00:00
reuk
047448fbce
Warnings: Add missing overrides 2024-01-30 11:37:30 +00:00
Tom Poole
6bf9bb9a2e Add final specifiers in implementation files 2023-10-10 16:12:38 +01:00
Anthony Nicholls
158220ddfa Formatting: Use nested namespace definitions 2023-10-09 14:49:18 +01:00
Tom Poole
4153d59e39 Formatting 2023-10-02 15:42:20 +01:00
Tom Poole
9b041f3d74 Add a base clang-tidy configuration 2023-09-18 11:24:19 +01:00
Tom Poole
82f1fd57a4 Fix some compiler warnings 2023-08-29 12:59:09 +01:00
reuk
a22e423fc6
CoreGraphics: Refactor for improved consistency 2023-08-09 16:48:01 +01:00
reuk
3894fdbe5f
CoreGraphics: Fix issue where AlertWindow borders were not rendered correctly 2023-05-31 15:15:25 +01:00
reuk
8ed3618e12
CoreGraphicsContext: Fix issue where clipping a gradient on a layer-backed view could cause rendering glitches 2023-05-04 18:42:41 +01:00
reuk
b56f386b6b
CoreGraphicsContext: Reduce repetition 2023-05-04 18:42:41 +01:00
reuk
e414f76cac
CoreGraphicsContext: Replace bool flag with std::optional 2023-05-04 18:42:41 +01:00
reuk
28414a6af8
Global: Avoid floating-point equality checks where possible 2023-04-04 19:55:11 +01:00
Anthony Nicholls
05d5c94990
Native: Rename all native files for improved consistency 2023-04-04 19:54:29 +01:00
reuk
454bc7c63a CoreGraphicsContext: Avoid hanging when drawing transformed tiled images
CGContextGetClipBoundingBox sometimes returns a 'null' rect. When it
does, the following logic will get stuck in the while loop drawing
individual tiles over and over again.
2023-02-03 15:16:13 +01:00
reuk
28f2157912
Convert ignoreUnused to [[maybe_unused]] 2022-12-01 11:41:50 +00:00
reuk
19175ff698
OpenGL: Ensure that macOS uses the same (sRGB) colour space everywhere 2022-09-27 15:18:21 +01:00
attila
c0f31aa12a CoreGraphics: fillAll() fills a larger area to avoid alpha blended edges
Alternatively we could disable antialiasing before the fill operation
but this could cause neighbouring Components to overlap on the screen
even if their coordinates don't.
2022-09-12 15:39:05 +02:00
reuk
5a6c8b1d0a
Linux Fonts: Improve default selection mechanism 2022-09-01 15:44:26 +01:00
reuk
c920eb95fd Fonts: Fix issue where default fonts were set to use non-existent styles 2022-08-23 13:43:03 +01:00
reuk
41ef5b7fd5
macOS: Remove macOS 10.14 preprocessor checks
The current minimum-supported Xcode (10.1) includes the macOS 10.14.1
SDK, so APIs from macOS 10.14 will always be available.
2022-08-04 22:51:17 +01:00
Tom Poole
2ec861d99e Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00
reuk
67e3326ecf
Fonts: Avoid segfaulting on Linux when there are no installed fonts 2022-05-03 11:44:03 +01:00
reuk
3c08f8beda
Linux Fonts: Replace font style if it does not exist for the requested font 2022-04-28 11:05:40 +01:00
reuk
19ddbe2368
Warnings: Fix missing-prototypes warnings 2022-04-22 14:18:48 +01:00
reuk
3bf635e004
Warnings: Always supply all field initialisers
This also fixes an issue where the requested font style could be
incorrectly overwritten.
2022-04-22 14:18:48 +01:00
reuk
6de457f932
Linux Fonts: Add extra default font path 2022-04-22 14:07:46 +01:00
reuk
f9c0c626fe
Linux: Avoid picking a bold/oblique version of Bitstream Vera Sans by default 2022-04-22 13:55:47 +01:00
Tom Poole
dea3fe60e4 Update copyright banners 2022-04-04 12:36:32 +01:00
reuk
db3a0a1ae8
CoreGraphics: Avoid allocating over-large buffers for clipped image data 2022-03-09 17:06:28 +00:00
reuk
5186ac71e2
iOS: Fix no-matching-function error 2022-03-03 12:27:04 +00:00
reuk
e27fb35996
Fonts: Adjust attribute ranges correctly when rendering AttributedStrings
CFAttributedString ranges must be given in terms of 16-bit word offsets,
rather than codepoints.
2022-02-23 10:56:09 +00:00
reuk
0223e44ae7
Image: Keep track of contiguous buffer size to avoid heap buffer overflows
In CoreGraphicsPixelData::createImage, image data was copied from a
BitmapData created from the Image passed into the function.

The BitmapData instance didn't keep track of the size of the buffer it
pointed to, so the buffer size was computed by multiplying the
BitmapData height by its line stride. However, if the BitmapData pointed
to a subsection of an image, the `data` pointer might be offset from
the allocated region, and `data + lineStride * height` would point past
the end of the allocated region. Trying to read/copy this range would
cause a heap buffer overflow at the end of the range.

This change adjusts BitmapData so that it keeps track of the size of the
allocated region. Taking a subsection of an image should subtract the
data pointer offset from the size of the allocated region.
2022-02-23 10:56:09 +00:00
reuk
3d7019bdc2
Fonts: Fix Xcode 13 build issue 2022-02-08 17:48:24 +00:00
reuk
50dacbc8fc Mac Fonts: Fix rendering of AttributedStrings with empty ranges
Previously, lifetime management of CTFontRefs was not implemented
correctly. For zero-length ranges, the font may not be retained when
applying it to a CFAttributedString, meaning that the reference stored
in the fontMap sometimes became invalid before
createCFAttributedString() returned.

We now retain font refs when adding them to the font map, and release
them when the map is destroyed, ensuring that the font references remain
valid throughout the lifetime of the map.
2022-02-07 14:24:11 +00:00
reuk
640194c878
MinGW: Improve compatibility
With this patch applied, the DemoRunner should build under MinGW, and be
(nearly) feature-complete compared to the MSVC build.

Specifically, when building with MinGW:
- Adds support for accessibility
- Fixes build issues in the juce_video module
- Fixes a link issue in the VST3 wrapper when VST3_CAN_REPLACE_VST2 is
  defined
- Adds support for the new-style native FileChooser
- Tidies up some other low-severity warnings

Known issues:
- Direct2D rendering is still not supported when building with MinGW due
  to ABI compatibilities.
2022-01-17 10:58:18 +00:00
Tom Poole
07dec2d369 macOS: Suppress leak detector warnings for retained system tray icons on Big Sur 2021-12-15 12:19:06 +00:00
Tom Poole
05796beffd macOS: Fix CGImage memory access violation on Monterey 2021-12-14 14:36:52 +00:00
reuk
03428561ed
ScaledImage: Use in a few more places 2021-12-01 15:44:07 +00:00
ed
a435026b24 macOS: Use available keyword instead of preprocessor version checks where possible 2021-09-29 16:13:48 +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
ed
c26ff2da6b DirectWrite: Don't skip newline glyph runs when performing text layout 2021-09-02 08:35:14 +01:00
ed
588e776bb6 Accessibility: Remove redundant method declaration and general fixups 2021-07-28 11:44:29 +01:00
ed
81534104fb DirectWrite: Don't include trailing whitespace when calculating text layout in CustomDirectWriteTextRenderer::DrawGlyphRun() 2021-07-07 10:21:38 +01:00