[jdk11u-dev] Withdrawn: 8328896: Fontmetrics for large Fonts has zero width

Martin Doerr mdoerr at openjdk.org
Fri Jun 28 12:07:22 UTC 2024


On Fri, 28 Jun 2024 11:14:50 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

> Backport of [JDK-8328896](https://bugs.openjdk.org/browse/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](https://bugs.openjdk.org/browse/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.

This pull request has been closed without being integrated.

-------------

PR: https://git.openjdk.org/jdk11u-dev/pull/2826


More information about the jdk-updates-dev mailing list