gpt4 book ai didi

html - 在网页中显示两种语言的文本,在 css 规则中使用不同字体的字体

转载 作者:行者123 更新时间:2023-11-28 03:06:51 25 4
gpt4 key购买 nike

我的网页按预期使用 Yekan 字体显示波斯文本。为什么英文文本错误地使用了 Alger 以外的字体?

@font-face { <!-- Persian Font -->
font-family: Yekan;
src: url(Fonts/BYekan.ttf);
unicode-range:U+0600-06FF;
}
@font-face { <!-- English Font -->
font-family: Alger;
src: url(Fonts/ALGER.TTF);
unicode-range: U+0020-007F;
}

最佳答案

一个元素只能添加一种字体。
技巧:尝试给他们相同的名字:

@font-face { /* Persian Font */
font-family: 'MyFont';
src: url(Fonts/BYekan.ttf);
unicode-range: U+0600-06FF;
}

@font-face { /* English font */
font-family: 'MyFont';
src: url(Fonts/ALGER.TTF);
unicode-range: U+0020-007F;
}

用法:

body {
font-family: 'MyFont';
}

这应该可以解决您的问题,但我无法测试它,因为我在移动设备上。

关于html - 在网页中显示两种语言的文本,在 css 规则中使用不同字体的字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32287257/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com