• Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • SixLabors.Fonts
      • ColorFontSupport
      • Font
      • FontCollection
      • FontCollectionExtensions
      • FontDescription
      • FontException
      • FontFamily
      • FontFamilyNotFoundException
      • FontMetrics
      • FontRectangle
      • FontStyle
      • Glyph
      • GlyphBounds
      • GlyphColor
      • GlyphMetrics
      • GlyphMissingException
      • GlyphRendererParameters
      • GlyphType
      • HintingMode
      • HorizontalAlignment
      • IColorGlyphRenderer
      • IFontCollection
      • IGlyphDecorationRenderer
      • IGlyphRenderer
      • IGlyphRendererExtensions
      • InvalidFontFileException
      • InvalidFontTableException
      • IReadOnlyFontCollection
      • IReadOnlySystemFontCollection
      • KerningMode
      • LayoutMode
      • MissingFontTableException
      • SystemFonts
      • TextAlignment
      • TextAttributes
      • TextDecorations
      • TextDirection
      • TextJustification
      • TextMeasurer
      • TextOptions
      • TextRenderer
      • TextRun
      • VerticalAlignment
      • WordBreaking
    • SixLabors.Fonts.Tables.AdvancedTypographic
      • FeatureTags
      • GlyphClassDef
      • Tag
    • SixLabors.Fonts.Tables.TrueType
      • TrueTypeGlyphMetrics
    • SixLabors.Fonts.Tables.TrueType.Glyphs
      • GlyphOutline
    • SixLabors.Fonts.Unicode
      • BidiCharacterType
      • BidiClass
      • BidiPairedBracketType
      • CodePoint
      • GraphemeClusterClass
      • JoiningClass
      • JoiningGroup
      • JoiningType
      • LineBreakClass
      • MemoryExtensions
      • ScriptClass
      • SpanCodePointEnumerator
      • SpanGraphemeEnumerator
    • SixLabors.Fonts.WellKnownIds
      • KnownNameIds

    Struct FontRectangle

    Stores a set of four single precision floating points that represent the location and size of a rectangle.

    Implements
    IEquatable<FontRectangle>
    Inherited Members
    Object.Equals(Object, Object)
    Object.GetType()
    Object.ReferenceEquals(Object, Object)
    Namespace: SixLabors.Fonts
    Assembly: SixLabors.Fonts.dll
    Syntax
    public readonly struct FontRectangle : IEquatable<FontRectangle>
    Remarks

    This struct is fully mutable. This is done (against the guidelines) for the sake of performance, as it avoids the need to create new values for modification operations.

    Constructors

    | Improve this Doc View Source

    FontRectangle(Vector2, Vector2)

    Initializes a new instance of the FontRectangle struct.

    Declaration
    public FontRectangle(Vector2 point, Vector2 size)
    Parameters
    Type Name Description
    Vector2 point

    The Vector2 which specifies the rectangles point in a two-dimensional plane.

    Vector2 size

    The Vector2 which specifies the rectangles height and width.

    | Improve this Doc View Source

    FontRectangle(Single, Single, Single, Single)

    Initializes a new instance of the FontRectangle struct.

    Declaration
    public FontRectangle(float x, float y, float width, float height)
    Parameters
    Type Name Description
    Single x

    The horizontal position of the rectangle.

    Single y

    The vertical position of the rectangle.

    Single width

    The width of the rectangle.

    Single height

    The height of the rectangle.

    Fields

    | Improve this Doc View Source

    Empty

    Represents a FontRectangle that has X, Y, Width, and Height values set to zero.

    Declaration
    public static readonly FontRectangle Empty
    Field Value
    Type Description
    FontRectangle

    Properties

    | Improve this Doc View Source

    Bottom

    Gets the y-coordinate of the bottom edge of this FontRectangle.

    Declaration
    public readonly float Bottom { get; }
    Property Value
    Type Description
    Single
    | Improve this Doc View Source

    Height

    Gets the height of this FontRectangle.

    Declaration
    public readonly float Height { get; }
    Property Value
    Type Description
    Single
    | Improve this Doc View Source

    Left

    Gets the x-coordinate of the left edge of this FontRectangle.

    Declaration
    public readonly float Left { get; }
    Property Value
    Type Description
    Single
    | Improve this Doc View Source

    Right

    Gets the x-coordinate of the right edge of this FontRectangle.

    Declaration
    public readonly float Right { get; }
    Property Value
    Type Description
    Single
    | Improve this Doc View Source

    Top

    Gets the y-coordinate of the top edge of this FontRectangle.

    Declaration
    public readonly float Top { get; }
    Property Value
    Type Description
    Single
    | Improve this Doc View Source

    Width

    Gets the width of this FontRectangle.

    Declaration
    public readonly float Width { get; }
    Property Value
    Type Description
    Single
    | Improve this Doc View Source

    X

    Gets the x-coordinate of this FontRectangle.

    Declaration
    public readonly float X { get; }
    Property Value
    Type Description
    Single
    | Improve this Doc View Source

    Y

    Gets the y-coordinate of this FontRectangle.

    Declaration
    public readonly float Y { get; }
    Property Value
    Type Description
    Single

    Methods

    | Improve this Doc View Source

    Center(FontRectangle)

    Returns the center point of the given FontRectangle.

    Declaration
    public static Vector2 Center(FontRectangle rectangle)
    Parameters
    Type Name Description
    FontRectangle rectangle

    The rectangle.

    Returns
    Type Description
    Vector2

    The Vector2.

    | Improve this Doc View Source

    Contains(FontRectangle)

    Determines if the rectangular region represented by rectangle is entirely contained within the rectangular region represented by this FontRectangle .

    Declaration
    public readonly bool Contains(FontRectangle rectangle)
    Parameters
    Type Name Description
    FontRectangle rectangle

    The rectangle.

    Returns
    Type Description
    Boolean

    The Boolean.

    | Improve this Doc View Source

    Contains(Vector2)

    Determines if the specified point is contained within the rectangular region defined by this FontRectangle .

    Declaration
    public readonly bool Contains(Vector2 point)
    Parameters
    Type Name Description
    Vector2 point

    The point.

    Returns
    Type Description
    Boolean

    The Boolean.

    | Improve this Doc View Source

    Contains(Single, Single)

    Determines if the specified point is contained within the rectangular region defined by this FontRectangle.

    Declaration
    public readonly bool Contains(float x, float y)
    Parameters
    Type Name Description
    Single x

    The x-coordinate of the given point.

    Single y

    The y-coordinate of the given point.

    Returns
    Type Description
    Boolean

    The Boolean.

    | Improve this Doc View Source

    Deconstruct(out Single, out Single, out Single, out Single)

    Deconstructs this rectangle into four floats.

    Declaration
    public readonly void Deconstruct(out float x, out float y, out float width, out float height)
    Parameters
    Type Name Description
    Single x

    The out value for X.

    Single y

    The out value for Y.

    Single width

    The out value for the width.

    Single height

    The out value for the height.

    | Improve this Doc View Source

    Equals(FontRectangle)

    Declaration
    public readonly bool Equals(FontRectangle other)
    Parameters
    Type Name Description
    FontRectangle other
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override readonly bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    ValueType.Equals(Object)
    | Improve this Doc View Source

    FromLTRB(Single, Single, Single, Single)

    Creates a new FontRectangle with the specified location and size.

    Declaration
    public static FontRectangle FromLTRB(float left, float top, float right, float bottom)
    Parameters
    Type Name Description
    Single left

    The left coordinate of the rectangle.

    Single top

    The top coordinate of the rectangle.

    Single right

    The right coordinate of the rectangle.

    Single bottom

    The bottom coordinate of the rectangle.

    Returns
    Type Description
    FontRectangle

    The FontRectangle.

    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override readonly int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    ValueType.GetHashCode()
    | Improve this Doc View Source

    Inflate(FontRectangle, Single, Single)

    Creates a new FontRectangle from the given rectangle that is inflated by the specified amount.

    Declaration
    public static FontRectangle Inflate(FontRectangle rectangle, float x, float y)
    Parameters
    Type Name Description
    FontRectangle rectangle

    The rectangle.

    Single x

    The amount to inflate the width by.

    Single y

    The amount to inflate the height by.

    Returns
    Type Description
    FontRectangle

    A new FontRectangle.

    | Improve this Doc View Source

    Inflate(Vector2)

    Creates a new FontRectangle inflated by the specified amount.

    Declaration
    public readonly FontRectangle Inflate(Vector2 size)
    Parameters
    Type Name Description
    Vector2 size

    The size.

    Returns
    Type Description
    FontRectangle

    New FontRectangle representing the inflated rectangle

    | Improve this Doc View Source

    Inflate(Single, Single)

    Creates a new FontRectangle inflated by the specified amount.

    Declaration
    public readonly FontRectangle Inflate(float width, float height)
    Parameters
    Type Name Description
    Single width

    The width.

    Single height

    The height.

    Returns
    Type Description
    FontRectangle

    New FontRectangle representing the inflated rectangle

    | Improve this Doc View Source

    Intersect(FontRectangle)

    Creates a FontRectangle that represents the intersection between this FontRectangle and the rectangle.

    Declaration
    public readonly FontRectangle Intersect(FontRectangle rectangle)
    Parameters
    Type Name Description
    FontRectangle rectangle

    The rectangle.

    Returns
    Type Description
    FontRectangle

    New FontRectangle representing the intersections between the two rectangles.

    | Improve this Doc View Source

    Intersect(FontRectangle, FontRectangle)

    Creates a rectangle that represents the intersection between a and b. If there is no intersection, an empty rectangle is returned.

    Declaration
    public static FontRectangle Intersect(FontRectangle a, FontRectangle b)
    Parameters
    Type Name Description
    FontRectangle a

    The first rectangle.

    FontRectangle b

    The second rectangle.

    Returns
    Type Description
    FontRectangle

    The FontRectangle.

    | Improve this Doc View Source

    IntersectsWith(FontRectangle)

    Determines if the specified FontRectangle intersects the rectangular region defined by this FontRectangle.

    Declaration
    public readonly bool IntersectsWith(FontRectangle rectangle)
    Parameters
    Type Name Description
    FontRectangle rectangle

    The other rectangle.

    Returns
    Type Description
    Boolean

    The Boolean.

    | Improve this Doc View Source

    Offset(Vector2)

    Adjusts the location of this rectangle by the specified amount.

    Declaration
    public readonly FontRectangle Offset(Vector2 point)
    Parameters
    Type Name Description
    Vector2 point

    The point.

    Returns
    Type Description
    FontRectangle

    New FontRectangle representing the offset rectangle.

    | Improve this Doc View Source

    Offset(Single, Single)

    Adjusts the location of this rectangle by the specified amount.

    Declaration
    public readonly FontRectangle Offset(float dx, float dy)
    Parameters
    Type Name Description
    Single dx

    The amount to offset the x-coordinate.

    Single dy

    The amount to offset the y-coordinate.

    Returns
    Type Description
    FontRectangle

    New FontRectangle representing the inflated rectangle.

    | Improve this Doc View Source

    ToString()

    Declaration
    public override readonly string ToString()
    Returns
    Type Description
    String
    Overrides
    ValueType.ToString()
    | Improve this Doc View Source

    Transform(FontRectangle, Matrix3x2)

    Creates a new FontRectangle by transforming the given rectangle by the given matrix.

    Declaration
    public static FontRectangle Transform(FontRectangle rectangle, Matrix3x2 matrix)
    Parameters
    Type Name Description
    FontRectangle rectangle

    The source rectangle.

    Matrix3x2 matrix

    The transformation matrix.

    Returns
    Type Description
    FontRectangle

    A transformed FontRectangle.

    | Improve this Doc View Source

    Union(FontRectangle, FontRectangle)

    Creates a rectangle that represents the union between a and b.

    Declaration
    public static FontRectangle Union(FontRectangle a, FontRectangle b)
    Parameters
    Type Name Description
    FontRectangle a

    The first rectangle.

    FontRectangle b

    The second rectangle.

    Returns
    Type Description
    FontRectangle

    The FontRectangle.

    Operators

    | Improve this Doc View Source

    Equality(FontRectangle, FontRectangle)

    Compares two FontRectangle objects for equality.

    Declaration
    public static bool operator ==(FontRectangle left, FontRectangle right)
    Parameters
    Type Name Description
    FontRectangle left

    The FontRectangle on the left side of the operand.

    FontRectangle right

    The FontRectangle on the right side of the operand.

    Returns
    Type Description
    Boolean

    True if the current left is equal to the right parameter; otherwise, false.

    | Improve this Doc View Source

    Inequality(FontRectangle, FontRectangle)

    Compares two FontRectangle objects for inequality.

    Declaration
    public static bool operator !=(FontRectangle left, FontRectangle right)
    Parameters
    Type Name Description
    FontRectangle left

    The FontRectangle on the left side of the operand.

    FontRectangle right

    The FontRectangle on the right side of the operand.

    Returns
    Type Description
    Boolean

    True if the current left is unequal to the right parameter; otherwise, false.

    Implements

    System.IEquatable<T>
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX