April 2015
Intermediate to advanced
556 pages
17h 47m
English
Sometimes, you will find a font that is good but would be perfect if it were bold or italicized or condensed. NSFontManager can be used to make this sort of conversion. You can also use a font manager to change the size of the font.
For example, imagine that you have a font and would like a similar font but bold. Here is the code:
let fontManager = NSFontManager.sharedFontManager()
let boldFont = fontManager.convertFont(someFont,
toHaveTrait: NSFontTraitMask.BoldFontMask)
Read now
Unlock full access