Hi,
When rendering a worksheet with text in Windings/Windings 3 fonts to image or HTML, I saw the outputs are incorrect.
Code:
var options = new ImageOrPrintOptions
{
ImageType = ImageType.Svg,
SaveFormat = SaveFormat.Svg,
OnlyArea = false,
TextRenderingHint = TextRenderingHint.ClearTypeGridFit,
OnePagePerSheet = true,
Transparent = true
};
var workbook = new Workbook(@".\test.xlsx");
var sheet = workbook.Worksheets[0];
sheet.PageSetup.PrintArea = "B10:H20";
sheet.PageSetup.LeftMargin =
sheet.PageSetup.RightMargin = sheet.PageSetup.TopMargin = sheet.PageSetup.BottomMargin = sheet.PageSetup.HeaderMargin = sheet.PageSetup.FooterMargin = 0;
// Render as SVG, showing the font is 'arial'
new SheetRender(sheet, options).ToImage(0, @".\out.svg");
options.ImageType = ImageType.Emf;
options.SaveFormat = SaveFormat.Auto;
// Render as EMF, same behaviour
new SheetRender(sheet, options).ToImage(0, @".\out.emf");
var htmlSaveOptions = new HtmlSaveOptions
{
ExportHiddenWorksheet = false,
ExportActiveWorksheetOnly = true,
DefaultFontName = string.Empty
};
// Render as HTML, the text (before applying font) became လ rather than “
sheet.Workbook.Save(@".\out.html", htmlSaveOptions);
In SVG/EMF, the font has been reset to ‘Arial’. In HTML, although the font names have been preserved properly, the character code has been changed from ‘“’ to “လ”.
I’ve attached my test files and some screenshot for your reference. Could you please take a look?
Windings fonts are installed in Windows by default, I’ve also included in my attachment just in case. Could you please help to take a look?
tests.zip (174.3 KB)
image.png (83.6 KB)
image.png (87.3 KB)
Thanks,
@ServerSide527,
Please notice, I am able to reproduce the issue as you mentioned by using your template file. I found text with Windings fonts are not properly rendered to images/HTML. I have logged a ticket with an id “CELLSNET-49671” for your issue. We will look into it soon.
Once we have an update on it, we will let you know.
@ServerSide527
In the fix v21.10.2, the origin text “
(\u201c
) and ”
(\u201d
) are kept in the output html which is same as Microsoft Excel generated html. However, the “Windings” font doesn’t contain glyphs for \u201c
and \u201d
, so they displays as the origin text “
and ”
.
Aspose.Cells21.10.2 For .Net2_AuthenticodeSigned.Zip (5.6 MB)
Aspose.Cells21.10.2 For .Net4.0.Zip (5.6 MB)
Aspose.Cells21.10.2 For .NetStandard20.Zip (5.6 MB)
After analyzing Microsoft Excel generated Emf file, the origin text “
(\u201c
) and ”
(\u201d
) are mapped to glyphs \uf093
and \uf094
in the “Windings” font. The attachment file “test-3.xlsx” indicates the map. Currently we can’t understand the map in Excel. If you have any idea about it, please share it with us.
test-3.zip (6.9 KB)
Hi @Peyton.Xu
Thanks for the quick update! It is already very helpful.
I’ve dug a bit and found these articles
https://lists.w3.org/Archives/Public/www-international/1998JulSep/0022.html
http://archives.miloush.net/michkap/archive/2008/03/12/8163426.html
They suggested a ISO-8859-1 and Windows-1252 mapping table, including
0x93 ↔ 0x201C
Then looking at the Winding 3 font table (Wingdings 3 character set and equivalent Unicode characters) 0x93 is pointing to the arrow mark.
So I suspect instead of mapped to \uf093, it’s actually mapped to \u0093 (147)
image.png (9.9 KB)
maybe that could explain the Office behaviour here?
Also, when I tried to render the sheet with \u0093 \u0094 instead, I can see Aspose works properly with all output formats.
Thanks,
@ServerSide527
Thanks for your addtional info. It is very helpful for us to understand the map mechanism. We will fix the issue. However, for rendering to html, we will keep the origin text “
(\u201c
) and ”
(\u201d
) .
The issues you have found earlier (filed as CELLSNET-49671) have been fixed in this update. This message was posted using Bugs notification tool by simon.zhao