MPLAB® Harmony Graphics Suite > Designer > Microchip Aria Designer > Graphics Composer Asset Management > Font Assets
MPLAB® Harmony Graphics Suite
Font Assets

The Font Assets window is launched from the Graphics Composer’s Asset menu.

Note: 
There are three dimensions to text support: Languages, Fonts, and Strings. Language “ID” strings are identified when an application supports more than one language. (In the case of single language support, the language default is provided.) Fonts are imported and organized using the Font Assets window. Strings are defined by a string name, and this name is used by widgets to reference the string. For each string and each language supported the glyphs are defined to spell out the string’s text and the font is chosen for that text.

 

The following figure shows the Font Assets window from the Aria Coffee Maker demonstration.

 

The Size (bytes): for a Font asset shows how much memory is needed to store all the glyphs used by the application from this font. For static strings MHGC determines which glyphs are used by the application’s pre-defined strings and builds these glyphs into the application. For dynamic strings (i.e. strings created during run time) ranges of glyphs are selected by the designer and these ranges are also included in the application by MHGC. The memory needed to store all these glyphs is shown by Size (bytes): .

Window Toolbar

There are five icons on the toolbar below the Images tab:

  1. Add Font From File – Adds a font asset from a file.

 

 

  1. Add Installed Font – Add a font installed on your computer.

 

 

  1. Replace Existing Font Data with New Source Font – Both Add Font From File and Add Installed Font create a new font asset. This icon allows the user to update an existing font asset, importing from a file or using a font installed on the user's computer.
  2. Rename Selected Font – Renames an existing font asset. In the example above, the Arial font was installed twice, first as a 16 point font and second as a 12 point font. If added to the fonts assets in this order, the 12 point font will have the name Arial_1. This font asset was renamed to Arial_Small using this tool.
  3. Delete Selected Fonts – Removes selected font assets from the application.
Sub-tabs

There are three sub-tabs to this window. 

Style Sub-tab  

 

 

 

The Size (bytes): shown represents the memory needed to store all the font’s glyphs. The application only stores the glyphs that are used by static (build-time) strings and by predefined glyph ranges to support dynamic (run-time) strings. 

The choices for Memory Location must be defined before the font can be assigned. Go to the Memory Configuration window to add a new location before using it in this sub-tab. 

Each font asset consists of a font, size, and some combination of the { Bold, Italic, Anti-Aliasing } options, including selecting none of these options. If bold is needed for one set of strings and italic for another, then the user will need two font assets, one with Bold checked and a second with Italic checked. The same applies for font sizes. Each font size requires its own font asset. Thus if the user needs two sizes of Arial, with plain, bold, and italic for each size, there will have to be 6 separate assets (6 = 2 Sizes x 3 ). 

Glyphs are normally (Anti-Aliasing off) stored as a pixel bit array, with each pixel represented by only one bit. Turning on Anti-Aliasing replaces each pixel bit with an 8-bit gray scale, thereby increasing font storage by a factor of 8! 

What if a font is chosen that does not support the character types of the text used for a particular language in the application? How can the user test and debug this? There a basically two ways:

  • Use an external font viewer to examine if the needed glyphs exist
  • Configure, build, and run the application and verify the strings are correctly rendered

If the glyphs are not available they will be rendered as rectangles ( ).

Strings Sub-tab

 

 

The Bound check box accomplishes the same thing as assigning a font to a text string in the Strings Assets window (Window:Strings menu). Assigning a string to a font means that the font will generate glyphs for that string. This is just another way to accomplish the binding of the string text to font. 

This sub-tab is also useful in a complicated graphics design to see how many strings use a particular font. Lightly-used or unused fonts can be eliminated to free up internal Flash memory.

Glyphs Sub-tab
Note: 
The word “glyph” comes from the Greek for “carving”, as seen in the word hieroglyph – Greek for “sacred writing”. In modern usage a glyph is an elemental or atomic symbol representing a readable character for purposes of communicating via writing. 

The Glyph sub-tab is only used when your application supports dynamic strings. For static (build-time) strings MHGC automatically determines which font glyphs are used based on the characters present in all the strings used by the application’s graphics widgets. Only these glyphs are included as part of the application’s font assets. With dynamic (i.e. run-time) strings this is not possible. This sub-tab allows you to specify which range of glyphs will be used by run-time strings. Once glyph ranges are defined, these glyphs are added to the font glyphs used by static strings. 

The Create New Custom Import Range icon ( ) allows the user to input a new glyph range for the font. Selecting this icon opens the Font Assets window.

 

 

 

NOTE:

Installing fonts already installed in your OS may produce over-aliased glyphs. It is better to using the installation source files rather than the installed files. This is especially true of fonts using non-Roman alphabets, such as Chinese, Japanese, or Korean. Here is an example:

MPLAB® Harmony Graphics Suite