Implemented font listing under linux in a quite hacky way. The directory list returned by XGetFontPath is not really usable, there are some path with appended :unscaled for non-ttf fonts, so i needed to add some null-pointer check to for_each_file after the opendir to avoid a crash. I think most of my ttf fonts gets listed, but at a quick glance i find some duplicates and the list is not alphabetically sorted. That would be a great improvement (sort and remove duplicates).
Also renamed Mask to Mask_table because XLib.h already defines some var called Mask. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@337 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
1
files.c
1
files.c
@@ -688,6 +688,7 @@ void for_each_file(const char * Nom_repertoire, void Callback(const char *))
|
||||
int Position_nom_fichier;
|
||||
strcpy(Nom_fichier_complet, Nom_repertoire);
|
||||
Repertoire_Courant=opendir(Nom_repertoire);
|
||||
if(Repertoire_Courant == NULL) return; // Répertoire invalide ...
|
||||
strcat(Nom_fichier_complet, SEPARATEUR_CHEMIN);
|
||||
Position_nom_fichier = strlen(Nom_fichier_complet);
|
||||
while ((Enreg=readdir(Repertoire_Courant)))
|
||||
|
||||
Reference in New Issue
Block a user