1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-24 08:41:37 +00:00

Updated documentation

This commit is contained in:
Andrei Kortunov 2022-07-18 10:38:55 +04:00
parent 5bc5c1bb0c
commit b60d14d434

View file

@ -1,30 +1,44 @@
Fonts Fonts
##### #####
Default UI font and font used in magic scrolls are defined in ``openmw.cfg``:
fallback=Fonts_Font_0,pelagiad
fallback=Fonts_Font_2,ayembedt
By default, built-in TrueType fonts are used. Font used by console and another debug windows is not configurable (so ``Fonts_Font_1`` is unused).
Morrowind .fnt fonts Morrowind .fnt fonts
-------------------- --------------------
Morrowind uses a custom ``.fnt`` file format. It is not compatible with the Windows Font File ``.fnt`` format. 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. To our knowledge, the format is undocumented. OpenMW can load this format and convert it on the fly into something usable
(see font loader `source code <https://gitlab.com/OpenMW/openmw/blob/master/components/fontloader/fontloader.cpp>`_).
OpenMW can load this format and convert it on the fly into something usable They can be used instead of TrueType fonts if needed by specifying their ``.fnt`` files names in the ``openmw.cfg``. For example:
(see font loader `source code <https://github.com/OpenMW/openmw/blob/master/components/fontloader/fontloader.cpp#L210>`_).
You can use --export-fonts command line option to write the converted font fallback=Fonts_Font_0,magic_cards_regular
(a PNG image and an XML file describing the position of each glyph in the image) to the current directory. fallback=Fonts_Font_2,daedric_font
In this example OpenMW will search for ``magic_cards_regular.fnt`` and ``daedric_font.fnt`` in the ``Fonts`` folder in data directories.
If they are not found, built-in TrueType fonts will be used as a fallback.
Note that an import wizard copies values from ``Morrowind.ini``, so bitmap fonts will be used after import.
If such behaviour is undesirable, ``Fonts_Font*`` entries should be removed from ``openmw.cfg``.
TrueType fonts TrueType fonts
-------------- --------------
Unlike vanilla Morrowind, OpenMW directly supports TrueType (``.ttf``) fonts. Unlike vanilla Morrowind, OpenMW directly supports TrueType (``.ttf``) fonts. This is the recommended fonts format.
OpenMW has build-in TrueType fonts: Pelagiad, OMWAyembedt and DejaVuLGCSansMono, which are used by default.
TrueType fonts are configured via ``openmw.cfg`` too:
This is the recommended way to install replacement fonts. fallback=Fonts_Font_0,pelagiad
fallback=Fonts_Font_2,ayembedt
1. Download `TrueType fonts for OpenMW <https://www.nexusmods.com/morrowind/mods/46854>`_ In this example, OpenMW will scan ``Fonts`` folder in data directories for ``.omwfont`` files.
2. Place the ``Fonts`` folder from archive to the configuration folder. Use :doc:`paths` article to find the folder. These files are XML files wich schema used by MyGUI. OpenMW uses files which ``name`` tag matches ``openmw.cfg`` entries:
Now Fonts folder should include ``openmw_font.xml`` file and three ``.ttf`` files. <Resource type="ResourceTrueTypeFont" name="pelagiad">
If desired, you can now delete the ``Data Files/Fonts`` directory.
It is also possible to adjust the font size and resolution via ``settings.cfg`` file:: It is also possible to adjust the font size and resolution via ``settings.cfg`` file::
@ -34,14 +48,6 @@ It is also possible to adjust the font size and resolution via ``settings.cfg``
The ``font size`` setting accepts clamped values in range from 12 to 20 while ``ttf resolution`` setting accepts values from 48 to 960. The ``font size`` setting accepts clamped values in range from 12 to 20 while ``ttf resolution`` setting accepts values from 48 to 960.
Any Resolution or Size properties in the XML file have no effect because the engine settings override them. Any Resolution or Size properties in the ``.omwfont`` file have no effect because the engine settings override them.
The engine automatically takes UI scaling factor into account, so don't account for it when tweaking the settings. The engine automatically takes UI scaling factor into account, so don't account for it when tweaking the settings.
Bitmap fonts
------------
Morrowind ``.fnt`` files are essentially a bitmap font, but using them is discouraged because they don't have 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.