Skip to content

Commit 87ae845

Browse files
committed
adds a few more bits of info for StandardGlyphVector
1 parent 3e34da0 commit 87ae845

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20250224211151
1+
20250228085852

sources/net.sf.j2s.java.core/src/sun/font/StandardGlyphVector.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ private static class JSTextMetrics {
144144
float actualBoundingBoxAscent;
145145
float actualBoundingBoxRight;
146146
float actualBoundingBoxDescent;
147+
float fontBoundingBoxAscent;
148+
float fontBoundingBoxDescent;
149+
float offsetX, offsetY;
147150
private String text;
151+
private float logicalWidth;
148152

149153

150154
public JSTextMetrics(String text, JSTextMetrics tm) {
@@ -154,6 +158,11 @@ public JSTextMetrics(String text, JSTextMetrics tm) {
154158
this.actualBoundingBoxDescent = tm.actualBoundingBoxDescent;
155159
this.actualBoundingBoxLeft = tm.actualBoundingBoxLeft;
156160
this.actualBoundingBoxRight = tm.actualBoundingBoxRight;
161+
this.fontBoundingBoxAscent = tm.fontBoundingBoxAscent;
162+
this.fontBoundingBoxDescent = tm.fontBoundingBoxDescent;
163+
this.logicalWidth = actualBoundingBoxRight - actualBoundingBoxLeft;
164+
this.offsetX = -actualBoundingBoxLeft;
165+
this.offsetY = actualBoundingBoxAscent + fontBoundingBoxDescent;
157166
// System. intln("jstxtm"
158167
// + " " + this.actualBoundingBoxLeft
159168
// + " " + this.actualBoundingBoxRight
@@ -169,8 +178,9 @@ protected Rectangle2D.Float getActualBounds(float x0, float y0) {
169178
}
170179

171180
protected float getLogicalWidth() {
172-
return actualBoundingBoxRight - actualBoundingBoxLeft;
181+
return logicalWidth;
173182
}
183+
174184
}
175185

176186

0 commit comments

Comments
 (0)