|
Font |
Top Previous Next |
|
The Font property specifies the font characteristics used when displaying text.
Syntax
Remarks
The Font property determines the font of the text generated. The default font is "MS Sans Serif", and font size is 8. The font properties can be altered at any point, and all subsequent TextOut functions will generate text with the modified font.
Requirements
Header: font.h
NOTE
In VC++, the font size is to be multiplied by 10000. For example, if the font size is 10, you'll have to set size as 100000.
Example Code [VC++] m_Engine.SetFileName("SampleDoc"); m_Engine.BeginDoc();
// Get the font object. COleFont fnt = m_Engine.GetFont();
// Set the font name and styles. fnt.SetName("Arial"); fnt.SetBold(true); fnt.SetItalic(true); fnt.SetUnderline(true);
// Set the font size. CY fntSize = m_Engine.GetFont().GetSize(); fntSize.int64 = 140000; fnt.SetSize(fntSize);
// Output a text in the font specified above. m_Engine.TextOutXY(1, 1, "eDocEngine ActiveX");
m_Engine.EndDoc();
[VB] With gtBMPEngineX1 .FileName = "Sample" .BeginDoc With .Font .Name = "Arial" .Bold = True .Italic = True .Underline = True .Size = 14 End With .TextOutXY 1, 1, "eDocEngine ActiveX" .EndDoc End With
[C#]
axgtEngineX1.FileName = "Sample";
//Trial users can ignore the ActivateLicense() function
axgtEngineX1.ActivateLicense("Enter the LicenseKey Here");
axgtEngineX1.BeginDoc(); Font F = new Font("Arial" ,14 , System.Drawing.FontStyle.Underline ) ; axgtEngineX1.Font = F ; axgtEngineX1.TextOutXY( 1 ,1 , "eDocEngine ActiveX"); axgtEngineX1.EndDoc();
|