fabric.js 字体锯齿问题
一种解决方案,给字体添加一个有透明度的描边,锯齿会减轻一些
totalDistanceText = new fabric.Textbox('0m', {
textAlign: 'center',
width: bodyWidth,
hoverCursor: 'default',
selectable: false,
fill: "#ffffff",
fontWeight: 800,
top: computedPx(30),
fontSize: 33,
// 这里给字体加一个透明度为0.5的描边
stroke: 'rgba(255,255,255,0.6)',
strokeWidth: 1,
fontFamily: 'PingFangSC-Semibold, PingFang SC'
})
canvas.add(totalDistanceText);

浙公网安备 33010602011771号