Location: Main > Module Types > View Module Type

Font Module

Engine Module Type StringFont
Module Type UsageMultiple Type


Font Modules enable the Drag[en]gine to load a Font from a file or to save a Font to a file. Font modules are Multiple Type Modules hence you can install more than one Font module at the same time. Launchers typically search missing Font modules for you so you have only those installed that your games really use.

Module Developer Informations

Font resources store informations required to render various types of text inside a game. Font resources are based on image type fonts hence an image source is required. As the source of the image any Image or Skin resource can be used. The font with and font height properties define the largest width and height found amongst all glyphs. The isColor property indicates if the font can be colorized or not. If this property is set to true the image source is first multiplied by a chosen text color. Therefore images for such fonts are gray scale and contain white where the color goes.

If a Skin resource is used the Texture to use is indicated by the set texture name. To use a skin set the path to the skin and the name of the texture to use. The engine loads the Skin resource automatically afterwards. If a skin path is set no image path have to be set at the same time. Using a skin as image source allows for dynamic texts.

To use a simple image as the image source set at least the basic image path. The basic image path is defines the Image resource to use as the font color. In addition a masc image path can be set which contains indicates a gray scale Image resource to use as the alpha masc. If at least one image path is set no skin path has to be set at the same time. Using an image as image source provides static text.

For every glyph in the font there is one glyph object. The number of glyphs is limited to the glyph space of the unicode character set. The index of each glyph is at the same time the value of the corresponding unicode character ( NOTE: Currently this is limited to 256 characters and will be changed in the near future ). Every glyph defines the rectangle to use from the image source in pixels. The size of the glyphs are not required to be the same.

Font modules contain only two functions one for loading a font from a file and the other for saving a font to a file. There are no additional informations stored otherwise.

See the following classes to get started with Font modules:

Notes: The definition of the Font resource is not final yet and will change until the release.