Font.createFont(Font.TRUETYPE_FONT, new URL("file:
Font.createFont(Font.TRUETYPE_FONT, fontFile.toURL().openStream()));
            public void run() {                try {                    html.getRenderingContext().setFontMapping("Ahem",                            Font.createFont(Font.TRUETYPE_FONT, new URL("file://" + directory + "/support/AHEM____.TTF").openStream()));                } catch (FontFormatException e) {                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.                } catch (IOException e) {                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.                }            }