From 4cbf5297af18f541baa5cd5b85017b1a7a5c19c0 Mon Sep 17 00:00:00 2001 From: Sven Göthel Date: Thu, 25 Jan 2024 09:00:20 +0100 Subject: Graph: Drop non-existing 'JAVA' font from FontFactory --- .../opengl/demos/graph/GPUTextRendererListenerBase01.java | 2 +- src/demos/com/jogamp/opengl/demos/util/MiscUtils.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src/demos/com/jogamp/opengl') diff --git a/src/demos/com/jogamp/opengl/demos/graph/GPUTextRendererListenerBase01.java b/src/demos/com/jogamp/opengl/demos/graph/GPUTextRendererListenerBase01.java index 461b0eeab..133c66817 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/GPUTextRendererListenerBase01.java +++ b/src/demos/com/jogamp/opengl/demos/graph/GPUTextRendererListenerBase01.java @@ -441,7 +441,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB public boolean nextFontSet() { try { - final int set = ( fontSet == FontFactory.UBUNTU ) ? FontFactory.JAVA : FontFactory.UBUNTU ; + final int set = ( fontSet == FontFactory.UBUNTU ) ? FontFactory.UBUNTU : FontFactory.UBUNTU ; final Font _font = FontFactory.get(set).getDefault(); if(null != _font) { fontSet = set; diff --git a/src/demos/com/jogamp/opengl/demos/util/MiscUtils.java b/src/demos/com/jogamp/opengl/demos/util/MiscUtils.java index b6e8c26d5..b2dcd1ec2 100644 --- a/src/demos/com/jogamp/opengl/demos/util/MiscUtils.java +++ b/src/demos/com/jogamp/opengl/demos/util/MiscUtils.java @@ -43,6 +43,8 @@ import com.jogamp.opengl.GLContext; import com.jogamp.common.os.Platform; import com.jogamp.common.util.InterruptSource; +import com.jogamp.graph.font.Font; +import com.jogamp.graph.font.FontFactory; public class MiscUtils { public static boolean atob(final String str, final boolean def) { @@ -169,6 +171,15 @@ public class MiscUtils { } catch (final IOException e) { e.printStackTrace(); } } + public static Font getInfoFont() { + try { + return FontFactory.get(FontFactory.UBUNTU).getDefault(); + // return FontFactory.get(FontFactory.SERIF).getDefault(); + } catch(final IOException ioe) { + ioe.printStackTrace(); + return null; + } + } public static class StreamDump extends InterruptSource.Thread { final InputStream is; -- cgit v1.2.3