RFR: 8165943: LineBreakMeasurer does not measure correctly if TextAttribute.TRACKING is set. [v2]
Phil Race
prr at openjdk.org
Thu Dec 1 20:30:22 UTC 2022
On Thu, 1 Dec 2022 18:22:57 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 two additional commits since the last revision:
>
> - Fix tracking for CJK, Arabic and Hebrew
> - Manual test
Changes requested by prr (Reviewer).
test/jdk/java/awt/font/LineBreakMeasurer/LineBreakWithTracking.java line 27:
> 25: @test
> 26: @key headful
> 27: @bug 8165943
headful isn't needed on manual tests.
Also whilst you can keep this manual test, I still think an automated test that verifies tracking is making a difference to the advance should be provided.
test/jdk/java/awt/font/LineBreakMeasurer/LineBreakWithTracking.java line 76:
> 74: Float regular = new Float(16.0);
> 75: Float big = new Float(24.0);
> 76:
LineBreakWithTracking.java:74: warning: [removal] Float(double) in Float has been deprecated and marked for removal
Float regular = new Float(16.0);
^
LineBreakWithTracking.java:75: warning: [removal] Float(double) in Float has been deprecated and marked for removal
Float big = new Float(24.0);
Use Float.valueOf(float) instead
test/jdk/java/awt/font/LineBreakMeasurer/LineBreakWithTracking.java line 138:
> 136: btn.addActionListener(new ActionListener(){
> 137: public void actionPerformed(ActionEvent e){
> 138: System.exit(0);
Do not call System.exit() in jtreg tests - even manual ones or ones that run in their own VM.
Instead dispose() the UI and then either let main() exit normally or throw RuntimeException() to indicate failure.
Also be sure that ALL exit paths clean up windows.
You may want to use PassFailJFrame.java to help you avoid writing the boilerplate and to get some of these things right
https://github.com/openjdk/jdk/blob/master/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java
-------------
PR: https://git.openjdk.org/jdk/pull/10289
More information about the client-libs-dev
mailing list