Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如果一个ttf里面包含了多个字重那该如何使用这个模板? #9

Open
NianBroken opened this issue Nov 29, 2022 · 1 comment

Comments

@NianBroken
Copy link

No description provided.

@lxgw
Copy link
Owner

lxgw commented Nov 30, 2022

可变字体(VF)需要对 fonts.xml 里面调用 font??w?.ttf 的语句进行调整(不限于 zh-Hans),参考以下语句:

    <family lang="zh-Hans">
        <font weight="100" style="normal">MiLanProVF.ttf
            <axis tag="wght" stylevalue="150" />
        </font>
        <font weight="200" style="normal">MiLanProVF.ttf
            <axis tag="wght" stylevalue="200" />
        </font>
        <font weight="300" style="normal">MiLanProVF.ttf
            <axis tag="wght" stylevalue="250" />
        </font>
        <font weight="350" style="normal">MiLanProVF.ttf
            <axis tag="wght" stylevalue="305" />
        </font>
        <font weight="400" style="normal">MiLanProVF.ttf
            <axis tag="wght" stylevalue="340" />
        </font>
        <font weight="500" style="normal">MiLanProVF.ttf
            <axis tag="wght" stylevalue="400" />
        </font>
        <font weight="550" style="normal">MiLanProVF.ttf
            <axis tag="wght" stylevalue="450" />
        </font>
        <font weight="600" style="normal">MiLanProVF.ttf
            <axis tag="wght" stylevalue="500" />
        </font>
        <font weight="700" style="normal">MiLanProVF.ttf
            <axis tag="wght" stylevalue="540" />
        </font>
        <font weight="900" style="normal">MiLanProVF.ttf
            <axis tag="wght" stylevalue="600" />
        </font>
    </family>

其中 MiLanProVF.ttf 可以改成您要更换的 VF 字体的文件名,可变字体的字重值(whgt 轴的 stylevalue)可以自己设定。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants