diff options
Diffstat (limited to 'libjava/classpath/gnu/java/awt/font')
-rw-r--r-- | libjava/classpath/gnu/java/awt/font/FontDelegate.java | 12 | ||||
-rw-r--r-- | libjava/classpath/gnu/java/awt/font/opentype/OpenTypeFont.java | 12 |
2 files changed, 21 insertions, 3 deletions
diff --git a/libjava/classpath/gnu/java/awt/font/FontDelegate.java b/libjava/classpath/gnu/java/awt/font/FontDelegate.java index 030f9d3bca5..a7787330984 100644 --- a/libjava/classpath/gnu/java/awt/font/FontDelegate.java +++ b/libjava/classpath/gnu/java/awt/font/FontDelegate.java @@ -115,8 +115,16 @@ public interface FontDelegate * Returns the number of glyphs in this font face. */ public int getNumGlyphs(); - - + + /** + * Returns the glyph code for the specified character. + * + * @param c the character to map + * + * @return the glyph code + */ + public int getGlyphIndex(int c); + /** * Returns the index of the glyph which gets displayed if the font * cannot map a Unicode code point to a glyph. Many fonts show this diff --git a/libjava/classpath/gnu/java/awt/font/opentype/OpenTypeFont.java b/libjava/classpath/gnu/java/awt/font/opentype/OpenTypeFont.java index a270ce7d96d..6c2193b94ae 100644 --- a/libjava/classpath/gnu/java/awt/font/opentype/OpenTypeFont.java +++ b/libjava/classpath/gnu/java/awt/font/opentype/OpenTypeFont.java @@ -617,7 +617,17 @@ public final class OpenTypeFont return new GNUGlyphVector(this, font, frc, glyphs); } - + /** + * Returns the glyph code for the specified character. + * + * @param c the character to map + * + * @return the glyph code + */ + public int getGlyphIndex(int c) + { + return getCharGlyphMap().getGlyph(c); + } /** * Determines the advance width for a glyph. |