-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-fonts.html
88 lines (78 loc) · 2.54 KB
/
example-fonts.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html>
<head>
<title>Example - Hello</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- Replace with a separate style.css file if you want -->
<style type="text/css">
body {
background: black;
color: white;
}
</style>
<!-- These 2 script tags are required for the 3D effect.
You can remove these if you disabled THREE_SETTINGS. -->
<script async src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/addons/": "https://unpkg.com/[email protected]/examples/jsm/"
}
}
</script>
<script type="module">
import * as qx from "./qx82/qx.js";
import * as qxa from "./qx82/qxa.js";
async function main() {
// Load the custom fonts.
qx.cls();
qx.print("Loading fonts...");
const boldFont = await qxa.loadFont("assets/bold-font.png");
const bigFont = await qxa.loadFont("assets/big-font.png");
qx.color(0, 7);
qx.cls();
qx.printBox(32, 24);
qx.setFont(bigFont);
// Silly title animation. Why not?
for (let i = 10; i >= 1; i--) {
qx.color(0, 7);
qx.locate(1, i + 1);
qx.print(" ");
qx.locate(1, i);
qx.print(" Retro Times\n");
await qxa.wait(i < 10 ? 0.1 : 1.0);
}
qx.setFont(null);
qx.color(8);
qx.print(" Oct 14, 1982");
qx.setFont(boldFont);
qx.locate(1, 6);
qx.color(1, 7);
await qxa.typewriter("Runaway fonts strike again\n", 0.01);
qx.setFont(null);
qx.color(0);
await qxa.typewriter(
"An unknown typeface has boldly\n" +
"appeared, underlining the need\n" +
"for typographical safety to\n" +
"stem the ascent of grotesque\n" +
"glyphs. Mayor Roman Serif has\n" +
"stated typography reached its\n" +
"cap height and a descent into\n" +
"a new baseline of sans-serifs\n" +
"was inevitable. A courier was\n" +
"sent to Baskerville suggesting\n" +
"a twelve-point plan to realign\n" +
"the left and right so we are\n" +
"all on the same page, for a\n" +
"true type of justified impact\n" +
"leaving an indent into future\n" +
"word processing.", 0.01);
}
window.addEventListener("load", () => qx.init(main));
</script>
</head>
<body>
</body>
</html>