FontListPanel.java
1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.felix.scr.annotations.Component
* org.apache.felix.scr.annotations.Service
* org.apache.felix.webconsole.ConfigurationPrinter
*/
package com.day.image.internal.font;
import com.day.image.font.AbstractFont;
import com.day.image.font.FontListEntry;
import com.day.image.internal.font.FontHelper;
import java.io.PrintWriter;
import java.util.List;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import org.apache.felix.webconsole.ConfigurationPrinter;
@Component
@Service(value={ConfigurationPrinter.class})
public class FontListPanel
implements ConfigurationPrinter {
private static final String TITLE = "GFX supported Fonts";
public String getTitle() {
return "GFX supported Fonts";
}
public void printConfiguration(PrintWriter pw) {
String[] fontPath;
List<FontListEntry> fonts = FontHelper.getInstance().getFontList();
for (FontListEntry fontListEntry : fonts) {
pw.print(fontListEntry.getFacename());
pw.print(", Style:");
pw.print(AbstractFont.styleToDescription(fontListEntry.getStyle()));
if (fontListEntry.getSize() == 0) {
pw.print(", Scalable TrueType Font");
} else {
pw.print(", Size:");
pw.print(fontListEntry.getSize());
}
pw.print(", Provider: ");
pw.print(fontListEntry.getFontProvider());
pw.println();
}
pw.println();
pw.println("*** GFX Font Path:");
for (String fontPathEntry : fontPath = FontHelper.getInstance().getFontPath()) {
pw.println(fontPathEntry);
}
}
}