• 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
      • GlyphLayoutMode
      • GlyphMetrics
      • GlyphMissingException
      • GlyphRendererParameters
      • GlyphType
      • HintingMode
      • HorizontalAlignment
      • HorizontalMetrics
      • IColorGlyphRenderer
      • IFontCollection
      • IGlyphRenderer
      • IGlyphRendererExtensions
      • IMetricsHeader
      • IReadOnlyFontCollection
      • IReadOnlySystemFontCollection
      • InvalidFontFileException
      • InvalidFontTableException
      • KerningMode
      • LayoutMode
      • LayoutModeExtensions
      • MissingFontTableException
      • SystemFonts
      • TextAlignment
      • TextAttributes
      • TextDecorations
      • TextDirection
      • TextJustification
      • TextMeasurer
      • TextOptions
      • TextRenderer
      • TextRun
      • VerticalAlignment
      • VerticalMetrics
      • WordBreaking
    • SixLabors.Fonts.Tables.AdvancedTypographic
      • FeatureTags
      • GlyphClassDef
      • Tag
    • SixLabors.Fonts.Tables.TrueType
      • TrueTypeGlyphMetrics
    • SixLabors.Fonts.Unicode
      • ArabicJoiningClass
      • ArabicJoiningGroup
      • ArabicJoiningType
      • BidiCharacterType
      • BidiClass
      • BidiPairedBracketType
      • CodePoint
      • GraphemeClusterClass
      • IndicPositionalCategory
      • IndicSyllabicCategory
      • LineBreakClass
      • MemoryExtensions
      • ScriptClass
      • SpanCodePointEnumerator
      • SpanGraphemeEnumerator
      • VerticalOrientationType
    • 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>

    Constructors

    | Edit this page 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.

    | Edit this page View Source

    FontRectangle(float, float, float, float)

    Initializes a new instance of the FontRectangle struct.

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

    The horizontal position of the rectangle.

    float y

    The vertical position of the rectangle.

    float width

    The width of the rectangle.

    float height

    The height of the rectangle.

    Fields

    | Edit this page 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

    | Edit this page View Source

    Bottom

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

    Declaration
    public float Bottom { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Height

    Gets the height of this FontRectangle.

    Declaration
    public float Height { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Left

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

    Declaration
    public float Left { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Right

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

    Declaration
    public float Right { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Top

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

    Declaration
    public float Top { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Width

    Gets the width of this FontRectangle.

    Declaration
    public float Width { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    X

    Gets the x-coordinate of this FontRectangle.

    Declaration
    public float X { get; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    Y

    Gets the y-coordinate of this FontRectangle.

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

    Methods

    | Edit this page View Source

    Center(in FontRectangle)

    Returns the center point of the given FontRectangle.

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

    The rectangle.

    Returns
    Type Description
    Vector2

    The Vector2.

    | Edit this page View Source

    Contains(in FontRectangle)

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

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

    The rectangle.

    Returns
    Type Description
    bool

    The bool.

    | Edit this page View Source

    Contains(Vector2)

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

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

    The point.

    Returns
    Type Description
    bool

    The bool.

    | Edit this page View Source

    Contains(float, float)

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

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

    The x-coordinate of the given point.

    float y

    The y-coordinate of the given point.

    Returns
    Type Description
    bool

    The bool.

    | Edit this page View Source

    Deconstruct(out float, out float, out float, out float)

    Deconstructs this rectangle into four floats.

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

    The out value for X.

    float y

    The out value for Y.

    float width

    The out value for the width.

    float height

    The out value for the height.

    | Edit this page View Source

    Equals(FontRectangle)

    Indicates whether the current object is equal to another object of the same type.

    Declaration
    public bool Equals(FontRectangle other)
    Parameters
    Type Name Description
    FontRectangle other

    An object to compare with this object.

    Returns
    Type Description
    bool

    true if the current object is equal to the other parameter; otherwise, false.

    | Edit this page View Source

    Equals(object?)

    Indicates whether this instance and a specified object are equal.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current instance.

    Returns
    Type Description
    bool

    true if obj and this instance are the same type and represent the same value; otherwise, false.

    Overrides
    ValueType.Equals(object)
    | Edit this page View Source

    FromLTRB(float, float, float, float)

    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
    float left

    The left coordinate of the rectangle.

    float top

    The top coordinate of the rectangle.

    float right

    The right coordinate of the rectangle.

    float bottom

    The bottom coordinate of the rectangle.

    Returns
    Type Description
    FontRectangle

    The FontRectangle.

    | Edit this page View Source

    GetHashCode()

    Returns the hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A 32-bit signed integer that is the hash code for this instance.

    Overrides
    ValueType.GetHashCode()
    | Edit this page View Source

    Inflate(in FontRectangle, float, float)

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

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

    The rectangle.

    float x

    The amount to inflate the width by.

    float y

    The amount to inflate the height by.

    Returns
    Type Description
    FontRectangle

    A new FontRectangle.

    | Edit this page View Source

    Inflate(Vector2)

    Creates a new FontRectangle inflated by the specified amount.

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

    The size.

    Returns
    Type Description
    FontRectangle

    New FontRectangle representing the inflated rectangle

    | Edit this page View Source

    Inflate(float, float)

    Creates a new FontRectangle inflated by the specified amount.

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

    The width.

    float height

    The height.

    Returns
    Type Description
    FontRectangle

    New FontRectangle representing the inflated rectangle

    | Edit this page View Source

    Intersect(in FontRectangle)

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

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

    The rectangle.

    Returns
    Type Description
    FontRectangle

    New FontRectangle representing the intersections between the two rectangles.

    | Edit this page View Source

    Intersect(in FontRectangle, in 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(in FontRectangle a, in FontRectangle b)
    Parameters
    Type Name Description
    FontRectangle a

    The first rectangle.

    FontRectangle b

    The second rectangle.

    Returns
    Type Description
    FontRectangle

    The FontRectangle.

    | Edit this page View Source

    IntersectsWith(in FontRectangle)

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

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

    The other rectangle.

    Returns
    Type Description
    bool

    The bool.

    | Edit this page View Source

    Offset(Vector2)

    Adjusts the location of this rectangle by the specified amount.

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

    The point.

    Returns
    Type Description
    FontRectangle

    New FontRectangle representing the offset rectangle.

    | Edit this page View Source

    Offset(float, float)

    Adjusts the location of this rectangle by the specified amount.

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

    The amount to offset the x-coordinate.

    float dy

    The amount to offset the y-coordinate.

    Returns
    Type Description
    FontRectangle

    New FontRectangle representing the inflated rectangle.

    | Edit this page View Source

    ToString()

    Returns the fully qualified type name of this instance.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    The fully qualified type name.

    Overrides
    ValueType.ToString()
    | Edit this page View Source

    Transform(in FontRectangle, Matrix3x2)

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

    Declaration
    public static FontRectangle Transform(in 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.

    | Edit this page View Source

    Union(in FontRectangle, in FontRectangle)

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

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

    The first rectangle.

    FontRectangle b

    The second rectangle.

    Returns
    Type Description
    FontRectangle

    The FontRectangle.

    Operators

    | Edit this page View Source

    operator ==(in FontRectangle, in FontRectangle)

    Compares two FontRectangle objects for equality.

    Declaration
    public static bool operator ==(in FontRectangle left, in 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
    bool

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

    | Edit this page View Source

    operator !=(in FontRectangle, in FontRectangle)

    Compares two FontRectangle objects for inequality.

    Declaration
    public static bool operator !=(in FontRectangle left, in 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
    bool

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

    Implements

    IEquatable<T>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX