I am trying to make a UILabel
in Swift -- the label will display a simplified Chinese character. I am trying to use the Kaiti SC font that comes with the Mac, it is available in the Font Book and in all of the programs on the Mac, but when I list out the fonts using the following code, it does not show up.
let fontFamilyNames = UIFont.familyNames()
for familyName in fontFamilyNames {
print("Font Family Name = [\(familyName)]")
let names = UIFont.fontNamesForFamilyName(familyName)
print("Font Names = [\(names)]")
}
The code for my UILabel is as follows:
let characterLabel:UILabel! = UILabel(frame: CGRectMake(600,140,300,300));
characterLabel.font = UIFont(name:"Kaiti SC" , size:250.0);
characterLabel.text = "说";
I would have thought all of the fonts on the Mac would be available in my Swift program. (The code, of course, does work with other fonts like "Baskerville", the Chinese characters simply don't look good in those fonts.) Any ideas?