Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8185538

JDK 9 is really slow initialising some OTF/CFF fonts.

    XMLWordPrintable

    Details

    • Subcomponent:
      2d
    • Resolved In Build:
      b29

      Backports

        Description

        Download any Noto CJK Font and run this program against it
        import java.io.File;
        import java.awt.Font;
        import java.awt.font.FontRenderContext;

        public class SlowFontInit {

            public static void main(String[] args) throws Exception {
                String name = "NotoSansCJKjp-Regular.otf";
                if (args.length > 0) {
                    name = args[0];
                }
                Font f = Font.createFont(Font.TRUETYPE_FONT, new File(name));
                FontRenderContext frc = new FontRenderContext(null, false, false);
                long t0 = System.currentTimeMillis();
                f.getStringBounds(" ", frc);
                long t1 = System.currentTimeMillis();
                System.out.println((t1-t0)+"ms. "+ f.getFontName());
            }
        }
        $ java SlowFontInit
        1802ms. Noto Sans CJK JP Regular

        Almost 2 seconds ..

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                pnarayanan Prahalad Kumar Narayanan (Inactive)
                Reporter:
                prr Philip Race
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: