JPro-one / JPro

The right place to report about bugs or suggest improvements for JPro.
https://www.jpro.one
9 stars 4 forks source link

Text in some cases is underlined in a weird way #180

Open pabulaner opened 2 months ago

pabulaner commented 2 months ago

When text is set to be underlined and it contains letters that extend bellow the baseline (like a 'y'), it is done so in a weird way. Instead of being underlined with one line, it seems to be dotted. Expected behavior would be to see one continues line.

Actual result: image

Expected result: image832

Code to reproduce:

package one.jpro.hellojpro;

import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.text.Font;
import javafx.stage.Stage;

/**
 * Hello JPro application.
 *
 * @author Florian Kirmaier
 */
public class HelloJPro extends Application {

    @Override
    public void start(Stage stage) {
        Label label = new Label("yyyyyy");
        label.setFont(new Font(50));
        label.setUnderline(true);
        label.setAlignment(Pos.CENTER);
        stage.setScene(new Scene(label));
        stage.show();
    }

    /**
     * Application entry point.
     *
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        launch(args);
    }
}
FlorianKirmaier commented 2 months ago

Quick feedback. I can confirm this behavior. It happens with characters that extend downwards. I'm not sure what to do with it - it seems like an intentional browser feature. It is questionable whether it's work to work around this problem.