/* * Copyright 2011 Oracle Corporation, All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ package test; import javafx.application.Application; import javafx.application.Launcher; import javafx.geometry.Bounds; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.effect.BoxBlur; import javafx.scene.text.Font; import javafx.scene.text.FontPosture; import javafx.scene.text.Text; import javafx.stage.Stage; /** * * @author Thor Johannesson */ public class BadJRT13037 extends Application { String content = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`~!@#$%^&*()_+-=[]{}\\|;':\",./<>?"; String numberContent = ""; Group group; Scene scene; double dx = 60.0, dy = 70.0; double x = 10, y = 10; final int NUM_COLUMNS = 15; int i = 0; Text text; Bounds tLogicalBounds; double width = 0, height = 0; @Override public void start(Stage stage) { stage = new Stage(); group = new Group(); scene = new Scene(group, 1024, 768); stage.setScene(scene); for (int i = 0; i < content.length(); ++i) { addText(); } stage.setVisible(true); } void addText() { x = (i % NUM_COLUMNS) * dx + 5.0; y = (i / NUM_COLUMNS) * dy + 60.0; text = new Text(x, y,content.substring(i, i+1)); //text.setFont(new Font(50)); // Times New Roman Italic exaggerates problem text.setFont( Font.font("Times New Roman", FontPosture.ITALIC, 50)); text.setEffect(new BoxBlur(0, 0 , 1)); group.getChildren().add(text); i++; } public static void main(String args[]) { Launcher.launch(BadJRT13037.class, args); } }