←Select platform

Font Property

Summary
Gets or sets the AnnFont used associated with this AnnObject.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public AnnFont Font { get; set; } 
@property (nonatomic, strong, nullable) LTAnnFont *font; 
public AnnFont getFont() 
public void setFont(AnnFont font) 
public:  
   property AnnFont^ Font 
   { 
      AnnFont^ get() 
      void set(AnnFont^ value) 
   } 
Font # get and set (AnnObject) 

Property Value

The AnnFont used to draw this AnnObject. The default value is "Arial" 12pt size.

Remarks

This property should be used as the font properties used when drawing the text of this object. Each object renderer is responsible for determining whether to use this property. For example, the renderer for AnnTextObject will use this property to create a device font and use it to draw its Text string. Setting Font to null will stop the object from rendering its text.

Example
C#
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); 
} 
Requirements

Target Platforms

See Also

Reference

AnnObject Class

AnnObject Members

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations.Engine Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.