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

876 commits

Author SHA1 Message Date
reuk
752a676fa6
ImageCache: Avoid data race on impl when accessing cache from a background thread 2021-10-06 16:59:07 +01:00
ed
b9542ccc4c Update code to use C++14 [[deprecated]] attribute
This commit removes the various compiler-specific JUCE_DEPRECATED macros and replaces them with C++14's deprecated attribute. It also removes the JUCE_CATCH_DEPRECATED_CODE_MISUSE flag as we can rely on the override specifier catching usage of these old virtual methods, and tidies up the DOXYGEN preprocessor checks as they were inconsistent across the codebase.
2021-09-29 16:14:00 +01:00
ed
a435026b24 macOS: Use available keyword instead of preprocessor version checks where possible 2021-09-29 16:13:48 +01:00
reuk
1a4296e98b
EdgeTable: Avoid shifts of negative numbers 2021-09-28 14:04:10 +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
Tom Poole
bc75010116 Bump version number to 6.1.2 2021-09-20 12:15:47 +01:00
Tom Poole
5109e30c6f Bump version number to 6.1.1 2021-09-09 12:51:15 +01:00
ed
b760620e05 TextLayout: Ensure that line origin is set correctly when line starts with whitespace or newline glyphs 2021-09-02 08:35:14 +01:00
ed
c26ff2da6b DirectWrite: Don't skip newline glyph runs when performing text layout 2021-09-02 08:35:14 +01:00
ed
2be72f6acd Partially revert e1366361
This fixes a bug when creating a TextLayout with whitespace at the start of lines.
2021-08-31 12:15:15 +01:00
Tom Poole
46fe3789fc Bump version number to 6.1.0 2021-08-23 09:55:56 +01:00
ed
588e776bb6 Accessibility: Remove redundant method declaration and general fixups 2021-07-28 11:44:29 +01:00
ed
a2d03d2266 Fixed some warnings flagged by Clang's static analyzer 2021-07-19 15:48:31 +01:00
Tom Poole
d53388097b AudioProcessorGraph: Improve performance when building large graphs 2021-07-08 10:47:36 +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
ed
e1366361ed TextLayout: Skip whitespace tokens in TokenList::createLayout() to fix misalignment when using horizontally centred justification 2021-07-07 10:21:38 +01:00
reuk
71bc141770 AttributedString: Fix faulty font lookup when rendering text
In particularly unfortunate cases, the fonts used for laying out and
drawing an AttributedString could end up differing, meaning that
incorrect glyph indices would be used during rendering. The rendered
text would end up using incorrect character symbols, making it
unreadable.

The problem seems to be:
- The AttributedString fetched a typeface during the getOrCreateFont
  call in createCFAttributedString.
- Details of the typeface (its style and name) were stored into the
  CFAttributedString.
- During `createLayout`, a new `Font` object was created using the
  stored typeface name and style.
- When calling `getTypeface` on this new font, during rendering,
  a different typeface was returned.

The fix implemented here stores the Font objects used during the
creating of the CFAttributedString, so that the fonts written to
the juce::AttributedString are guaranteed to match the fonts used
to compute the layout.
2021-07-05 12:21:36 +01:00
reuk
55f6f3227d TextLayout: Tidy up special member functions 2021-07-05 12:21:36 +01:00
reuk
dcd2ef93f9
Colour: Remove restrictions on argument to brighter() and darker() 2021-06-30 17:03:38 +01:00
Tom Poole
78be43888e Update the minimum C++ standard to C++14 2021-06-24 16:09:48 +01:00
reuk
0c56fa8fa0
Colour: Fix comparisons in HSL conversions 2021-06-23 12:09:34 +01:00
reuk
f0c02529ef
Colour: Avoid divisions by zero 2021-06-21 19:05:40 +01:00
reuk
8dc7636fc4
PathFlatteningIterator: Ensure iterator terminates when flattening paths with very large coordinate values 2021-06-04 13:04:24 +01:00
reuk
7ac6911ccc
Windows: Fix clang/gnu compiler warnings 2021-06-03 17:30:44 +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
ec990202b1 Accessibility: Added VoiceOver (macOS) and Narrator (Windows) accessibility screen reader support to juce_gui_basics 2021-05-10 10:53:14 +01:00
reuk
0f690662d8
AutoResizingNSViewComponent: Fix display issues for certain plugin views
Previously, the following plugins were causing issues when hosting their
editors:

- Softube plugins. I used Saturation Knob for testing, which crashed when
  deleting the temporary parent view.
- KORG Gadget series, which displayed a black screen after the temporary parent
  view was deleted.
- FabFilter Pro-C, which displayed at the wrong scale when opened on a
  retina display.
2021-05-06 15:51:09 +01:00
ed
d6baa1570d Docs: Removed reference to Graphics::getClipRegion() method which no longer exists 2021-04-29 17:33:24 +01:00
ed
a747f7c47f
CoreGraphics: Added convertToPointFloat() helper 2021-04-28 15:38:09 +01:00
ed
d6ac6b543b Removed some unnecessary angled brackets 2021-04-27 15:56:01 +01:00
ed
0fc1ede50f Used MemoryBlock::isEmpty() in a few places 2021-04-22 18:22:06 +01:00
ed
76993469ea CoreGraphics: Fixed a leak when loading an empty MemoryBlock in juce_loadWithCoreImage() 2021-04-22 18:22:06 +01:00
ed
5bff5dc9c8 Whitespace 2021-04-22 18:22:06 +01:00
Tom Poole
ee76137441 Fixed some compiler warnings 2021-04-16 16:44:05 +01:00
Tom Poole
79fbde7099 Added preliminary support for FreeBSD 2021-03-29 14:16:46 +01:00
Tom Poole
2367d648f4 Fixed an issue rendering AttributedStrings containing horizontal font scale 2021-03-25 15:50:21 +00:00
Tom Poole
a9ad07a945 Use RAII for CFTypes 2021-03-25 15:48:35 +00:00
Tom Poole
4c58e50f2e Bump version number to 6.0.8 2021-03-22 09:24:48 +00:00
ed
f9f83fe3fa Correctly scale saturation value to 0-1 in HSL Colour constructor 2021-02-19 19:07:12 +00:00
reuk
64b9366e8f
CharacterFunctions: Add new function to move pointer past whitespace 2021-02-18 10:54:29 +00:00
jules
a9b5fe3a39 Tweaks for emscripten support 2021-02-08 09:59:46 +00:00
reuk
837ab64dbd
Android: Fix numeric conversion warnings 2021-02-03 16:09:54 +00:00
ed
af69be5346 Windows: Tidied up the usage of the JUCE_COMCALL, JUCE_COMCLASS, and JUCE_IUNKNOWNCLASS macros 2021-01-29 15:40:12 +00:00
reuk
3baaad8b5b
XmlElement: Update loops to use new iterators 2021-01-28 20:14:11 +00:00
reuk
ba37f915d6 Font: Fix issue where style changes may also affect the typeface of a Font
On Windows, calls to `createSystemTypefaceFor` with a data buffer always
create a WindowsTypeface instance. However, calls with an existing
`Font` instance may try to create a WindowsDirectWriteTypeface, and will
only fall back to using a WindowsTypeface on failure.

Previously, a missing typeface wasn't treated as a failure, which meant
that `WindowsDirectWriteTypeface` would fall back to the first usable
typeface it could find.

With this change applied, we check whether the
WindowsDirectWriteTypeface actually managed to find the font we
requested, and will fall back to using a plain WindowsTypeface in that
case.
2021-01-27 15:57:52 +00:00
Tom Poole
308757bc48 Tidied up the pixel format classes 2021-01-19 23:29:56 +00:00
reuk
651c91eb56
ColorSpacePtr: Tidy up uses 2021-01-15 15:05:35 +00:00
reuk
60ff8fde97
AttributedString: Fix colourspace used on macOS 2021-01-15 15:05:35 +00:00
reuk
586ab8927d Fix warnings when building in C++20 mode 2021-01-15 13:33:40 +00:00
Tom Poole
2553336f45 Bump version number to 6.0.7 2021-01-14 17:26:20 +00:00