public Foundry(Font f, Color defcol) { font = f; this.defcol = defcol; BufferedImage junk = TexI.mkbuf(new Coord(10, 10)); Graphics tmpl = junk.getGraphics(); tmpl.setFont(f); m = tmpl.getFontMetrics(); }
public Line render(String text, Color c) { Line t = new Line(text); Coord sz = strsize(text); if (sz.x < 1) sz = sz.add(1, 0); t.img = TexI.mkbuf(sz); Graphics g = t.img.createGraphics(); if (aa) Utils.AA(g); g.setFont(font); g.setColor(c); t.m = g.getFontMetrics(); g.drawString(text, 0, t.m.getAscent()); g.dispose(); return (t); }
public Line render(String text, Color c) { text = Translate.get(text); Coord sz = strsize(text); if (sz.x < 1) sz = sz.add(1, 0); BufferedImage img = TexI.mkbuf(sz); Graphics g = img.createGraphics(); if (aa) Utils.AA(g); g.setFont(font); g.setColor(c); FontMetrics m = g.getFontMetrics(); g.drawString(text, 0, m.getAscent()); g.dispose(); return (new Line(text, img, m)); }