Voilà mon problème : j'ai un fichier jar, contenant à la racine les images et le fichier indigojo.ttf
Dans ma classe principale, j'appelle la création de la nouvelle police comme suit :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
    public static void loadFonts()
    {
        try {
            policeEcriture25 = new Font(Font.createFont(Font.TRUETYPE_FONT,new FileInputStream(new File("indigojo.ttf"))).getFamily(),Font.BOLD,25);   
            policeEcriture35 = new Font(Font.createFont(Font.TRUETYPE_FONT,new FileInputStream(new File("indigojo.ttf"))).getFamily(),Font.BOLD,35);   
            policeEcriture50 = new Font(Font.createFont(Font.TRUETYPE_FONT,new FileInputStream(new File("indigojo.ttf"))).getFamily(),Font.BOLD,50);   
            policeEcriture75 = new Font(Font.createFont(Font.TRUETYPE_FONT,new FileInputStream(new File("indigojo.ttf"))).getFamily(),Font.BOLD,75);   
        }
        catch(Exception e){
            policeEcriture25 = new Font ("Serif", Font.BOLD, 25);
            policeEcriture35 = new Font ("Serif", Font.BOLD, 35);
            policeEcriture50 = new Font ("Serif", Font.BOLD, 50);
            policeEcriture75 = new Font ("Serif", Font.BOLD, 75);
        }
    }
code appelé par :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
    public static void main(String args[])
    {
	//chargement des Fonts
        loadFonts();
Si quelqu'un avait une idée du pourquoi ça ne marche que quand la font est copiée dans le répertoire FONT de windows...
Merci beaucoup d'avance !