Answer the question
In order to leave comments, you need to log in
How to set different font-size for Cyrillic and Latin in one element?
One element can contain both Latin and Cyrillic characters.
There are two different fonts included. One primary, but without support for Cyrillic, the second with support for both, but is needed only as a crutch for Cyrillic.
@font-face {
font-family: latin;
src: url('/fonts/latin.eot'); /* IE9 Compat Modes */
src: url('/fonts/latin.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/fonts/latin.woff') format('woff'), /* Modern Browsers */
url('/fonts/latin.ttf') format('truetype'), /* Safari, Android, iOS */
url('/fonts/latin.svg#svgFontName') format('svg'); /* Legacy iOS */
}
@font-face {
font-family: cyrillic;
...
}
.example {
font-family: latin, cyrillic, Arial, Helvetica, sans-serif;
font-size: 100%;
}
Answer the question
In order to leave comments, you need to log in
if you have it like this - [span]rus eng[/span], then nothing, if only to detect characters with javascript, and wrap the Latin or Cyrillic alphabet in additional. element, for it to set the font later,
but this is some kind of perversion) find a normal font
Why do you need such a perversion, if, as in the example above, rus eng, then you can split spli(' ') into JS by space and add the class you need and already apply the desired style, but for such a construction
your hands will be torn off
Mikhail Chirsky : why perversion? It seems to me quite reasonable if there was a style for a particular unicode character. there is a pseudo element for the first character in the text.
Or, for example, I would like something like this:
.example {
@font-face {
font-family: latin;
font-size: 1em;
}
@font-face {
font-family: cyrillic;
font-size: 2em;
}
font-family: latin, cyrillic, Arial, Helvetica, sans-serif;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question