Verified Commit ca7a472b authored by Thibaut Broggi's avatar Thibaut Broggi
Browse files

Fix font size on canvas

parent 8372b5c8
......@@ -3,7 +3,7 @@ let ctx = canvas.getContext('2d');
let width = canvas.width;
let height = canvas.height;
let fontSize = 60;
let fontSize = 44;
let get = function(url, cb) {
let xmlHttp = new XMLHttpRequest();
......@@ -32,29 +32,29 @@ let draw = function() {
ctx.fill();
// Write text
ctx.font = fontSize + 'px FiraSans';
ctx.font = fontSize + 'pt 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.fillText('et libertés.', width * 0.08, height * 0.2 + fontSize * 2.8);
ctx.font = fontSize + 'pt ' + font;
ctx.fillStyle = fgColor;
ctx.fillText(fillText, width * 0.08, height * 0.2 + fontSize);
ctx.fillText(fillText, width * 0.08, height * 0.2 + fontSize * 1.4);
// Add footer
ctx.fillStyle = 'white';
ctx.fillRect(0, height * 0.85, width, height * 0.15);
ctx.fill();
ctx.font = '16px FiraSans';
ctx.font = '12pt FiraSans';
ctx.fillStyle = '#497ed5';
let offset = height * 0.05;
if (signature) {
ctx.fillText('Faites comme ', offset, height * 0.9);
offset += ctx.measureText('Faites comme ').width;
ctx.font = 'bold 16px FiraSans';
ctx.font = 'bold 12pt FiraSans';
ctx.fillText(signature, offset, height * 0.9);
offset += ctx.measureText(signature).width;
ctx.font = '16px FiraSans';
ctx.font = '12pt FiraSans';
ctx.fillText(', s', offset, height * 0.9);
offset += ctx.measureText(', s').width;
} else {
......@@ -63,7 +63,7 @@ let draw = function() {
}
ctx.fillText('outenez ', offset, height * 0.9);
offset += ctx.measureText('outenez ').width;
ctx.font = 'bold 16px FiraSans';
ctx.font = 'bold 12pt FiraSans';
ctx.fillText('La Quadrature du Net !', offset, height * 0.9);
//Draw picto
......
Supports Markdown
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