使用带有openjdk的stix-fonts的例外? [英] Exception using stix-fonts with openjdk?

查看:403
本文介绍了使用带有openjdk的stix-fonts的例外?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试创建 SXSSFWorkbook 时出现问题。

异常堆栈跟踪:

java.lang.ArrayIndexOutOfBoundsException: 0
    at sun.font.CompositeFont.getSlotFont(CompositeFont.java:351)
    at sun.font.CompositeGlyphMapper.initMapper(CompositeGlyphMapper.java:81)
    at sun.font.CompositeGlyphMapper.<init>(CompositeGlyphMapper.java:62)
    at sun.font.CompositeFont.getMapper(CompositeFont.java:409)
    at sun.font.CompositeFont.canDisplay(CompositeFont.java:435)
    at java.awt.Font.canDisplayUpTo(Font.java:2063)
    at java.awt.font.TextLayout.singleFont(TextLayout.java:470)
    at java.awt.font.TextLayout.<init>(TextLayout.java:531)
    at FontTest.main(FontTest.java:15)

gradle文件:

compile 'org.apache.poi:poi:3.14'
compile 'org.apache.poi:poi-ooxml:3.14'

环境熨烫:


  • openjdk version1.8.0_141

  • RedHat 7.4

  • wildfly 10.0.0

推荐答案

问题仅发生在红帽版本7.4
报告那里
和红帽子们正在努力修复它这里
我找到的解决方案只是提供字体以强制将Utopia作为java使用的默认字体。

The issue happened only on Red hat version 7.4. it is reported there. and the Red hat guys are working to fix it here. the solution I found is just to provide the fonts in order to force back Utopia as the default font, used by java.

创建以下文件 /etc/fonts/local.conf ,内容如下:

Create the following file /etc/fonts/local.conf with the following content:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer><family>Utopia</family></prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer><family>Utopia</family></prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer><family>Utopia</family></prefer>
  </alias>
  <alias>
    <family>dialog</family>
    <prefer><family>Utopia</family></prefer>
  </alias>
  <alias>
    <family>dialoginput</family>
    <prefer><family>Utopia</family></prefer>
  </alias>
</fontconfig>

确保文件可由正确的用户阅读。

Make sure the file is readable by the correct user.

这篇关于使用带有openjdk的stix-fonts的例外?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆