On Tue, 24 Nov 2026 19:05:10 GMT, Alexander Zvegintsev <[email protected]> 
wrote:

>> Phil Race has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   8397728
>
> src/java.desktop/unix/native/common/awt/fontpath.c line 1083:
> 
>> 1081: 
>> 1082:             fontformat = NULL;
>> 1083:             if ((fontCount == 0) && (j < (nfonts / 2))) {
> 
> IIUC, an edge case is possible on a system with only two fonts.
> If `FcFontSort` returns a usable variable font first and an unsupported font 
> (e.g. a bitmap font) second, the first is skipped and the second is rejected 
> by the JDK.
> So we can end up with `fcFirstFontID` unset, while we could have used the 
> first font.
> 
> Wouldn’t it be safer to retry the search from the start with variable fonts 
> allowed if the first pass found no usable font (`fontCount == 0`)?

It seems pretty unlikely but I've added a reset check

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33957#discussion_r4687720598

Reply via email to