e654. 获得文本的缩略图

Shape getTextShape(Graphics2D g2d, String str, Font font) {
        FontRenderContext frc = g2d.getFontRenderContext();
        TextLayout tl = new TextLayout(str, font, frc);
        return tl.getOutline(null);
    }

 

Related Examples
posted @ 2018-09-02 21:34  borter  阅读(190)  评论(0编辑  收藏  举报