A powerful PowerShell script that automatically renames and organizes font files with a standardized naming convention: Family (Subfamily) (vVersion).ext
- Smart Font Analysis: Automatically extracts font family, subfamily, and version information
- Standardized Naming: Converts fonts to
Family (Subfamily) (vVersion).ext
format - Automatic Organization: Moves processed fonts to a separate folder, leaving only problematic fonts in the original directory
- Comprehensive Logging: Creates detailed log files with timestamps for all operations
- Simulation Mode: Test changes before applying them with
-WhatIf
parameter - Multiple Format Support: Works with TTF, OTF, WOFF, and WOFF2 files
- Intelligent Subfamily Detection: Recognizes Bold, Italic, Light, Medium, Thin, Black, and combinations
- Version Extraction: Attempts to extract actual version information from font files and filenames
- Windows PowerShell 5.1 or later
- .NET Framework (included with PowerShell)
- Windows operating system
- Download the
FontRenamer.ps1
script - Place it in your fonts directory or any preferred location
- Open PowerShell in that directory
- Load the script functions:
. .\FontRenamer.ps1
# Load the script
. .\FontRenamer.ps1
# Show help information
Show-Help
# Test run (simulation mode - no actual changes)
Rename-Fonts -WhatIf
# Process fonts in current directory
Rename-Fonts
# Process fonts in specific directory
Rename-Fonts -Path "C:\MyFonts"
Processing fonts in: C:\Fonts
Processing: Arial-Bold.ttf
Detected: Family='Arial', Subfamily='Bold', Version='1.0'
SUCCESS: Renamed and moved to: C:\Fonts\Processed_Fonts\Arial (Bold) (v1.0).ttf
Processing: Roboto-LightItalic-v2.1.otf
Detected: Family='Roboto', Subfamily='Light Italic', Version='2.1'
SUCCESS: Renamed and moved to: C:\Fonts\Processed_Fonts\Roboto (Light Italic) (v2.1).otf
=== SUMMARY ===
Total fonts found: 15
Renamed and moved: 8
Moved unchanged: 5
Errors (remained in original folder): 2
All processed fonts moved to: C:\Fonts\Processed_Fonts
Only fonts with errors remain in: C:\Fonts
Log file saved: C:\Fonts\FontRenamer_Log_2025-08-24_14-30-25.txt
Your_Fonts_Directory/
├── Processed_Fonts/ # Successfully processed fonts
│ ├── Arial (Bold) (v1.0).ttf
│ ├── Roboto (Light Italic) (v2.1).otf
│ ├── OpenSans (Regular) (v1.0).woff
│ └── ...
├── ProblemFont1.ttf # Fonts with extraction errors
├── CorruptFont2.otf # Fonts that couldn't be processed
└── FontRenamer_Log_2025-08-24_14-30-25.txt # Detailed operation log
Before | After |
---|---|
Arial-Bold.ttf |
Arial (Bold) (v1.0).ttf |
Roboto-LightItalic.otf |
Roboto (Light Italic) (v1.0).otf |
OpenSans-Regular-v2.1.woff |
OpenSans (Regular) (v2.1).woff |
Montserrat-ExtraBoldItalic.woff2 |
Montserrat (ExtraBold Italic) (v1.0).woff2 |
- .ttf - TrueType Font
- .otf - OpenType Font
- .woff - Web Open Font Format
- .woff2 - Web Open Font Format 2.0
The script intelligently detects various font styles:
- Weight: Thin, Light, Regular, Medium, SemiBold, Bold, ExtraBold, Black
- Style: Italic, Normal
- Combinations: Bold Italic, Light Italic, Medium Italic, etc.
The script attempts to extract version information from:
- Font metadata - Internal font version strings
- Filename patterns - Version numbers in filenames (
v2.1
,Version1.5
) - Fallback - Defaults to
v1.0
if no version found
- Simulation Mode: Always test with
-WhatIf
before making changes - Comprehensive Logging: Every operation is logged with timestamps
- Error Handling: Gracefully handles corrupt or problematic fonts
- File Conflict Prevention: Checks for existing files before renaming
- Original File Preservation: Problematic fonts remain untouched
Each run generates a detailed log file with:
- Timestamp and execution mode
- Font analysis results (Family, Subfamily, Version)
- Success/failure status for each operation
- Final summary with statistics
- Full path information for moved files
Rename-Fonts -Path "D:\FontCollection" -WhatIf
Rename-Fonts -Verbose
The script automatically processes all supported formats. To handle only specific types, you can filter the directory contents first.
-
"Execution Policy" Error
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
-
"Cannot extract font info" Errors
- File may be corrupted
- Unsupported font format
- File permissions issue
-
Functions Not Recognized
- Make sure to load the script with dot sourcing:
. .\FontRenamer.ps1
- Make sure to load the script with dot sourcing:
- Use
Show-Help
command for quick reference - Check the generated log files for detailed error information
- Ensure you have proper read/write permissions in the target directory
MIT License - feel free to use, modify, and distribute.
Contributions are welcome! Please feel free to submit issues or pull requests.
If you encounter any issues or have suggestions for improvements, please open an issue on GitHub.
Made with ❤️ for font enthusiasts and designers