Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check if font is installed?
Message
From
22/04/2006 21:52:58
 
 
To
22/04/2006 19:47:04
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01115753
Message ID:
01115761
Views:
9
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
Previous
Reply
Map
View

Click here to load this message in the networking platform