Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

4
Probable fatal error: No physical fonts found
Post Body

Hi guys,

I have been using java.awt.Font for a while without problems, however recently all of a sudden they stopped working.

When I try to draw a string using

g.drawString("Test", 0,0);

It gives me the error:

Exception in thread "Game" java.lang.Error: Probable fatal error: No physical fonts found.

Also, whenever I try to import a custom font, I get a FontFormatException:

try
        {
            font = Font.createFont(Font.TRUETYPE_FONT, new File("assets/pixelated/pixelated.ttf"));
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File("assets/pixelated/pixelated.ttf")));
        }
        catch(IOException | FontFormatException e)
        {
            e.printStackTrace();
        }

The Exceptions thrown are:

java.awt.FontFormatException: Unexpected runtime exception.

Exception in thread "Game" java.lang.NullPointerException: Cannot invoke "java.awt.Font.deriveFont(float)" because "com.lootrunner.menu.Screen.font" is null

I am very confused because all of the code I have shown worked perfectly fine a few days ago. Now every single program I use which includes fonts do not work at all.

I am using Eclipse as my IDE, and I am on Windows 10. I uninstalled Java and reinstalled JDK 15.0.2. I am genuinely confused as even Google does not even help. The closest error I have found is Probable fatal error: No fonts found (notice how there isn't the word physical)

Any help would really be appreciated as I cannot work on anything now :(

Thank you so much

Author
User Disabled
Account Strength
0%
Disabled 6 months ago
Account Age
4 years
Verified Email
Yes
Verified Flair
No
Total Karma
7,182
Link Karma
190
Comment Karma
6,963
Profile updated: 5 days ago
Posts updated: 8 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago