<Swing Dev> [12] JDK-8202013: JEditorPane shows large HTML unordered list bullets

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Mon Sep 3 07:24:33 UTC 2018


Hi All,

Please review a fix for an issue where it is seen that
when displaying an HTML unordered list in a JEditorPane, the bullets 
generated by <li> looks larger than needed relative to text font size as 
seen in
https://www.dropbox.com/s/onv6v5xzutnvuyz/large-text-bullets.png?dl=0

This is because the StyleSheet#drawShape() routine hardcodes the bullet 
size to 8 which might look larger relative to some font size and smaller 
compared to larger font size.
Ideally, the bullet size should be relative to text font size.
Proposed fix is to make sure the bullet size is relative to text font size.
I have used bullet size to be 1/3rd of text font size as
https://www.w3schools.com/html/html_lists.asp "An Unordered List" 
bullets size comparison to text looks similar
and I could not find any docs stating what should be the ideal bullet 
size relative to font.

Also, the fix takes into account the bullet is shown in middle to text 
lists, whereas previously, it is at the bottom (although we could not 
figure it out as the bullet size was large)

Bug: https://bugs.openjdk.java.net/browse/JDK-8202013
webrev: http://cr.openjdk.java.net/~psadhukhan/8202013/webrev.0/

This also fixes JDK-8201925: JEditorPane unordered list bullets look 
pixelated by using antialiasing to make the bullet shape smoother.

Regards
Prasanta



More information about the swing-dev mailing list