123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- //
- // UIFont+RQExtension.h
- // RQCommon
- //
- // Created by 张嵘 on 2018/11/16.
- // Copyright © 2018 张嵘. All rights reserved.
- //
- /**
- * 但是苹方字体 iOS9.0+出现 需要做适配
- * 这个分类主要用来 字体...
- (
- "PingFangSC-Ultralight",
- "PingFangSC-Regular",
- "PingFangSC-Semibold",
- "PingFangSC-Thin",
- "PingFangSC-Light",
- "PingFangSC-Medium"
- )
- */
- // IOS版本
- #define RQIOSVersion ([[[UIDevice currentDevice] systemVersion] floatValue])
- /// 设置系统的字体大小(YES:粗体 NO:常规)
- #define RQFont(__size__,__bold__) ((__bold__)?([UIFont boldSystemFontOfSize:__size__]):([UIFont systemFontOfSize:__size__]))
- /// 极细体
- #define RQUltralightFont(__size__) ((RQIOSVersion<9.0)?RQFont(__size__ , YES):[UIFont rq_fontForPingFangSC_UltralightFontOfSize:__size__])
- /// 纤细体
- #define RQThinFont(__size__) ((RQIOSVersion<9.0)?RQFont(__size__ , YES):[UIFont rq_fontForPingFangSC_ThinFontOfSize:__size__])
- /// 细体
- #define RQLightFont(__size__) ((RQIOSVersion<9.0)?RQFont(__size__ , YES):[UIFont rq_fontForPingFangSC_LightFontOfSize:__size__])
- // 中等
- #define RQMediumFont(__size__) ((RQIOSVersion<9.0)?RQFont(__size__ , YES):[UIFont rq_fontForPingFangSC_MediumFontOfSize:__size__])
- // 常规
- #define RQRegularFont(__size__) ((RQIOSVersion<9.0)?RQFont(__size__ , NO):[UIFont rq_fontForPingFangSC_RegularFontOfSize:__size__])
- /** 中粗体 */
- #define RQSemiboldFont(__size__) ((RQIOSVersion<9.0)?RQFont(__size__ , YES):[UIFont rq_fontForPingFangSC_SemiboldFontOfSize:__size__])
- /// 苹方常规字体 10
- #define RQRegularFont_10 RQRegularFont(10.0f)
- /// 苹方常规字体 11
- #define RQRegularFont_11 RQRegularFont(11.0f)
- /// 苹方常规字体 12
- #define RQRegularFont_12 RQRegularFont(12.0f)
- /// 苹方常规字体 13
- #define RQRegularFont_13 RQRegularFont(13.0f)
- /** 苹方常规字体 14 */
- #define RQRegularFont_14 RQRegularFont(14.0f)
- /// 苹方常规字体 15
- #define RQRegularFont_15 RQRegularFont(15.0f)
- /// 苹方常规字体 16
- #define RQRegularFont_16 RQRegularFont(16.0f)
- /// 苹方常规字体 17
- #define RQRegularFont_17 RQRegularFont(17.0f)
- /// 苹方常规字体 18
- #define RQRegularFont_18 RQRegularFont(18.0f)
- /// 苹方常规字体 19
- #define RQRegularFont_19 RQRegularFont(19.0f)
- /// 苹方常规字体 20
- #define RQRegularFont_20 RQRegularFont(20.0f)
- #import <UIKit/UIKit.h>
- @interface UIFont (RQExtension)
- /**
- * 苹方极细体
- *
- * @param fontSize 字体大小
- *
- */
- + (instancetype)rq_fontForPingFangSC_UltralightFontOfSize:(CGFloat)fontSize;
- /**
- * 苹方常规体
- *
- * @param fontSize 字体大小
- *
- */
- + (instancetype)rq_fontForPingFangSC_RegularFontOfSize:(CGFloat)fontSize;
- /**
- * 苹方中粗体
- *
- * @param fontSize 字体大小
- *
- */
- + (instancetype)rq_fontForPingFangSC_SemiboldFontOfSize:(CGFloat)fontSize;
- /**
- * 苹方纤细体
- *
- * @param fontSize 字体大小
- *
- */
- + (instancetype)rq_fontForPingFangSC_ThinFontOfSize:(CGFloat)fontSize;
- /**
- * 苹方细体
- *
- * @param fontSize 字体大小
- *
- */
- + (instancetype)rq_fontForPingFangSC_LightFontOfSize:(CGFloat)fontSize;
- /**
- * 苹方中黑体
- *
- * @param fontSize 字体大小
- *
- */
- + (instancetype)rq_fontForPingFangSC_MediumFontOfSize:(CGFloat)fontSize;
- @end
|