how to get raw image data for fonts
As part of a bigger project I am working on, I need to be alble to get the images of fonts brought to an array of pixel values, which would be used as a training set in some advanced work on artificial intelligence. The only thing I can think of is to do graphics.getGrapics() the draw string in each of the fonts on that graphic object but everyting I can find necessitates having a graphics object come in from the system.
I need to list fonts, then have each of those fonts draw ascii 0x20 through 0x7e and be able to get the  or  as one would normally view  on the screen or that same data as a flat dataspace that I can do offsets to make a Matrix. I have searched the code but have not gotten any starting places located.
The data can be float or int or 1/0 valued, it does not matter - I just need work the raw values from code rather than tediously, manually generating data by looking at the displayed rendering.
how to construct in internal buffered image
I found no way to construct a BufferedImage except to get one preconstructed from a graphics object supplied in a paint() .... the best I can come up with is:
Originally Posted by Darryl.Burke
obviously the  could be made bigger and I would not unroll the loop for a default internal Buffered Image initialization ... the data will be coming in ( from the JNI work in the static linking post ) as 8-bit grayscale default dib with no compression or any standard cs ops deriving from known optimizations, that's the license spike provides - anything requiring any brains such as will be coming in from known commercial traffic gets passed to him for commercial use.
// = new java.awt.image.BufferedImage(java.awt.image.ColorModel.getRGBdefault(),java.awt.image.Raster.createPackedRaster(java.awt.image.DataBuffer.TYPE_BYTE,4,3,notAnImage, new java.awt.Point()),false, new java.util.Hashtable<java.lang.String,java.lang.String>());
I worked on this as deep as I could grasp what is going on, the comment marker is to remove the code during prototyping - the small array should actually be grapics big enough to do object.drawString() for ascii 0x20 through 0x7e inclusive, at any font size that I can get constructed.
The instructor ( a double degreed board member of IEEE ) suggests using the smallest size that will work, for me what is practical for that is "any size that will work" as I can let the machine run for a hundred hours building the learning sets. One of the things I will get to today is g5 - which has an abundance of powerful optimizations for building the learning sets.
What is hanging the plan here is constructing a default ImageProducer of sufficient correctness that I can call draw string on it, listing the fonts and reducing the selection set to a sensible set is within my skills, though will involve significant manual methods such looking at the system font tool and so on....