Young-Ho Kim
Young-Ho Kim

Reputation: 193

Assigining different font-size per each font in one font-family

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

So the text contains English and other languages mixed.

I assigned font-family like

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.

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

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

is there any way to do that?

Upvotes: 11

Views: 4155

Answers (1)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201886

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).

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.

Upvotes: 11

Related Questions