Closed peratik closed 11 months ago
Can you try
loadFont('roboto-bold', './Roboto-Bold.ttf', { filter: "linear" });
to see if it's better?
With linear
filter it is still pixelated.
It looks like the text is at least as sharp as the surrounding graphics (the rounded rectangles)
I think there are 2 ways to get better text rendering than the screenshot:
How can we increase canvas resolution?
You can try increasing pixelDensity
kaboom({
pixelDensity: 2,
})
You can get your current pixelDensity
by window.devicePixelRatio
, and try some higher value (higher value will cost performance)
For all non-bitmap fonts kaboom uses canvas 2d context to render to a texture, using a fixed font size of 64, it might be a good idea to make it customizable so you can render the font to a larger / smaller size so it works better for scaling like
loadFont('roboto-bold', './Roboto-Bold.ttf', { size: 120 }); // just an idea, not implemented yet
pixelDensity
solutions works. thank you.
size: 120
is not available in the current Kaboom release, it would be great to have it.
Hi, It is not sharp and pixelated, How can fix it?