Skip to content

Commit e6b93e7

Browse files
committed
!479 [206_4] 通过调整字体加载顺序,优先采用软件自带字体,解决Emoji无法显示的问题
1 parent e8b25fd commit e6b93e7

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

devel/206_4.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
# 修复部分emoji显示并且修改字体名字
22

3-
## 2025/07/31
3+
## 如何测试
4+
通过206_4.tmu文件
45

5-
### 如何测试
6+
## 2025/08/01
7+
### What
8+
调整字体加载的顺序,内置的字体会覆盖系统字体,优先使用软件内置的字体,从而解决Emoji无法渲染的问题。
69

7-
通过206_4.tmu文件
10+
### Why
11+
在Debian 12上,存在NotoColorEmoji.ttf文件:
12+
```
13+
/usr/share/texlive/texmf-dist/fonts/truetype/google/noto-emoji/NotoColorEmoji.ttf
14+
```
15+
目前的实现是会选择这个字体,而不是我们内置的字体。然后就会出现法加载字体。
16+
17+
## 2025/07/31
818

919
### What
1020

src/Plugins/Freetype/tt_file.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ tt_font_search_path () {
9292
if (!is_empty (xtt)) {
9393
ret= ret | url (xtt);
9494
}
95-
ret= ret | url ("$TEXMACS_HOME_PATH/fonts/truetype") |
96-
url ("$TEXMACS_PATH/fonts/truetype") |
97-
url ("$TEXMACS_HOME_PATH/fonts/opentype") |
98-
url ("$TEXMACS_PATH/fonts/opentype");
9995
if (os_win () || os_mingw ()) {
10096
ret= ret | url_system ("$windir/Fonts");
10197
}
@@ -142,6 +138,10 @@ tt_font_search_path () {
142138
ret= ret | url_system ("/usr/share/fonts/fonts-cesi");
143139
}
144140
}
141+
ret= ret | url ("$TEXMACS_HOME_PATH/fonts/truetype") |
142+
url ("$TEXMACS_PATH/fonts/truetype") |
143+
url ("$TEXMACS_HOME_PATH/fonts/opentype") |
144+
url ("$TEXMACS_PATH/fonts/opentype");
145145
return ret;
146146
}
147147

0 commit comments

Comments
 (0)