Use PSADT to install a .fon format font

I need to push out to a bunch of computers a font that is in a .fon format. I've pushed out fonts using just powershell in the past but they were in .ttf but haven't done any in .fon. Anyone ever done that with PSADT or have any solutions. Everything I search for on the web reference .ttf or .otf.

I can't even get a copy and paste to work of moving the file into c:\windows\fonts because it says it's denied (doing it as a regular user or a admin account). Just looking to see if anyone could help point me in the right direction. Thanks

Font support is coming, however I don't know if it'll have the specifics to handle your particular format.

Yea, I'm working on that right now.
But I only have code to support TrueType and OpenType.
I'll look around for code to do .fon font.

1 Like

I cannot find PS code to install .Fon fonts.

When you manually copy the .Fon file to c:\Windows\Fonts\ as admin USING EXPLORER,
it should register it in HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Fonts.

If you point me to a valid .Fon font file, I should be able figure it out to add it in what I'm working on.

PS: I haven't seen .Fon fonts in decades.

Basically the font that we need to reinstall is sseriff.fon which is a default font from windows. This app we use which is installed from Intune via PSADT, now we are having users who since moving to windows 11 they are getting tiny font size inside the application and the vendor says to basically reinstall the sseriff.fon file. So my thought was to include a step in the PSADT package that once the install is done, to copy the sseriff.fon back over into the c:\windows\fonts folder and do whatever is needed to install it.

Just doing some testing in regular powershell (run as admin), I get a deny when trying to copy sseriff.fon from C:\temp\sseriff.fon to C:\Windows\fonts. If I do it as a non admin I get the same error. So I haven't tried to do it with psadt because of the errors I was getting trying in regular powershell.

And honestly I don't know if a simple copy and paste is all that is needed to "reinstall" this font or if something has to be done the fact.

Are you using Explorer or a PS/CMD command to copy the Font file?

in regular powershell with a copy-item

Copy-Item -Path "C:\temp\sserife.fon" -Destination "C:\Windows\Fonts" -Force

and I get a "Access to the path 'C:\Windows\Fonts\sserife.fon' is denied". If I drag and drop the file to the fonts folder, I get a file already exists do you want to replace and if I hit yes it does the replacement with no errors.

I also tried running that Powershell line as a regular user as well with the same error.

For the hell, can you delete the sserife.fon from the \fonts\ folder using Explorer?

If you can't, your permissions on the \Fonts\ folder are broken.

I have found a powershell script that installs all 3 types of fonts including .fon fonts

I have NOT tested this code but it makes me want to just use this instead for PSADT.

The Catches:

  • It uses A LOT of C# code which I'm no wiz at.
  • It's written by Microsoft

So @sean410, you can use this as it supports .fon fonts. You probably don't publish code so you have nothing to fear.

As for me, it's up to @mjr4077au Mitch if he's comfortable with using this code for PSADT.
If Mitch is not comfortable with using MS' code, I'll check-in my PowerShell Only code for issue #832

I don't get a error when deleting it but also it doesn't delete so I dunno lol

I'll look over that code on monday to see if that might work for what we are trying to do. Thanks

1 Like

Yea. I was looking to add support for .Fon fonts but they don't register the same way and the registry value name is not obtained the same way. It's as if it need to look inside the .Fon file to get the name, font sized and DPI (guessing that's what the (120) is on some of the fonts.

This MS script might be the only way to install .Fon files without a special installer.