On Mon, 16 Nov 2026 22:17:23 GMT, Andy Goryachev <[email protected]> wrote:

>> Fixes exporting of the `CodeArea` font to RTF and HTML.
>> 
>> Only the font family and size gets exported.  The font weight is not, mainly 
>> for simplicity (the custom models can be better), but also because there is 
>> no public API to get the font weight from the `Font` class.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Andy Goryachev has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains eight additional 
> commits since the last revision:
> 
>  - reworked html export for CodeArea
>  - Merge branch 'master' into 8396861.codearea.font
>  - getter
>  - Merge branch 'master' into 8396861.codearea.font
>  - diff
>  - cleanup
>  - html too
>  - code area font

LGTM with one suggestion.

modules/jfx.incubator.richtext/src/main/java/com/sun/jfx/incubator/scene/control/richtext/HtmlStyledOutput.java
 line 399:

> 397:         wr.write("<body>\n");
> 398:         if (font != null) {
> 399:             wr.write("<pre>");

HTML strips the first newline after a `<pre>`, so this will get rid of an 
intentional newline at the beginning of the content.

Suggestion:

            wr.write("<pre>\n");

-------------

Marked as reviewed by kcr (Lead).

PR Review: https://git.openjdk.org/jfx/pull/2369#pullrequestreview-5948551375
PR Review Comment: https://git.openjdk.org/jfx/pull/2369#discussion_r4607331628

Reply via email to