public void setFont(Font font) {
if (font == null) {
return;
}
this.font = font;
FontWeight weight = font.isBold() ? FontWeight.BOLD : FontWeight.NORMAL;
FontPosture posture = font.isItalic()
? FontPosture.ITALIC : FontPosture.REGULAR;
this.gc.setFont(javafx.scene.text.Font.font(font.getFamily(),
weight, posture, font.getSize()));
}