Knowledge Base

fontmake.exe is a utility for creating font files that can be used with the HMI430.

Fontmake runs from the Windows command line.  It will convert any TrueType or OpenType font into a “.fon” file that holds one size of the specified font.  Thus you will need to create a separate file for each size you require.

To use the .fon files created by fontmake, drag them to the Internal Storage folder in your controller, then use SetFont() to display text using the font.  Ensure the full length (including the extension) of the .fon file name remains under 32 characters.

These font files will not work on SimpleHMI for Android or Windows, they can only be used on SPLat touch screen controllers.

Arguments

fontmake takes the following arguments:

   fontmake.exe -s nn [-o output_file] [-m charmap_file] [-h] [-v] [-n] input_font_file

Where:

  • [] parameters are optional.
  • {} either of these parameters is required.
  • -s nn = Size of the font which equates to it’s height in pixels.
  • -y = Make Y advance same as text height (typically larger line spacing, but ajacent lines won’t overwrite each other).
  • -o = Output directory and/or file name.  Defaults to current directory and input file name with size & .fon (or .c) extension.
  • -m = Character map file.  This lists all the characters that should be included in the font file.  If no map file is specified, then the ASCII charset will be created, unless the -n option is used.  Specify this option alone to display a charmap_file template.
  • -h = Display help.
  • -v = Verbose, display messages.
  • -n = Output numbers only to save space (no letters)
  • -e = Show error codes.

Example

   fontmake.exe -s 12 -o ../fonts/ "/Windows/Fonts/arial.ttf"

Creates ../fonts/arial_12.fon.  Drag this file to the Internal Storage folder in your controller, then use #HMI SetFont( “arial_12.fon” ) to display text using the font.