54static bool osakaMonoIsInstalled()
55{
56 RetainPtr<CFDictionaryRef> attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, nullptr, nullptr, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
57 RetainPtr<CTFontDescriptorRef> emptyDescriptor = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get()));
58 RetainPtr<CFArrayRef> fontDescriptors = adoptCF(CTFontDescriptorCreateMatchingFontDescriptors(emptyDescriptor.get(), nullptr));
59 for (CFIndex i = 0; i < CFArrayGetCount(fontDescriptors.get()); ++i) {
60 CTFontDescriptorRef fontDescriptor = static_cast<CTFontDescriptorRef>(CFArrayGetValueAtIndex(fontDescriptors.get(), i));
61 RetainPtr<CFStringRef> name = adoptCF(static_cast<CFStringRef>(CTFontDescriptorCopyAttribute(fontDescriptor, kCTFontNameAttribute)));
62 if (name && CFEqual(name.get(), CFSTR("Osaka-Mono")))
63 return true;
64 }
65 return false;
66}
67