From b60d14d43438b3a270921a82fa8508d6f7046fee Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Mon, 18 Jul 2022 10:38:55 +0400 Subject: [PATCH] Updated documentation --- docs/source/reference/modding/font.rst | 48 +++++++++++++++----------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/docs/source/reference/modding/font.rst b/docs/source/reference/modding/font.rst index 3778ac5ed2..d43f37340c 100644 --- a/docs/source/reference/modding/font.rst +++ b/docs/source/reference/modding/font.rst @@ -1,30 +1,44 @@ 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 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 `_). -OpenMW can load this format and convert it on the fly into something usable -(see font loader `source code `_). -You can use --export-fonts command line option 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. +They can be used instead of TrueType fonts if needed by specifying their ``.fnt`` files names in the ``openmw.cfg``. For example: + + fallback=Fonts_Font_0,magic_cards_regular + 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 -------------- -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 `_ - 2. Place the ``Fonts`` folder from archive to the configuration folder. Use :doc:`paths` article to find the folder. +In this example, OpenMW will scan ``Fonts`` folder in data directories for ``.omwfont`` files. +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. - -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:: @@ -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. -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. - -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.