hack font integration, shout outs to beenz

This commit is contained in:
Hugh Bord 2021-03-20 18:35:54 +10:00
parent eef7788332
commit e8aeb10e9d
3 changed files with 4 additions and 3 deletions

View File

@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
<link rel='stylesheet' href='//cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack.css'>
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>

View File

@ -258,7 +258,7 @@ export default {
};
// set asciiImport as the entire file contents as a string
this.asciiImport = contents;
this.asciiImport = contents.split("\u0003\u0003").join("\u0003");
// This will end up in the asciibirdMeta
this.finalAscii = {

View File

@ -166,7 +166,7 @@ export default {
let canvasY = 0;
let curBlock = {};
this.ctx.font = "12px Deja Vu Sans Mono";
this.ctx.font = "14px Hack";
for (y = 0; y < this.currentAsciibirdMeta.height + 1; y++) {
canvasY = BLOCK_HEIGHT * y;
@ -199,7 +199,7 @@ export default {
this.ctx.fillText(
curBlock.char,
canvasX,
canvasY + BLOCK_HEIGHT - 2
canvasY + BLOCK_HEIGHT
);
this.ctx.stroke();
}