return true;
}
-// we might move this into our CGUtils...
+/** Assumes src and dst are not NULL. */
static void CFStringToSkString(CFStringRef src, SkString* dst) {
// Reserve enough room for the worst-case string,
// plus 1 byte for the trailing null.
{
AutoCFRelease<CFStringRef> fontName(CTFontCopyPostScriptName(ctFont));
- CFStringToSkString(fontName, &info->fFontName);
+ if (fontName.get()) {
+ CFStringToSkString(fontName, &info->fFontName);
+ }
}
CFIndex glyphCount = CTFontGetGlyphCount(ctFont);
// we take ownership of the ref
static const char* get_str(CFStringRef ref, SkString* str) {
+ if (NULL == ref) {
+ return NULL;
+ }
CFStringToSkString(ref, str);
CFSafeRelease(ref);
return str->c_str();