We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ArgumentException: Unable to find any font for: GenericFontFamilies.Serif

I am trying to use our Swing application under Projector (https://blog.jetbrains.com/blog/2021/03/11/projector-is-out/​), however Aspose Slides is throwing the following exception. I have lodged a bug with the Projector team (https://youtrack.jetbrains.com/issue/PRJ-465​), but can the Aspose DEV team provide some clues as to what could be the problem here please? The Projector developer has specifically asked:

Unfortunately, it doesn’t help. I need to know which method of AWT is called and with which parameters, just before the library tells “Unable to find any font for: GenericFontFamilies.Serif”.

It would be extremely valuable if Aspose Slides can be used in this environment. Can the Aspose developers please provide this information? Thanks.

java.lang.ExceptionInInitializerError: null
        at com.aspose.slides.internal.m4.do.do(Unknown Source) ~[aspose-slides-21.2-jdk16.jar:21.2]
        at com.aspose.slides.internal.fq.new.do(Unknown Source) ~[aspose-slides-21.2-jdk16.jar:21.2]
        at com.aspose.slides.internal.fq.new.do(Unknown Source) ~[aspose-slides-21.2-jdk16.jar:21.2]
        at com.aspose.slides.internal.fq.new.do(Unknown Source) ~[aspose-slides-21.2-jdk16.jar:21.2]
        at com.aspose.slides.internal.on.implements.do(Unknown Source) ~[aspose-slides-21.2-jdk16.jar:21.2]
        at com.aspose.slides.internal.oq.final.do(Unknown Source) ~[aspose-slides-21.2-jdk16.jar:21.2]
        at com.aspose.slides.internal.oq.final.do(Unknown Source) ~[aspose-slides-21.2-jdk16.jar:21.2]
        at com.aspose.slides.internal.oq.final.do(Unknown Source) ~[aspose-slides-21.2-jdk16.jar:21.2]
        at com.aspose.slides.FontsLoader.do(Unknown Source) ~[aspose-slides-21.2-jdk16.jar:21.2]
        at com.aspose.slides.FontsLoader.loadExternalFonts(Unknown Source) ~[aspose-slides-21.2-jdk16.jar:21.2]
        ...
​        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.jetbrains.projector.server.ProjectorLauncher.main(ProjectorLauncher.kt:44) [projector-server-1.0-SNAPSHOT.jar:?]
Caused by: com.aspose.slides.exceptions.ArgumentException: Unable to find any font for: GenericFontFamilies.Serif
        at com.aspose.slides.internal.hj.int.do(Unknown Source) ~[aspose-slides-21.2-jdk16.jar:21.2]
        at com.aspose.slides.internal.fm.this.<clinit>(Unknown Source) ~[aspose-slides-21.2-jdk16.jar:21.2]
        ... 22 more

@nuix,
Thank you for your query. The exception can be related to the inaccessibility of the default folder with system fonts. Please check the issue with the latest version of Aspose.Slides. There were some fixes for fonts after 21.2. If the issue persists, please share a stack trace.

@nuix,
If the error persists with the latest version of Aspose.Slides, please check the issue with the special build for you:

Many thanks - I will give this a try this week and report back.

Hi - I am afraid both 21.4 and the 12.5 preview fail in the same way. Any other ideas?

java.lang.ExceptionInInitializerError: null
        at com.aspose.slides.internal.ng.do.do(Unknown Source) ~[aspose-slides-pre-21.5-with-fix.jar:21.5]
        at com.aspose.slides.internal.fq.new.do(Unknown Source) ~[aspose-slides-pre-21.5-with-fix.jar:21.5]
        at com.aspose.slides.internal.fq.new.do(Unknown Source) ~[aspose-slides-pre-21.5-with-fix.jar:21.5]
        at com.aspose.slides.internal.fq.new.do(Unknown Source) ~[aspose-slides-pre-21.5-with-fix.jar:21.5]
        at com.aspose.slides.internal.oz.implements.do(Unknown Source) ~[aspose-slides-pre-21.5-with-fix.jar:21.5]
        at com.aspose.slides.internal.o3.short.do(Unknown Source) ~[aspose-slides-pre-21.5-with-fix.jar:21.5]
        at com.aspose.slides.internal.o3.short.do(Unknown Source) ~[aspose-slides-pre-21.5-with-fix.jar:21.5]
        at com.aspose.slides.internal.o3.short.do(Unknown Source) ~[aspose-slides-pre-21.5-with-fix.jar:21.5]
        at com.aspose.slides.FontsLoader.do(Unknown Source) ~[aspose-slides-pre-21.5-with-fix.jar:21.5]
        at com.aspose.slides.FontsLoader.loadExternalFonts(Unknown Source) ~[aspose-slides-pre-21.5-with-fix.jar:21.5]
        ...
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.jetbrains.projector.server.ProjectorLauncher.main(ProjectorLauncher.kt:44) [projector-server-1.0-SNAPSHOT.jar:?]
Caused by: com.aspose.slides.exceptions.ArgumentException: Unable to find any font for: GenericFontFamilies.SansSerif
        at com.aspose.slides.internal.ht.int.do(Unknown Source) ~[aspose-slides-pre-21.5-with-fix.jar:21.5]
        at com.aspose.slides.internal.fm.this.<clinit>(Unknown Source) ~[aspose-slides-pre-21.5-with-fix.jar:21.5]
        ... 22 more

@nuix,
I passed your information to our development team. I will inform you about any progress.

1 Like

If it is helpful, we also use Aspose Words 19.11 and Aspose Cells 19.10 without issue.

@nuix,
It would be great if you could isolate some code example that reproduces the problem.

I don’t have a small sample program as this is a part of a much larger program. However if you have a small Swing GUI program (any will do), run it using Projector and ensure it calls com.aspose.slides.FontsLoader.loadExternalFonts() on Linux - that should be enough to reproduce the problem.

@nuix,
Our development team is continuing to investigate this case. I will inform you about any progress.

1 Like

@nuix,
If we prepare another custom build for you, will you check the issue on your side?

@nuix,
Our development team still has not managed to reproduce the error. We prepared another special release for you. Please check the issue on your side:

Many thanks - it works now!

Can you indicate when this change will be made into an official release? Thanks.

@nuix,
The fix will be included in Aspose.Slides 21.6. This release will be published in the second half of June.

1 Like

The issues you have found earlier (filed as SLIDESJAVA-38531) have been fixed in this update.