tray icon indicating copy to clipboard operation
tray copied to clipboard

Chinese characters not printed correctly using printHTML on MacOS via QZ-Tray

Open lite1979 opened this issue 3 years ago • 1 comments

This issue was originally discovered by a user on the qz-print googlegroups email chain

When printing a simple HTML snippet via QZ-Tray on Windows, all of the characters are printed correctly, but when printing this same HTML via QZ-Tray on MacOS, several characters are missing and there are extra blank spaces in the print result.

QZ Tray 2.1.2 / AdoptOpenJDK 11

<html>
    <head>
        <meta charset="UTF8">
        <title>My First Web Page</title>
    </head>
    <body>
        <h6>
    <span>Testing for:</span>
    <span>九龍尖沙咀重慶大廈</span>
    <span>3</span>
    <span>樓</span>
    <span>27室</span>
</h6>
<table>
    <tbody>
        <tr>
            <td><span>1.</span>九龍尖沙咀重慶大廈3樓27室</td>
            <td><span>2.</span>九龍尖沙咀重慶大廈<span>3樓27室</span></td>
            <td><span>3.</span>大廈3樓</td>
        </tr>
        <tr>
            <td><span>4.</span>&#20061;&#40845;&#23574;&#27801;&#21632;&#37325;&#24950;&#22823;&#24264;3&#27155;27&#23460;</td>
        </tr>
    </tbody>
</table>
    </body>
</html>

WinvMac

lite1979 avatar Apr 29 '21 22:04 lite1979

The bug can be reproduced by printing a very small html snippet on Mac:

<p>3樓2</p>

There seem to be two workarounds:

  1. Separate ASCII and chinese characters using something like an additional span, e.g;
<p><span>3</span>樓<span>2</span></p>


--OR-- 2. Use { rasterize: true } when printing on Mac

The fact that it is not reproducible with { rasterize: true } suggests it's likely a bug with the JavaFX printing subsystem. I think we will need to file a bug report with our JavaFX provider to resolve this.

tresf avatar Apr 30 '21 02:04 tresf