Import a font

You can import fonts from ttf and otf files. Then you will be able to use the Font.Gbx files generated by the import process in your manialinks to display labels with custom fonts. Note that players will need the Font.Gbx file to display your manialink correctly, so it is recommended that you use custom fonts only inside a title pack (which includes those font files).

Importing a font is quite simple, just follow these steps

  1. Place the font file in Work folder

    The font file you want to import must have the extension .ttf, .otf or .ttc. Ttf and otf are the most commonly used font formats, you can find such files very easily on the web.

First you have to place this font file in a folder that we will call {FontFileFolder} and that must be {maniaplanet_user_dir}/Work/Media/Font or any subfolder you want.

For example, the path of your font file could be: C:/Users/Bob/Documents/ManiaPlanet/Work/Media/Font/times.ttf or C:/Users/Bob/Documents/ManiaPlanet/Work/Media/Font/FontPack1/times.ttf

  1. Create the xml file

    To import a font, you must create a .xml file describing how to import it. Create a new empty file and name it {FontName}.xml, where {FontName} is the name that will be used in manialinks. It is often a good idea to use the same name as the original font file but you don't need to.

Then place this file in {XmlFileFolder}, that must be {maniaplanet_user_dir}/Work/Media/Font or any subfolder you want. It is recommended to use the same folder as {FontFileFolder}, but you can use another if you want.

Finally, open the file and fill it with this single line: <Font File="{FontFilePathRelativeToXmlFolder}"/>, where {FontFilePathRelativeToXmlFolder} is the complete path (with filename and extension) of the font file relative to {FontFileFolder}. You can use "../" to go to parent folder.

For example:

  • if the path of the font file is: C:/Users/Bob/Documents/ManiaPlanet/Work/Media/Font/times.ttf and the path of the xml file is: C:/Users/Bob/Documents/ManiaPlanet/Work/Media/Font/TimesNewRoman.xml then you will write: <Font File="times.ttf"/>

  • if the path of the font file is: C:/Users/Bob/Documents/ManiaPlanet/Work/Media/Font/FontPack1/times.ttf and the path of the xml file is: C:/Users/Bob/Documents/ManiaPlanet/Work/Media/Font/TimesNewRoman.xml then you will write: <Font File="FontPack1/times.ttf"/>

  • if the path of the font file is: C:/Users/Bob/Documents/ManiaPlanet/Work/Media/Font/times.ttf and the path of the xml file is: C:/Users/Bob/Documents/ManiaPlanet/Work/Media/Font/FontPack1/TimesNewRoman.xml then you will write: <Font File="../times.ttf"/>

  1. Import

    Now open a command line prompt in the {Maniaplanet_exe_dir} (the folder where you have unzipped the NadeoImporter) and then type the command :

NadeoImporter Font {XmlFileFolderPathRelativeToWorkFolder}/{FontName}.xml

where {XmlFileFolderPathRelativeToWorkFolder} is the path of the folder containing the xml file you have created in step 2, relative to {maniaplanet_user_dir}/Work folder.

This command will create several files:

  • the main gbx font file: {maniaplanet_user_dir}/{XmlFileFolderPathRelativeToWorkFolder}/{FontName}.Font.Gbx

  • one or several texture files: {maniaplanet_user_dir}/{XmlFileFolderPathRelativeToWorkFolder}/{FontName}_Textures/{FontName}_XX.dds where XX is first 00 and increases for each new texture file

For example, if the path of the xml file is: C:/Users/Bob/Documents/ManiaPlanet/Work/Media/Font/TimesNewRoman.xml then you will type NadeoImporter Font Media/Font/TimesNewRoman.xml which will create C:/Users/Bob/Documents/ManiaPlanet/Media/Font/TimesNewRoman.Font.Gbx, C:/Users/Bob/Documents/ManiaPlanet/TimesNewRoman_Textures/TimesNewRoman_00.dds and C:/Users/Bob/Documents/ManiaPlanet/Media/Font/TimesNewRoman_Textures/TimesNewRoman_01.dds

Note: If you want to put this font in one of your title packs, do not forget to include not only the Font.Fbx files but also all the textures in the related textures directory

  1. Use the font in your manialinks

    Labels have an attribute called "textfont" which enables you to use a custom font for the text to display.

  • if {FontName}.Font.Gbx was imported directly in the {maniaplanet_user_dir}/Media/Font/ folder, then just add textfont="{FontName}" in your label tag

  • if {FontName}.Font.Gbx was imported in a subfolder {maniaplanet_user_dir}/Media/Font/{SubPath}, then add textfont="{SubPath}/{FontName}

For example,

  • if the path of the gbx font file is: C:/Users/Bob/Documents/ManiaPlanet/Media/Font/TimesNewRoman.Font.Gbx then your label will be: <label pos="2 1" z-index="0" size="34 6" text="Hello world!" textfont="TimesNewRoman"/>

  • if the path of the gbx font file is: C:/Users/Bob/Documents/ManiaPlanet/Media/Font/FontPack1/TimesNewRoman.Font.Gbx then your label will be: <label pos="2 1" z-index="0" size="34 6" text="Hello world!" textfont="FontPack1/TimesNewRoman"/>