import Bedstead from './bedstead.js';
function update_glyph() {
var args = [];
+ var cstr = "";
for (var row of document.getElementById("pixels").rows) {
var arg = 0;
for (var pixel of row.getElementsByTagName('input')) {
arg += 1
}
}
- args.push(arg.toString())
+ 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("output").textContent = charstring;
+ document.getElementById("charstring").textContent = charstring;
document.getElementById("rendered")
.setAttribute("d", charstring
.replaceAll(/<!--(?:[^-]|-[^-])*-->/g, "")
for (var e of document.getElementsByTagName('input')) {
e.onchange = update_glyph;
}
+ update_glyph();
]]>
</script>
</head>
</svg>
</div>
</div>
- <p><code id="output"></code></p>
+ <p><code id="c"></code></p>
+ <p><code id="charstring"></code></p>
</body>
</html>