Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Install font with API
Message
De
11/03/1998 08:33:34
 
 
À
10/03/1998 13:30:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00083698
Message ID:
00083838
Vues:
24
>>Can anyone please show me some VFP5 code to install the foxfont.fon font programmatically using the API.
>>
>
>DECLARE INTEGER AddFontResource IN win32api STRING
>LOCAL lc_font, ln_Return
>*&& you will also have to include the path on foxfont.fon
>lc_font = 'foxfont.fon' + CHR(0)
>ln_return = AddFontResource(@lc_font)
>IF ln_return = -1
> =MESSAGEBOX('Font No Installed')
>ENDIF
>
>I think this is how it works, but I never tested it.
>
>Charles


Thanks Charles, this worked well.

I was also hoping that someone might also have the code to tell the registry to keep the font after the machine has been restarted. For now, I can live with running this code if the FOXFONT isn't already installed.

By the way, does anyone know of a good way to test if a font has been installed?
I am currently using the following clumsy code which works, but maybe there is a better way:

lFontinst = FONTMETRIC(7,"foxfont",0) = 7

Thanks,
__________________________________________________
Mesa Vista Software (david@mesa-vista.com)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform