在一个字体族中为每个字体分配不同的字体大小 [英] Assigining different font-size per each font in one font-family

查看:130
本文介绍了在一个字体族中为每个字体分配不同的字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以非英语语言制作网页。

I'm making a webpage in a language other that English.

因此,文字包含英语和其他语言。

So the text contains English and other languages mixed.

我分配的字体族像

p{
font-family: 'EnglishFont', 'NonEnglishFont';
font-size:14px;
}

它工作正常,但字体的原始矢量大小不同,句子在混合语言中看起来很奇怪。

It works fine, but the original vector size of the fonts differs, causing the sentence looks weird in mixed languages.

所以我想为一个css类中的字体分配不同的大小,例如

so I want to assign different size for font in one css class, something like

p{
font-family: 'EnglishFont', 'NonEnglishFont';
font-size:14px, 16px;
}

有什么办法吗?

推荐答案

您不能设置字体大小,因此它将取决于字体族。

You cannot set font size so that it would depend on the font family.

而是尝试在页面上找到适合于两种(或所有)语言的字体。字体设计者应该考虑不同写入系统的不同特性。通常设计用于例如亚洲语言也有拉丁字母(至少基本的拉丁字母,大多数足以满足英语)。

Instead, try and find a font that is suitable for both (or all) languages on the page. The font designer should have taken the different characteristic of different writing systems into account. Usually fonts designed for e.g. Asian languages have Latin letters, too (at least the basic Latin letters, which mostly suffice for English).

如果你真的想为不同的书写系统设置不同的字体属性,您需要使用区分不同语言的标记,例如在HTML中使用 lang 属性,并在CSS中基于它们选择器。但通常使用不同的字体是一个要避免的问题,而不是一个解决方案。

If you really want to set different font properties for different writing systems, you need to use markup that distinguishes between different languages, e.g. using lang attributes in HTML and selectors based on them in CSS. But normally the use of different fonts is a problem to be avoided, rather than a solution.

这篇关于在一个字体族中为每个字体分配不同的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆