Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UILabel font : bold and italic [duplicate]

Possible Duplicate:
How do I set bold and italic on UILabel of iPhone/iPad?

I am trying to make UILabel font bold and italic both using system font, but I cant use these both style at a time. so is it possible to make font bold and italic using system font? here is my code,

lblTitle.font = [UIFont italicSystemFontOfSize:[UIFont systemFontSize]]; 

or

lblTitle.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize]];

I want my font Bold and Italic both. Can anyone help me? Thank you in advance.

like image 442
user7388 Avatar asked Dec 24 '12 09:12

user7388


People also ask

How do you make UILabel bold?

Double Click on Bold to select it, and then right click on it to see more options. Select font > Bold from that option. It should do the task.


2 Answers

try this code...

UIFont *yourFont = [UIFont fontWithName:@"Helvetica-BoldOblique" 
                                   size:[UIFont systemFontSize]];
lblTitle.font = yourFont;

you can use also another fontName for BoldItalik like.

Optima-BoldItalic,TimesNewRomanPS-BoldItalicMT,Baskerville-BoldItalic,HelveticaNeue-BoldItalic,etc...

like image 134
Paras Joshi Avatar answered Oct 15 '22 20:10

Paras Joshi


There are several font that contains Bod+Italic in themselves you can use those fonts... One frequently for an example is

lblTitle.font = [UIFont fontWithName:@"Arial-BoldItalicMT" size:16.0f];

others are :

- TrebuchetMS-Bold

- Helvetica-BoldOblique

- This link will help you.

like image 28
Anoop Vaidya Avatar answered Oct 15 '22 19:10

Anoop Vaidya