Install a font programatically
Install a font programatically
Has anyone come up w/ a routine to install a font programatically ?
in order to do it w/o user intervention, i guess you'd also need to know the default location of fonts.
is there an environmental var that stores the location of fonts for the version of windows you are on ?
i'm looking at marlett, which should be in the fonts on disk, it just may not be installed.
in order to do it w/o user intervention, i guess you'd also need to know the default location of fonts.
is there an environmental var that stores the location of fonts for the version of windows you are on ?
i'm looking at marlett, which should be in the fonts on disk, it just may not be installed.
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: Install a font programatically
hm ... you need Administrator Rights to install.bwolfsohn wrote:Has anyone come up w/ a routine to install a font programatically ?
greetings by OHR
Jimmy
Jimmy
Re: Install a font programatically
ok..Auge_Ohr wrote:hm ... you need Administrator Rights to install.bwolfsohn wrote:Has anyone come up w/ a routine to install a font programatically ?
other than that, the same question still applies..
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: Install a font programatically
This is how I do it in a customer's application:
Code: Select all
DllCall("GDI32.DLL", DLL_STDCALL, "AddFontResourceA", DC_Path(AppName(.t.))+'ZapfDingbats.ttf' )
DllCall("GDI32.DLL", DLL_STDCALL, "AddFontResourceA", DC_Path(AppName(.t.))+'IDAutomationHC39M_FREE.otf' )
DllCall("GDI32.DLL", DLL_STDCALL, "AddFontResourceA", DC_Path(AppName(.t.))+'FRE3OF9X.TTF' )
DllCall("GDI32.DLL", DLL_STDCALL, "AddFontResourceA", DC_Path(AppName(.t.))+'Symbol.ttf' )
DllCall("GDI32.DLL", DLL_STDCALL, "AddFontResourceA", DC_Path(AppName(.t.))+'Consola.ttf' )
The eXpress train is coming - and it has more cars.
Re: Install a font programatically
normally this is always c:\windows\fontsis there an environmental var that stores the location of fonts for the version of windows you are on ?
no need to install the font, just copy the ttf to c:\windows\fonts
the font is automatic installed.
Klaus
Re: Install a font programatically
tried copying. in windows 7, the font did not automatically install.Koverhage wrote:normally this is always c:\windows\fontsis there an environmental var that stores the location of fonts for the version of windows you are on ?
no need to install the font, just copy the ttf to c:\windows\fonts
the font is automatic installed.
when i typed the name of the font in a dos box, and clicked install, it said this font is already installed want to overwrite,
answered yes, and it worked.
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: Install a font programatically
Brian -
Why don't you use the AddFontResourceA API call?
Why don't you use the AddFontResourceA API call?
The eXpress train is coming - and it has more cars.
Re: Install a font programatically
I plan on using it.. i just wanted to respond that the other method didn't work.,..rdonnay wrote:Brian -
Why don't you use the AddFontResourceA API call?
do you do any testing to see if that font is installed already ?
if so, how ?
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: Install a font programatically
You don't need to test.
That's done by the API function.
Those 5 lines of code are called every time the app starts.
It's been working fine for over 2 years with 350 work stations.
That's done by the API function.
Those 5 lines of code are called every time the app starts.
It's been working fine for over 2 years with 350 work stations.
The eXpress train is coming - and it has more cars.
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: Install a font programatically
Simply copying to the font folder worked with WinXP. Not entirely with Win7. I found you had to access the fonts via an office program to make certain they were recognized. But the other methods do work.
I also do the font install and select the folder with the new fonts and that works also.
I also do the font install and select the folder with the new fonts and that works also.