JDK-8177394 : Printed content is overlapping
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux_redhat_7.2
  • CPU: x86
  • Submitted: 2017-03-17
  • Updated: 2017-10-26
  • Resolved: 2017-10-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10
10Resolved
Related Reports
Duplicate :  
Description
Testsuite name: 2D manual 
Test name(s): 2D_Printing/PrintFont_2D 
Product(s) tested: openJDK 9 b160(64bit) 
OS/architecture: Oel7.2 Redhat x64/Printer:Lexmark E260dn

Issue is: Printed content is overlapping refer to PrintFont_Native.jpg and PrintFont_None.jpg

The following case has the same issue refer to AntialiasTableTest.jpg :
2D_Font/AntialiasTableTest
Comments
This will get fixed when we pull in HB 1.5.1 as per https://bugs.openjdk.java.net/browse/JDK-8177394 so closing as dup. of that,
06-10-2017

Patch has been pushed upstream : https://cgit.freedesktop.org/harfbuzz/commit/?id=edcf6344bc62af9ea726a633468c9243e127fa13 We'll get that fix next time we upgrade harfbuzz.
24-03-2017

The OEL (same as RHEL) 7.2 versions that were provided to me both claim to be v 2.8 but are most definitely not the same 2.8 as the ones on Ubuntu 16.04. I don't know how many slightly different versions of these bad fonts are out there but for the ones I've seen to date the fix is now this : --- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.cc +++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.cc @@ -124,6 +124,14 @@ /* 2c0c90c6f6087ffbfea76589c93113a9cbb0e75f cantarell-fonts-0.0.21/otf/Cantarell-Bold.otf */ /* 55461f5b853c6da88069ffcdf7f4dd3f8d7e3e6b cantarell-fonts-0.0.21/otf/Cantarell-Bold-Oblique.otf */ || (188 == gdef_len && 3426 == gpos_len && 264 == gsub_len) + /* d125afa82a77a6475ac0e74e7c207914af84b37a padauk-2.80/Padauk.ttf RHEL 7.2 */ + || (1058 == gdef_len && 11818 == gpos_len && 47032 == gsub_len) + /* 0f7b80437227b90a577cc078c0216160ae61b031 padauk-2.80/Padauk-Bold.ttf RHEL 7.2*/ + || (1046 == gdef_len && 12600 == gpos_len && 47030 == gsub_len) + /* d3dde9aa0a6b7f8f6a89ef1002e9aaa11b882290 padauk-2.80/Padauk.ttf Ubuntu 16.04 */ + || (1058 == gdef_len && 16770 == gpos_len && 71796 == gsub_len) + /* 5f3c98ccccae8a953be2d122c1b3a77fd805093f padauk-2.80/Padauk-Bold.ttf Ubuntu 16.04 */ + || (1046 == gdef_len && 17862 == gpos_len && 71790 == gsub_len) /* 6c93b63b64e8b2c93f5e824e78caca555dc887c7 padauk-2.80/Padauk-book.ttf */ || (1046 == gdef_len && 17112 == gpos_len && 71788 == gsub_len) /* d89b1664058359b8ec82e35d3531931125991fb9 padauk-2.80/Padauk-bookbold.ttf */
24-03-2017

It turns out this is a font bug discussed here :- https://github.com/behdad/harfbuzz/issues/305 >Yes, this is a font bug - the GDEF table in Padauk gives class 3 (mark) > to lots of Latin glyphs that should be normal base glyphs, not marks. > That results in their widths being zeroed. harfbuzz blacklisted v2.8 of the Padauk Book fonts but not the base Padauk fonts :- https://cgit.freedesktop.org/harfbuzz/commit/?id=67e9fdf427e8536f0a134f84ad3bf1740245fe12 We have that patch so the Book fonts look fine. However not the base fonts. harfbuzz later black-listed v3.0 Padauk Book fonts. https://cgit.freedesktop.org/harfbuzz/commit/?id=a657f23ca31237d652b5c101ed24194b6aeadaf8 We don't have that patch (it is from just about 5 weeks ago) but it still does not fix the base fonts. What we need is this :- -- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.cc +++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.cc @@ -124,6 +124,10 @@ /* 2c0c90c6f6087ffbfea76589c93113a9cbb0e75f cantarell-fonts-0.0.21/otf/Cantarell-Bold.otf */ /* 55461f5b853c6da88069ffcdf7f4dd3f8d7e3e6b cantarell-fonts-0.0.21/otf/Cantarell-Bold-Oblique.otf */ || (188 == gdef_len && 3426 == gpos_len && 264 == gsub_len) + /* d3dde9aa0a6b7f8f6a89ef1002e9aaa11b882290 padauk-2.80/Padauk.ttf */ + || (1058 == gdef_len && 16770 == gpos_len && 71796 == gsub_len) + /* 5f3c98ccccae8a953be2d122c1b3a77fd805093f padauk-2.80/Padauk-Bold.ttf */ + || (1046 == gdef_len && 17862 == gpos_len && 71790 == gsub_len) /* 6c93b63b64e8b2c93f5e824e78caca555dc887c7 padauk-2.80/Padauk-book.ttf */ || (1046 == gdef_len && 17112 == gpos_len && 71788 == gsub_len) /* d89b1664058359b8ec82e35d3531931125991fb9 padauk-2.80/Padauk-bookbold.ttf */ ==== I will recommend this upstream as I don't see the point in just patching it locally. I'd also like to know what version we have on OEL 7.2 as that was the submitter used.
23-03-2017

To reproduce just run Font2DTest.jar on Ubuntu, scroll down to Padauk and select textLayout. This reproduces with Oracle JDK as well as OpenJDK, So nothing to do with printing
23-03-2017

The fix for 8145901 applies to both open+closed and was a a general problem. This seems more limited. And that was about scaling. I can see this one on screen without scaling although it may still be a disagreement about what units is used to report some value. The observation that this isn't reproducible on Windows may be more to do with the specific fonts that exhibit this problem than anything else. Padauk + Padauk Bold. Perhaps ICU is just not dependent on the same API as harfbuzz and so isn't suffering from this font oddity.
23-03-2017

It's evident from this testing that it is harfbuzz issue so I do not think b95 testing is necessary anymore.
23-03-2017

[~psadhukhan] -- with icu b160 works well, without this overlapping effect. As to the b95, it's rather hard to configure the system for it: several Jigsaw-related changes require searching, fresh cloning, and updating to an old version of the tests and helper scripts. It's doable but please confirm it's really necessary.
23-03-2017

Seems to be a similar problem as in https://bugs.openjdk.java.net/browse/JDK-8145901 ie more of a font/textlayout issue than printing. Reproducing needs setting up tonga environment so would take time. @Yuri, could you please check if -Dsun.font.layoutengine=icu works for this testcase? Also, b95 does it work before harfbuzz was integrated?
23-03-2017

Confirmed with a different printer and the same system and font. (/usr/share/fonts/sil-padauk/Padauk-bold.ttf)
22-03-2017

RULE "2D_Printing/PrintFont_2D" Exception java.lang.RuntimeException: <br><br>The fonts are not printed properly when dialog type is 'None'.<br>The fonts are not printed properly whendialog type is 'Native'. RULE "2D_Printing/PrintFont_2D" ExitCode 255 RULE "2D_Font/AntialiasTableTest" ExitCode 255
17-03-2017