1 18 package org.apache.batik.svggen; 19 20 import java.awt.Color ; 21 import java.awt.Font ; 22 import java.awt.Graphics2D ; 23 import java.awt.RenderingHints ; 24 25 33 public class GVector implements Painter { 34 public void paint(Graphics2D g) { 35 g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 36 RenderingHints.VALUE_ANTIALIAS_ON); 37 38 Font font = new Font ("Arial", Font.BOLD, 15); 40 g.setFont(font); 41 42 Color labelColor = new Color (0x666699); 44 g.setPaint(labelColor); 45 46 String text = "This is a GlyphVector"; 48 49 java.awt.font.GlyphVector gv = font.createGlyphVector(g.getFontRenderContext(), 51 text); 52 53 g.drawGlyphVector(gv, 30, 30); 54 } 55 } 56 | Popular Tags |