}
/* setFromString returns false if shaping is needed, and we then back
* off to a TextLayout. Such text may benefit slightly from a lower
* overhead in this approach over the approach in previous releases.
*/
GlyphList gl = GlyphList.getInstance();
if (gl.setFromString(info, s, devx, devy)) {
drawGlyphList(sg2d, gl);
gl.dispose();
} else {
gl.dispose(); // release this asap.
TextLayout tl = new TextLayout(s, sg2d.getFont(),
sg2d.getFontRenderContext());
tl.draw(sg2d, (float)x, (float)y);
}
}