Class FontSetting
Class that represents rendering settings for fonts.
public class FontSetting : RenderSettingsBase<RenderFont>
- Inheritance
-
objectFontSetting
- Extension Methods
Constructors
FontSetting()
Initializes a new instance of the FontSetting class with default settings.
public FontSetting()
FontSetting(string, int)
Initializes a new instance of the FontSetting class with the specified font family and size.
public FontSetting(string fontFamily, int size)
Parameters
fontFamilystringThe font family name.
sizeintThe size of the font.
Properties
Bold
Gets or sets a value indicating whether the font is bold.
[Display(ResourceType = typeof(Strings), Name = "Bold", Order = 3)]
public bool Bold { get; set; }
Property Value
- bool
FontFamily
Gets or sets the font family name.
[Display(ResourceType = typeof(Strings), Name = "FontFamily", Order = 2)]
[ComboBoxEditor(typeof(FontSetting.FontFamiliesSource), IsTextEditable = true, AutoComplete = true)]
public string FontFamily { get; set; }
Property Value
- string
Italic
Gets or sets a value indicating whether the font is italic.
[Display(ResourceType = typeof(Strings), Name = "Italic", Order = 3)]
public bool Italic { get; set; }
Property Value
- bool
Size
Gets or sets the size of the font.
[Range(1, 100)]
[Display(ResourceType = typeof(Strings), Name = "Size", Order = 1)]
public int Size { get; set; }
Property Value
- int
Strikeout
Gets or sets a value indicating whether the font is strikeout.
[Display(ResourceType = typeof(Strings), Name = "Strikeout", Order = 5)]
public bool Strikeout { get; set; }
Property Value
- bool
Underline
Gets or sets a value indicating whether the font is underlined.
[Display(ResourceType = typeof(Strings), Name = "Underline", Order = 4)]
public bool Underline { get; set; }
Property Value
- bool
Methods
Clone()
Creates a new settings object with the same property values. The copy builds its own render object.
public override object Clone()
Returns
- object
The copy.
CreateDefaultRenderObject()
Creates the default render object.
protected override RenderFont CreateDefaultRenderObject()
Returns
- RenderFont
The default render object.
Equals(FontSetting)
Compares the font family (ordinal, case-sensitive), size and style flags with another font setting.
protected bool Equals(FontSetting other)
Parameters
otherFontSettingSetting to compare with.
Returns
- bool
true when all values are equal.
Equals(object?)
Determines whether obj is a FontSetting with the same font family, size and style flags.
public override bool Equals(object? obj)
Parameters
objobjectObject to compare with.
Returns
- bool
true when the settings are equal.
GenerateRenderObject()
Generates the render object based on the current settings.
protected override RenderFont GenerateRenderObject()
Returns
- RenderFont
The generated render object.
GetHashCode()
Returns a hash code computed from the font family, size and style flags. The values are mutable, so do not change a setting while it is a key in a hash-based collection.
public override int GetHashCode()
Returns
- int
The hash code.
ToString()
Returns a string that represents the current font setting.
public override string ToString()
Returns
- string
A string that represents the current font setting.
Operators
operator ==(FontSetting?, FontSetting?)
Determines whether two font settings have the same font family, size and style flags; two null values are equal.
public static bool operator ==(FontSetting? left, FontSetting? right)
Parameters
leftFontSettingFirst setting.
rightFontSettingSecond setting.
Returns
- bool
true when the settings are equal.
operator !=(FontSetting?, FontSetting?)
Determines whether two font settings differ in font family, size or style flags.
public static bool operator !=(FontSetting? left, FontSetting? right)
Parameters
leftFontSettingFirst setting.
rightFontSettingSecond setting.
Returns
- bool
true when the settings are not equal.