I would like to integrate a custom font into a synth style. I found a possible answer here but the interesting part - the xml - is not visible on that site.
Could some one explain to me, how to integrate this custom object into the xml?
I figured it out by myself. For everyone searching for this topic, here's the solution.
Create a new class:
public class CustomFontResource {
public static FontUIResource createFont(String path, final int size) {
Font font = Font.createFont(Font.TRUETYPE_FONT,
new FileInputStream(path));
FontUIResource fontResource = new FontUIResource(font.deriveFont(
Font.PLAIN, size));
return fontResource;
}
}
I figured it out by myself. For everyone searching for this topic, here's the solution. Create a new class:
Add this to the style.xml: