Class LineMetrics


  • public class LineMetrics
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      LineMetrics​(long startIndex, long endIndex, long endExcludingWhitespaces, long endIncludingNewline, boolean hardBreak, double ascent, double descent, double unscaledAscent, double height, double width, double left, double baseline, long lineNumber)  
    • Field Detail

      • _startIndex

        public final long _startIndex
        The index in the text buffer the line begins.
      • _endIndex

        public final long _endIndex
        The index in the text buffer the line ends.
      • _endExcludingWhitespaces

        public final long _endExcludingWhitespaces
      • _endIncludingNewline

        public final long _endIncludingNewline
      • _hardBreak

        public final boolean _hardBreak
      • _ascent

        public final double _ascent
        The final computed ascent for the line. This can be impacted by the strut, height, scaling, as well as outlying runs that are very tall. The top edge is getBaseline() - getAscent() and the bottom edge is getBaseline() + getDescent(). Ascent and descent are provided as positive numbers. These values are the cumulative metrics for the entire line.
      • _descent

        public final double _descent
        The final computed descent for the line. This can be impacted by the strut, height, scaling, as well as outlying runs that are very tall. The top edge is getBaseline() - getAscent() and the bottom edge is getBaseline() + getDescent(). Ascent and descent are provided as positive numbers. These values are the cumulative metrics for the entire line.
      • _unscaledAscent

        public final double _unscaledAscent
      • _height

        public final double _height
        Total height of the paragraph including the current line.
      • _width

        public final double _width
        Width of the line.
      • _left

        public final double _left
        The left edge of the line.
      • _baseline

        public final double _baseline
        The y position of the baseline for this line from the top of the paragraph.
      • _lineNumber

        public final long _lineNumber
        Zero indexed line number
    • Constructor Detail

      • LineMetrics

        public LineMetrics​(long startIndex,
                           long endIndex,
                           long endExcludingWhitespaces,
                           long endIncludingNewline,
                           boolean hardBreak,
                           double ascent,
                           double descent,
                           double unscaledAscent,
                           double height,
                           double width,
                           double left,
                           double baseline,
                           long lineNumber)
    • Method Detail

      • getLineHeight

        public double getLineHeight()
        The height of the current line, equals to Math.round(getAscent() + getDescent()).
      • getRight

        public double getRight()
        The right edge of the line, equals to getLeft() + getWidth()
      • getStartIndex

        public long getStartIndex()
        The index in the text buffer the line begins.
      • getEndIndex

        public long getEndIndex()
        The index in the text buffer the line ends.
      • getEndExcludingWhitespaces

        public long getEndExcludingWhitespaces()
      • getEndIncludingNewline

        public long getEndIncludingNewline()
      • isHardBreak

        public boolean isHardBreak()
      • getAscent

        public double getAscent()
        The final computed ascent for the line. This can be impacted by the strut, height, scaling, as well as outlying runs that are very tall. The top edge is getBaseline() - getAscent() and the bottom edge is getBaseline() + getDescent(). Ascent and descent are provided as positive numbers. These values are the cumulative metrics for the entire line.
      • getDescent

        public double getDescent()
        The final computed descent for the line. This can be impacted by the strut, height, scaling, as well as outlying runs that are very tall. The top edge is getBaseline() - getAscent() and the bottom edge is getBaseline() + getDescent(). Ascent and descent are provided as positive numbers. These values are the cumulative metrics for the entire line.
      • getUnscaledAscent

        public double getUnscaledAscent()
      • getHeight

        public double getHeight()
        Total height of the paragraph including the current line.
      • getWidth

        public double getWidth()
        Width of the line.
      • getLeft

        public double getLeft()
        The left edge of the line.
      • getBaseline

        public double getBaseline()
        The y position of the baseline for this line from the top of the paragraph.
      • getLineNumber

        public long getLineNumber()
        Zero indexed line number
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object