Determine font styling from the inline cursor instead of overlaid caret

The caret is no longer inline with the text content, so the font style
of this doesn't match the position of the cursor in the document.
Merge pull request #708 from peitschie/ime-style-fix

Determine font styling from the inline cursor instead of overlaid caret