diff options
Diffstat (limited to 'src/java/org/apache/fop/render/ps/FontResourceCache.java')
-rw-r--r-- | src/java/org/apache/fop/render/ps/FontResourceCache.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/render/ps/FontResourceCache.java b/src/java/org/apache/fop/render/ps/FontResourceCache.java index 9d4090eed..1514d201e 100644 --- a/src/java/org/apache/fop/render/ps/FontResourceCache.java +++ b/src/java/org/apache/fop/render/ps/FontResourceCache.java @@ -42,19 +42,20 @@ class FontResourceCache { } /** - * Returns the PSResource for the given font key. + * Returns the PSFontResource for the given font key. * @param key the font key ("F*") - * @return the matching PSResource + * @return the matching PSFontResource instance */ - public PSResource getPSResourceForFontKey(String key) { - PSResource res = null; + public PSFontResource getFontResourceForFontKey(String key) { + PSFontResource res = null; if (this.fontResources != null) { - res = (PSResource)this.fontResources.get(key); + res = (PSFontResource)this.fontResources.get(key); } else { this.fontResources = new java.util.HashMap(); } if (res == null) { - res = new PSResource(PSResource.TYPE_FONT, getPostScriptNameForFontKey(key)); + res = PSFontResource.createFontResource( + new PSResource(PSResource.TYPE_FONT, getPostScriptNameForFontKey(key))); this.fontResources.put(key, res); } return res; @@ -76,9 +77,9 @@ class FontResourceCache { throw new IllegalStateException("Font not available: " + key); } if (postFix == null) { - return tf.getFontName(); + return tf.getEmbedFontName(); } else { - return tf.getFontName() + postFix; + return tf.getEmbedFontName() + postFix; } } |