Is there a medium weight font between -systemFontOfSize: and -boldSystemFontOfSize:?

Proud Member picture Proud Member · May 1, 2012 · Viewed 25.3k times · Source

-systemFontOfSize is too thin, and boldSystemFontOfSize too thick. I need something inbetween.

When I create a UIFont like this:

[UIFont boldSystemFontOfSize:14];

then the debugger prints this font info:

font-family: ".Helvetica NeueUI"; font-weight: bold; font-style: normal; font-size: 14px

Sometimes fonts have a medium font weight. How can I create a font of this type but with a medium weight?

Answer

Andrei picture Andrei · Sep 2, 2015

Starting with iOS 8.2 you can use:

[UIFont systemFontOfSize:14 weight:UIFontWeightMedium];