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

61 commits

Author SHA1 Message Date
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
68514d626c Graphics: Added a global GlyphArrangement cache 2022-04-04 12:36:33 +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
394c4fd475 Clang: Fix warnings when building with clang 10 2020-07-01 10:00:43 +01:00
ed
009d685179 Updated all license headers 2020-06-29 08:30:22 +01:00
reuk
3a9e26b26c
Font: Fix deadlock in findTypefaceFor 2020-06-11 12:38:11 +01:00
Tom Poole
894e7d2bd2 Updated all license headers 2020-04-23 17:30:39 +01:00
reuk
327f817b9b Copyrights: Update commercial/gpl headers to be gpl-only 2020-04-09 15:22:56 +01:00
ed
eaf0f990d4 Replaced all uses of static_cast<Type&&> with std::move 2018-11-28 17:29:20 +00: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
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
87042769b6 Tidied up some more old typedefs 2018-05-11 14:44:51 +01:00
jules
58a99ff139 Dragged the singleton macros into the 21st century.. Cleaned up their implementation and gave them new upper-case names to match juce official style. The old names are still defined to avoid breaking old code, but please update before they get deprecated! 2017-12-12 16:24:40 +00:00
jules
2fcb8fa71b Added some prototype function definitions to avoid compiler warnings for people who enable the "missing prototype" flag 2017-10-09 15:39:22 +01:00
jules
3d7c777238 Some light modernisation of a bunch of old code 2017-10-04 12:47:43 +01:00
jules
eda613c6db Moved all "namespace juce" declarations from module headers to the individual .h and .cpp source files. This makes life a lot easier for Intellisense and other IDE autocompletion tools 2017-09-08 08:59:55 +01:00
jules
66fa7e7411 Added some assertions to catch use of some Font methods on background threads 2017-07-06 11:45:26 +01:00
hogliux
b5afccc37c Updated file headers and the README with the JUCE 5 license 2017-04-27 14:43:04 +01:00
jules
bf94ab0e4c Made a few minor tweaks to reduce the number of pedantic -Wfloat-equals warnings 2017-04-21 15:09:35 +01:00
hogliux
9f3fb1c0a6 Added a compiler error if your compiler is too old and removed numerous code checks for old compilers which are now deprecated 2017-02-01 17:18:06 +00:00
jules
2a1234b6ac Simplified some inter-module dependencies and exception-catching fallbacks 2015-12-23 11:47:18 +00:00
jules
9a1a58c454 Tweaked Font::getStringWidth to round-up the value it returns as an int. 2015-07-24 15:55:37 +01:00
hogliux
c7b8e77031 Update copyright notice 2015-07-22 15:59:34 +01:00
jules
4e4a9968a3 Reverted my typo that had changed the minimum font horizontal scale from the old default 0.7 2015-03-19 15:40:48 +00:00
jules
844d9e8d86 Added method Font::getDefaultMinimumHorizontalScaleFactor() to make it possible to change the global minimum font squashing amount. 2015-03-17 11:41:14 +00:00
jules
50a55b2e9c Avoided a few compiler warnings. 2014-12-03 11:45:15 +00:00
jules
02460bb95b A bit of refactoring inside GlyphArrangement, to avoid som edge-cases where the wrong number of lines is chosen. 2014-06-29 14:34:26 +01:00
jules
f4c83a9411 Fix for a very obscure race-condition involving font string initialisation. 2014-04-05 17:39:31 +01:00
jules
a8984031ba Made sure that glyph caches are flushed along with the typeface cache. 2013-10-23 11:50:04 +01:00
jules
af87a2eda6 Added some thread-safety to typeface caching, and optimised default font construction. 2013-09-24 13:37:00 +01:00
jules
c5f1e86cb3 Added some point-size accessor methods to Font. 2013-07-06 10:28:24 +01:00
jules
03c2801f3f Copyright header update in all module files. juce_core modules are now ISC licensed. All other modules are GPLv2/3/AGPLv3 2013-06-13 13:17:12 +01:00
jules
136041daa7 Fixed a couple of base-class copying typos and prevented copying of ReferenceCountedObject bases. 2013-03-08 15:13:07 +00:00
jules
d0135d9efc Worked around a GCC compiler bug. Also tidied up a bunch of GCC warnings. 2013-03-08 14:07:51 +00:00
jules
2ae82c4db4 New method Font::withPointHeight, for specifying font sizes in points. 2012-12-17 21:27:23 +00:00
jules
0ceeb573d8 Minor changes to avoid pedantic compiler warnings. 2012-12-04 21:39:15 +00:00
jules
3f6714ea7d Fixed a leak. 2012-10-05 17:50:17 +01:00
jules
ed83df2d75 Fonts: fix for changing height of customised typefaces. 2012-10-05 17:24:03 +01:00
jules
6b1654e1d2 Fixed some more warnings. 2012-09-24 15:45:25 +01:00
jules
fb5bcb5094 Removed a confusing Font constructor that took a style name but could be mistakenly called with a typeface name. 2012-07-14 12:48:01 +01:00
jules
df729be74a Cleaned-up class inheritance visibilities and encapsulation for some internal classes. 2012-07-12 14:10:46 +01:00
jules
502af083aa Fixed a bug in Font::setUnderline(). 2012-07-11 09:44:10 +01:00
jules
46c327d902 Font::fromString() fix. 2012-07-03 19:43:49 +01:00
jules
b6211f01c8 Added method: Font::withTypefaceStyle(). 2012-07-03 14:39:00 +01:00
jules
625395fc98 Fix for Typeface::clearTypefaceCache() 2012-07-02 15:06:49 +01:00
jules
eeeaf832d5 Added a Typeface::clearTypefaceCache() method. 2012-06-26 10:39:16 +01:00
jules
ec89065a44 Improved thread-safety of Typeface::Ptr 2012-05-22 20:41:50 +01:00
jules
f401d72b4b Tidied up some minor font issues. 2012-05-21 19:02:37 +01:00