reuk
4122427748
FontOptions: Add some assertions to warn about misuse
2024-06-11 11:34:04 +01:00
reuk
d69dee0f5b
Font: Return correct result from getStringWidth after setting size in points
...
Previously, code such as the following would return a smaller string
width for larger tracking values:
juce::Font f { juce::FontOptions{}.withPointHeight (16.0f) };
const auto g = f.withExtraKerningFactor (1.0f);
const auto a = f.getStringWidth ("foobar");
const auto b = g.getStringWidth ("foobar");
With this change applied, the width 'b' is greater than the width 'a',
as expected.
2024-06-11 11:34:04 +01:00
reuk
6b89bb6f91
Font: Fix result of getDescent(), which was incorrect when font height was set in points
2024-05-20 12:49:56 +01:00
reuk
365e8a235d
Font: Remove unnecessary conversion from point-height to juce-height when using FontOptions
2024-05-20 12:49:56 +01:00
reuk
56d5445f8a
FontOptions: Make it easier to specify font sizes in points
2024-04-29 16:08:22 +01:00
reuk
c5a9e26960
Typeface: Add support for querying the default system UI typeface
2024-04-29 16:08:21 +01:00
reuk
19061e6d17
Direct2D: Add initial support
2024-04-18 14:16:02 +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
2ed9b84070
Font: Add new FontOptions type
2024-04-18 14:16:00 +01:00
reuk
d406d51ad0
TypefaceCache: Refactor to make more concise
2024-04-18 14:16:00 +01:00
reuk
6c4c78baac
Typeface: Fix advances for Apple Color Emoji
...
The glyph spacing for this font does not scale linearly with the font
size; at smaller font sizes, the spacing is relatively larger.
Typeface::getStringWidth, Typeface::getGlyphPositions, and the
equivalent Font member functions now take the font size and horizontal
scale into account when computing advances on Apple platforms.
2024-04-18 14:15:59 +01:00
reuk
a1b23c0248
Font: Add support for querying fallbacks
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
Tom Poole
6bf9bb9a2e
Add final specifiers in implementation files
2023-10-10 16:12:38 +01:00
Tom Poole
4153d59e39
Formatting
2023-10-02 15:42:20 +01:00
Tom Poole
ff0cb4ad5b
Use NullCheckedInvocation in more places
2023-10-02 13:40:10 +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
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