6517125: FontStrike.getGlyphVectorOutline() not used

Reviewed-by: prr, serb
This commit is contained in:
Daniel Gredler 2025-12-26 11:58:48 +00:00
parent 3e6170c5be
commit e65ace10e3
8 changed files with 5 additions and 94 deletions

View File

@ -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) {

View File

@ -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;
}
}

View File

@ -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<tmpLen;i++) {
tmpGlyphs[i] = glyphs[i] & SLOTMASK;
}
gp = getStrikeForSlot(slot).getGlyphVectorOutline(tmpGlyphs, x, y);
if (path == null) {
path = gp;
} else if (gp != null) {
path.append(gp, false);
}
}
if (path == null) {
return new GeneralPath();
} else {
return path;
}
}
}

View File

@ -39,7 +39,6 @@ import java.util.concurrent.ConcurrentHashMap;
import static sun.awt.SunHints.*;
import sun.java2d.pipe.OutlineTextRenderer;
public class FileFontStrike extends PhysicalStrike {
/* fffe and ffff are values we specially interpret as meaning
@ -931,11 +930,6 @@ public class FileFontStrike extends PhysicalStrike {
return gp;
}
GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
return fileFont.getGlyphVectorOutline(pScalerContext,
glyphs, glyphs.length, x, y);
}
protected void adjustPoint(Point2D.Float pt) {
if (invertDevTx != null) {
invertDevTx.deltaTransform(pt, pt);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 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
@ -32,20 +32,12 @@ import java.awt.geom.Point2D;
public abstract class FontStrike {
protected FontStrikeDisposer disposer;
protected FontStrikeDesc desc;
protected StrikeMetrics strikeMetrics;
protected boolean algoStyle = false;
protected float boldness = 1f;
protected float italic = 0f;
/*
* lastLookupTime is updated by Font2D.getStrike and can be used to
* choose strikes that have not been newly referenced for purging when
* memory usage gets too high. Active strikes will never be purged
* because purging is via GC of WeakReferences.
*/
//protected long lastlookupTime/* = System.currentTimeMillis()*/;
public abstract int getNumGlyphs();
@ -70,11 +62,5 @@ public abstract class FontStrike {
abstract Rectangle2D.Float getGlyphOutlineBounds(int glyphCode);
abstract GeneralPath
getGlyphOutline(int glyphCode, float x, float y);
abstract GeneralPath
getGlyphVectorOutline(int[] glyphs, float x, float y);
abstract GeneralPath getGlyphOutline(int glyphCode, float x, float y);
}

View File

@ -116,10 +116,4 @@ final class DelegateStrike extends NativeStrike {
GeneralPath getGlyphOutline(int glyphCode, float x, float y) {
return delegateStrike.getGlyphOutline(glyphCode, x, y);
}
@Override
GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
return delegateStrike.getGlyphVectorOutline(glyphs, x, y);
}
}

View File

@ -295,10 +295,4 @@ class NativeStrike extends PhysicalStrike {
GeneralPath getGlyphOutline(int glyphCode, float x, float y) {
return new GeneralPath();
}
@Override
GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
return new GeneralPath();
}
}

View File

@ -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;
}
}