Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions TeXmacs/tests/tmu/206_20.tmu
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<TMU|<tuple|1.1.0|2026.2.0>>

<style|<tuple|generic|chinese|table-captions-above|number-europe|preview-ref>>

<\body>
Unicode优先级:

<\itemize>
<item>当前字体

<item>Noto Color Emoji
</itemize>

\;

不设置字体

♤♡♢♧

\<spadesuit\>\<heartsuit\>\<diamondsuit\>\<clubsuit\>

\;

设置字体为 Arial

<\with|font|Arial>
♤♡♢♧

\<spadesuit\>\<heartsuit\>\<diamondsuit\>\<clubsuit\>
</with>

\;

设置字体为 Noto CJK SC

<\with|font|Noto CJK SC>
♤♡♢♧

\<spadesuit\>\<heartsuit\>\<diamondsuit\>\<clubsuit\>
</with>

\;

设置字体为 Noto Color Emoji

<\with|font|Noto Color Emoji>
♤♡♢♧

\<spadesuit\>\<heartsuit\>\<diamondsuit\>\<clubsuit\>
</with>
</body>

<\initial>
<\collection>
<associate|page-medium|paper>
<associate|page-screen-margin|false>
</collection>
</initial>
13 changes: 13 additions & 0 deletions devel/206_20.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 206_19 修改处于 emoji 范围内的unicode字符的字体优先级

## 如何测试
- 打开 TeXmacs/tests/tmu/206_19.tmu

## 2026/02/24
### What
- 处于 emoji 范围内的Unicode优先级:
- 设置的字体
- 默认字体

### Why
部分unicode符号在字体中其实有,但是默认会使用 Noto Color Emoji,而且无法再设置
5 changes: 5 additions & 0 deletions src/Graphics/Fonts/smart_font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> parts= trimmed_tokenize (a[i], "=");
Expand Down