Creating A HTML Font List

With just a couple of lines of code, you can create a HTML document listing each installed type face on your computer which you then can print out for reference. Next time you want to create a fancy newsletter or party invitation, grab your font reference and pick a type face.

[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | Out-Null

# create HTML
$result = (New-Object System.Drawing.Text.InstalledFontCollection).Families |
ForEach-Object {$strHTML=''}{
$strHTML += "<font size='5' face='{0}'>{0}</font><br>" -f ($_.Name)
}{$strHTML}

# write HTML
Set-Content $home\FontList.htm $result

# open HTML
& "$home\FontList.htm"

Posted Jul 28 2009, 08:00 AM by ps1
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.