@Override
    public void renderFont(RenderFont font, String str, int x, int y, Color color, float sizeX, float sizeY) {
        if (str.length() == 0) {
            return;
        }

        RenderFontJme jmeFont = (RenderFontJme) font;

        ColorRGBA colorRgba = convertColor(color, tempColor);
        CachedTextKey key = new CachedTextKey(jmeFont.getFont(), str/*, colorRgba*/);
        BitmapText text = textCacheLastFrame.get(key);
        if (text == null) {
            text = jmeFont.createText();
            text.setText(str);
            text.updateLogicalState(0);
        }
        textCacheCurrentFrame.put(key, text);

//        float width = text.getLineWidth();
//        float height = text.getLineHeight();
        float x0 = x; //+ 0.5f * width * (1f - sizeX);
        float y0 = y; // + 0.5f * height * (1f - sizeY);

        tempMat.loadIdentity();
        tempMat.setTranslation(x0, getHeight() - y0, 0);
        tempMat.setScale(sizeX, sizeY, 0);

        rm.setWorldMatrix(tempMat);
        rm.setForcedRenderState(renderState);
        text.setColor(colorRgba);
        text.updateLogicalState(0);
        text.render(rm, colorRgba);

//        System.out.format("renderFont(%s, %s, %d, %d, %s, %f, %f)\n", jmeFont.getFont(), str, x, y, color.toString(), sizeX, sizeY);
    }
Instantiates a new RenderDevice using the specified ColorSpace for Nifty
colors.

@param display the SceneProcessor to render Nifty (not null, alias created)
@param colorSpace the ColorSpace to use for Nifty colors (sRGB or Linear)
jme3-niftygui/src/main/java/com/jme3/niftygui/RenderDeviceJme.java