font.rst 2.03 KB
Newer Older
Ryan Tucker's avatar
Ryan Tucker committed
1
2
3
4
5
6
Fonts
#####

Morrowind .fnt fonts
--------------------

Alexei Kotov's avatar
Alexei Kotov committed
7
8
Morrowind uses a custom ``.fnt`` file format. It is not compatible with the Windows Font File ``.fnt`` format.
To our knowledge, the format is undocumented.
Ryan Tucker's avatar
Ryan Tucker committed
9

10
11
OpenMW can load this format and convert it on the fly into something usable 
(see font loader `source code <https://github.com/OpenMW/openmw/blob/master/components/fontloader/fontloader.cpp#L210>`_). 
Andrei Kortunov's avatar
Andrei Kortunov committed
12
You can use --export-fonts command line option to write the converted font
13
(a PNG image and an XML file describing the position of each glyph in the image) to the current directory.
Ryan Tucker's avatar
Ryan Tucker committed
14
15
16
17

TrueType fonts
--------------

Alexei Kotov's avatar
Alexei Kotov committed
18
19
20
21
Unlike vanilla Morrowind, OpenMW directly supports TrueType (``.ttf``) fonts.

This is the recommended way to install replacement fonts.

Andrei Kortunov's avatar
Andrei Kortunov committed
22
23
	1.	Download `TrueType fonts for OpenMW <https://www.nexusmods.com/morrowind/mods/46854>`_
	2.	Place the ``Fonts`` folder from archive to the configuration folder. Use :doc:`paths` article to find the folder.
Alexei Kotov's avatar
Alexei Kotov committed
24

Andrei Kortunov's avatar
Andrei Kortunov committed
25
Now Fonts folder should include ``openmw_font.xml`` file and three ``.ttf`` files.
Alexei Kotov's avatar
Alexei Kotov committed
26

Andrei Kortunov's avatar
Andrei Kortunov committed
27
If desired, you can now delete the ``Data Files/Fonts`` directory.
Alexei Kotov's avatar
Alexei Kotov committed
28

29
It is also possible to adjust the font size and resolution via ``settings.cfg`` file::
Alexei Kotov's avatar
Alexei Kotov committed
30

Andrei Kortunov's avatar
Andrei Kortunov committed
31
32
33
			[GUI]
			font size = 16
			ttf resolution = 96
Alexei Kotov's avatar
Alexei Kotov committed
34

Andrei Kortunov's avatar
Andrei Kortunov committed
35
The ``font size`` setting accepts clamped values in range from 12 to 20 while ``ttf resolution`` setting accepts values from 48 to 960.
Alexei Kotov's avatar
Alexei Kotov committed
36

Andrei Kortunov's avatar
Andrei Kortunov committed
37
Any Resolution or Size properties in the XML file have no effect because the engine settings override them.
Alexei Kotov's avatar
Alexei Kotov committed
38
39
40

The engine automatically takes UI scaling factor into account, so don't account for it when tweaking the settings.

Ryan Tucker's avatar
Ryan Tucker committed
41
42
43
Bitmap fonts
------------

Alexei Kotov's avatar
Alexei Kotov committed
44
Morrowind ``.fnt`` files are essentially a bitmap font, but using them is discouraged because they don't have Unicode support. 
45
46
47
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.