MPLAB® Harmony Graphics Suite
|
The String Table Configuration 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.
|
Within this window, the Languages supported by the application are defined and the encoding for all application glyphs selected.
The “ID” string used for each language is merely for ease of use in building the texts to be used. “English”, “American”, or any other string can be used to identity that language, as long as it is understood by the application’s creator when selecting the text to be used for that particular language. Then the application can switch to supporting one of its languages using “ID” strings defined.
Here is an example string asset definition, taken from the Aria Coffee Maker demonstration. This application supports English, French, Italian, and German. The text string “InfoText_Desc9” uses the Arial font, and text for each language is specified within the String Assets window.
Any number of languages can be defined as long as there is memory to store the strings needed.
The following figure shows the String Table Configuration for an application that uses English, Spanish, and Chinese.
The size of all the strings for each language is shown in the Size column. String size represents the memory allocated for glyph indices for all the strings supporting that language. A language can be enabled/disabled via the check box in the Enabled column. Disabling a language removes it from the application build but keeps it in the project.
There are three icons on the toolbar:
Clicking Add New Language opens a new line, allowing the user to select and edit the new language’s “ID” string.
Then, for every string defined in the application there will be a line to define the needed text, and to specify the font to be used.
If a value is not provided for the new language the string will be output as a null (empty string). If a Font selection is not provided then the string will be output as a series of blocks (?).
The Aria User Interface Library primitive, LIB_EXPORT void laContext_SetStringLanguage(uint32_t id), allows the application to switch between languages using the Language ID #defines are specified in the application’s gfx_assets.h file.
There are two sub-tabs to this window.
Language Definitions Sub-tab
This sub-tab shows the languages defined for the application. A Language can be enabled/disabled to include or exclude it from the application’s generation/regeneration under MPLAB Harmony Configurator (MHC). New languages can be added by specifying a text string for the language. With a new language, go to the String Assets window to specify the text and fonts for all defined strings.
Encoding Sub-tab
Selecting the Character Encoding Format Selection Dialog icon gives you three choices for how the characters in all strings in the graphics application are encoded:
The default is ASCII. It is typically the most efficient in terms of memory and processing, but it does not support as many glyphs. Chinese text should be encoded in UTF-8 or UTF-16, but Western language text can be encoded in ASCII to save memory. The trade-off between ASCII, UTF-8, and UTF-16 depends on the application. Changing from UTF-8 to UTF-16 will double the size of all strings in the application. This is because the sizes of all glyph indices double in size. (String sizes are the sizes of glyph reference indices, not the size of the particular font glyphs used to write out the string.)
The memory utilization resulting from an encoding choice can be seen in the Summary sub-tab of the Memory Configuration window.
MPLAB® Harmony Graphics Suite
|