-
Bug
-
Resolution: Fixed
-
P2
-
7, 8, 9
-
b96
-
x86
-
os_x
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8188622 | 8u172 | Sreeprakash Sreedharan | P2 | Resolved | Fixed | b01 |
JDK-8190624 | 8u171 | Sreeprakash Sreedharan | P2 | Resolved | Fixed | b01 |
JDK-8169862 | 8u162 | Sreeprakash Sreedharan | P2 | Closed | Fixed | b01 |
JDK-8198118 | emb-8u171 | Unassigned | P2 | Resolved | Fixed | b01 |
version "1.7.0-u6-b01"
OpenJDK Runtime Environment (build 1.7.0-u6-b01-20120314)
OpenJDK 64-Bit Server VM (build 23.0-b16, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Mac OS 10.6.8
A DESCRIPTION OF THE PROBLEM :
Latin ligatures are only active for fonts which where created using
Font.createFont(). The exact same font, created with new Font(), does not honour the TextAttribute.LIGATURES attribute correctly.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Get the LinuxLibertine font from http://www.linuxlibertine.org/.
Install the font LinLibertine_R_G.ttf and put a copy of it in the same folder as the java test code.
Compile and run the test code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Same display for both labels, with "ff" ligature in the word "efficace".
ACTUAL -
The "ff" ligature is done for the lower label (whose font is directly opened by java), but is not available for the upper label (whose font is taken from the system).
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontFormatException;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.font.TextAttribute;
import java.awt.font.TextLayout;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
public class TestLiber {
Font createFont1() {
Font f= new Font("Linux Libertine G", Font.PLAIN, 28);
Map<TextAttribute, Object> map= new HashMap<TextAttribute, Object>();
map.put(TextAttribute.SIZE, 60);
map.put(TextAttribute.KERNING, TextAttribute.KERNING_ON);
map.put(TextAttribute.LIGATURES, TextAttribute.LIGATURES_ON);
f= f.deriveFont(map);
return f;
}
Font createFont2() {
try {
Font f= Font.createFont(Font.TRUETYPE_FONT, new FileInputStream("LinLibertine_R_G.ttf"));
Map<TextAttribute, Object> map= new HashMap<TextAttribute, Object>();
map.put(TextAttribute.SIZE, 60);
map.put(TextAttribute.KERNING, TextAttribute.KERNING_ON);
map.put(TextAttribute.LIGATURES, TextAttribute.LIGATURES_ON);
f= f.deriveFont(map);
return f;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public TestLiber() throws FileNotFoundException, FontFormatException, IOException {
JFrame frame= new JFrame();
String string = "il estoit efficace ect. nettoyer";
JLabel label= new JLabel(string);
JLabel label2= new JLabel(string);
label.setFont(createFont1());
label2.setFont(createFont2());
frame.getContentPane().setLayout(new BoxLayout(frame.getContentPane(),BoxLayout.PAGE_AXIS));
frame.add(label);
frame.add(label2);
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
new TestLiber();
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
});
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
directly use the files for the fonts and bypass the system ?
- backported by
-
JDK-8188622 [macosx] A font has different behaviour for ligatures depending on its creation mode
-
- Resolved
-
-
JDK-8190624 [macosx] A font has different behaviour for ligatures depending on its creation mode
-
- Resolved
-
-
JDK-8198118 [macosx] A font has different behaviour for ligatures depending on its creation mode
-
- Resolved
-
-
JDK-8169862 [macosx] A font has different behaviour for ligatures depending on its creation mode
-
- Closed
-
- duplicates
-
JDK-8035916 [macosx] Problem with Thai text rendering on Mac OS.
-
- Closed
-
-
JDK-8134078 [macosx] Font ligatures are not rendered for natively loaded font
-
- Closed
-
-
JDK-8139741 [macosx] Font ligature is not rendered on OS X for natively loaded font
-
- Closed
-
- relates to
-
JDK-8147002 [macosx] Arabic character cannot be rendered on MacOS X
-
- Resolved
-
-
JDK-8201801 RTL language (Hebrew) is presented from left to right
-
- Resolved
-
-
JDK-8189858 [macosx] Arabic character cannot be rendered on MacOS X
-
- Closed
-
-
JDK-8246036 [macos] Mongolian characters and Yi Syllables are displayed as rectangles
-
- Closed
-