JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
FontSet01.java
Go to the documentation of this file.
1package com.jogamp.opengl.test.junit.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 FontSet01 {
11 public static Font[] getSet00() throws IOException {
12 final Font[] fonts = new Font[7];
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 FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
19 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSans.ttf",
20 FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
21 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerif.ttf",
22 FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
23 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerifItalic.ttf",
24 FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
25 return fonts;
26 }
27 public static Font[] getSet01() throws IOException {
28 final Font[] fonts = new Font[11];
29 int i = 0;
30 fonts[i++] = FontFactory.get(FontFactory.UBUNTU).getDefault(); // FontSet.FAMILY_REGULAR, FontSet.STYLE_NONE
33 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeMono.ttf",
34 FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
35 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeMonoBold.ttf",
36 FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
37 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSans.ttf",
38 FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
39 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSansBold.ttf",
40 FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
41 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerif.ttf",
42 FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
43 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerifBold.ttf",
44 FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
45 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerifBoldItalic.ttf",
46 FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
47 fonts[i++] = FontFactory.get(IOUtil.getResource("fonts/freefont/FreeSerifItalic.ttf",
48 FontSet01.class.getClassLoader(), FontSet01.class).getInputStream(), true);
49 return fonts;
50 }
51}
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