1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-25 02:04:23 +00:00
JUCE/modules/juce_graphics/native
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
..
juce_android_Fonts.cpp Android: Fix numeric conversion warnings 2021-02-03 16:09:54 +00:00
juce_android_GraphicsContext.cpp Updated all license headers 2020-06-29 08:30:22 +01:00
juce_android_IconHelpers.cpp Updated all license headers 2020-06-29 08:30:22 +01:00
juce_freetype_Fonts.cpp Clang: Fix warnings when building with clang 10 2020-07-01 10:00:43 +01:00
juce_linux_Fonts.cpp Added preliminary support for FreeBSD 2021-03-29 14:16:46 +01:00
juce_linux_IconHelpers.cpp Updated all license headers 2020-06-29 08:30:22 +01:00
juce_mac_CoreGraphicsContext.h Updated all license headers 2020-06-29 08:30:22 +01:00
juce_mac_CoreGraphicsContext.mm Used MemoryBlock::isEmpty() in a few places 2021-04-22 18:22:06 +01:00
juce_mac_CoreGraphicsHelpers.h Accessibility: Added VoiceOver (macOS) and Narrator (Windows) accessibility screen reader support to juce_gui_basics 2021-05-10 10:53:14 +01:00
juce_mac_Fonts.mm AttributedString: Fix faulty font lookup when rendering text 2021-07-05 12:21:36 +01:00
juce_mac_IconHelpers.cpp Use RAII for CFTypes 2021-03-25 15:48:35 +00:00
juce_RenderingHelpers.h Windows: Fix and suppress some analysis warnings 2021-05-26 15:34:26 +01:00
juce_win32_Direct2DGraphicsContext.cpp Updated all license headers 2020-06-29 08:30:22 +01:00
juce_win32_Direct2DGraphicsContext.h Updated all license headers 2020-06-29 08:30:22 +01:00
juce_win32_DirectWriteTypeface.cpp Windows: Fix clang/gnu compiler warnings 2021-06-03 17:30:44 +01:00
juce_win32_DirectWriteTypeLayout.cpp Windows: Fix clang/gnu compiler warnings 2021-06-03 17:30:44 +01:00
juce_win32_Fonts.cpp Windows: Fix clang/gnu compiler warnings 2021-06-03 17:30:44 +01:00
juce_win32_IconHelpers.cpp Updated all license headers 2020-06-29 08:30:22 +01:00