install windows fonts
-
-
Does anyone know any API to install fonts to windows folder? On XP I used to just copy those to windows/fonts folder, but it does not work on vista. There is windows API AddFontResource, but it only installs font until user reboots computer. Thanks.
You can add fonts to your setup & deployment project and then register it as font..
.: I love it when a plan comes together :. http://www.zonderpunt.nl
-
Does anyone know any API to install fonts to windows folder? On XP I used to just copy those to windows/fonts folder, but it does not work on vista. There is windows API AddFontResource, but it only installs font until user reboots computer. Thanks.
I did not need to register the new font. I copied the new font file into the directory during the install. XP and Vista found it and listed it in the font selection dialog with no problems. :confused: did not know that i had to register the font in anyway
-
You can add fonts to your setup & deployment project and then register it as font..
.: I love it when a plan comes together :. http://www.zonderpunt.nl
-
Does anyone know any API to install fonts to windows folder? On XP I used to just copy those to windows/fonts folder, but it does not work on vista. There is windows API AddFontResource, but it only installs font until user reboots computer. Thanks.
I think i have the same problem. I want to copy the a font file by using my program, but the only thing i managed until now is to register the font file vie AddFontResoucre so openoffice can use it until my pc reboots. I tried to get write permissions by using FileIoPermission for the font-Directory but when my program actually copies the file to the directory it says i dont have the permission to do so. My code looks like this:
FileIOPermission f2 = new FileIOPermission(FileIOPermissionAccess.Write, "C:\\Windows\\Fonts\\");
f2.AddPathList(FileIOPermissionAccess.Read, fontPath);
try
{
f2.Demand();
System.IO.File.Copy(fontPath, destination);
}
catch (SecurityException se)
{
MessageBox.Show(se.ToString());
}
catch (UnauthorizedAccessException ex)
{
MessageBox.Show(ex.ToString());
}