Skip to content

Instantly share code, notes, and snippets.

View yuanhao's full-sized avatar

Yuanhao Li yuanhao

  • Germany
View GitHub Profile
#include <iostream>
#include <CoreText/CTFont.h>
#include <CoreText/CTFontCollection.h>
#include <CoreFoundation/CFString.h>
#include <CoreFoundation/CFBase.h>
void callBack(const void *value, void *context) {
CTFontDescriptorRef pDesc = static_cast<CTFontDescriptorRef>(value);
CFStringRef pFamilyName = (CFStringRef)CTFontDescriptorCopyAttribute(pDesc, kCTFontFamilyNameAttribute);