This simple program loads or removes any FONT from a specified path & file name (Loaded font doesn'
This simple program loads or removes any FONT from a specified path & file name (Loaded font doesn't listed in the FONTS directory of Windows)
API Declarations
Private Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFileName As String) As Long
Rate This simple program loads or removes any FONT from a specified path & file name (Loaded font doesn'
(1(1 Vote))
'FntFileName is my font's name and path
Public Function LoadFont(FntFileName As String) As Boolean
Dim FntRC As Long
FntRC = AddFontResource(FntFileName)
If FntRC = 0 Then 'no success
LoadFont = False
Else 'success: font loaded!
LoadFont = True
End If
End Function
Public Function RemoveFont(FntFileName As String) As Boolean
Dim RC As Long
Do
RC = RemoveFontResource(FntFileName)
Loop Until RC=0
'if rc=0 then font removed or invalid file name
End Function
This simple program loads or removes any FONT from a specified path & file name (Loaded font doesn' Comments
No comments yet — be the first to post one!
Post a Comment