From dc54d0b638b793902de9e4ad02559468c0d7bcf6 Mon Sep 17 00:00:00 2001 From: cirno <13643614+healghost@user.noreply.gitee.com> Date: Wed, 26 Nov 2025 18:11:48 +0800 Subject: [PATCH 1/4] =?UTF-8?q?209=5F5=20=E4=BF=AE=E5=A4=8D=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=AE=AD=E5=A4=B4=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devel/209_5.md | 176 ++++++++++++++++++++++++++++++ src/Graphics/Fonts/smart_font.cpp | 46 ++++++++ 2 files changed, 222 insertions(+) create mode 100644 devel/209_5.md diff --git a/devel/209_5.md b/devel/209_5.md new file mode 100644 index 000000000..f90822108 --- /dev/null +++ b/devel/209_5.md @@ -0,0 +1,176 @@ +# 209_5 修复代码模式下箭头符号显示问题 + +## 如何测试 + +### 测试步骤 + +1. 在TeXmacs中创建一个verbatim/代码块 +2. 在代码块中输入箭头符号,如 `hookrightarrow`、`leftarrow`、`rightarrow` 等 +3. 观察符号是否正确显示 + +### 预期结果 + +#### 修复前 +- 箭头符号在代码模式(tt字体)下显示不正确 +- 数学符号在等宽字体环境中无法正确回退到支持的字体 + +#### 修复后 +- 箭头符号在代码模式下正确显示 +- 等宽字体环境中的数学符号能够正确回退到Unicode字体 +- 保持等宽字体外观 + +## 2024/11/26 + +### What +从C++字体选择机制层面修复TeXmacs代码模式(tt字体)下箭头符号显示不正确的问题 + +### Why + +#### 问题分析 +箭头符号(特别是 `hookrightarrow` 等数学符号)在TeXmacs的代码/verbatim模式(使用tt等宽字体)下显示不正确,而在普通文本模式下显示正常。 + +#### 根本原因 + +当前的字体选择机制在处理等宽字体(tt variant)时,对于数学符号的回退策略不够完善: + +1. **字体回退不足**:在`smart_font.cpp`的`resolve()`函数中,当tt字体不支持某个数学符号时,没有正确回退到支持该符号的Unicode字体 +2. **数学符号特殊处理缺失**:对于等宽字体环境中的数学符号,需要特殊的字体选择逻辑 +3. **Unicode字体优先级**:需要在等宽字体环境中提高Unicode字体对数学符号的支持优先级 + +### How + +#### 方案:修改C++字体选择机制 + +需要修改 `src/Graphics/Fonts/smart_font.cpp` 中的字体解析逻辑,使得在等宽字体(tt variant)环境中遇到数学符号时,能够正确回退到支持该符号的Unicode字体。 + +#### 修改位置 + +在 `smart_font_rep::resolve(string c)` 函数中添加针对等宽字体环境的数学符号处理逻辑。 + +#### 具体实现思路 + +1. **检测等宽字体环境**: + - 判断当前 `variant` 是否为 "tt" 或包含 "tt" + - 判断字符是否为数学符号(箭头、运算符等) + +2. **添加Unicode字体回退**: + - 当检测到等宽字体环境中的数学符号时 + - 优先尝试使用支持该符号的Unicode等宽字体(如Consolas、Courier New) + - 如果Unicode等宽字体不支持,再回退到非等宽的数学字体 + +3. **保持字体一致性**: + - 对于普通ASCII字符,继续使用等宽字体 + - 只对数学符号进行特殊处理 + +#### 实际代码修改 + +**修改位置1:`smart_font_rep::resolve(string c)` 函数** + +在 `for (int attempt= 1; attempt <= FONT_ATTEMPTS; attempt++)` 循环之前添加: + +```cpp +// Special handling for math symbols in monospace (tt) font environment +if (variant == "tt" || ends (variant, "-tt")) { + string range= get_unicode_range (c); + bool is_math_symbol= (range == "arrows" || + range == "mathematical_operators" || + range == "supplemental_mathematical_operators" || + (starts (c, "<") && ends (c, ">") && N (c) > 2)); + + if (is_math_symbol) { + // Try Unicode monospace fonts first + array unicode_mono_fonts; + unicode_mono_fonts << string ("Consolas"); + unicode_mono_fonts << string ("Courier New"); + unicode_mono_fonts << string ("DejaVu Sans Mono"); + unicode_mono_fonts << string ("Liberation Mono"); + unicode_mono_fonts << string ("Menlo"); + + for (int i= 0; i < N (unicode_mono_fonts); i++) { + font cfn= closest_font (unicode_mono_fonts[i], "rm", series, "right", sz, dpi, 1); + if (!is_nil (cfn) && cfn->supports (c)) { + tree key= tuple ("unicode-mono-math", unicode_mono_fonts[i]); + int nr = sm->add_font (key, REWRITE_NONE); + initialize_font (nr); + return sm->add_char (key, c); + } + } + + // Fallback to regular math font if Unicode monospace fonts don't support it + if (math_kind == 0) { + font math_fn= closest_font ("roman", "rm", series, "mathitalic", sz, dpi, 1); + if (!is_nil (math_fn) && math_fn->supports (c)) { + tree key= tuple ("math-fallback-tt"); + int nr = sm->add_font (key, REWRITE_NONE); + initialize_font (nr); + return sm->add_char (key, c); + } + } + } +} +``` + +**修改位置2:`smart_font_rep::initialize_font(int nr)` 函数** + +在 `emoji-font` 处理之后添加: + +```cpp +else if (a[0] == "unicode-mono-math" && N (a) >= 2) + fn[nr]= adjust_subfont ( + closest_font (a[1], "rm", series, "right", sz, dpi, 1)); +else if (a[0] == "math-fallback-tt") + fn[nr]= adjust_subfont ( + closest_font ("roman", "rm", series, "mathitalic", sz, dpi, 1)); +``` + +#### 优势 + +1. **无需修改样式文件**:从底层字体选择机制解决问题 +2. **自动适用所有场景**:任何使用tt字体的地方都会受益 +3. **更好的字体回退**:提供了更智能的字体选择策略 +4. **保持向后兼容**:不影响现有的字体选择逻辑 + +#### 影响范围 + +- **作用域**:影响所有使用tt等宽字体的场景 +- **兼容性**:向后兼容,增强现有功能 +- **性能**:轻微增加字体解析时间,但可忽略不计 +- **平台**:改善跨平台字体支持 + +#### 注意事项 + +1. 需要确保Unicode等宽字体在各平台上可用 +2. 需要测试各种数学符号的显示效果 +3. 需要考虑字体大小和度量的一致性 + +#### 与样式文件方案的对比 + +**样式文件方案(已实现)**: +- 修改 `TeXmacs/styles/source.ts` +- 在verbatim宏中添加 `font|Consolas,Courier New,Courier` 和 `math-font|roman` +- 优点:简单直接,立即生效 +- 缺点:只影响verbatim环境,其他使用tt字体的地方不受影响 + +**C++字体选择方案(本方案)**: +- 修改 `src/Graphics/Fonts/smart_font.cpp` +- 在字体解析层面添加智能回退逻辑 +- 优点:全局生效,所有tt字体环境都受益 +- 缺点:需要重新编译,实现较复杂 + +#### 实现细节说明 + +1. **检测条件**: + - 检查 `variant` 是否为 "tt" 或以 "-tt" 结尾 + - 检查字符是否属于数学符号范围(箭头、数学运算符等) + - 检查字符是否为TeXmacs特殊符号格式(`<...>`) + +2. **字体回退顺序**: + - 首先尝试常见的Unicode等宽字体(Consolas、Courier New、DejaVu Sans Mono、Liberation Mono、Menlo) + - 如果Unicode等宽字体不支持,且不在数学模式下(`math_kind == 0`),则回退到roman数学字体 + - 这样既保证了符号的正确显示,又尽可能保持等宽字体的视觉一致性 + +3. **字体初始化**: + - 为新的字体键 `unicode-mono-math` 和 `math-fallback-tt` 添加初始化逻辑 + - 使用 `adjust_subfont` 确保字体度量正确 + + diff --git a/src/Graphics/Fonts/smart_font.cpp b/src/Graphics/Fonts/smart_font.cpp index 946bde542..1109133bc 100644 --- a/src/Graphics/Fonts/smart_font.cpp +++ b/src/Graphics/Fonts/smart_font.cpp @@ -1211,6 +1211,46 @@ smart_font_rep::resolve (string c) { (c[0] < 'A' || c[0] > 'Z') && (c[0] < 'a' || c[0] > 'z')) return sm->add_char (tuple ("italic-roman"), c); + // Special handling for math symbols in monospace (tt) font environment + if (variant == "tt" || ends (variant, "-tt")) { + string range= get_unicode_range (c); + bool is_math_symbol= (range == "arrows" || + range == "mathematical_operators" || + range == "supplemental_mathematical_operators" || + (starts (c, "<") && ends (c, ">") && N (c) > 2)); + + if (is_math_symbol) { + // Try Unicode monospace fonts first + array unicode_mono_fonts; + unicode_mono_fonts << string ("Consolas"); + unicode_mono_fonts << string ("Courier New"); + unicode_mono_fonts << string ("DejaVu Sans Mono"); + unicode_mono_fonts << string ("Liberation Mono"); + unicode_mono_fonts << string ("Menlo"); + + for (int i= 0; i < N (unicode_mono_fonts); i++) { + font cfn= closest_font (unicode_mono_fonts[i], "rm", series, "right", sz, dpi, 1); + if (!is_nil (cfn) && cfn->supports (c)) { + tree key= tuple ("unicode-mono-math", unicode_mono_fonts[i]); + int nr = sm->add_font (key, REWRITE_NONE); + initialize_font (nr); + return sm->add_char (key, c); + } + } + + // Fallback to regular math font if Unicode monospace fonts don't support it + if (math_kind == 0) { + font math_fn= closest_font ("roman", "rm", series, "mathitalic", sz, dpi, 1); + if (!is_nil (math_fn) && math_fn->supports (c)) { + tree key= tuple ("math-fallback-tt"); + int nr = sm->add_font (key, REWRITE_NONE); + initialize_font (nr); + return sm->add_char (key, c); + } + } + } + } + for (int attempt= 1; attempt <= FONT_ATTEMPTS; attempt++) { if (attempt > 1 && substitute_math_letter (c, math_kind) != "") break; for (int i= 0; i < N (a); i++) { @@ -1281,6 +1321,12 @@ smart_font_rep::initialize_font (int nr) { else if (a[0] == "emoji-font") fn[nr]= adjust_subfont ( closest_font (a[1], "rm", "medium", "right", sz, dpi, 1)); + else if (a[0] == "unicode-mono-math" && N (a) >= 2) + fn[nr]= adjust_subfont ( + closest_font (a[1], "rm", series, "right", sz, dpi, 1)); + else if (a[0] == "math-fallback-tt") + fn[nr]= adjust_subfont ( + closest_font ("roman", "rm", series, "mathitalic", sz, dpi, 1)); else if (a[0] == "special") fn[nr]= smart_font_bis (family, variant, series, "right", sz, hdpi, dpi); else if (a[0] == "emu-bracket") -- Gitee From f56af8d5e068dbc94802e29512a98a7348c32b9d Mon Sep 17 00:00:00 2001 From: cirno <13643614+healghost@user.noreply.gitee.com> Date: Wed, 26 Nov 2025 18:22:16 +0800 Subject: [PATCH 2/4] =?UTF-8?q?209=5F5=20=E4=BF=AE=E5=A4=8D=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=AE=AD=E5=A4=B4=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devel/209_5.md | 114 +------------------------------------------------ 1 file changed, 1 insertion(+), 113 deletions(-) diff --git a/devel/209_5.md b/devel/209_5.md index f90822108..3d829e375 100644 --- a/devel/209_5.md +++ b/devel/209_5.md @@ -19,7 +19,7 @@ - 等宽字体环境中的数学符号能够正确回退到Unicode字体 - 保持等宽字体外观 -## 2024/11/26 +## 2025/11/26 ### What 从C++字体选择机制层面修复TeXmacs代码模式(tt字体)下箭头符号显示不正确的问题 @@ -62,115 +62,3 @@ - 对于普通ASCII字符,继续使用等宽字体 - 只对数学符号进行特殊处理 -#### 实际代码修改 - -**修改位置1:`smart_font_rep::resolve(string c)` 函数** - -在 `for (int attempt= 1; attempt <= FONT_ATTEMPTS; attempt++)` 循环之前添加: - -```cpp -// Special handling for math symbols in monospace (tt) font environment -if (variant == "tt" || ends (variant, "-tt")) { - string range= get_unicode_range (c); - bool is_math_symbol= (range == "arrows" || - range == "mathematical_operators" || - range == "supplemental_mathematical_operators" || - (starts (c, "<") && ends (c, ">") && N (c) > 2)); - - if (is_math_symbol) { - // Try Unicode monospace fonts first - array unicode_mono_fonts; - unicode_mono_fonts << string ("Consolas"); - unicode_mono_fonts << string ("Courier New"); - unicode_mono_fonts << string ("DejaVu Sans Mono"); - unicode_mono_fonts << string ("Liberation Mono"); - unicode_mono_fonts << string ("Menlo"); - - for (int i= 0; i < N (unicode_mono_fonts); i++) { - font cfn= closest_font (unicode_mono_fonts[i], "rm", series, "right", sz, dpi, 1); - if (!is_nil (cfn) && cfn->supports (c)) { - tree key= tuple ("unicode-mono-math", unicode_mono_fonts[i]); - int nr = sm->add_font (key, REWRITE_NONE); - initialize_font (nr); - return sm->add_char (key, c); - } - } - - // Fallback to regular math font if Unicode monospace fonts don't support it - if (math_kind == 0) { - font math_fn= closest_font ("roman", "rm", series, "mathitalic", sz, dpi, 1); - if (!is_nil (math_fn) && math_fn->supports (c)) { - tree key= tuple ("math-fallback-tt"); - int nr = sm->add_font (key, REWRITE_NONE); - initialize_font (nr); - return sm->add_char (key, c); - } - } - } -} -``` - -**修改位置2:`smart_font_rep::initialize_font(int nr)` 函数** - -在 `emoji-font` 处理之后添加: - -```cpp -else if (a[0] == "unicode-mono-math" && N (a) >= 2) - fn[nr]= adjust_subfont ( - closest_font (a[1], "rm", series, "right", sz, dpi, 1)); -else if (a[0] == "math-fallback-tt") - fn[nr]= adjust_subfont ( - closest_font ("roman", "rm", series, "mathitalic", sz, dpi, 1)); -``` - -#### 优势 - -1. **无需修改样式文件**:从底层字体选择机制解决问题 -2. **自动适用所有场景**:任何使用tt字体的地方都会受益 -3. **更好的字体回退**:提供了更智能的字体选择策略 -4. **保持向后兼容**:不影响现有的字体选择逻辑 - -#### 影响范围 - -- **作用域**:影响所有使用tt等宽字体的场景 -- **兼容性**:向后兼容,增强现有功能 -- **性能**:轻微增加字体解析时间,但可忽略不计 -- **平台**:改善跨平台字体支持 - -#### 注意事项 - -1. 需要确保Unicode等宽字体在各平台上可用 -2. 需要测试各种数学符号的显示效果 -3. 需要考虑字体大小和度量的一致性 - -#### 与样式文件方案的对比 - -**样式文件方案(已实现)**: -- 修改 `TeXmacs/styles/source.ts` -- 在verbatim宏中添加 `font|Consolas,Courier New,Courier` 和 `math-font|roman` -- 优点:简单直接,立即生效 -- 缺点:只影响verbatim环境,其他使用tt字体的地方不受影响 - -**C++字体选择方案(本方案)**: -- 修改 `src/Graphics/Fonts/smart_font.cpp` -- 在字体解析层面添加智能回退逻辑 -- 优点:全局生效,所有tt字体环境都受益 -- 缺点:需要重新编译,实现较复杂 - -#### 实现细节说明 - -1. **检测条件**: - - 检查 `variant` 是否为 "tt" 或以 "-tt" 结尾 - - 检查字符是否属于数学符号范围(箭头、数学运算符等) - - 检查字符是否为TeXmacs特殊符号格式(`<...>`) - -2. **字体回退顺序**: - - 首先尝试常见的Unicode等宽字体(Consolas、Courier New、DejaVu Sans Mono、Liberation Mono、Menlo) - - 如果Unicode等宽字体不支持,且不在数学模式下(`math_kind == 0`),则回退到roman数学字体 - - 这样既保证了符号的正确显示,又尽可能保持等宽字体的视觉一致性 - -3. **字体初始化**: - - 为新的字体键 `unicode-mono-math` 和 `math-fallback-tt` 添加初始化逻辑 - - 使用 `adjust_subfont` 确保字体度量正确 - - -- Gitee From f0a87b408f68a910aa7b0b1ac2c21635671d9b52 Mon Sep 17 00:00:00 2001 From: cirno <13643614+healghost@user.noreply.gitee.com> Date: Wed, 26 Nov 2025 18:30:45 +0800 Subject: [PATCH 3/4] =?UTF-8?q?209=5F5=20=E4=BF=AE=E5=A4=8D=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=AE=AD=E5=A4=B4=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devel/209_5.md | 18 ++++++++------- src/Graphics/Fonts/smart_font.cpp | 37 ++++++------------------------- 2 files changed, 17 insertions(+), 38 deletions(-) diff --git a/devel/209_5.md b/devel/209_5.md index 3d829e375..80f32dce5 100644 --- a/devel/209_5.md +++ b/devel/209_5.md @@ -50,15 +50,17 @@ #### 具体实现思路 1. **检测等宽字体环境**: - - 判断当前 `variant` 是否为 "tt" 或包含 "tt" - - 判断字符是否为数学符号(箭头、运算符等) + - 判断当前 `variant` 是否为 "tt" 或以 "-tt" 结尾 + - 判断字符是否为数学符号(箭头、数学运算符、补充数学运算符等) + - 判断字符是否为TeXmacs特殊符号格式(`<...>`) -2. **添加Unicode字体回退**: +2. **使用DejaVu Sans Mono字体**: - 当检测到等宽字体环境中的数学符号时 - - 优先尝试使用支持该符号的Unicode等宽字体(如Consolas、Courier New) - - 如果Unicode等宽字体不支持,再回退到非等宽的数学字体 + - 尝试使用 DejaVu Sans Mono 字体(支持丰富的Unicode数学符号) + - 如果该字体支持该符号,则使用它进行渲染 -3. **保持字体一致性**: - - 对于普通ASCII字符,继续使用等宽字体 - - 只对数学符号进行特殊处理 +3. **简洁设计**: + - 只使用单一的Unicode等宽字体(DejaVu Sans Mono) + - 不提供额外的回退机制,保持代码简洁 + - 对于普通ASCII字符,继续使用原有的等宽字体 diff --git a/src/Graphics/Fonts/smart_font.cpp b/src/Graphics/Fonts/smart_font.cpp index 1109133bc..1ea2f7365 100644 --- a/src/Graphics/Fonts/smart_font.cpp +++ b/src/Graphics/Fonts/smart_font.cpp @@ -1220,33 +1220,13 @@ smart_font_rep::resolve (string c) { (starts (c, "<") && ends (c, ">") && N (c) > 2)); if (is_math_symbol) { - // Try Unicode monospace fonts first - array unicode_mono_fonts; - unicode_mono_fonts << string ("Consolas"); - unicode_mono_fonts << string ("Courier New"); - unicode_mono_fonts << string ("DejaVu Sans Mono"); - unicode_mono_fonts << string ("Liberation Mono"); - unicode_mono_fonts << string ("Menlo"); - - for (int i= 0; i < N (unicode_mono_fonts); i++) { - font cfn= closest_font (unicode_mono_fonts[i], "rm", series, "right", sz, dpi, 1); - if (!is_nil (cfn) && cfn->supports (c)) { - tree key= tuple ("unicode-mono-math", unicode_mono_fonts[i]); - int nr = sm->add_font (key, REWRITE_NONE); - initialize_font (nr); - return sm->add_char (key, c); - } - } - - // Fallback to regular math font if Unicode monospace fonts don't support it - if (math_kind == 0) { - font math_fn= closest_font ("roman", "rm", series, "mathitalic", sz, dpi, 1); - if (!is_nil (math_fn) && math_fn->supports (c)) { - tree key= tuple ("math-fallback-tt"); - int nr = sm->add_font (key, REWRITE_NONE); - initialize_font (nr); - return sm->add_char (key, c); - } + // Try DejaVu Sans Mono for Unicode math symbols + font cfn= closest_font ("DejaVu Sans Mono", "rm", series, "right", sz, dpi, 1); + if (!is_nil (cfn) && cfn->supports (c)) { + tree key= tuple ("unicode-mono-math", "DejaVu Sans Mono"); + int nr = sm->add_font (key, REWRITE_NONE); + initialize_font (nr); + return sm->add_char (key, c); } } } @@ -1324,9 +1304,6 @@ smart_font_rep::initialize_font (int nr) { else if (a[0] == "unicode-mono-math" && N (a) >= 2) fn[nr]= adjust_subfont ( closest_font (a[1], "rm", series, "right", sz, dpi, 1)); - else if (a[0] == "math-fallback-tt") - fn[nr]= adjust_subfont ( - closest_font ("roman", "rm", series, "mathitalic", sz, dpi, 1)); else if (a[0] == "special") fn[nr]= smart_font_bis (family, variant, series, "right", sz, hdpi, dpi); else if (a[0] == "emu-bracket") -- Gitee From 1b3295a1269580d2dcb643a8debfa3abe1062807 Mon Sep 17 00:00:00 2001 From: cirno <13643614+healghost@user.noreply.gitee.com> Date: Wed, 26 Nov 2025 18:32:43 +0800 Subject: [PATCH 4/4] =?UTF-8?q?209=5F5=20=E4=BF=AE=E5=A4=8D=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=AE=AD=E5=A4=B4=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Graphics/Fonts/smart_font.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Graphics/Fonts/smart_font.cpp b/src/Graphics/Fonts/smart_font.cpp index 1ea2f7365..670e6a510 100644 --- a/src/Graphics/Fonts/smart_font.cpp +++ b/src/Graphics/Fonts/smart_font.cpp @@ -1214,14 +1214,15 @@ smart_font_rep::resolve (string c) { // Special handling for math symbols in monospace (tt) font environment if (variant == "tt" || ends (variant, "-tt")) { string range= get_unicode_range (c); - bool is_math_symbol= (range == "arrows" || - range == "mathematical_operators" || - range == "supplemental_mathematical_operators" || - (starts (c, "<") && ends (c, ">") && N (c) > 2)); - + bool is_math_symbol= + (range == "arrows" || range == "mathematical_operators" || + range == "supplemental_mathematical_operators" || + (starts (c, "<") && ends (c, ">") && N (c) > 2)); + if (is_math_symbol) { // Try DejaVu Sans Mono for Unicode math symbols - font cfn= closest_font ("DejaVu Sans Mono", "rm", series, "right", sz, dpi, 1); + font cfn= + closest_font ("DejaVu Sans Mono", "rm", series, "right", sz, dpi, 1); if (!is_nil (cfn) && cfn->supports (c)) { tree key= tuple ("unicode-mono-math", "DejaVu Sans Mono"); int nr = sm->add_font (key, REWRITE_NONE); @@ -1302,8 +1303,8 @@ smart_font_rep::initialize_font (int nr) { fn[nr]= adjust_subfont ( closest_font (a[1], "rm", "medium", "right", sz, dpi, 1)); else if (a[0] == "unicode-mono-math" && N (a) >= 2) - fn[nr]= adjust_subfont ( - closest_font (a[1], "rm", series, "right", sz, dpi, 1)); + fn[nr]= + adjust_subfont (closest_font (a[1], "rm", series, "right", sz, dpi, 1)); else if (a[0] == "special") fn[nr]= smart_font_bis (family, variant, series, "right", sz, hdpi, dpi); else if (a[0] == "emu-bracket") -- Gitee