Verified Commit 2dfdfe37 authored by Thibaut Broggi's avatar Thibaut Broggi
Browse files

Fix text on generated image

parent c6e56619
......@@ -31,11 +31,12 @@ let draw = function() {
ctx.fill();
// Write text
ctx.font = fontSize + 'px ' + font;
ctx.font = fontSize + 'px FiraSans';
ctx.fillStyle = 'white';
ctx.textBaseline = 'top';
ctx.fillText('Internet,', width * 0.08, height * 0.2);
ctx.fillText('et libertés.', width * 0.08, height * 0.2 + fontSize * 2);
ctx.font = fontSize + 'px ' + font;
ctx.fillStyle = fgColor;
ctx.fillText(fillText, width * 0.08, height * 0.2 + fontSize);
......@@ -53,18 +54,18 @@ let draw = function() {
ctx.fillStyle = 'white';
ctx.fillRect(0, height * 0.85, width, height * 0.15);
ctx.fill();
ctx.font = '16px Arial';
ctx.fillStyle = 'blue';
ctx.font = '16px FiraSans';
ctx.fillStyle = '#497ed5';
let offset = height * 0.05;
ctx.fillText('Faites comme ', offset, height * 0.9);
offset += ctx.measureText('Faites comme ').width;
ctx.font = 'bold 16px Arial';
ctx.font = 'bold 16px FiraSans';
ctx.fillText(signature, offset, height * 0.9);
offset += ctx.measureText(signature).width;
ctx.font = '16px Arial';
ctx.font = '16px FiraSans';
ctx.fillText(', soutenez ', offset, height * 0.9);
offset += ctx.measureText(', soutenez ').width;
ctx.font = 'bold 16px Arial';
ctx.font = 'bold 16px FiraSans';
ctx.fillText('La Quadrature du Net !', offset, height * 0.9);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment