Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.


This topic has been updated for Visual Studio 2005 SP1.

Call SetPrinterFont to set the printer font to the font specified by pFont.

void SetPrinterFont(
   CFont* pFont 



A pointer to an object of type CFont. If NULL, the font used for printing is based on the display font.

If you want your view to always use a particular font for printing, include a call to SetPrinterFont in your class's OnPreparePrinting function. This virtual function is called before printing occurs, so the font change takes place before the view's contents are printed.

This section has been updated for Visual Studio 2005 SP1.

This method is not supported in Smart Device projects.

Community Additions

© 2015 Microsoft