For the sake of future readers, to see the font features array, in Objective-C it is:
@import CoreText;
and
- (void)fontFeatures:(UIFont *)font {
NSArray *features = CFBridgingRelease(CTFontCopyFeatures((__bridge CTFontRef)font));
if (features) {
NSLog(@"%@: %@", font.fontName, features);
}
}
For HelveticaNeue-UltraLight
that yields:
HelveticaNeue-UltraLight: (
{
CTFeatureTypeIdentifier = 1;
CTFeatureTypeName = Ligatures;
CTFeatureTypeNameID = 258;
CTFeatureTypeSelectors = (
{
CTFeatureSelectorDefault = 1;
CTFeatureSelectorIdentifier = 2;
CTFeatureSelectorName = "Common Ligatures";
CTFeatureSelectorNameID = 259;
}
);
},
{
CTFeatureTypeExclusive = 1;
CTFeatureTypeIdentifier = 6;
CTFeatureTypeName = "Number Spacing";
CTFeatureTypeNameID = 262;
CTFeatureTypeSelectors = (
{
CTFeatureSelectorDefault = 1;
CTFeatureSelectorIdentifier = 0;
CTFeatureSelectorName = "No Change";
CTFeatureSelectorNameID = 264;
},
{
CTFeatureSelectorIdentifier = 1;
CTFeatureSelectorName = "Proportional Numbers";
CTFeatureSelectorNameID = 263;
}
);
},
{
CTFeatureTypeExclusive = 1;
CTFeatureTypeIdentifier = 17;
CTFeatureTypeName = "Character Alternatives";
CTFeatureTypeNameID = 265;
CTFeatureTypeSelectors = (
{
CTFeatureSelectorDefault = 1;
CTFeatureSelectorIdentifier = 0;
CTFeatureSelectorName = "No Change";
CTFeatureSelectorNameID = 264;
},
{
CTFeatureSelectorIdentifier = 1;
CTFeatureSelectorName = "Time Punctuation";
CTFeatureSelectorNameID = 266;
},
{
CTFeatureSelectorIdentifier = 2;
CTFeatureSelectorName = "Compass Punctuation";
CTFeatureSelectorNameID = 267;
},
{
CTFeatureSelectorIdentifier = 3;
CTFeatureSelectorName = "Weather Punctuation";
CTFeatureSelectorNameID = 268;
},
{
CTFeatureSelectorIdentifier = 4;
CTFeatureSelectorName = "Round Lowercase Punctuation";
CTFeatureSelectorNameID = 269;
}
);
}
)
Thus, in iOS 8, for HelveticaNeue-UltraLight
, key 17 is "Character Alternatives", and value 1 is "Time Punctuation".
To see these features in Swift, it is:
import CoreText
and
func fontFeatures(font: UIFont) {
if let features = CTFontCopyFeatures(font) as NSArray! {
println("\(font.fontName): \(features)")
}
}