# 求教如何修改WFG的繁体词典，避免其css字体设定影响到排在其后面的词典？

**URL:** <https://forum.freemdict.com/t/topic/11833>\
**Category:** 技术交流与词典编修\
**Tags:** 汉语, css, mdx改版\
**Created:** [2022 年3 月 28 日 09:04 UTC](https://forum.freemdict.com/t/topic/11833 "2022-03-28T09:04:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

作者： ![hahaya](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/77aa72/32.png) [@hahaya](https://forum.freemdict.com/u/hahaya)\
发布日期： [2022 年3 月 28 日 09:04 UTC](https://forum.freemdict.com/t/topic/11833/1 "2022-03-28T09:04:16Z")

</div>

发现WFG的几本繁体词典，字体设置了明体等繁体字体，只要排在这些词典所在分组后面的词典，比如这部，都会受影响，字体变为明体：

 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/9/5/95675fae1d40bcb10d9f15e25b733ecec2c73de8.png)

求教如何修改原文件，才能避免这些字体设定沿用到其他词典的字体样式？

---

<div class="post-metadata">

作者： ![hahaya](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/77aa72/32.png) [@hahaya](https://forum.freemdict.com/u/hahaya)\
发布日期： [2022 年3 月 30 日 01:35 UTC](https://forum.freemdict.com/t/topic/11833/2 "2022-03-30T01:35:16Z")

</div>

有人知道怎么修改吗？

---

<div class="post-metadata">

作者： ![xianjue114](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/a587f6/32.png) [@xianjue114](https://forum.freemdict.com/u/xianjue114)\
发布日期： [2025 年1 月 6 日 12:07 UTC](https://forum.freemdict.com/t/topic/11833/3 "2025-01-06T12:07:35Z")

</div>

> [@WFG重编国语辞典，去样式文件、加类型](https://forum.freemdict.com/t/topic/35007):
>
> WFG的重编国语辞典给例句、引证等都加了区别，但由于其个人的习惯，搞了样式文件，并在样式文件里写死了样式，不利于调试和排版。我把样式记号给改成了\<span class="xxx"\>为主的标签，并按照个人喜好在排版和功能上做了些调整，塞了个人喜欢的字体+[atauzki制作的子集化全宋体](http://forum.freemdict.com/t/topic/15691/32)。mdx体积会大一些。 [重编国语辞典.part2.rar](https://forum.freemdict.com/uploads/short-url/bFrH9W4ivX4U5yz1Hya0dSV0dow.rar) (16.3 MB) [重编国语辞典.part1.rar](https://forum.freemdict.com/uploads/short-url/p5KoYSkxVtEVbYLxf6VV3ASc5CE.rar) …

---

<div class="post-metadata">

作者： ![xiaoyifang](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/df788c/32.png) [@xiaoyifang](https://forum.freemdict.com/u/xiaoyifang)\
发布日期： [2025 年1 月 6 日 13:17 UTC](https://forum.freemdict.com/t/topic/11833/4 "2025-01-06T13:17:10Z")

</div>

记得wfg的词典样式是内嵌的，如果先分离成css，应该就可以通过css前缀隔离。

---

<div class="post-metadata">

作者： ![last\_idol](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/last_idol/32/2205_2.png) [@last\_idol](https://forum.freemdict.com/u/last_idol)\
发布日期： [2025 年1 月 6 日 13:37 UTC](https://forum.freemdict.com/t/topic/11833/5 "2025-01-06T13:37:47Z")

</div>

他这个不是样式内嵌问题，而是同名字体冲突，浏览器不存在字体隔离，论坛里好多词典的字体用了相同的名称，加载在一起互相替换。 😄

---

<div class="post-metadata">

作者： ![last\_idol](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/last_idol/32/2205_2.png) [@last\_idol](https://forum.freemdict.com/u/last_idol)\
发布日期： [2025 年1 月 7 日 03:32 UTC](https://forum.freemdict.com/t/topic/11833/6 "2025-01-07T03:32:33Z")

</div>

如何避免字体冲突？

**相同名称的字体浏览器只会加载一次。**

对于子集化的字体或者修改过的字体，字体内部的 postscriptName 以及从样式表引入的字体 font-face 的 font-family 属性都应该使用全新的名称，子集化的同名字体会导致其他词典查找不到对应字符的字体，最后回退到别的字体上。

带有私有区的字体也有类似问题，同一字体的不同版本，私有区的字符有可能被大量替换或者移除了，也需要子集化并使用全新的名称。

（有人私下问这个问题，这里补充下
