+ // Get the next font in the iteration.
+ status = ATSFontFamilyIteratorNext( theFontFamilyIterator, &theATSFontFamilyRef );
+ if(status == noErr)
+ {
+ CFStringRef theName = NULL;
+ ATSFontFamilyGetName(theATSFontFamilyRef, kATSOptionFlagsDefault, &theName);
+ CFArrayAppendValue(atsfontnames, theName);
+ CFRelease(theName);
+
+ }
+ else if (status == kATSIterationScopeModified) // Make sure the font database hasn't changed.
+ {
+ // reset the iterator
+ status = ATSFontFamilyIteratorReset (kATSFontContextLocal, nil, nil,
+ kATSOptionFlagsUnRestrictedScope,
+ &theFontFamilyIterator);
+ CFArrayRemoveAllValues(atsfontnames);
+ }