The text has been deformed, like a mosaic
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
When I draw the barcode, the text becomes a mosaic.

code show as below
``` javascript
var canvas = document.createElement("canvas");
JsBarcode(canvas, md5Key, {
format: "CODE128",
height:100,
fontSize:10,
margin:1,
fontOptions:'italic',
font:'Microsoft YaHei',
displayValue:true,
text:tipName + ':' + tip,
textAlign:'left',
textPosition:'buttom',
});
var base64 = canvas.toDataURL("image/png");
```
I found this library when I googled
[polyfill](https://github.com/jondavidjohn/hidpi-canvas-polyfill)
I hope the author can join this or similar processing mechanism,
When I print out using a thermal printer, the text cannot be read.
Contributor guide
Research direction
Start by reproducing the provided CODE128 canvas example in a browser, including the font and text settings, then compare its output with the linked hidpi-canvas-polyfill. Check whether the generated PNG remains readable when printed on a thermal printer; done means the barcode text is no longer rendered as a mosaic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100