Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SF UI Text-Light(New san francisco) font doesn't work

I am try to change font for a label but it's doesn't work font name:new New san francisco.

Import that font into project and add in info.plist and this is my code

labelname.font = [UIFont fontWithName:@"SF UI Text-Light" size:12];

If I use that's work fine

labelname.font = [UIFont fontWithName:@"HelveticaNeue" size:12];

But New san francisco font doesn't work. I don't know what I miss :(

enter image description here

like image 318
Mathi Arasan Avatar asked Sep 24 '15 13:09

Mathi Arasan


2 Answers

That's happens because you use the wrong System name for the font. Try to use

labelname.font = [UIFont fontWithName:@"SFUIText-Light" size:12];

How to find System font names see here Adding custom fonts to iOS app finding their real names

like image 182
d.rozumeenko Avatar answered Sep 28 '22 04:09

d.rozumeenko


I try to log the system font and find the font name is ".SFUIText-Light" ,so

labelname.font = [UIFont fontWithName:@".SFUIText-Light" size:12];

this is work.

like image 43
newfun Avatar answered Sep 28 '22 05:09

newfun