* painted
*/
protected Rectangle __drawString(Object graphics, String str, POS hpos, POS vpos, boolean newLine, boolean draw, boolean revertLastOutputPX) {
assert graphics instanceof Graphics ? ((Graphics2D) graphics).getClipBounds() instanceof Rectangle : true : "graphics has no clip set and will result in nullpointerexception";
if (!render.isOn()) {
throw new JXAException(JXAException.LEVEL.SYSTEM, "not in HUD rendering block, missing HUD.begin()");
}
Color c = null;
FloatBuffer currentColor = null;
if (graphics instanceof Graphics) {
Graphics2D g = (Graphics2D) graphics;