There isn't a way to do this without resorting to some pretty gross hacks.
If you're curious, the way you might approach this is by first creating a .vlw
font using George's answer. Then you'd need to write a utility program that reads in the bytes of the file as a byte array, then outputs some syntax that lets you store this as a variable. Copy that variable into your target sketch, and then you could then use a ByteArrayInputStream
to pass the bytes into the PFont
constructor that takes an InputStream
.
So sure, it's possible to do this. But this is very hacky and you should definitely not bother trying it.
Instead, I encourage you to take a step back and think about exactly what you're trying to do. It sounds like you're trying to export a single .exe
file from Processing. Note that this is not possible, even if you use the above hack to get rid of the font file!
Processing exports itself as a directory of run scripts and .jar
files. It is not a single packaged executable file. To convert your Processing sketch into a .exe
file, you're going to have to use something like Launch4J or JWrapper.
Note that these kinds of applications all offer support for packaging external files, which is how you should deal with your font file.
Also note that you could just store your font on the web, and then pass the URL into the loadFont()
function. But again, you'll still have to deal with the multiple .jar
files that Processing exports.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…