Fonts: Difference between revisions

From OpenMW Wiki
Jump to navigation Jump to search
(Update source link to something more current)
(Wipe out the page, RTD it is)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''Morrowind .fnt fonts'''
Font support information has moved to our official documentation on [https://openmw.readthedocs.io/en/master/reference/modding/font.html ReadTheDocs].
 
Morrowind uses a custom .fnt file format. It is not compatible with the Windows Font File .fnt format, nor compatible with .fnt formats from any other Bethesda games. To our knowledge, the format is undocumented and no tools for viewing or editing these fonts exist.
 
OpenMW can load this format and convert it on the fly into something usable (see font loader
[https://github.com/OpenMW/openmw/blob/master/components/fontloader/fontloader.cpp#L210 source code]). In OpenMW 0.32, an --export-fonts command line option was added to write the converted font (a PNG image and an XML file describing the position of each glyph in the image) to the current directory.
 
'''TrueType fonts'''
 
Unlike vanilla Morrowind, OpenMW directly supports TrueType (.ttf) fonts. This is the recommended way to create new fonts.
 
* Delete the original magic cards .fnt file (from your Data Files/Fonts directory).
* Open resources/mygui/openmw_font.xml in your OpenMW installation.
* Add a Resource element for the new font. You can use the existing one for DejaVuLGCSansMono.ttf as a template. Some important values:
** name="Magic Cards"
** <Codes> specifies which glyphs are included in the font texture. For international glyphs, you might need to add a few more. You can check the code for a glyph in a font editor (e.g. FontForge)
 
TODO: Add examples
 
'''Bitmap fonts'''
 
Morrowind .fnt files are essentially a bitmap font, but using them is discouraged because of no Unicode support.
MyGUI has its own format for bitmap fonts. An example can be seen by using the --export-fonts command line option (see above), which converts Morrowind .fnt to a MyGUI bitmap font. This is the recommended format to use if you wish to edit Morrowind's bitmap font or create a new bitmap font.

Latest revision as of 15:31, 30 December 2018

Font support information has moved to our official documentation on ReadTheDocs.