Record Class TextFlow

java.lang.Object
java.lang.Record
io.leandev.appfuse.report.node.TextFlow
Record Components:
whiteSpace - 空白與原始換行處理
overflowWrap - 正常斷點不足時的換行方式
tabSize - 每個 Tab stop 的半形空格數;0 不移動
tabStop - 選填固定 Tab stop 間距;非 null 時優先於 tabSize
avoidLineStart - 是否避免關閉括號及句讀出現在行首
avoidLineEnd - 是否避免開啟括號出現在行尾
hangingPunctuation - 是否允許一個行尾避頭標點懸掛;有界頁首仍禁止超出欄寬
trailingEmptyLine - 是否在末尾換行後再保留一行;false 為 CSS pre-wrap 的末尾換行行高

public record TextFlow(TextFlow.WhiteSpace whiteSpace, TextFlow.OverflowWrap overflowWrap, int tabSize, Length tabStop, boolean avoidLineStart, boolean avoidLineEnd, boolean hangingPunctuation, boolean trailingEmptyLine) extends Record

明確啟用的文字流配置;未在 ParagraphStyle 設定時,原有排版及 bytes 不變。

策略以整個段落為單位,包含不同字型的 Inline;儲存格與分節 Block 頁首使用相同策略。 Tab stop 由段落的字型與字級計算,不以空格取代原文。

Since:
4.0.0-alpha.30
  • Constructor Details

    • TextFlow

      public TextFlow(TextFlow.WhiteSpace whiteSpace, TextFlow.OverflowWrap overflowWrap, int tabSize, Length tabStop, boolean avoidLineStart, boolean avoidLineEnd, boolean hangingPunctuation, boolean trailingEmptyLine)
      Creates an instance of a TextFlow record class.
      Parameters:
      whiteSpace - the value for the whiteSpace record component
      overflowWrap - the value for the overflowWrap record component
      tabSize - the value for the tabSize record component
      tabStop - the value for the tabStop record component
      avoidLineStart - the value for the avoidLineStart record component
      avoidLineEnd - the value for the avoidLineEnd record component
      hangingPunctuation - the value for the hangingPunctuation record component
      trailingEmptyLine - the value for the trailingEmptyLine record component
  • Method Details

    • normal

      public static TextFlow normal()
      CSS normal 空白折疊、overflow-wrap:anywhere、無標點懸掛。
    • preWrap

      public static TextFlow preWrap()
      CSS pre-wrap、overflow-wrap:anywhere、tab-size:4;單一末尾換行只結束目前行。
    • withWhiteSpace

      public TextFlow withWhiteSpace(TextFlow.WhiteSpace value)
    • withOverflowWrap

      public TextFlow withOverflowWrap(TextFlow.OverflowWrap value)
    • withTabSize

      public TextFlow withTabSize(int value)
    • withTabStop

      public TextFlow withTabStop(Length value)
    • withAvoidLineStart

      public TextFlow withAvoidLineStart(boolean value)
    • withAvoidLineEnd

      public TextFlow withAvoidLineEnd(boolean value)
    • withHangingPunctuation

      public TextFlow withHangingPunctuation(boolean value)
    • withTrailingEmptyLine

      public TextFlow withTrailingEmptyLine(boolean value)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • whiteSpace

      public TextFlow.WhiteSpace whiteSpace()
      Returns the value of the whiteSpace record component.
      Returns:
      the value of the whiteSpace record component
    • overflowWrap

      public TextFlow.OverflowWrap overflowWrap()
      Returns the value of the overflowWrap record component.
      Returns:
      the value of the overflowWrap record component
    • tabSize

      public int tabSize()
      Returns the value of the tabSize record component.
      Returns:
      the value of the tabSize record component
    • tabStop

      public Length tabStop()
      Returns the value of the tabStop record component.
      Returns:
      the value of the tabStop record component
    • avoidLineStart

      public boolean avoidLineStart()
      Returns the value of the avoidLineStart record component.
      Returns:
      the value of the avoidLineStart record component
    • avoidLineEnd

      public boolean avoidLineEnd()
      Returns the value of the avoidLineEnd record component.
      Returns:
      the value of the avoidLineEnd record component
    • hangingPunctuation

      public boolean hangingPunctuation()
      Returns the value of the hangingPunctuation record component.
      Returns:
      the value of the hangingPunctuation record component
    • trailingEmptyLine

      public boolean trailingEmptyLine()
      Returns the value of the trailingEmptyLine record component.
      Returns:
      the value of the trailingEmptyLine record component