美文网首页
自定义字体,让字体统一

自定义字体,让字体统一

作者: Kloar | 来源:发表于2016-01-27 13:58 被阅读45次

.h文件


#import@interface AppStyleConfigure : NSObject

/**

*  获取统一字体

*

*  @return <#return value description#>

*/

+(UIFont*)getAppFont:(CGFloat)size;

+(UIFont*)getAppBoldFont:(CGFloat)size;

@end


.m文件


#import "AppStyleConfigure.h"

@implementation AppStyleConfigure

/**

*  获取统一字体

*

*  @return return value description

*/

+(UIFont*)getAppFont:(CGFloat)size{

if (kMainScreen_width < 370) {

size = size - 1;

size = (size<11) ? 11:size;

return [UIFont fontWithName:@"Arial" size:size];

}else{

return [UIFont fontWithName:@"Arial" size:size];

}

}

+(UIFont*)getAppBoldFont:(CGFloat)size{

if (kMainScreen_width < 370) {

size = size - 1;

size = (size<11) ? 11:size;

return [UIFont fontWithName:@"Arial-BoldMT" size:size];

}else{

return [UIFont fontWithName:@"Arial-BoldMT" size:size];

}

}

@end

相关文章

网友评论

      本文标题:自定义字体,让字体统一

      本文链接:https://www.haomeiwen.com/subject/elgdkttx.html