Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding Fonts
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00084474
Message ID:
00084503
Vues:
30
>>>Can anyone enlighten me on a Win32 call to register fonts in Win95/NT?
>>>
>>>Thanks
>>>
>>>Wayne
>>
>>Just to expand a bit on what Ed told you, AddFontResource does not install the font. It simply allows the application calling the function to use it. Further, if a call to SendMessage is not made, no other application will have access to it. The function returns the number of fonts loaded. It is not limited to True Type Fonts (TTF files, which are raw), but can also be used to load a .FON font resource file, a .FNT raw bitmap font file, or a .FOT TrueType resource file.
>>
>>hth,
>
>Well, is there a call to actually install the font? I am attempting to install fonts that a user's machine may or may not have.
>
>I previously tried Edward's suggestion, and did not see any results of the call.
>***AddFontResource, RemoveFontResource
> DECLARE INTEGER AddFontResource IN win32api STRING
> =AddFontResource("some.ttf")
>
>
>Am I missing something here?
>
>Wayne

There's no single function call to add a font, but rather a series of steps involving the registry. Since this question has come up before, I'm going to try to see if I can create something that will do this.

GETFONT() should show the new font on the list, provided, of course, it the call succeeded. Naturally, "some.ttf" needs to be replaced with the fully qualified filename of the actual font. If the value returned by AddFontResource was zero, however, an error occurred. In which case you need a call to GetLastError (DECLARE INTEGER GetLastError IN Win32API), in order to retrieve the error number. Without that information, it's hard to say what the problem might have been.

hth,
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