Guide:UnderstandingFonts
Understanding Fonts in Skyrim -- by Kesta
This article is to provide some insight on how fonts works in Skyrim, and how mods can modify them.
The Interface
Introduction
Fonts are almost only used from the interface part of Skyrim. That is, font are only displayed either on the HUD, or inside a menu.
Yes, reading a book do count as being inside a menu from the technical side of things.
The only exception is for textures containing texts, where the text and its font are just an image, painted directly in the world. A typical example of this in Skyrim is the Wall of the 500 seen in Windhelm.
For everything else, fonts are used through interface elements, a.k.a. stuffs in .swf files (ShockWave Flash), which define all of the Interface (HUDs and Menus) in Skyrim.
Unlike most of the SWF-based user interface, fonts aren't directly embedded in their menus. Instead, the system is based on libraries :
Each menu / HUD is using a binding to declare its font, and the game engine then supply the actual font to those bindings with fonts from libraries. This article is about explaining where those libraries works, how they're supplied to the interface's bindings, and thus how to adjust them yourself.
SWF Files 101
SWF files are originally Flash files, bearing the .fla extension. They're used/edited by Adobe Flash CSX (X being a version number), and its successor Adobe Animate CC, which are animations tools. Those tools are used to create interactive 2D movie clips. You can see a menu as a very-interactive 2d movie clip, this is technically what they are.
Once finalized, those .fla are then compiled into a .swf, which can be used by the game. Because .swf is a compiled format, this isn't supposed to be edited as is, though this is possible because the format is pretty simple and the encoding lightweight.
If you need to peak directly inside a compiled SWF file (in this article, I'll do it to briefly explain the content of a font library, and how menus reference them), you can use JPEXS. This is a free tool that is extremely powerful (actually better than most of its paying counterparts), and even come with a decompiler to convert .swf back to .fla files.
In the end, what is inside a .swf file can be summed as :
- A set of predefined element (text blocks, shapes, images, sounds, ...)
- A movie clip made of frame, each frame made of a combination of the above-mentioned elements
- An interaction logic written in ActionScript, so some elements can be interacted with, and the movie clip controlled accordingly.
A minimal valid .swf is made of some regular metadata, and at least a single frame (which can be empty) in the movie clip. Elements and Scripts are optional.
Fonts libraries
Where ?
Fonts libraries are actually regular .swf files. If not for their name, unwary user would probably never notice them.
They're usually found in the Data/Interface folder and their name is prefixed by fonts_ though this is only a convention : Theoretically, they could be placed anywhere in the Data folder and named anything... but this would just make it harder to identify them.
As always, the original game files aren't visible by default since they're packed inside one of the game's archive (.bsa). Interface files, including font libraries, are located in the Skyrim - Interface.bsa (you can use B.A.E. to have a peak inside and eventually extract them). There is two of them for the English version of the game :
fonts_console.swf fonts_en.swf
What ?
As you probably guessed, fonts used in the console are defined in fonts_console.swf, and other fonts are defined in fonts_en.swf.
Actually, when trying to guess what was in developers mind by looking at which fonts are defined in each, the conclusion is essentially that common fonts are expected to be inside fonts_console.swf (which contains Arial), while stylized fonts made for the game are defined within fonts_en.swf.
The content of a SWF fonts library is pretty straightforward :
- A minimal SWF (header, file attributes, metadata, and a single frame with a default background color).
- One or more fonts definitions.
- Eventually some texts elements placed on the frame, used by the creator to test/visualize it during development.
Here is the architecture of the fonts_console.swf file for a more visual example :
Multi-Language support
When creating a new font, each character is created individually.
Languages using special characters suffer a lot from this. Typically, accentuated characters, or completely different alphabets (Cyrillic or Japanese) need to use fonts with their characters properly defined.
If you're using a modded fontlib on a non-english verison of the game, there is a possibility that some or all of your special character will be missing and instead replaced by a square-shaped character. This is actually true for any computer application using fonts.
In those cases, there isn't much you can do about it if you don't want to recreate part of the fonts yourself, aside from contacting the author and asking for support for your languages characters.
Fonts bindings
If you try to open any of the original menu with an SWF editor tool like JPEXS, you'll get a complain about a missing gfxfontlib.swf file... but there is no such file in the Skyrim's files.
That's where the trick is. Instead of using this gfxfontlib.swf file that was probably used by designers, the game's scaleform engine supply fonts to its menus dynamically.
Menus define their texts elements and assign them a font as a binding instead of an hard-coded one. Here is a sample of code from the MessageBox menu, which define the properties of te text displayed in messageboxes :
[ xmin -40 ymin -40 xmax 6960 ymax 2380 wordwrap 1 multiline 1 readonly 1 noselect 1 html 1 useoutlines 1 font 7 height 440 color #ffffffff align center leftmargin 0 rightmargin 0 indent 0 leading 40 ]<p align="center"><font face="$EverywhereMediumFont" size="22" color="#ffffff" letterSpacing="0.800000" kerning="0"><message text></font></p>
As you see, the font's face is defined directly here, and point to a somewhat mysterious "$EverywhereMediumFont"... this is what I called a "binding" earlier.
Why do I call it somewhat mysterious ? Because if you open any of the fonts libraries I mentioned above, there is nothing called "$EverywhereMediumFont", no matter how hard you look. Nor in any of the other interface files.
This lead us to the last file, the actual configuration, that will map each of those bindings to an actual font defined in one of the fonts lib (and state which files to use as fonts library).
In Data/Interface, you'll find a fontconfig.txt file. This is where the "magic" (or rather, the mapping... nothing magical anymore now that we know what it's supposed to do) happens. This is how the vanilla file look :
fontlib "Interface/fonts_console.swf" fontlib "Interface/fonts_en.swf" map "$ConsoleFont" = "Arial" Normal map "$StartMenuFont" = "Futura Condensed" Normal map "$DialogueFont" = "Futura CondensedLight" Normal map "$EverywhereFont" = "Futura CondensedLight" Normal map "$EverywhereBoldFont" = "Futura Condensed" Bold map "$EverywhereMediumFont" = "Futura Condensed" Normal map "$DragonFont" = "Dragon_script" Normal map "$SkyrimBooks" = "SkyrimBooks_Gaelic" Normal map "$HandwrittenFont" = "SkyrimBooks_Handwritten_Bold" Normal map "$HandwrittenBold" = "SkyrimBooks_Handwritten_Bold" Normal map "$FalmerFont" = "Falmer" Normal map "$DwemerFont" = "Dwemer" Normal map "$DaedricFont" = "Daedric" Normal map "$MageScriptFont" = "Mage Script" Normal map "$SkyrimSymbolsFont" = "SkyrimSymbols" Normal map "$SkyrimBooks_UnreadableFont" = "SkyrimBooks_Unreadable" Normal validNameChars "`1234567890-=~!@#$%^&*():_+QWERTYUIOP[]ASDFGHJKL;'ZXCVBNM,./qwertyuiop{}//asdfghjkl;'zxcvbnm<>?|¡¢£¤¥¦§¨©ª«®¯°²³´¶·¸¹º»¼½¾¿ÄÀÁÂÃÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ ÿ "
And now, everything is crystal clear. Or should be, but you just jumped right to this paragraph instead of reading the above wall of text didn't you ?
- The first lines, starting by fontlib, define the font libraries to use (the two we looked into earlier), and an additional property stating if the font should be bold or normal.
- Then, lines starting with map will associate one of the binding to one of the font defined in any of the fontlib declared at the beginning of the file.
- The last part state which characters are valid. This shouldn't be changed, but used as a reference by fonts creator to make sure all of those characters have been defined in their font. Do note that this list might change depending on your game's language. You have to make sure the list is the one adapted for your language (compare it against the non-modded file).
For now, what you could do is to swap some of the fonts between each other. But even if it look cool, having your whole interface written in Daedric font won't be very convenient...
Adding new fonts
There is various ways we can think of to add new fonts based on the system described previously:
- Editing directly fonts_en.swf or fonts_console.swf to add new ones, and edit fontconfig.txt to associate them to bindings.
- Supplying a new fonts_something.swf and edit fontconfig.txt to include the new fontlib and associate their new fonts to bindings.
- Edit one of the actual menus so they don't use bindings anymore and instead ship with their own fonts embedded.
You should never see the first one. To put things simply, an SWF is a compiled format as explained at the beginning. Decompiling it into an editable file (.fla), then editing it, and recompiling it, is very tedious and can potentially break the file if anything goes wrong, while you could do things in a simpler way by using the second technique (creating a new file).
The third technique... as you can guess, aside of the fact that you have to decompile/recompile a whole menu just to change fonts will potentially break the file, this also break the game's "visual consistency" if the end user is using a font that doesn't match at all the one defined in the menu. However, this can be used in order to add variety to menus (typically to make a distinctions between bold and non-bold texts if there is none in the original menu), or to allow a more dynamic way of swapping between fonts (This is how SkyUI allow you to change fonts in-game, or why EZ2C Dialogue Menu allow you to change dialogue fonts without overriding any fonts-related files). However, those two mods are an exceptional case, most fonts mods use the second technique.
For the purpose of this article, we're now going to focus on this second way of doing things.
What we know so far : Font mods should ship with :
- One or more fontlib files defining the new fonts
- Either
- An edited fontconfig.txt to bind those fonts to actual in-game menus,
- Or instructions to do it yourself.
The problem is that if it ship with its own fontconfig.txt, it is incompatible with other font mods doing so, while if it provide instructions, it isn't plug-and-play.
But since we're advanced user, we don't care about the fact that it isn't plug-and-play. We're going to dirty our hands a little bit, because that's what is great about modding :)
So to include new fonts in your game :
- Make sure every fontlib that is from a mod is declared in fontconfig.txt like this :
fontlib "Interface/fontlibname.swf"
(replacing fontlibname by the actual name of the file).
- Assign the fonts to the binding of your choice by editing one or more of the map line :
map "$EverywhereFont" = "A cool font" Normal
Make sure that the font name is properly declared in one of the declared fontlib ! Usually, valid namesare indicated in the mod's page, in the readme, or in the shipped fontconfig.txt or the template. If not, you can always open the fontlib SWF with JPEXS to check which font are declared and what's their name.
An usual configuration to edit fonts is about :
- Changing the main font(s) to whatever you favorite font is, to replace vanilla's Futura and its derived.
- Changing the console font to something more readable for console-purpose, usually monospace.
- Changing the books fonts if you fancy something else or grew tired of the original one.
Fonts mods
Here are some fonts mods you might be interested to check out.
Main Fonts Replacer
- Main Font Replacement
- Font Replacement
- Font Overhaul
- 30 Custom Main Fonts for Skyrim
- Sovngarde Font Replacer
Console Fonts Replacer
Book Fonts Replacer
Creating your own fonts
As some authors already did, you can create your very own font for Skyrim and include it in your setup following the above instructions. The only thing missing would be to create your own fontlib file. Since this is relatively simple, you can actually avoid Adobe Animate CC to do it, and instead use a free tool.
This is what sIFR Generator is about. It allow you to simply upload a .ttf file and have it converted to a ready-to-use .swf fontlib. You can try it yourself with any of the fonts file you'll find online, or those already present in your system (You'll find them in C:/Windows/Fonts). Note that windows font are usually made of multiple .ttf files (one for regular font, one for bold, and one for italic), and a .ttc files that is what most of the windows programs expected and tie the related .ttf together.
If you want to do something fun as a test practice, you can try generate your own Oblivion-style font using the .ttf resources available on this nexus page : Elderscrolls Font Pack.
Conclusion
And that's about it for this article. Skyrim's fonts shouldn't have anymore secret for you ;)
Feel free to reach me on the STEP forum for any questions, remarks, or suggestions regarding this article. Or to edit the page directly for minor changes such as typo, grammatical corrections (my English is far from perfect), or formatting.