JetBrains / skija

Java bindings for Skia
Apache License 2.0
2.63k stars 127 forks source link

Instantiating a Typeface from file causes EXCEPTION_ACCESS_VIOLATION #133

Open SamuelDidoszak opened 3 years ago

SamuelDidoszak commented 3 years ago

Calling a native method _nMakeFromFile from Typeface class causes an Access Violation. (Typeface.java 142). It's happening regardless of file and path. The issue arises when trying to create a Scene from Examples. Scene requires initialization of static final Typeface iter (Scene.java 7).

Log file: hs_err_pid512.log

tonsky commented 3 years ago

Which example are you trying to run and how? What’s your OS?

SuperSkidder commented 2 years ago

i have the same problem, Windows 11 lwjgl example

tonsky commented 2 years ago

I can't reproduce it, unfortunately. Can you debug it a little? Does it point to the right file? Does that file exists? You can do that by modifying Scene.java and replacing file function with this:

public static String file(String path) {
        String res = "../scenes/" + path;
        try {
            java.io.File file = new java.io.File(res).getCanonicalFile();
            System.out.println(file + ": " + file.exists());
        } catch (java.io.IOException e) {
            e.printStackTrace();
        }
        return res;
    }

P.S. Can you also try https://github.com/HumbleUI/Skija and see if the problem also exists there? This repo is not updated anymore