IPhone system font

What is the default system font name on iPhone?

I would like to get this to configure UIView .

+95
ios fonts iphone typeface
01 Oct '10 at 10:25
source share
12 answers

Delighted with purist fonts everywhere, the iPhone interface system uses Helvetica or a variant of it.

Original iPhone, iPhone 3G and Helvetica iPhone 3GS System Interface. As the always-awesome DaringFireball was first noted, the iPhone 4 uses a thinly modified font called "Helvetica Neue." DaringFireball also notes that this change is due to the iPhone 4 display, not the iOS 4 operating system and the old iPhone models running iOS 4 still use Helvetica as a system font.

IPod models released before the iPhone use either Chicago, and Espy Sans, or Myriad and use Helvetica after the iPhone release.

From http://www.everyipod.com/iphone-faq/iphone-who-designed-iphone-font-used-iphone-ringtones.html

For iOS9, it changed to San Fransisco . See http://developer.apple.com/fonts for more details.

+106
Oct 01 '10 at 11:13
source share

If you are doing a software setup, do not hardcode the system font. Use UIFont systemFontOfSize: UIFont boldSystemFontOfSize: and UIFont italicSystemFontOfSize ( Apple documentation ).

This became especially true with iOS 7, which changed the system font to Helvetica Neue.

This has become especially relevant since iOS 9, which again changed the system font in San Francisco.

+103
01 Oct '10 at 11:18
source share

afaik iPhone uses " Helvetica " by default <iOS 10

+15
01 Oct '10 at
source share

You can always use

 UIFont *systemFont = [UIFont systemFontOfSize:12]; NSLog(@"what is it? %@ %@", systemFont.familyName, systemFont.fontName); 

Answer:

Before iOS 6

  Helvetica Helvetica 

iOS 7

 .Helvetica Neue Interface .HelveticaNeueInterface-M3 

but you can just use Helvetica Neue

+11
Aug 22 '13 at 0:05
source share

swift

Specific font

Installing a specific font in Swift is done as follows:

 let myFont = UIFont(name: "Helvetica", size: 17) 

If you do not know the name, you can get a list of available font names, for example:

 print(UIFont.familyNames()) 

Or an even more detailed list:

 for familyName in UIFont.familyNames() { print(UIFont.fontNamesForFamilyName(familyName)) } 

But the system font is changing from version to version of iOS. So it would be better to get the system font dynamically.

System font

 let myFont = UIFont.systemFontOfSize(17) 

But we have a hard-coded size. What if the user has bad eyes and they want to increase the font? Of course, you could make a setting in your application so that the user changes the font size, but it will be annoying if the user has to do this separately for each application on his phone. It would be easier to make one change in the general settings ...

Dynamic font

 let myFont = UIFont.preferredFont(forTextStyle: .body) 

Ah, now we have a system font with a user-selected size for the text style we are working with. This is the recommended way to install the font. See Supportive Dynamic Type for more information about this.

connected with

  • IOS visual font list
  • How to make an attribute string using Swift?
+11
Jan 16 '16 at 10:55
source share

I'm not sure if there is an api to get the system font name by default. So I just get the following name:

  //get system default font UILabel *label = [[UILabel alloc] init]; fontname = label.font.fontName; [label release]; 

It looks stupid, but it works.

+8
May 19 '11 at 3:26
source share

Here are a few updates to support iOS 7. Now it's Dynamic Font Size .

For any applications that support the "Dynamic Type", users can select the font size in iOS 7, which works as a whole on the system, simply by visiting the "General" in the "Settings" section and select "Font Size".

 UIFont *dynamicFont = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; 

And a list of constants, a detailed explanation here

 NSString *const UIFontTextStyleHeadline; NSString *const UIFontTextStyleSubheadline; NSString *const UIFontTextStyleBody; NSString *const UIFontTextStyleFootnote; NSString *const UIFontTextStyleCaption1; NSString *const UIFontTextStyleCaption2; 
+3
Sep 15 '13 at 11:18
source share

The UIFontSystemFonts category for UIFont (UIInterface.h) provides several convenient predefined sizes.

 @interface UIFont (UIFontSystemFonts) + (CGFloat)labelFontSize; + (CGFloat)buttonFontSize; + (CGFloat)smallSystemFontSize; + (CGFloat)systemFontSize; @end 

I use it for chat messages (tags) and it works well when I need to get the size of text blocks.

  [UIFont systemFontOfSize:[UIFont labelFontSize]]; 

Happy coding!

+3
May 14 '14 at 12:46
source share
 UIFont *systemFont = [UIFont systemFontOfSize:[UIFont systemFontSize]]; 

This will give you a system font with the default default font size used for the default label text.

+3
Oct 31 '14 at 11:35
source share

Swift

You should always use the system defaults and not hard code the font name because the default font can be changed by Apple at any time.

There are several standard system fonts (regular, bold , italics) with different sizes (shortcut, button, and others):

 let font = UIFont.systemFont(ofSize: UIFont.systemFontSize) let font2 = UIFont.boldSystemFont(ofSize: UIFont.systemFontSize) let font3 = UIFont.italicSystemFont(ofSize: UIFont.systemFontSize) 

report that the default font size depends on the target view (shortcut, button, others)

Examples:

 let labelFont = UIFont.systemFont(ofSize: UIFont.labelFontSize) let buttonFont = UIFont.systemFont(ofSize: UIFont.buttonFontSize) let textFieldFont = UIFont.systemFont(ofSize: UIFont.systemFontSize) 
+2
Sep 07 '17 at 21:18
source share
  1. download the required .ttf file

  2. add the .ttf file under the copy set resource, double check if the ttf file is added under the resource

  3. In info.pllist add the ttf file name as is.

  4. Now open the font book, add the .ttf file to the font book, select the information icon, there you will find the name of the postscript.

  5. now give the name of the postscript instead of the font name

0
Jan 04 '18 at 12:24
source share

The default font for iOS is San Francisco. You can link to the link for more information.

0
Jul 22 '19 at 6:27
source share



All Articles