The most efficient way that I know of would probably be double buffering. (The reason for that being the fact that direct GPU calls like set or setForeground take a certain amount of time depending on the tier and a good double buffering API has an algorithm that minimizes the amount of GPU calls)
On the other hand I don't know if that's actually necessary for a text editor.