package bugs;

import javafx.application.Application;
import javafx.embed.swing.SwingNode;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.stage.Stage;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class FontTest extends Application {
    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        Label fxLabel1 = new Label("JavaFX Regular - Package Emoji: 📦"); // 📦 U+1F4E6
        Label fxLabel2 = new Label("JavaFX Bold - Package Emoji: 📦");
        Font fxRegularFont = Font.font("Lucida Grande", FontWeight.NORMAL, 13);
        Font fxBoldFont = Font.font("Lucida Grande", FontWeight.BOLD, 13);
        fxLabel1.setFont(fxRegularFont);
        fxLabel2.setFont(fxBoldFont);
        
        JPanel swingPanel = new JPanel();
        var boxLayout = new BoxLayout(swingPanel, BoxLayout.Y_AXIS);
        swingPanel.setLayout(boxLayout);
        JLabel swingLabel1 = new JLabel("Swing Regular - Package Emoji: 📦");
        JLabel swingLabel2 = new JLabel("Swing Bold - Package Emoji: 📦");
        var swingRegularFont = new java.awt.Font("Lucida Grande", java.awt.Font.PLAIN, 13);
        var swingBoldFont = new java.awt.Font("Lucida Grande", java.awt.Font.BOLD, 13);
        swingLabel1.setFont(swingRegularFont);
        swingLabel2.setFont(swingBoldFont);
        swingPanel.add(swingLabel1);
        swingPanel.add(swingLabel2);
        SwingNode swingNode = new SwingNode();
        swingNode.setContent(swingPanel);
                
        var root = new VBox(fxLabel1, fxLabel2, swingNode);
        root.setPadding(new Insets(8));
        var scene = new Scene(root);
        primaryStage.setScene(scene);
        primaryStage.setTitle("Emoji Rendering Test");
        primaryStage.setMinHeight(110);
        primaryStage.setMinWidth(240);
        primaryStage.show();
    }
}
