XML Hacking: Font Themes

Font themes are one of the simpler theme elements in Open Office XML, but for some baffling reason, Mac Office users can’t create one. It’s odd enough that the only Mac program that can create a color theme is PowerPoint, but even it can’t provide an escape from Calibri and Arial! So I’m going to show you how to do it on your own.

Let’s start with a dead-simple font theme. Here’s the minimal file that Office will read:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<a:fontScheme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Test">
  <a:majorFont>
    <a:latin typeface="Arial"/>
    <a:ea typeface=""/>
    <a:cs typeface=""/>
  </a:majorFont>
  <a:minorFont>
    <a:latin typeface="Arial"/>
    <a:ea typeface=""/>
    <a:cs typeface=""/>
  </a:minorFont>
</a:fontScheme>

You can create this in any text editor, including TextEdit in plain text mode (don’t try this with an rtf file). However, by default TextEdit will change the necessary straight quotes to smart quotes, producing a file that Office will not recognize. If you’re using Text Edit, make sure you visit both TextEdit>Preferences and TextEdit>Edit>Substitutions and turn off Smart Quotes in both locations.

Now that you’re set up to edit, copy and paste the font theme file. The <a:latin> tag is the standard font for your theme. <a:majorFont> is for headings and <a:minorFont> for text. Fill in <a:ea> with a font that supports Chinese or Japanese (ea stands for East Asian), if you want to support those languages. The <a:cs> tag stands for complex scripts: Arabic, Thai, Hebrew and many more. For more detail on non-European language support in font themes, please see my article XML Hacking: Font Themes Complete. Or you can just leave those tags blank if you have a predictable user base that won’t require them.

A common mistake is to get too specific with the font name in font themes. The name is only the base font name as displayed in Powerpoint’s font menu. “Open Sans” will work, but “Open Sans Extrabold” will cause Word 2011 to display a blank space where the font theme should be, while Word 2016 will simply ignore the entire file.

Save the file as a text file with a .xml ending and give it the name you want to appear in the user interface. “Brandwares.xml” will appear in the Font Theme menu as Brandwares.

For Office 2016, save this file to Users/YourUserName/Library/Group Containers/UBF8T346G9.Office/User Content/Themes/Theme Fonts. For Office 2011, save it to Users/YourUserName/Library/Application Support/Microsoft/Office/User Templates/My Themes/Theme Fonts. In current versions of OS X, the user Library is hidden by default. To open it, hold down the Alt key, while clicking on the Go menu and choosing Library.

Once it’s correctly installed, it will show in PowerPoint’s Slide Master view under the Fonts dropdown. A new Custom group will appear at the top of the list, with your font theme in it. Once you apply it and a color theme to a presentation, you can save as a theme file and distribute that to your users, it will contain the font theme you just created. Happy hacking!


Font Themes – An Alternate Method

March 2017 edit: If you have any problems creating a font theme from scratch, here’s a workaround. Open an existing font theme that come with Office and edit the font names to the ones you want to use. These files are the verbose style discussed in this article: XML Hacking: Font Themes Complete. For most uses, you only need to set the a:latin font in the a:majorfont and a:minorfont sections. Here’s where you can find the Microsoft Font Themes:

Office 2011 for Mac – Open Applications/Microsoft Office 2011/Office/Media/Office Themes/Theme Fonts and copy any of the XML files.

Office 2016 for Mac – Open Applications, then right-click on Microsoft PowerPoint and choose Show Package Contents. Open Contents/Resources/Office Themes/Theme Colors and copy any of the XML files in there.

Here are the locations for 32-bit versions of Windows. If you’re using a 64-bit version of Windows, check the same path inside C:\Program Files (x86).

Office 2007 for Windows – Open C:\Program Files\Microsoft Office\Document Themes 12\Theme Fonts.

Office 2010 for Windows – Open C:\Program Files\Microsoft Office\Document Themes 14\Theme Fonts.

Office 2013 for Windows – Open C:\Program Files\Microsoft Office\root\Document Themes 15\Theme Fonts.

Office 2016 for Windows – Open C:\Program Files\Microsoft Office\root\Document Themes 16\Theme Fonts.

10:35 pm

50 thoughts on “XML Hacking: Font Themes

    • The most common issues that I’ve seen are:

      • Smart quotes around the font names instead of straight quotes. This can happen if you use TextEdit with its default settings, or if you use Word to edit the XML.
      • Over-qualifying the font name. As an example, Arial will work, but Arial Bold will not. Use the base font name as it appears in the PowerPoint font menu.

      If neither of those seem to be the case, feel free to post your question at the Microsoft PowerPoint forum, where I answer questions. You can upload your Font Theme to Dropbox or other cloud storage, then include a Share link to it in your post. I’ll take a look at it. This way the knowledge benefits more people, thanks.

  1. Dear lord FINALLY a site that makes sense of this.

    Having just transitioned from a PC to a Mac for work this has irritated me for ages. Why there can’t be an option to create a custom on at the bottom of the fonts list like there is on the PC is beyond me, but thank you for explaining this concisely – there’s no documentation for this and, frankly, that folder is completely hidden and you would never guess to put it there. It doesn’t help that there is an identical folder structure in users/name/library/microsoft etc that does NOTHING!

    The smart quotes thing is important to highlight too, it didn’t recognise any of my custom ones due to a couple of rogue ones in the Fontset Name.

    Thanks again

    • Regarding the folder in Users/YourUserName/Library/Microsoft, every version of Office has different locations for support files. The Users/YourUserName/Library/Microsoft path was used by Office 2008 and Office 2011, so if you had those previously installed, you would still have that folder structure. The Microsoft installer leaves those folders alone so user can later retrieve any templates or themes that may still be in there.

  2. i looked all over the web—more than a few had ways to hack the PPT fonts. none of them worked—thank you for posting–you solution WORKED!!

    • Office users are used to work with “Family” fonts, where clicking on the Bold or Italic buttons switches the font. You could use “Single” fonts instead, where you switch weights by changing the font selected in the font dropdown. Then you could create a theme where the Regular weight was the Body font and the Bold was the Headings font in the theme.

      Unfortunately, this would mean that the Bold button would only apply a stroke to the Regular weight instead of switching it to the true Bold version. The would play havoc with the presentation design. Switching to Bold by changing the font choice isn’t very user-friendly and most PowerPoint users would have to be taught to change their ways.

      • Our company Montserrat as our corporate font. However, we use Montserrat Light as you normally would a “regular” weight font for body text, and the actual regular Montserrat as you would “bold,” for headings etc. It is an unusually thickly-weighted font that I’d like to move away from anyway, but it’s what we must work with for now.
        Do you have any suggestions as to how I could make a font theme that defaults new minor font items to use Light if you cannot specify font styles in the xml, or am I just going to have to live with it?

        • If you open the Format>Font dialog and both Montserrat Light and Montserrat Regular show as separate entries in the list of fonts, you can use both font names in the theme. (If you’re using a Mac, don’t trust the list of fonts that show on the Ribbon, since OS X automatically assembles fonts into a family for that dropdown.)

          If you only see Montserrat Light in the Format>Font dialog and you have to add the Bold attribute to get the Regular weight, then you’ll have to spec Montserrat Light for both heading and body in the font theme. In this case, you’ll just have to live with it.

  3. John, your tutorial was a lifesaver. Thank you! You helped me to finally solve the annoyance I was struggling against for 20 years. Sweet victory!

  4. I tried this and saved the xml file within Containers/UBF8T346G9.Office/User Content.localized/Themes.localized/Theme Fonts
    Sadly, nothing happens – I’ve restarted PPT a few times but those fonts just don’t show up. I’d really appreciate your help with this…
    Miriam

    • That doesn’t look like the right path. Please try Users/YourUserName/Library/Group Containers/UBF8T346G9.Office/User Content/Themes/Theme Fonts. to make the your user Library folder visible, you’ll probably have to hold down the Alt key while clicking on the Go menu and choosing Library. If that doesn’t work for you, please post the XML from your font theme.

  5. I’ve removed the issue with the text edit and I’m using a basic version of the font name. I’m getting a spinning wheel under custom fonts and I can see the file name appear but I can’t choose the font. Reasons for this?

    • Just to double-check your steps, after creating the font theme and placing it in the Theme Fonts folder, you would then open the presentation or document and apply the font theme to the file. After you apply it, then you would select a style in Word or a placeholder in PowerPoint and choose YourFontName (Body) or YourFontName (Headings). Have you followed those steps? Are you seeing the beach ball when you’re trying to apply font name with (Body) or (Headings) in the name, or just the plain font?

    • That font should be installed like any other. If you’re on Windows, fonts should be installed in C:/Windows/Fonts, on a Mac place them in Users/YourUserName/Library/Fonts to make them available to the current user, or Library/Fonts to install for all users.

  6. Hi, this is FANTASTIC, thanks! I’m wondering, can you include more than two font families? For instance, we’re trying to create a custom theme for a client with three different typefaces, but can only get the two to load using this XML script. Any help is GREATLY appreciated. THANK YOU!!!!

  7. Hi John, Did you ever resolve the previous issue of having the spinning wheel under Custom instead of being able to select the theme fonts? I believe I am following your directions correctly (for PPT 2011 for Mac) but when I select the Fonts drop down menu, it behaves as if it is trying to load my custom font.

    • I’m guessing here, but one trap with using TextEdit is that by default it inserts “smart” quotes instead of straight quotes. XML chokes on smart quotes. In TextEdit, open Preferences and uncheck the Smart quotes option to avoid this.

  8. I may be an idiot, but I can’t find the library, on my OS X (latest version iMac. I am new to the mac, however

    • In modern versions of OS X, the user Library folder is hidden by default. In the OS X menu at the top of your screen, hold down the Alt key while clicking on Go menu and choosing Library to make it temporarily visible.

      To make the Library folder permanently visible (I do this on every Mac), click on the Go menu and choose Home. Then choose the View menu and select Show View Options. At the bottom of the View Options dialog, check the Show Library Folder option.

  9. Pingback: PowerPoint Construction Best Practices - Office Best Practices

    • A Font Theme file is a small XML file that stands alone. In a Windows installation, the default location for this file is C:\Users\YourUserName\AppData\Roaming\Microsoft\Templates\Document Themes\Theme Fonts. In Office 2011 for Mac, the location is Macintosh HD/Users/YourUserName/Library/Application Support/Microsoft/Office/User Templates/My Themes/Theme Fonts, while in Office 2016 for Mac the file would go in Macintosh HD/Users/YourUserName/Library/Group Containers/UBF8T346G9.Office/User Content/Themes/Theme Fonts. Once you place this file in the correct folder, it will then appear in PowerPoint as another font theme that can be applied to a presentation, template or theme. Please note that default paths may be customized on any computer and that the AppData (windows) and Library (OS X) folders are normally hidden.

      Once you apply that Font Theme, PowerPoint transfers the information to the theme1.xml part of your presentation (found in ppt/theme). This means that if you’re developing a full theme, you can edit the a:fontScheme section of theme1.xml to get the same effect. When I open theme1.xml and see <a:latin typeface=”Calibri”/>, I can edit that to <a:latin typeface=”Humanist“/> for both the a:majorFont and a:minorFont sections.

      If you still have questions, feel free to email me at production at brandwares dot com with your operating system and Office version and I can give you more exact details.

  10. Hi John, I’m afraid I’m not having any luck with this hack, either. I edited your file in TextEdit, with smart quotes turned off in both places. I saved the .xml file to Macintosh HD/Users/MyUserName/Library/Group Containers/UBF8T346G9.Office/User Content/Themes/Theme Fonts…
    I’m trying to use Georgia (a:majorFont) and Yu Gothic (a:minorFont).
    Thinking that maybe Yu Gothic was the problem, I tested Georgia as the a:minorFont, but that didn’t work either.
    I’m overlooking something somewhere!

    • Yu Gothic would not work as that’s considered an East Asian font rather than a Latin font. This article covers only the most basic font theme for Latin fonts, I’ll write a part 2 to the article to describe a complete Font Theme.

      Feel free to post your XML here, substituting &lt; for < and &gt; for >. You can also email the file to me at production at brandwares dot com and I’ll take a look at it.

  11. Pingback: Report Charts: Simple Excel Templates - Office Best Practices

    • Another possible cause is that the font name is entered in a form that PowerPoint can’t parse. Using the base font name as it appears in the PowerPoint font menu usually works. But I’m guessing.

      Feel free to post your XML here, substituting &lt; for < and &gt; for >. You can also email the file to me at production at brandwares dot com and I’ll take a look at it.

  12. Pingback: XML Hacking: Font Themes Complete - Office Best Practices

  13. John,

    I’m using Office Home & Student 2016 for Mac. I tried to use your simple XML code for a custom font theme, but custom themes never showed up in any of my Office apps.

    Here’s a solution that did work:
    As a second attempt, I copied a font theme XML file from within the application package for Word and then saved the copy with a new, unique name to my User Content/Themes/Theme Fonts folder.

    Within the opening < a:fontScheme / > tag, there is a name variable for the custom theme. (This variable is not represented in your simple font theme code.) I substituted my custom font theme name in place of the original, “Arial”.

    Within the opening < a:latin / > tag for both the major and minor font definitions, I changed the value of the typeface variable to the basic family name of my font: typeface=”Roboto”.

    Also within the opening < a:latin / > tag for both the major and minor font definitions, there is a variable for a panose number. (This variable also is not represented in your simple font theme code.) I left this panose variable unchanged, though I suspect the number would not actually describe my custom font.

    Finally, I left all of the complicated non-latin a:font tag definitions unchanged, and then saved.

    This time, upon launching Word and Powerpoint, my new custom font theme showed up in the Font Themes list.

    What accounts for this? Why did your simple font theme code fail? Was it the missing Name variable? The missing Panose variable? The missing list of foreign scripts?

    Postscript:
    As a related problem, my Powerpoint application will not respond to menu commands to Customize or Format Theme Colors.

    So far, the solution seems to be to crack open the PowerPoint application package, open and save a copy of a Theme Color XML file to my User Content/Themes/Theme Colors folder, and then carefully edit the hexidecimal values for each of the color variables listed.

    (BTW, this only works if you edit a copy of a Theme Color XML file from the Powerpoint application package. If you try this with an XML file from the Word application package, it fails. There are some differences in the code between the two that probably accounts for this.)

    Do you know whether or not Microsoft intends to fix these broken features in Office 2016 for Mac?

    Sincerely,
    Mark Oehlschlager

    • Invariably, when a font theme file doesn’t display in an Office program, it’s because there is a mistake in the XML. Your workaround is a perfectly good alternative method, since all you have to edit are the font names. If you can email the file to me at production at brandwares dot com, I’ll tell you what the problem was.

      As for PowerPoint not reacting to the Customize Colors… command, that sounds like a problem with your Office installation. You can get help with that issue here: Microsoft Answers

      After you create a color theme file that works in PowerPoint, you can apply the same color theme in Word by selecting the Design tab, clicking on Colors and selecting the custom theme file. This is much easier to do that editing the Word XML, which is tricky on a Mac.

      In case you didn’t see it, here’s my article on how to edit XML in OS X: XML Hacking: Editing in OS X. I really recommend using BBEdit to avoid having to unzip and rezip the files.

  14. I have created 2 font themes using your code. Both of them work in PPT. Thanks so much!

    Only one of them works in Word though. Any thoughts about why?
    They’re open type fonts I can access on the font menu in Word.

    The one that works is Georgia and Verdana.
    The one that doesn’t is Rooney Pro and RooneySans.

    • What are the symptoms of the font theme “not working”? Does the theme not show in the list of available font themes? Or does the font not switch to Rooney when you select that theme? Or something else?

      • The theme is available to select, but the font doesn’t display.
        The fonts to change when I chose the theme, but not to Rooney. In the font window it says Rooney Pro (Theme Headings) or RooneySans (Theme Body) but the font shown is a substitute (Times New Roman).

        I can access both of the Rooney fonts I want manually — and they display correctly.

  15. The theme is available to select, but the font doesn’t display.
    The fonts to change when I chose the theme, but not to Rooney. In the font window it says Rooney Pro (Theme Headings) or RooneySans (Theme Body) but the font shown is a substitute (Times New Roman).

    I can access both of the Rooney fonts I want manually — and they display correctly.

    • Those are the symptoms of a font that Microsoft Word sees as not being installed. If you’re using a Mac, trying running the Font Book application and verify the Rooney fonts. Select a Rooney font, then choose View>Show Font Info. If Kind says OpenType PostScript, that may be an issue with Word 2016 for Mac. That version has shown problems will being able to display PostScript and PostScript-flavored OpenType

  16. This is great. Thanks.

    Even better: I was able to specify a specific style of a font just by using its base name + style (e.g., “Calibri Light”). The built-in themes do the same thing.

    This was on Word 15.38 (170902). Maybe Microsoft fixed it since you wrote these directions?

    • Thanks for your kind words!

      Office is still working the same as when I wrote the article. Your trick will work for any font weight that is in it’s own family. Calibri is one family and Calibri Light is another, so you can spec Calibri Light in a theme. This trick wouldn’t work with Calibri Bold, where you can only spec the base font of Calibri. This is because Calibri Bold in in the Calibri family.

      As an illustration, open the Format>Font dialog in Word. Click on the Font dropdown (or Latin text font dropdown, if you have multiple languages installed). You’ll see Calibri and Calibri Light, but no Calibri Bold. As the article mentions in paragraph 5, the name you can use is the name that appears in PowerPoint’s font menu. Calibri Bold does not appear there, so you can’t use it.

Leave a Reply

*Required fields. Your email address will not be published.

Posting XML? To enter XML code, please replace all less than signs "<" with "&lt;" and greater than signs ">" with "&gt;". Otherwise, Wordpress will strip them out and you will see only a blank area where your code would have appeared.