RFR: 8341670: [Text, TextFlow] Public API for Text Layout Info [v18]
Andy Goryachev
angorya at openjdk.org
Mon Mar 10 16:12:15 UTC 2025
On Sat, 8 Mar 2025 08:23:41 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:
>> Andy Goryachev has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 42 commits:
>>
>> - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>> - review comments
>> - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>> - 25 25
>> - Merge branch 'master' into ag.text.layout.api
>> - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>> - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>> - Merge branch 'master' into ag.text.layout.api
>> - segments
>> - Merge remote-tracking branch 'origin/master' into ag.text.layout.api
>> - ... and 32 more: https://git.openjdk.org/jfx/compare/fc770fb9...0f94efdd
>
> modules/javafx.graphics/src/main/java/com/sun/javafx/scene/text/TextLayout.java line 256:
>
>> 254: * @return the caret geometry
>> 255: */
>> 256: public float[] getCaretGeometry(int offset, boolean leading);
>
> Does this method throw any exceptions? If so, please specify.
This method does not throw any exceptions, so none are specified.
> modules/javafx.graphics/src/main/java/com/sun/javafx/scene/text/TextLayout.java line 271:
>
>> 269: * @param client the callback to invoke for each rectangular shape
>> 270: */
>> 271: public void getRange(int start, int end, int type, GeometryCallback client);
>
> Does this method throw any exceptions?
no.
> modules/javafx.graphics/src/main/java/com/sun/javafx/text/PrismCaretInfo.java line 54:
>
>> 52: public String toString() {
>> 53: StringBuilder sb = new StringBuilder();
>> 54: sb.append("PrismCaretInfo{parts=[");
>
> I think you shouldn't leak implementation details via the `toString()` method (the name of the implementing class, as well as `parts=`, which is not a term that appears in the API). Maybe just drop `PrismCaretInfo{parts=` entirely.
makes sense.
On a related note, we don't seem to have a consistent standard for toString() output (probably no one does!), so maybe it's worth polling the devs about it.
Standardized log output might be useful when one has to go through masses of old/transient logs, or when scraping the logs for analytics. A JSON output might be useful since it offers a cheap structured form, although it suffers from two issues: verbosity and difficulty to encode binary data and object types easily.
Any ideas?
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1596#discussion_r1987607054
PR Review Comment: https://git.openjdk.org/jfx/pull/1596#discussion_r1987609067
PR Review Comment: https://git.openjdk.org/jfx/pull/1596#discussion_r1987602663
More information about the openjfx-dev
mailing list