I have created a Birt
report in which I defined a Segoeuii font-family to the text it works fine in windows but when it come of Unix OS it change all the fonts to the Times new Roman it is somehow because the font is not present in the Unix file system and Birt
does not register the font that is not in the file system so we need to register the fonts first so using FontFactory
I register the font and than set this font in the property but still it displaying Times new Roman .
Here is my code.
public void testCode() {
URL font = Thread.currentThread().getContextClassLoader().getResource("segoeuii.ttf"); // getResourceAsStream("segoeuii.ttf");
TextItemHandle text = (TextItemHandle) designHandle.findElement("TextProbingAttacks");
FontFactory.register(font.toString(), "test_font");
Font myfont = FontFactory.getFont("test_font");
try {
text.setProperty("fontFamily", myfont);
} catch (SemanticException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}