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 🙂 .

About Tsukasa

The fool's herald.
This entry was posted in Blog and tagged , . Bookmark the permalink.

28 Responses to Temporarily register fonts using a normal User account

  1. David says:

    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. Tsukasa says:

    [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. LRdM says:

    [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. pahan says:

    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. Tsukasa says:

    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. Andy says:

    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. Pingback: How to Install fonts without Administrator rights… (works) | Cosmo Tablet...

  8. gudbarnone says:

    Yes Andy it’s possible with a batch file. EG

    pushd c:\temp\fonts; For %f in (*.*) do registerfont %f; popd

    Ensure registerfont is either in the folder or the path.

    This has been discussed at length at
    http://social.technet.microsoft.com/Forums/en-US/w7itprosecurity/thread/9a0938f5-9851-48bd-bbe8-8078647b6fd2/

    Hope this helps
    Chris

  9. dark ry says:

    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

  10. dcpurton says:

    For those wanting a non .NET version, I found a similar need this week, so wrote an implementation in C.

    Grab it from http://marshwiggle.net/regfont/

    Maybe someone else will find this useful.

    cheers

    dc

  11. Tsukasa says:

    Very cool dcpurton!
    Added a link to the post 🙂 .

  12. Chris says:

    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

  13. kurt says:

    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!

  14. Pingback: How to install fonts without admin right « Bridge to Nova

  15. Tai says:

    this link is dead 🙁 http://marshwiggle.net/regfont/

  16. Ben Malkevitch says:

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

  17. Tsukasa says:

    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.

  18. dcpurton says:

    Hi everyone,

    Sorry the marshwiggle.net link is not working. My server died and I haven’t had time to get it back online yet.

    Feel free to email me if you want a copy of regfont.

    My email address is dcpurton@marshwiggle.net

    David

  19. Mike says:

    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>

    • dcpurton says:

      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?

    • dcpurton says:

      I think this is fixed. Turns out the standard Windows shell does no wildcard expansion! (I only use Linux.)

      I’ve put a new version up that handles wildcards internally. Grab it from http://marshwiggle.net/regfont

  20. Odd Henriksen says:

    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.

  21. Eric says:

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

    Thank you and have a nice day

    • Tsukasa says:

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

      • Eric says:

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

      • Tsukasa says:

        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.