Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can UITextField and UITextView be made to render fonts the same, or are they just different?

If I create a UILabel, a UITextField, and a UITextView, then set them to have the same layout styles - eg, no background color, white text, and a Courier font at size 18 - the UILabel and UITextField look identical, whereas the UITextView looks different - the font looks thinner.

I took a screenshot of the problem, but I don't have enough reputation to put it inline here. So instead, click here to see my example in action

I'm pretty sure I read somewhere that UITextView uses a different rendering mechanism for fonts (CoreText, perhaps?), but whatever it is the controls definitely look different.

So, is there any way that UITextViews can be made to render their fonts like UITextFields/UILabels, or vice versa?

like image 514
FizzBuzz Avatar asked Feb 12 '12 19:02

FizzBuzz


1 Answers

Fascinating issue. So far I haven't been able to reproduce it with anything but Courier, but it definitely occurs in Courier. I would open a defect at bugreporter.apple.com.

To help you move on, though, I recommend switching to Courier New, where I do not see this issue, and should be very close to your original goal.

like image 180
Rob Napier Avatar answered Oct 15 '22 04:10

Rob Napier