I'd like to recommend you two articles: Text Rendering Hates You and Text Editing Hates You Too.
The first one is explaining some aspects on implementing text rendering for a general purpose software. The second one extends the topic to text input.
Both topics do seem to be simple and straight-forward. Reading them will remind you that the devil is in the details.
I had a similar effect with The Problem with Time & Timezones by Tom Scott where he explains implementation implications on time and time zones.
TL;DR: avoid contact with any topic mentioned. ;-)