LNUM unavailable in Mavericks via CTFontCopyFeatures

Originator:marcos
Number:rdar://16019362 Date Originated:8 Feb 2014
Status:Duplicate of 16005083 (Open) Resolved:10 Feb 2014
Product:OS X Product Version:10.9.1
Classification:Serious Reproducible:yes
 
Summary:
Under prior versions of OSX, calling CTFontCopyFeatures for a CTFontRef containing the LNUM opentype feature would show three options for kNumberCaseType: 

0: oldstyle figures
1: lining figures
2: no change

in mavericks, only 0 and 2 are available, with the same font.

the problem also manifests itself under advanced typography options in textedit.

Steps to Reproduce:
with the supplied font (or any font using the LNUM opentype feature), compile the following:

    CTFontRef ctf = CTFontCreateWithName(CFSTR("NadyezhdaSLOne-Reg"), 16.0, nil);
    CFArrayRef feats = CTFontCopyFeatures(ctf);
    for (NSDictionary* d in (__bridge NSArray *) feats) {
        if ([d objectForKey:@"CTFeatureTypeIdentifier"] == [NSNumber numberWithInt:21])
            NSLog(@"%@", d);
    }


Expected Results:
{
        CTFeatureTypeExclusive = 1;
        CTFeatureTypeIdentifier = 21;
        CTFeatureTypeName = "Number Case";
        CTFeatureTypeSelectors =         (
                        {
                CTFeatureSelectorIdentifier = 0;
                CTFeatureSelectorName = "Old-Style Figures";
            },
                        {
                CTFeatureSelectorIdentifier = 1;
                CTFeatureSelectorName = "Lining Figures";
            },
                        {
                CTFeatureSelectorDefault = 1;
                CTFeatureSelectorIdentifier = 2;
                CTFeatureSelectorName = "No Change";
            }
        );
    }

Actual Results:
{
        CTFeatureTypeExclusive = 1;
        CTFeatureTypeIdentifier = 21;
        CTFeatureTypeName = "Number Case";
        CTFeatureTypeNameID = "-2200";
        CTFeatureTypeSelectors =         (
                        {
                CTFeatureSelectorIdentifier = 0;
                CTFeatureSelectorName = "Old-Style Figures";
                CTFeatureSelectorNameID = "-2201";
            },
                        {
                CTFeatureSelectorDefault = 1;
                CTFeatureSelectorIdentifier = 2;
                CTFeatureSelectorName = "No Change";
                CTFeatureSelectorNameID = "-2203";
            }
        );
    }

Version:
osx 10.9.1 -- incorrect behavior

osx 10.6.8 -- correct behavior

Notes:
did not have any other versions of osx handy to test

Configuration:
the correct behavior was observed in 10.6, the incorrect behavior showing only two states for NumberCase showed up in 10.9

Attachments:
'Nadyezhda SL One.ttf' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!