From 1eb73f52570f3b4a8ac382c73f9029df8fec8f7c Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Tue, 25 Nov 2025 15:36:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=81=E8=A3=85KBFont=EF=BC=8C=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Shared/KBConfig.h | 3 ++ Shared/KBFont.h | 45 ++++++++++++++++ Shared/KBFont.m | 53 +++++++++++++++++++ .../Localization/en.lproj/Localizable.strings | 3 ++ .../zh-Hans.lproj/Localizable.strings | 7 ++- keyBoard.xcodeproj/project.pbxproj | 8 +++ keyBoard/Class/Guard/V/KBGuideKFCell.m | 2 +- keyBoard/Class/Guard/V/KBGuideUserCell.m | 2 +- keyBoard/Class/Guard/VC/KBSexSelVC.m | 12 ++--- keyBoard/Class/Home/V/HomeHeadView.m | 10 ++-- keyBoard/Class/Home/V/HomeHotCell.m | 4 +- keyBoard/Class/Home/V/HomeRankCardCell.m | 6 +-- keyBoard/Class/Home/V/HomeRankDetailPopView.m | 8 +-- keyBoard/Class/Home/V/KBTopThreeView.m | 2 +- keyBoard/Class/Me/V/KBChangeNicknamePopView.m | 8 +-- keyBoard/Class/Me/V/KBGenderPickerPopView.m | 6 +-- keyBoard/Class/Me/V/KBMyHeaderView.m | 12 ++--- keyBoard/Class/Me/V/KBMyKeyboardCell.m | 4 +- keyBoard/Class/Me/V/KBMyListCell.m | 4 +- keyBoard/Class/Me/V/KBPersonInfoItemCell.m | 4 +- keyBoard/Class/Me/V/KBSkinBottomActionView.m | 4 +- keyBoard/Class/Me/V/KBSkinDetailHeaderCell.m | 6 +-- keyBoard/Class/Me/V/KBSkinSectionTitleCell.m | 2 +- keyBoard/Class/Me/V/MySkinCell.m | 4 +- keyBoard/Class/Me/VC/KBFeedBackVC.m | 10 ++-- keyBoard/Class/Me/VC/KBMyKeyBoardVC.m | 2 +- keyBoard/Class/Me/VC/KBNoticeVC.m | 4 +- keyBoard/Class/Me/VC/KBPersonInfoVC.m | 6 +-- keyBoard/Class/Me/VC/MySkinVC.m | 6 +-- keyBoard/Class/Pay/V/KBJfPayCell.m | 4 +- keyBoard/Class/Pay/V/KBVipPayHeaderView.m | 4 +- keyBoard/Class/Pay/V/KBVipReviewItemCell.m | 6 +-- keyBoard/Class/Pay/V/KBVipSubscribeCell.m | 6 +-- keyBoard/Class/Pay/VC/KBJfPay.m | 23 ++++---- keyBoard/Class/Pay/VC/KBVipPay.m | 9 ++-- keyBoard/Class/Search/V/KBSearchBarView.m | 4 +- .../Class/Search/V/KBSearchSectionHeader.m | 2 +- keyBoard/Class/Search/V/KBSkinCardCell.m | 2 +- keyBoard/Class/Search/V/KBTagCell.m | 4 +- keyBoard/Class/Shop/V/KBShopHeadView.m | 14 ++--- 40 files changed, 224 insertions(+), 101 deletions(-) create mode 100644 Shared/KBFont.h create mode 100644 Shared/KBFont.m diff --git a/Shared/KBConfig.h b/Shared/KBConfig.h index 28424a8..de3317a 100644 --- a/Shared/KBConfig.h +++ b/Shared/KBConfig.h @@ -33,6 +33,9 @@ #define KB_BASE_URL @"http://192.168.1.144:7529/api" #endif +#import "KBFont.h" + + // Universal Links 通用链接 #ifndef KB_UL_BASE #define KB_UL_BASE @"https://app.tknb.net/ul" diff --git a/Shared/KBFont.h b/Shared/KBFont.h new file mode 100644 index 0000000..91c020d --- /dev/null +++ b/Shared/KBFont.h @@ -0,0 +1,45 @@ +// +// KBFont.h +// 全局字体工具(主 App 与键盘扩展共用) +// +// 说明: +// - 不做系统 Dynamic Type 适配,字号只按设计稿 + 屏幕宽度等比缩放 +// - 统一从这里取字体,避免在各处到处写死数字和 weight +// + +#ifndef KBFont_h +#define KBFont_h + +#if __OBJC__ + +#import +#import "KBConfig.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface KBFont : NSObject + +/// 按设计稿字号 + 屏幕宽度缩放,返回系统字体 +/// 使用示例:label.font = [KBFont fontOfSize:14 weight:UIFontWeightRegular]; ++ (UIFont *)fontOfSize:(CGFloat)designSize weight:(UIFontWeight)weight; + +/// 常用 weight 封装(设计稿字号) ++ (UIFont *)regular:(CGFloat)designSize; ++ (UIFont *)medium:(CGFloat)designSize; ++ (UIFont *)semibold:(CGFloat)designSize; ++ (UIFont *)bold:(CGFloat)designSize; + +/// 根据当前项目大致预设的几个常用语义字号 +/// 可以按设计调整里面的数值,不影响调用方 ++ (UIFont *)titleFont; // 标题,例如 18pt 半粗 ++ (UIFont *)bodyFont; // 正文,例如 14pt 常规 ++ (UIFont *)captionFont; // 辅助/备注,例如 12pt 常规 + +@end + +NS_ASSUME_NONNULL_END + +#endif /* __OBJC__ */ + +#endif /* KBFont_h */ + diff --git a/Shared/KBFont.m b/Shared/KBFont.m new file mode 100644 index 0000000..a3fd2ee --- /dev/null +++ b/Shared/KBFont.m @@ -0,0 +1,53 @@ +// +// 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 + diff --git a/Shared/Localization/en.lproj/Localizable.strings b/Shared/Localization/en.lproj/Localizable.strings index d6f2d31..ac20ff9 100644 --- a/Shared/Localization/en.lproj/Localizable.strings +++ b/Shared/Localization/en.lproj/Localizable.strings @@ -92,6 +92,7 @@ // Mine "Settings" = "Settings"; +"Personal" = "Personal"; "My Keyboard" = "My Keyboard"; "Notice" = "Notice"; "Share App" = "Share App"; @@ -159,6 +160,8 @@ "Payment failed" = "Payment failed"; "Purchase: %@ Coins %@" = "Purchase: %@ Coins %@"; "Pay clicked" = "Pay clicked"; +"Points Recharge" = "Points Recharge"; +"My Points" = "My Points"; // Example categories/items "能力" = "Ability"; diff --git a/Shared/Localization/zh-Hans.lproj/Localizable.strings b/Shared/Localization/zh-Hans.lproj/Localizable.strings index 6035eea..09daa7e 100644 --- a/Shared/Localization/zh-Hans.lproj/Localizable.strings +++ b/Shared/Localization/zh-Hans.lproj/Localizable.strings @@ -89,10 +89,11 @@ "Rank" = "排行"; "Recharge Now" = "立即充值"; "By clicking Pay, you indicate your agreement to the" = "点击“支付”即表示您同意"; -"《Embership Agreement》" = "会员协议"; +"《Embership Agreement》" = "《会员协议》"; // Mine "Settings" = "设置"; +"Personal" = "个人"; "My Keyboard" = "我的键盘"; "Notice" = "通知"; "Share App" = "分享app"; @@ -156,7 +157,9 @@ "Payment successful" = "支付成功"; "Payment failed" = "支付失败"; "Purchase: %@ Coins %@" = "购买:%@ Coins %@"; -"Pay clicked" = "Pay clicked"; +"Pay clicked" = "点击支付"; +"Points Recharge" = "积分充值"; +"My Points" = "我的积分"; // 示例商品/分类 "能力" = "能力"; diff --git a/keyBoard.xcodeproj/project.pbxproj b/keyBoard.xcodeproj/project.pbxproj index e70a9a5..eabacb6 100644 --- a/keyBoard.xcodeproj/project.pbxproj +++ b/keyBoard.xcodeproj/project.pbxproj @@ -50,6 +50,8 @@ 04791F8F2ED469C0004E8522 /* KBHostAppLauncher.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F8D2ED469C0004E8522 /* KBHostAppLauncher.m */; }; 04791F922ED48010004E8522 /* KBNoticeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F912ED48010004E8522 /* KBNoticeVC.m */; }; 04791F952ED48028004E8522 /* KBFeedBackVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F942ED48028004E8522 /* KBFeedBackVC.m */; }; + 04791F982ED49CE7004E8522 /* KBFont.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F972ED49CE7004E8522 /* KBFont.m */; }; + 04791F992ED49CE7004E8522 /* KBFont.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F972ED49CE7004E8522 /* KBFont.m */; }; 047C650D2EBC8A840035E841 /* KBPanModalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C650C2EBC8A840035E841 /* KBPanModalView.m */; }; 047C65102EBCA8DD0035E841 /* HomeRankContentVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C650F2EBCA8DD0035E841 /* HomeRankContentVC.m */; }; 047C65502EBCBA9E0035E841 /* KBShopVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C654F2EBCBA9E0035E841 /* KBShopVC.m */; }; @@ -258,6 +260,8 @@ 04791F912ED48010004E8522 /* KBNoticeVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBNoticeVC.m; sourceTree = ""; }; 04791F932ED48028004E8522 /* KBFeedBackVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBFeedBackVC.h; sourceTree = ""; }; 04791F942ED48028004E8522 /* KBFeedBackVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFeedBackVC.m; sourceTree = ""; }; + 04791F962ED49CE7004E8522 /* KBFont.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBFont.h; sourceTree = ""; }; + 04791F972ED49CE7004E8522 /* KBFont.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFont.m; sourceTree = ""; }; 047C650B2EBC8A840035E841 /* KBPanModalView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBPanModalView.h; sourceTree = ""; }; 047C650C2EBC8A840035E841 /* KBPanModalView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBPanModalView.m; sourceTree = ""; }; 047C650E2EBCA8DD0035E841 /* HomeRankContentVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeRankContentVC.h; sourceTree = ""; }; @@ -1273,6 +1277,8 @@ 04A9FE1F2EB893F10020DB6D /* Localization */, 04FC98012EB36AAB007BD342 /* KBConfig.h */, 04122F592EC5D40000EF7AB3 /* KBAPI.h */, + 04791F962ED49CE7004E8522 /* KBFont.h */, + 04791F972ED49CE7004E8522 /* KBFont.m */, A1B2C4002EB4A0A100000001 /* KBAuthManager.h */, A1B2C4002EB4A0A100000002 /* KBAuthManager.m */, A1B2C4232EB4B7A100000001 /* KBKeyboardPermissionManager.h */, @@ -1557,6 +1563,7 @@ 049FB22F2EC34EB900FAB05D /* KBStreamTextView.m in Sources */, 04FC95702EB09516007BD342 /* KBFunctionView.m in Sources */, 049FB23F2EC4B6EF00FAB05D /* KBULBridgeNotification.m in Sources */, + 04791F992ED49CE7004E8522 /* KBFont.m in Sources */, 04FC956D2EB054B7007BD342 /* KBKeyboardView.m in Sources */, 04FC95672EB0546C007BD342 /* KBKey.m in Sources */, A1B2C3F42EB35A9900000001 /* KBFullAccessGuideView.m in Sources */, @@ -1630,6 +1637,7 @@ 0477BDF02EBB76E30055D639 /* HomeSheetVC.m in Sources */, 048908E62EBF841B00FABA60 /* KBSkinDetailTagCell.m in Sources */, 04FC97002EB30A00007BD342 /* KBGuideTopCell.m in Sources */, + 04791F982ED49CE7004E8522 /* KBFont.m in Sources */, 0477BDFA2EBC66340055D639 /* HomeHeadView.m in Sources */, 04FC97032EB30A00007BD342 /* KBGuideKFCell.m in Sources */, 04FC97062EB30A00007BD342 /* KBGuideUserCell.m in Sources */, diff --git a/keyBoard/Class/Guard/V/KBGuideKFCell.m b/keyBoard/Class/Guard/V/KBGuideKFCell.m index 14a9ac2..a6b5938 100644 --- a/keyBoard/Class/Guard/V/KBGuideKFCell.m +++ b/keyBoard/Class/Guard/V/KBGuideKFCell.m @@ -67,7 +67,7 @@ if (!_contentLabel) { _contentLabel = [UILabel new]; _contentLabel.numberOfLines = 0; - _contentLabel.font = [UIFont systemFontOfSize:15]; + _contentLabel.font = [KBFont regular:15]; _contentLabel.textColor = [UIColor colorWithWhite:0.15 alpha:1.0]; } return _contentLabel; diff --git a/keyBoard/Class/Guard/V/KBGuideUserCell.m b/keyBoard/Class/Guard/V/KBGuideUserCell.m index 88dd15c..b856b50 100644 --- a/keyBoard/Class/Guard/V/KBGuideUserCell.m +++ b/keyBoard/Class/Guard/V/KBGuideUserCell.m @@ -49,7 +49,7 @@ if (!_contentLabel) { _contentLabel = [UILabel new]; _contentLabel.numberOfLines = 0; - _contentLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _contentLabel.font = [KBFont medium:16]; _contentLabel.textColor = [UIColor whiteColor]; _contentLabel.textAlignment = NSTextAlignmentCenter; } diff --git a/keyBoard/Class/Guard/VC/KBSexSelVC.m b/keyBoard/Class/Guard/VC/KBSexSelVC.m index 55ca428..f44ebb9 100644 --- a/keyBoard/Class/Guard/VC/KBSexSelVC.m +++ b/keyBoard/Class/Guard/VC/KBSexSelVC.m @@ -281,7 +281,7 @@ typedef NS_ENUM(NSInteger, KBSexOption) { if (!_titleLabel) { _titleLabel = [UILabel new]; _titleLabel.text = @"Please Select Your Gender"; - _titleLabel.font = [UIFont systemFontOfSize:22 weight:UIFontWeightSemibold]; + _titleLabel.font = [KBFont medium:20]; _titleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; _titleLabel.numberOfLines = 1; } @@ -303,7 +303,7 @@ typedef NS_ENUM(NSInteger, KBSexOption) { _skipButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_skipButton setTitle:@"Skip" forState:UIControlStateNormal]; [_skipButton setTitleColor:[UIColor colorWithHex:KBBlackValue] forState:UIControlStateNormal]; - _skipButton.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; + _skipButton.titleLabel.font = [KBFont medium:12]; _skipButton.backgroundColor = [UIColor colorWithHex:0xE9F7F4]; _skipButton.layer.cornerRadius = 16; _skipButton.layer.masksToBounds = YES; @@ -338,7 +338,7 @@ typedef NS_ENUM(NSInteger, KBSexOption) { if (!_maleLabel) { _maleLabel = [UILabel new]; _maleLabel.text = @"Male"; - _maleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold]; + _maleLabel.font = [KBFont medium:20]; _maleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; } return _maleLabel; @@ -366,7 +366,7 @@ typedef NS_ENUM(NSInteger, KBSexOption) { if (!_femaleLabel) { _femaleLabel = [UILabel new]; _femaleLabel.text = @"Female"; - _femaleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular]; + _femaleLabel.font = [KBFont medium:20]; _femaleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; } return _femaleLabel; @@ -402,7 +402,7 @@ typedef NS_ENUM(NSInteger, KBSexOption) { if (!_otherLabel) { _otherLabel = [UILabel new]; _otherLabel.text = @"The Third Gender"; - _otherLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular]; + _otherLabel.font = [KBFont medium:20]; _otherLabel.textColor = [UIColor colorWithHex:KBBlackValue]; } return _otherLabel; @@ -413,7 +413,7 @@ typedef NS_ENUM(NSInteger, KBSexOption) { _confirmButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_confirmButton setTitle:@"Turn On The Keyboard" forState:UIControlStateNormal]; [_confirmButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _confirmButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold]; + _confirmButton.titleLabel.font = [KBFont bold:16]; _confirmButton.backgroundColor = [UIColor blackColor]; _confirmButton.layer.cornerRadius = 30; _confirmButton.layer.masksToBounds = YES; diff --git a/keyBoard/Class/Home/V/HomeHeadView.m b/keyBoard/Class/Home/V/HomeHeadView.m index 651a65b..7883c16 100644 --- a/keyBoard/Class/Home/V/HomeHeadView.m +++ b/keyBoard/Class/Home/V/HomeHeadView.m @@ -154,6 +154,7 @@ KBTopImageButton *btn = self.featureButtons[i]; if (i < count) { btn.textLabel.text = titles[i]; + btn.textLabel.font = [KBFont regular:12]; } UIImage *img = (i < images.count) ? images[i] : nil; btn.iconView.image = img; @@ -188,7 +189,8 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightBold]; +// _titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightBold]; + _titleLabel.font = [KBFont bold:18]; _titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; _titleLabel.textAlignment = NSTextAlignmentCenter; } @@ -198,7 +200,8 @@ - (UILabel *)subTitleLabel { if (!_subTitleLabel) { _subTitleLabel = [[UILabel alloc] init]; - _subTitleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular]; +// _subTitleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular]; + _subTitleLabel.font = [KBFont regular:14]; _subTitleLabel.textColor = self.titleLabel.textColor; _subTitleLabel.textAlignment = NSTextAlignmentCenter; } @@ -236,7 +239,8 @@ _buyButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_buyButton setTitle:KBLocalized(@"Recharge Now") forState:UIControlStateNormal]; [_buyButton setTitleColor:[UIColor colorWithHex:0x1B1F1A] forState:UIControlStateNormal]; - _buyButton.titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; +// _buyButton.titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; + _buyButton.titleLabel.font = [KBFont medium:15]; [_buyButton setBackgroundImage:[UIImage imageNamed:@"recharge_now_icon"] forState:UIControlStateNormal]; [_buyButton addTarget:self action:@selector(onTapBuyAction) forControlEvents:UIControlEventTouchUpInside]; } diff --git a/keyBoard/Class/Home/V/HomeHotCell.m b/keyBoard/Class/Home/V/HomeHotCell.m index f09890f..a3ee0b6 100644 --- a/keyBoard/Class/Home/V/HomeHotCell.m +++ b/keyBoard/Class/Home/V/HomeHotCell.m @@ -121,7 +121,7 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _titleLabel.font = [KBFont medium:16]; _titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; } return _titleLabel; @@ -130,7 +130,7 @@ - (UILabel *)subLabel { if (!_subLabel) { _subLabel = [[UILabel alloc] init]; - _subLabel.font = [UIFont systemFontOfSize:12]; + _subLabel.font = [KBFont regular:12]; _subLabel.textColor = [UIColor colorWithHex:0x9A9A9A]; _subLabel.numberOfLines = 2; } diff --git a/keyBoard/Class/Home/V/HomeRankCardCell.m b/keyBoard/Class/Home/V/HomeRankCardCell.m index 6dce938..aebe906 100644 --- a/keyBoard/Class/Home/V/HomeRankCardCell.m +++ b/keyBoard/Class/Home/V/HomeRankCardCell.m @@ -159,7 +159,7 @@ if (!_titleLabel) { _titleLabel = [UILabel new]; _titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; - _titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _titleLabel.font = [KBFont medium:16]; _titleLabel.textAlignment = NSTextAlignmentCenter; } return _titleLabel; @@ -169,7 +169,7 @@ if (!_descLabel) { _descLabel = [UILabel new]; _descLabel.textColor = [UIColor colorWithHex:0x9A9A9A]; - _descLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; + _descLabel.font = [KBFont regular:12]; _descLabel.textAlignment = NSTextAlignmentCenter; _descLabel.numberOfLines = 2; } @@ -180,7 +180,7 @@ if (!_peopleLabel) { _peopleLabel = [UILabel new]; _peopleLabel.textColor = [UIColor colorWithHex:KBColorValue]; - _peopleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightRegular]; + _peopleLabel.font = [KBFont regular:10]; _peopleLabel.textAlignment = NSTextAlignmentCenter; _peopleLabel.numberOfLines = 2; } diff --git a/keyBoard/Class/Home/V/HomeRankDetailPopView.m b/keyBoard/Class/Home/V/HomeRankDetailPopView.m index 129ceb7..190b4f3 100644 --- a/keyBoard/Class/Home/V/HomeRankDetailPopView.m +++ b/keyBoard/Class/Home/V/HomeRankDetailPopView.m @@ -174,7 +174,7 @@ if (!_titleLabel) { _titleLabel = [UILabel new]; _titleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; - _titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _titleLabel.font = [KBFont medium:16]; _titleLabel.textAlignment = NSTextAlignmentCenter; _titleLabel.text = @"High EQ"; // 默认文案 } @@ -186,7 +186,7 @@ _downloadLabel = [UILabel new]; _downloadLabel.textColor = [UIColor colorWithHex:KBColorValue]; _downloadLabel.backgroundColor = [UIColor colorWithHex:0xEDFFFD]; - _downloadLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium]; + _downloadLabel.font = [KBFont regular:13]; _downloadLabel.textAlignment = NSTextAlignmentCenter; _downloadLabel.text = @"Download: 1 Million"; } @@ -207,7 +207,7 @@ if (!_descLabel) { _descLabel = [UILabel new]; _descLabel.textColor = [UIColor colorWithHex:KBBlackValue]; - _descLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]; + _descLabel.font = [KBFont medium:14]; _descLabel.numberOfLines = 0; _descLabel.text = @"Be Neither Too Close\nNor Too Distant"; } @@ -219,7 +219,7 @@ _saveButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_saveButton setTitle:@"Save" forState:UIControlStateNormal]; [_saveButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; - _saveButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold]; + _saveButton.titleLabel.font = [KBFont medium:16]; _saveButton.backgroundColor = [UIColor colorWithRed:0.02 green:0.75 blue:0.67 alpha:1.0]; _saveButton.layer.cornerRadius = 24.0; _saveButton.layer.masksToBounds = YES; diff --git a/keyBoard/Class/Home/V/KBTopThreeView.m b/keyBoard/Class/Home/V/KBTopThreeView.m index 524028a..1be6e21 100644 --- a/keyBoard/Class/Home/V/KBTopThreeView.m +++ b/keyBoard/Class/Home/V/KBTopThreeView.m @@ -112,7 +112,7 @@ if (!_titleLabel) { _titleLabel = [[UILabel alloc] init]; _titleLabel.textColor = [UIColor colorWithWhite:0.1 alpha:1]; - _titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _titleLabel.font = [KBFont medium:13]; _titleLabel.textAlignment = NSTextAlignmentCenter; } return _titleLabel; diff --git a/keyBoard/Class/Me/V/KBChangeNicknamePopView.m b/keyBoard/Class/Me/V/KBChangeNicknamePopView.m index 7c7a084..1c124db 100644 --- a/keyBoard/Class/Me/V/KBChangeNicknamePopView.m +++ b/keyBoard/Class/Me/V/KBChangeNicknamePopView.m @@ -122,7 +122,7 @@ _titleLabel = [UILabel new]; _titleLabel.text = KBLocalized(@"Change The Nickname"); _titleLabel.textColor = [UIColor blackColor]; - _titleLabel.font = [UIFont systemFontOfSize:22 weight:UIFontWeightBold]; + _titleLabel.font = [KBFont medium:16]; } return _titleLabel; } @@ -159,7 +159,7 @@ if (!_textField) { _textField = [[UITextField alloc] init]; _textField.clearButtonMode = UITextFieldViewModeWhileEditing; - _textField.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold]; + _textField.font = [KBFont medium:16]; _textField.textColor = [UIColor blackColor]; _textField.placeholder = KBLocalized(@"Please Enter The Modified Nickname"); } @@ -171,8 +171,8 @@ _saveButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_saveButton setTitle:KBLocalized(@"Save") forState:UIControlStateNormal]; [_saveButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; - _saveButton.titleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold]; - _saveButton.backgroundColor = [UIColor colorWithRed:0.02 green:0.75 blue:0.67 alpha:1.0]; + _saveButton.titleLabel.font = [KBFont medium:16]; + _saveButton.backgroundColor = [UIColor colorWithHex:KBColorValue]; _saveButton.layer.cornerRadius = 28.0; _saveButton.layer.masksToBounds = YES; // 胶囊按钮 [_saveButton addTarget:self action:@selector(onTapSave) forControlEvents:UIControlEventTouchUpInside]; } diff --git a/keyBoard/Class/Me/V/KBGenderPickerPopView.m b/keyBoard/Class/Me/V/KBGenderPickerPopView.m index 97b1af3..22e9369 100644 --- a/keyBoard/Class/Me/V/KBGenderPickerPopView.m +++ b/keyBoard/Class/Me/V/KBGenderPickerPopView.m @@ -147,7 +147,7 @@ if (![label isKindOfClass:UILabel.class]) { label = [[UILabel alloc] init]; label.textAlignment = NSTextAlignmentCenter; - label.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold]; + label.font = [KBFont medium:16]; } NSString *name = self.items[row][@"name"] ?: @""; label.text = name; @@ -178,7 +178,7 @@ _titleLabel = [UILabel new]; _titleLabel.text = @"Modify Gender"; _titleLabel.textColor = [UIColor blackColor]; - _titleLabel.font = [UIFont systemFontOfSize:22 weight:UIFontWeightBold]; + _titleLabel.font = [KBFont medium:16]; } return _titleLabel; } @@ -222,7 +222,7 @@ _saveButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_saveButton setTitle:@"Save" forState:UIControlStateNormal]; [_saveButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; - _saveButton.titleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold]; + _saveButton.titleLabel.font = [KBFont medium:16]; _saveButton.backgroundColor = [UIColor colorWithRed:0.02 green:0.75 blue:0.67 alpha:1.0]; _saveButton.layer.cornerRadius = 23.0; _saveButton.layer.masksToBounds = YES; [_saveButton addTarget:self action:@selector(onTapSave) forControlEvents:UIControlEventTouchUpInside]; diff --git a/keyBoard/Class/Me/V/KBMyHeaderView.m b/keyBoard/Class/Me/V/KBMyHeaderView.m index 481b7b9..06f8771 100644 --- a/keyBoard/Class/Me/V/KBMyHeaderView.m +++ b/keyBoard/Class/Me/V/KBMyHeaderView.m @@ -107,8 +107,8 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [UILabel new]; - _titleLabel.text = KBLocalized(@"Settings"); // 大标题 - _titleLabel.font = [UIFont systemFontOfSize:30 weight:UIFontWeightBold]; + _titleLabel.text = KBLocalized(@"Personal"); // 大标题 + _titleLabel.font = [KBFont bold:30]; _titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; } return _titleLabel; @@ -118,7 +118,7 @@ if (!_keyboardBtn) { _keyboardBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [_keyboardBtn setTitle:KBLocalized(@"My Keyboard") forState:UIControlStateNormal]; - _keyboardBtn.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightSemibold]; + _keyboardBtn.titleLabel.font = [KBFont medium:10]; [_keyboardBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; _keyboardBtn.backgroundColor = [UIColor colorWithHex:KBColorValue]; _keyboardBtn.layer.cornerRadius = 17; @@ -129,7 +129,7 @@ if (kbImg) { [_keyboardBtn setImage:kbImg forState:UIControlStateNormal]; _keyboardBtn.imageView.contentMode = UIViewContentModeScaleAspectFit; - CGFloat spacing = 6.0; + CGFloat spacing = 3.0; _keyboardBtn.contentEdgeInsets = UIEdgeInsetsMake(0, spacing, 0, spacing); _keyboardBtn.titleEdgeInsets = UIEdgeInsetsMake(0, spacing, 0, -spacing); } @@ -156,8 +156,8 @@ if (!_nameLabel) { _nameLabel = [UILabel new]; _nameLabel.text = @"Notice"; - _nameLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold]; - _nameLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; + _nameLabel.font = [KBFont medium:20]; + _nameLabel.textColor = [UIColor colorWithHex:KBBlackValue]; } return _nameLabel; } diff --git a/keyBoard/Class/Me/V/KBMyKeyboardCell.m b/keyBoard/Class/Me/V/KBMyKeyboardCell.m index 9608f33..e585b22 100644 --- a/keyBoard/Class/Me/V/KBMyKeyboardCell.m +++ b/keyBoard/Class/Me/V/KBMyKeyboardCell.m @@ -91,7 +91,7 @@ + (CGSize)sizeForEmoji:(NSString *)emoji title:(NSString *)title { // 固定高度 44,宽度 = 左右内边距(12+12) + Emoji 宽(按 20 号字估算) + 间距(8) + 文案宽 UIFont *emojiFont = [UIFont systemFontOfSize:20]; - UIFont *titleFont = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + UIFont *titleFont = [KBFont regular:13]; CGFloat emojiW = 0; if (emoji.length > 0) { @@ -128,7 +128,7 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [UILabel new]; - _titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _titleLabel.font = [KBFont regular:13]; _titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; } return _titleLabel; diff --git a/keyBoard/Class/Me/V/KBMyListCell.m b/keyBoard/Class/Me/V/KBMyListCell.m index c42ee4c..2c94197 100644 --- a/keyBoard/Class/Me/V/KBMyListCell.m +++ b/keyBoard/Class/Me/V/KBMyListCell.m @@ -98,8 +98,8 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [UILabel new]; - _titleLabel.font = [UIFont systemFontOfSize:16]; - _titleLabel.textColor = [UIColor colorWithHex:0x222222]; + _titleLabel.font = [KBFont medium:16]; + _titleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; _titleLabel.text = @"Title"; } return _titleLabel; diff --git a/keyBoard/Class/Me/V/KBPersonInfoItemCell.m b/keyBoard/Class/Me/V/KBPersonInfoItemCell.m index 58699b7..4ec30fb 100644 --- a/keyBoard/Class/Me/V/KBPersonInfoItemCell.m +++ b/keyBoard/Class/Me/V/KBPersonInfoItemCell.m @@ -149,7 +149,7 @@ if (!_titleLabel) { _titleLabel = [UILabel new]; _titleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; - _titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular]; + _titleLabel.font = [KBFont medium:16]; } return _titleLabel; } @@ -158,7 +158,7 @@ if (!_valueLabel) { _valueLabel = [UILabel new]; _valueLabel.textColor = [UIColor colorWithHex:KBBlackValue]; - _valueLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _valueLabel.font = [KBFont bold:16]; _valueLabel.textAlignment = NSTextAlignmentRight; [_valueLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; } diff --git a/keyBoard/Class/Me/V/KBSkinBottomActionView.m b/keyBoard/Class/Me/V/KBSkinBottomActionView.m index 898890f..ba2c283 100644 --- a/keyBoard/Class/Me/V/KBSkinBottomActionView.m +++ b/keyBoard/Class/Me/V/KBSkinBottomActionView.m @@ -113,7 +113,7 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = [UIFont systemFontOfSize:17 weight:UIFontWeightSemibold]; + _titleLabel.font = [KBFont medium:16]; _titleLabel.textColor = [UIColor whiteColor]; _titleLabel.textAlignment = NSTextAlignmentCenter; } @@ -143,7 +143,7 @@ - (UILabel *)priceLabel { if (!_priceLabel) { _priceLabel = [[UILabel alloc] init]; - _priceLabel.font = [UIFont systemFontOfSize:17 weight:UIFontWeightSemibold]; + _priceLabel.font = [KBFont medium:16]; _priceLabel.textColor = [UIColor whiteColor]; _priceLabel.textAlignment = NSTextAlignmentCenter; } diff --git a/keyBoard/Class/Me/V/KBSkinDetailHeaderCell.m b/keyBoard/Class/Me/V/KBSkinDetailHeaderCell.m index 418435f..c5fafe6 100644 --- a/keyBoard/Class/Me/V/KBSkinDetailHeaderCell.m +++ b/keyBoard/Class/Me/V/KBSkinDetailHeaderCell.m @@ -57,8 +57,8 @@ - (UILabel *)leftLabel { if (!_leftLabel) { _leftLabel = [UILabel new]; - _leftLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; - _leftLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold]; + _leftLabel.textColor = [UIColor colorWithHex:KBBlackValue]; + _leftLabel.font = [KBFont medium:16]; _leftLabel.text = @"Dopamine"; } return _leftLabel; @@ -67,7 +67,7 @@ if (!_rightLabel) { _rightLabel = [UILabel new]; _rightLabel.textColor = [UIColor colorWithHex:KBColorValue]; - _rightLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; + _rightLabel.font = [KBFont regular:13]; _rightLabel.textAlignment = NSTextAlignmentRight; _rightLabel.text = @"Download: 1 Million"; } diff --git a/keyBoard/Class/Me/V/KBSkinSectionTitleCell.m b/keyBoard/Class/Me/V/KBSkinSectionTitleCell.m index 7a0d1bf..d672097 100644 --- a/keyBoard/Class/Me/V/KBSkinSectionTitleCell.m +++ b/keyBoard/Class/Me/V/KBSkinSectionTitleCell.m @@ -28,7 +28,7 @@ if (!_titleLabel) { _titleLabel = [UILabel new]; _titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; - _titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold]; + _titleLabel.font = [KBFont medium:14]; _titleLabel.text = @"Recommended Skin"; } return _titleLabel; diff --git a/keyBoard/Class/Me/V/MySkinCell.m b/keyBoard/Class/Me/V/MySkinCell.m index b4a6e91..a6645b5 100644 --- a/keyBoard/Class/Me/V/MySkinCell.m +++ b/keyBoard/Class/Me/V/MySkinCell.m @@ -167,8 +167,8 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [UILabel new]; - _titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]; - _titleLabel.textColor = [UIColor colorWithHex:0x333333]; + _titleLabel.font = [KBFont regular:14]; + _titleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; _titleLabel.text = @"Dopamine"; } return _titleLabel; diff --git a/keyBoard/Class/Me/VC/KBFeedBackVC.m b/keyBoard/Class/Me/VC/KBFeedBackVC.m index fa98f25..ee248ce 100644 --- a/keyBoard/Class/Me/VC/KBFeedBackVC.m +++ b/keyBoard/Class/Me/VC/KBFeedBackVC.m @@ -116,7 +116,7 @@ _textView = [[UITextView alloc] init]; _textView.delegate = self; _textView.backgroundColor = [UIColor clearColor]; - _textView.font = [UIFont systemFontOfSize:16]; + _textView.font = [KBFont medium:14]; _textView.textColor = [UIColor blackColor]; _textView.textContainerInset = UIEdgeInsetsZero; _textView.textContainer.lineFragmentPadding = 0; @@ -129,7 +129,7 @@ if (!_placeholderLabel) { _placeholderLabel = [UILabel new]; _placeholderLabel.textColor = [UIColor colorWithWhite:0.75 alpha:1.0]; - _placeholderLabel.font = [UIFont systemFontOfSize:16]; + _placeholderLabel.font = [KBFont medium:14]; _placeholderLabel.text = KBLocalized(@"Please Enter The Content"); } return _placeholderLabel; @@ -138,8 +138,8 @@ - (UILabel *)countLabel { if (!_countLabel) { _countLabel = [UILabel new]; - _countLabel.textColor = [UIColor colorWithWhite:0.7 alpha:1.0]; - _countLabel.font = [UIFont systemFontOfSize:14]; + _countLabel.textColor = [UIColor colorWithHex:0xACACAC]; + _countLabel.font = [KBFont regular:13]; _countLabel.textAlignment = NSTextAlignmentRight; _countLabel.text = @"0/100"; } @@ -151,7 +151,7 @@ _commitButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_commitButton setTitle:KBLocalized(@"Commit") forState:UIControlStateNormal]; [_commitButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _commitButton.titleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold]; + _commitButton.titleLabel.font = [KBFont medium:16]; // 使用与修改昵称弹窗相近的主色 _commitButton.backgroundColor = [UIColor colorWithRed:0.02 green:0.75 blue:0.67 alpha:1.0]; _commitButton.layer.cornerRadius = 28.0; diff --git a/keyBoard/Class/Me/VC/KBMyKeyBoardVC.m b/keyBoard/Class/Me/VC/KBMyKeyBoardVC.m index b68ea64..02acabd 100644 --- a/keyBoard/Class/Me/VC/KBMyKeyBoardVC.m +++ b/keyBoard/Class/Me/VC/KBMyKeyBoardVC.m @@ -261,7 +261,7 @@ static NSString * const kKBMyKeyboardCellId = @"kKBMyKeyboardCellId"; if (!_saveButton) { _saveButton = [UIButton buttonWithType:UIButtonTypeSystem]; [_saveButton setTitle:KBLocalized(@"Save") forState:UIControlStateNormal]; - _saveButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold]; + _saveButton.titleLabel.font = [KBFont medium:16]; [_saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; _saveButton.backgroundColor = [UIColor colorWithHex:KBColorValue]; _saveButton.layer.cornerRadius = 25; diff --git a/keyBoard/Class/Me/VC/KBNoticeVC.m b/keyBoard/Class/Me/VC/KBNoticeVC.m index ad10810..6f41da3 100644 --- a/keyBoard/Class/Me/VC/KBNoticeVC.m +++ b/keyBoard/Class/Me/VC/KBNoticeVC.m @@ -75,8 +75,8 @@ - (UILabel *)noticeTitleLabel { if (!_noticeTitleLabel) { _noticeTitleLabel = [UILabel new]; - _noticeTitleLabel.textColor = [UIColor blackColor]; - _noticeTitleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold]; + _noticeTitleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; + _noticeTitleLabel.font = [KBFont medium:16]; // 文案可根据需要在 Localizable.strings 中配置多语言 _noticeTitleLabel.text = KBLocalized(@"Notification Setting"); } diff --git a/keyBoard/Class/Me/VC/KBPersonInfoVC.m b/keyBoard/Class/Me/VC/KBPersonInfoVC.m index e167163..3781f98 100644 --- a/keyBoard/Class/Me/VC/KBPersonInfoVC.m +++ b/keyBoard/Class/Me/VC/KBPersonInfoVC.m @@ -273,7 +273,7 @@ _modifyLabel = [UILabel new]; _modifyLabel.text = @"Modify"; _modifyLabel.textColor = [UIColor colorWithHex:KBBlackValue]; - _modifyLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold]; + _modifyLabel.font = [KBFont bold:18]; } return _modifyLabel; } @@ -281,9 +281,9 @@ - (UIButton *)logoutBtn { if (!_logoutBtn) { _logoutBtn = [UIButton buttonWithType:UIButtonTypeSystem]; - [_logoutBtn setTitle:@"Log Out" forState:UIControlStateNormal]; + [_logoutBtn setTitle:KBLocalized(@"Log Out") forState:UIControlStateNormal]; [_logoutBtn setTitleColor:[UIColor colorWithHex:0xFF0000] forState:UIControlStateNormal]; - _logoutBtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _logoutBtn.titleLabel.font = [KBFont medium:16]; _logoutBtn.backgroundColor = UIColor.whiteColor; _logoutBtn.layer.cornerRadius = 12; _logoutBtn.layer.masksToBounds = YES; [_logoutBtn addTarget:self action:@selector(onTapLogout) forControlEvents:UIControlEventTouchUpInside]; diff --git a/keyBoard/Class/Me/VC/MySkinVC.m b/keyBoard/Class/Me/VC/MySkinVC.m index d9091ea..533b160 100644 --- a/keyBoard/Class/Me/VC/MySkinVC.m +++ b/keyBoard/Class/Me/VC/MySkinVC.m @@ -281,8 +281,8 @@ static NSString * const kMySkinCellId = @"kMySkinCellId"; - (UILabel *)selectedLabel { if (!_selectedLabel) { _selectedLabel = [UILabel new]; - _selectedLabel.textColor = [UIColor colorWithHex:0x666666]; - _selectedLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; + _selectedLabel.textColor = [UIColor colorWithHex:KBBlackValue]; + _selectedLabel.font = [KBFont medium:13]; // _selectedLabel.text = @"Selected: 0 Skins"; } return _selectedLabel; @@ -292,7 +292,7 @@ static NSString * const kMySkinCellId = @"kMySkinCellId"; if (!_deleteButton) { _deleteButton = [UIButton buttonWithType:UIButtonTypeSystem]; [_deleteButton setTitle:KBLocalized(@"Delete") forState:UIControlStateNormal]; - _deleteButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _deleteButton.titleLabel.font = [KBFont medium:13]; _deleteButton.layer.cornerRadius = 18; _deleteButton.layer.borderWidth = 1; _deleteButton.clipsToBounds = YES; diff --git a/keyBoard/Class/Pay/V/KBJfPayCell.m b/keyBoard/Class/Pay/V/KBJfPayCell.m index c1aa27d..c48b2ba 100644 --- a/keyBoard/Class/Pay/V/KBJfPayCell.m +++ b/keyBoard/Class/Pay/V/KBJfPayCell.m @@ -211,7 +211,7 @@ if (!_coinLabel) { _coinLabel = [UILabel new]; _coinLabel.text = @"690"; - _coinLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold]; + _coinLabel.font = [KBFont bold:20]; _coinLabel.textColor = [UIColor colorWithHex:KBBlackValue]; } return _coinLabel; @@ -221,7 +221,7 @@ if (!_priceLabel) { _priceLabel = [UILabel new]; _priceLabel.text = @"$6.90"; - _priceLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]; + _priceLabel.font = [KBFont medium:18]; _priceLabel.textColor = [UIColor colorWithHex:KBColorValue]; } return _priceLabel; diff --git a/keyBoard/Class/Pay/V/KBVipPayHeaderView.m b/keyBoard/Class/Pay/V/KBVipPayHeaderView.m index c8be5dc..d2ff5cf 100644 --- a/keyBoard/Class/Pay/V/KBVipPayHeaderView.m +++ b/keyBoard/Class/Pay/V/KBVipPayHeaderView.m @@ -195,7 +195,7 @@ _titleLabel = [[UILabel alloc] init]; _titleLabel.text = @"Become a member of LOVE KEY"; _titleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; - _titleLabel.font = [UIFont systemFontOfSize:25 weight:UIFontWeightBold]; + _titleLabel.font = [KBFont bold:18]; } return _titleLabel; } @@ -204,7 +204,7 @@ _desLabel = [[UILabel alloc] init]; _desLabel.text = @"Unlock all functions"; _desLabel.textColor = [UIColor colorWithHex:KBBlackValue]; - _desLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold]; + _desLabel.font = [KBFont medium:14]; } return _desLabel; } diff --git a/keyBoard/Class/Pay/V/KBVipReviewItemCell.m b/keyBoard/Class/Pay/V/KBVipReviewItemCell.m index 4c4fe1d..6456d42 100644 --- a/keyBoard/Class/Pay/V/KBVipReviewItemCell.m +++ b/keyBoard/Class/Pay/V/KBVipReviewItemCell.m @@ -86,7 +86,7 @@ if (!_nameLabel) { _nameLabel = [UILabel new]; _nameLabel.textColor = [UIColor colorWithHex:KBBlackValue]; - _nameLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]; + _nameLabel.font = [KBFont medium:13]; _nameLabel.text = @"Sdsd666"; } return _nameLabel; @@ -114,8 +114,8 @@ - (UILabel *)contentLabel { if (!_contentLabel) { _contentLabel = [UILabel new]; - _contentLabel.textColor = [UIColor colorWithWhite:0.25 alpha:1.0]; - _contentLabel.font = [UIFont systemFontOfSize:12]; + _contentLabel.textColor = [UIColor colorWithHex:KBBlackValue]; + _contentLabel.font = [KBFont regular:10]; _contentLabel.numberOfLines = 2; _contentLabel.text = @"I Highly Recommend This App. It Taught Me How To Chat"; } diff --git a/keyBoard/Class/Pay/V/KBVipSubscribeCell.m b/keyBoard/Class/Pay/V/KBVipSubscribeCell.m index 5fcf747..0daba95 100644 --- a/keyBoard/Class/Pay/V/KBVipSubscribeCell.m +++ b/keyBoard/Class/Pay/V/KBVipSubscribeCell.m @@ -117,7 +117,7 @@ _titleLabel = [UILabel new]; _titleLabel.text = @"Monthly Subscription"; _titleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; - _titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; + _titleLabel.font = [KBFont medium:13]; } return _titleLabel; } @@ -126,7 +126,7 @@ _priceLabel = [UILabel new]; _priceLabel.text = @"$4.49"; _priceLabel.textColor = [UIColor colorWithHex:KBBlackValue]; - _priceLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold]; + _priceLabel.font = [KBFont bold:20]; } return _priceLabel; } @@ -134,7 +134,7 @@ if (!_strikeLabel) { _strikeLabel = [UILabel new]; _strikeLabel.text = @"$4.49"; - _strikeLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold]; + _strikeLabel.font = [KBFont medium:20]; _strikeLabel.textColor = [UIColor colorWithWhite:0.7 alpha:1.0]; } return _strikeLabel; diff --git a/keyBoard/Class/Pay/VC/KBJfPay.m b/keyBoard/Class/Pay/VC/KBJfPay.m index 3c960fd..85def2c 100644 --- a/keyBoard/Class/Pay/VC/KBJfPay.m +++ b/keyBoard/Class/Pay/VC/KBJfPay.m @@ -50,7 +50,7 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId"; [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(self.view); }]; - self.kb_titleLabel.text = @"Recharge"; + self.kb_titleLabel.text = KBLocalized(@"Points Recharge"); // 默认数据(演示) self.data = @[ @@ -123,7 +123,7 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId"; }]; [self.agreementLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.view); - make.bottom.equalTo(self.agreementButton.mas_top).offset(-8); + make.bottom.equalTo(self.agreementButton.mas_top).offset(0); }]; // 底部按钮 @@ -261,8 +261,8 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId"; - (UILabel *)myPointsTitleLabel { if (!_myPointsTitleLabel) { _myPointsTitleLabel = [UILabel new]; - _myPointsTitleLabel.text = @"My Points"; - _myPointsTitleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _myPointsTitleLabel.text = KBLocalized(@"My Points"); + _myPointsTitleLabel.font = [KBFont medium:14]; _myPointsTitleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; } return _myPointsTitleLabel; @@ -272,7 +272,7 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId"; if (!_pointsLabel) { _pointsLabel = [UILabel new]; _pointsLabel.text = @"4230"; // 示例值 - _pointsLabel.font = [UIFont systemFontOfSize:36 weight:UIFontWeightBold]; + _pointsLabel.font = [KBFont bold:30]; _pointsLabel.textColor = [UIColor colorWithHex:KBColorValue]; } return _pointsLabel; @@ -298,7 +298,8 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId"; if (!_rechargeLabel) { _rechargeLabel = [UILabel new]; _rechargeLabel.text = KBLocalized(@"Recharge Now"); - _rechargeLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; +// _rechargeLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _rechargeLabel.font = [KBFont medium:14]; _rechargeLabel.textColor = [UIColor colorWithHex:KBBlackValue]; } return _rechargeLabel; @@ -333,7 +334,8 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId"; _payButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_payButton setTitle:KBLocalized(@"Recharge Now") forState:UIControlStateNormal]; [_payButton setTitleColor:[UIColor colorWithHex:KBBlackValue] forState:UIControlStateNormal]; - _payButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; +// _payButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _payButton.titleLabel.font = [KBFont medium:15]; // 使用现有的切图(若不存在可退化为渐变图片) UIImage *bg = [UIImage imageNamed:@"recharge_now_icon"]; if (bg) { @@ -352,7 +354,8 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId"; _agreementLabel = [UILabel new]; _agreementLabel.text = KBLocalized(@"By clicking Pay, you indicate your agreement to the"); // 简化文案 - _agreementLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightRegular]; +// _agreementLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightRegular]; + _agreementLabel.font = [KBFont regular:12]; _agreementLabel.textColor = [UIColor colorWithWhite:0.45 alpha:1.0]; } return _agreementLabel; @@ -362,8 +365,8 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId"; _agreementButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_agreementButton setTitle:KBLocalized(@"《Embership Agreement》") forState:UIControlStateNormal]; [_agreementButton setTitleColor:[UIColor colorWithHex:KBColorValue] forState:UIControlStateNormal]; - _agreementButton.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightSemibold]; - +// _agreementButton.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightSemibold]; + _agreementButton.titleLabel.font = [KBFont regular:12]; [_agreementButton addTarget:self action:@selector(agreementButtonAction) forControlEvents:UIControlEventTouchUpInside]; } return _agreementButton; diff --git a/keyBoard/Class/Pay/VC/KBVipPay.m b/keyBoard/Class/Pay/VC/KBVipPay.m index c889bda..8a3c2ad 100644 --- a/keyBoard/Class/Pay/VC/KBVipPay.m +++ b/keyBoard/Class/Pay/VC/KBVipPay.m @@ -72,7 +72,7 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId"; }]; [self.agreementLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.view); - make.bottom.equalTo(self.agreementButton.mas_top).offset(-8); + make.bottom.equalTo(self.agreementButton.mas_top).offset(0); }]; [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self.view); @@ -267,7 +267,8 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId"; _payButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_payButton setTitle:KBLocalized(@"Recharge Now") forState:UIControlStateNormal]; [_payButton setTitleColor:[UIColor colorWithHex:KBBlackValue] forState:UIControlStateNormal]; - _payButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; +// _payButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _payButton.titleLabel.font = [KBFont medium:15]; UIImage *bg = [UIImage imageNamed:@"recharge_now_icon"]; if (bg) { [_payButton setBackgroundImage:bg forState:UIControlStateNormal]; @@ -285,7 +286,7 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId"; if (!_agreementLabel) { _agreementLabel = [UILabel new]; _agreementLabel.text = @"By clicking \"Pay\", you indicate your agreement to the"; - _agreementLabel.font = [UIFont systemFontOfSize:12]; + _agreementLabel.font = [KBFont regular:12]; _agreementLabel.textColor = [UIColor colorWithHex:KBBlackValue]; } return _agreementLabel; @@ -296,7 +297,7 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId"; _agreementButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_agreementButton setTitle:@"《Embership Agreement》" forState:UIControlStateNormal]; [_agreementButton setTitleColor:[UIColor colorWithHex:KBColorValue] forState:UIControlStateNormal]; - _agreementButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightSemibold]; + _agreementButton.titleLabel.font = [KBFont regular:12]; [_agreementButton addTarget:self action:@selector(agreementButtonAction) forControlEvents:UIControlEventTouchUpInside]; } return _agreementButton; diff --git a/keyBoard/Class/Search/V/KBSearchBarView.m b/keyBoard/Class/Search/V/KBSearchBarView.m index e762875..75910be 100644 --- a/keyBoard/Class/Search/V/KBSearchBarView.m +++ b/keyBoard/Class/Search/V/KBSearchBarView.m @@ -86,7 +86,7 @@ if (!_textField) { _textField = [[UITextField alloc] init]; _textField.delegate = self; - _textField.font = [UIFont systemFontOfSize:15]; + _textField.font = [KBFont medium:13]; _textField.textColor = [UIColor colorWithHex:0x1B1F1A]; _textField.clearButtonMode = UITextFieldViewModeWhileEditing; _textField.returnKeyType = UIReturnKeySearch; @@ -104,7 +104,7 @@ - (UIButton *)searchButton { if (!_searchButton) { _searchButton = [UIButton buttonWithType:UIButtonTypeSystem]; - _searchButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _searchButton.titleLabel.font = [KBFont regular:14]; [_searchButton setTitle:@"Search" forState:UIControlStateNormal]; // 绿色样式 [_searchButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; diff --git a/keyBoard/Class/Search/V/KBSearchSectionHeader.m b/keyBoard/Class/Search/V/KBSearchSectionHeader.m index ab4fe6a..481689a 100644 --- a/keyBoard/Class/Search/V/KBSearchSectionHeader.m +++ b/keyBoard/Class/Search/V/KBSearchSectionHeader.m @@ -67,7 +67,7 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold]; + _titleLabel.font = [KBFont medium:14]; _titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; } return _titleLabel; diff --git a/keyBoard/Class/Search/V/KBSkinCardCell.m b/keyBoard/Class/Search/V/KBSkinCardCell.m index 00c4bc4..6a40c92 100644 --- a/keyBoard/Class/Search/V/KBSkinCardCell.m +++ b/keyBoard/Class/Search/V/KBSkinCardCell.m @@ -70,7 +70,7 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightSemibold]; + _titleLabel.font = [KBFont regular:14]; _titleLabel.textColor = [UIColor colorWithHex:KBBlackValue]; } return _titleLabel; diff --git a/keyBoard/Class/Search/V/KBTagCell.m b/keyBoard/Class/Search/V/KBTagCell.m index 2838baf..778586e 100644 --- a/keyBoard/Class/Search/V/KBTagCell.m +++ b/keyBoard/Class/Search/V/KBTagCell.m @@ -30,7 +30,7 @@ + (CGSize)sizeForText:(NSString *)text { if (text.length == 0) { return CGSizeMake(40, 32); } - CGSize s = [text sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]}]; + CGSize s = [text sizeWithAttributes:@{NSFontAttributeName:[KBFont regular:13]}]; // 两侧内边距 12 + 12,高度固定 32 return CGSizeMake(ceil(s.width) + 24, 32); } @@ -40,7 +40,7 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = [UIFont systemFontOfSize:14]; + _titleLabel.font = [KBFont regular:13]; _titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; } return _titleLabel; diff --git a/keyBoard/Class/Shop/V/KBShopHeadView.m b/keyBoard/Class/Shop/V/KBShopHeadView.m index 616cc7e..0fa6d6c 100644 --- a/keyBoard/Class/Shop/V/KBShopHeadView.m +++ b/keyBoard/Class/Shop/V/KBShopHeadView.m @@ -192,8 +192,8 @@ if (!_titleLabel) { _titleLabel = [UILabel new]; _titleLabel.numberOfLines = 0; - _titleLabel.text = @"Points\nMall"; // 两行展示 - _titleLabel.font = [UIFont systemFontOfSize:30 weight:UIFontWeightBold]; + _titleLabel.text = KBLocalized(@"Points\nMall"); // 两行展示 + _titleLabel.font = [KBFont medium:22]; _titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; } return _titleLabel; @@ -254,9 +254,9 @@ - (UILabel *)myPointsLabel { if (!_myPointsLabel) { _myPointsLabel = [UILabel new]; - _myPointsLabel.text = @"My Points"; + _myPointsLabel.text = KBLocalized(@"My Points"); _myPointsLabel.textColor = [UIColor colorWithHex:KBBlackValue]; - _myPointsLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]; + _myPointsLabel.font = [KBFont regular:14]; } return _myPointsLabel; } @@ -274,7 +274,7 @@ _amountLabel = [UILabel new]; _amountLabel.text = @"88.00"; _amountLabel.textColor = [UIColor colorWithHex:KBColorValue]; - _amountLabel.font = [UIFont systemFontOfSize:40 weight:UIFontWeightBold]; + _amountLabel.font = [KBFont bold:40]; _amountLabel.adjustsFontSizeToFitWidth = YES; // _amountLabel.minimumScaleFactor = 0.7; } @@ -284,9 +284,9 @@ - (UIButton *)rechargeButton { if (!_rechargeButton) { _rechargeButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_rechargeButton setTitle:@"Recharge" forState:UIControlStateNormal]; + [_rechargeButton setTitle:KBLocalized(@"Recharge") forState:UIControlStateNormal]; [_rechargeButton setTitleColor:[UIColor colorWithHex:KBBlackValue] forState:UIControlStateNormal]; - _rechargeButton.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold]; + _rechargeButton.titleLabel.font = [KBFont medium:13]; UIImage *bg = [UIImage imageNamed:@"recharge_btn_bg"]; [_rechargeButton setBackgroundImage:bg forState:UIControlStateNormal];