// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
namespace SixLabors.Fonts {
///
/// Represents the positioned metrics for one Unicode word-boundary segment.
///
public readonly struct WordMetrics
{
///
/// Initializes a new instance of the struct.
///
/// The positioned logical advance rectangle for the word-boundary segment in pixel units.
/// The rendered glyph bounds for the word-boundary segment in pixel units.
/// The union of the positioned logical advance bounds and rendered glyph bounds in pixel units.
/// The inclusive grapheme insertion index where the word-boundary segment starts.
/// The exclusive grapheme insertion index where the word-boundary segment ends.
/// The inclusive UTF-16 index where the word-boundary segment starts.
/// The exclusive UTF-16 index where the word-boundary segment ends.
internal WordMetrics(
FontRectangle advance,
FontRectangle bounds,
FontRectangle renderableBounds,
int graphemeStart,
int graphemeEnd,
int stringStart,
int stringEnd)
{
this.Advance = advance;
this.Bounds = bounds;
this.RenderableBounds = renderableBounds;
this.GraphemeStart = graphemeStart;
this.GraphemeEnd = graphemeEnd;
this.StringStart = stringStart;
this.StringEnd = stringEnd;
}
///
/// Gets the positioned logical advance rectangle for the word-boundary segment in pixel units.
///
public FontRectangle Advance { get; }
///
/// Gets the rendered glyph bounds for the word-boundary segment in pixel units.
///
public FontRectangle Bounds { get; }
///
/// Gets the union of the positioned logical advance bounds and rendered glyph bounds in pixel units.
///
public FontRectangle RenderableBounds { get; }
///
/// Gets the inclusive grapheme insertion index where the word-boundary segment starts.
///
public int GraphemeStart { get; }
///
/// Gets the exclusive grapheme insertion index where the word-boundary segment ends.
///
public int GraphemeEnd { get; }
///
/// Gets the inclusive UTF-16 index where the word-boundary segment starts.
///
public int StringStart { get; }
///
/// Gets the exclusive UTF-16 index where the word-boundary segment ends.
///
public int StringEnd { get; }
}
}