1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-24 01:54:22 +00:00
JUCE/modules/juce_graphics
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
..
colour Colour: Remove restrictions on argument to brighter() and darker() 2021-06-30 17:03:38 +01:00
contexts Docs: Removed reference to Graphics::getClipRegion() method which no longer exists 2021-04-29 17:33:24 +01:00
effects Clang: Fix warnings when building with clang 10 2020-07-01 10:00:43 +01:00
fonts TextLayout: Tidy up special member functions 2021-07-05 12:21:36 +01:00
geometry PathFlatteningIterator: Ensure iterator terminates when flattening paths with very large coordinate values 2021-06-04 13:04:24 +01:00
image_formats Windows: Fix and suppress some analysis warnings 2021-05-26 15:34:26 +01:00
images Added preliminary support for FreeBSD 2021-03-29 14:16:46 +01:00
native AttributedString: Fix faulty font lookup when rendering text 2021-07-05 12:21:36 +01:00
placement Updated all license headers 2020-06-29 08:30:22 +01:00
juce_graphics.cpp Added preliminary support for FreeBSD 2021-03-29 14:16:46 +01:00
juce_graphics.h Update the minimum C++ standard to C++14 2021-06-24 16:09:48 +01:00
juce_graphics.mm Updated all license headers 2020-06-29 08:30:22 +01:00