While applying bold and italic style to all font families, the bold and italic styles gets applied to some of the fonts. In some of the cases like Algerian the bold-italic style does not applied. Is there any way for handling these special cases for Algerian and some similar font families for which bold-italic style does not get applied?
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.text.Font;
import javafx.scene.text.FontPosture;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class FontTest extends Application {
public static void main(String[] args) {
// TODO Auto-generated method stub
launch();
}
@Override
public void start(Stage primaryStage) throws Exception {
// TODO Auto-generated method stub
Text t=new Text();
t.setText("Abc");
t.setX(50);
t.setY(50);
Font font = Font.font("Algerian", FontWeight.BOLD, FontPosture.ITALIC, 19);
t.setFont(font);
Group group = new Group(t);
//Creating a Scene by passing the group object, height and width
Scene scene = new Scene(group ,200, 200);
primaryStage.setTitle("Sample Application");
//Adding scene to the stage
primaryStage.setScene(scene);
//Displaying the contents of the stage
primaryStage.show();
}
}