This site requires JavaScript, please enable it in your browser!
Greenfoot back
HolyCheeseCurd
HolyCheeseCurd wrote ...

2017/5/22

List of Fonts?

HolyCheeseCurd HolyCheeseCurd

2017/5/22

#
Is there anywhere that I would be able to find a list of the available fonts? If so please do tell me. Thanks.
danpost danpost

2017/5/22

#
My TextImage Support Class scenario has a method in the TextImage class that lists all available fonts on your system in the terminal window.
Yehuda Yehuda

2017/5/22

#
HolyCheeseCurd wrote...
Is there anywhere that I would be able to find a list of the available fonts?
I'm not so sure what you mean. The available fonts are the ones that are on the system that the program is running on. If you want to retrieve the fonts from the system in your program, then you can use the following:
1
java.awt.Font[] fonts = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
Now the 'fonts' variable is an array of Fonts containing all the fonts on the System. java.awt.GraphicsEnvironment
You need to login to post a reply.