How-to: use UTF-8 characters with Navigation Cube

In this article we detail how to replace the HOOPS Visualize Navigation Cube labels with UTF-8 characters. This will be useful to write labels in Cyrillic, Chinese, Japanese, Korean or to use any other wide size characters.

Make sure the source code file is encoded to UTF-8 without BOM

  • Any advanced text editor, such as Notepad++ will let you save a file with the desired encoding.
  • Example:
    • In Notepad++ go to Encoding menu
    • Select UTF-8
    • Save the file

Make sure to select UTF-8 without BOM. Depending on the software it may be called by other name:

  • UTF-8
  • UTF-8 sans BOM
  • UTF-8 without BOM

Identify a fond in the system corresponding to the language you want to use

You will need to set the font for the Navigation Cube to display correctly the labels.

Here is a list of default UTF-8 Windows font: Typography in Windows apps - Windows apps

Use the NavigationCubeControl to customize the cube

Code snippet example

  • Replacing labels with Korean characters.
  • Malgun Gothic is user-interface font for Korean.
GetCanvas().GetFrontView().GetNavigationCubeControl().SetText(
		"안녕 ", "안녕 ", "안녕 ",
		 "안녕 ", "안녕 ", "안녕 ",
		 TextAttributeKit().SetFont("Malgun Gothic"));

image-20210430-090443