Java io ioexception problem reading font data

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.io.IOException: Problem reading font data. #5

java.io.IOException: Problem reading font data. #5

Comments

Hi. I got cronometer to build successfully on Linux, with output:

$ ant . BUILD SUCCESSFUL Total time: 9 seconds

When I try to run it, however, there’s a problem:

$ ./start_cronometer.sh Loading index. Loading index. Loading Deprecated index. Loaded 62 foods. Loading index. Loading Deprecated index. Loaded 10324 foods. java.io.IOException: Problem reading font data. at java.desktop/java.awt.Font.createFont0(Unknown Source) at java.desktop/java.awt.Font.createFont(Unknown Source) at ca.spaz.gui.IconFont.getIconFont(Unknown Source) at ca.spaz.gui.IconFont.createIconFontButton(Unknown Source) at ca.spaz.cron.ui.DailySummary.getTodayButton(Unknown Source) at ca.spaz.cron.ui.DailySummary.getToolbar(Unknown Source) at ca.spaz.cron.ui.DailySummary.initialize(Unknown Source) at ca.spaz.cron.ui.DailySummary.init>(Unknown Source) at ca.spaz.cron.Cronometer.getDailySummary(Unknown Source) at ca.spaz.cron.Cronometer.getMainPanel(Unknown Source) at ca.spaz.cron.Cronometer.initGUI(Unknown Source) at ca.spaz.cron.Cronometer.main(Unknown Source) Exception in thread "main" java.lang.InternalError: java.lang.reflect.InvocationTargetException at java.desktop/sun.font.FontManagerFactory$1.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.desktop/sun.font.FontManagerFactory.getInstance(Unknown Source) at java.desktop/java.awt.Font.getFont2D(Unknown Source) at java.desktop/java.awt.Font.getFamily(Unknown Source) at java.desktop/java.awt.Font.getFamily_NoClientCode(Unknown Source) at java.desktop/java.awt.Font.getFamily(Unknown Source) at java.desktop/sun.swing.SwingUtilities2.displayPropertiesToCSS(Unknown Source) at java.desktop/javax.swing.plaf.basic.BasicHTML$BasicDocument.setFontAndColor(Unknown Source) at java.desktop/javax.swing.plaf.basic.BasicHTML$BasicDocument.init>(Unknown Source) at java.desktop/javax.swing.plaf.basic.BasicHTML$BasicEditorKit.createDefaultDocument(Unknown Source) at java.desktop/javax.swing.plaf.basic.BasicHTML.createHTMLView(Unknown Source) at java.desktop/javax.swing.plaf.basic.BasicHTML.updateRenderer(Unknown Source) at java.desktop/javax.swing.plaf.basic.BasicLabelUI.installComponents(Unknown Source) at java.desktop/javax.swing.plaf.basic.BasicLabelUI.installUI(Unknown Source) at java.desktop/javax.swing.JComponent.setUI(Unknown Source) at java.desktop/javax.swing.JLabel.setUI(Unknown Source) at java.desktop/javax.swing.JLabel.updateUI(Unknown Source) at java.desktop/javax.swing.JLabel.init>(Unknown Source) at java.desktop/javax.swing.JLabel.init>(Unknown Source) at ca.spaz.gui.ErrorReporter.init>(Unknown Source) at ca.spaz.gui.ErrorReporter.showError(Unknown Source) at ca.spaz.gui.IconFont.getIconFont(Unknown Source) at ca.spaz.gui.IconFont.createIconFontButton(Unknown Source) at ca.spaz.cron.ui.DailySummary.getTodayButton(Unknown Source) at ca.spaz.cron.ui.DailySummary.getToolbar(Unknown Source) at ca.spaz.cron.ui.DailySummary.initialize(Unknown Source) at ca.spaz.cron.ui.DailySummary.init>(Unknown Source) at ca.spaz.cron.Cronometer.getDailySummary(Unknown Source) at ca.spaz.cron.Cronometer.getMainPanel(Unknown Source) at ca.spaz.cron.Cronometer.initGUI(Unknown Source) at ca.spaz.cron.Cronometer.main(Unknown Source) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source) . 32 more Caused by: java.lang.NullPointerException at java.desktop/sun.awt.FontConfiguration.getVersion(Unknown Source) at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(Unknown Source) at java.desktop/sun.awt.FontConfiguration.init(Unknown Source) at java.desktop/sun.awt.X11FontManager.createFontConfiguration(Unknown Source) at java.desktop/sun.font.SunFontManager$2.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.desktop/sun.font.SunFontManager.init>(Unknown Source) at java.desktop/sun.awt.FcFontManager.init>(Unknown Source) at java.desktop/sun.awt.X11FontManager.init>(Unknown Source) . 37 more

Cronometer won’t start due to this bug.

The text was updated successfully, but these errors were encountered:

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.io.IOException: Problem reading font data when using bootBuildImage #29972

java.io.IOException: Problem reading font data when using bootBuildImage #29972

Comments

we are trying to switch from using jib for creating the docker images to using Spring Boot built in buildpacks with bootBuildImage but are having problems in the resulting image when using JasperRerports:

Caused by: java.io.IOException: Problem reading font data. at java.desktop/java.awt.Font.createFont0(Unknown Source) ~[na:na] at java.desktop/java.awt.Font.createFont(Unknown Source) ~[na:na] at net.sf.jasperreports.engine.fonts.SimpleFontFace.(SimpleFontFace.java:100) 

it seems like there are not fonts configured in the resulting docker image — is there a way to add those?

The text was updated successfully, but these errors were encountered:

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem reading font data from the resources folder on Lambda with Corretto #317

Problem reading font data from the resources folder on Lambda with Corretto #317

Comments

The issue is potentially related to corretto/corretto-11#118

 SimpleJasperReportsContext context = new SimpleJasperReportsContext(); // Raleway SimpleFontFamily raleway = new SimpleFontFamily(context); raleway.setName("Raleway"); raleway.setPdfEmbedded(true); raleway.setPdfEncoding("Identity-H"); SimpleFontFace ralewayRegular = new SimpleFontFace(context); ralewayRegular.setTtf("fonts/Raleway/Raleway-Regular.ttf"); raleway.setNormalFace(ralewayRegular); // Raleway SemiBold SimpleFontFamily ralewaySemiBold = new SimpleFontFamily(context); ralewaySemiBold.setName("Raleway SemiBold"); ralewaySemiBold.setPdfEmbedded(true); ralewaySemiBold.setPdfEncoding("Identity-H"); SimpleFontFace ralewaySemiBoldRegular = new SimpleFontFace(context); ralewaySemiBoldRegular.setTtf("fonts/RalewaySemiBold/Raleway-SemiBold.ttf"); ralewaySemiBold.setNormalFace(ralewaySemiBoldRegular); context.setExtensions(FontFamily.class, Arrays.asList(raleway, ralewaySemiBold)); 

the ttf is present in the resources folder

and during invoking the lambda function got the next exception message:

Caused by: net.sf.jasperreports.engine.fonts.InvalidFontException: Error loading font "fonts/Raleway/Raleway-Regular.ttf". at net.sf.jasperreports.engine.fonts.SimpleFontFace.loadFont(SimpleFontFace.java:206) at net.sf.jasperreports.engine.fonts.SimpleFontFace.setTtf(SimpleFontFace.java:167) at net.sf.jasperreports.engine.fonts.SimpleFontFace.setTtf(SimpleFontFace.java:157) . Caused by: java.io.IOException: Problem reading font data. at java.desktop/java.awt.Font.createFont0(Unknown Source) at java.desktop/java.awt.Font.createFont(Unknown Source) at net.sf.jasperreports.engine.fonts.SimpleFontFace.loadFont(SimpleFontFace.java:198) . 15 more 

this issue is related to Java8 Corretto and Java11 Corretto

The text was updated successfully, but these errors were encountered:

Источник

Читайте также:  Detect file encoding java
Оцените статью