mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Check for conversion error in Core Text renderer
Original patch by Kazuki Sakamoto.
This commit is contained in:
@@ -927,6 +927,10 @@ defaultAdvanceForFont(CTFontRef fontRef)
|
||||
// Convert UTF-8 chars to UTF-16
|
||||
CFStringRef sref = CFStringCreateWithBytesNoCopy(NULL, s, len,
|
||||
kCFStringEncodingUTF8, false, kCFAllocatorNull);
|
||||
if (sref == NULL) {
|
||||
ASLogWarn(@"Conversion error: some text may not be rendered");
|
||||
continue;
|
||||
}
|
||||
CFIndex unilength = CFStringGetLength(sref);
|
||||
const UniChar *unichars = CFStringGetCharactersPtr(sref);
|
||||
UniChar *buffer = NULL;
|
||||
|
||||
Reference in New Issue
Block a user