Temporarily register fonts using a normal User account

As you may know Windows is quite stiff sometimes. You can’t add additional font directories like you’d do on Unix. Another stiffy problem is that Windows requires an elevated account for operations like installing/removing fonts from the system. That’s quite troublesome at times.

This is exactly when my little tool jumps in. With RegisterFont you can add a number of fonts to your font cache without using an elevated user account. The downside is that all the changes persist only ’till the next reboot; Windows will rebuild it’s cache and the changes will be lost.

Anyway, the archive contains a binary as well as the C# sourcecode to this small utility. Use it like that:

RegisterFont.exe add font1.ttf font2.ttf font3.ttf … font1000.ttf

Easy, huh? If you don’t want to add fonts but remove them, substitute the “add” parameter with “rem” and you’ll be set. I didn’t bother to link up to the MSDN entries explaining the API, this is just a quick and dirty tool I wrote because we were in need of a quick solution to a problem 🙂 .

Update 2010-08-27: dcpurton wrote a tool in C to accomplish the same goal but without the .net dependencies. Best of all: Sourcecode is also available 🙂 .

Published by

tsukasa

The fool's herald.

28 thoughts on “Temporarily register fonts using a normal User account”

  1. Hi

    After appending to Target line, I run the app but I get a “RegisterFont has encountered a problem and needs to close. We are sorry for the inconvenience” message.

    What can I do to stop this? Thanks

  2. [quote comment=””]Hi

    After appending to Target line, I run the app but I get a “RegisterFont has encountered a problem and needs to close. We are sorry for the inconvenience” message.

    What can I do to stop this? Thanks[/quote]
    It’d help me if you could post the exact command-line you used to launch the program 🙂 .

  3. [quote comment=””][quote comment=””]Hi

    After appending to Target line, I run the app but I get a “RegisterFont has encountered a problem and needs to close. We are sorry for the inconvenience” message.

    What can I do to stop this? Thanks[/quote]
    It’d help me if you could post the exact command-line you used to launch the program 🙂 .[/quote]

    I’m getting this as well. “X:\registerfont add Charlem0.otf”. Application Error is “The application failed to initialize properly (0xc0000135). Click on OK to terminate the application.

  4. this utility needs .net framework 2.0 isnt there anyway to install fonts without .net framework?
    if so pls tell me.
    anyway this is a nice work pal.
    I have a solution but its bit lengthy but it dont need anything but the font 🙂 if u r interested just drop me a mail.

  5. pahan, you can always use the API call in C++ directly, that’d allow you to to circumvent .net dependencies.

    The original purpose was to quickly register a font, so I’m still quite content with the way it works 🙂 .

  6. Hi

    Many thanks. Very useful – saved me from big problems as I am at home in the holidays with a work pc andd no handy tech support guy with admin rights.

    Just an idea – could this be made to add or rem all the fonts in a fonts directory? Maybe with wildcards eg somthing like:

    registerfont.exe add \fonts\*.otf \fonts\*.ttf

    Regards

    Andy

  7. could you compile a version of this that does not require the user to have .NET Framework 2.0 ? or include the DLL’s that it needs?

    i do not have administrator privileges at work and hence can’t run RegisterFont without getting the error: “The application failed to initialize properly (0xc0000135). Click on OK to terminate the application.”

    if i did have administrator privileges i would be able to install .NET Framework 2.0 but in that case i would just be able to install the fonts i need, and wouldn’t need this fix

    this application should be usable by the target audience, namely users without administrative privileges or any other special software that doesn’t come with windows out of the box

  8. Great work guys :):)
    A fine example of collaborative development!
    I have been looking for this solution for a while. See my posts on http://social.technet.microsoft.com/Forums “UAC stops standard users from installing fonts”
    I will be updating this now to direct people to both your sites.
    Chris

  9. download regfont.exe from http://marshwiggle.net/regfont/

    copy fonts to folder: C:\Temp\fonts\
    copy regfont.exe to C:\Temp\fonts\
    copy shortcut of regfont.exe C:\Temp\fonts\

    in properies of shortcut in target field paste:
    C:\Temp\fonts\regfont.exe -a C:\Temp\fonts\*.ttf

    of course you can chance folders names ect. and .ttf maybe even *.* (every file) will be ok

    cheers and thx for help!

  10. 4 years later, still works like a charm. Stupid Windows, smart Tsukasa. Thanks! Ben

  11. Tai: If you’re in a corporate environment and use Windows 7 you can run my .net-based version without having to install any prerequisites. It’s a shame dcpurton’s site is down, though.

    Ben: Thanks, Microsoft should really fix that sort of thing – there’s virtually no reason why we can’t have a per-user font directory in a profile – even in a synchronized or roaming profile.

  12. Hi

    i am very sorry , but my windows xp give some error:

    Error adding …

    ———————-cut—————-
    Verzeichnis von C:\temp\fonts

    28.06.2012 14:50 .
    28.06.2012 14:50 ..
    20.10.2004 20:07 53.960 #44v2.ttf
    20.10.2004 20:06 53.548 #44v2c.ttf
    20.10.2004 20:06 55.524 #44v2e.ttf
    20.10.2004 20:06 57.144 #44v2i.ttf
    20.10.2004 20:07 116.540 #44v2s.ttf
    08.11.2001 22:32 678 Cocon-BoldExp.pfm
    08.11.2001 22:32 32.522 Cocon-Light.pfb
    08.11.2001 22:32 682 Cocon-Light.pfm
    10.11.2001 13:57 0 Cocon-LightCondensed.pfb
    08.11.2001 22:32 700 Cocon-LightCondensed.pfm
    08.11.2001 22:32 19.557 Cocon-LightConExp.pfb
    08.11.2001 22:32 694 Cocon-LightConExp.pfm
    08.11.2001 22:32 19.648 Cocon-LightExp.pfb
    08.11.2001 22:32 688 Cocon-LightExp.pfm
    08.11.2001 22:32 32.783 Cocon-Regular.pfb
    08.11.2001 22:32 678 Cocon-Regular.pfm
    08.11.2001 22:32 32.600 Cocon-RegularCondensed.pfb
    08.11.2001 22:32 19.082 Cocon-RegularConExp.pfb
    08.11.2001 22:32 684 Cocon-RegularConExp.pfm
    08.11.2001 22:32 19.122 Cocon-RegularExp.pfb
    08.11.2001 22:32 681 Cocon-RegularExp.pfm
    16.06.2012 16:03 16.384 regfont.exe
    28.06.2012 14:48 573 regfont.exe.lnk
    23 Datei(en) 534.472 Bytes
    2 Verzeichnis(se), 80.175.673.344 Bytes frei

    C:\temp\fonts>regfont.exe -a #44v2.ttf
    Successfully added font #44v2.ttf.

    C:\temp\fonts>regfont.exe -a *.ttf
    Error adding *.ttf.

    C:\temp\fonts>regfont.exe -a “*.ttf”
    Error adding *.ttf.

    C:\temp\fonts>regfont.exe -a “*.PFM | *.PFB”
    Error adding *.PFM | *.PFB.

    C:\temp\fonts>regfont.exe -a “Cocon-Light.PFM | Cocon-Light.PFB”
    Error adding Cocon-Light.PFM | Cocon-Light.PFB.

    C:\temp\fonts>regfont -a “Cocon-Light.PFM | Cocon-Light.PFB”
    Error adding Cocon-Light.PFM | Cocon-Light.PFB.

    C:\temp\fonts>regfont -a Cocon-Light.PFM
    Error adding Cocon-Light.PFM.

    C:\temp\fonts>regfont -a Cocon-Light.pfb
    Error adding Cocon-Light.pfb.

    C:\temp\fonts>regfont -a Cocon-Light.pfm
    Error adding Cocon-Light.pfm.

    C:\temp\fonts>

    1. I’m not sure if this is still the case but Mac PS fonts didn’t used to be compatible with Win PS fonts. Maybe the PS fonts are failing for this reason? You could email a couple of the fonts to me and I’ll have a look if you like (dcpurton@marshwiggle.net).

      I’m not sure why your ttf fonts are failing. It almost looks like the shell is not expanding the *.ttf (I wouldn’t expect “*.ttf” with quotes to work – this will pass *.ttf as the file name which of course doesn’t exist.) Do they all work if you add them individually?

  13. Greetings,

    I made some slight modifications to the application, most notably I added the SendNotifyMessage API function, and I run it after every “add”/”rem” action to notify all running processes about the font change (it’s a “WM_FONTCHANGE” message sent to “HWND_BROADCAST”).

    In the spirit of open source, I just wanted to inform you. Let me know if you’re interested in the updated files.

  14. Hi, which fonts extensions are supported by the regfont-20130320 version?

    Thank you and have a nice day

    1. TrueType, TrueType Collections, PostScript Type 1 and OpenType – simply put: All formats Windows can handle out of the box.

      1. OK Thanks!
        Just in case, do you have a solution for Adobe fonts?

      2. Unfortunately my only intel on this topic is that Adobe usually ships in OpenType, so in theory there should be no problem.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.