Skip to content

fontlaborg/fontlift-win-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fontlift-win-cli

fontlift-win-cli

Windows CLI for font install, uninstall, list, and cache cleanup. Written in C++17.

Made by FontLab https://www.fontlab.com/


How font installation works on Windows

Installing a font on Windows requires three steps:

  1. Copy the file into a Fonts directory the OS watches:

    • System scope (default when running as Administrator): C:\Windows\Fonts\ — visible to all users; requires Administrator privileges.
    • User scope (Windows 10 version 1809 and later): %LOCALAPPDATA%\Microsoft\Windows\Fonts\ — visible to the current user only; no admin needed.
  2. Write a registry entry so the font survives reboots:

    • System scope: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
    • User scope: same path under HKEY_CURRENT_USER
    • The value name follows the convention "Family Name (TrueType)" and the value data is the font file path. Without this entry the font disappears after the next reboot.
  3. Notify GDI via AddFontResourceW + WM_FONTCHANGE broadcast so running applications (Word, browsers, design tools) see the new font immediately without restarting.

Uninstalling reverses those steps. fontlift also broadcasts WM_FONTCHANGE after removal so running apps refresh their font lists.

Font names explained:

  • Internal name / PostScript name — the stable identifier applications use programmatically, e.g. Arial-BoldMT. This is what -n matches.
  • Family name — the group name shown in font menus, e.g. Arial.

Supported formats: .ttf (TrueType), .otf (OpenType), .ttc/.otc (collections with multiple faces per file). .woff/.woff2 are web-only and not supported as installed system fonts by GDI.


Installation

Download binary

  1. Download fontlift-win-v*.zip from Releases
  2. Extract and add the directory to your PATH

Build from source

git clone https://github.com/fontlaborg/fontlift-win-cli.git
cd fontlift-win-cli
build.cmd

Requires Visual Studio Build Tools with the Windows SDK (Advapi32, Shlwapi, User32, Gdi32).


Quick start

rem Install a font (user scope — no admin needed on Windows 10 1809+)
fontlift-win install myfont.ttf

rem Install system-wide (requires running as Administrator)
fontlift-win install myfont.ttf --admin

rem List all installed fonts (paths, sorted and deduped)
fontlift-win list

rem List PostScript/internal names
fontlift-win list -n

rem List both path and name
fontlift-win list -n -p

rem Uninstall (keep the file)
fontlift-win uninstall myfont.ttf
fontlift-win u -n "Font Name"

rem Remove (uninstall + delete the file)
fontlift-win remove myfont.ttf
fontlift-win rm -n "Font Name"

rem Clean up stale registrations and caches
fontlift-win cleanup
fontlift-win cleanup --admin     rem include system font caches (requires admin)

Commands

list (alias: l)

fontlift-win list        rem paths (default, sorted, duplicate paths removed)
fontlift-win list -n     rem internal/PostScript names
fontlift-win list -n -p  rem name and path, sorted
fontlift-win list -s     rem accepted for compatibility; output is always sorted

install (alias: i)

fontlift-win install myfont.ttf
fontlift-win i -p C:\Downloads\font.otf
fontlift-win i myfont.ttf --admin    rem force system scope (requires admin)
fontlift-win i myfont.ttf -a         rem same

Scope selection:

  • Running as Administrator with --admin: copies to C:\Windows\Fonts\ + writes HKLM registry entry.
  • Running without admin: copies to %LOCALAPPDATA%\Microsoft\Windows\Fonts\ + writes HKCU registry entry. (Windows 10 1809+ only.)
  • If a font with the same family name is already installed, it is removed first.

uninstall (alias: u)

fontlift-win uninstall myfont.ttf
fontlift-win u -n "Font Name"
fontlift-win u -n "Font Name" --admin   rem also search system registry

Removes the GDI registration and registry entry. The file stays on disk. Searches both user and system registries. Removes every matching entry the process has permission for. If a system-scope copy remains, rerun elevated with --admin.

remove (alias: rm)

fontlift-win remove myfont.ttf
fontlift-win rm -n "Font Name"
fontlift-win rm -n "Font Name" --admin

Unregisters the font and permanently deletes the file. There is no undo.

cleanup (alias: c)

fontlift-win cleanup              rem registry prune + user/app caches
fontlift-win cleanup --admin      rem also clear system font caches

Cleanup does two things:

  • Prune registry: removes entries pointing to font files that no longer exist. Cleans up both user and system registry keys (system requires admin).
  • Clear caches: deletes user-level font caches and Adobe AdobeFnt*.lst manifest files. With --admin, also stops the Windows Font Cache Service (FontCache), deletes its binary cache files and FNTCACHE.DAT, then restarts the service. This resolves rendering glitches after fonts are added or removed. A reboot may still be required for some applications.

Options reference

Flag Short Description
--admin -a Include system-scope operations (requires Administrator)
--path PATH -p PATH Specify font by file path
--name NAME -n NAME Specify font by internal/PostScript name
(sort flag) -s Sort output — accepted but output is always sorted

Exit codes

Code Meaning
0 Success
1 Error
2 Permission denied (need Administrator for system fonts)

Troubleshooting

Access denied for system fonts (exit code 2) Open Command Prompt as Administrator, then rerun the command. Per-user fonts (%LOCALAPPDATA%\Microsoft\Windows\Fonts\) never need elevation.

Font installed but not visible in apps Run fontlift-win cleanup to clear stale caches. Some applications (especially older Win32 apps) only reload fonts on restart.

Font already installed Uninstall the existing copy first: fontlift-win u -n "Exact Name". Run fontlift-win list -n to find the exact name.

Invalid font file Verify the format (.ttf, .otf, .ttc, .otc) and that the file is not corrupted. .woff and .woff2 are web-only formats and cannot be installed as system fonts.

Font cache corruption / rendering glitches Run fontlift-win cleanup --admin as Administrator to purge all font caches and broken registry entries. A reboot is recommended after system cache cleanup.


Technical details

  • C++17, Windows 7+
  • Dependencies: Windows SDK only (Advapi32, Shlwapi, User32, Gdi32)
  • Binary size: ~100 KB
  • Source: under 1000 lines

See DEPENDENCIES.md for details.


Building

build.cmd      rem build executable
publish.cmd    rem create distribution archive

License

Copyright 2025 by Fontlab Ltd. Licensed under Apache License 2.0 — see LICENSE

About

CLI tool for Windows to install/uninstall fonts

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors