-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
11.0.8
-
x86_64
-
windows_10
ADDITIONAL SYSTEM INFORMATION :
Win 10, jdk 11.0.8
A DESCRIPTION OF THE PROBLEM :
A huge space between 'w' and 'A' is shown on font size 11. There seems to be not kerning.
---------- BEGIN SOURCE ----------
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.font.TextAttribute;
import java.awt.font.TextLayout;
import java.awt.geom.AffineTransform;
import java.text.AttributedString;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.FontData;
public class CheckLabel {
public static void main(String[] args) {
JFrame f = new JFrame();
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.add(new Component() {
@Override
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
AttributedString attributedString = new AttributedString("PwA");
FontData fontData = new FontData("Arial", 11, SWT.NONE); //$NON-NLS-1$
java.awt.Font awtFont = new java.awt.Font(fontData.getName(), fontData.getStyle(), fontData.getHeight());
attributedString.addAttribute(TextAttribute.FONT, awtFont);
TextLayout tl = new TextLayout("PwA", attributedString.getIterator().getAttributes(), g2d.getFontRenderContext());
//shape is created from the outline of the textlayout
Shape outline = tl.getOutline(AffineTransform.getTranslateInstance(0, 20));
g2d.fill(outline);
g2d.setTransform(AffineTransform.getScaleInstance(2, 2));
Shape outline2 = tl.getOutline(AffineTransform.getTranslateInstance(0, 100));
g2d.fill(outline2);
}
@Override
public Dimension getSize() {
return new Dimension(100, 100);
}
});
f.setSize(400, 400);
f.setVisible(true);
}
}
---------- END SOURCE ----------
FREQUENCY : always
Win 10, jdk 11.0.8
A DESCRIPTION OF THE PROBLEM :
A huge space between 'w' and 'A' is shown on font size 11. There seems to be not kerning.
---------- BEGIN SOURCE ----------
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.font.TextAttribute;
import java.awt.font.TextLayout;
import java.awt.geom.AffineTransform;
import java.text.AttributedString;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.FontData;
public class CheckLabel {
public static void main(String[] args) {
JFrame f = new JFrame();
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.add(new Component() {
@Override
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
AttributedString attributedString = new AttributedString("PwA");
FontData fontData = new FontData("Arial", 11, SWT.NONE); //$NON-NLS-1$
java.awt.Font awtFont = new java.awt.Font(fontData.getName(), fontData.getStyle(), fontData.getHeight());
attributedString.addAttribute(TextAttribute.FONT, awtFont);
TextLayout tl = new TextLayout("PwA", attributedString.getIterator().getAttributes(), g2d.getFontRenderContext());
//shape is created from the outline of the textlayout
Shape outline = tl.getOutline(AffineTransform.getTranslateInstance(0, 20));
g2d.fill(outline);
g2d.setTransform(AffineTransform.getScaleInstance(2, 2));
Shape outline2 = tl.getOutline(AffineTransform.getTranslateInstance(0, 100));
g2d.fill(outline2);
}
@Override
public Dimension getSize() {
return new Dimension(100, 100);
}
});
f.setSize(400, 400);
f.setVisible(true);
}
}
---------- END SOURCE ----------
FREQUENCY : always
- duplicates
-
JDK-8253834 Kerning broken on Arial, 11Pt Size on Graphics2d fillOutline
-
- Closed
-