bedstead/webstead.xhtml
Ben Harris b62b0454b5 webstead: add Emscripten and musl copyright notices
Programs compiled with Emscripten end up statically linked against the
Emscripten runtime, which includes musl libc.  So we need to comply with
their licences by including a copy of the licence and the relevant
copyright notices.  I think putting them on the webstead page in small
print is probably the best approach.

This might need updating each release to match the version of Emscripten
that I build the editor with.
2026-01-13 21:42:18 +00:00

199 lines
7.1 KiB
HTML

<html xmlns="http://www.w3.org/1999/xhtml" lang="en-GB" xml:lang="en-GB">
<head>
<!-- SPDX-License-Identifier: CC0-1.0 -->
<link rel="stylesheet" href="bedstead.css" type="text/css" />
<title>Bedstead editor test</title>
<style>
:root {
--pix: 7vmin;
}
body {
max-width: none;
}
#inout {
display: flex;
}
#inpane, #outpane {
padding-left: var(--pix);
padding-top: var(--pix);
width: calc(5 * var(--pix));
height: calc(9 * var(--pix));
}
#pixels {
border-spacing: 0;
}
#pixels td {
padding: 0;
line-height: 0;
}
#pixels input {
appearance: none;
color: inherit;
margin: 0;
width: var(--pix);
height: var(--pix);
border: 1px solid;
}
#pixels input:checked {
background: currentColor;
}
</style>
<!-- Script is async rather than deferred because Chromium can't
handle deferred scripts in XHTML.
https://issues.chromium.org/issues/40518469 -->
<script type="module" async="async"><![CDATA[
import Bedstead from './bedstead.js';
function update_glyph() {
var args = [];
var cstr = "";
for (var row of document.querySelector('#pixels').rows) {
var arg = 0;
for (var pixel of row.querySelectorAll('input')) {
arg *= 2;
if (pixel.checked) {
arg += 1
}
}
args.push(arg.toString());
cstr += "\\" + arg.toString(8).padStart(2, "0");
}
document.getElementById("c").textContent =
` {"${cstr}", U() },`;
Bedstead({
arguments: args,
print: function(charstring) {
document.getElementById("charstring").textContent = charstring;
document.getElementById("rendered")
.setAttribute("d", charstring
.replaceAll(/<!--(?:[^-]|-[^-])*-->/g, "")
.replace(/^.* [hv]stem /, "")
.replace(/^cntrmask [01]* /, "")
.replaceAll(/(\S+ +\S+ +)rmoveto/g, "m$1")
.replaceAll(/ rlineto/g, "")
.replace(/ endchar/, ""));
}
});
}
function init() {
for (var e of document.querySelectorAll('#pixels input')) {
e.onchange = update_glyph;
}
update_glyph();
}
// This script is loaded asynchronously, so make sure the DOM is
// loaded before touching it.
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", init);
} else {
init();
}
]]>
</script>
</head>
<body>
<div id="inout">
<form id="inpane">
<table id="pixels">
<tr>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
</tr>
<tr>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
</tr>
<tr>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
</tr>
<tr>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
</tr>
<tr>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
</tr>
<tr>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
</tr>
<tr>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
</tr>
<tr>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
</tr>
<tr>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
</tr>
</table>
</form>
<div id="outpane">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="100 100 500 1000">
<g transform="scale(1,-1) translate(0,-800)">
<path id="rendered" fill="currentColor"/>
</g>
</svg>
</div>
</div>
<p><pre id="c"></pre></p>
<p><code id="charstring"></code></p>
<div class="smallprint">
<p>This editor contains code from Emscripten and musl libc under
the following licence:</p>
<p>Copyright 2010-2022 The Emscripten Authors</p>
<p>Copyright © 2005-2020 Rich Felker, et al.</p>
<p>Copyright (C) 2011 by Valentin Ochs</p>
<p>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:</p>
<p>The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
</div>
</body>
</html>