@@ -1814,7 +1814,7 @@ public Font(PShapeSVG parent, XML properties) {
18141814 namedGlyphs .put (fg .name , fg );
18151815 }
18161816 if (fg .unicode != 0 ) {
1817- unicodeGlyphs .put (new Character (fg .unicode ), fg );
1817+ unicodeGlyphs .put (Character . valueOf (fg .unicode ), fg );
18181818 }
18191819 }
18201820 glyphs [glyphCount ++] = fg ;
@@ -1848,7 +1848,7 @@ public void drawString(PGraphics g, String str, float x, float y, float size) {
18481848 char [] c = str .toCharArray ();
18491849 for (int i = 0 ; i < c .length ; i ++) {
18501850 // call draw on each char (pulling it w/ the unicode table)
1851- FontGlyph fg = unicodeGlyphs .get (new Character (c [i ]));
1851+ FontGlyph fg = unicodeGlyphs .get (Character . valueOf (c [i ]));
18521852 if (fg != null ) {
18531853 fg .draw (g );
18541854 // add horizAdvX/unitsPerEm to the x coordinate along the way
@@ -1866,7 +1866,7 @@ public void drawChar(PGraphics g, char c, float x, float y, float size) {
18661866 float s = size / face .unitsPerEm ;
18671867 g .translate (x , y );
18681868 g .scale (s , -s );
1869- FontGlyph fg = unicodeGlyphs .get (new Character (c ));
1869+ FontGlyph fg = unicodeGlyphs .get (Character . valueOf (c ));
18701870 if (fg != null ) g .shape (fg );
18711871 g .popMatrix ();
18721872 }
@@ -1877,7 +1877,7 @@ public float textWidth(String str, float size) {
18771877 char [] c = str .toCharArray ();
18781878 for (int i = 0 ; i < c .length ; i ++) {
18791879 // call draw on each char (pulling it w/ the unicode table)
1880- FontGlyph fg = unicodeGlyphs .get (new Character (c [i ]));
1880+ FontGlyph fg = unicodeGlyphs .get (Character . valueOf (c [i ]));
18811881 if (fg != null ) {
18821882 w += (float ) fg .horizAdvX / face .unitsPerEm ;
18831883 }
0 commit comments