Use NSTextStorage instead of NSMutableAttributed string when calculating text size.
NSTextStorage surprisingly provides more accurate text metrics when text contains
emojis and certain "complex" glyphs (eg Chinese hieroglyphs).
Also fix another minor issue that might cause text to be laid out differently
when being edited.