I have the following lines in my Java applet init function:
try {
this.font = Font.createFont(
Font.TRUETYPE_FONT,
new File("fonts/myfont.ttf")
).deriveFont(24f);
GraphicsEnvironment.getLocalGraphicsEnvironment().registerFont(font);
} catch(Exception ex){
System.out.println(ex);
}
When I open the applet with the appletviewer, the font is loaded as expected. But when I open the HTML page with any web browser, I get this error in the Java Console:
java.security.AccessControlException: access denied (java.io.FilePermission fonts/myfont.ttf read)
and the default font is loaded.
(How) can I fix that?