aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/font/FontFactory.java')
-rw-r--r--src/jogl/classes/com/jogamp/graph/font/FontFactory.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
index cd39abdfe..eb74c5696 100644
--- a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
+++ b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
@@ -217,4 +217,32 @@ public class FontFactory {
final Character.UnicodeBlock block = Character.UnicodeBlock.of( c );
return block != null && block != Character.UnicodeBlock.SPECIALS;
}
+
+ /** Returns {@link FontSet#getDefault() default} {@link Font} of {@link #getDefault() default} {@link FontSet} or {@code null} if n/a */
+ public static Font getDefaultFont() {
+ try {
+ return getDefault().getDefault();
+ } catch(final IOException ioe) {
+ ioe.printStackTrace();
+ return null;
+ }
+ }
+
+ /** Returns the default symbols {@link Font} or {@code null} if n/a */
+ public static Font getSymbolsFont() {
+ try {
+ return get(SYMBOLS).getDefault();
+ } catch(final IOException ioe) {
+ ioe.printStackTrace();
+ return null;
+ }
+ }
+
+ /** Returns registered fallback {@link Font}, maybe {@code null}. See {@link #setFallbackFont(Font)}. */
+ public static synchronized Font getFallbackFont() {
+ return fallbackFont;
+ }
+ /** Registers given {@link Font} as the default fallback font. */
+ public static synchronized void setFallbackFont(final Font f) { fallbackFont = f; }
+ private static Font fallbackFont = null;
}