Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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));
 }