g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, usesFractionalMetrics? RenderingHints.VALUE_FRACTIONALMETRICS_ON : RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
// place the character (on baseline, centered horizontally)
FontMetrics fm = g.getFontMetrics();
int cwidth = fm.charWidth(text.charAt(0));
int height = fm.getHeight();
int ascent = fm.getAscent();
int vborder = (int) ((float)(imgSize - height) / 2f);
int hborder = (int) ((float)(imgSize - cwidth) / 2f);
g.drawString(text, hborder, vborder+ascent);