RFR: 8165943: LineBreakMeasurer does not measure correctly if TextAttribute.TRACKING is set. [v4]
Phil Race
prr at openjdk.org
Tue Dec 6 22:29:04 UTC 2022
On Tue, 6 Dec 2022 22:13:47 GMT, Olga Mikhaltsova <omikhaltcova at openjdk.org> wrote:
>> This is a fix for LineBreakMeasurer. It takes into account the TextAttribute.TRACKING value (not eq 0) while calculating the line breaks.
>>
>> Tested on Linux x64, Windows x64, macOS x64 with the reproducer (LineBreakSample.java) attached to JDK-8165943 and the following group of tests:
>> `$JTREG_HOME/bin/jtreg -jdk:$BUILD_HOME ./test/jdk/java/awt/font`
>
> Olga Mikhaltsova has updated the pull request incrementally with one additional commit since the last revision:
>
> Deleted trailing whitespaces, added new line at the end
test/jdk/java/awt/font/LineBreakMeasurer/LineBreakWithTracking.java line 50:
> 48:
> 49: private float textTracking = 0.0f;
> 50: private static String fontName = "Bitstream Cyberbit";
Did you previously use this font ? I must have over-looked that.
Do not use fonts that aren't available on the OS .. no SQE person will ever install - or even know a test uses it - and JDK will just use Dialog instead and people will get confused over why their experience is different than yours.
And of course each OS (desktop) will have different fonts. Overall best to just pick a logical font. If you want to know if the font supports all your code points you can iterate over your text using Font.canDisplay(int codePoint)
I'll submit a test job using your automated test.
-------------
PR: https://git.openjdk.org/jdk/pull/10289
More information about the client-libs-dev
mailing list