Skip to content

Fix user mode fonts to install & add repair support - #6619

Draft
David Bennett (dkbennett) wants to merge 1 commit into
microsoft:masterfrom
dkbennett:user/dkbennett/userfonts
Draft

David Bennett (dkbennett) wants to merge 1 commit into
microsoft:masterfrom
dkbennett:user/dkbennett/userfonts

Conversation

@dkbennett

@dkbennett David Bennett (dkbennett) commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

📖 Description

Align user-scope font installation with the machine-scope model to address fonts missing from Windows discovery after sign-out or restart.

  • Install user fonts directly into %LOCALAPPDATA%\Microsoft\Windows\Fonts and register their absolute paths under HKCU\Software\Microsoft\Windows NT\CurrentVersion\Fonts.
  • Track original filenames separately from collision-renamed installed files using the same package inventory mapping strategy for both scopes.
  • Add font repair using installed package metadata. Repair migrates existing nested user installations to the flat layout and restores discovery registrations without downloading fonts.
  • Update validation, inventory, and uninstall to handle both layouts. Remove only mapped files and matching registrations, preserving unrelated files and the shared Fonts directory.

Machine-scope discovery registrations retain their relative filename values. Migration rollback is per-file and best effort.

🔗 References

Addresses #6535.

🔍 Validation

Automated coverage checks exact inventory filenames, flat installation paths, REG_SZ discovery values, scope isolation, filename collisions, repair migration, failure handling, and uninstall cleanup.

AppInstallerCLITests.exe '[fonts],[FontHelper],[RepairFlow]'
Passed: 334 assertions in 29 test cases.
wingetdev font list --details --disable-interactivity: passed against the locally deployed dev build with fonts enabled.

✅ Checklist

🤖 AI Assistance

  • AI assistance was used and has been disclosed in this PR
  • No AI assistance was used

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

@github-actions

Copy link
Copy Markdown

check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

Unrecognized words (1)

fontlayout

These words are not needed and should be removed AAD ABCD abi ACL'd AMap Amd appdata ARMNT asan Baz bitmask bluetooth boundparms brk Buf certs cgi CMSG codepage commandline constexpr Cov cswinrt CTL Dbg Dcom decompressor dedupe DEFT devhome Dns dsc EOP ERANGE errcode errmsg errstr filemode Finalizers FULLWIDTH fuzzer GES github Hackathon HINSTANCE hlocal hmac Hyperlink ICONDIR icu idx img inet Intelli iwr JDK LCID lhs LONGLONG LPBYTE LPCWSTR LPDWORD LPSTR LPVOID LPWSTR MAJORVERSION MAXLENGTH maxvalue MDs MINORVERSION mta nlohmann NONAME NOUPDATE NTFS nullability ofile oid oop OPTOUT outfile OUTOFMEMORY PARAMETERMAP pdb PDWORD pid PKCS pkgs pkix placeholders positionals posix pscustomobject pseudocode PSHOST publickey qword redirector regexes remoting reparse REQS rhs rowid RTTI runspace runtimes SARL savepoint Scm sid sqlite subdir subkey trimstart ttl typedef uninitialize uninstallation UNMARSHALING userprofile versioned virtuals Webserver website wildcards winreg WMI workaround Wpp wsl

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:dkbennett/winget-cli.git repository
on the user/dkbennett/userfonts branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/microsoft/winget-cli/actions/runs/40033113636/attempts/1' &&
git commit -m 'Update check-spelling metadata'

Pattern suggestions ✂️ (2)

You could add these patterns to .github/actions/spelling/patterns.txt:

# Automatically suggested patterns

# hit-count: 1 file-count: 1
# assign regex
= /[^*].*?(?:[a-z]{3,}|[A-Z]{3,}|[A-Z][a-z]{2,}).*/[gi]?(?=\W|$)

# hit-count: 1 file-count: 1
# regex choice
\(\?:[^)]+\|[^)]+\)

Alternatively, if a pattern suggestion doesn't make sense for this project, add a # to the beginning of the line in the candidates file with the pattern to stop suggesting it.

Notices ℹ️ (1)

See the 📂 files view, the 📜action log, or 📝 job summary for details.

ℹ️ Notices Count
ℹ️ candidate-pattern 2

See ℹ️ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant