Share via


Creating a .tinyfnt Font File

Use the TFConvert tool to create a .tinyfnt font from TrueType or OpenType font files in a size and style tailored to your application.

The TinyFNT Format

The .NET Micro Framework uses the .tinyfnt file format to work with fonts. The .tinyfnt format uses a fixed-point bitmap-based font system for a simpler way to render fonts. Two sample .tinyfnt fonts are included in the Fonts subdirectory of your .NET Micro Framework installation. To create other fonts, in the size, style, and language tailored to your application, you use the TFConvert tool to create a .tinyfnt font from TrueType or OpenType font files.

Steps To Create a TinyFNT Font

To create a custom font for your application, select a TrueType font to begin with, create a font definition in a .tinyfnt file, and run TFConvert to generate the .tinyfnt file from the font definition.

Selecting a TrueType Font

The .NET Micro Framework SDK provides a set of sample OpenType fonts that you can use in creating and distributing applications for the .NET Micro Framework. The fonts are located in the \Tools\Fonts\TrueType subdirectory of your .NET Micro Framework installation.

The sample fonts are supplied under license from Ascender Corporation. These fonts support a small character set that is a subset of the full font available from Ascender. The following list contains the names of the sample OpenType fonts, with the name using the corresponding font.

Ee436565.includedfonts(en-us,MSDN.10).gif

Figure 1.  The names of sample fonts

Ascender is a provider of advanced font products specializing in font design, development, and licensing. To license extended or custom versions of the sample fonts please contact Ascender Corporation directly via their Web site http://www.ascendercorp.com

Creating a Font Definition

Once you have identified a TrueType font file to import from, you create a font definition file. The font definition file, a text file with the .fntdef extension, specifies the TrueType font to import from, the range of characters to import, and other options. The .fntdef file contains one option on each line. The TFConvert References contain details on the options that make up a .fntdef file.

At a basic level, a .fntdef file must contain a SelectFont option and an option to import a range of characters. The following example shows a font definition for importing code points 65 to 90 from the sample Miramonte font. The path in the AddFontToProcess statement should be modified to match the location of the Miramonte font on your installation of the .NET Micro Framework.

        AddFontToProcess "C:\\Program Files\\Microsoft .NET Micro Framework\\v2.0.3036\\Tools\\Fonts\\TrueType\\Miramo.ttf"
        SelectFont “WE:400,FN:Miramonte”
        ImportRange 65 90
      

Running TFConvert

Pass the path to the font definition file you created and the name of the .tinyfnt file to generate as command line arguments to TFConvert.

Location

The TFConvert tool can be found in the Tools subdirectory of your .NET Micro Framework installation. For example,

C:\Program Files\Microsoft .NET Micro Framework\v2.0.3036\Tools

Usage

To invoke TFConvert from the command prompt, use the following form:

TFConvert <input file> <output file>

The input file argument is the path of the font definition file. It must have the .fntdef extension.

The output file argument is the path of the TINYFNT font that you wish to create. It must have the .tinyfnt extension.

Example

TFConvert miramonte.fntdef miramonte.tinyfnt