Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITextField font style not changing

I have the following problem - I want to change the UITextField font to a custom one. I am using this line of code:

textField.font = [UIFont fontWithName:@"fontname.ttf" size:20];

I want to use this font: Neurm.ttf Can you please tell me what is wrong or just try it out and tell me is it working?

like image 884
scourGINHO Avatar asked May 16 '13 08:05

scourGINHO


3 Answers

You doing wrong Because no need to set extension (fontname.ttf) in your string.

textField.font = [UIFont fontWithName:@"NEURM TTF" size:20];

and check following links how to use custom font in ios.

1.How to use custom font in iOS Apps?

2.iPhone Development: how to use custom fonts?

like image 112
Dharmbir Singh Avatar answered Oct 05 '22 12:10

Dharmbir Singh


Its possible you may have not gone through some necessary steps to embed a custom font in your app.

Check;

  • iOS Custom Fonts
  • Can I embed a custom font in an iPhone application?

and see if you missed anything.

like image 35
Madhu Avatar answered Oct 05 '22 10:10

Madhu


here

someTf.font = [UIFont fontWithName:@"AlexBrush-Regular" size:20];

This is working correctly no need to give .ttf ext

like image 22
mihir kumar panda Avatar answered Oct 05 '22 11:10

mihir kumar panda