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

602 commits

Author SHA1 Message Date
ed
81534104fb DirectWrite: Don't include trailing whitespace when calculating text layout in CustomDirectWriteTextRenderer::DrawGlyphRun() 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
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
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
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
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
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
ed
9005c81f47 Windows: Fixed a potential crash in the DirectWrite TextLayout::createNativeLayout() implementation 2020-11-25 17:39:57 +00:00
ed
4ddcc7bb61 macOS: Set CoreText underline property when creating native text layout 2020-08-04 10:26:41 +01:00
ed
1b2c9c154b iOS: Don't set the font smoothing property of the graphics context on iOS so that cached Component images render the same as the default 2020-07-20 17:17:54 +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
cbfbd8cf12
CoreGraphics: Use generic colour spaces, instead of device colour spaces 2020-06-09 09:40:59 +01:00
ed
7b17d42039 macOS: Use CGContextGetUserSpaceToDeviceSpaceTransform to get backing scale factor of graphics context to avoid unnecessary upscaling on retina displays on macOS 10.14+ 2020-06-05 09:55:51 +01:00
ed
b5214a341e Normalised lambda whitespace 2020-06-05 09:37:56 +01:00
reuk
092bc44413
MinGW: Fix windows/gcc warnings 2020-05-11 11:28:28 +01:00
reuk
e13901d912 ClangCl: Silence code which warns when building on Windows with Clang 2020-04-27 10:22:06 +01:00
Tom Poole
894e7d2bd2 Updated all license headers 2020-04-23 17:30:39 +01:00
reuk
e7e1de78fa Files: Add RangedDirectoryIterator 2020-04-13 13:16:06 +01:00
reuk
5f348c3040 Warnings: Add warning-wrangling header 2020-04-13 13:16:05 +01:00
reuk
327f817b9b Copyrights: Update commercial/gpl headers to be gpl-only 2020-04-09 15:22:56 +01:00
ed
26c9468dc5 Deprecated AffineTransform::getScaleFactor() as it was producing incorrect values for transforms containing rotations. Added getDeterminant() method for getting the determinant of the transform 2020-03-30 18:34:19 +01:00
ed
441c88f3b9 macOS: Removed all dynamic_cast type_info warning workarounds which have been fixed in 0dd3b02 2020-03-30 12:57:28 +01:00
ed
59a058fdc6 Fixed some warnings flagged up when enabling -Wswitch-enum, -Wswitch-default, -Wredundant-decls, and -Wimplicit-fallthrough 2020-03-09 17:39:28 +00:00
ed
5bda9de977 Windows: Fixed some build errors and warnings when using Clang in Visual Studio 2020-02-06 14:07:42 +00:00
ed
442478680b macOS: Fixed another spurious dynamic_cast warning in CoreGraphicsPixelData 2020-02-05 10:49:25 +00:00
Tom Poole
9798f672c4 macOS: Renamed the CoreGraphicsImage class to avoid a symbol resolution issue in Pro Tools 2020-01-27 10:23:59 +00:00
Tom Poole
47f138464f macOS: Fixed a CoreGraphics text layout bug 2020-01-17 16:34:50 +00:00
ed
a54da0b832 Fixed some more typos 2020-01-07 08:53:23 +00:00
Tom Poole
5ad8b1a50c macOS: Fixed an issue setting the CTFrame size for AttributedStrings 2019-12-30 16:39:07 +00:00
Tom Poole
1d2fc2ddd5 macOS: Fixed an issue restoring graphics state after drawing an AttributedString 2019-12-30 15:12:02 +00:00
Tom Poole
008f097e12 Windows: Fixed a DirectWrite justification bug 2019-12-30 11:38:41 +00:00
Tom Poole
24d7a9a342 Updated some deprecated code use 2019-11-29 10:21:28 +00:00
ed
c78749b14e macOS: Fixed some issues drawing italicised text 2019-08-27 14:03:36 +01:00
reuk
edf99d171f TextLayout: Fixed some bugs setting stringRanges 2019-08-08 17:58:17 +01:00
Tom Poole
ece16bce70 CoreGraphics: Fixed a text layout bug 2019-08-07 18:01:37 +01:00
Tom Poole
c528af5976 macOS: Replaced a deprecated glyph drawing function 2019-08-05 16:50:55 +01:00