I declare
proggytiny as a
protected static Font in my class, then initialize it as follows:
try {
proggytiny = Font.createFont(
Font.TRUETYPE_FONT, GECKO_SE.class.getResourceAsStream("fonts/ProggyTiny.ttf"));
} catch(FontFormatException e) {
System.out.println("Font format not supported");
} catch (IOException e) {
System.out.println("Font not found");
}
I then use
setFont on a ]b]JTextPane to apply this font to it.
The
JTextPane then
seemingly has no text on it, but in fact a tiny flashing dot appears for the cursor when I click on a line. I printed out a
proggyfont.getSize(), and its size is currently '1', which is either the problem or a symptom of a larger problem, I'm assuming.
My question is this: how can I set the size of my custom font? I've been searching for about 90 minutes and haven't found anything that works; the first thing I tried was
proggyfont = proggyfont.deriveFont(12);
after initializing it, but it's had no effect.
Help!