# 欧路词典（Eudic）字体解决方案

**URL:** <https://forum.freemdict.com/t/topic/15356>\
**Category:** 技术交流与词典编修\
**Tags:** mdd, css\
**Created:** [2022 年9 月 14 日 16:44 UTC](https://forum.freemdict.com/t/topic/15356 "2022-09-14T16:44:17Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

作者： ![Moguer](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/moguer/32/20527_2.png) [@Moguer](https://forum.freemdict.com/u/Moguer)\
发布日期： [2022 年9 月 15 日 07:02 UTC](https://forum.freemdict.com/t/topic/15356/29 "2022-09-15T07:02:36Z")

</div>

关于中文是否要向英文的“首段不缩进”看齐，已经有一些[讨论](https://www.zhihu.com/question/19840594)。

---

<div class="post-metadata">

作者： ![zambast](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/z/67e7ee/32.png) [@zambast](https://forum.freemdict.com/u/zambast)\
发布日期： [2022 年9 月 15 日 07:02 UTC](https://forum.freemdict.com/t/topic/15356/30 "2022-09-15T07:02:39Z")

</div>

我评论的是最上面那篇《请使用逻辑正确的段首缩排》，因为说的是中文排版；至于西文排版，因为西文看得少并不懂，我只会当知识点来记。

---

<div class="post-metadata">

作者： ![mdxfan](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/mdxfan/32/31774_2.png) [@mdxfan](https://forum.freemdict.com/u/mdxfan)\
发布日期： [2022 年9 月 15 日 07:02 UTC](https://forum.freemdict.com/t/topic/15356/31 "2022-09-15T07:02:44Z")

</div>

op说的没错，西文排版确实已经形成了规范。但是中英混排的情况，尤其是双语词典，还没有较好的指导。

---

<div class="post-metadata">

作者： ![Moguer](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/moguer/32/20527_2.png) [@Moguer](https://forum.freemdict.com/u/Moguer)\
发布日期： [2022 年9 月 15 日 07:04 UTC](https://forum.freemdict.com/t/topic/15356/32 "2022-09-15T07:04:23Z")

</div>

你说的那篇博文当然只是倡导，平时自由排版也没有对错之分，看个人喜好。

---

<div class="post-metadata">

作者： ![atauzki](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/atauzki/32/1365_2.png) [@atauzki](https://forum.freemdict.com/u/atauzki)\
发布日期： [2022 年9 月 18 日 06:49 UTC](https://forum.freemdict.com/t/topic/15356/34 "2022-09-18T06:49:03Z")

</div>

苹果字体对windows兼容性差，显示效果也差很多

---

<div class="post-metadata">

作者： ![mdict6](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mdict6](https://forum.freemdict.com/u/mdict6)\
发布日期： [2022 年10 月 15 日 14:15 UTC](https://forum.freemdict.com/t/topic/15356/35 "2022-10-15T14:15:27Z")

</div>

今天学会自制生成图标字体啦，打包成mdd 挂在需要的词典文件夹里，就可以显示啦

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/4/3/43b253d5f0e8d23eb36aae79a92a521823530ac7.png)

[oalecd9.zip](https://forum.freemdict.com/uploads/short-url/oIbgQkKC9DbnarqJSHnErRhU2ST.zip) (1.2 KB)

---

<div class="post-metadata">

作者： ![startle](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/startle/32/22231_2.png) [@startle](https://forum.freemdict.com/u/startle)\
发布日期： [2022 年10 月 15 日 15:30 UTC](https://forum.freemdict.com/t/topic/15356/36 "2022-10-15T15:30:00Z")

</div>

😆 其实是微软自己不思进取，不能很好地支持 OpenType。

---

<div class="post-metadata">

作者： ![startle](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/startle/32/22231_2.png) [@startle](https://forum.freemdict.com/u/startle)\
发布日期： [2022 年10 月 15 日 16:18 UTC](https://forum.freemdict.com/t/topic/15356/37 "2022-10-15T16:18:05Z")

</div>

关于在 Mdict 中使用 woff2 字体：我认为是没有必要的。

> 从来就没有不付出任何代价就可以得到的东西，woff2 字体虽然拥有着极小的体积，但鱼和熊掌不可兼得，超高的压缩率是牺牲了 CPU 算力换来的，woff2 会增加页面渲染的时间。这也就是所谓的以时间换空间。

woff2 适用于网络字体，较小的字体体积能够减少页面下载资源的时间。但若字体本身就在本地，较小的体积仅仅只减少了字体占用的空间。

对于本地 Latin（英文等字符集）字体：英文字体的体积并不算大，最多不过几 MB，大多甚至只有几百 KB，所以这种情况采用 woff2 是没有太大必要的。

对于本地 CJK（中日韩字符集）字体，因为字体本身体积并不算小，几十 MB 都是常有的事，如果每次都要对 woff2 字体解码，那么势必会增加页面渲染的时间。

我也曾在欧路词典测试过思源宋体 VF、思源黑体 VF 的 woff2 版本与 ttf/otf 版本，结果是 woff2 的页面渲染完成时间显著长于 ttf/otf。

最后，如果提供 ttf/otf 版本的字体，用户还能直接把它们安装进 iOS/iPadOS/macOS/Windows 系统。当然，Android 并不被包括在内，因为直到 Android 13，Google 也未能提供 Android 系统层面安装第三方字体的途径与 API。

---

<div class="post-metadata">

作者： ![atauzki](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/atauzki/32/1365_2.png) [@atauzki](https://forum.freemdict.com/u/atauzki)\
发布日期： [2022 年10 月 16 日 00:26 UTC](https://forum.freemdict.com/t/topic/15356/38 "2022-10-16T00:26:55Z")

</div>

可惜我的应用场景大多数都是这个垃圾安卓 🙃，连系统自带的字体都不能用字体名来调用

---

<div class="post-metadata">

作者： ![Moguer](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/moguer/32/20527_2.png) [@Moguer](https://forum.freemdict.com/u/Moguer)\
发布日期： [2022 年10 月 17 日 07:51 UTC](https://forum.freemdict.com/t/topic/15356/39 "2022-10-17T07:51:06Z")

</div>

iOS 使用描述文件安装字体是有体积限制的，许多 CJK 字体都超过了这个大小，不知道您有没有什么直接安装的思路？  
我试过把字体文件直接放在词典文件同目录，CSS 调用似乎不生效哎……也不知道是不是我写错。

---

<div class="post-metadata">

作者： ![startle](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/startle/32/22231_2.png) [@startle](https://forum.freemdict.com/u/startle)\
发布日期： [2022 年10 月 17 日 08:26 UTC](https://forum.freemdict.com/t/topic/15356/40 "2022-10-17T08:26:51Z")

</div>

对于 iOS，你可以使用两个工具：Fontcase 和 iFont。  
前者将所有它管理的字体都打包为一个描述文件，后者将每一个字体都打包为单独的一个描述文件。  
用 iFont 可以正常安装安装多个字重的思源宋体 SC（每个字重 20+MB）。  
唯一遗憾的是，目前 iOS 不支持可变字体的安装，否则还能省很多空间。

这里面的 CSS 确认能够正常调用同级目录下的字体，你可以参考参考。

> [@重新设计的现代风格 CSS 现已正式发布（2023.10.20更新）](https://forum.freemdict.com/t/topic/16055):
>
> 重新设计的《现代汉语词典》、《现代汉语大词典》、《新华成语大词典》、《古代汉语词典》、《牛津高阶英汉词典 10》的 CSS 现已正式发布。 非常感谢这些 mdict 字典的作者以及修订者的不懈努力与无私奉献！ 最近更新（v1.8.1） 更新日期：2023.10.20 [新] 恢复之前 OALD 10 的点击区域。 [新] 修复 OALD 10 折叠区域排版错乱的问题。 [新] 适配《新华成…

---

<div class="post-metadata">

作者： ![Moguer](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/moguer/32/20527_2.png) [@Moguer](https://forum.freemdict.com/u/Moguer)\
发布日期： [2022 年10 月 17 日 12:04 UTC](https://forum.freemdict.com/t/topic/15356/41 "2022-10-17T12:04:02Z")

</div>

**更正** ：刚刚用 Apple Configurator 安装三个字重到手机，大小超过 100M，没有报错了，全上应该也没问题。

在我写这篇帖子的时候，在 iOS 安装超过一定大小的描述文件会报错。情况大概同[这篇](https://v2ex.com/t/684295)。以及查到：

> From the Xcode logs it says mc\_mobile\_tunnel[307] : (Error) MC: Message size 34024201 exceeds limit of 20971520 bytes So the profile size is limited to 20 MB.

现在看来 iOS 16 已经解决这个问题……可以放心怼 CJK 字体了。  
以及欧路不生效大概是因为我智障到没有写那个路径前的点号。

感谢您的回复！

---

<div class="post-metadata">

作者： ![eudic](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/77aa72/32.png) [@eudic](https://forum.freemdict.com/u/eudic)\
发布日期： [2023 年8 月 28 日 21:30 UTC](https://forum.freemdict.com/t/topic/15356/42 "2023-08-28T21:30:55Z")

</div>

被樓主的藝術品成功安利Lora字體！可惜iOS顯示不出來。小小嘗試了一下，作為小白，個人實踐下來最簡單的方法：

在 [https://www.fontsquirrel.com](https://www.fontsquirrel.com) 下載字體 ⇨

☞ 情況1 ☜

> 不改mdd ⇨ 使用任意Font Installer將字體裝入系統，將字體文件放入文件夾，css直接寫上font-family，與字體文件名一致即可識別。在歐路上這種方法會影響app默認字體，只能顯示默認的helvetica字體

☞ 情況2 ☜

> 改mdd ⇨ 將字體文件放入mdd文件夾，重新打包，css要加上font-face

其他心得

> 如果不是全局更改字體，而是單獨設置，為避免受同一區域其他元素字體設置的影響，最好加上font-weight:normal;font-style:normal;否則如果本身就是BoldItalic，受影響時會雙重Bold+雙重italic

我只用了ttf，沒有進行什麼轉換，感覺速度挺好的

[上一页](https://forum.freemdict.com/t/topic/15356.md?page=1)
