1 18 package org.apache.batik.svggen; 19 20 import java.awt.Graphics2D ; 21 import java.awt.RenderingHints ; 22 import java.awt.Color ; 23 import java.awt.Font ; 24 25 31 public class Bug6535 implements Painter { 32 public void paint(Graphics2D g){ 33 g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, 34 RenderingHints.VALUE_TEXT_ANTIALIAS_ON); 35 g.setPaint(Color.black); 36 37 g.scale(10,10); 38 39 Font font=new Font ("Arial", Font.PLAIN, 1); 41 Font font2=font.deriveFont(1.5f); 42 43 g.setFont(font); 44 g.drawString("Hello, size 10", 4, 4); 45 46 g.setFont(font2); 47 g.drawString("Hello, size 15", 4, 8); 48 49 g.scale(.1, .1); 50 51 font=new Font ("Arial", Font.PLAIN, 10); 52 font2=font.deriveFont(15f); 53 54 g.setFont(font); 55 g.drawString("Hello, size 10", 160, 40); 56 57 g.setFont(font2); 58 g.drawString("Hello, size 15", 160, 80); 59 60 } 61 } 62 | Popular Tags |