How to register Font Files

Issues related to Enigma Virtual Box
Post Reply
YogiYang
Posts: 18
Joined: Sun Oct 10, 2010 9:22 am

How to register Font Files

Post by YogiYang » Mon Aug 15, 2011 11:33 am

I have a software in which I bundle my own fonts that are not available otherwise in the system.

Now how can I get Enigma VB to register these fonts in the system?

Enigma
Site Admin
Posts: 2516
Joined: Wed Aug 20, 2008 2:24 pm

Re: How to register Font Files

Post by Enigma » Mon Aug 15, 2011 1:10 pm

This really have no ideas... Can you send me your test files, just to reproduce the problem when font files are not working?

YogiYang, please send us NON packed files.

YogiYang
Posts: 18
Joined: Sun Oct 10, 2010 9:22 am

Re: How to register Font Files

Post by YogiYang » Mon Aug 15, 2011 1:13 pm

Enigma wrote:YogiYang, please send us NON packed files.
Sorry I have send a packed file long before you replied to this post. The non packed files about around 17MB in size so it would be impractical to send you all those files.

But yet if you insist I will send all the files along with the main executable.

Enigma
Site Admin
Posts: 2516
Joined: Wed Aug 20, 2008 2:24 pm

Re: How to register Font Files

Post by Enigma » Mon Aug 15, 2011 1:34 pm

Just compress these files... not possible?

No problem, please send 17 MB... if only gmail won't send such email.... :?:

YogiYang
Posts: 18
Joined: Sun Oct 10, 2010 9:22 am

Re: How to register Font Files

Post by YogiYang » Mon Aug 15, 2011 1:36 pm

Gmail will not allow to send files greater and 10MB so I will have to upload it to some file server and send you the link.

Enigma
Site Admin
Posts: 2516
Joined: Wed Aug 20, 2008 2:24 pm

Re: How to register Font Files

Post by Enigma » Mon Aug 15, 2011 1:42 pm

YogiYang wrote:Gmail will not allow to send files greater and 10MB so I will have to upload it to some file server and send you the link.
Just divide files on a two emails, no problem :)

judge42
Posts: 2
Joined: Wed Apr 10, 2013 6:35 pm

Re: How to register Font Files

Post by judge42 » Mon May 06, 2013 3:44 pm

Hello, do you have a solution to register font files ?
thanks

Enigma
Site Admin
Posts: 2516
Joined: Wed Aug 20, 2008 2:24 pm

Re: How to register Font Files

Post by Enigma » Mon May 06, 2013 4:12 pm

I'm not sure it is possible at all. If font files are being used by another applications too, which are not packed, then EVB can't help there.

EVB does it's magic only under process of packed executable, or all other processes that it executes. It can't affect all processes or entire system.

YogiYang
Posts: 18
Joined: Sun Oct 10, 2010 9:22 am

Re: How to register Font Files

Post by YogiYang » Tue May 07, 2013 5:47 am

In case of fonts what you can do is remove (uninstall) old fonts and then install new fonts.

I have been doing this for quite some time now in my VB6 based software.

Here is the sample code

Code: Select all

Sub Install_TTF (FontName$, FontFileName$, WindSysDir$)
    Dim Ret%, Res&, FontPath$, FontRes$
    Const WM_FONTCHANGE = &H1D
    Const HWND_BROADCAST = &HFFFF

    FontPath$ = WindSysDir$ + "\" + FontFileName$
    FontRes$ = Left$(FontPath$, Len(FontPath$) - 3) + "FOT"

    Ret% = CreateScalableFontResource(0, FontRes$, FontFileName$, WindSysDir$)
    Ret% = AddFontResource(FontRes$)
'    Res& = SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0)
'    Ret% = WriteProfileString("fonts", FontName + " (TrueType)", FontRes$)
End Sub

' This sub will remove any True Type fonts installed
'
Sub Remove_TTF (FontName$, FontFileName$, WindSysDir$)
    
    Dim Ret%, Res&, FontPath$, FontRes$
    Const WM_FONTCHANGE = &H1D
    Const HWND_BROADCAST = &HFFFF

    FontPath$ = WindSysDir$ + "\" + FontFileName$
    FontRes$ = Left$(FontPath$, Len(FontPath$) - 3) + "FOT"

    'Ret% = CreateScalableFontResource(0, FontRes$, FontFileName$, WindSysDir$)
    Ret% = RemoveFontResource(FontRes$)
    Res& = SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0)
'    Ret% = WriteProfileString("fonts", FontName + " (TrueType)", FontRes$)

End Sub
Just my 2cents. :)

judge42
Posts: 2
Joined: Wed Apr 10, 2013 6:35 pm

Re: How to register Font Files

Post by judge42 » Tue May 07, 2013 11:34 am

Thanks YogiYang,
I 'll try this

Post Reply