Git Product home page Git Product logo

Comments (2)

BlackGlory avatar BlackGlory commented on June 10, 2024

我测试了一下, 主要问题出在Linux预装的字体太少, 大多数页面使用的中文字体都不存在.
Appoint Font的原理是把本地安装过的字体替换为用户设置的字体, 在这种情况下, Appoint Font根本不知道该替换掉什么字体.

在此基础上, Chrome在Linux上处理字体fallback似乎也有问题, 浏览器的字体设置不会被尊重.
举例来说, 当我设置MiSans字体为默认字体时, 浏览器会错误地选择渲染Noto Serif CJK SC.


根据上面的测试,安装中文字体理应能够解决此问题, 所以我尝试安装微软雅黑和宋体.
然而, 在Ubuntu Server 20.04的Chrome 113.0.5672.63上, 这不起效果.
具体表现为, 浏览器选择加载微软雅黑, 而不是用户在扩展里设置的字体.

进一步调查后, 发现这是因为浏览器不知为何不能正常加载以本地字体为源的FontFace:
检查document.fonts会发现所有FontFace都处于pending状态.

鉴于Chrome在字体方面一贯的糟糕表现, 这可能是一个bug.
受限于Appoint Font的原理, 无法修复.

from appoint-font.

Dcryfm avatar Dcryfm commented on June 10, 2024

感谢及时回复啊,我用的是基于 ubuntu 的 linux 系统,安装 .deb 的 Chrome 才会有字体问题。如果安装的是 flatpak 的Chrome,我只用在浏览器中设置字体,所有页面就会按我设置的字体渲染,不知道啥情况。感谢费心解答,我关闭这个问题了。

from appoint-font.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.