aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph/font
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp/graph/font')
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java5
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
index 8806f537d..8e465de99 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
@@ -44,6 +44,7 @@ import com.jogamp.common.util.IntObjectHashMap;
import com.jogamp.graph.curve.OutlineShape;
import com.jogamp.graph.font.Font;
import com.jogamp.graph.font.FontFactory;
+import com.jogamp.graph.font.Font.Glyph;
import com.jogamp.graph.geom.AABBox;
import com.jogamp.graph.geom.Vertex;
import com.jogamp.graph.geom.Vertex.Factory;
@@ -162,6 +163,10 @@ class TypecastFont implements FontInt {
return sb;
}
+ public float getAdvanceWidth(int i, float pixelSize) {
+ return font.getHmtxTable().getAdvanceWidth(i) * metrics.getScale(pixelSize);
+ }
+
public Metrics getMetrics() {
if (metrics == null) {
metrics = new TypecastHMetrics(this);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
index 6baaf5afb..916c7b4d8 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
@@ -77,7 +77,7 @@ public class TypecastRenderer {
advanceTotal = 0;
continue;
} else if (character == ' ') {
- advanceTotal += font.font.getHmtxTable().getAdvanceWidth(Glyph.ID_SPACE) * metrics.getScale(pixelSize);
+ advanceTotal += font.getAdvanceWidth(Glyph.ID_SPACE, pixelSize);
continue;
}
Glyph glyph = font.getGlyph(character);