MPLAB® Harmony Graphics Suite
|
The Font Assets window is launched from the Graphics Composer’s Asset menu.
![]() |
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): .
There are five icons on the toolbar below the Images tab:
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:
If the glyphs are not available they will be rendered as rectangles ( ).
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.
![]() |
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.
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
|