Benches Uncategorized

3

How to set UIFont to bold?

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I checked the documentation but nothing came up. I am able to set the family name and size with [UIFont fontWithName:@"Arial" size:17]; but how do I make it bold?

3 replies

Sign in or join Beachball Help to reply.

  1. 0

    Aleksey Atiskov

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    You can use [UIFont fontWithName:@"Arial-BoldMT" size:17];

  2. 0

    Tom Peck

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    You need to pass in the name of the specific font within the family. Use the "fontNamesForFamilyName" method of UIFont to get a list of names.

    The naming scheme is not consistent. Here are some examples of bold font names:

    "Helvetica-Bold"

    "TimesNewRomanPS-BoldMT"

    "Arial-BoldMT"

    "CourierNewPS-BoldMT"

    "Georgia-Bold"

    Message was edited by: Tom Peck

  3. 0

    EagerEyes

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    If you want to use the system font, you can also use boldSystemFontOfSize.