@
@
@prostophp2016-02-17 12:02:45
css
@prostophp, 2016-02-17 12:02:45

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%;
}

However, in reality, the fonts have a difference in size of three times. I can’t refuse Latin, although it is he who is responsible for the lack of standards in size.
The question is whether it is possible to set different sizes for Cyrillic and Latin in one element. Or do you still have to look for a Cyrillic font suitable in size (non-standard) for Latin?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
vvvadimos, 2016-02-17
@vvvadimos

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

M
Mikhail, 2016-02-17
Chirskiy @chirskiy_mixail

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

P
prostophp, 2016-02-17
@prostophp

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;
}

vvvadimos : yes, such a font, written specifically for the game, and departed from all possible standards. However, the site is based on the game and styled accordingly, so it was a crime to refuse the font. Alternatively, you can look for specialists who will adjust it to the standard

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question