Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Cannot display Chinese texts (Read 5620 times)
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
Cannot display Chinese texts
Nov 8th, 2016 at 3:34pm
Print Post  
Hi,
I would like to know how can we support Chinese texts in the Cell.
See attachment
  

AttachFileHandler.png ( 83 KB | 189 Downloads )
AttachFileHandler.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Cannot display Chinese texts
Reply #1 - Nov 8th, 2016 at 4:59pm
Print Post  
Hi,

Make sure you are using fonts that contain Chinese glyphs. The diagram's default Font value "Arial" does not contains them and draws placeholders. Set some Unicode fonts and the texts should show -

Code
Select All
TableNode t = diagram.getFactory().createTableNode(10, 10, 20, 30, 1, 3);
t.getCell(0, 0).setFont(new Font("Arial", Font.PLAIN, 4)); // this one does not render correctly
t.getCell(0, 0).setText("测试");
t.getCell(0, 1).setFont(new Font("MingLiU", Font.PLAIN, 4));
t.getCell(0, 1).setText("测试");
t.getCell(0, 2).setFont(new Font("Arial Unicode", Font.PLAIN, 4));
t.getCell(0, 2).setText("测试"); 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
Re: Cannot display Chinese texts
Reply #2 - Nov 11th, 2016 at 11:17am
Print Post  
Thanks for the reply. Adding the Font to TableNode works, but adding it to the Cell overlaps the characters for some reason. (Tried with Arial Unicode).
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Cannot display Chinese texts
Reply #3 - Nov 11th, 2016 at 11:29am
Print Post  
Cells draw text using table's font when their own isn't set, so there shouldn't be any difference if you assign same font. Do you mean characters in same cell overlapping each other, or a cell's text overflowing to next one and overlapping neighboring cells' text?
  
Back to top
 
IP Logged
 
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
Re: Cannot display Chinese texts
Reply #4 - Nov 14th, 2016 at 10:21am
Print Post  
Yes, the characters in the same cell overlaps with each other when I set the Arial Unicode Font to Cell. For now, adding the same Font to TableNode works (which is enough for my requirement), but there is a potential of a bug here.

PS: I have numbers and Chinese Text in the same row of the Cell. I dont know if this matters because even removing numbers caused overlap.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Cannot display Chinese texts
Reply #5 - Nov 15th, 2016 at 10:26am
Print Post  
I could not reproduce overlapping glyphs. What diagram.MeasureUnit and font.Size values are you using, and could you post the exact string, or attach a saved diagram xml file?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint