I am using SteelSeries gauge Java library. In my code DisplaySingle.setLcdValueFont() has no effect: no matter what font I set, the default font is always used. Has anyone managed to make setLcdValueFont work?
Details: I use DisplaySingle in the following way:
public class ScoreDisplay {
private DisplaySingle display = new DisplaySingle();
public ScoreDisplay() {
display.setLcdUnitString("");
Font font = new Font("serif", Font.PLAIN,30);
if (font == null) {
System.out.println("Font is null");
}
System.out.println(font.toString());
display.setLcdValueFont(font);
display.setLcdColor(LcdColor.AMBER_LCD);
display.setLcdValue(99);
display.setLcdDecimals(0);
display.setLcdValueFont(font);
}
public DisplaySingle getDisplay() {
return display;
}
}
Later in the code, the display gets added to a JPanel:
ScoreDisplay scoreDisplay = new ScoreDisplay();
JPanel panel = new JPanel(new GridLayout(4, 1));
[...]
panel.add(scoreDisplay.getDisplay());
I had a look at the source of DisplaySingle and noticed that its init() method always resets lcdValueFont to a derivative of LCD_DIGITAL_FONT or LCD_STANDARD_FONT, overwriting value set by a call to .setLcdValueFont. The method init() is called in many places, including various set* methods.
I think there is a bug in DisplaySingle but perhaps I just can't make it work?