Hello,
I’ve noticed that Surrogate Pairs like “𝑥” (U+1D465) in svg text blocks are shown as two squares when an svg file is rendered to an Image. If the Skiasharp backend is used, nothing is shown at all instead of the correct glyph. I already made sure to provide a font that has a glyph for the requested character but that doesn’t seem to help.
As a side note, I’ve also noticed that the MatchFontFallback method only gets half of the pair, which isn’t ideal if one wants to check if the font provides a glyph for that character.
I’ve attached a sample Project:
AsposeSVG-SurrogatePairs.zip (461.8 KB)
Thanks and best regards
@Developer123123
It seems that the issue you’re experiencing with Surrogate Pairs not being displayed correctly when converting SVG files to images may be related to the limitations of certain rendering engines. Specifically, GDI+ can struggle with rendering complex fonts, which might be causing the characters to appear as squares or not at all.
To improve the rendering of SVG files, especially when dealing with complex fonts and Surrogate Pairs, I recommend using the Aspose.SVG.Drawing.SkiaSharp component. This component utilizes SkiaSharp for rendering graphics and fonts, which generally provides better support for such scenarios compared to GDI+.
Here’s how you can integrate the SkiaSharp-based drawing engine into your project:
-
Install the Aspose.SVG.Drawing.SkiaSharp package from NuGet:
Install-Package Aspose.SVG.Drawing.SkiaSharp
-
Initialize the SkiaSharp-based drawing engine in your code:
using Aspose.Svg.Drawing.SkiaSharp;
// Initialize SkiaSharp-based drawing engine
Aspose.Svg.Configuration.SetExtension(new SkiaModule());
By using this approach, you should see improved handling of Surrogate Pairs and other complex font rendering issues when converting SVG to images.
If you continue to face challenges, please ensure that the font you are using indeed supports the required glyphs for the characters in question.
Feel free to reach out if you have any further questions or need additional assistance!
As mentioned, with Aspose.Svg.Configuration.SetExtension(new SkiaModule()); the characters are missing in the resulting image completely.
@Developer123123
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): SVGNET-490
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
The issues you have found earlier (filed as SVGNET-490) have been fixed in this update. This message was posted using Bugs notification tool by vdeviatov