I need to use a TrueType font in my web application. I would like to include the file in my war file and then load the font using the classLoader.getResource() method. The only Constructor I see that might be what I need is the TrueTypeFont(byte[] bytes) constructor. The documentation says that the bytes parameter is the "TrueType font byte array", but I don't know what that means. Does that mean I just load the bytes from the .ttf file into a byte array and pass it to this constructor?
Could you give me some help with the right way to do this.
thanks.
Loading True Type Font from Web App
Re: Loading True Type Font from Web App
Support · Apr 2, 2009Hello,
Yes, you will have to use the TruTypeFont class constructor which takes the byte array data of the font file as a parameter. You will have to get the byte data of the font file and create the TruTypeFont object using the byte array.
Thanks,
ceTe Software Support Team.