This page has been translated automatically.
Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Core Library
Containers
Engine Classes
Node-Related Classes
Rendering-Related Classes
Physics-Related Classes
Bounds-Related Classes
GUI-Related Classes
Controls-Related Classes
Pathfinding-Related Classes
Utility Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

ImageTTF

ImageTTF is a console tool for converting a *.ttf font file into a texture.
This tool is handy if a text that uses a font is dynamically resized in case of limited memory resources (for example, mobile devices). In case of using a converted texture the memory footprint is significantly lower.

To invoke ImageTTF, run imagettf_x86.exe (in Windows) or imagettf_x86 (in Linux) from a command-line console (the 64-bit version has x64 postfix).

Command Line Options

ImageTTF tool receives a TTF font and outputs a texture with 16×8 slots for symbols. It recognizes the following command line options:

  • -o NAME — name of the output file.
  • -s SIZE — size of the slot available for a character or a number (in pixels). This option determines the size of the output texture. The default is 16 pixels.
  • -f SIZE — size of the font (in pixels). If a symbol is too big to fit into the slot, it will be cut. The default is 12 pixels.
  • -e EXTENSION — extension for the output texture file. The default is PNG.

Output Texture Formats

The following image formats are supported for the output texture:

  • Direct Draw Surface (DDS)
  • Portable Network Graphics (PNG)
  • PhotoShop Document (PSD)
  • JPEG (JPG)
  • Targa (TGA)

Usage

The syntax for Windows is:

Shell commands
imagettf_x86.exe OPTIONS font.ttf

The syntax for Linux is:

Shell commands
imagettf_x86 OPTIONS font.ttf

Type of an output file is determined based on its extension (see the -o option).

Examples

The following creates a texture named texture.dds from my_font.ttf file:

Shell commands
imagettf_x86.exe -o texture.dds -s 34 -f 14 font.ttf
Last update: 2017-07-03
Build: ()