Verified Commit ce647465 authored by Thibaut Broggi's avatar Thibaut Broggi

Merge branch 'preprod'

parents 132d537c 0e67ee32
Pipeline #1741 passed with stages
in 1 minute and 43 seconds
......@@ -64,23 +64,56 @@ app.use(function(req, res, next) {
next();
});
// {name: filepath}
// {name: {filepath, offset}}
let fonts = {
'FiraSans': 'FiraSans-Regular.otf',
'bilbo-inc': 'BilboINC.ttf',
'bluu-next': 'BluuNext-Bold.otf',
'combat': 'Combat.otf',
'gulax': 'Gulax.otf',
'lineal': 'Lineal.otf',
'resistance': 'Resistance.otf',
'savate': 'savate-regular.otf',
'solid-mirage': 'SolideMirageMono.otf',
'steps-mono': 'Steps-Mono.otf',
'terminal': 'terminal-grotesque_open.otf'
'FiraSans': {
path: 'FiraSans-Regular.otf',
offset: 0
},
'bilbo-inc': {
path: 'BilboINC.ttf',
offset: 10
},
'bluu-next': {
path: 'BluuNext-Bold.otf',
offset: 0
},
'combat': {
path: 'Combat.otf',
offset: 0
},
'gulax': {
path: 'Gulax.otf',
offset: 10
},
'lineal': {
path: 'Lineal.otf',
offset: 4
},
'resistance': {
path: 'Resistance.otf',
offset: 2
},
'savate': {
path: 'savate-regular.otf',
offset: 10
},
'solid-mirage': {
path: 'SolideMirageMono.otf',
offset: 0
},
'steps-mono': {
path: 'Steps-Mono.otf',
offset: 10
},
'terminal': {
path: 'terminal-grotesque_open.otf',
offset: 15
}
};
for (let i in fonts) {
Canvas.registerFont('./static/fonts/' + fonts[i], {family: i});
Canvas.registerFont('./static/fonts/' + fonts[i].path, {family: i});
}
Canvas.registerFont('./static/fonts/FiraSans-Bold.otf', {family: 'FiraSans', weight: 'bold'});
......@@ -125,7 +158,7 @@ app.get('/generate.png', function (req, res) {
ctx.fillText(_('et libertés.'), width * 0.08, height * 0.2 + fontSize * 2.8);
ctx.font = fontSize + 'pt ' + req.args.font;
ctx.fillStyle = req.args.fgColor;
ctx.fillText(req.args.text, width * 0.08, height * 0.2 + fontSize * 1.4);
ctx.fillText(req.args.text, width * 0.08, height * 0.2 + fontSize * 1.4 + fonts[req.args.font].offset);
// Add footer
ctx.fillStyle = 'white';
......
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