diff options
author | smallsql <smallsql> | 2013-10-21 18:28:22 +0400 |
---|---|---|
committer | smallsql <smallsql> | 2013-10-21 18:28:22 +0400 |
commit | b1e935ee295b20bb551570195820b7eb299817c4 (patch) | |
tree | c84a651317bc45389178d06a7880d073f0f1aeff /openjdk/sun | |
parent | 327403a4b495c9bb46b07699803c2544d05d8ca1 (diff) |
Implements the StandardGlypVector constuctor with glyphs
Diffstat (limited to 'openjdk/sun')
-rw-r--r-- | openjdk/sun/font/StandardGlyphVector.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/openjdk/sun/font/StandardGlyphVector.java b/openjdk/sun/font/StandardGlyphVector.java index aec6572e..fb3de314 100644 --- a/openjdk/sun/font/StandardGlyphVector.java +++ b/openjdk/sun/font/StandardGlyphVector.java @@ -94,8 +94,21 @@ public class StandardGlyphVector extends GlyphVector{ this(font, getString(iter), frc); } - public StandardGlyphVector(Font font, int[] glyphs, FontRenderContext frc) { - throw new NotYetImplementedError(); + public StandardGlyphVector( Font font, int[] glyphs, FontRenderContext frc ) { + this( font, glyphs2chars(glyphs), frc ); + } + + /** + * Symmetric to {@link #getGlyphCodes(int, int, int[])} + * Currently there is no real mapping possible between the chars and the glyph IDs in the TTF file + */ + private static char[] glyphs2chars( int[] glyphs ) { + int count = glyphs.length; + char[] text = new char[count]; + for( int i = 0; i < count; ++i ) { + text[i] = (char)glyphs[i]; + } + return text; } ///////////////////////////// |