Use PowerShell to Print Installed Font Family Names

Bruce Wen
2 min readFeb 19, 2024

The script makes life easier.

Photo by Arnold Francisca on Unsplash

As a developer, I often install new fonts and configure the font family name in the IDE.

Some fonts’ family names are not directly visible and cause some trouble. (see this post on Reddit)

On windows, it’s easy to get all installed fonts’ family names.

Here is the code:

function Get-Fonts {
param (
$regex
)
$AllFonts = (New-Object System.Drawing.Text.InstalledFontCollection).Families.Name
if ($null -ne $regex) {
$FilteredFonts = $($AllFonts | Select-String -Pattern ".*${regex}.*")
return $FilteredFonts
}
return $AllFonts
}

The examples:

> Get-Fonts | Select-Object -First 10
Agency FB
Algerian
all-the-icons
Arial
Arial Black
Arial Narrow
Arial Rounded MT Bold
AverageMono
Bahnschrift
Bahnschrift Condensed

To use regex:

> Get-Fonts -regex "Nerd"
BlexMono Nerd Font
BlexMono Nerd Font Mono
Cousine Nerd Font
Cousine Nerd Font Mono
DroidSansMono Nerd Font
DroidSansMono Nerd Font Mono
GoMono Nerd Font
GoMono Nerd Font Mono
Hack Nerd Font
Hack Nerd Font Mono
ProFontIIx Nerd Font
ProFontIIx Nerd Font Mono
ProFontWindows Nerd Font
ProFontWindows Nerd Font Mono
Ubuntu Nerd Font
Ubuntu Nerd Font Mono
UbuntuCondensed Nerd Font
UbuntuCondensed Nerd Font Mono

📓 To use the font families whose names contain spaces, it’s usually required to quote the font family name in the configuration.

--

--