Skip to content

8328896: Fontmetrics for large Fonts has zero width #2826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

8328896: Fontmetrics for large Fonts has zero width #2826

wants to merge 1 commit into from

Conversation

TheRealMDoerr
Copy link
Contributor

@TheRealMDoerr TheRealMDoerr commented Jun 28, 2024

Backport of JDK-8328896. Applies cleanly except one hunk which is omitted:

--- src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m
+++ src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m
@@ -1020,4 +1020,20 @@ @implementation CGGI_GlyphCanvas
             CTFontGetAdvancesForGlyphs(font, kCTFontDefaultOrientation, glyphs, advances, count);
         }
     }
-}+    int MAX_SIZE = 1 << 30;
+    if (bboxes) {
+        for (int i = 0; i < count; i++) {
+           if (bboxes[i].origin.x > (double)MAX_SIZE) bboxes[i].origin.x = 0;
+           if (bboxes[i].origin.y > (double)MAX_SIZE) bboxes[i].origin.y = 0;
+           if (bboxes[i].size.width > (double)MAX_SIZE) bboxes[i].size.width = 0;
+           if (bboxes[i].size.height > (double)MAX_SIZE) bboxes[i].size.height = 0;
+        }
+    }
+    if (advances) {
+        for (int i = 0; i < count; i++) {
+           if (advances[i].width > (double)MAX_SIZE) advances[i].width = 0;
+           if (advances[i].height > (double)MAX_SIZE) advances[i].height = 0;
+        }
+    }
+}
+

JDK-8263583 is not in 11u.

The included test has passed on linux, but failed on my MacBook Pro M1. Test has passed in 17u-dev, so there must be something wrong in 11u-dev.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8328896 needs maintainer approval

Issue

  • JDK-8328896: Fontmetrics for large Fonts has zero width (Bug - P3)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev.git pull/2826/head:pull/2826
$ git checkout pull/2826

Update a local copy of the PR:
$ git checkout pull/2826
$ git pull https://git.openjdk.org/jdk11u-dev.git pull/2826/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2826

View PR using the GUI difftool:
$ git pr show -t 2826

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/2826.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 28, 2024

👋 Welcome back mdoerr! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 28, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title Backport 25871af36b1397bdc3715ab0edc589f0483ea0b1 8328896: Fontmetrics for large Fonts has zero width Jun 28, 2024
@openjdk
Copy link

openjdk bot commented Jun 28, 2024

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Jun 28, 2024
@mlbridge
Copy link

mlbridge bot commented Jun 28, 2024

Webrevs

@TheRealMDoerr
Copy link
Contributor Author

Test didn't pass on MacBook Pro M1, but passed in 17u-dev. Giving up, here.

@TheRealMDoerr TheRealMDoerr deleted the 8328896_Fontmetrics branch June 28, 2024 12:04
@TheRealMDoerr
Copy link
Contributor Author

My suggested solution: Use JDK 17! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

1 participant