在 iOS 中英文字体可以设置斜体,但是对中文字符无效,所以要对中文设置斜体得另外做处理。
//设置中文倾斜
CGAffineTransform matrix = CGAffineTransformMake(1, 0, tanf(5 * (CGFloat)M_PI / 180), 1, 0, 0);
//设置反射。倾斜角度。
UIFontDescriptor *desc = [UIFontDescriptor fontDescriptorWithName:[UIFont systemFontOfSize:14].fontName matrix:matrix];
//取得系统字符并设置反射。
label.font = [UIFont fontWithDescriptor:desc size:14];
作者:赖床综合症
链接://www.greatytc.com/p/20268ff0b298
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。