Override system font with different font in Java

I am wondering how to override system font with a different font(having same name). From my research it appears that GraphicsEnvironment#registerFont(font) returns false in case of font name or font family name matches with already loaded system fonts.

Internally GraphicsEnvironment uses SunFontManager to register font.

public boolean registerFont(Font font) {

/* This method should not be called with "null".

* It is the caller's responsibility to ensure that.

*/

if (font == null) {

return false;

}

/* Initialise these objects only once we start to use this API */

synchronized (regFamilyKey) {

if (createdByFamilyName == null) {

createdByFamilyName = new Hashtable();

createdByFullName...

Read More »

By: StackOverFlow - Friday, 9 November

Related Posts