Whenever I come at the point in my designs to select the font, this common problem occurs (common for every designer) ,
For example we set the font family and font size for a paragraph as follows,
p {
font-family: 'Source Sans Pro', Arial, Verdana, sans-serif;
font-size: 13px;
}
In CSS (as everyone knows) when the first font in the font family is not present, it selects the second font, and if the second is not present it goes for the third one and so on.
The problem is that Arial is bigger than 'Source Sans Pro' at 13 px, and Verdana is bigger than Arial at 13 px.
Look at this image:
This is the problem every designer face every single time they think the font family for a design.
I wish there was some CSS method or hack by which we tell the browser to take the 'Source Sans Pro' at 13px, but if its not present than don't take Arial at 13px, instead take Arial at 12px, and if even Arial is not present than take Verdana at 11px.
e.g. font-family-size: 'Source Sans Pro' 13px, Arial 12px, Verdana 11px; (this rule isn't there in CSS, its just my wish)
Summary: We can assign a single size for the whole font family (font family which contains more than one fonts), now in practical every font size display different (smaller or bigger) than other fonts in the same font family.
Both the x-height as well as the cap height of a font affect its legibility, and will make different typefaces look larger or smaller at the same point size. When designers first try out different fonts, they usually look for a size that looks and works best for the demographics and requirements of the design at hand.
And a “font family” represents a collection of related fonts, such as bold and italic variations of the same “typeface” or “font”. In summary, in common terminology, typeface (aka font) means the design, font means the file containing the typeface, and font-family means collection of related fonts.
Fonts are stored in files on the computer and they are called by their name. If two fonts use the same name the computer will overwrite the old one. If two different custom fonts use the same name and each computer has a different one installed, the fonts will display according to how they are installed.
Web authors should always add at least one generic family in a font-family list, since there's no guarantee that a specific font is installed on the computer or can be downloaded using a @font-face at-rule.
What you are looking for is the font-size-adjust
property — a nearly perfect solution to this problem. Of course, browser support is terrible: it only works on Firefox.
Here's an example (open in Firefox): http://jsfiddle.net/zL6vL/1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With