Font Property (original) (raw)
Syntax
C#
Objective-C
C++/CLI
Java
Python
@property (nonatomic, strong, nullable) LTAnnFont *font;
public AnnFont getFont()
public void setFont(AnnFont font)
Property Value
The AnnFont used to draw this AnnObject. The default value is "Arial" 12pt size.
Example
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Engine;
using Leadtools.Codecs;
using Leadtools.Annotations;
using Leadtools.Annotations.WinForms;
public void AnnCore_AnnTextObject()
{
// assumes _automation is valid
double inch = 720.0;
// Add a text object
AnnTextObject textObj = new AnnTextObject();
// Set the points for the hotspot
textObj.Points.Add(LeadPointD.Create(1 * inch, 1 * inch));
textObj.Points.Add(LeadPointD.Create(2 * inch, 1 * inch));
textObj.Points.Add(LeadPointD.Create(2 * inch, 2 * inch));
textObj.Points.Add(LeadPointD.Create(1 * inch, 2 * inch));
// Set the text
textObj.Text = "sample text for object\nsecond line of text\nlast line";
// Add the object to the automation container
// Set the font size
textObj.Font.FontSize = 16;
_automation.Container.Children.Add(textObj);
}