Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView (Read 5755 times)
Selvam
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 8
Joined: Oct 13th, 2021
Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Oct 20th, 2021 at 9:48am
Print Post  
Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView

Kindly suggest/provide solution to how to define Chinese language in the node text.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3373
Joined: Oct 19th, 2005
Re: Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Reply #1 - Oct 20th, 2021 at 11:37am
Print Post  
This works in my test with default font.

Code
Select All
void TestChinese(Diagram diagram)
{
    var node = diagram.Factory.CreateShapeNode(20, 20, 30, 30);
    node.Text = " 题";
} 



Have you set some specific font as property of nodes or styles?

Regards,
Slavcho
Mindfusion
  

Untitled_024.png (Attachment deleted)
Back to top
 
IP Logged
 
Selvam
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 8
Joined: Oct 13th, 2021
Re: Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Reply #2 - Oct 25th, 2021 at 11:17am
Print Post  
we are using by suggested code but it displays like some character [Refer Attachment1].

If we are using below code then it will be displayed as exact character [Refer Attachment2]. but while downloading as PDF the same text is not displayed [Refer Attachment3].
startNode.EnableStyledText = true;
startNode.PolygonalTextLayout = true;

Kindly suggest for this
  

Attachments.zip (Attachment deleted)
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3373
Joined: Oct 19th, 2005
Re: Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Reply #3 - Oct 25th, 2021 at 12:41pm
Print Post  
Try either setting the NoFontFallback flag in nodes' TextFormat.FormatFlags to zero, or explicitly setting Font to one that contains Unicode characters.

For PDF see https://mindfusion.eu/Forum/YaBB.pl?num=1277702629/10#10

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Selvam
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 8
Joined: Oct 13th, 2021
Re: Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Reply #4 - Oct 27th, 2021 at 7:05am
Print Post  
Hi Slavcho,

I think still we are missing something to get exact text while downloading.
we have used be code and diagram displays like ?? in downloaded PDF.

AutoDetectEncoding = false,
DefaultEncoding = System.Text.Encoding.Default

Still we are facing issue refer the attached PDF.jpg
  

PDF.png (Attachment deleted)
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3373
Joined: Oct 19th, 2005
Re: Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Reply #5 - Oct 27th, 2021 at 7:46am
Print Post  
Hi,

Quote:
DefaultEncoding = System.Text.Encoding.Default


Have you tried Unicode encoding as in post linked above?

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Selvam
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 8
Joined: Oct 13th, 2021
Re: Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Reply #6 - Oct 27th, 2021 at 11:17am
Print Post  
Hi Slavcho,

Question mark value is displayed when using Encoding.Default code [Ref Att1.png]

Empty value is displayed when using Encoding.Unicode code [Ref Att2.png]

  

Att1.png (Attachment deleted)
Att2.png (Attachment deleted)
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3373
Joined: Oct 19th, 2005
Re: Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Reply #7 - Oct 27th, 2021 at 3:35pm
Print Post  
What happens if you remove the encoding properties? They might not be needed after you fixed on-screen rendering.

Code
Select All
diagram.Factory.CreateShapeNode(10, 10, 40, 40).Text = "地狱其他凝胶";
var pdfex = new PdfExporter();
pdfex.Export(diagram, @"D:\test.pdf"); 



With that I'm seeing Chinese text in both Firefox and Edge, while Adobe Reader asks to download a font pack. On what OS are you seeing missing fonts? I believe that's what the question marks indicate.

Regards,
Slavcho
  

Untitled_025.png (Attachment deleted)
Back to top
 
IP Logged
 
Selvam
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 8
Joined: Oct 13th, 2021
Re: Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Reply #8 - Oct 28th, 2021 at 8:41am
Print Post  
we are using Windows 10 Pro OS

Is required to install Chinese font?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3373
Joined: Oct 19th, 2005
Re: Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Reply #9 - Oct 28th, 2021 at 9:12am
Print Post  
You might need fonts both on server side for PdfExporter to use and on client side for PDF readers. Does attached PDF render correctly for you? Please attach your PDFs generated with and without encoding overrides and I will check them on my system.

Regards,
Slavcho
  

test_003.pdf (Attachment deleted)
Back to top
 
IP Logged
 
Selvam
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 8
Joined: Oct 13th, 2021
Re: Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Reply #10 - Nov 8th, 2021 at 4:39pm
Print Post  
Hi Slavcho,

I have attached the sample code. PFA

Refer PDF under the temp folder which is not displayed exact char what is used in the application.

Kindly refer the code and suggest us.
  

SampleWebSite.zip (Attachment deleted)
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3373
Joined: Oct 19th, 2005
Re: Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Reply #11 - Nov 10th, 2021 at 9:01am
Print Post  
Hi,

PDF generated on our side with default AutoDetectEncoding = true value looks correct. Does attached file render Chinese glyphs for you?

Code
Select All
var pdf = new MindFusion.Diagramming.Export.PdfExporter
{
    PageSize =
        (PageSize)
            Enum.Parse(typeof(PageSize), diagramSize, false),
    Margins = { Bottom = 2, Top = 2, Left = 2, Right = 2 },
    InvisibleItems = true,
    AutoScale = MindFusion.Diagramming.Export.AutoScale.FitToWidth,
	//DefaultEncoding = System.Text.Encoding.Unicode,
	AutoDetectEncoding = true
}; 



If AutoDetectEncoding = true generates a different PDF for you, please attach it and our developer will compare with ours to investigate what might be going wrong. From what we can tell, the PDFs from your temp folder were generated with auto-detect disabled.

Regards,
Slavcho
  

db18b624-388d-414e-8099-83ac2f1fc712_E.pdf (Attachment deleted)
Back to top
 
IP Logged
 
Selvam
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 8
Joined: Oct 13th, 2021
Re: Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Reply #12 - Nov 24th, 2021 at 11:20am
Print Post  
Hi Slavcho,

While opening the PDF which attached by you in this thread it will display font package required notification in Adobe. and same issue exist with viewing in chrome browser

Refer the attach-1 and after clicked ok refer the attach-2
  

attach-1.png (Attachment deleted)
attach-2.png (Attachment deleted)
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3373
Joined: Oct 19th, 2005
Re: Chinese language is not supported in MindFusion.Diagramming.WebForms.DiagramView
Reply #13 - Nov 24th, 2021 at 4:51pm
Print Post  
Adobe's font pack page was working for me the other day, and the PDF shows on my side after installing from there; maybe try updating your PDF Reader version in case they've obsoleted some URL used by old ones.

As for Chrome, it might be falling back to fonts without glyphs if it can't find the actual ones from the PDF file. Try opening the PDF in notepad and look for /FontName PDF tags. It should render correctly when you have these fonts installed on client's OS.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint