A lightweight, Windows-compatible font containing only flag emojis from Google's Noto Color Emoji font, with cross-platform build tools and system integration support.
This project creates a subset of the Noto Color Emoji font that contains only flag emojis, significantly reducing file size while maintaining full emoji flag support. The resulting font is perfect for applications that only need flag emoji support without the overhead of the complete emoji font.
- Lightweight: Contains only flag emojis, dramatically smaller than the full Noto Color Emoji font
- Windows Compatible: Uses the Windows-compatible version of Noto Color Emoji
- Complete Flag Support: Includes all country and regional flag emojis
- Cross-platform: Build scripts available for both Windows (PowerShell) and Unix-like systems (Bash)
- Automated Process: Simple one-command build process
-
HarfBuzz: The
hb-subsettool is required for font subsetting- Windows: Download from HarfBuzz releases
- macOS:
brew install harfbuzz - Ubuntu/Debian:
sudo apt-get install harfbuzz-utils - Fedora/RHEL:
sudo dnf install harfbuzz-devel
-
Python: Required for font name table updates
- fontTools:
pip install fonttools
- fontTools:
-
Internet Connection: For downloading the source font
.\build.ps1./build.sh- Downloads Source Font: Fetches the latest Windows-compatible Noto Color Emoji font from Google's repository
- Creates Subset: Uses HarfBuzz to extract only flag-related Unicode characters
- Updates Metadata: Renames the font to "Noto Color Emoji Flags" for clear identification
- Generates Output: Creates
NotoColorEmoji-flagsonly_WindowsCompatible.ttfin thefonts/directory
The build process generates:
fonts/NotoColorEmoji-flagsonly_WindowsCompatible.ttf- The final flag-only font file
The font includes:
- All country flags (๐บ๐ธ, ๐ฌ๐ง, ๐ฏ๐ต, etc.)
- Regional indicator symbols (U+1F1E6-U+1F1FF)
- Supporting characters for proper flag rendering
- Zero-width joiner (U+200D) for compound flags
โโโ build.ps1 # Windows PowerShell build script
โโโ build.sh # Unix/Linux bash build script
โโโ update_flag_name.py # Python script to update font names
โโโ flags-only-unicodes.txt # Unicode list for flag characters
โโโ fonts/ # Output directory (created during build)
โโโ NotoColorEmoji-flagsonly_WindowsCompatible.ttf
- Source Font: Noto Color Emoji (Windows Compatible version)
- Subsetting Tool: HarfBuzz hb-subset
- Font Format: TrueType (.ttf)
- Character Encoding: Unicode
- Platform Support: Cross-platform with Windows optimization
- Web Applications: Lightweight flag emoji support
- Mobile Apps: Reduced bundle size for flag-only emoji needs
- Desktop Applications: Custom flag picker interfaces
- Documentation: Technical documentation requiring only flag emojis
- Windows Font Fallback: Set Noto flags as primary choice with Segoe UI Emoji as fallback
You can replace the flag characters in Windows' built-in seguiemj.ttf (Segoe UI Emoji) font to use Google's more detailed and frequently updated flag emojis instead of Microsoft's versions.
- System File Modification: This process modifies a Windows system font file
- Admin Rights Required: You need administrator privileges
- Backup Essential: Always backup the original font file before making changes
- Windows Updates: System updates may restore the original font
- System Stability: Improper font modification can cause display issues
- Completed build process (generated flag-only font)
- Administrator access to Windows
- Font editing software (recommended: FontForge or similar)
- FontTools with additional utilities:
pip install fonttools[all]
# Run as Administrator
Copy-Item "C:\Windows\Fonts\seguiemj.ttf" "C:\Windows\Fonts\seguiemj.ttf.backup"# Copy to working directory
Copy-Item "C:\Windows\Fonts\seguiemj.ttf" ".\fonts\seguiemj_original.ttf"Create a merge script (merge_flags.py):
from fontTools import ttLib
from fontTools.merge import Merger
import shutil
def merge_flag_fonts():
# Load fonts
system_font = ttLib.TTFont("fonts/seguiemj_original.ttf")
flags_font = ttLib.TTFont("fonts/NotoColorEmoji-flagsonly_WindowsCompatible.ttf")
# Create merger instance
merger = Merger()
# Merge flag characters from Noto into Segoe UI Emoji
# This replaces existing flag glyphs with Noto versions
merged_font = merger.merge([system_font, flags_font])
# Save merged font
merged_font.save("fonts/seguiemj_with_noto_flags.ttf")
print("Merged font created: seguiemj_with_noto_flags.ttf")
if __name__ == "__main__":
merge_flag_fonts()# Run as Administrator - Stop Windows Font Cache Service
Stop-Service FontCache -Force
# Replace the system font
Copy-Item ".\fonts\seguiemj_with_noto_flags.ttf" "C:\Windows\Fonts\seguiemj.ttf" -Force
# Restart Font Cache Service
Start-Service FontCache
# Clear font cache
Remove-Item "$env:LOCALAPPDATA\Microsoft\Windows\Fonts\*" -Force -ErrorAction SilentlyContinue- Open any application that displays emojis (Notepad, Browser, etc.)
- Type flag emojis: ๐บ๐ธ ๐ฌ๐ง ๐ฏ๐ต ๐ฉ๐ช ๐ซ๐ท
- Verify that the flags now display Google's Noto versions
If you need to restore the original font:
# Run as Administrator
Stop-Service FontCache -Force
Copy-Item "C:\Windows\Fonts\seguiemj.ttf.backup" "C:\Windows\Fonts\seguiemj.ttf" -Force
Start-Service FontCacheInstead of replacing the system font, you can use Windows font linking:
- Install the flag font in Windows: Double-click the
.ttffile and click "Install" - Create a registry entry to link flag characters to your custom font
- This method is safer but more complex to implement
Configure Windows to prioritize the Noto Color Emoji Flags font for flag characters while falling back to the system's Segoe UI Emoji font for other emojis. This approach provides the best flag rendering without modifying system files.
- Non-invasive: No system file modification required
- Safe: Preserves original Windows fonts
- Selective: Only affects flag emoji rendering
- Reversible: Easy to undo changes
- Update-proof: Survives Windows updates
- Administrator privileges
- Completed build process (flag font installed)
# Install font for all users (requires admin)
Copy-Item ".\fonts\NotoColorEmoji-flagsonly_WindowsCompatible.ttf" "$env:SystemRoot\Fonts\"
# Register in registry
$fontName = "Noto Color Emoji Flags (TrueType)"
$fontFile = "NotoColorEmoji-flagsonly_WindowsCompatible.ttf"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" -Name $fontName -Value $fontFile# Create font linking registry entries
$regPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink"
# Set Noto flags as primary for emoji characters, Segoe UI Emoji as fallback
$linkValue = @(
"NotoColorEmoji-flagsonly_WindowsCompatible.ttf,Noto Color Emoji Flags",
"seguiemj.ttf,Segoe UI Emoji"
)
New-ItemProperty -Path $regPath -Name "Segoe UI Emoji" -Value $linkValue -PropertyType MultiString -Force# Restart Windows font cache
Stop-Service FontCache -Force
Start-Service FontCache
# Clear font cache
Remove-Item "$env:LOCALAPPDATA\Microsoft\Windows\Fonts\*" -Force -ErrorAction SilentlyContinueFor web applications, use CSS font-family prioritization:
/* Prioritize Noto flags, fallback to system emoji */
.emoji {
font-family:
"Noto Color Emoji Flags",
"Segoe UI Emoji",
"Apple Color Emoji",
"Noto Color Emoji",
sans-serif;
}
/* Alternative: specific to flag emojis */
.flag-emoji {
font-family: "Noto Color Emoji Flags", "Segoe UI Emoji";
}// In main process
app.on('ready', () => {
// Set font preferences
systemPreferences.setUserDefault('NSFontFamilyClassName', 'string', 'Noto Color Emoji Flags');
});// C# WPF example
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
// Set font fallback
var fontFamily = new FontFamily("Noto Color Emoji Flags, Segoe UI Emoji");
this.FontFamily = fontFamily;
}
}- Open Notepad or any text editor
- Type flag emojis: ๐บ๐ธ ๐ฌ๐ง ๐ฏ๐ต ๐ฉ๐ช ๐ซ๐ท
- Type other emojis: ๐ ๐ ๐ โค๏ธ ๐
- Verify that:
- Flags display using Noto style (more detailed)
- Other emojis display using Segoe UI style
Create a test HTML file:
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: "Noto Color Emoji Flags", "Segoe UI Emoji";
font-size: 24px;
}
</style>
</head>
<body>
<p>Flags: ๐บ๐ธ ๐ฌ๐ง ๐ฏ๐ต ๐ฉ๐ช ๐ซ๐ท ๐จ๐ณ ๐ฎ๐ณ</p>
<p>Other: ๐ ๐ ๐ โค๏ธ ๐ ๐ถ ๐</p>
</body>
</html># Remove font linking
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink" -Name "Segoe UI Emoji"
# Restart font services
Stop-Service FontCache -Force
Start-Service FontCache# Remove font file and registry entry
Remove-Item "$env:SystemRoot\Fonts\NotoColorEmoji-flagsonly_WindowsCompatible.ttf"
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" -Name "Noto Color Emoji Flags (TrueType)"- Changes not visible: Clear browser cache and restart applications
- Registry access denied: Ensure running as administrator
- Font conflicts: Check for duplicate font installations
- Performance issues: Monitor system performance with large font stacks
- Font linking affects system-wide emoji rendering
- Some applications may override system font settings
- Modern browsers handle font fallback automatically
- Mobile apps may require platform-specific implementations
- Font doesn't load: Ensure font cache is cleared and services restarted
- Garbled text: Restore backup and check font integrity
- Windows updates: May need to repeat process after major updates
- Performance issues: Large merged fonts may impact system performance
- This modification affects all applications system-wide
- Some applications may cache fonts and require restart
- Modern Windows versions have additional protection mechanisms
- Consider testing on a virtual machine first
"hb-subset tool not found"
- Ensure HarfBuzz is installed and added to your system PATH
"Failed to download font file"
- Check your internet connection
- Verify the GitHub URL is accessible
"Python script execution failed"
- Ensure Python is installed and in PATH
- Install fontTools:
pip install fonttools
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
This project uses fonts from Google's Noto project. Please refer to the Noto repository for licensing information regarding the font files.
The build scripts and tools in this repository are provided as-is for educational and practical use.
- Google Fonts team for the excellent Noto Color Emoji font
- HarfBuzz project for the powerful font subsetting tools
- fontTools library for font manipulation capabilities
- Noto Emoji project for maintaining high-quality emoji fonts
- Microsoft Typography team for Windows font system documentation
Note: This project does not distribute the font files directly. The build process downloads the official font from Google's repository and creates the subset locally.