moved up 'formatText' so that native text field will be drawn correctly (closes #313)