Skip to content

v1.4.1

Choose a tag to compare

@cn0xroot cn0xroot released this 16 Sep 14:50
· 90 commits to master since this release

修复

  • 界面字号设置之前不是真正全局生效:样式表里 62 处按钮/卡片数字/表格文字等
    的字号是写死的 px,只改 body 自己的 font-size 根本碰不到它们,调节滑块时
    页面看起来"没什么变化"。修复过程中还发现一个连带问题:把这 62 处全部换成相对
    根字号的 rem 单位后,第一版验证时发现即使 CSS 变量本身已经正确更新,
    <html> 的实际字号还是纹丝不动——原因是 html, body { ... font-size: 1rem }
    这条联合选择器规则会同时套到 html 和 body 头上,而 1rem 用在根元素自己
    身上不是"相对自己"、是相对浏览器默认的 16px,这条规则排在后面,把专门给
    html 写的字号规则覆盖掉了。现在用全新浏览器验证过:默认 14px 时按钮是
    13px、卡片数字 28px;调到 18px 后按钮变成 16.7px、卡片数字变成 36px——整站
    所有文字同比例联动缩放。
  • 界面字体设置对导航栏/按钮类文字不生效:<button>/<select>/<input>/
    <textarea> 这几个表单控件元素,浏览器自己的默认样式表压根不会让它们继承正文
    的 font-family(会摆烂用系统 UI 控件字体,实测是 Arial),这是每个浏览器的
    标准行为,不是继承链断了——"首页"/"状态信息"这些导航按钮、"新建会话"这类按钮
    换字体跟没换一样,根因就是这个。加一条 button, input, select, textarea { font-family: inherit; } 就解决了,截图验证过导航文字确实跟着变成楷体的手写
    笔画风格。

新增

  • 界面字体新增三个中文选项:楷体、黑体(思源黑体)、宋体(思源宋体)。没有
    把字体文件打包进项目——完整 CJK 字库一个 17~21MB,直接打包会让首次切字体的
    下载很慢——改成纯字体名引用,访问者的系统/浏览器本地装了对应字体就会生效
    (这台 Linux 机器本身已经装了 AR PL UKai/UMing、Noto Sans/Serif CJK、霞鹜文楷
    这些开源中文字体,同机或同局域网内访问能直接命中;Windows 的"微软雅黑"/
    "宋体"、Mac 的"苹方"/"华文楷体"也在各自字体栈里)。没有加"柳体"——系统上没有
    真正的柳公权风格书法字体,网上找到的几款标榜"柳体"的免费字体授权条款未经
    核实,不确定能不能安全打包,先跳过。

English

Fixed

  • The interface font-size setting wasn't actually global: 62 places in the stylesheet
    (buttons, card numbers, table text, …) had hardcoded pixel font-sizes, so changing only
    body's own font-size never touched them — the slider looked like it barely did
    anything. Fixing it surfaced a second, related bug: after converting all 62 to rem
    units relative to the root, the first verification pass showed the CSS variable updating
    correctly while <html>'s actual font-size never moved — because the combined
    html, body { ... font-size: 1rem } rule applies to both elements, and 1rem on the
    root element itself doesn't mean "relative to itself," it resolves against the browser's
    16px default; that rule came later in the cascade and silently overrode the dedicated
    html font-size rule. Verified in a fresh browser profile: at the 14px default, buttons
    render at 13px and card numbers at 28px; at 18px, buttons become 16.7px and card numbers
    36px — every piece of text scales together now.
  • The interface font setting had no effect on nav-bar/button text: browsers'
    built-in default stylesheet never lets <button>/<select>/<input>/<textarea>
    inherit the surrounding font-family — they fall back to the OS's native UI control
    font instead (Arial, in practice), and that's standard behavior in every browser, not a
    broken inheritance chain. So switching fonts did nothing for the "Home"/"Status" nav
    buttons or things like the "New Session" button. Fixed with a single
    button, input, select, textarea { font-family: inherit; } rule — verified via
    screenshot that the nav text now actually picks up Kaiti's handwritten brush strokes.

Added

  • Three new Chinese font options in the interface font setting: Kaiti (calligraphy-
    style), Heiti (Source Han Sans), and Songti (Source Han Serif). No font files were
    bundled into the project — a full CJK glyph set runs 17–21MB each, and bundling would
    make the first font switch painfully slow to download — so these are plain font-name
    references instead; they render correctly wherever the visitor's system/browser already
    has a matching font installed (this Linux machine itself has AR PL UKai/UMing, Noto
    Sans/Serif CJK, and LXGW WenKai, so same-machine or same-LAN access picks them up
    directly; Windows's "Microsoft YaHei"/"SimSun" and macOS's "PingFang SC"/"STKaiti" are
    also in the respective stacks). A "Liu style" (柳体, Liu Gongquan calligraphy) option was
    not added — no such font is installed on this system, and the free fonts online claiming
    that style have unverified licensing, so bundling one wasn't safe to do without
    confirmation.

完整更新日志见 CHANGELOG.md (English)。