Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which height does a font-size in pixels refer to?

Tags:

css

pixel

fonts

In many programs or systems you can specify a font-size by pixel height. (Photoshop, CSS, etc.)

What does this refer to exactly? Is it the height from the descender to the ascender? From the baseline to the cap height? I haven't been able to find out whether there's a standard for it, or if each application handles it differently.

// EDIT

I just realized this isn't really the right place to be asking this. Is there a way to remove this question?

like image 1000
Silverlan Avatar asked Sep 01 '25 10:09

Silverlan


1 Answers

Well the answer is 'descender to the ascender' (round about), BUT every font works different and has a different rendering in Programms, Browsers etc. So if you are using a font wich in not 'normal', but a little smaller than normal, it is actually smaller than the pixel yu give it with font-size. On the other hand there are.

If you look at my Image (enlarged in Photoshop) this is Arial at font-size:18px; but from the bottom to the top its 17px. So its not 100% Accurate and can change by different fonts and different platforms & Programms.

enter image description here

like image 107
Pinki Avatar answered Sep 03 '25 02:09

Pinki