Conversion of docx to pdf yields erroneous rendering of glyphs

Hi there,

We got a Word document containing some weird glyphs like Ç̆ (LATIN CAPITAL LETTER C WITH CEDILLA WITH COMBINING BREVE) or Û̄ (LATIN CAPITAL LETTER U WITH CIRCUMFLEX WITH COMBINING MACRON). If we convert the docx to pdf using Aspose.Words those characters are not rendered properly. The combining breve and combining macron, respectively, are displayed at the right side of their base letter instead of above it like in Word.
You can reproduce this phenomenon using your Free Online Converter and the attached document. How can we achieve the same look as if shown in Word? Are we missing something? Please advice.

Best regards,
Gerrit

ConversionTest.docx (12.7 KB)

@gbette The problem occurs because by default MS Word uses font open type features. In Aspose.Words you should enable this feature. Aspose.Words.Shaping.Harfbuzz package provides support for OpenType features in Aspose.Words using the HarfBuzz text shaping engine. You should enabling open type features to get the result closer to MS Word’s result. To achieve this you should add reference to Aspose.Words Shaping Harfbuzz plugin and use the following code to convert your document:

Document doc = new Document(@"C:\Temp\in.docx");
doc.LayoutOptions.TextShaperFactory = Aspose.Words.Shaping.HarfBuzz.HarfBuzzTextShaperFactory.Instance;
doc.Save(@"C:\Temp\out.pdf");
1 Like

@alexey.noskov Thanks for your prompt response. I’m gonna try it this week and report back.

1 Like

@alexey.noskov It works as expected. Thanks!

1 Like