title: how much pixels dose a character takes in iOS?
body: <p>I'm trying to automatically layout text on a UILabel view.
  The text (such as "abcdefghij") contains ten characters. I want to display it in one single line.
  I turned off the Size Class and Auto Layout for convenience, and added following codes to layout the text on the UILabel. It should be ten characters in one line, and the width of the UILabel is equal to the width of the device. </p>
  
  <pre><code>    let screenWidth = UIScreen.mainScreen().bounds.width
      labelView.frame = CGRect(x: labelView.frame.origin.x, y: labelView.frame.origin.y, width: screenWidth, height: labelView.frame.height)
      let string = "abcdefghij"
      let stringLength = CGFloat(string.characters.count)
      let characterSize = keyboardView.font.pointSize
      let characterSpacing = (screenWidth - characterSize * stringLength) / stringLength 
      let content = NSAttributedString(string: string, attributes: [NSKernAttributeName: characterSpacing])
      keyboardView.attributedText = content
  </code></pre>
  
  <p>But it turns out like this. <a href="http://i.stack.imgur.com/rAlLk.png" rel="nofollow">The width of string is not equal to the screen</a></p>
  
  <p>I think, the only could be wrong here is the pointSize. It equals to 13.8 while I set the font size to 17. 
  I don't understand it. 
  Give me some hints, please.
  Thanks for your attention. </p>
  
  <p>By using <code>sizeWithAttributes</code> and <code>boundingRectWithSize(_:options:context:)</code>, I finally figured out how it works. But my origin purpose is fitting the 10 characters in one line. The code should calculate the space between the characters, and all the space is same size. Could you give me some advices? 
  <a href="http://i.stack.imgur.com/OqGzI.png" rel="nofollow">This is what I want to make</a></p>