A browser-based editor for Oblivion's proprietary font format.
Permissions and credits
Credits and distribution permission
Other user's assetsAll the assets in this file belong to the author, or are from free-to-use modder's resources
Upload permissionYou can upload this file to other sites but you must credit me as the creator of the file
Modification permissionYou are allowed to modify my files and release bug fixes or improve on the features so long as you credit me as the original creator
Conversion permissionYou can convert this file to work with other games as long as you credit me as the creator of the file
Asset use permissionYou are allowed to use the assets in this file without permission as long as you credit me
Asset use permission in mods/files that are being soldYou are not allowed to use assets from this file in any mods/files that are being sold, for money, on Steam Workshop or other platforms
Asset use permission in mods/files that earn donation pointsYou must get permission to earn Donation Points for your mods if they use my assets
Author notes
polyfills.DocumentFragment.children.js is a public domain work. It was added to this MDN article sometime after August 20th, 2010:
Per that license, you can freely redistribute or modify this mod, as long as you credit the original author, link to the license, and indicate whether changes have been made; moreover, you must use the same license for any derivative works. Permission to monetize the mod is not granted. Fair use e.g. criticism, etc., is not limited by these terms.
Full license text: https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
File credits
The OpenMW team has made available source code containing near-complete specifications for Bethesda's old FNT and TEX formats. (The OpenMW folks didn't identify one of the two kerning values.) Though I didn't use any of their code or assets, without their work, creating this editor would not have been possible.
The DocumentFragment.children polyfill was taken from the MDN wiki. Per MDN it is a public domain work.
Donation Points system
This mod is opted-in to receive Donation Points
Changelogs
Version 1.7.7
Added two macros for reporting potential issues with a font: one alerts you to bad glyphs (in practice this is just the up/down arrow key glitch glyphs), and the other alerts you to all glyphs with uneven kerning. All glyphs that trigger an alert will be selected in the glyph list.
Added a "select all glyphs" button to the glyph list, which should help with making batch edits (e.g. expanding all glyphs by X pixels on each side: you'd select all glyphs and then change each property individually).
Version 1.7.6
Added the ability to import and export the TEX as a PNG.
You can now multi-select glyphs in the glyph list, and batch-edit properties by using the "increment" and "decrement" buttons on the number edits.
Version 1.7.5
Rebuilt the editor so that it can function in Firefox 68+. The editor was previously left non-functional by Mozilla's changes to the same-origin policy with respect to file:/// URIs, which made JavaScript module files impossible to use in local files.
Added a 2x-zoom checkbox to the font texture display.
Version 1.7.4
Separated the "Save" button into "Save FNT" and "Save TEX." This should fix issues stemming from a Firefox update that broke showing multiple download prompts at the same time.
Version 1.7.3
Added Windows-1250 as an available encoding.
Version 1.7.2
Fixed font previewing with non-ASCII characters. Use the encoding drop-down on the glyph list to get previewing working properly. (Fonts don't store encodings anywhere, so you have to tell the tool what encoding to use for everything.)
Macros now have an encoding option.
When you extend the TEX height, the TEX now re-renders properly.
Trying to create a font in an alternate encoding will no longer produce a blank canvas if your initially selected canvas size was too small.
Version 1.7.1
Fixed a bug where the modal for saving fonts didn't respond to you clicking "Save."
Version 1.7
You can now create new fonts using the Windows-1251 encoding.
You can now change what encoding the glyph list on the right uses. Available options are ASCII and Windows-1251.
Version 1.6
Cleaned up the code a bit, now that a more important project has shipped. All core editor components are now separated and are constructed as JavaScript modules.
Version 1.5
Added macros to force a font to all-uppercase or all-lowercase. These only modify glyph data, so these fonts can share the same TEX file as the original font.
Fixed a rendering bug with TEX files that were taller than they were wide.
Added the ability to extend the height of the loaded font's TEX canvas, automatically fixing up FNT UVs in the process.
Version 1.4
Some glyphs now have hover tooltip descriptions. Glyphs repurposed in Oblivion have had their displayed names changed accordingly.
You can now specify an outline's desired thickness when rendering a font. Specified thickness doesn't necessarily translate to actual visible thickness, because your browser handles the rendering for that and HTML5 canvases are weird about some things.
The font preview now handles tabs consistently with the game.
Fixed the glyph select widget: it will no longer "eat" browser/system key combos that use the Ctrl, Shift, or Meta/Windows keys.
Changed the controls to modify a glyph property for all glyphs. They now edit only printable, non-whitespace glyphs, and this is indicated in the UI label.
Non-integer glyph values no longer cause browsers to show form field validation errors.
Version 1.3
Added support for high-resolution fonts. Morrowind and Oblivion render text by constructing a mesh at run-time, with one quad per rendered glyph. The corner coordinates are UVs for each glyph vertex, while the other values describe the size and position of a rendered glyph. Among other things, this makes it possible to create high-resolution fonts which are then downscaled to a normal font size. The font editor now supports this: a "Scale Mult" option is available when creating fonts from scratch; and when a glyph is selected and its bounds are being displayed on the canvas, bounds for line heights and offsets take the computed scale into account. (All that said, Oblivion's font downscaling isn't terribly good. A 4x-resolution font, for example, looks jagged and low-quality when downscaled.)
Updated the UI: the top-bar is now a Microsoft Office-style ribbon.
The "unk04" value in FNT headers was identified while disassembling the executable, and is now displayed as "TEX count," with a hover-tip (and code comments) explaining its function. It is not editable at this time.
Vertical alignment on generated fonts has been improved somewhat; among other things, outlined and non-outlined fonts are consistent, in that toggling the outline on and off has no effect on the apparent position of the text itself. However, vertical alignment can still be improved for non-shadowed fonts; in particular, it would be worth researching how the game determines the height of a single-line text element (as opposed to the height of a line of text *in* that element).
Fixed whitespace generation. Whitespace characters now use right-side kerning instead of left-side kerning, which should prevent lines after the first from being indented.
Version 1.2
Fixed vertical alignment on fonts created from scratch, and on text previews. Refer to the readme for further information.
Fixed incorrect bounds displays when selecting a glyph.
Non-printable characters are no longer generated when creating fonts from scratch.
The "Font Size" property has been renamed to "Line Height."
Potential fixes to spaces in generated fonts: kerning-left is now used instead of kerning-right, as the engine ignores the latter for zero-width characters in some cases.
Fixed the layout in non-Firefox browsers. (I'm pretty sure Firefox was actually the one that was doing things wrong.)
All changes regarding vertical alignment and spacing have been verified via disassembly of the game itself.
Oblivion Font Editor
A browser-based tool for editing Oblivion's fonts. It can load existing fonts, or create a new one by rendering glyphs to an HTML5 canvas. Glyphs can be individually modified, and kerning and ascender lengths can also be modified for all glyphs at once. Text can be previewed in the loaded font, with accurate glyph placement and line-spacing. Fonts can be resaved as FNT/TEX pairs. Editor supports multiple text encodings (currently ASCII and Windows-1251). For usage instructions, refer to the README.txt (which the Nexus should also allow me to add as a mod page tab).
Caveats
This is one of my personal tools and as such, it is provided as-is. I may fix bugs or provide support on request, but in general I'm going to be a lot less keen on fixing this thing than I would be for my public works.
The tool is a web page meant to run on your hard drive. It works in Firefox and Edge as of this writing. However, Chrome is the odd one out, and in its infinite wisdom refuses to handle basic local file access properly unless started with a command line switch (--allow-file-access-from-files).