Use of Font or ComplexScriptFont

Hi

We’re converting vsdx files to SVG with diagram.java.

If a shape has different font and complex script fonts set, the complexscriptfont seems to always be used in preference to the actual font. So, if I have both fonts in my font directory, the wrong font is being used in the generated SVG.

Is there any way to ensure the Font is used rather than ComplexScriptFont?

Cheers
Vittal

test-font.vsdx.zip (18.5 KB)
The attached zip contains test-font.vsdx. This has a block using “Russo One” for a font, another block using “PT Sans”. If I convert to SVG with a font directory containing Arial, Russo One and PT Sans, all the blocks appear in Arial. If I have just Russo One and PT Sans in the font directory, all the text is in PT Sans and if I just have Russo One in the font directory, all the text is in Russo One.

This is really vexing!

Regards
Vittal

@vittala

Thanks for contacting support.

Would you please share the complete sample code snippet that you are using to convert .vsdx to .svg. It would help us testing the scenario in our environment and address it accordingly. Also, please share which platform (.NET/Java) you are using the API in.

Hi

This is with diagram.java 19.1 on linux and MacOS X:

    Diagram vsd = new Diagram(file);
    // Set up any font directories
    String[] fonts = line.getOptionValues("fontdir");
    if (fonts != null && vsd != null) {
        vsd.setFontDirs(fonts);
    }
    SVGSaveOptions saveOpts = new SVGSaveOptions();
    saveOpts.setQuality(100);
    if (line.hasOption("page")) {
        int optSheetIdx = Integer.parseInt(line.getOptionValue("page", "1")) - 1;
        if (optSheetIdx < vsd.getPages().getCount()) {
            saveOpts.setPageIndex(optSheetIdx);
        }
    }
    saveOpts.setSaveFormat(com.aspose.diagram.SaveFileFormat.SVG);
    vsd.save(outfile, saveOpts);

Regards
Vittal

@vittala

Thanks for sharing the code snippet.

We were able to replicate the issue in our environment and logged it as DIAGRAMNET-51610 in our issue tracking system for the sake of correction. Please note that we have tested the scenario in Windows environment and it was reproducible. We will further investigate the reasons behind it and share additional updates with you as soon as we have some. Please spare us little.

We are sorry for the inconvenience.

The issues you have found earlier (filed as DIAGRAMNET-51610) have been fixed in Aspose.Diagram for .NET 19.2.