UIFont(name: "STHeitiTC-Medium", size: fontSize)!
Using this font, the line line height become very tall. Can apple include old fonts in iOS9?
UIFont(name: "STHeitiTC-Medium", size: fontSize)!
Using this font, the line line height become very tall. Can apple include old fonts in iOS9?
Run the following code in iOS8 and iOS9, the font was substituted in iOS9. The line height was taller a lot. The font displayed become very small.
Make the font substitution closer to iOS8 or even no substitute font was used.
var chineseFont = "STHeitiTC-Medium"
for i in [20, 10, 8] {
let *** = UIFont(name: chineseFont, size: CGFloat(i))!
print("\(chineseFont) \(***) fontSize:\(i) lineHeight:\(***.lineHeight) pointSize:\(***.pointSize) ascender:\(***.ascender) descender:\(***.descender) capHeight:\(***.capHeight)")
}
iOS9
iOS8
Was there ever any response for this? My app was using this font exclusively, and now it looks all strange in ios 9.
It seems that the font family HeitiTC is removed from iOS 9, and the system just chose the other available Chinese font to adapt which caused your layout to appear strangely. You can use the following snippet to check if it's still available on your device:
for (NSString *fontFamily in [UIFont familyNames]) {
NSLog(@"Family: %@", fontFamily);
for (NSString *fontName in [UIFont fontNamesForFamilyName: family]) {
NSLog(@" %@", fontName");
}
}
What I did was to include a copy of the font file in my app bundle, and it worked like a charm 🙂
Here's a tutorial of how to add custom fonts into your app:
http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/