On Fri, 13 Nov 2026 16:07:48 GMT, Kevin Rushforth <[email protected]> wrote:

>> 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 six additional 
>> commits since the last revision:
>> 
>>  - getter
>>  - Merge branch 'master' into 8396861.codearea.font
>>  - diff
>>  - cleanup
>>  - html too
>>  - code area font
>
> modules/jfx.incubator.richtext/src/main/java/com/sun/jfx/incubator/scene/control/richtext/HtmlStyledOutput.java
>  line 371:
> 
>> 369:         if (font != null) {
>> 370:             wr.write("<style>\nbody {\n");
>> 371:             wr.write("  font-family: \"");
> 
> You save the font family and size, but not the bold or italic attributes. Was 
> this intentional?

it is intentional: there is no public API or a reliable way to obtain this 
information from the `Font` class.  `Font.getStyle()` is not reliable.

I think it should be ok for the initial implementation, something custom models 
can improve.

> modules/jfx.incubator.richtext/src/main/java/com/sun/jfx/incubator/scene/control/richtext/RtfStyledOutput.java
>  line 74:
> 
>> 72:         this.font = RichUtils.codeAreaFont(r);
>> 73:         if (font != null) {
>> 74:             fontTable.add(font.getFamily());
> 
> As with the HTML export, you save the font family and size, but not the bold 
> or italic attributes.

also intentional.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2369#discussion_r4566642427
PR Review Comment: https://git.openjdk.org/jfx/pull/2369#discussion_r4566645469

Reply via email to