From b1e935ee295b20bb551570195820b7eb299817c4 Mon Sep 17 00:00:00 2001 From: smallsql Date: Mon, 21 Oct 2013 14:28:22 +0000 Subject: Implements the StandardGlypVector constuctor with glyphs --- openjdk/sun/font/StandardGlyphVector.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'openjdk/sun') 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; } ///////////////////////////// -- cgit v1.2.3