๐ Hiragino = ๐ฉ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (CGSize)sizeThatFitsHiraginoCompatible:(CGSize)size | |
{ | |
// ใใฉใฎใใใฉใณใ(ๆฅๆฌ่ช)ใงๆญฃ็ขบใซๆ็ปใตใคใบใๅๅพใใ | |
// http://qiita.com/yusuga_/items/2be8c55ca561bba44702 | |
// ใใฉใฎใ (Hiragino Kaku Gothic, Hiragino Mincho) ใฎๆใ ใ่ฃๆญฃใใใใ | |
CGSize s = [self sizeThatFits:size]; | |
UIFont *font = self.font; | |
if ([font.familyName hasPrefix:@"Hiragino"]) { | |
s.width = ceil(s.width); | |
s.height = ceil(s.height + fabs(font.descender)); | |
} | |
return s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment