UnderwaterApps / overlap2d

Overlap2D Game development toolkit for UI and Level design
Other
781 stars 224 forks source link

Crash when making text (linux) #336

Open DeejayArroba opened 8 years ago

DeejayArroba commented 8 years ago

Whenever I click to place text in the world the editor crashes. This is on Arch Linux and the error says something about not finding a font?

java.lang.NullPointerException
    at java.io.File.<init>(File.java:277)
    at com.badlogic.gdx.files.FileHandle.<init>(FileHandle.java:62)
    at com.uwsoft.editor.proxy.FontManager.getTTFByName(FontManager.java:175)
    at com.uwsoft.editor.proxy.ResourceManager.prepareEmbeddingFont(ResourceManager.java:379)
    at com.uwsoft.editor.factory.ItemFactory.createLabel(ItemFactory.java:223)
    at com.uwsoft.editor.view.stage.tools.TextTool.putItem(TextTool.java:63)
    at com.uwsoft.editor.view.stage.tools.ItemDropTool.stageMouseDown(ItemDropTool.java:17)
    at com.uwsoft.editor.view.stage.SandboxMediator$SandboxStageEventListener.touchDown(SandboxMediator.java:386)
    at com.uwsoft.editor.view.stage.input.SandboxInputAdapter.touchDown(SandboxInputAdapter.java:91)
    at com.badlogic.gdx.InputMultiplexer.touchDown(InputMultiplexer.java:90)
    at com.badlogic.gdx.backends.lwjgl.LwjglInput.processEvents(LwjglInput.java:313)
    at com.badlogic.gdx.backends.lwjgl.LwjglCanvas$3.run(LwjglCanvas.java:234)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: No OpenGL context found in the current thread.
    at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124)
    at org.lwjgl.opengl.GL11.glDeleteTextures(GL11.java:732)
    at com.badlogic.gdx.backends.lwjgl.LwjglGL20.glDeleteTexture(LwjglGL20.java:248)
    at com.badlogic.gdx.graphics.GLTexture.delete(GLTexture.java:170)
    at com.badlogic.gdx.graphics.Texture.dispose(Texture.java:194)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.dispose(TextureAtlas.java:418)
    at com.badlogic.gdx.scenes.scene2d.ui.Skin.dispose(Skin.java:389)
    at com.kotcrab.vis.ui.VisUI.dispose(VisUI.java:114)
    at com.uwsoft.editor.Overlap2D.dispose(Overlap2D.java:68)
    at com.badlogic.gdx.backends.lwjgl.LwjglCanvas$4.run(LwjglCanvas.java:309)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
azakhary commented 8 years ago

Eh Linux again :D we search for fonts on different directories on Linux, and apparently for every linux this place is different. But I am not sure why it crashes I remember we did ensure it won't crash even if directory is not there... Thanks for reporting! Will take a loook.

As for easy fix, make sure there is .fonts directory in your /user/[username/ directory And it should open up.

DeejayArroba commented 8 years ago

Ah, that worked. I didn't have the .fonts directory before. It still crashed if the directory was empty though, I had to put some fonts in it to make it work. Thanks for the response

azakhary commented 8 years ago

Please don't close the issue though, the crash has to be fixed. Also, where does your linux version keep fonts normally?

DeejayArroba commented 8 years ago

/usr/share/fonts, but the vast majority of the fonts are in the /usr/share/fonts/TTF subdirectory