// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using System.Diagnostics;
namespace SixLabors.Fonts.Unicode {
///
/// Information about a potential line break position.
///
[DebuggerDisplay("{PositionMeasure}/{PositionWrap} @ {Required}")]
internal readonly struct LineBreak
{
///
/// Initializes a new instance of the struct.
///
/// The code point index to measure to
/// The code point index to actually break the line at
/// True if this is a required line break; otherwise false
/// True if this is a manual hyphenation break; otherwise false
public LineBreak(
int positionMeasure,
int positionWrap,
bool required = false,
bool isHyphenationBreak = false)
{
this.PositionMeasure = positionMeasure;
this.PositionWrap = positionWrap;
this.Required = required;
this.IsHyphenationBreak = isHyphenationBreak;
}
///
/// Gets the break position, before any trailing whitespace.
/// This doesn't include trailing whitespace.
///
public int PositionMeasure { get; }
///
/// Gets the break position, after any trailing whitespace.
/// This includes trailing whitespace.
///
public int PositionWrap { get; }
///
/// Gets a value indicating whether there should be a forced line break here.
///
public bool Required { get; }
///
/// Gets a value indicating whether this is a manual hyphenation break.
///
public bool IsHyphenationBreak { get; }
}
}