One possibility is to add a new method to Text / TextFlow:
public LayoutInfo getLayoutInfo()
Where LayoutInfo structure provides methods for querying the following information:
- text lines: offsets and bounds
- overall layout bounds
- text selection geometry (JDK-8341672)
- strike-through geometry (JDK-8341672)
- underline geometry (JDK-8341672)
The line bounds obtained via LayoutInfo might help address JDK-8091012 "[Text] No way to distinguish between a hit to the last character and a hit beyond the end of text", albeit indirectly.
The RichTextArea requires such a public API in TextFlow only, but we'll basically get the same functionality for Text node for free.
See also
https://github.com/andy-goryachev-oracle/Test/blob/main/doc/Text/LayoutInfo.md
- csr for
-
JDK-8344648 [Text,TextFlow] Public API for Text Layout Info
- Draft
- relates to
-
JDK-8318095 TextArea/TextFlow: wrong layout in RTL mode
- Open
-
JDK-8341438 TextFlow: incorrect caretShape(), hitTest(), rangeShape() with non-empty padding/border
- Open
-
JDK-8300569 ☂ Missing APIs related to rich text control
- In Progress
-
JDK-8091012 [Text] No way to distinguish between a hit to the last character and a hit beyond the end of text
- Open
-
JDK-8301121 RichTextArea Control (Incubator)
- In Progress
-
JDK-8341671 [Text/TextFlow] getCaretInfo
- Open
- links to
-
Review(master) openjdk/jfx/1596