Skip to content

Instantly share code, notes, and snippets.

@akisute
Created October 6, 2015 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akisute/f7e7f528b5d51019bc95 to your computer and use it in GitHub Desktop.
Save akisute/f7e7f528b5d51019bc95 to your computer and use it in GitHub Desktop.
๐ŸŽ Hiragino = ๐Ÿ’ฉ
- (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