diff --git a/build.gradle b/build.gradle index a36fccc..6eefe5c 100644 --- a/build.gradle +++ b/build.gradle @@ -41,6 +41,7 @@ test { useJUnitPlatform() jvmArgs += "--enable-preview" jvmArgs += "--enable-native-access=ALL-UNNAMED" + systemProperty 'java.library.path','/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib:/lib/x86_64-linux-gnu' } publishing { diff --git a/src/test/java/org/freedesktop/cairo/test/FTFontFaceTest.java b/src/test/java/org/freedesktop/cairo/test/FTFontFaceTest.java index d5265df..9d05515 100644 --- a/src/test/java/org/freedesktop/cairo/test/FTFontFaceTest.java +++ b/src/test/java/org/freedesktop/cairo/test/FTFontFaceTest.java @@ -14,6 +14,8 @@ import io.github.jwharm.javagi.interop.Platform; +import java.io.File; + class FTFontFaceTest { private static String TTF_FILE; @@ -22,7 +24,14 @@ class FTFontFaceTest { static void setup() { // These files are going to be in different locations depending on your system. switch (Platform.getRuntimePlatform()) { - case "linux" -> TTF_FILE = "/usr/share/fonts/liberation-serif/LiberationSerif-Regular.ttf"; + case "linux" -> { + // Fedora + TTF_FILE = "/usr/share/fonts/liberation-serif/LiberationSerif-Regular.ttf"; + if (! new File(TTF_FILE).exists()) { + // Ubuntu + TTF_FILE = "/usr/share/fonts/truetype/liberation/LiberationSerif-Regular.ttf"; + } + } case "windows" -> TTF_FILE = "C:\\Windows\\Fonts\\arial.ttf"; case "macos" -> TTF_FILE = "/Library/Fonts/Arial Unicode.ttf"; }