Hello Jeff,
We are so sorry for the late reply. This is Abel from E-iceblue support team.
1. The image you showed was opened on your host machine or in container ?The image was opened in my host machine (win-10 64-bit).
2. Is it successful to see my expected result on your container ?
I used the following code (“code1” and “code2”) to test your scenario in linux system (CentOS release 7.9.2009)
When I set font name to “文鼎標楷注音” in “code1”, the font name is correctly shown but the font(文鼎標楷注音) isn’t applied to the content of result document(result1.doc).
when I used the MS Office365 to open the result document in my host machine.
In addition, when I set font real name to “Bpmf GenRyu Min R” in “code2”, the font name is correctly shown and the font is successful applied to the content of result document (result2.doc)
Ps: (1) I used MS Office365 to open the result document in my host machine.
(2) I have attached the result document.
code1:
- Code: Select all
Document doc = new Document();
Section sec = doc.AddSection();
Paragraph par = sec.AddParagraph();
doc.PrivateFontList.Add(new PrivateFontPath(@"文鼎標楷注音", @"BpmfGenRyuMin-R.ttf"));
doc.EmbedFontsInFile = true;
CharacterFormat format = new CharacterFormat(doc);
format.FontName = @"文鼎標楷注音";
format.FontSize = 50;
format.Bold = true;
//Paragraph par1 = textBox.Body.AddParagraph();
par.AppendText("哈哈哈").ApplyCharacterFormat(format);
doc.SaveToFile(@"result.doc", FileFormat.Doc);
code2:
- Code: Select all
Document doc = new Document();
Section sec = doc.AddSection();
Paragraph par = sec.AddParagraph();
doc.PrivateFontList.Add(new PrivateFontPath(@"Bpmf GenRyu Min R", @"BpmfGenRyuMin-R.ttf"));
doc.EmbedFontsInFile = true;
CharacterFormat format = new CharacterFormat(doc);
format.FontName = @"Bpmf GenRyu Min R";
format.FontSize = 50;
format.Bold = true;
//Paragraph par1 = textBox.Body.AddParagraph();
par.AppendText("哈哈哈").ApplyCharacterFormat(format);
doc.SaveToFile(@"result.doc", FileFormat.Doc);
Sincerely
Abel
E-iceblue support team
Login to view the files attached to this post.