Browse Source

Fix for a problem with CoreText when laying out very long text strings

tags/2021-05-28
jules 9 years ago
parent
commit
d0f646a9ad
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      modules/juce_graphics/native/juce_mac_Fonts.mm

+ 6
- 3
modules/juce_graphics/native/juce_mac_Fonts.mm View File

@@ -219,10 +219,13 @@ namespace CoreTextTypeLayout
CGColorSpaceRef rgbColourSpace = CGColorSpaceCreateDeviceRGB();
#endif
CFStringRef cfText = text.getText().toCFString();
CFMutableAttributedStringRef attribString = CFAttributedStringCreateMutable (kCFAllocatorDefault, 0);
CFAttributedStringReplaceString (attribString, CFRangeMake (0, 0), cfText);
CFRelease (cfText);
if (CFStringRef cfText = text.getText().toCFString())
{
CFAttributedStringReplaceString (attribString, CFRangeMake (0, 0), cfText);
CFRelease (cfText);
}
const int numCharacterAttributes = text.getNumAttributes();
const CFIndex attribStringLen = CFAttributedStringGetLength (attribString);


Loading…
Cancel
Save