Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add Font
Message
 
À
05/09/1997 09:51:23
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00048556
Message ID:
00048689
Vues:
28
>>>>>What does this code do?
>>>>>
>>>>>DECLARE INTEGER AddFontResource IN win32api STRING
>>>>>=AddFontResource("ARIALN.TTF")
>>>>>
>>>>>Thanks
>>>>>Elyse
>>>>
>>>>Basically it adds a font to the Windows font table. Once this is done it can be used by an application. In this case it's a True Type Font.
>>>>
>>>>George
>>>
>>>How come after I ran it I didn't see the font added to my Control Panel\Fonts list? (Although my apllication did seem to know about the font)
>>>
>>>Elyse
>>
>>Elyse,
>>
>>If you had the Fonts window open when you issued the function call, I'd guess that the reason it didn't show immediately afterwards is that the window hadn't been refreshed. When you select View/Refresh, the fonts list is reloaded. When you call the fonts list from within an application, it loads the list when you call the dialog.
>>
>>George
>
>Here's what I did:
> 1) I deleted my font from the Control Panel\Fonts
> 2) I checked to confirm that my application did not find the font. (It didn't)
> 3) I ran this code.
> 4) I checked to confirm that my apllication found the font (It did)
> 5) I checked the Windows\Control Panel\Fonts list - it wasn't there and refresh didn't help.
> 6) Today, when I turned on my computer (re-booted) my application could not find the font. After running this code again, my application once again found the font but it still never showed up in the Windows System directory or Control Panel\Fonts list.
>
>My question again: What does this code do? Is it only a temporary "installation"?
>
>Thanks
>Elyse

While it adds the font resource to the font table, it does not copy it to the WINDOWS\SYSTEM directory nor does it install it. You're correct about it being temporary, since it only exists in memory. Further, other applications may not recognize the newly loaded font resource unless they're informed of its existence via the SendMessage function. Lastly, any application adding a font resource, should remove it by calling RemoveFontResource.

George
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform