Repository navigation
中文段落里的引号和省略号用中文字体,英文段落不变 - #489
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows 上
“ ” ‘ ’ …在中文句子里只有汉字的 38% 宽(#487)。原因是字体栈里 Segoe UI 自带这几个字形,轮不到后面的中文字体;macOS 上 SF 同理,只是不明显。这几个字符中英文共用,按字符换字体(issue 里的
unicode-range方案)会让英文字幕和英文回答里的引号也变宽。所以改成按语言:MdgCommon.textLang判断一段文字有拉丁字母、没有中日韩文字时为英文;AI 回答的每个块、提问、输入框、阅读页的字幕/章节/标题按它标lang="en"。--font-sans前面加一个只覆盖这 5 个码位的MdgCjkPunct(苹方 / 微软雅黑),[lang="en"]用不带它的--font-sans-en。content.css 的英文规则只限在阅读页自己的节点里,不碰宿主页面。对比:ChatGPT、Claude.ai、Kimi、知乎都不处理;DeepSeek 全站给引号套苹方(
quote-cjk-patch),只在一行有德语„时跳过,英文回答也受影响,Windows 上没有苹方所以不生效。验证
node scripts/selftest.mjs:51 个通过,新增textLang和按块标语言的用例。node scripts/smoke.mjs:通过(各页面、B站和 YouTube 视频页无报错)。关联 issue
Closes #487