DOCX to HtmlFixed conversion issue with sybmol having Wingdings fonts using C#

Hi,

I have a DOCX using Wingdings font.
When I save this file as HtmlFixed with Aspose.Words 20.2 the html file obtained doesn’t show the correct Wingdings (neither in Chrome, Firefox, Edge or IE11). I use some specific html fixed save options.

In the attached zip file, you have:

  • the input file in DOCX format
  • the screenshot of the input file in Word
  • the .NET class, including html fixed save options settings
  • the output file in HTML format
  • the screenshot of the output file with incorrect font

files.zip (57.6 KB)

@julien.mevel.isilog

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-19984. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hello,

In 22.11, I just redid the test:

  • In HTML the font is identical to that of the document
  • In Fixed HTML the font is not identical

Can you tell me how to keep this format?

Cordially.

element.zip (30.3 KB)

@ISIWARE HTML is flow format and does not require building layout, so the font names are written into HTML just as they were read from the source document.
On other hand HTML Fixed is fixed page format, more like PDF, XPS or image. It’s purpose is to preserve exact visual representation. To achieve this document layout is built. To build document layout Aspose.Words needs the fonts used in the document. If Aspose.Words cannot find the font used in the document, the font is substituted. So the fonts in the output HTML Fixed document might differ from the source document, this depends on the fonts avaialbel on the machine where conversion is performed. You can implement IWarningCallback to get notifications when font substitution is performed.
Also, font specified in MS Word might not contain the glyphs required to display some character, both MS Word and Aspose.Words in this case performs font fallback, i.e. uses another font, which does contain the glyph.

The Wingdings font is present on my PC, see “Police.png”.

I also tried to check or not the different boxes present in the document settings before converting it with Aspose but without success. See “ParameterWord.png”

So I think there is an anomaly.

Cordially

Police.png (18.1 KB)
ParametreWord.png (23.6 KB)

@ISIWARE As I can see Windings is used in output Fixed HTML document:

.awtext002 {
	font-family:'Wingdings';
	font-style:normal;
	font-weight:normal;
}
<span class="awspan awtext002" style="font-size:24pt; color:#92d050; left:41.82pt; top:7.71pt; font-family:serif; line-height:26.64pt;">✓</span>

As you can see awtext002 class is applied to the span, so Windings is also applied.

Hello,

The Wingdings font is present in the class but it is crossed out and replaced by the serif font. See “Html.png”
I tried to remove the serif font in the HTML but without success.

Cordially
Html.png (37.7 KB)

@ISIWARE There are issues with rendering symbols in different browsers. Glyphs that use symbolic fonts are not rendered in IE on Windows and in any browser on Linux. To work around this issue Aspose.Words replaces characters of most common symbolic fonts with their Unicode equivalents, if possible. A generic font should be used to render the equivalent, and Aspose.Words overrides the ‘font-family’ property applied through the class.