Description
When rendering vertical (top-to-bottom) text that contains a Word EQ field, the content inside the field equation is rendered with an incorrect text direction in HTML output.
Specifically, the number inside the circled number EQ field is rotated 90 degrees counterclockwise.
This issue does not occur in:
- Microsoft Word
- DOCX → PNG output generated by Aspose.Words
I have already enabled HarfBuzz text shaping, but it does not resolve the issue for HTML rendering.
Expected Result (Microsoft Word 2010)
- Vertical text and EQ field content are rendered correctly.
- The number inside the circled number maintains the correct orientation.
Actual Result (Aspose.Words Output)
- The text inside the EQ field is rendered incorrectly only in HTML output.
DOCX → PNG
- The result is rendered correctly and matches Microsoft Word.
DOCX → HTML
- The number inside the EQ field is rotated 90 degrees counterclockwise, resulting in incorrect visual output.
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="Content-Style-Type" content="text/css" /><meta name="generator" content="Aspose.Words for .NET 25.12.0" /><title></title></head><body style="widows:0; orphans:0; font-family:'Times New Roman'; font-size:12pt"><div><table cellspacing="0" cellpadding="0" style="width:31.5pt; margin-left:1.45pt; border-collapse:collapse"><tr style="height:127.1pt; page-break-inside:avoid"><td style="width:28.7pt; height:127.1pt; margin-left:auto; writing-mode:tb-rl; padding-right:1.4pt; padding-left:1.4pt; vertical-align:top; overflow:hidden"><div style="height:127.1pt; margin-left:auto; writing-mode:tb-rl; -aw-ignore:true; overflow:hidden"><p style="margin-top:0pt; margin-bottom:0pt; font-size:14pt"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAYCAYAAAAYl8YPAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFNSURBVEhL7ZM/qoNAEIcFgyDkAjmCFh4hVTprbTxAasFglSqpUqa3EQU7K0mRYwSsxFrbWBhBmcdOyLKr+aPvpXwfDDo/xw91XQG+iNAP/sK/7I7nebDZbLA+8VSWJAmoqgrr9RrCMORKkiRwHKd/CzKQLZdLME2zH3P4vo9zfTjZYrGAsizZ6CVZlsF8PucyKrtcLrBarbiLnwiCAGzbpj3Kuq6D2WzGzo3idrtxT4eyoijAMAx2bhRRFMHxeIT9fo89lf0G13XxyMkE4f7pzucznk+pgYx9MjKw2+1G1UvZdrvFgKzQWMg3I2/DyZqmAU3TMJgqIwuQ5zn29D+L45idG8XpdALLsmhPZW3bTv7XZFmGuq5pP9ibZOB6vfZjDnJdFMV+PJQRFEXBlUrTFKqqojnpSa7rOjf/4KnsweFwwP3K1jveyqbyVdkPoTRzLTqMiQgAAAAASUVORK5CYII=" width="19" height="24" alt="" style="vertical-align:middle; -aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline" /><span style="font-family:標楷體">—( )</span></p></div></td></tr></table><p style="margin-top:0pt; margin-bottom:0pt; line-height:1pt"><span style="font-size:14pt; -aw-import:ignore"> </span></p><p style="margin-top:0pt; margin-bottom:0pt"><span style="-aw-import:ignore"> </span></p></div></body></html>
Sample Docx
sample.docx (16.8 KB)
Sample Code
using Aspose.Words;
using Aspose.Words.Saving;
using Aspose.Words.Shaping.HarfBuzz;
new License().SetLicense("licensePath");
var doc = new Document($@"{rootDir}\Assets\{fileName}.docx")
{
LayoutOptions = { TextShaperFactory = HarfBuzzTextShaperFactory.Instance }
};
doc.Save("outputPngPath");
doc.Save("outputHtmlPath", new HtmlSaveOptions
{
ExportImagesAsBase64 = true
});
Environment
- .NET Framework 4.8
- Aspose.Words 25.12.0
- Aspose.Words.Shaping.HarfBuzz 25.12.0
Question
- Is there any configuration or setting that I may be missing to correctly render vertical text with EQ fields in HTML?
- Is this a known limitation or bug in Aspose.Words when exporting DOCX to HTML?
- Are there any recommended workarounds or planned fixes to make the HTML output consistent with the PNG output?
