I am attempting to draw a cube using the Braille Patterns Unicode Block, via the node-drawille library.
However, it appears that the width of the braille characters is not consistent(?), even though the text is in a <pre>
element.
I have included the demo, which prints the length of each line (80 characters). I have also included a picture of what I see when I highlight the entire <pre>
element. (OSX 10.12)
I have tested both with the default monospace
and the font I use in my terminal (Menlo Regular
). The results are similar, the width is inconsistent even though the character count is the same.
Desired result (pasted exactly into terminal):
(For best results w/ demo, run in a full page, and highlight the entire pre element to see the variable widths).
var data = document.getElementById('cube').innerHTML;
data.split('\n').forEach(x => console.log(x.length))
<pre id="cube">
⢀⡀
⢀⡠⠔⠊⠁⡏⠑⠤⡀
⢀⡠⠔⠊⠁ ⡇ ⠈⠑⠤⡀
⢀⡠⠔⠊⠁ ⡇ ⠈⠑⠤⡀
⢸⠑⠒⠤⠤⣀⡀ ⡇ ⢀⣀⡠⠤⠜⢳
⢸ ⠈⠉⠒⠒⠤⢄⣀⡠⡧⠔⠒⠊⠉⠁ ⢸
⢸ ⡇ ⡇ ⢸
⢸ ⡇ ⡇ ⢸
⢸ ⡇ ⡇ ⢸
⢸ ⡇ ⡇ ⢸
⡏ ⡇ ⡇ ⡇
⡇ ⡇ ⡇ ⡇
⡇ ⡇ ⡇ ⡇
⡇ ⡇ ⡇ ⡇
⡇ ⣀⡠⠤⠔⠓⠢⡧⠤⣀⣀⣀ ⡇
⡇⣀⣀⠤⠔⠒⠋⠉ ⡇ ⠈⠉⠉⠑⠒⠒⣤⠇
⠉⠒⠤⢄⡀ ⡇ ⢀⡠⠔⠉
⠈⠉⠒⠦⢄⣀ ⡇ ⣀⠤⠚⠁
⠉⠒⠢⢄⡧⠔⠊
</pre>