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.