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 ----------
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 ----------
- duplicates
-
JDK-8290866 Apple Color Emoji turns gray after JavaFX version 18
- Resolved
- relates to
-
JDK-8290866 Apple Color Emoji turns gray after JavaFX version 18
- Resolved
-
JDK-8263583 Emoji rendering on macOS
- Resolved