From e65ace10e3c40d6fef4e9997311d88c900e84ced Mon Sep 17 00:00:00 2001 From: Daniel Gredler Date: Fri, 26 Dec 2025 11:58:48 +0000 Subject: [PATCH] 6517125: FontStrike.getGlyphVectorOutline() not used Reviewed-by: prr, serb --- .../macosx/classes/sun/font/CStrike.java | 6 --- .../macosx/classes/sun/font/NativeStrike.java | 8 +--- .../classes/sun/font/CompositeStrike.java | 41 +------------------ .../classes/sun/font/FileFontStrike.java | 6 --- .../share/classes/sun/font/FontStrike.java | 18 +------- .../unix/classes/sun/font/DelegateStrike.java | 6 --- .../unix/classes/sun/font/NativeStrike.java | 6 --- .../classes/sun/font/NativeStrike.java | 8 +--- 8 files changed, 5 insertions(+), 94 deletions(-) diff --git a/src/java.desktop/macosx/classes/sun/font/CStrike.java b/src/java.desktop/macosx/classes/sun/font/CStrike.java index 4b0ac9fd8d3..bffb76fb1ad 100644 --- a/src/java.desktop/macosx/classes/sun/font/CStrike.java +++ b/src/java.desktop/macosx/classes/sun/font/CStrike.java @@ -222,12 +222,6 @@ public final class CStrike extends PhysicalStrike { return getNativeGlyphOutline(getNativeStrikePtr(), glyphCode, x, y); } - // should implement, however not called though any path that is publicly exposed - @Override - GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) { - throw new Error("not implemented yet"); - } - // called from the Sun2D renderer @Override long getGlyphImagePtr(int glyphCode) { diff --git a/src/java.desktop/macosx/classes/sun/font/NativeStrike.java b/src/java.desktop/macosx/classes/sun/font/NativeStrike.java index 9a1b1ecec3d..4ea267a4bd7 100644 --- a/src/java.desktop/macosx/classes/sun/font/NativeStrike.java +++ b/src/java.desktop/macosx/classes/sun/font/NativeStrike.java @@ -47,7 +47,6 @@ public class NativeStrike extends PhysicalStrike { throw new RuntimeException("NativeFont not used on Windows"); } - @Override void getGlyphImagePtrs(int[] glyphCodes, long[] images,int len) { } @@ -81,14 +80,9 @@ public class NativeStrike extends PhysicalStrike { Rectangle2D.Float getGlyphOutlineBounds(int glyphCode) { return null; } + @Override GeneralPath getGlyphOutline(int glyphCode, float x, float y) { return null; } - - @Override - GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) { - return null; - } - } diff --git a/src/java.desktop/share/classes/sun/font/CompositeStrike.java b/src/java.desktop/share/classes/sun/font/CompositeStrike.java index be6092f61f8..9974332a314 100644 --- a/src/java.desktop/share/classes/sun/font/CompositeStrike.java +++ b/src/java.desktop/share/classes/sun/font/CompositeStrike.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -175,43 +175,4 @@ public final class CompositeStrike extends FontStrike { return path; } } - - /* The physical font slot for each glyph is encoded in the glyph ID - * To be as efficient as possible we find a run of glyphs from the - * same slot and create a temporary array of these glyphs decoded - * to the slot. The slot font is then queried for the GeneralPath - * for that run of glyphs. GeneralPaths from each run are appended - * to create the shape for the whole glyph array. - */ - GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) { - GeneralPath path = null; - GeneralPath gp; - int glyphIndex = 0; - int[] tmpGlyphs; - - while (glyphIndex < glyphs.length) { - int start = glyphIndex; - int slot = glyphs[glyphIndex] >>> 24; - while (glyphIndex < glyphs.length && - (glyphs[glyphIndex+1] >>> 24) == slot) { - glyphIndex++; - } - int tmpLen = glyphIndex-start+1; - tmpGlyphs = new int[tmpLen]; - for (int i=0;i