Skip to content

Commit 64c38cb

Browse files
authored
[212_6] 补充windows平台修复PDF 导出时不可见字符导致的渲染问题 (#3297)
1 parent d77a6e0 commit 64c38cb

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

devel/212_6.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
## 如何测试
44
打开 `TeXmacs/tests/tmu/212_6.tmu`,导出为 PDF,检查零宽空格等不可见字符不会导致渲染异常。
55

6+
## 2026/05/08 补充过滤 Windows 平台上的 `ecrm10` 字体
7+
8+
### What
9+
`pdf_hummus_renderer.cpp` 中,将 `0x17` 的过滤条件从仅 `ecss10` 扩展为同时包含 `ecrm10`
10+
11+
### Why
12+
在 Windows 平台上,零宽空格(U+200B)映射到的字体是 `ecrm10` 而非 `ecss10`,导致之前的修复在 Windows 上未生效。不同平台上的字体映射存在差异,Linux 上为 `ecss10`,Windows 上为 `ecrm10`
13+
614
## 2026/05/07 重新设计不可见字符的过滤方案
715

816
### What

src/Plugins/Pdf/pdf_hummus_renderer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,9 @@ pdf_hummus_renderer_rep::draw (int glyph_index, font_glyphs fn, SI x, SI y,
13361336
int codepoint) {
13371337
// debug_convert << "draw \"" << (char)glyph_index << "\" " << glyph_index
13381338
// << " " << fn->res_name << "\n";
1339-
if (glyph_index == 0x17 && starts (fn->res_name, "ecss10")) return;
1339+
if (glyph_index == 0x17 &&
1340+
(starts (fn->res_name, "ecss10") || starts (fn->res_name, "ecrm10")))
1341+
return;
13401342
// emoji cache for this renderer instance
13411343
static hashmap<index_type, picture> emoji_cache;
13421344
if (is_emoji_character (glyph_index)) {

0 commit comments

Comments
 (0)