vector - Java AWT Fonts scrambled -
we using following code draw texts in xchart library, on odroid c2 example text scrambled , not readable (see attached picture reference). code used before line starting layout.draw replaced causing issues in eps , pdf export. have github issue here states various reasons problems. working fine on several other installations.
fontrendercontext frc = g.getfontrendercontext(); // textlayout layout = new textlayout(ticklabel, font, new fontrendercontext(null, true, false)); textlayout layout = new textlayout(ticklabel, getchartpainter().getstylemanager().getaxisticklabelsfont(), frc); rectangle2d ticklabelbounds = layout.getbounds(); // layout.draw(g, (float) xoffset, (float) (yoffset + axistick.getaxis().getpaintzone().getheight() - ticklocation + ticklabelbounds.getheight() / 2.0)); shape shape = layout.getoutline(null); affinetransform orig = g.gettransform(); affinetransform @ = new affinetransform(); at.translate((float) xoffset, (float) (yoffset + axistick.getaxis().getpaintzone().getheight() - ticklocation + ticklabelbounds.getheight() / 2.0)); g.transform(at); g.fill(shape); g.settransform(orig);
Comments
Post a Comment