import org.simantics.scenegraph.g2d.G2DNode;
import org.simantics.scenegraph.g2d.G2DPDFRenderingHints;
+import org.simantics.scenegraph.g2d.G2DRenderingHints;
+import org.simantics.scenegraph.g2d.G2DRenderingHints.TextRenderingMode;
import org.simantics.scenegraph.utils.GeometryUtils;
public class FlagNode extends G2DNode {
lineDist *= gScaleRecip;
double y = startY;
double textAreaWidth = textArea.getWidth() * gScaleRecip;
- boolean isRenderingPdf = g.getRenderingHint(G2DPDFRenderingHints.KEY_PDF_WRITER) != null;
+ boolean renderAsText = g.getRenderingHint(G2DPDFRenderingHints.KEY_PDF_WRITER) != null
+ || g.getRenderingHint(G2DRenderingHints.KEY_TEXT_RENDERING_MODE) == TextRenderingMode.AS_TEXT;
for (int i = 0; i < flagText.length; ++i) {
//String line = flagText[i];
System.out.println(" DRAW: '" + flagText[i] + "' with " + g.getTransform());
// #6459: render as text in PDF and paths on screen
- if (isRenderingPdf)
+ if (renderAsText)
g.drawString(flagText[i], (float) x, (float) y);
else
textLayout[i].draw(g, (float) x, (float) y);