Iosevka 字体工程 — HN 讨论摘要
原文概要
10 月 14 日,HN 用户 otobrglez 把一份Iosevka 字体主页顶到了 281 分。Iosevka 由开发者 be5invis (Renzhi) 维护,是一款定位”程序化生成”的等宽字体家族。
主页把 Iosevka 描述为 “open-source, sans-serif + slab-serif, monospace + quasi‑proportional typeface family”。八种变体并列陈列:Iosevka(默认无衬线)、Iosevka Term(窄字符列优先)、Iosevka Fixed(关闭连字)、Iosevka Slab / Term Slab / Fixed Slab 三种衬线版,加上为正文写作设计的 Iosevka Aile 与 Iosevka Etoile 两种 quasi-proportional 系列。
技术细节上,主页强调了三件事:默认等宽字形精确为 1/2em 宽,相对 Fira Code / IBM Plex / JetBrains Mono 等同类可在同屏装下更多列;包含 146 个可配置字符与 19 种 stylistic sets;支持以 OpenType 特性驱动的连字集,包括用 = 和 - 拼出的长箭头与水平条。
仓库 be5invis/Iosevka 下采用 SIL Open Font License 1.1。语言覆盖宣称达到 248 种,覆盖含拉丁、希腊、西里尔、亚美尼亚等字符集。
讨论焦点
font-display: swap:让字体展示页先渲染成 Courier
最先冲出主楼的是首页加载时的视觉异常。网友 oefrha 在发稿 1 小时内贴出了他看到的现象,把同一段时间内 HN 里的疑惑直接摆到了台面上:
“IMO a font specimen site may be the worst place to use font-display: swap. Was wondering why I was looking at what seemed indistinguishable from Courier, turns out what I saw was exactly Courier.” — oefrha [c:50084708]
(译文:我认为字体展示页是最不该用
font-display: swap的地方。我纳闷为什么看到的东西跟 Courier 没区别,结果它确实就是 Courier。)
embedding-shape 顺着帖子补了一段 CSS 解释,并提出问题真正可能出在哪:
“font-display: swap changes the default behavior from "No text visible until font been loaded" to "Display fallback font until specified font is available", meaning you’ll see Courier until Iosevka loaded properly, or Courier forever if the font file failed to load.” — embedding-shape [c:50086025]
(译文:
font-display: swap把默认行为从”字体加载完再显示文字”换成”先显示后备字体”,结果是你会先看到 Courier,加载好了换成 Iosevka,加载失败就一直看 Courier。)
kqp 把这条狗屎的源头指到了 Google 的 PageSpeed Insights:
“I think the dogmatism stems from Google, which delivers this advice as unconditional instruction and often gets parroted, makes the main website grading tool that calls it an error, and says they’ll drive less traffic to you if their grading tool rates you poorly.” — kqp [c:50086557]
(译文:我认为这种教条源头在 Google——它把这条建议当不可违背的指令发给所有人,又经营着主流评分工具,把它标成错误项,并威胁说分数低就少给你导流。)
到这里,故事已经不只是字体:HN 用户拿一段 CSS 头文件当镜子照,照出来的是前端工具链的一种”全员照抄”。
连字:从 “abomination” 到”调整间距而已”
字体本身没发火,讨论是从网友 jve 一段吐槽开始的:
“Is it only me but I really dislike "Code Ligations"? I have to mark some chars to count how many consecutive "=" simbols there are… or \/ looking like V without having other chars near it to distinguish.” — jve [c:50085518]
(译文:只有我一个人不喜欢”Code Ligations”吗?我得数才知道连续多少个
=,单独的\/看上去就像 V,附近没别的字符就分不清。)
接下来的子楼里,semiquaver 直接挑错别字——网站上写的是 “Ligation” 而不是 “Ligature”。在更长的子线下,masfuerte 为这个合成词的诞生找来了词源辩护:
“Ligation is (among other things) the act of applying a ligature. So it does make sense.” — masfuerte [c:50086488]
(译文:Ligation 是(其中一种含义)实施 ligature 这个动作。所以这词用得有道理。)
但反对派并没有被说服。WesolyKubeczek 把怒气烧成了一段种族志般的描述,结尾冷静下来给出理由:
“Code ligatures look like the final desperate attempt of an aging hipster, a Ruby on Rails and Web2.0 early adoptr (sic), the type to wear thick-rimmed fake glasses and a scarf in the middle of summer, to be cool, as he is riding his old Segway, with a glass of soy latte in one hand and an avocado toast in the other, into the void of oblivion.” — WesolyKubeczek [c:50086480]
(译文:代码连字像一位正在老去的潮人最后的挣扎。早期 Ruby on Rails 与 Web 2.0 的早期用户,戴着厚框假眼镜、盛夏里围着围巾,想装酷;他骑在一辆老 Segway 上,一只手举着豆奶拿铁,另一只捏着牛油果吐司,滑进遗忘的虚空。)
“I don’t like them because I never know what they actually stand for in ASCII.” — WesolyKubeczek [c:50086480]
(译文:我不喜欢它们,因为我永远不知道它们在 ASCII 里原本是什么字符。)
守方则用实际经验反驳。Semaphor 是个常用者:
“Common complaint. Personally, I like them. They look pleasing and I never had issues distinguishing between the ligatures for ==, ===, and = itself.” — Semaphor [c:50085885]
(译文:老抱怨了。我个人喜欢,看上去舒服,
==、===、=三者从来没让我误判过。)
boltzmann64 把焦点从”要不要开”转到”它们干了什么”。这条评论点出 Iosevka 的 Fixed 系列给连字做了一个”半关闭”的中间地带:
“I used to hate font ligatures until I discovered Commit Mono (my all time favorite monospace font). They use the ligatures only to adjust spacing and make it look better on a monospace grid.” — boltzmann64 [c:50087106]
(译文:我以前恨字体连字,直到遇见 Commit Mono(我至今最爱的等宽字体)。他们只用连字来调整间距,让排版在等宽栅格上更顺眼。)
mkesper 顺手提供了逃生通道:
“The ‘fixed’ variant disables them.” — mkesper [c:50085688]
(译文:’Fixed’ 变体直接关掉它们。)
这场子讨论的趣味在它没结论——一边要把 = ==== <> 打回 ASCII 原形,一边要”看上去舒服”。
裁缝:默认宽度太窄,扩展版太宽
Iosevka 老用户群有着别的等宽字体圈很少见的一面:很多人不是下载就用,而是自己动手 build。wartywhoa23 在主楼就开了这条线索,并挑明作者在背后搭的整套基础设施:
“Iosevka, my absolutely most loved font for years! I’ve been using a custom version - you can customize the font and build your own ttf (or better yet, ttc) using the build system supplied in the repository.” — wartywhoa23 [c:50084940]
(译文:Iosevka 是我这几年最喜欢的字体,没有之一。我一直在用自编译版本——可以用网页上的 customizer 定制,再从仓库里的 build system 编出自己的 ttf(更好的是 ttc)。
“be5invis, the author of the font, deserves a special mention for creating a whole custom DSL called PatEL (Parametric Type Expression Language) to generate the font programmatically!” — wartywhoa23 [c:50084940]
(译文:be5invis 这位作者值得单独被提到——他为了按程序生成字体,整了一门自定义 DSL 出来,叫 PatEL(Parametric Type Expression Language)。)
下面两位用户分别贡献了”魔法宽度”个人档案。needfish:
“One thing is that the width by default is too compact and the extended is too wide for my taste. Upon searching I found somebody’s build that has width 576. I don’t know why that number, but I used it in my current builds and it turns out pretty much perfect for terminal use for me, just wide enough.” — needfish [c:50085645]
(译文:默认宽度对我来说太紧,扩展版又太宽。我搜到一份 build,宽度取 576,不知道为啥是这个数,但我现在用的就是这个,刚好够宽。)
frazer2669 同意了”默认太窄、扩展太宽”的判断,给出自己的取值:
“Same, default is too narrow and extended is too wide for my taste. The custom build has a default "semi-extended" which is just right for me and has a width of 548. Again no clue why that number, but if Iosevka says that is right then it is :)” — frazer2669 [c:50086708]
(译文:同感,默认太窄、扩展太宽。社区里有个”semi-extended” build 默认宽度 548,对我来说刚好。同样不知道为什么这个数,但既然是 Iosevka 说的,那它就对 :))
Iosevka 把”自定义宽度”这件事做成默认体验——这一点,在讨论里反复被回头夸。
“sans-serif” 还是 “parfois-serif”
展示页把 Iosevka 写成 “sans-serif + slab-serif”。rf15 把这种混合写法当成业界积弊的又一例:
“Good to know that the age old tradition of calling a font with serifs sans-serif is well alive and kicking. The reason here is that the basic glyph shape is that of a sans-serif, but still got serifs added afterwards. That doesn’t stop it from diluting the meaning of the term.” — rf15 [c:50084795]
(译文:原来”明明带衬线却叫无衬线字体”的多年传统还活着。原因是基础字形是无衬线,只是后面又加上了衬线,但这样做没解决”无衬线”这个名词被稀释的问题。)
joarv0249nw 在另一楼层问得更直接:
“Why is it called sans-serif when there is serif on i j etc?” — joarv0249nw [c:50086914]
(译文:i、j 上明明有衬线,凭什么叫 sans-serif?)
tremon 站队原作者并指出主楼的字眼其实是精确的:
“Where does it say it is a sans-serif font? The very first full sentence on the page starts with "Iosevka is an open-source, sans-serif + slab-serif, monospace + quasi‑proportional typeface family", just like the title here says "sans-serif and slab-serif".” — tremon [c:50086494]
(译文:哪个字写了 sans-serif?主页第一句原话是”Iosevka 是开源的,无衬线 + 板状衬线,等宽 + 准比例字体族”,跟主楼标题写法一样。)
在这场你来我往里,Freak_NL 给出了一个更小巧的命名建议:
“Iosevka is more of a parfois-serif I guess.” — Freak_NL [c:50086390]
(译文:Iosevka 更像 parfois-serif,对吧。)
生态位置:Pragmata Pro 的开源替代品
讨论里不止一次提到 Iosevka 的”前身”——商业字体 Pragmata Pro。climech 把这条线讲清楚:
“I remember falling in love with PragmataPro many years ago, I really like narrow fonts, but I couldn’t afford it (I don’t remember how much it was at the time but it was something insane, at least for my wallet). Then Iosevka entered the scene, and I never looked back.” — climech [c:50086540]
(译文:很多年前我爱上 Pragmata Pro,喜欢窄字体,但当时买不起(具体多少忘了,反正对我钱包来说是一笔巨款)。后来 Iosevka 出现了,我就再没回头。)
durdn 顺着这条线给了一个反向案例,把开源循环对接到商业字体上:
“A friend pointed me to a derivative of Iosevka that tries to mimic the historical (and commercially licensed) Pragmata Pro and the result is an insanely great font I’ve migrated to recently: https://github.com/shytikov/pragmasevka” — durdn [c:50086123]
(译文:朋友给我推荐了一份 Iosevka 的衍生字体,目标是模仿历史上的(且商业授权的)Pragmata Pro,效果特别好,我最近就迁过去了:仓库见 https://github.com/shytikov/pragmasevka)
这套循环还出现在桌面发行版上。starquake 提供了一个官方级确认:
“The default font since GNOME 48 is Adwaita Sans (a modified Inter with different l’s and I’s) and for monospace it is Adwaita Mono (a modified Iosevka.) I like it a lot!” — starquake [c:50085203]
(译文:从 GNOME 48 起默认字体是 Adwaita Sans(改了 l 和 I 的 Inter 衍生字体),等宽就是 Adwaita Mono(一份改过的 Iosevka)。我很喜欢。)
结尾由 nitinreddy88 给出了一段”我试过所有字体然后又回来了”的注脚,但这次回去的是 Berkeley Mono:
“Whenever font discussions come up, I will try everyones suggestions to find better than what I have, and always came back to Berkeley. Its almost near perfect for coding!” — nitinreddy88 [c:50085207]
(译文:每次讨论字体的话题,我都会试试大家推荐的新字体,看看有没有更好的,结果每次都跑回 Berkeley。用来写代码几乎完美。)
典型观点一览
| 立场 | 用户 | 一句话 |
|---|---|---|
font-display: swap 在字体页就是反向操作 | oefrha [c:50084708] | 看了半天以为是新字体,结果是 Courier |
| Google PageSpeed 是这股教条的总源头 | kqp [c:50086557] | 评分工具当裁判,网站作者照单全收 |
| 连字非改不可,关掉就解决 | jve [c:50085518] | 一堆 = 数不清,单独的 \/ 跟 V 撞脸 |
| 连字是”看上去舒服”的真实特性 | Semaphor [c:50085885] | ==/===/= 不会误判 |
| 用 Fixed 变体逃离争议 | mkesper [c:50085688] | ‘Fixed’ 直接关连字 |
| 自定义宽度比官方默认更顺手 | needfish [c:50085645] | 默认太紧、扩展太宽,最后选 576 |
| 另一套魔法宽度 | frazer2669 [c:50086708] | “semi-extended” 默认 548,效果刚好 |
| 程序化字体的命名诚实问题 | rf15 [c:50084795] | 带衬线还叫 sans-serif,是在稀释术语 |
| sans-serif 是页面刻意并列写的 | tremon [c:50086494] | 首页原话是 “sans-serif + slab-serif” |
| Iosevka 是 Pragmata Pro 的开源代替品 | climech [c:50086540] | 商业授权劝退,开源顶上 |
| 桌面发行版的官方背书 | starquake [c:50085203] | GNOME 48 默认等宽 Adwaita Mono 是改过的 Iosevka |
| 字体裁缝日常 | Daneel_ [c:50086895] | 网站上有漂亮 customizer,能不能直接下载成那个版本 |
总体情绪
到 96 条评论收口,主线情绪很明确:Iosevka 是那种”用得越久越离不开,被它产品设计震撼” 的字体;与之并行的是另一种声音——font-display: swap 把自家首页演示现场撞成 Courier,连字命中”装饰过度”批评者的所有敏感点,命名上的 “sans-serif + slab-serif” 也成为吹毛求疵者的靶心。技术圈对一款好用的工具,向来是不肯只夸两句就走的。
讨论里最少被正面反驳的,是它的程序化生成骨架:PatEL DSL、146 个可调字符、19 套 stylistic sets,把”调到自己合用”做成了标准动作而不是变通。这恰好解释了为什么用户讨论里最细的那几条——给定 576 而不是默认——是另一种沉默的背书。
引用帖子
| # | 标题 | 链接 |
|---|---|---|
| 1 | Iosevka is an open-source, sans-serif and slab-serif, monospace font | https://news.ycombinator.com/item?id=50084240 |
本摘要由 AI 模型辅助生成:minimax-cn-coding-plan/MiniMax-M3