зеркало из https://github.com/github/Rebel.git
Ensure that fontName isn't nil
This commit is contained in:
Родитель
0e9680c74b
Коммит
fcf7004256
|
@ -11,6 +11,8 @@
|
||||||
@implementation NSFont (RBLFallbackAdditions)
|
@implementation NSFont (RBLFallbackAdditions)
|
||||||
|
|
||||||
+ (NSFont *)rbl_fontWithName:(NSString *)fontName size:(CGFloat)fontSize fallbackNames:(NSArray *)fallbackNames {
|
+ (NSFont *)rbl_fontWithName:(NSString *)fontName size:(CGFloat)fontSize fallbackNames:(NSArray *)fallbackNames {
|
||||||
|
NSParameterAssert(fontName != nil);
|
||||||
|
|
||||||
NSMutableArray *fallbackDescriptors = [NSMutableArray arrayWithCapacity:fallbackNames.count];
|
NSMutableArray *fallbackDescriptors = [NSMutableArray arrayWithCapacity:fallbackNames.count];
|
||||||
for (NSString *fallbackName in fallbackNames) {
|
for (NSString *fallbackName in fallbackNames) {
|
||||||
[fallbackDescriptors addObject:[NSFontDescriptor fontDescriptorWithName:fallbackName size:fontSize]];
|
[fallbackDescriptors addObject:[NSFontDescriptor fontDescriptorWithName:fallbackName size:fontSize]];
|
||||||
|
|
Загрузка…
Ссылка в новой задаче