Any way to get custom fonts to work with a web applet?


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | font = new Font( "q" , 0 , 0 ); String path = Glo. class .getProtectionDomain().getCodeSource().getLocation().getPath(); InputStream is = Glo. class .getResourceAsStream( "resources/Vdj.ttf" ); Font uniFont = null ; try { //font = Font.createFont(0,new File(+"resources\\Vdj.ttf"));// "File" does not work with .jars uniFont=Font.createFont(Font.TRUETYPE_FONT,is); } catch (java.awt.FontFormatException r){ System.err.println( "FontFormatException: " + r.getMessage()); } catch (java.io.IOException r){ System.err.println( "FontFormatException: " + r.getMessage()); } font = uniFont.deriveFont(24f); |