tray
tray copied to clipboard
Chinese characters not printed correctly using printHTML on MacOS via QZ-Tray
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>九龍尖沙咀重慶大廈3樓27室</td>
</tr>
</tbody>
</table>
</body>
</html>
The bug can be reproduced by printing a very small html snippet on Mac:
<p>3樓2</p>
There seem to be two workarounds:
- 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.