Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6703377
Votes 0
Synopsis freetype: glyph vector outline is not translated correctly
Category java:classes_2d
Reported Against b24
Release Fixed 7(b28)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs
Submit Date 16-MAY-2008
Description
When freetype scaler is used outline is not translated correctly along y  customer .

Testcase:
============
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;

import javax.swing.JComponent;
import javax.swing.JFrame;

public class BugDemo {

	public static class DemoComponent extends JComponent {
		@Override
		public void paintComponent(Graphics g) {
			Graphics2D g2 = (Graphics2D) g;
			FontRenderContext frc = new FontRenderContext(null, false, false);

			g2.translate(100, 100);
			
			g2.setColor(Color.GRAY);
			g2.drawLine(0,0,150,0);
			g2.drawLine(0,150,0,0);
			
			g2.setColor(Color.BLACK);
		    GlyphVector gv = g.getFont().createGlyphVector(frc, "test");
		    g2.drawGlyphVector(gv, 20, 20);

		    g2.setColor(Color.RED);
		    g2.fill(gv.getOutline(20,20));
		}
	}

	private static void createAndShowGUI() {
		JFrame.setDefaultLookAndFeelDecorated(true);
		JFrame frame = new JFrame("BugDemo");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().add(new DemoComponent());
		frame.pack();
		frame.setSize(200,200);
		frame.setVisible(true);
	}

	public static void main(String[] args) {
		javax.swing.SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				createAndShowGUI();
			}
		});
	}

}
Posted Date : 2008-05-16 03:03:43.0
Work Around
N/A
Evaluation
y axis in java and freetpye have different directions. 
Need to invert sign of y value of translation matrix before applying to freetype output.
Posted Date : 2008-05-16 03:05:46.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang