Open jsfan3 opened 5 years ago
(Tested in the Simulator)
I've seen the exception in eclipse several times, too. I don't recall if it was harmless or not (it's possible that it failed the build or the simulator start and I started immediately over and it worked), anyway, it wasn't reproducible and it was no problem for me. I don't use any custom fonts or CSS. Just my 2c.
Can you share the font that you are using here?
More details:
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Images.res
java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:5917)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:897)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
java.lang.RuntimeException: java.io.IOException: Problem reading font data.
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:5952)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:897)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:5917)
... 7 more
Retina Scale: 1.0
I have also seen this once now, and only once. It didn't seem to correspond with anything unusual in the app or the generation of the styles. Still not sure what caused it.
I usually see it one or more time every day (but consider that every day I compile hundreds of times... so this occurs rarely).
I haven't been able to track down the source yet. The JDK code swallows the actual exception so we don't really know the true cause. Their code looks like:
...
} catch (Throwable t) {
if (t instanceof FontFormatException) {
throw (FontFormatException)t;
}
if (t instanceof IOException) {
throw (IOException)t;
}
Throwable cause = t.getCause();
if (cause instanceof FontFormatException) {
throw (FontFormatException)cause;
}
throw new IOException("Problem reading font data.");
}
...
One possibility is that java.awt.Font isn't thread-safe. I can't find any information on this either way. I've added a tiny bit of diagnostic code to catch this error condition and provide a little bit more information... but I'm not sure that this will help tremendously.
Ok, if your diagnostic code logs something I'll publish it.
Your diagnostic code doesn't log anything... I'm still see this error during compile:
java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:5917)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:897)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
java.lang.RuntimeException: java.io.IOException: Problem reading font data.
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:5952)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:897)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:5917)
... 7 more
This bug became very annoying, because almost every time that I launch the app I'm developing in the Simulator, I get the already reported exception. The only difference from the previous report is the line number of the JavaSEPort. I'm using Netbeans 10 + Java 8 + CSS enabled. I'm using only native fonts, except for a ttf file I'm using for some icons (you can download this file here: http://www.informatica-libera.net/docLavoro/controller.ttf), with a code like:
@font-face {
font-family: "MyIcons";
src: url(fonts/controller.ttf);
}
java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6334)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1006)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
java.lang.RuntimeException: java.io.IOException: Problem reading font data.
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6369)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1006)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6334)
... 7 more
I have added some more detailed logging around each of the createFont() calls to try to record which font file is triggering the issue. I have also added a test case to the SampleRunner that uses your provided CSS file. If you can run this sample and reproduce the issue, it might help to track this down.
Also, please try to enabling async stack traces temporarily, to see if we can get some more context around the error condition.
Display.getInstance().setEnableAsyncStackTraces(true);
Thank you! Yesterday, after your commit, I downloaded the last sources and I'm compiling the project (that uses that ttf) against the last sources. I've already have setEnableAsyncStackTraces(true)
. However the error log is the same, nothing is changed.
My project is using 10 CSS files (thanks to a modified build.xml) for a total of 1506 lines of CSSes, so this bug can be triggered also by something else than that font (all the other font-families are native).
If the error log is exactly the same, then you must not be running against the latest sources in git. I explicitly add comments to every place where this exception could be thrown.
Yes, it's exactly the same. To update the sources, I use this Bash script:
#!/bin/bash
rm -fR cn1-binaries CodenameOne codenameone-skins
git clone https://github.com/codenameone/CodenameOne
cd CodenameOne && ant javase
Is it right?
In the Property of the Netbeans project, section Libraries, as compile-time library I selected the Codename One project (CodenameOne - dist/CodenameOne.jar), as run-time library I selected the JavaSE port (JavaSE - dist/JavaSE.jar). Is it right?
Compiling the project, I get this log:
ant -f /home/francesco/Projects/SimpleFronted -Dnb.internal.action.name=rebuild clean jar
Generating GUI sources foo
No GUI Entries available
init:
deps-clean:
Updating property file: /home/francesco/Projects/SimpleFronted/build/built-clean.properties
CodenameOne.init:
CodenameOne.deps-clean:
Updating property file: /home/francesco/Projects/SimpleFronted/build/built-clean.properties
Factory.init:
Factory.deps-clean:
Updating property file: /home/francesco/Projects/SimpleFronted/build/built-clean.properties
Deleting directory /home/francesco/CodenameOne/Factory/build
Factory.clean:
Deleting directory /home/francesco/CodenameOne/CodenameOne/build
CodenameOne.clean:
JavaSE.init:
JavaSE.deps-clean:
Updating property file: /home/francesco/Projects/SimpleFronted/build/built-clean.properties
Deleting directory /home/francesco/CodenameOne/Ports/JavaSE/build
JavaSE.clean:
Deleting directory /home/francesco/Projects/SimpleFronted/build
refresh-libs-impl:
Deleting directory /home/francesco/Projects/SimpleFronted/lib/impl
Deleting directory /home/francesco/Projects/SimpleFronted/native/internal_tmp
clean:
Created dir: /home/francesco/Projects/SimpleFronted/native/internal_tmp
Generating GUI sources foo
No GUI Entries available
init:
deps-jar:
Created dir: /home/francesco/Projects/SimpleFronted/build
Updating property file: /home/francesco/Projects/SimpleFronted/build/built-jar.properties
CodenameOne.init:
CodenameOne.deps-jar:
Created dir: /home/francesco/CodenameOne/CodenameOne/build
Updating property file: /home/francesco/Projects/SimpleFronted/build/built-jar.properties
Factory.init:
Factory.deps-jar:
Created dir: /home/francesco/CodenameOne/Factory/build
Updating property file: /home/francesco/Projects/SimpleFronted/build/built-jar.properties
Created dir: /home/francesco/CodenameOne/Factory/build/classes
Created dir: /home/francesco/CodenameOne/Factory/build/empty
Created dir: /home/francesco/CodenameOne/Factory/build/generated-sources/ap-source-output
Compiling 1 source file to /home/francesco/CodenameOne/Factory/build/classes
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
Factory.compile:
Created dir: /home/francesco/CodenameOne/Factory/dist
Building jar: /home/francesco/CodenameOne/Factory/dist/Factory.jar
Factory.jar:
Created dir: /home/francesco/CodenameOne/CodenameOne/build/classes
CodenameOne.initEnv:
Init env executing with cn1env = ${cn1env} for ../../CodenameOne/GUIBuilder/src
CodenameOne.stamp:
Created dir: /home/francesco/CodenameOne/CodenameOne/build/empty
Created dir: /home/francesco/CodenameOne/CodenameOne/build/generated-sources/ap-source-output
Compiling 586 source files to /home/francesco/CodenameOne/CodenameOne/build/classes
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Copying 3 files to /home/francesco/CodenameOne/CodenameOne/build/classes
CodenameOne.compile:
Created dir: /home/francesco/CodenameOne/CodenameOne/dist
Building jar: /home/francesco/CodenameOne/CodenameOne/dist/CodenameOne.jar
CodenameOne.jar:
JavaSE.init:
JavaSE.deps-jar:
Created dir: /home/francesco/CodenameOne/Ports/JavaSE/build
Updating property file: /home/francesco/Projects/SimpleFronted/build/built-jar.properties
Created dir: /home/francesco/CodenameOne/Ports/JavaSE/build/classes
Created dir: /home/francesco/CodenameOne/Ports/JavaSE/build/empty
Created dir: /home/francesco/CodenameOne/Ports/JavaSE/build/generated-sources/ap-source-output
Compiling 24 source files to /home/francesco/CodenameOne/Ports/JavaSE/build/classes
warning: [options] bootstrap class path not set in conjunction with -source 1.7
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
Copying 23 files to /home/francesco/CodenameOne/Ports/JavaSE/build/classes
JavaSE.build-skins:
JavaSE.init-skins:
DEPRECATED - The copydir task is deprecated. Use copy instead.
Copying 1327 files to /home/francesco/CodenameOne/Ports/JavaSE/build/classes
Expanding: /home/francesco/cn1-binaries/javase/sqlite-jdbc-3.7.15-M1.jar into /home/francesco/CodenameOne/Ports/JavaSE/build/classes
Expanding: /home/francesco/cn1-binaries/javase/Filters.jar into /home/francesco/CodenameOne/Ports/JavaSE/build/classes
JavaSE.compile:
Created dir: /home/francesco/CodenameOne/Ports/JavaSE/dist
Building jar: /home/francesco/CodenameOne/Ports/JavaSE/dist/JavaSE.jar
To run this application from the command line without Ant, try:
/usr/lib/jvm/oracle-java8-jdk-amd64/jre/bin/java -cp /home/francesco/CodenameOne/CodenameOne/dist/CodenameOne.jar:/home/francesco/cn1-binaries/javase/sqlite-jdbc-3.7.15-M1.jar:/home/francesco/cn1-binaries/javase/Filters.jar:/home/francesco/cn1-binaries/javafx/lib/javafx.base.jar:/home/francesco/cn1-binaries/javafx/lib/javafx.controls.jar:/home/francesco/cn1-binaries/javafx/lib/javafx.swing.jar:/home/francesco/cn1-binaries/javafx/lib/javafx.web.jar:/home/francesco/cn1-binaries/javafx/lib/javafx.media.jar:/home/francesco/cn1-binaries/javafx/lib/javafx.graphics.jar:/home/francesco/cn1-binaries/javafx/lib/javafx.fxml.jar:/home/francesco/cn1-binaries/javafx/lib:/home/francesco/CodenameOne/Ports/JavaSE/dist/JavaSE.jar com.codename1.impl.javase.Simulator
JavaSE.jar:
Created dir: /home/francesco/Projects/SimpleFronted/build/classes
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Basic.css
Output: /home/francesco/Projects/SimpleFronted/src/Basic.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Basic.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/iOS.css
Output: /home/francesco/Projects/SimpleFronted/src/iOS.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/iOS.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Android.css
Output: /home/francesco/Projects/SimpleFronted/src/Android.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Android.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Images.css
Output: /home/francesco/Projects/SimpleFronted/src/Images.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Images.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Outer.css
Output: /home/francesco/Projects/SimpleFronted/src/Outer.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Outer.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/BaseForm.css
Output: /home/francesco/Projects/SimpleFronted/src/BaseForm.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/BaseForm.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/BaseRegistrationForm.css
Output: /home/francesco/Projects/SimpleFronted/src/BaseRegistrationForm.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/BaseRegistrationForm.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/BaseProfile.css
Output: /home/francesco/Projects/SimpleFronted/src/BaseProfile.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/BaseProfile.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/TeammateController.css
Output: /home/francesco/Projects/SimpleFronted/src/TeammateController.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/TeammateController.res
java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6334)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1006)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
java.lang.RuntimeException: java.io.IOException: Problem reading font data.
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6369)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1006)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6334)
... 7 more
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/WebApp.css
Output: /home/francesco/Projects/SimpleFronted/src/WebApp.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/WebApp.res
Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller
code size and wider device support
Created dir: /home/francesco/Projects/SimpleFronted/build/tmp
Compiling 107 source files to /home/francesco/Projects/SimpleFronted/build/tmp
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Created dir: /home/francesco/Projects/SimpleFronted/build/empty
Created dir: /home/francesco/Projects/SimpleFronted/build/generated-sources/ap-source-output
Compiling 107 source files to /home/francesco/Projects/SimpleFronted/build/classes
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Copying 22 files to /home/francesco/Projects/SimpleFronted/build/classes
compile:
Created dir: /home/francesco/Projects/SimpleFronted/dist
Copying 1 file to /home/francesco/Projects/SimpleFronted/build
Not copying library /home/francesco/Projects/SimpleFronted/override , it's a directory.
Not copying library /home/francesco/Projects/SimpleFronted/lib/impl/cls , it's a directory.
Not copying library /home/francesco/Projects/SimpleFronted/lib/impl/stubs , it's a directory.
Not copying library /home/francesco/Projects/SimpleFronted/native/internal_tmp , it's a directory.
Copy libraries to /home/francesco/Projects/SimpleFronted/dist/lib.
Building jar: /home/francesco/Projects/SimpleFronted/dist/SimpleFronted.jar
To run this application from the command line without Ant, try:
java -jar "/home/francesco/Projects/SimpleFronted/dist/SimpleFronted.jar"
Compiling 4 source files to /home/francesco/Projects/SimpleFronted/native/internal_tmp
Note: /home/francesco/Projects/SimpleFronted/lib/impl/native/javase/com/diamonddevgroup/device/DeviceNativeImpl.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Copying 4 files to /home/francesco/Projects/SimpleFronted/native/internal_tmp
deploy:
jar:
BUILD SUCCESSFUL (total time: 14 seconds)
This morning I spent more than an hour trying to find a test case that always reproduce this issue, without success.
Your comments «in every place where this exception could be thrown» are not reached by the code that throws the exception or, alternatively, ant
doesn't show their output.
However, I note something that could be strange. Please read the start of this log:
ant -f /home/francesco/Projects/SimpleFronted -Dnb.internal.action.name=run run
Generating GUI sources foo
No GUI Entries available
init:
deps-jar:
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Basic.css
Output: /home/francesco/Projects/SimpleFronted/src/Basic.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Basic.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/iOS.css
Output: /home/francesco/Projects/SimpleFronted/src/iOS.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/iOS.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Android.css
Output: /home/francesco/Projects/SimpleFronted/src/Android.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Android.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Images.css
Output: /home/francesco/Projects/SimpleFronted/src/Images.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Images.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Outer.css
Output: /home/francesco/Projects/SimpleFronted/src/Outer.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Outer.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/BaseForm.css
Output: /home/francesco/Projects/SimpleFronted/src/BaseForm.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/BaseForm.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/BaseRegistrationForm.css
Output: /home/francesco/Projects/SimpleFronted/src/BaseRegistrationForm.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/BaseRegistrationForm.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/BaseProfile.css
Output: /home/francesco/Projects/SimpleFronted/src/BaseProfile.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/BaseProfile.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/TeammateController.css
Output: /home/francesco/Projects/SimpleFronted/src/TeammateController.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/TeammateController.res
java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6334)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1006)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/WebApp.css
Output: /home/francesco/Projects/SimpleFronted/src/WebApp.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/WebApp.res
Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller
code size and wider device support
compile:
run:
Retina Scale: 1.0
[EDT] 0:0:0,1 - Codename One revisions: e72cf75cb5c21f23295f0d5ae3be4fc3d45ba5f1
Maybe the strange fact is that com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6334)
is executed at the wrong time, because the Simulator is not opened yet. I suppose that "JaveSEPort" is the Simulator and that it shouldn't be opened until all the sources (including css to res) are compiled. Is that right?
In this case the error is shown multiple times during "compiling only", without launching the Simulator:
ant -f /home/francesco/Projects/SimpleFronted -Dnb.internal.action.name=rebuild clean jar
Generating GUI sources foo
No GUI Entries available
init:
deps-clean:
Deleting directory /home/francesco/Projects/SimpleFronted/build
refresh-libs-impl:
Deleting directory /home/francesco/Projects/SimpleFronted/lib/impl
Deleting directory /home/francesco/Projects/SimpleFronted/native/internal_tmp
clean:
Created dir: /home/francesco/Projects/SimpleFronted/native/internal_tmp
Generating GUI sources foo
No GUI Entries available
init:
deps-jar:
Created dir: /home/francesco/Projects/SimpleFronted/build/classes
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Basic.css
Output: /home/francesco/Projects/SimpleFronted/src/Basic.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Basic.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/iOS.css
Output: /home/francesco/Projects/SimpleFronted/src/iOS.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/iOS.res
java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6334)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1006)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Android.css
Output: /home/francesco/Projects/SimpleFronted/src/Android.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Android.res
java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6334)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1006)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
java.lang.RuntimeException: java.io.IOException: Problem reading font data.
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6369)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1006)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6334)
... 7 more
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Images.css
Output: /home/francesco/Projects/SimpleFronted/src/Images.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Images.res
java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6334)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1006)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
java.lang.RuntimeException: java.io.IOException: Problem reading font data.
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6369)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:406)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:107)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:125)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1006)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6334)
... 7 more
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Outer.css
Output: /home/francesco/Projects/SimpleFronted/src/Outer.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Outer.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/BaseForm.css
Output: /home/francesco/Projects/SimpleFronted/src/BaseForm.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/BaseForm.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/BaseRegistrationForm.css
Output: /home/francesco/Projects/SimpleFronted/src/BaseRegistrationForm.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/BaseRegistrationForm.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/BaseProfile.css
Output: /home/francesco/Projects/SimpleFronted/src/BaseProfile.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/BaseProfile.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/TeammateController.css
Output: /home/francesco/Projects/SimpleFronted/src/TeammateController.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/TeammateController.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/WebApp.css
Output: /home/francesco/Projects/SimpleFronted/src/WebApp.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/WebApp.res
Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller
code size and wider device support
Created dir: /home/francesco/Projects/SimpleFronted/build/tmp
Compiling 109 source files to /home/francesco/Projects/SimpleFronted/build/tmp
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Created dir: /home/francesco/Projects/SimpleFronted/build/empty
Created dir: /home/francesco/Projects/SimpleFronted/build/generated-sources/ap-source-output
Compiling 109 source files to /home/francesco/Projects/SimpleFronted/build/classes
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Copying 22 files to /home/francesco/Projects/SimpleFronted/build/classes
compile:
Created dir: /home/francesco/Projects/SimpleFronted/dist
Copying 1 file to /home/francesco/Projects/SimpleFronted/build
Not copying library /home/francesco/Projects/SimpleFronted/override , it's a directory.
Not copying library /home/francesco/Projects/SimpleFronted/lib/impl/cls , it's a directory.
Not copying library /home/francesco/Projects/SimpleFronted/lib/impl/stubs , it's a directory.
Not copying library /home/francesco/Projects/SimpleFronted/native/internal_tmp , it's a directory.
Copy libraries to /home/francesco/Projects/SimpleFronted/dist/lib.
Building jar: /home/francesco/Projects/SimpleFronted/dist/SimpleFronted.jar
To run this application from the command line without Ant, try:
java -jar "/home/francesco/Projects/SimpleFronted/dist/SimpleFronted.jar"
Compiling 4 source files to /home/francesco/Projects/SimpleFronted/native/internal_tmp
Note: /home/francesco/Projects/SimpleFronted/lib/impl/native/javase/com/diamonddevgroup/device/DeviceNativeImpl.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Copying 4 files to /home/francesco/Projects/SimpleFronted/native/internal_tmp
deploy:
jar:
BUILD SUCCESSFUL (total time: 10 seconds)
My CSS target in build.xml
:
<target name="-cn1-compile-css" if="codename1.cssTheme">
<java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
<jvmarg value="-Dcli=true"/>
<arg value="-css"/>
<arg file="css/Basic.css"/>
<arg file="src/Basic.res"/>
</java>
<java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
<jvmarg value="-Dcli=true"/>
<arg value="-css"/>
<arg file="css/iOS.css"/>
<arg file="src/iOS.res"/>
</java>
<java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
<jvmarg value="-Dcli=true"/>
<arg value="-css"/>
<arg file="css/Android.css"/>
<arg file="src/Android.res"/>
</java>
<java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
<jvmarg value="-Dcli=true"/>
<arg value="-css"/>
<arg file="css/Images.css"/>
<arg file="src/Images.res"/>
</java>
<java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
<jvmarg value="-Dcli=true"/>
<arg value="-css"/>
<arg file="css/Outer.css"/>
<arg file="src/Outer.res"/>
</java>
<java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
<jvmarg value="-Dcli=true"/>
<arg value="-css"/>
<arg file="css/BaseForm.css"/>
<arg file="src/BaseForm.res"/>
</java>
<java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
<jvmarg value="-Dcli=true"/>
<arg value="-css"/>
<arg file="css/BaseRegistrationForm.css"/>
<arg file="src/BaseRegistrationForm.res"/>
</java>
<java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
<jvmarg value="-Dcli=true"/>
<arg value="-css"/>
<arg file="css/BaseProfile.css"/>
<arg file="src/BaseProfile.res"/>
</java>
<java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
<jvmarg value="-Dcli=true"/>
<arg value="-css"/>
<arg file="css/TeammateController.css"/>
<arg file="src/TeammateController.res"/>
</java>
<java jar="${user.home}/.codenameone/designer_1.jar" failonerror="true">
<jvmarg value="-Dcli=true"/>
<arg value="-css"/>
<arg file="css/WebApp.css"/>
<arg file="src/WebApp.res"/>
</java>
</target>
I also noted that failonerror="true"
doesn't stop the ant
execution, so it seems that these multiple exceptions (like in the last reported log) are not detected as errors.
Hi everybody,
I am coming from a total different corner in search for a solution for the Font data bug and still never heard of Codename One, but perhaps my 2 Cents can have a hint?
I made a Springboot Application, including tests which "runs on my computer". The application simulates a simple camera, which generates a numberplate, that means it has to render a Font from EuroPlate.ttf into an image of an empty plate and send it to some consuming API to recognize it graphically.
When I "mvn package" it and build a docker container (some debian, openjdk8-jre image), the application cannot use the included font. I checked the jar, and of course I make no mistakes ;-) it IS available to the application. But strangely when it should load the font, it cannot be "found" by the jvm and puts a well known headline from above. I can reproduce it the problem.
I followed the suggestions of the Java Tutorials and made an InputStream:
InputStream resource = ClassLoader.getSystemResourceAsStream("resources/EuroPlate.ttf"); Font font = Font.createFont(Font.TRUETYPE_FONT, resource); font.deriveFont(105f); return font;
So there a now 3 possible problems:
I tend to the second.
@Semo Thank you for your comment. If you never heard about Codename One, this is the homepage: https://www.codenameone.com/
This is a detailed answer on StackOverflow about how Codename One works: https://stackoverflow.com/a/10646336/2670744
In short words, Codename One allows to write apps that run on multiple platforms (Android, iOS, Windows Phone, desktop, web-app, etc.) using the same Java code, that is transcompiled to the native code of the target platform.
Today, I had the problem maybe twenty times... nearly on every run. It happened despite me not dealing with fonts at all. The stack trace is AFAIK exactly the same as in the simulator.
However, it wasn't the simulator, but a test case of mine which I run from another project using regular Java with JUnit (I use them whenever I expect no platform-specific problems). This is an uncommon setup, however, I believe the problem is the same: Probably a race between EDT wanting the font and the CN initialization. This is my setup (in the main thread) done before anything else:
final CodenameOneImplementation impl = new JavaSEPort();
Display.getInstance().setEnableAsyncStackTraces(true); // (1)
Util.setImplementation(impl);
final JFrame frame = new JFrame(); // (2)
Display.init(frame);
frame.setSize(300, 300);
frame.setVisible(true); // (3)
Commenting out the last line solved the problem and so did replacing it by
CN.callSerially(() -> frame.setVisible(true));
As the problem occurs randomly, it's probably a race. In the code where it happened, there's no other interaction with cn1 except for the above lines.
(1) This didn't change anything, the stack trace looked the same. (2) - (3) This should probably be done on the EDT, but IIRC in Swing, it's fine to do anything with GUI components on any thread before they get visible the first time. I guess, cn1 differs in this point.
@shannah Hi Steve, I have a small news about this old bug. Just now, for the first time, the log reports a new info, that is the font involved in the bug. The news is this line:
Exception while reading font from resource path /com/codename1/impl/javase/Roboto-Thin.ttf
The full log is:
ant -f /home/francesco/Projects/SimpleFronted -Dnb.internal.action.name=run run
Generating GUI sources foo
No GUI Entries available
init:
deps-jar:
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Basic.css
Output: /home/francesco/Projects/SimpleFronted/src/Basic.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Basic.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/iOS.css
Output: /home/francesco/Projects/SimpleFronted/src/iOS.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/iOS.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Android.css
Output: /home/francesco/Projects/SimpleFronted/src/Android.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Android.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Images.css
Output: /home/francesco/Projects/SimpleFronted/src/Images.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Images.res
Exception while reading font from resource path /com/codename1/impl/javase/Roboto-Thin.ttf
java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6745)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:409)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:108)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:126)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1068)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
java.lang.RuntimeException: java.io.IOException: Problem reading font data.
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6794)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:409)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:108)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:126)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1068)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6745)
... 7 more
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/Outer.css
Output: /home/francesco/Projects/SimpleFronted/src/Outer.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/Outer.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/BaseForm.css
Output: /home/francesco/Projects/SimpleFronted/src/BaseForm.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/BaseForm.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/BaseRegistrationForm.css
Output: /home/francesco/Projects/SimpleFronted/src/BaseRegistrationForm.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/BaseRegistrationForm.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/BaseProfile.css
Output: /home/francesco/Projects/SimpleFronted/src/BaseProfile.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/BaseProfile.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/TeammateController.css
Output: /home/francesco/Projects/SimpleFronted/src/TeammateController.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/TeammateController.res
Retina Scale: 1.0
Input: /home/francesco/Projects/SimpleFronted/css/WebApp.css
Output: /home/francesco/Projects/SimpleFronted/src/WebApp.res
Acquiring lock on CSS checksums file /home/francesco/Projects/SimpleFronted/.cn1_css_checksums...
Lock obtained
File has not changed since last compile.
Releasing lock
CSS file successfully compiled. /home/francesco/Projects/SimpleFronted/src/WebApp.res
Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller
code size and wider device support
compile:
run:
Retina Scale: 1.0
[EDT] 0:0:0,0 - Codename One revisions: 7dd4e7d08b3442d90959477ee52a5ae8c4361b29
I have the same issue (happens from time to time, doesn't seem to prevent the compilation of the simulator).
Any updates?
My stacktrace just in case:
Releasing lock
CSS file successfully compiled. /Users/user/NetBeansProjects/myapp/src/theme.res
Exception while reading font from resource path /com/codename1/impl/javase/Roboto-Thin.ttf
java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6883)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:409)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:108)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:126)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1094)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
java.lang.RuntimeException: java.io.IOException: Problem reading font data.
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6932)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:209)
at com.codename1.ui.plaf.UIManager.resetThemeProps(UIManager.java:409)
at com.codename1.ui.plaf.UIManager.<init>(UIManager.java:108)
at com.codename1.ui.plaf.UIManager.getInstance(UIManager.java:126)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1094)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.io.IOException: Problem reading font data.
at java.awt.Font.createFont0(Font.java:1000)
at java.awt.Font.createFont(Font.java:877)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:6883)
... 7 more
I confirm that I still have the same issue.
Do you remember this long discussion, dating back to a problem that existed for three years?
The good news is that after switching from "Oracle Java 8 + Netbeans 10 + Ant" to "OpenJDK 11 + Netbeans 12 + Maven" this bug disappeared.
When I compile a Codename One projects in Netbeans 9 (Java 8), I note that in the log there is a
java.io.IOException: Problem reading font data
. However it seems completely irrelevant, because my app works fine. What can cause thejava.io.IOException: Problem reading font data
? In one of the loaded css I use the@font-face
to load custom icons generated with Fontello, however they are loaded correctly in the app, so I don't understand the meaning of thisjava.io.IOException
.