Giter Site home page Giter Site logo

Comments (4)

blinkfox avatar blinkfox commented on July 30, 2024

@ZongchengMa 我试了下,可以的。

我在这里下载了 NotoSerifSC-Regular.otf 字体,放在了主题的 vue 文件夹中,将这个字体也在本地电脑中安装了,然后在 vue.css 里面添加下面的 css

@font-face {
    font-family: 'Noto Serif SC';
    font-style: normal;
    font-weight: 300;
    src: local('Noto Serif SC'), local('Noto Serif SC Regular'), url('vue/NotoSerifSC-Regular.otf') format('otf');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

修改 body 中的 font-family ,添加字体:

body {
    font-family: Noto Serif SC, Source Sans Pro, Helvetica Neue, Arial, sans-serif !important;
    color: #34495e;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6rem;
    letter-spacing: 0;
    margin: 0;
    overflow-x: hidden;
}

重启 Typora 就可以看到一个效果了,这个只是Regular风格的,同理你还得加其他几种风格的字体。

from typora-vue-theme.

HatCupCoke avatar HatCupCoke commented on July 30, 2024

Snipaste_2019-04-13_17-36-06

依然如之前一样,显示效果为只有英文和阿拉伯数字可以以 Noto Serif 来渲染。

我认真比对了代码,发觉我的代码应该和你的一样,为防错漏,还是贴上来看看。

这是我的 CSS 文件

from typora-vue-theme.

blinkfox avatar blinkfox commented on July 30, 2024

我这边把你的css文件下载下来,本地试了下,没问题啊,切换字体,能看到一些中文的差别的

from typora-vue-theme.

HatCupCoke avatar HatCupCoke commented on July 30, 2024

我又在我的台式机和笔记本都做了测试。结果依然是英文数字可以正常显示而中文字体无法显示为 Noto Serif,暂不清楚这个 bug 是如何产生的。

另外,我已确保我的 Typora 为最新的 0.9.68 版本。

from typora-vue-theme.

Related Issues (20)

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.