static JWindow screenTextOverlay_withOutline(fS text, O... _) { ret swing(func -> JWindow { new JWindow w; w.setAlwaysOnTop(true); w.setVisible(true); Font font = cast optPar font(_); if (font == null) font = w.getFont().deriveFont(boolPar bold(_, true) ? Font.BOLD : Font.PLAIN, optPar fontSize(_, 80)); TextLayout tl = newTextLayout(text, font, w); Rectangle2D r = tl.getBounds(); new AffineTransform tx; tx.translate(0, r.getHeight()); Shape outline = tl.getOutline(tx); float outlineWidth = optPar outlineWidth(_, 4.0f); JComponent c = dynamicallyPaintedComponent(voidfunc(Graphics2D g, int w, int h) { fillRect(g, 0, 0, w, h, optPar color(_, Color.WHITE)); g.setColor(Color.black); g.setStroke(new BasicStroke(outlineWidth); antiAliasOn(g); g.draw(outline); }); w.add(c); centerWindow(w, iceil(r.getWidth()+optPar magicXMargin(_, 10)), iceil(r.getHeight()+optPar magicYMargin(_, 10))); w.setShape(outline); ret w; }); }