FontRegister is both a command-line tool and a csharp native library (pure code) for installing and uninstalling fonts on Windows.
- Ability to install fonts in bulk.
- Notify Windows OS about new fonts refreshing the font-lists on other apps immediately (photoshop, word and so on).
- Written in pure C# and Pinvoke.
- Code install/uninstall API via Nuget supporting .NET 4.8 and .NET 6.0.
ttf
otf
fon
ttc
# Will print help
fontregister
# Register fonts in the following folders or specific files:
# Note: Folders are deep-searched recursively.
fontregister install "c:/folder" "c:/font.ttf" "./relativedir/" "./relativedir/font.otf"
Here's the output of the help command:
Usage: FontManager <command> [paths...]
Commands:
install <path1> [path2] [path3] ... : Install fonts from specified files or directories
uninstall <fontName1> [fontName2] [fontName3] ... : Uninstall specified fonts
PM> Install-Package FontRegister
//single file
var notifier = new WindowsFontInstaller(new WindowsSystemNotifier()); //pass null to not notify other apps
notifier.InstallFont("C:/myfonts/myfont.ttf");
//in bulk
var fontManager = new FontManager(notifier);
fontManager.InstallFonts(new string[] { "C:/myfonts", "C:/myfonts2/myfont.ttf" });
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- FontReg for the underlying functionality.
- All contributors and users for their support.