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
Best answer: 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, 2014

Best answer: 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, 2014

Response by poster: 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, 2014

Response by poster: 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, 2014

« Older Please help me become a more likable, better...   |   4x+y+2z=100, x>y, y>z, x+y+z=j, 3x+z=k, j>k... Newer »
This thread is closed to new comments.