1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-13 00:04:19 +00:00

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

This commit is contained in:
jules 2016-01-05 15:38:56 +00:00
parent 420f85bc5f
commit d0f646a9ad

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);