setting i18n property to true for a document brakes the text layout.
Compile and run the next test:
public class I18nTest {
public static void main(String[] args) throws Exception {
JFrame jFrame = new JFrame();
JEditorPane component = new JEditorPane();
component.setEditorKit(new StyledEditorKit());
component.getDocument().putProperty("i18n", Boolean.TRUE);
SimpleAttributeSet attrs = new SimpleAttributeSet();
StyleConstants.setFontSize(attrs, 72);
StyleConstants.setBold(attrs, true);
StyleConstants.setUnderline(attrs, true);
component.getDocument().insertString(0, "test test", null);
component.getDocument().insertString(5, "TEST TEST TEST", attrs);
jFrame.getContentPane().add(new JScrollPane(component));
jFrame.setSize(300, 500);
jFrame.setVisible(true);
}
}
it produces layout shown on the l2.png screenshot, but should look like l1.png.