In iOS 7, users can manipulate their fonts from the control panel, something designed to help (amongst other things) visually impaired users.
I'm trying to work with the new paradign by using the new methods created to support that functionality. For the most part, it's easy enough -- just use [label setFont:[UIFont prefferedFontForTextStyle:UIFontTextStyleHeadline]] or whatever format you need.
But occasionally I need to adjust those. For example, maybe headline needs to be a bit bigger. I can use this answer to that. Unfortunately, I can't figure out how to apply that answer to other changes, such as simply bolding the font without changing the size.
You can try this:
UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleHeadline];
/// Add the bold trait
descriptor = [descriptor fontDescriptorWithSymbolicTraits:UIFontDescriptorTraitBold];
/// Pass 0 to keep the same font size
UIFont *font = [UIFont fontWithDescriptor:descriptor size:0];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With