JDK-8291469 : [macos] Emoji only render half size on retina display
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: openjfx11,openjfx17,openjfx18
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • CPU: aarch64
  • Submitted: 2022-07-22
  • Updated: 2023-01-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
A DESCRIPTION OF THE PROBLEM :
When using a retina display, AppleColorEmoji font render too small, the emojis only have half of the height and width as it should be.

CTFontStrike get font ref with a CGAffineTransform, the arg matrix has field a and d value 2.0:
fontRef = OS.CTFontCreateWithName(psNameRef, size, matrix);
This works for ordinary font, but not for AppleColorEmoji font. It may be a bug for feature of Core Text.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile the source code and run, a window showing emoji and plain text will show.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Emoji has same height as plain text, and take full width of it's frame.
ACTUAL -
Emoji only occupies 1/4 of its frame, leaving other region as blank space.  

---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.text.Font;
import javafx.stage.Stage;

public class Test extends Application {

    @Override
    public void start(Stage stage) {
        var label = new Label("Text🐶Text");
        label.setFont(new Font(40));

        Scene scene = new Scene(label);
        stage.setWidth(400);
        stage.setHeight(100);
        stage.setScene(scene);

        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }

}

---------- END SOURCE ----------


Comments
There also appears to be clipping on the bottom side of the emoji glyph. I've uploaded Screenshot 2023-01-02 that shows this.
03-01-2023

This fails at least as far back as FX 11 .. probably was always a bug.
04-08-2022

Issue is reproduced on MacOS OS: MacOS (BigSur) OpenJFX 16 : Fail OpenJFX 17: Fail OpenJFX 18.0.2: Fail Emoji is smaller than the Text, screenshot for the same is attached.
28-07-2022