JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
FontSetDemos.java
Go to the documentation of this file.
1package com.jogamp.opengl.demos.graph;
2
3import java.io.IOException;
4
5import com.jogamp.common.util.IOUtil;
6import com.jogamp.graph.font.Font;
7import com.jogamp.graph.font.FontFactory;
8import com.jogamp.graph.font.FontSet;
9
10public class FontSetDemos {
11 public static Font[] getSet01() throws IOException {
12 final Font[] fonts = new Font[11];
13 int i = 0;
14 fonts[i++] = FontFactory.get(FontFactory.UBUNTU).getDefault(); // FontSet.FAMILY_REGULAR, FontSet.STYLE_NONE
17 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeMono.ttf",
18 FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
19 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeMonoBold.ttf",
20 FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
21 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerif.ttf",
22 FontSetDemos.class.getClassLoader(), FontSetDemos.class).getInputStream(), true);
23 return fonts;
24 }
25}
The optional property jogamp.graph.font.ctor allows user to specify the FontConstructor implementatio...
static final FontSet get(final int font)
static final int UBUNTU
Ubuntu is the default font family, {@value}.
static final int STYLE_ITALIC
ITALIC style bit flag, {@value}.
Definition: FontSet.java:60
static final int FAMILY_LIGHT
Font family LIGHT, {@value}.
Definition: FontSet.java:39
Font getDefault()
Returns the family FAMILY_REGULAR with STYLE_NONE as retrieved with get(int, int).
Font get(int family, int stylebits)
static final int STYLE_NONE
Zero style, {@value}.
Definition: FontSet.java:51
Interface wrapper for font implementation.
Definition: Font.java:60