From 6c82a0363f48866a6992ef8612b617be415a2cca Mon Sep 17 00:00:00 2001 From: Yuki Date: Sat, 28 Feb 2026 09:27:41 +0800 Subject: [PATCH 1/4] wip --- TeXmacs/tests/tmu/206_20.tmu | 58 ++++++++++++++++++++++++++++++++++++ devel/206_20.md | 13 ++++++++ 2 files changed, 71 insertions(+) create mode 100644 TeXmacs/tests/tmu/206_20.tmu create mode 100644 devel/206_20.md diff --git a/TeXmacs/tests/tmu/206_20.tmu b/TeXmacs/tests/tmu/206_20.tmu new file mode 100644 index 0000000000..b565e0f5b9 --- /dev/null +++ b/TeXmacs/tests/tmu/206_20.tmu @@ -0,0 +1,58 @@ +> + +> + +<\body> + Unicode优先级: + + <\itemize> + 当前字体 + + Noto Color Emoji + + + \; + + 不设置字体 + + ♤♡♢♧ + + \\\\ + + \; + + 设置字体为 Arial + + <\with|font|Arial> + ♤♡♢♧ + + \\\\ + + + \; + + 设置字体为 Noto CJK SC + + <\with|font|Noto CJK SC> + ♤♡♢♧ + + \\\\ + + + \; + + 设置字体为 Noto Color Emoji + + <\with|font|Noto Color Emoji> + ♤♡♢♧ + + \\\\ + + + +<\initial> + <\collection> + + + + diff --git a/devel/206_20.md b/devel/206_20.md new file mode 100644 index 0000000000..76c7181828 --- /dev/null +++ b/devel/206_20.md @@ -0,0 +1,13 @@ +# 206_19 修改处于 emoji 范围内的unicode字符的字体优先级 + +## 如何测试 +- 打开 TeXmacs/tests/tmu/206_19.tmu + +## 2026/02/24 +### What +- Unicode优先级: + - 当前字体 + - Noto Color Emoji + +### Why +部分unicode符号在字体中其实有,但是默认会使用 Noto Color Emoji \ No newline at end of file From 0152882530077a0a650e9cff9a373700141b6875 Mon Sep 17 00:00:00 2001 From: Yuki Date: Sat, 28 Feb 2026 13:10:45 +0800 Subject: [PATCH 2/4] wip --- src/Graphics/Fonts/smart_font.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Graphics/Fonts/smart_font.cpp b/src/Graphics/Fonts/smart_font.cpp index de9d0b65ef..9328f600c0 100644 --- a/src/Graphics/Fonts/smart_font.cpp +++ b/src/Graphics/Fonts/smart_font.cpp @@ -1139,6 +1139,11 @@ smart_font_rep::resolve (string c) { // Special handling for emoji characters - bypass font-family restrictions string range= get_unicode_range (c); + // 如果设置了字体,就优先使用当前设置的字体 + if (fn[SUBFONT_MAIN]->supports(c)) { + return sm->add_char(tuple("main"), c); + } + if (range == "emoji") { for (int i= 0; i < N (a); i++) { array parts= trimmed_tokenize (a[i], "="); From 33b740158fdc1631726e0af7c1fee842abdf0bbf Mon Sep 17 00:00:00 2001 From: Yuki Date: Sat, 28 Feb 2026 13:12:12 +0800 Subject: [PATCH 3/4] wip --- src/Graphics/Fonts/smart_font.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Graphics/Fonts/smart_font.cpp b/src/Graphics/Fonts/smart_font.cpp index 9328f600c0..7afa6f16c9 100644 --- a/src/Graphics/Fonts/smart_font.cpp +++ b/src/Graphics/Fonts/smart_font.cpp @@ -1140,8 +1140,8 @@ smart_font_rep::resolve (string c) { // Special handling for emoji characters - bypass font-family restrictions string range= get_unicode_range (c); // 如果设置了字体,就优先使用当前设置的字体 - if (fn[SUBFONT_MAIN]->supports(c)) { - return sm->add_char(tuple("main"), c); + if (fn[SUBFONT_MAIN]->supports (c)) { + return sm->add_char (tuple ("main"), c); } if (range == "emoji") { From 1bacd37691f3b5fa6954bcd6968c1ac0075e743f Mon Sep 17 00:00:00 2001 From: Yuki Date: Sat, 28 Feb 2026 13:22:46 +0800 Subject: [PATCH 4/4] wip --- devel/206_20.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/devel/206_20.md b/devel/206_20.md index 76c7181828..a639f8adee 100644 --- a/devel/206_20.md +++ b/devel/206_20.md @@ -5,9 +5,9 @@ ## 2026/02/24 ### What -- Unicode优先级: - - 当前字体 - - Noto Color Emoji +- 处于 emoji 范围内的Unicode优先级: + - 设置的字体 + - 默认字体 ### Why -部分unicode符号在字体中其实有,但是默认会使用 Noto Color Emoji \ No newline at end of file +部分unicode符号在字体中其实有,但是默认会使用 Noto Color Emoji,而且无法再设置 \ No newline at end of file