Dear Aspose team,
We have the problem that we cannot figure out how to set a specific font, that is not the document default to a piece of text.
We downloaded the sample codes from github: https://github.com/aspose-diagram/Aspose.Diagram-for-.NET
and we used the sample ApplyFontOnText.cs. This code always applies the font value 4, which corresponds to the Calibri, default font, and in this particular case everything works fine.
We wanted to have a piece of text with a different font, Wingdings, that has ID=3 in the Fonts list of the document. So we changed one line in the sample code.
// Just a little modification. We would like to have another font here (the “Wingdings” font -> ID = 3).
shape.Chars.Font.Value = 3;
The result is that output saved by the code shows three problems:
- The font of the text belonging to the given formatting shows in Calibri, and not in Wingdings.
- When we edit the respective shape, the dorpdown on the ribbon of Visio, that should show the font of the text is blank.
- All the text that comes after the one with the problematic font is squashed, the letters are on top of each other. When the shape is edited, then they show as one-pixel smudge.
I am attaching a small zip with the code file for convenience and a pdf file showing the issues we have.
Sample code and output vsdx: samples.zip (45.9 KB)
Pdf showing the problems: ApplyFontOnText_Out opened in Visio2013&Visio2016.pdf (1.7 MB)
The issue is present if we open the output file either with Visio 2016 or 2013.
This is a quite blocking issue for us. If you could provide any workaround or a quick fix for this, that would be highly appreciated.