Welcome to the Treehouse Community
Looking to learn something new?
I can't find a reference as to what constitutes the "font metrics" of an element. What does that all encompass?
Steven Parker215,954 Points
The term "font metrics" as used here simply means "font size".
The "metrics" actually encompass all parameters that are used to display the font, but for this exercise the focus is on the font size.
Since the relative units do not have a specific size, they are based on the current size from the font metrics.
So, for example, if the current font size was 10px and you set it to
1.5em, it would now be 15px.
Font metrics is information that is part of a font file which is used to help display the font properly. The browser will use these metrics to determine how the text should be displayed in terms of size and spacing.
For example, in the link you gave for the
ex unit, it mentions that it uses the x-height of the font. x-height is one of the metrics that a font can provide.
Here's a wikipedia article with a Font Metrics section: https://en.wikipedia.org/wiki/Typeface#Font_metrics
There's a diagram of the word "Sphinx" and it shows that the x-height is the height of a lowercase x. It also shows some of the other metrics that a font can provide.
Another wikipedia link, https://en.wikipedia.org/wiki/Font#Metrics , which also talks about kerning. Some fonts could provide kerning information which tells you how close together certain letter pairs can be.
Also in the link you gave, the 'ch unit' mentions "advance width or height" which are 2 more examples of font metrics.
Font metrics could also be used by the browser for line-height and leading calculations.