1 18 package org.apache.batik.svggen; 19 20 import java.awt.Graphics2D ; 21 import java.awt.Font ; 22 import java.awt.geom.AffineTransform ; 23 24 31 public class Bug4945 implements Painter { 32 public void paint(Graphics2D g){ 33 Font origFont = g.getFont(); 34 35 g.setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING, 36 java.awt.RenderingHints.VALUE_ANTIALIAS_ON); 37 38 Font font = origFont.deriveFont(AffineTransform.getScaleInstance(1.5, 3)); 40 g.setFont(font); 41 g.drawString("Scaled Font", 20, 40); 42 43 font = origFont.deriveFont(AffineTransform.getTranslateInstance(50, 20)); 45 g.setFont(font); 46 g.drawString("Translated Font", 20, 80); 47 g.drawLine(20, 80, 120, 80); 48 49 font = origFont.deriveFont(AffineTransform.getShearInstance(.5, .5)); 51 g.setFont(font); 52 g.drawString("Sheared Font", 20, 120); 53 54 font = origFont.deriveFont(AffineTransform.getRotateInstance(Math.PI/4)); 56 g.setFont(font); 57 g.drawString("Rotated Font", 220, 120); 58 } 59 } 60 61 | Popular Tags |