[python-win32] Selecting a font when printing with CDC.TextOut()

Jens B. Jorgensen jens.jorgensen at tallan.com
Tue Dec 28 16:06:55 CET 2004


As is true of win32* module use in general there is no substute for the 
msdn library documentation. Check out this documentation page to see an 
example of TextOut usage:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cdc.3a3a.beginpath.asp

Luc Saffre wrote:

> Hello,
>
> how can I select a font to use when printing to a PrinterDC using 
> TextOut()? I couldn't find any answer from the documentation.
>
> Here is a simplified context:
>
>   import win32ui
>   import win32con
>   dc = win32ui.CreateDC()
>   dc.CreatePrinterDC(printerName)
>   dc.StartDoc("hello")
>   dc.SetMapMode(win32con.MM_TWIPS)
>   dc.StartPage()
>   dc.TextOut(200,-200,"Hello, World")
>   dc.EndPage()
>   dc.EndDoc()
>
> TIA for any hints!
> Luc
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32



-- 
Jens B. Jorgensen
jens.jorgensen at tallan.com

"With a focused commitment to our clients and our people, we deliver value through customized technology solutions"  



More information about the Python-win32 mailing list