Bug 1478006 - Invalid font metrics when printing under certain repeatable conditions
Summary: Invalid font metrics when printing under certain repeatable conditions
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.8.0-openjdk
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mario Torre
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-03 12:48 UTC by Robert Marcano
Modified: 2019-05-28 23:27 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-05-28 23:27:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Test output (86.17 KB, application/pdf)
2017-08-03 12:48 UTC, Robert Marcano
no flags Details
Test case (4.72 KB, text/x-csrc)
2017-08-03 12:50 UTC, Robert Marcano
no flags Details


Links
System ID Private Priority Status Summary Last Updated
openjdk bug system JDK-8139178 0 None None None 2017-08-03 15:38:02 UTC

Description Robert Marcano 2017-08-03 12:48:28 UTC
Created attachment 1308721 [details]
Test output

Description of problem:

When doing Java Printing API with Java2D, font metrics for ascent and descent return negative or zero values under certain conditions: 

1. If the page is printer landscape it return zero for both metrics properties.
2. If the page contains transparency (when the page is sent to the printer as an image) it returns negative values.

The landscape problem has greater preference than the one with a transparency, so a landscape page with a transparency return zero.


Version-Release number of selected component (if applicable):

java-1.8.0-openjdk-1.8.0.141-1.b16.fc26.x86_64

How reproducible:

Always.

Steps to Reproduce:

I am attaching a test case and output PDF

Actual results:

Invalid font metrics when printing with some transparency on the page or using landscape orientation.

Expected results:

The metrics must always return valid values on all situations of portrait or landscape, transparency present or not.

Additional info:

The bug doesn't happen on Oracle JVMs that use a proprietary font layout code.

The test PDF has 4 pages, 1 and 2 are portrait, 3 and 4 are landscape (page 4 is really landscape printed but the viewer will show it portrait, it is Ghostcript's ps2pdf automatic orientation algorithm in action)

- Page 1 is the only one with correct positive values and is shown perfectly.
- Page 2 is invalid with negative values because is has transparency.
- Page 3 is invalid with zero as values because they are landscape.

Comment 1 Robert Marcano 2017-08-03 12:50:13 UTC
Created attachment 1308723 [details]
Test case

Adding the test that generated the PDF

Comment 2 Robert Marcano 2017-08-03 15:38:03 UTC
I was referred to an old OpenJDK bug (so sad it is that old). Added it to this bug

Comment 3 Robert Marcano 2017-08-03 19:05:24 UTC
For the record, there is a workaround if the client code is accessible: Use LineMetrics instead of FontMetrics to get ascent and descent. It is probably better to use those when printing because LineMetrics returns float values instead of int of FontMetrics and Java printing is fixed at 72 dpi but real printers has greater resolutions so subpixel font metrics are better.

But for closed source applications or that developers don't want to update the fix is needed.

Comment 4 Fedora End Of Life 2018-05-03 08:26:27 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 5 Mario Torre 2018-05-03 08:52:43 UTC
I'm keeping this alive since the bug appears still not fixed upstream even in 9 and 10.

Comment 6 maria121 2018-12-15 03:23:17 UTC Comment hidden (spam)
Comment 7 Ben Cotton 2019-05-02 20:07:19 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Ben Cotton 2019-05-28 23:27:46 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.