Barcode Fonts, Components, ActiveX and .NET Windows Forms Controls, Java Servlets, 
DLLs and Barcode Scanners. IDAutomation.com, Inc. is a BBB Accredited Business. Click for the BBB Business Review of this Computers Hardware, Software & Services in Tampa FL
Contact IDAutomationView your cart in the IDAutomation Store
Loading
Home:  Support:  Search:

CreatePointFont function to dynamically create barcodes within a C++ application?

Solution(s):

Can the CreatePointFont function be used to dynamically create instances of fonts within a C++ application? Yes it can. The following is an example of using the CreatePointFont function. Ensure that the variables are scoped properly to avoid any problems with the fonts being sized correctly through each pass of this routine.

/**************************************************************************************************/
private void CreateAFont() {
//Create a font object in case  we want to test with a different kind of font
CFont pageNumFont; //The initial point size times a "magnifier" variable.
pageNumFont.CreatePointFont(200 * m_Flags.m_Zoom, "Arial Bold", pCDC);
//Here is the data that is going to be drawn on the screen
CString pageStyleNum = "898798789:;
//Create a font object
CFont OCRAfont;
long lPointSize = 100;

//Create a 10 Point font out of the IDAutomationOCRa font using the device context
//of the screen. The parameters are the point size of the font (multiplied //by a factor of 10), the name of the font, and a pointer to the device //context that the font will be drawn on
OCRAfont.CreatePointFont(lPointSize , "Advocra", this->GetDC());
//Here is the bounding rectangle for the text that we are going to draw
CRect OCRArect(50, 100, 600, 200);
//Select the font that we would like to draw with
pCDC->SelectObject(&OCRAfont); pCDC->DrawText(pageStyleNum, OCRArect, DT_SINGLELINE | DT_LEFT | DT_NOCLIP); }
/**************************************************************************************************/

To sign up for monthly updates about new products or upgrades, please click here.© Copyright 2012 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

     Barcode Fonts | Components | Scanners | Support | Contact Us

70% of Fortune 100 Company's use IDAutomation Products.