question

yuan zhang avatar image
0 Likes"
yuan zhang asked jing.c commented

Chinese fonts does not show correctly

Dear all,

There are many Chinese fonts in the Object "Text" does not show correctly, I tried to update the windows font, but did not completely solve this problem.Our users want to display in Chinese, is there any way to solve this problem? Or is there any font that you can provide me?

Thanks.

FlexSim 16.1.2
chinese fonts
20170511165206.png (164.3 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Phil BoBo avatar image
2 Likes"
Phil BoBo answered jing.c commented

FlexSim's 3D text renderer reads the contours from the font file and does its best to tessellate those outlines into 3D shapes. As you noticed, some Chinese characters do not appear correctly.

You could instead use the drawflattext() command in an object's Custom Draw trigger to draw text in the 3D view. That command converts the font glyphs into pixelated textures instead of triangle-tessellated 3D shapes.

· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

jing.c avatar image jing.c commented ·

Hi,Bobo. Thanks for your reply.

My computer can not show any Chinese character normally. I had tried a lot of methods to solve it, including reinstall the system, update the graphics card, and so on. But fails.

No matter which version of FlexSim I use(including V2017.1.2), it can not show Chinese character(well it can show the English correctly). As I know, Some Chinese users have the same problem.

Learning from your answer, I try to use drawflattext() to solve it. However not quite understand about using drawflattext(). Could you please give me an example?

1 Like 1 ·
flattext.png (59.8 KiB)
chinesefontpng.png (42.4 KiB)
Phil BoBo avatar image Phil BoBo ♦♦ jing.c commented ·

For Chinese characters to be displayed in the 3D view, you need to ensure that you have the Arial Unicode font installed in Windows. The file that FlexSim uses is C:\Windows\Fonts\arialuni.ttf

Also, you need to ensure that the "Language for non-Unicode programs" is set to Chinese in the Windows Region dialog. This is required for rendering non-ASCII characters with drawflattext() or in the object names. Prior to 17.1, this was also required to draw 3D text with Chinese characters.

The documentation for drawflattext() has example code in it:

if (!param(2)) {
	setdrawnamefunction(80, 15, c, param(1), 1);
} else {
	fglTranslate(-40, -15, 0);
	drawflattext("暂存区");
}

2 Likes 2 ·
chinese-text2.png (234.6 KiB)
region-setting.png (19.1 KiB)
arialuni.png (94.3 KiB)
jing.c avatar image jing.c Phil BoBo ♦♦ commented ·

Thanks a lot !!! It solve the problem which trouble me for a long time.

By the way, example code of drawflattext() only shows in Version2017 or further.

0 Likes 0 ·