Files
keyboard/Shared/KBFont.m

54 lines
1.1 KiB
Mathematica
Raw Normal View History

2025-11-25 15:36:16 +08:00
//
// KBFont.m
//
#import "KBFont.h"
#if __OBJC__
@implementation KBFont
+ (UIFont *)fontOfSize:(CGFloat)designSize weight:(UIFontWeight)weight {
// 375 稿 KBConfig.h KBFit
CGFloat scaledSize = KBFit(designSize);
return [UIFont systemFontOfSize:scaledSize weight:weight];
}
+ (UIFont *)regular:(CGFloat)designSize {
return [self fontOfSize:designSize weight:UIFontWeightRegular];
}
+ (UIFont *)medium:(CGFloat)designSize {
return [self fontOfSize:designSize weight:UIFontWeightMedium];
}
+ (UIFont *)semibold:(CGFloat)designSize {
return [self fontOfSize:designSize weight:UIFontWeightSemibold];
}
+ (UIFont *)bold:(CGFloat)designSize {
return [self fontOfSize:designSize weight:UIFontWeightBold];
}
#pragma mark -
+ (UIFont *)titleFont {
// 18pt
return [self fontOfSize:18.0 weight:UIFontWeightSemibold];
}
+ (UIFont *)bodyFont {
// 14pt
return [self regular:14.0];
}
+ (UIFont *)captionFont {
// 12pt
return [self regular:12.0];
}
@end
#endif