From 5857d93e2d41608b247ec18cb9129f3a6624d9ac Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 1 Apr 2011 20:07:04 +0200 Subject: Font Names: Expose name indices allowing user to pick all names .. --- src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/com/jogamp/graph/curve') diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java index 2bb99d27c..79ae8c11e 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java @@ -55,13 +55,13 @@ public abstract class TextRenderer extends Renderer { Path2D[] paths = new Path2D[str.length()]; ((FontInt)font).getOutline(str, size, affineTransform, paths); - GlyphString glyphString = new GlyphString(pointFactory, font.getName(), str); + GlyphString glyphString = new GlyphString(pointFactory, font.getName(Font.NAME_UNIQUNAME), str); glyphString.createfromFontPath(paths, affineTransform); glyphString.generateRegion(gl.getContext(), sharpness, st, renderType); return glyphString; } - + public void flushCache() { Iterator iterator = stringCacheMap.values().iterator(); while(iterator.hasNext()){ @@ -84,12 +84,12 @@ public abstract class TextRenderer extends Renderer { } protected GlyphString getCachedGlyphString(Font font, String str, int fontSize) { - final String key = font.getName() + "." + str.hashCode() + "." + fontSize; + final String key = font.getName(Font.NAME_UNIQUNAME) + "." + str.hashCode() + "." + fontSize; return stringCacheMap.get(key); } protected void addCachedGlyphString(Font font, String str, int fontSize, GlyphString glyphString) { - final String key = font.getName() + "." + str.hashCode() + "." + fontSize; + final String key = font.getName(Font.NAME_UNIQUNAME) + "." + str.hashCode() + "." + fontSize; validateCache(1); stringCacheMap.put(key, glyphString); stringCacheArray.add(stringCacheArray.size(), key); -- cgit v1.2.3