This patch makes drawHighlightForText a completely cross-platform method