Skip

How do I use Raleway's alternate numerals?
July 22, 2014 5:56 PM   Subscribe

So, I'm using Raleway. It has numbers that descend, though, like the 3, 4, 5, etc. But it also appears to have numbers that do not descend. Yay. How do I use them? Bonus points: how do I make UIKit use them?
posted by jeffamaphone to Media & Arts (4 answers total) 2 users marked this as a favorite
 
Things like alternate numerals are special features of the OpenType format.

How you access them depends on the application you're using. In OS X apps that use the standard Fonts panel, you can click the gear icon and select "Typography" to access OpenType features.

Accessing OpenType Features in UIKit or CoreText on Stack Overflow might help you with the UIKit portion of your question.
posted by bcwinters at 7:10 PM on July 22


Here is an answer on Stack Overflow. The keywords you are looking for are "lining numerals" (what you like) and "old-style" (below the baseline).
posted by dame at 7:11 PM on July 22


Thanks guys. I actually needed both iOS and web solutions. Now that I know what they're called, I think I can get it sorted.
posted by jeffamaphone at 7:33 PM on July 22


For future reference:

NSDictionary *upperCaseNumbers = @{
UIFontFeatureTypeIdentifierKey : @(kNumberCaseType),
UIFontFeatureSelectorIdentifierKey : @(kUpperCaseNumbersSelector)
};

NSDictionary *attributes = @{
UIFontDescriptorNameAttribute : @"Raleway-SemiBold",
UIFontDescriptorFeatureSettingsAttribute : @[ upperCaseNumbers ]
};

UIFontDescriptor *descriptor = [[UIFontDescriptor alloc] initWithFontAttributes:attributes];
UIFont *font = [UIFont fontWithDescriptor:descriptor size:size];

posted by jeffamaphone at 3:48 PM on October 29


« Older I'm unlikable. This is undenia...   |  4x+y+2z=100, x>y, y>z, x... Newer »

You are not logged in, either login or create an account to post comments



Post