1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
File fonte = null;
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try
{
// String police = //+ this.config.chemRepDonnees()// + File.separatorChar + "ec.TTF";
String police = "donnees" + File.separatorChar + "ec.TTF";
System.out.println("*********************Fonte : " + police);
File f = new File(police);
System.out.println(f.exists());
fonte = new File(police);
ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, fonte));
}
catch (IOException|FontFormatException e)
{
System.out.println("Erreur");
System.out.println(e.getMessage()) ;
throw new RuntimeException ("Erreur lors du chargement de la fonte.", e) ;
} |