UIFont possible sizes

2019-08-24 01:59发布

I am trying in an iPhone app to set the possibility for the user to choose the fonts.

I have already made progress using the UIFont class. Here is my question : When the choice of a Font within a Font Family is made how to I know the possibilities the user has for the size? Is there a way to list them? I did not see anything like that in the UIFont documentation or anywhere I looked on the net.

Thanks for any piece of information.

2条回答
我只想做你的唯一
2楼-- · 2019-08-24 02:48

iOS uses scalable fonts, and you can specify the size in fractions of points. So there's no way to list the possibilities. Give the user a few good choices or a slider.

查看更多
虎瘦雄心在
3楼-- · 2019-08-24 02:51

Like David Dunham said, fonts are scalable, so you can use the [UIFont normalSystemFondOfSize:] method to access a font with any size. You can also use [UIFont fontWithName:size:] if you need to actually change the font used.

查看更多
登录 后发表回答