Questions tagged [uifont]

The UIFont class provides the interface for getting and setting font information. The class provides you with access to the font’s characteristics and also provides the system with access to the font’s glyph information, which is used during layout. You use font objects by passing them to methods that accept them as a parameter. Available in iOS 2.0 and later in UIKit.

The class provides access to the font’s characteristics and also provides the system with access to the font’s glyph information, which is used during layout. You use font objects by passing them to methods that accept them as a parameter.

You do not create UIFont objects using the alloc and init methods. Instead, you use class methods of UIFont to look up and retrieve the desired font object. These methods check for an existing font object with the specified characteristics and return it if it exists. Otherwise, they create a new font object based on the desired font characteristics.

Resources:

732 questions
47
votes
6 answers

Custom UIFont baseline shifted

I'm having a problem with custom UIFonts. I load 6 of them (font A in regular/bold/regularItalic/boldItalic, font B in condensed/condensedSlanted variants). However, here is what it gives when rendered: The two first rows are OK, but the last one…
Cyrille
  • 25,014
  • 12
  • 67
  • 90
46
votes
17 answers

Custom Font in ios not working

I want to use HelveticaNeue-UltraLight in my ios application. I'm adding the font file as a resource to my project and adding the "Fonts provided by application" key in the plist file. The file name is HelveticaNeue.dfont and I've added it to the…
the Reverend
  • 12,305
  • 10
  • 66
  • 121
45
votes
3 answers

Convert from SwiftUI.Font to UIFont

I have a UIViewRepresentable with a UITextView and I want to set the font on the UITextView using the current Font from the SwiftUI environment. I just need a simple init like: UIFont(_ swiftUIFont: Font) But I can't find any such thing. And the…
Richard Venable
  • 8,310
  • 3
  • 49
  • 52
41
votes
4 answers

How do you change the color of a UIFont?

I've searched the web and I can't get a good answer, although I'm sure this is very simple. Can someone please show me how to do the following: Make a UIFont of name "Helvetica-Bold", size 8.0, and color of black. I've got the name and size, but I…
CodeGuy
  • 28,427
  • 76
  • 200
  • 317
41
votes
6 answers

How do you set the font size on a UIBarButtonItem?

I can't find a way to set the font size of the title in a custom UIBarButtonItem. The only way I can think of getting around this is to set it as an image, which I would like to avoid. Any other suggestions?
Jim
  • 890
  • 2
  • 10
  • 22
41
votes
6 answers

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

-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";…
Proud Member
  • 40,078
  • 47
  • 146
  • 231
40
votes
7 answers

How to get the font-size or a bold-version of UIFont instance

How to get the font-size of a UIFont instance? Or, if someone can implement this method for UIFont? - (UIFont *)boldFont;
Míng
  • 2,500
  • 6
  • 32
  • 48
39
votes
8 answers

Changing tab bar font in Swift

I have been trying to change the font for the tab bar items however I haven't been able to find any Swift examples. I know that this is how you change it in Objective-C: [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary…
user3746428
  • 11,047
  • 20
  • 81
  • 137
38
votes
5 answers

How to change an UILabel/UIFont's letter spacing?

I've searched loads already and couldn't find an answer. I have a normal UILabel, defined this way: UILabel *totalColors = [[[UILabel alloc] initWithFrame:CGRectMake(5, 7, 120, 69)] autorelease]; totalColors.text = [NSString…
Andre
  • 4,417
  • 8
  • 32
  • 37
37
votes
8 answers

How to get monospaced numbers in UILabel on iOS 9

At WWDC 2015, there was a session about the new “San Francisco” system font in iOS 9. It uses proportional number rendering instead of monospaced numbers by default when linked against the iOS 9 SDK. There is a convenient initializer on NSFont…
Samuel
  • 679
  • 1
  • 7
  • 13
34
votes
3 answers

UITextView font is nil

I created a UITextView with a font size of 14 in a storyboard and hooked it up to the detailDescriptionLabel property of my ViewController. This code is in viewDidLoad: self.detailDescriptionLabel.font=[UIFont systemFontOfSize:10]; NSLog(@"text is…
L D
  • 339
  • 3
  • 3
33
votes
4 answers

How to create bold UIFont

I am doing some word wrapping in my tableview as some of the values are so big they go off the edge of the screen. However, the font and size and boldness dose not match the default settings of the table view and was hoping someone could help me fix…
HurkNburkS
  • 5,492
  • 19
  • 100
  • 183
33
votes
6 answers

How to force UILabel to draw a text with upper case chars?

How to force UILabel to draw a text with upper case chars?
Dmitry
  • 14,306
  • 23
  • 105
  • 189
32
votes
4 answers

Swift 3 error: [_SwiftValue pointSize] unrecognized selector sent to instance

I just migrated our project to swift 3 and see lots of crashes because of one issue: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_SwiftValue pointSize]: unrecognized selector sent to instance The reason for…
Leonid
  • 603
  • 2
  • 7
  • 13
31
votes
6 answers

UIFont fontWithName returns nil

In my info.plist, I added a key "Fonts provided by application" and added EdwardianScriptITCStd.otf But, when I try to get that font, it returns nil: NSLog(@"%@", [UIFont fontWithName:@"EdwardianScriptITCStd" …
0xSina
  • 20,973
  • 34
  • 136
  • 253
1
2
3
48 49