@@ -1811,7 +1811,7 @@ public Font(PShapeSVG parent, XML properties) {
18111811 namedGlyphs .put (fg .name , fg );
18121812 }
18131813 if (fg .unicode != 0 ) {
1814- unicodeGlyphs .put (new Character (fg .unicode ), fg );
1814+ unicodeGlyphs .put (Character . valueOf (fg .unicode ), fg );
18151815 }
18161816 }
18171817 glyphs [glyphCount ++] = fg ;
@@ -1845,7 +1845,7 @@ public void drawString(PGraphics g, String str, float x, float y, float size) {
18451845 char [] c = str .toCharArray ();
18461846 for (int i = 0 ; i < c .length ; i ++) {
18471847 // call draw on each char (pulling it w/ the unicode table)
1848- FontGlyph fg = unicodeGlyphs .get (new Character (c [i ]));
1848+ FontGlyph fg = unicodeGlyphs .get (Character . valueOf (c [i ]));
18491849 if (fg != null ) {
18501850 fg .draw (g );
18511851 // add horizAdvX/unitsPerEm to the x coordinate along the way
@@ -1863,7 +1863,7 @@ public void drawChar(PGraphics g, char c, float x, float y, float size) {
18631863 float s = size / face .unitsPerEm ;
18641864 g .translate (x , y );
18651865 g .scale (s , -s );
1866- FontGlyph fg = unicodeGlyphs .get (new Character (c ));
1866+ FontGlyph fg = unicodeGlyphs .get (Character . valueOf (c ));
18671867 if (fg != null ) g .shape (fg );
18681868 g .popMatrix ();
18691869 }
@@ -1874,7 +1874,7 @@ public float textWidth(String str, float size) {
18741874 char [] c = str .toCharArray ();
18751875 for (int i = 0 ; i < c .length ; i ++) {
18761876 // call draw on each char (pulling it w/ the unicode table)
1877- FontGlyph fg = unicodeGlyphs .get (new Character (c [i ]));
1877+ FontGlyph fg = unicodeGlyphs .get (Character . valueOf (c [i ]));
18781878 if (fg != null ) {
18791879 w += (float ) fg .horizAdvX / face .unitsPerEm ;
18801880 }
0 commit comments