Search code examples
iosuitextviewnsattributedstringuifont

UITextView fix character width


My problem is that I have to two UITextView displaying different Text, but always the same number of characters. I could not find a way to set a fix character-width and space width in UITextView/NSAtrrStr/UIFont. Is there a way to do that?

thanks


Solution

  • As far as I know, Courier New is the only fixed-width font shipped with iOS.

    Also, you can always import custom fonts to your xcode project which you know are fixed-width. Here is how: Embed Custom Font in iOS