Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set a different font-size for a fallback font

Tags:

css

fonts

On my website I use these fonts: font-family: Segoe UI, Verdana, Geneva, sans-serif

Verdana looks kind of like Segoe UI and is a nice fallback for Macs & iOS devices. Now the problem is that Verdana is just a lot bigger than Segoe UI so on some devices the fonts are just too big.

I cannot seem to figure out how to set the font-size depending on the font applied; 18px for segoe ui and 16px for verdana for example?

Any idea how I could do this using only css?

thanks!

like image 559
cmplieger Avatar asked Aug 12 '12 00:08

cmplieger


People also ask

How do you define a fallback font?

A fallback font is a reserve typeface containing symbols for as many Unicode characters as possible. When a display system encounters a character that is not part of the repertoire of any of the other available fonts, a symbol from a fallback font is used instead.

How do you change the font for the web page What does mean by fall back fonts and how do you give them?

font-family: font-name; but we can also set fallback fonts which would be: font-family: font-1, font-2, font-3; If Font 1 isn't available, font-2 would be used, and so on.

Is Helvetica a fallback font?

So the candidate fallback fonts are Arial / Helvetica, Trebuchet MS, and Verdana.


1 Answers

You could use the ex unit but its implementation has been buggy for some browsers.
Another alternative is using the font-size-adjust property which is supported by Gecko powered browsers.

like image 94
Knu Avatar answered Oct 06 '22 12:10

Knu