VisualHMI Multilingual and Font Library: Switching between 30 languages, font library tailoring, and string ID maintenance rules

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

The multi-language solution for VisualHMI is quite convenient:one set of UI, multiple language entries, and one register for switching. There's no need to create a separate interface for each language. This article thoroughly explains the maintenance of font libraries, text labels, and string IDs - the final section on "String ID Maintenance" is the most common pitfall after equipment shipment, so be sure to read it through.

1. How does multi-language work?

Core idea: Don't hardcode the text on the UI, use control referencesto language entries; configure the number of languages in the project properties (up to 30); set themulti-language system registerat runtime, and switch all entries with one click.

VisualHMI Multilingual and Font Library: Switching between 30 languages, font library tailoring, and string ID maintenance rules插图

The multi-language feature depends on whether the characterfont library (*.ttf vector font library). If the font library does not contain this character, switching to that language will display squares/blank spaces. The system's built-in font libraries are all free of charge, so be careful with copyright when adding your own font libraries.is included in the

2. Font Management

2.1 System-Built Fonts

The software comes with 5 built-in fonts:

FontContent
DroidSans.ttfOnly containing alphanumeric characters
DS-DIGIB.ttfDigital tube style, uppercase letters, numbers
fangsong_GB2312.ttfFangsong, supports both Chinese and English
songti_GB2312.ttfSong typeface, supports both Chinese and English
wqyMicroHeiMono.ttfWenquan default font library, supporting Chinese/Traditional Chinese/English/Russian/French/Japanese/Korean/Portuguese/Spanish/German/Italian, preferred for multiple languages

VisualHMI Multilingual and Font Library: Switching between 30 languages, font library tailoring, and string ID maintenance rules插图1

2.2 Add font library

Click "Add" in Font Library Settings → select the ttf file. The new font library will create a new font folder under the project directory and place the file inside.

VisualHMI Multilingual and Font Library: Switching between 30 languages, font library tailoring, and string ID maintenance rules插图2

Naming of added font library file: composed of letters, numbers, -, _, with a length not exceeding32 characters.

2.3 Replace font library

The font displayed by the control is associated with the index. Replace Arabic.ttf with wqyMicroHeiMono: change the Arabic index to 0 and uncheck wqy.

VisualHMI Multilingual and Font Library: Switching between 30 languages, font library tailoring, and string ID maintenance rules插图3

After replacing the original font library with the newly added font library,you need to save the project and reopen itfor the editing interface to refresh and display.

2.4 Delete font library

The system's built-in font library cannot be deleted; user-added font libraries can be deleted.

VisualHMI Multilingual and Font Library: Switching between 30 languages, font library tailoring, and string ID maintenance rules插图4

2.5 Font Pruning (to save Flash space)

VisualHMI integrated font cutting tool: [Project] → [Font Cutting]. Select the font to be cut → Load the character set to be retained (txt must be UTF-8 encoded) → Start cutting, generating xxx_cut.ttf.

VisualHMI Multilingual and Font Library: Switching between 30 languages, font library tailoring, and string ID maintenance rules插图5

The new version also supportsProject Character Pruning: Automatic pruning when compiling and generating download files, with four modes:

ModeEffect
DisabledDo not prune, retain complete font
Project CharactersOnly retain characters used in the project
Project Characters + GB2312Engineering characters + all characters encoded in GB2312
Engineering characters + GBKEngineering characters + all characters encoded in GBK
⚠️ Pitfalls of cropping:Text dynamically received through serial ports and strings set during LUA script runtime are not included in the cropped character set, and will not be automatically incorporated into the cropped font library. During runtime, they may display as unreadable characters/squares. Before using the cropping function, explicitly add all characters that may be dynamically displayed to the reserved character set.

3. Text labels (correct way to open multiple languages)

Text labels = a container for terms, containing translations in all languages. Controls reference the same text label, making changes in one place effective across all languages, without having to repeatedly write text.

Open the management window through the menu bar [Text Label], which supports adding, modifying, deleting, exporting, and importing.

VisualHMI Multilingual and Font Library: Switching between 30 languages, font library tailoring, and string ID maintenance rules插图6

3.1 Add text labels

Click "Add", the default name is "text1", which can be changed to a meaningful name (such as "Temperature Setting"). Fill in the translations for each language in the corresponding language column.

VisualHMI Multilingual and Font Library: Switching between 30 languages, font library tailoring, and string ID maintenance rules插图7

3.2 Edit in Excel

Click "EXCEL Edit" to open the label in a table format for direct editing. Save and close, then return to the text label window for confirmation.

VisualHMI Multilingual and Font Library: Switching between 30 languages, font library tailoring, and string ID maintenance rules插图8

3.3 Export/Import

Supports exporting to xml, csv, xlsx for modification and subsequent import. Suitable for batch translation and multi-person collaboration.

4. String ID Maintenance (Most Important After Shipment, Must Read)

Afinal string tableis generated during compilation. String sources:

  • Text in the text label table: actively maintained by the user, each entry has a fixed ID, referenced with$(such as$温度设定)
  • directly filled text: text directly written in the control, automatically added to the end of the string table during compilation (no fixed ID))
  • Alarm configuration string: Alarm content. If referenced by$, use a fixed ID; if filled in directly, the

key will be automatically appended. Note: Historical records do not save text, only string IDs:

历史记录 = 时间 + 字符串ID
操作记录 = 时间 + 操作字符串ID + 值变化
告警记录 = 告警时间 + 告警字符串ID

. When displaying history, the device uses the saved ID to look up the text in the string table of thecurrent version. Therefore, the string table is adictionary of explanations for historical data-- once published, the meaning of the ID cannot be changed.

VisualHMI Multilingual and Font Library: Switching between 30 languages, font library tailoring, and string ID maintenance rules插图9

⚠️ Example: In the original version, "150 = Set temperature modification", the device records an operation record "2026-05-11 10:20:30 Set temperature modification 20 -> 25". If the subsequent project changes 150 to "Fan mode modification", the same record will be displayed as "Fan mode modification 20 -> 25" -- the meaning is completely wrong.

5. String ID maintenance rules (follow them to avoid errors)

  1. Text that must be saved by the device must use fixed text label IDs: Operation record content, parameter description, text referenced in historical records, alarm content
  2. Published IDs cannot be deleted: Even if this item is no longer used, the original ID should be retained
  3. Published IDs cannot be reused: Old IDs cannot be assigned to new content
  4. Published IDs cannot change meaning: Typos can be corrected and translations can be added, but "Set temperature modification" cannot be changed to "Fan mode modification"
  5. IDs that are no longer used should be retained in place: Mark as obsolete/Reserved/Deprecated, but do not delete
  6. New content should only use new IDs: Append unused IDs from the beginning
  7. Do not rely on automatically appended string IDs: Text filled in directly is only suitable for display on the current version interface and is not suitable as a reference basis for historical records.
  8. Check string table compatibility before upgrading.: Compare the new and old versions to confirm that the meaning of the published IDs has not changed.
  9. Establish a string ID maintenance table.: Record the purpose, Chinese and English versions, enabled status, and first usage version of each ID.

Organized from Guangzhou Dacai Technology VisualHMI development documentation (hmi-doc.gz-dc.com) resource introduction "Multi-language (Font Library, Text Labels)", copyright owned by Dacai Technology.

Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.