JavaFX application cannot detect fonts

I have a JavaFX snap which returns errors because it seems to not see fonts. I have tried the debugging steps here for JavaFX which gives me the following output.

$ bisq-desktop
Picked up JAVA_TOOL_OPTIONS: -Duser.home=/home/david/snap/bisq-desktop/common -Dprism.debugfonts=true -Dprism.fontdir=/snap/bisq-desktop/x10/etc/fonts -Dprism.useFontConfig=false
Mar-21 15:39:27.056 [main] INFO  bisq.core.setup.CoreSetup:


Log files under: /home/david/snap/bisq-desktop/common/.local/share/Bisq/bisq
Mar-21 15:39:27.070 [main] INFO  bisq.common.util.Utilities: System info: os.name=Linux; os.version=5.5.9-arch1-2; os.arch=amd64; sun.arch.data.model=64; JRE=11.0.6+10-post-Ubuntu-1ubuntu118.04.1 (Ubuntu); JVM=11.0.6+10-post-Ubuntu-1ubuntu118.04.1 (OpenJDK 64-Bit Server VM)
Mar-21 15:39:27.072 [main] INFO  b.c.s.CoreNetworkCapabilities: Set Capability.RECEIVE_BSQ_BLOCK
Mar-21 15:39:27.246 [main] INFO  bisq.common.app.Version: Version{VERSION=1.2.9, P2P_NETWORK_VERSION=1, LOCAL_DB_VERSION=1, TRADE_PROTOCOL_VERSION=2, BASE_CURRENCY_NETWORK=0, getP2PNetworkId()=10}
Mar-21 15:39:27.246 [main] INFO  bisq.core.setup.CoreSetup: Path to Bisq jar file: /snap/bisq-desktop/x10/usr/lib/common.jar
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/snap/bisq-desktop/x10/usr/lib/guice-4.2.2.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Mar-21 15:39:29.781 [JavaFX Application Thread] WARN  b.c.p.ProvidersRepository: We have banned provider nodes: bannedNodes=[], selected provider baseUrl=http://62nvujg5iou3vu3i.onion/, providerList=[http://62nvujg5iou3vu3i.onion/, http://44mgyoe2b6oqiytt.onion/, http://ceaanhbvluug4we6.onion/, http://xc3nh4juf2hshy7e.onion/, http://gztmprecgqjq64zh.onion/]
Mar-21 15:39:29.815 [JavaFX Application Thread] INFO  b.c.n.p.s.DefaultSeedNodeRepository: Seed nodes: [723ljisnynbtdohi.onion:8000, fl3mmribyxgrv63c.onion:8000, s67qglwhkgkyvr74.onion:8000, 3f3cu2yw7u457ztq.onion:8000, rm7b56wbrcczpjvl.onion:8000, jhgcy2won7xnslrb.onion:8000, 5quyxpxheyvzmb2d.onion:8000, ef5qnzx6znifo3df.onion:8000]
Mar-21 15:39:30.133 [JavaFX Application Thread] INFO  b.c.s.CoreNetworkCapabilities: Set Capability.RECEIVE_BSQ_BLOCK
Mar-21 15:39:30.513 [JavaFX Application Thread] INFO  b.c.btc.nodes.LocalBitcoinNode: No local Bitcoin node detected on port 8333.
Loading FontFactory com.sun.javafx.font.freetype.FTFactory
Subpixel: enabled
Freetype2 Loaded (version 2.8.1)
LCD support Enabled
Not using FontConfig
Fontconfig returned no font for sans:regular:roman
Fontconfig returned no font for sans:bold:roman
Fontconfig returned no font for sans:regular:italic
Fontconfig returned no font for sans:bold:italic
Fontconfig returned no font for serif:regular:roman
Fontconfig returned no font for serif:bold:roman
Fontconfig returned no font for serif:regular:italic
Fontconfig returned no font for serif:bold:italic
Fontconfig returned no font for monospace:regular:roman
Fontconfig returned no font for monospace:bold:roman
Fontconfig returned no font for monospace:regular:italic
Fontconfig returned no font for monospace:bold:italic
Error: JavaFX detected no fonts! Please refer to release notes for proper font configuration

My Snap config is here:

name: bisq-desktop
base: core18
version: git
summary: Peer-to-peer exchange to trade various curriencies for bitcoin
description: |
  Cross-platform desktop application that allows users to trade national currency (dollars, euros, etc) for bitcoin without relying on centralized exchanges
confinement: strict
grade: stable
icon: snap/local/icon.png

apps:
  bisq-desktop:
    extensions:
      - gnome-3-28
    command: bisq-desktop
    plugs:
      - network
      - network-bind
      - desktop
      - desktop-legacy
      - x11
      - wayland
      - home
      - gsettings
      - camera
      - opengl
    desktop: usr/share/applications/bisq.desktop
    environment:
      JAVA_HOME: "$SNAP/usr/lib/jvm/java-11-openjdk-amd64"
      JAVA_TOOL_OPTIONS: "-Duser.home=$SNAP_USER_COMMON -Dprism.debugfonts=true -Dprism.fontdir=$SNAP/etc/fonts -Dprism.useFontConfig=false"

parts:
  bisq:
    plugin: gradle
    override-build: |
      ./gradlew build -x test

      # Install executable and jars
      install -d "${SNAPCRAFT_PART_INSTALL}/opt/bisq"
      cp desktop/build/app/bin/bisq-desktop "${SNAPCRAFT_PART_INSTALL}/usr/bin"
      cp -r desktop/build/app/lib/* "${SNAPCRAFT_PART_INSTALL}/usr/lib"

      # Install desktop launcher icon
      install -Dm644 desktop/package/linux/icon.png "${SNAPCRAFT_PART_INSTALL}/usr/share/pixmaps/bisq.png"

    source: .
    build-packages:
      - openjdk-11-jdk
    stage-packages:
      - libgl1
      - libglx0
      - libxtst6
      - libxxf86vm1
      - libv4l-0
      - libasound2
      - freeglut3
      - libgtk2.0-0
      - libavcodec57
      - libavformat57
      - openjfx
      - ttf-dejavu
      - ttf-ubuntu-font-family
      - fonts-open-sans

  # Install desktop launcher
  launchers:
    plugin: dump
    source: snap/local
    organize:
      'bisq.desktop': usr/share/applications/bisq.desktop

This is a new thread for my past thread for the same issue which I thought I had solved. I never really solved it, but instead worked around the issue by unpacking a .deb. Any help would be appreciated. I feel like the snap is very close, but I cannot figure out why the application cannot find fonts.

Past forum thread: Help with JavaFX snap

I did notice that the gnome-platform directory for the snap was empty and that is where the FONTCONFIG_PATH environment variable is pointing. I’m not sure if that is a bug in the extension but I’m hoping someone here can tell me.

Source is here: https://github.com/dmp1ce/bisq

Try removing your customisations which appear to be telling your app to not use fontconfig at all.

I had those options there to attempt to debug. Here is the output with all the options removed. I still get the missing fonts error.

JAVA_TOOL_OPTIONS: "-Duser.home=$SNAP_USER_COMMON"
$ bisq-desktop
Picked up JAVA_TOOL_OPTIONS: -Duser.home=/home/david/snap/bisq-desktop/common
Mar-23 08:25:25.225 [main] INFO  bisq.core.setup.CoreSetup:


Log files under: /home/david/snap/bisq-desktop/common/.local/share/Bisq/bisq
Mar-23 08:25:25.235 [main] INFO  bisq.common.util.Utilities: System info: os.name=Linux; os.version=5.5.10-arch1-1; os.arch=amd64; sun.arch.data.model=64; JRE=11.0.6+10-post-Ubuntu-1ubuntu118.04.1 (Ubuntu); JVM=11.0.6+10-post-Ubuntu-1ubuntu118.04.1 (OpenJDK 64-Bit Server VM)
Mar-23 08:25:25.237 [main] INFO  b.c.s.CoreNetworkCapabilities: Set Capability.RECEIVE_BSQ_BLOCK
Mar-23 08:25:25.415 [main] INFO  bisq.common.app.Version: Version{VERSION=1.2.9, P2P_NETWORK_VERSION=1, LOCAL_DB_VERSION=1, TRADE_PROTOCOL_VERSION=2, BASE_CURRENCY_NETWORK=0, getP2PNetworkId()=10}
Mar-23 08:25:25.415 [main] INFO  bisq.core.setup.CoreSetup: Path to Bisq jar file: /snap/bisq-desktop/x1/usr/lib/common.jar
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/snap/bisq-desktop/x1/usr/lib/guice-4.2.2.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Mar-23 08:25:28.089 [JavaFX Application Thread] WARN  b.c.p.ProvidersRepository: We have banned provider nodes: bannedNodes=[], selected provider baseUrl=http://xc3nh4juf2hshy7e.onion/, providerList=[http://xc3nh4juf2hshy7e.onion/, http://gztmprecgqjq64zh.onion/, http://44mgyoe2b6oqiytt.onion/, http://ceaanhbvluug4we6.onion/, http://62nvujg5iou3vu3i.onion/]
Mar-23 08:25:28.131 [JavaFX Application Thread] INFO  b.c.n.p.s.DefaultSeedNodeRepository: Seed nodes: [723ljisnynbtdohi.onion:8000, fl3mmribyxgrv63c.onion:8000, s67qglwhkgkyvr74.onion:8000, 3f3cu2yw7u457ztq.onion:8000, rm7b56wbrcczpjvl.onion:8000, jhgcy2won7xnslrb.onion:8000, 5quyxpxheyvzmb2d.onion:8000, ef5qnzx6znifo3df.onion:8000]
Mar-23 08:25:28.208 [JavaFX Application Thread] INFO  b.c.s.CoreNetworkCapabilities: Set Capability.RECEIVE_BSQ_BLOCK
Mar-23 08:25:28.640 [JavaFX Application Thread] INFO  b.c.btc.nodes.LocalBitcoinNode: No local Bitcoin node detected on port 8333.
Error: JavaFX detected no fonts! Please refer to release notes for proper font configuration
Mar-23 08:25:29.454 [JavaFX Application Thread] ERROR bisq.desktop.app.BisqApp: Error during app init java.lang.ExceptionInInitializerError: null
        at bisq.desktop.main.MainView$1.computeValue(MainView.java:265)
        at bisq.desktop.main.MainView$1.computeValue(MainView.java:246)
        at javafx.beans.binding.ObjectBinding.get(ObjectBinding.java:151)
        at javafx.beans.binding.ObjectExpression.getValue(ObjectExpression.java:49)
        at com.sun.javafx.binding.ExpressionHelper.addListener(ExpressionHelper.java:53)
        at javafx.beans.binding.ObjectBinding.addListener(ObjectBinding.java:71)
        at javafx.beans.property.ObjectPropertyBase.bind(ObjectPropertyBase.java:174)
        at bisq.desktop.main.MainView.initialize(MainView.java:246)
        at bisq.desktop.common.view.InitializableView.initialize(InitializableView.java:41)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2573)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
        at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)
        at bisq.desktop.common.fxml.FxmlViewLoader.loadFromFxml(FxmlViewLoader.java:100)
        at bisq.desktop.common.fxml.FxmlViewLoader.load(FxmlViewLoader.java:89)
        at bisq.desktop.common.view.CachingViewLoader.load(CachingViewLoader.java:41)
        at bisq.desktop.app.BisqApp.loadMainView(BisqApp.java:260)
        at bisq.desktop.app.BisqApp.startApplication(BisqApp.java:131)
        at bisq.desktop.app.BisqAppMain.startApplication(BisqAppMain.java:129)
        at bisq.core.app.BisqExecutable.onApplicationLaunched(BisqExecutable.java:124)
        at bisq.desktop.app.BisqAppMain.onApplicationLaunched(BisqAppMain.java:97)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
        at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
        at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NullPointerException: null
        at com.sun.javafx.font.LogicalFont.<init>(LogicalFont.java:181)
        at com.sun.javafx.font.LogicalFont.getLogicalFont(LogicalFont.java:113)
        at com.sun.javafx.font.LogicalFont.getLogicalFont(LogicalFont.java:153)
        at com.sun.javafx.font.PrismFontFactory.createFont(PrismFontFactory.java:579)
        at com.sun.javafx.font.PrismFontLoader.loadFont(PrismFontLoader.java:224)
        at javafx.scene.text.Font.<init>(Font.java:346)
        at javafx.scene.text.Font.getDefault(Font.java:110)
        at javafx.scene.control.Tooltip.<clinit>(Tooltip.java:590)
        ... 27 common frames omitted

java.lang.ExceptionInInitializerError: null
        at bisq.desktop.main.MainView$1.computeValue(MainView.java:265)
        at bisq.desktop.main.MainView$1.computeValue(MainView.java:246)
        at javafx.beans.binding.ObjectBinding.get(ObjectBinding.java:151)
        at javafx.beans.binding.ObjectExpression.getValue(ObjectExpression.java:49)
        at com.sun.javafx.binding.ExpressionHelper.addListener(ExpressionHelper.java:53)
        at javafx.beans.binding.ObjectBinding.addListener(ObjectBinding.java:71)
        at javafx.beans.property.ObjectPropertyBase.bind(ObjectPropertyBase.java:174)
        at bisq.desktop.main.MainView.initialize(MainView.java:246)
        at bisq.desktop.common.view.InitializableView.initialize(InitializableView.java:41)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2573)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
        at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)
        at bisq.desktop.common.fxml.FxmlViewLoader.loadFromFxml(FxmlViewLoader.java:100)
        at bisq.desktop.common.fxml.FxmlViewLoader.load(FxmlViewLoader.java:89)
        at bisq.desktop.common.view.CachingViewLoader.load(CachingViewLoader.java:41)
        at bisq.desktop.app.BisqApp.loadMainView(BisqApp.java:260)
        at bisq.desktop.app.BisqApp.startApplication(BisqApp.java:131)
        at bisq.desktop.app.BisqAppMain.startApplication(BisqAppMain.java:129)
        at bisq.core.app.BisqExecutable.onApplicationLaunched(BisqExecutable.java:124)
        at bisq.desktop.app.BisqAppMain.onApplicationLaunched(BisqAppMain.java:97)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
        at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
        at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)