On Fri, 6 Nov 2026 16:15:17 GMT, Phil Race <[email protected]> wrote:

>> This fix resolves problems with styles of logical fonts on OL 10.2 - and any 
>> other Linux where a font variation is used as the first component of the 
>> Linux sans/serif/monospace desktop fonts.
>> 
>> It skips such initial fonts - as identified by [wght] in the name, which 
>> seems sufficient for now, although not fool proof.
>> The alternative is opening the fonts to see if they are variation fonts 
>> during the process of gathering the names.
>> That is something we don't really want to do. That's why we use fontconfig.
>> If we need to refine this later, we will, but hopefully before that is 
>> needed we'll have proper variation support.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Phil Race has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   8396849

src/java.desktop/unix/native/common/awt/fontpath.c line 986:

> 984:         (*env)->ReleaseStringUTFChars(env, fcNameStr, (const 
> char*)fcName);
> 985:         (*env)->DeleteLocalRef(env, fcNameStr);
> 986:         if (pattern == NULL) {

(*FcPatternGetInteger)(pattern, FC_WEIGHT, 0, &expectedWeight);
(*FcPatternGetInteger)(pattern, FC_SLANT, 0, &expectedSlant);


Shouldn't these calls come after the NULL check for `pattern`?

Shouldn't we also check the return values of all 4 `FcPatternGetInteger` calls?

If a call fails, we could use an uninitialized value of `expectedWeight`, 
`expectedSlant`, `weight`, or `slant`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33761#discussion_r4495390352

Reply via email to