I am trying to get all the character codes in a .ttf/.otf file so I can get a random character and display it. I want to create a matrix rain, I found a font file with only the characters used in it only.Here is the link to the font. I am trying to implement it this way: String.toCharCode();
My code so far:
var value = String.fromCharCode(97);
var fontSize = 30;
function setup() {
createCanvas(500,500);
textFont('Matrix');
textSize(fontSize);
}
function draw() {
ellipse(width/2,height/2,9,9);
text(value,width/2,height/2);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.js"></script>
<style type = "text/css">
@font-face {
font-family: "Matrix";
src: url(--Link to file--);
}
</style>
research: