Skip to content

Commit e65ace1

Browse files
author
Daniel Gredler
committed
6517125: FontStrike.getGlyphVectorOutline() not used
Reviewed-by: prr, serb
1 parent 3e6170c commit e65ace1

File tree

8 files changed

+5
-94
lines changed

8 files changed

+5
-94
lines changed

src/java.desktop/macosx/classes/sun/font/CStrike.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,6 @@ GeneralPath getGlyphOutline(int glyphCode, float x, float y) {
222222
return getNativeGlyphOutline(getNativeStrikePtr(), glyphCode, x, y);
223223
}
224224

225-
// should implement, however not called though any path that is publicly exposed
226-
@Override
227-
GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
228-
throw new Error("not implemented yet");
229-
}
230-
231225
// called from the Sun2D renderer
232226
@Override
233227
long getGlyphImagePtr(int glyphCode) {

src/java.desktop/macosx/classes/sun/font/NativeStrike.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public class NativeStrike extends PhysicalStrike {
4747
throw new RuntimeException("NativeFont not used on Windows");
4848
}
4949

50-
5150
@Override
5251
void getGlyphImagePtrs(int[] glyphCodes, long[] images,int len) {
5352
}
@@ -81,14 +80,9 @@ float getGlyphAdvance(int glyphCode) {
8180
Rectangle2D.Float getGlyphOutlineBounds(int glyphCode) {
8281
return null;
8382
}
84-
@Override
85-
GeneralPath getGlyphOutline(int glyphCode, float x, float y) {
86-
return null;
87-
}
8883

8984
@Override
90-
GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
85+
GeneralPath getGlyphOutline(int glyphCode, float x, float y) {
9186
return null;
9287
}
93-
9488
}

src/java.desktop/share/classes/sun/font/CompositeStrike.java

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -175,43 +175,4 @@ GeneralPath getGlyphOutline(int glyphCode, float x, float y) {
175175
return path;
176176
}
177177
}
178-
179-
/* The physical font slot for each glyph is encoded in the glyph ID
180-
* To be as efficient as possible we find a run of glyphs from the
181-
* same slot and create a temporary array of these glyphs decoded
182-
* to the slot. The slot font is then queried for the GeneralPath
183-
* for that run of glyphs. GeneralPaths from each run are appended
184-
* to create the shape for the whole glyph array.
185-
*/
186-
GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
187-
GeneralPath path = null;
188-
GeneralPath gp;
189-
int glyphIndex = 0;
190-
int[] tmpGlyphs;
191-
192-
while (glyphIndex < glyphs.length) {
193-
int start = glyphIndex;
194-
int slot = glyphs[glyphIndex] >>> 24;
195-
while (glyphIndex < glyphs.length &&
196-
(glyphs[glyphIndex+1] >>> 24) == slot) {
197-
glyphIndex++;
198-
}
199-
int tmpLen = glyphIndex-start+1;
200-
tmpGlyphs = new int[tmpLen];
201-
for (int i=0;i<tmpLen;i++) {
202-
tmpGlyphs[i] = glyphs[i] & SLOTMASK;
203-
}
204-
gp = getStrikeForSlot(slot).getGlyphVectorOutline(tmpGlyphs, x, y);
205-
if (path == null) {
206-
path = gp;
207-
} else if (gp != null) {
208-
path.append(gp, false);
209-
}
210-
}
211-
if (path == null) {
212-
return new GeneralPath();
213-
} else {
214-
return path;
215-
}
216-
}
217178
}

src/java.desktop/share/classes/sun/font/FileFontStrike.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import static sun.awt.SunHints.*;
4040
import sun.java2d.pipe.OutlineTextRenderer;
4141

42-
4342
public class FileFontStrike extends PhysicalStrike {
4443

4544
/* fffe and ffff are values we specially interpret as meaning
@@ -931,11 +930,6 @@ GeneralPath getGlyphOutline(int glyphCode, float x, float y) {
931930
return gp;
932931
}
933932

934-
GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
935-
return fileFont.getGlyphVectorOutline(pScalerContext,
936-
glyphs, glyphs.length, x, y);
937-
}
938-
939933
protected void adjustPoint(Point2D.Float pt) {
940934
if (invertDevTx != null) {
941935
invertDevTx.deltaTransform(pt, pt);

src/java.desktop/share/classes/sun/font/FontStrike.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -32,20 +32,12 @@
3232

3333
public abstract class FontStrike {
3434

35-
3635
protected FontStrikeDisposer disposer;
3736
protected FontStrikeDesc desc;
3837
protected StrikeMetrics strikeMetrics;
3938
protected boolean algoStyle = false;
4039
protected float boldness = 1f;
4140
protected float italic = 0f;
42-
/*
43-
* lastLookupTime is updated by Font2D.getStrike and can be used to
44-
* choose strikes that have not been newly referenced for purging when
45-
* memory usage gets too high. Active strikes will never be purged
46-
* because purging is via GC of WeakReferences.
47-
*/
48-
//protected long lastlookupTime/* = System.currentTimeMillis()*/;
4941

5042
public abstract int getNumGlyphs();
5143

@@ -70,11 +62,5 @@ abstract void getGlyphImageBounds(int glyphcode,
7062

7163
abstract Rectangle2D.Float getGlyphOutlineBounds(int glyphCode);
7264

73-
abstract GeneralPath
74-
getGlyphOutline(int glyphCode, float x, float y);
75-
76-
abstract GeneralPath
77-
getGlyphVectorOutline(int[] glyphs, float x, float y);
78-
79-
65+
abstract GeneralPath getGlyphOutline(int glyphCode, float x, float y);
8066
}

src/java.desktop/unix/classes/sun/font/DelegateStrike.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,4 @@ Rectangle2D.Float getGlyphOutlineBounds(int glyphCode) {
116116
GeneralPath getGlyphOutline(int glyphCode, float x, float y) {
117117
return delegateStrike.getGlyphOutline(glyphCode, x, y);
118118
}
119-
120-
@Override
121-
GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
122-
return delegateStrike.getGlyphVectorOutline(glyphs, x, y);
123-
}
124-
125119
}

src/java.desktop/unix/classes/sun/font/NativeStrike.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,4 @@ Rectangle2D.Float getGlyphOutlineBounds(int glyphCode) {
295295
GeneralPath getGlyphOutline(int glyphCode, float x, float y) {
296296
return new GeneralPath();
297297
}
298-
299-
@Override
300-
GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
301-
return new GeneralPath();
302-
}
303-
304298
}

src/java.desktop/windows/classes/sun/font/NativeStrike.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public class NativeStrike extends PhysicalStrike {
4747
throw new RuntimeException("NativeFont not used on Windows");
4848
}
4949

50-
5150
@Override
5251
void getGlyphImagePtrs(int[] glyphCodes, long[] images,int len) {
5352
}
@@ -81,14 +80,9 @@ float getGlyphAdvance(int glyphCode) {
8180
Rectangle2D.Float getGlyphOutlineBounds(int glyphCode) {
8281
return null;
8382
}
84-
@Override
85-
GeneralPath getGlyphOutline(int glyphCode, float x, float y) {
86-
return null;
87-
}
8883

8984
@Override
90-
GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
85+
GeneralPath getGlyphOutline(int glyphCode, float x, float y) {
9186
return null;
9287
}
93-
9488
}

0 commit comments

Comments
 (0)