Closed KiraLis39 closed 1 month ago
Used: Java -> jdk 22.0.2
JME -> jme3-lwjgl3 3.7.0-beta1.2.2 (jme in Desktop app mode)
Freetype -> `
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-freetype</artifactId>
<version>3.3.4</version>
<classifier>natives-windows</classifier>
<scope>runtime</scope>
</dependency>`
A required function is missing: FT_Get_Default_Named_Instance
It seems the problem is version of lib freetype. This function is add in freetype 2.13.1, I don't know what version does lwjgl3.3.4 use.
Could you try to use a lower version of lwjgl3? like 3.3.2? I will check lwjgl3's dependency later.
I can't reproduce the issue. I think the problem is freetype natives and library version not match.
try to add all these dependencies to your pom.xml
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>3.3.4</version>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-freetype</artifactId>
<version>3.3.4</version>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<classifier>natives-windows</classifier>
<version>3.3.4</version>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-freetype</artifactId>
<classifier>natives-windows</classifier>
<version>3.3.4</version>
</dependency>
and try this demo:
public class TestFtLibrary {
public static void main(String[] args) {
try (FtLibrary lib = new FtLibrary()) {
System.out.println("freetype version:" + lib.getVersion());
} catch (Throwable e) {
e.printStackTrace();
}
}
}
and try this demo:
public class TestFtLibrary {
public static void main(String[] args) {
try (FtLibrary lib = new FtLibrary()) {
System.out.println("freetype version:" + lib.getVersion());
} catch (Throwable e) {
e.printStackTrace();
}
}
}
A required function is missing: FT_Get_Default_Named_Instance
It seems the problem is version of lib freetype. This function is add in freetype 2.13.1, I don't know what version does lwjgl3.3.4 use.
Could you try to use a lower version of lwjgl3? like 3.3.2? I will check lwjgl3's dependency later.
lwjgl 3.3.2 use freetype version 2.13.0
, and lwjgl 3.3.4 use freetype version 2.13.2
. Which add new function FT_Get_Default_Named_Instance.
https://chromium.googlesource.com/chromium/src/third_party/freetype2/+/master/docs/CHANGES#59
jme3-freetype-font itself use lwjgl 3.3.2, if means 4 dependencies:
Your pom only changed one version of them. Add every denpendency to you pom or just keep them 3.3.2.
try to add all these dependencies to your pom.xml
<dependency> <groupId>org.lwjgl</groupId> <artifactId>lwjgl</artifactId> <version>3.3.4</version> </dependency> <dependency> <groupId>org.lwjgl</groupId> <artifactId>lwjgl-freetype</artifactId> <version>3.3.4</version> </dependency> <dependency> <groupId>org.lwjgl</groupId> <artifactId>lwjgl</artifactId> <classifier>natives-windows</classifier> <version>3.3.4</version> </dependency> <dependency> <groupId>org.lwjgl</groupId> <artifactId>lwjgl-freetype</artifactId> <classifier>natives-windows</classifier> <version>3.3.4</version> </dependency>
To keep the version the same. I suggest use dependency managment.
<properties>
<lwjgl.version>3.3.2</lwjgl.version>
</properties>
<profiles>
<profile>
<id>lwjgl-natives-linux-amd64</id>
<activation>
<os>
<family>unix</family>
<name>linux</name>
<arch>amd64</arch>
</os>
</activation>
<properties>
<lwjgl.natives>natives-linux</lwjgl.natives>
</properties>
</profile>
<profile>
<id>lwjgl-natives-macos-x86_64</id>
<activation>
<os>
<family>mac</family>
<arch>x86_64</arch>
</os>
</activation>
<properties>
<lwjgl.natives>natives-macos</lwjgl.natives>
</properties>
</profile>
<profile>
<id>lwjgl-natives-windows-amd64</id>
<activation>
<os>
<family>windows</family>
<arch>amd64</arch>
</os>
</activation>
<properties>
<lwjgl.natives>natives-windows</lwjgl.natives>
</properties>
</profile>
</profiles>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-bom</artifactId>
<version>${lwjgl.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
A required function is missing: FT_Get_Default_Named_Instance
It seems the problem is version of lib freetype. This function is add in freetype 2.13.1, I don't know what version does lwjgl3.3.4 use.
Could you try to use a lower version of lwjgl3? like 3.3.2? I will check lwjgl3's dependency later.
Yes, I tried to run my app with version 3.3.2 etc. I alternated in different ways. There were other errors, but always an error.
<dependency> <groupId>org.lwjgl</groupId> <artifactId>lwjgl</artifactId> <version>3.3.4</version> </dependency> <dependency> <groupId>org.lwjgl</groupId> <artifactId>lwjgl-freetype</artifactId> <version>3.3.4</version> </dependency> <dependency> <groupId>org.lwjgl</groupId> <artifactId>lwjgl</artifactId> <classifier>natives-windows</classifier> <version>3.3.4</version> </dependency> <dependency> <groupId>org.lwjgl</groupId> <artifactId>lwjgl-freetype</artifactId> <classifier>natives-windows</classifier> <version>3.3.4</version> </dependency>
Yes, I see, Its work. All is good, Thanks a lot.
Everything is fine, but the application often starts with an error, immediately closes. Sometimes it starts normally, sometimes this error. In any case, I ask the authors to quickly update the library to more modern levels, it is very useful.
10.10.24 18:01:04.437 [INFO] th:jME3 Main i.g.j.f.f.FtLibrary.newFace():130 load input data:323768
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffa058cdd01, pid=4408, tid=11328
#
# JRE version: OpenJDK Runtime Environment (22.0.2+9) (build 22.0.2+9-70)
# Java VM: OpenJDK 64-Bit Server VM (22.0.2+9-70, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C 0x00007ffa058cdd01
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# H:\JavaProj\Games\FreyaTheGame\FreyaTheGame3D\hs_err_pid4408.log
[10.698s][warning][os] Loading hsdis library failed
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Process finished with exit code -1073740791 (0xC0000409)
jMonkeyEngine 3.7.0 itself depends on lwjgl 3.3.3, you'd better just keep the same version. Or there must be version conflicts.
I'll release version 0.2.2 to maven center repository, update lwjgl3 version to 3.3.3.
Wow, this is cool. I love Swing, but JME+Swing is a bad idea. This library is a great option. It lacks many things, but I am adding them myself. Like Separator:
addChild(button);
addChild(new LSeparator(LSeparator.Type.HORIZONTAL, 6));
addChild(button2);
addChild(new LSeparator(LSeparator.Type.HORIZONTAL, 6));
addChild(button3);
public class LSeparator extends Container {
public LSeparator() {
this(Type.HORIZONTAL);
}
public LSeparator(Type type) {
this(Type.HORIZONTAL, 3);
}
public LSeparator(Type type, float value) {
switch (type) {
case HORIZONTAL -> setInsets(new Insets3f(value, 0, value, 0));
case VERTICAL -> setInsets(new Insets3f(0, value, 0, value));
}
setAlpha(0);
}
public enum Type {
HORIZONTAL,
VERTICAL
}
}
It's just that Swing has new BodrerLayout(hgap: 6, vgap: 6), but here it doesn't yet.
By the way, I still haven't been able to set up a style for disabled buttons. Is there a way to display button.setEnabled(false) differently?
I try to use this library, but got an error: into constructor of class FtLibrary on line ok(FT_Init_FreeType(ptr))
It happened when call:
FtFontKey key = new FtFontKey("Interface/Fonts/Propaganda.ttf", 16, true);
in my method on app starts: