이들을 소문자이라고하며, UIFontDescriptor
을 사용하여 켤 수 있습니다.
첫째, 당신은 몇 가지 상수 CoreText를 가져와야 :
#import <CoreText/SFNTLayoutTypes.h>
or
@import CoreText.SFNTLayoutTypes;
그런 다음 글꼴 디스크립터를 사용하여 글꼴을 만들 수 있습니다.
NSDictionary *lowercaseNumbers = @{
UIFontFeatureTypeIdentifierKey: @(kNumberCaseType),
UIFontFeatureSelectorIdentifierKey: @(kLowerCaseNumbersSelector),
};
UIFontDescriptor *descriptor = [[UIFontDescriptor alloc] initWithFontAttributes:
@{
UIFontDescriptorFamilyAttribute: @"Georgia",
UIFontDescriptorFeatureSettingsAttribute:@[ lowercaseNumbers ],
}];
UIFont *font = [UIFont fontWithDescriptor:descriptor size:15];
결과 : : 여기 조지아 제품군을 사용

편집 : 지적 Random832 @으로 조지아는 소문자 숫자를 가지고, 그래서 결과는 무관하다. 그러나 @vikingosegundo이 코드는 지원되는 글꼴에서 작동합니다. 감사.

상단 라인은 활성화가 무슨 소리
NSDictionary *lowercaseNumbers = @{ UIFontFeatureTypeIdentifierKey:@(kNumberCaseType), UIFontFeatureSelectorIdentifierKey: @(kLowerCaseNumbersSelector)};
UIFontDescriptor *descriptor = [[UIFontDescriptor alloc] initWithFontAttributes:
@{UIFontDescriptorFamilyAttribute: @"DIN Next LT Pro",UIFontDescriptorFeatureSettingsAttribute:@[ lowercaseNumbers ]}];
UIFont *font = [UIFont fontWithDescriptor:descriptor size:12];
if (font)
label.font = font;
와
두 번째 줄에 생성 된? 글꼴 작동을 변경하지 않습니까? – Sulthan
글꼴에는 2 개의 숫자 스타일이 있습니다. 안감 스타일이 기본 스타일입니다. @ 술탄 – vikingosegundo
@ 설탕, 어쩌면 내가 추가 한 이미지가 더 명확 해집니다. – vikingosegundo