Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check if font is installed?
Message
De
22/04/2006 21:52:58
 
 
À
22/04/2006 19:47:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01115753
Message ID:
01115761
Vues:
8
Is there another way to check is a font is installed other than checking if file exists in font directory?
Like Hilmar said, AFONT() works a treat. My public application object has a property called "MonoFont" that is assigned once up-front in the initialisation process with the following code:
private x
if afont(x)
    THIS.MonoFont = "Consolas"
    if ascan(x,"Consolas") = 0
        THIS.MonoFont = "Lucida Console"
        if ascan(x,"Lucida Console") = 0
            THIS.MonoFont = "Courier New"
        endif
    endif
else
    THIS.MonoFont = "Courier New"
endif
When I have controls that need to be fixed-width, I just set their .FontName = goApp.MonoFont.

- Colin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform