From 156c3584f706753e892be77338d1b9c2cb669c5b Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 23 May 2016 01:12:52 -0400 Subject: [PATCH] Documentation update. --- darwin/drawtext.m | 1 + 1 file changed, 1 insertion(+) diff --git a/darwin/drawtext.m b/darwin/drawtext.m index 55e058fe..9061603d 100644 --- a/darwin/drawtext.m +++ b/darwin/drawtext.m @@ -475,6 +475,7 @@ uiDrawTextLayout *uiDrawNewTextLayout(const char *str, uiDrawTextFont *defaultFo // unfortunately the CFRanges for attributes expect UTF-16 codepoints // we want full characters // fortunately CFStringGetRangeOfComposedCharactersAtIndex() is here for us + // https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Strings/Articles/stringsClusters.html says that this does work on surrogate pairs (despite the name), and that this is the preferred function for this particular job anyway backing = CFAttributedStringGetString(layout->mas); n = CFStringGetLength(backing); // allocate one extra, just to be safe