Font Substitution while Visio Diagram to SVG Conversion in Java

Hi,

We’re using setFontDirs in Aspose Diagram Java 22.2 to set a set of directories containing fonts for conversion of Visio files to SVG. The font directories all exist and contain various ttf font files. However, the fonts either are not being picked up or incorrectly substituted.

We’ve tried to use the IWarningCallback mechanism to report on WarningType.FONT_SUBSTITUTION events, but nothing seems to be logged.

I have attached the source code we’re using.

vsdx-to-svg.zip (3.6 KB)

Is it possible to report on what the font substitutions are, what fonts are being found and whether it’s possible to manually set the font to font file mappings?

Regards
Vittal

@vittala

Can you please also share the sample Diagram file for our reference so that we can further proceed to address the issue accordingly?

Hi @asad.ali

Attached is a zip containing Font-testcase.vsdx (the source file) and the result of conversion (Font-testcase.svg). It was converted on a mac with:

java -jar vsdx2svg.jar -i Font-testcase.vsdx -o Font-testcase.svg -f ~/Library/Fonts/ -f /Library/Fonts

Archive.zip (93.9 KB)

@vittala

An investigation ticket as DIAGRAMJAVA-50883 has been logged in our issue tracking system for the sake of further analysis on this case. We will look into its details and keep you posted with the status of ticket resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as DIAGRAMJAVA-50883) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou

Thanks - this change now allows us to see where font substitutions have failed, but is there any mechanism to see why they’ve failed. We’re using setFontDirs to set font paths that contain ttf files, but they don’t appear to be being mapped correctly.

@vittala

Thanks for your feedback. We have recorded it under the earlier logged ticket and will let you know as soon as we have related information to share with you.

Thanks. Ideally we’d like to be able to see which fonts have been found, which ones haven’t and manually set up mappings from a missing font to a known font.

@vittala

Would you please provide the information of font substitution? We will check it.

Also please try this code:

com.aspose.diagram.FontConfigs.setFontFolder("C:/font/", false);