How can I set the font and font size in use with the TextOut API function?
Printable View
How can I set the font and font size in use with the TextOut API function?
You can't do that so simple with textout.
I've done a lot of things with GDI, and even made a DLL file that manages the GDI Dll objects.
If you create a font object (I thought about CreateFontEx) with a LOGFONT strcuture, you can define how the font should look like.
Then select that new font into the DC (of the window). That's done with SelectObject() Save the previous handle of the previous font (returned by SelectObject()). Now you should be able to draw with cool fonts.
You can also use DrawText() to draw text. That even supports wrapping the text. Please check our the MSDN for details about, or take a look at my DLL files
Anyway, more about the dll's:
- one of the GDI dll's is used to create the GDI objects, and select them easily in the DC.
- an other one (source included) helps you out with the difficulties of the gdi drawing api's
ya, i figured it out like 10 mins after i posted.... i used CreateFont with SelectObject....