java - 如何显示彩色表情符号?
问题描述
我正在 Java-FX 的帮助下开发一个基于窗口的应用程序,我想显示彩色表情符号,但我可以在 Segoe UI Emoji 字体的帮助下显示黑白表情符号,但是如何用这种字体显示彩色表情符号。
package study;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.ScrollPane;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class Study extends Application {
@Override
public void start(Stage stage) {
stage.setWidth(500);
stage.setHeight(500);
Scene scene = new Scene(new Group());
VBox root = new VBox();
final WebView browser = new WebView();
final WebEngine webEngine = browser.getEngine();
ScrollPane scrollPane = new ScrollPane();
scrollPane.setContent(browser);
webEngine.setUserStyleSheetLocation(this.getClass().getClassLoader().
getResource("study/application.css").toString());
webEngine.loadContent("<html><body>Testing <p>😰</p></body></html>");
root.getChildren().addAll(scrollPane);
scene.setRoot(root);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
解决方案
推荐阅读
- javascript - 如何使用数据表在内部拆分值
- javascript - 如何更新在 bootstrap-vue 中单击的按钮
- css - 在 SVG 标签之外添加 SVG Defs
- svelte - 如何触发/强制更新 Svelte 组件
- mysql - 存储过程返回 ER_BAD_NULL_ERROR
- scala - 控制微批量结构化 Spark Streaming
- xamarin - 在 webview xamarin 表单中单击输入和显示键盘时页面不滚动
- excel - 如何创建仅在我选择的单元格上运行的宏?
- javascript - 递归函数无法读取对象属性
- spring-cloud - 如何检索多个 AWS 安全密钥?