Layout Improvements (New Fonts)
This commit is contained in:
@@ -45,20 +45,21 @@
|
||||
}
|
||||
|
||||
#pragma mark Properties
|
||||
- (NSFont *)font
|
||||
{
|
||||
return self.usesSmallSize ? self.smallFont : self.normalFont;
|
||||
}
|
||||
|
||||
- (CGFloat)fontSize
|
||||
{
|
||||
return self.usesSmallSize ? self.smallFontSize : self.normalFontSize;
|
||||
}
|
||||
|
||||
- (NSFont *)normalFont
|
||||
- (NSFont *)normalFontWithSize:(CGFloat)size
|
||||
{
|
||||
return [NSFont fontWithName:@"CMU Serif"
|
||||
size:self.fontSize];
|
||||
size:size];
|
||||
}
|
||||
|
||||
- (NSFont *)specialFontWithSize:(CGFloat)size
|
||||
{
|
||||
return [NSFont fontWithName:@"CMU Sans Serif Oblique"
|
||||
size:size];
|
||||
}
|
||||
|
||||
- (CGFloat)contextInferredFontSize
|
||||
{
|
||||
return self.usesSmallSize ? self.smallFontSize : self.normalFontSize;
|
||||
}
|
||||
|
||||
- (CGFloat)normalFontSize
|
||||
@@ -66,17 +67,16 @@
|
||||
return 18.0;
|
||||
}
|
||||
|
||||
- (NSFont *)smallFont
|
||||
{
|
||||
return [NSFont fontWithName:@"CMU Serif"
|
||||
size:self.smallFontSize];
|
||||
}
|
||||
|
||||
- (CGFloat)smallFontSize
|
||||
{
|
||||
return 12.0;
|
||||
}
|
||||
|
||||
- (NSFont *)font
|
||||
{
|
||||
return [self normalFontWithSize:self.contextInferredFontSize];
|
||||
}
|
||||
|
||||
#pragma mark Cache Tree
|
||||
// Querying and Storing Caches
|
||||
- (BOOL)hasCacheForElementAtIndex:(NSUInteger)index
|
||||
@@ -154,7 +154,7 @@
|
||||
attributes:@{NSFontAttributeName: font}];
|
||||
CFAttributedStringRef attributedString = CFBridgingRetain(text);
|
||||
CTLineRef line = CTLineCreateWithAttributedString(attributedString);
|
||||
CFRelease(attributedString); // TODO: Is this release appropriate?
|
||||
CFRelease(attributedString);
|
||||
return line;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user