long display = xg2d.display;
int screen = xg2d.xConfig.dev.screen;
long colormap = x11.XDefaultColormap(display, screen);
LinuxFont peer = (LinuxFont)g.getFont().getPeer();
X11.XColor xcolor = getXColor(g.getColor());
long xcolorPtr = xcolor.lock();
/*
* Work around for escape-subsequences.
* We don't draw anything instead of \n,\r,\t
*
* */
char[] outChars = new char[str.length()];
char[] inChars = str.toCharArray();
int j = 0;
for (int i = 0; i < inChars.length; i++){
if(peer.getFontType() == FontManager.FONT_TYPE_T1){
if (!peer.isGlyphExists(inChars[i])){
continue;
}
}
switch (inChars[i]){
case '\n':
case '\r':
case '\t':
break;
default:
outChars[j] = inChars[i];
j++;
}
}
if (inChars.length != 0 ){
LinuxNativeFont.drawStringNative(xg2d.xftDraw, display, colormap,
peer.getFontHandle(isAntialiasingHintSet(g)), (int)Math.round(x), (int)Math.round(y),
outChars, j, xcolorPtr);
}
xcolor.unlock();
}