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
30
votes
6 answers

How do I add a custom font to a Cocoapod?

I want to use a custom font within a Cocoapod, but I can't find anything on using a custom font within a static library. As there is no info.plist file, there is no where to tell the app what font to use. Any ideas?
Quentamia
  • 3,244
  • 3
  • 33
  • 42
27
votes
2 answers

iOS: UIButton titleLabel -- does it do anything at all?

I want to make a UIButton with type UIButtonTypeCustom (for the shape). I want to assign the title using button.titleLabel because I need to specify the font. The following code looks like it should work, but doesn't -- no label shows up,…
Amagrammer
  • 6,385
  • 3
  • 28
  • 30
25
votes
9 answers

Changing Search Bar placeholder text font in Swift

I am trying to change the font of the placeholder text in the search bar within my Search Display Controller. I was looking at some examples and I tried to implement them but as they are in Objective-C, I wasn't able to find any that I could get to…
user3746428
  • 11,047
  • 20
  • 81
  • 137
24
votes
5 answers

Font color for UILabel not changing

I am trying to display numbers on a UILabel with a bold black font and size 50. After some failed attempts I just realized that no matter what color I set the font to, it always gets set to lightGray. Is there something else I need to do other than…
user220201
  • 4,514
  • 6
  • 49
  • 69
23
votes
7 answers

Setting the titleLabel.font property of a of a UIButton not working

In currently working with iOS 7 and I an attempting to increase the font size of the titleLabel of my UIButton. I am doing it like this, [[_centerButton titleLabel] setFont:[UIFont boldSystemFontOfSize:28.0]]; However this does not do anything.…
gossainapps
  • 723
  • 1
  • 7
  • 18
23
votes
3 answers

Get path to trace out a character in an iOS UIFont

Suppose I have a custom font "Foo" that I'm using in my iOS App. I've added it to my project, plist, etc. and I'm able to render UILabels and such with it just fine. Now, if I want to find out a sequence of points that would "trace out" the letter…
Joel
  • 2,285
  • 2
  • 21
  • 22
21
votes
5 answers

UIFontWeightTrait and UIFontDescriptorFamilyAttribute Ignored when creating UIFont from UIFontDescriptor

Given the following code and a device running iOS 7.1 or later: NSDictionary *fontTraitsDictionary = @{UIFontWeightTrait : @(-1.0)}; NSDictionary *attributesDictionary = @{ UIFontDescriptorFamilyAttribute :…
jaredsinclair
  • 12,687
  • 5
  • 35
  • 56
20
votes
4 answers

Detect whether a font is bold/italic on iOS?

Given a UIFont or a CTFont, how can I tell whether the font is bold/italic?
aryaxt
  • 76,198
  • 92
  • 293
  • 442
20
votes
3 answers

iOS Foundation: system font size

I would like to know if systemFontSize in iOS app tableView is always the same for textLabel? This is are depening to style? For example when I NSLog(@"%f",[UIFont systemFontSize]); I'm getting 14.0. Is this are always the same? And what's more:…
Jakub
  • 13,712
  • 17
  • 82
  • 139
19
votes
6 answers

How to convert CGFontRef to UIFont?

I want to use a custom font for a UILabel. The custom font is loaded by from a file: NSString *fontPath = ... ; // a TTF file in iPhone Documents folder CGDataProviderRef fontDataProvider = CGDataProviderCreateWithFilename([fontPath…
ohho
  • 50,879
  • 75
  • 256
  • 383
19
votes
4 answers

How to set font name of UILabel as HelveticaNeue Thin in iOS?

I am creating UILabel, for the label i can set the font name as HelveticaNeue Regular, Light, UltraLight etc, But i unable to set the font name as HelveticaNeue Thin, it is not working as expected. I did like, label.font = [UIFont…
Surfer
  • 1,370
  • 3
  • 19
  • 34
19
votes
6 answers

NSAttributedString change style to bold without changing pointSize?

I am digging into NSAttributedStrings on iOS. I have a model that is returning a persons first and last name as NSAttributesString. (I don't know if it is a good idea to deal with attributed strings in models!?) I want the first name to be printed…
Michael Ochs
  • 2,846
  • 3
  • 27
  • 33
17
votes
2 answers

Dynamically Mocking iOS Dynamic Type System Text Size (UIContentSizeCategory)

I'd like to easily test my app with different selections of system text size, including accessibility sizes. These can be set in the Settings app (Display & Brightness => Text Size or General => Accessibility => Larger Text). The only way I can…
Tim Arnold
  • 8,359
  • 8
  • 44
  • 67
17
votes
6 answers

Ios Swift making font toggle bold, italic, boldItalic, normal without change other attributes

I am surprised, that simply setting bold and italic for existing font is so complicated in Swift. I just want to simplify things by having following methods on font class. I want the below methods to be added to existing font which has font-family…
Sujay U N
  • 4,974
  • 11
  • 52
  • 88
17
votes
5 answers

Custom Font in Xcode 6

I have a custom font that I have imported into xcode that I want to use as a UIFont. When I try to create a UIFont with the fonts name it doesn't work. I've tried looking thru all of the fonts in each font family and I don't see the font. But when I…
GnarGnar
  • 325
  • 1
  • 3
  • 9
1 2
3
48 49