I am implementing a text editor in C++ just using the vanilla Win32 API and I'm trying to find the best way to implement syntax highlighting. I know that there are existing controls out there like scintilla, but I'm doing this for fun so I want to do most of the work myself. I also want it to be fast and lightweight.
From what I've learned so far, it looks like the most low level option for drawing text in GDI is the TextOut
function. However, if I need to keep changing the font color then that means I will need to make many calls to TextOut
in order to draw one body of text with mixed formatting. Is this inefficient? When syntax highlighting and rich text controls are implemented, would they be likely to use TextOut
behind the scenes or is there some other way? Is every other method of drawing text in GDI just a higher level wrapper around TextOut
?