Sets the font and font size to be used for text

 

   

Syntax
 

[C#]
void SetFont(FontObject font, double size)

 

   

Params
 
Name Description
font The font to be assigned to the field.
size The font size to be assigned to the field.

 

   

Notes
 

Sets the font and font size to be used for text.

This function works by changing the DefaultAppearance for the field using the specified FontObject and size.

Properties such as the TextFont and TextSize get the effective value which may be inherited. Calling this function sets the value on this item itself which will override any inherited value.

Passing a font value of null will remove both the font and size from the item itself though a value may still be present if it is inherited from a parent field or from document defaults.

A zero size font indicates that the font should scale so that it fits the size of the field. Negative font heights appear the same as positive ones but are best avoided as they are likely to cause confusion.

The appearance of the field is not updated until you change the Value or call UpdateAppearance.

When filling a field with non-Latin text, such as Chinese, Japanese or Korean (CJK), you need to ensure the FontObject you provide can support the characters you are using. Otherwise the glyphs will be missing.

 

   

Example
 

None.