@ -46,33 +46,72 @@ Download the minified js file in dist folder and include it in your html.
@@ -46,33 +46,72 @@ Download the minified js file in dist folder and include it in your html.
Generate LeonSans and draw it in the Canvas element of HTML5.
```javascript
this.canvas = document.createElement('canvas');
document.body.appendChild(this.canvas);
this.ctx = this.canvas.getContext("2d");
let leon, controll, canvas, ctx;
this.leon = new LeonSans({
text: 'The quick brown\nfox jumps over\nthe lazy dog',
color: ['#000000'],
size: 160,
weight: 200
});
const sw = 800;
const sh = 600;
const pixelRatio = 2;
requestAnimationFrame(animate);
function init() {
canvas = document.createElement('canvas');
document.body.appendChild(canvas);
ctx = canvas.getContext("2d");
canvas.width = sw * pixelRatio;
canvas.height = sh * pixelRatio;
canvas.style.width = sw + 'px';
canvas.style.height = sh + 'px';
ctx.scale(pixelRatio, pixelRatio);
leon = new LeonSans({
text: 'The quick brown\nfox jumps over\nthe lazy dog',