Search Results for

    Show / Hide Table of Contents

    Class Font

    Defines a particular format for text, including font face, size, and style attributes.

    Inheritance
    System.Object
    Font
    Namespace: IronSoftware.Drawing
    Assembly: IronSoftware.Drawing.Common.dll
    Syntax
    public class Font : Object

    Constructors

    Font(String)

    Initializes a new Font that uses the specified existing FamilyName.

    Further Documentation:
    Code Example

    Declaration
    public Font(string FamilyName)
    Parameters
    Type Name Description
    System.String FamilyName

    The FontFamily of the new Font.

    Font(String, FontStyle)

    Initializes a new Font that uses the specified existing FamilyName and FontStyle enumeration.

    Further Documentation:
    Code Example

    Declaration
    public Font(string FamilyName, FontStyle Style)
    Parameters
    Type Name Description
    System.String FamilyName

    The FontFamily of the new Font.

    FontStyle Style

    The FontStyle to apply to the new Font. Multiple values of the FontStyle enumeration can be combined with the OR operator.

    Font(String, FontStyle, Single)

    Initializes a new Font that uses the specified existing FamilyName, FontStyle enumeration, FontWeight, Bold, Italic and Size.

    Further Documentation:
    Code Example

    Declaration
    public Font(string FamilyName, FontStyle Style, float Size)
    Parameters
    Type Name Description
    System.String FamilyName

    The FontFamily of the new Font.

    FontStyle Style

    The FontStyle to apply to the new Font. Multiple values of the FontStyle enumeration can be combined with the OR operator.

    System.Single Size

    The em-size of the new font in the units specified by the unit parameter.

    Font(String, Single)

    Initializes a new Font that uses the specified existing FamilyName, FontWeight, Bold, Italic and Size.

    Further Documentation:
    Code Example

    Declaration
    public Font(string FamilyName, float Size)
    Parameters
    Type Name Description
    System.String FamilyName

    The FontFamily of the new Font.

    System.Single Size

    The em-size of the new font in the units specified by the unit parameter.

    Properties

    Bold

    Gets a value that indicates whether this Font is bold.

    Declaration
    public bool Bold { get; }
    Property Value
    Type Description
    System.Boolean

    FamilyName

    Gets the family name for the typeface.

    Declaration
    public string FamilyName { get; }
    Property Value
    Type Description
    System.String

    Italic

    Gets a value that indicates whether this font has the italic style applied.

    Declaration
    public bool Italic { get; }
    Property Value
    Type Description
    System.Boolean

    Size

    Gets the "em-size of this Font measured in the units specified by the Unit property.

    Declaration
    public float Size { get; }
    Property Value
    Type Description
    System.Single

    Strikeout

    Gets a value that indicates whether this Font specifies a horizontal line through the font.

    Declaration
    public bool Strikeout { get; }
    Property Value
    Type Description
    System.Boolean

    Style

    Gets the font style for the typeface.

    Declaration
    public FontStyle Style { get; }
    Property Value
    Type Description
    FontStyle

    Underline

    Gets a value that indicates whether this Font is underlined.

    Declaration
    public bool Underline { get; }
    Property Value
    Type Description
    System.Boolean

    Operators

    Implicit(Font to Font)

    Implicitly casts to Microsoft.Maui.Graphics.Font objects from Font.

    When your .NET Class methods use Font as parameters or return types, you now automatically support Font as well.

    Declaration
    public static implicit operator Font(Font Font)
    Parameters
    Type Name Description
    Font Font

    Font is explicitly cast to a Microsoft.Maui.Graphics.Font

    Returns
    Type Description
    Microsoft.Maui.Graphics.Font

    Implicit(Font to Font)

    Implicitly casts to SixLabors.Fonts.Font objects from Font.

    When your .NET Class methods use Font as parameters or return types, you now automatically support Font as well.

    Declaration
    public static implicit operator Font(Font Font)
    Parameters
    Type Name Description
    Font Font

    Font is explicitly cast to a SixLabors.Fonts.Font

    Returns
    Type Description
    SixLabors.Fonts.Font

    Implicit(Font to SKFont)

    Implicitly casts to System.Drawing.Font objects from Font.

    When your .NET Class methods use Font as parameters or return types, you now automatically support Font as well.

    Declaration
    public static implicit operator SKFont(Font Font)
    Parameters
    Type Name Description
    Font Font

    Font is explicitly cast to a SkiaSharp.SKFont

    Returns
    Type Description
    SkiaSharp.SKFont

    Implicit(Font to Font)

    Implicitly casts to System.Drawing.Font objects from Font.

    When your .NET Class methods use Font as parameters or return types, you now automatically support Font as well.

    Declaration
    public static implicit operator Font(Font Font)
    Parameters
    Type Name Description
    Font Font

    Font is explicitly cast to a System.Drawing.Font

    Returns
    Type Description
    System.Drawing.Font

    Implicit(Font to Font)

    Implicitly casts Microsoft.Maui.Graphics.Font objects to Font.

    When your .NET Class methods use Font as parameters or return types, you now automatically support Font as well.

    Declaration
    public static implicit operator Font(Font Font)
    Parameters
    Type Name Description
    Microsoft.Maui.Graphics.Font Font

    Microsoft.Maui.Graphics.Font will automatically be cast to Font

    Returns
    Type Description
    Font

    Implicit(Font to Font)

    Implicitly casts SixLabors.Fonts.Font objects to Font.

    When your .NET Class methods use Font as parameters or return types, you now automatically support Font as well.

    Declaration
    public static implicit operator Font(Font Font)
    Parameters
    Type Name Description
    SixLabors.Fonts.Font Font

    SixLabors.Fonts.Font will automatically be cast to Font

    Returns
    Type Description
    Font

    Implicit(SKFont to Font)

    Implicitly casts SkiaSharp.SKFont objects to Font.

    When your .NET Class methods use Font as parameters or return types, you now automatically support Font as well.

    Declaration
    public static implicit operator Font(SKFont Font)
    Parameters
    Type Name Description
    SkiaSharp.SKFont Font

    SkiaSharp.SKFont will automatically be cast to Font

    Returns
    Type Description
    Font

    Implicit(Font to Font)

    Implicitly casts System.Drawing.Font objects to Font.

    When your .NET Class methods use Font as parameters or return types, you now automatically support Font as well.

    Declaration
    public static implicit operator Font(Font Font)
    Parameters
    Type Name Description
    System.Drawing.Font Font

    System.Drawing.Font will automatically be cast to Font

    Returns
    Type Description
    Font
    ☀
    ☾
    Downloads
    • Download with Nuget
    In This Article
    Back to top
    Install with Nuget
    Want to deploy IronDrawing to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronDrawing free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.