Skip to content

Commit 3988e37

Browse files
songhahaha66da-liii
authored andcommitted
!487 [206_6] 修复加粗逻辑,避免对emoji字符应用加粗处理
1 parent d89aa58 commit 3988e37

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

TeXmacs/tests/tmu/206_6.tmu

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<TMU|<tuple|1.1.0|2025.1.0>>
2+
3+
<style|<tuple|generic|chinese|number-europe>>
4+
5+
<\body>
6+
<with|font-series|bold|加粗文😀😁本测试>
7+
</body>
8+
9+
<\initial>
10+
<\collection>
11+
<associate|font|Noto Color Emoji>
12+
<associate|font-family|rm>
13+
<associate|page-medium|paper>
14+
<associate|page-screen-margin|false>
15+
</collection>
16+
</initial>

devel/206_6.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# 修复加粗emoji字体闪退问题
2+
3+
## 2025/08/02
4+
5+
### What
6+
7+
修改加粗逻辑,不对emoji做加粗处理
8+
9+
### How
10+
11+
修改poor_bold.cpp文件
12+
13+
### Why
14+
15+
对emoji字体加粗会直接闪退
16+

src/Graphics/Fonts/poor_bold.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "analyze.hpp"
1313
#include "cork.hpp"
1414
#include "font.hpp"
15+
#include "unicode.hpp"
1516
#include "universal.hpp"
1617

1718
/******************************************************************************
@@ -271,6 +272,11 @@ int
271272
poor_bold_font_rep::index_glyph (string s, font_metric& fnm, font_glyphs& fng) {
272273
int c= base->index_glyph (s, fnm, fng);
273274
if (c < 0) return c;
275+
276+
// Check if this is an emoji character, if so, don't apply bolden transform
277+
if (is_emoji_character (c)) {
278+
return c;
279+
}
274280
SI dpen, dtot;
275281
fatten (s, dpen, dtot);
276282
fnm= bolden (fnm, dtot, vertical (dpen));

0 commit comments

Comments
 (0)