关于PowerPoint中存在但Windows字体设置未列出的字体的系统名称获取及问题解决的问询
Hey there, let's break this down for you—this is a super common issue with Office-specific fonts, and I've got a few practical ways to help you get the system name you need for Python, plus fix why those fonts don't show up in Windows settings.
Why can't you see Avenir in Windows Fonts?
Most likely, that Avenir Next LT Pro Light is an Office-only embedded font. Microsoft bundles some fonts directly with Office apps instead of installing them globally on your Windows system. These fonts are only loaded when Office apps are running, so they don't appear in the system-wide Fonts settings or other non-Office programs by default.
How to get the real system font name for Python
Here are three reliable methods to find the exact name Windows (and Python) recognizes for that font:
1. Use PowerPoint VBA to list font details
This is the most direct way since you're already working with PowerPoint:
- Open your PowerPoint presentation, press
Alt + F11to launch the VBA Editor. - Right-click your presentation in the Project pane > Insert > Module.
- Paste this code into the module:
Sub ListAllFonts() Dim presentationFont As Font For Each presentationFont In ActivePresentation.Fonts ' Print the font name as PowerPoint sees it (this is the system name you need) Debug.Print "PowerPoint Display Name: " & presentationFont.Name & " | System Font Name: " & presentationFont.Name Next presentationFont End Sub
- Press
F5to run the macro, then pressCtrl + Gto open the Immediate Window. Look for the line with "Avenir Next LT Pro Light"—the "System Font Name" value is what you'll use in Python.
2. Dig into Office's font files
Office stores its private fonts in a hidden virtual file system (VFS) folder. Here's how to find them:
- Navigate to
C:\Program Files\Microsoft Office\root\VFS\Fonts\Private(orC:\Program Files (x86)\Microsoft Office\root\VFS\Fonts\Privateif you have 32-bit Office). - Look for files named something like
AvenirNextLTPro-Light.otfor similar. - Right-click the font file > Properties > Details tab. Look for the "Font name" field—this is the system-recognized name.
3. Use Python's matplotlib to scan for the font
If you're already working in Python, you can use matplotlib to detect all available fonts (including Office's private ones if they're loaded):
from matplotlib import font_manager # Scan all available fonts on your system available_fonts = font_manager.findSystemFonts() # Search for Avenir-related fonts for font_path in available_fonts: font_prop = font_manager.FontProperties(fname=font_path) font_name = font_prop.get_name() if "Avenir" in font_name: print(f"Found font: {font_name} | Path: {font_path}")
The font_name value here is what you'll pass to Python plotting libraries like matplotlib or seaborn.
How to make the font appear in Windows Fonts settings
If you want the font to be available system-wide (including in Windows settings), you can install it properly:
- Locate the font file in the Office VFS folder mentioned earlier.
- Copy the file to your desktop (to avoid permission issues).
- Right-click the copied font file > "Install". This will register the font with Windows, and it will now show up in the Fonts settings and all other programs.
⚠️ Important note: Always check the font's license before installing it system-wide. Some fonts bundled with Office have restricted usage that might prevent you from installing them outside of Office apps.
备注:内容来源于stack exchange,提问作者Bram Vanroy

