Font size, px or pt?

Asked

Viewed 10,227 times

6

I receive the layout in PSD, export as I need. And I do font-face when necessary.

The Photoshop I have, shows the measurement of the sources in pt, I always applied px in CSS. I was reading that, and I saw that he treats these two measures differently. And sometimes, depending on the source used, I have problems with the size. The ideal would be to measure the font used with the Crop Photoshop, or something? and designate in pt in the CSS?

  • Read it here, explain it nicely...http://kyleschaeffer.com/development/css-font-size-em-vs-px-vs-pt-vs/

  • @Dante, the ideal then is %? as long as there is a div of the full size?

  • If you know exactly what size the div is (not very iterative) and you don’t have full fill issues in some cases, you’d better use the '%'

1 answer

8


Always use px in css when using absolute values, if you want to see the table below to do the substitution:

+---------+---------+----------+---------+
| Points  | Pixels  |   Ems    |    %    |
+---------+---------+----------+---------+
| 6pt     | 8px     | 0.5em    | 50%     |
| 7pt     | 9px     | 0.55em   | 55%     |
| 7.5pt   | 10px    | 0.625em  | 62.5%   |
| 8pt     | 11px    | 0.7em    | 70%     |
| 9pt     | 12px    | 0.75em   | 75%     |
| 10pt    | 13px    | 0.8em    | 80%     |
| 10.5pt  | 14px    | 0.875em  | 87.5%   |
| 11pt    | 15px    | 0.95em   | 95%     |
| 12pt    | 16px    | 1em      | 100%    |
| 13pt    | 17px    | 1.05em   | 105%    |
| 13.5pt  | 18px    | 1.125em  | 112.5%  |
| 14pt    | 19px    | 1.2em    | 120%    |
| 14.5pt  | 20px    | 1.25em   | 125%    |
| 15pt    | 21px    | 1.3em    | 130%    |
| 16pt    | 22px    | 1.4em    | 140%    |
| 17pt    | 23px    | 1.45em   | 145%    |
| 18pt    | 24px    | 1.5em    | 150%    |
| 20pt    | 26px    | 1.6em    | 160%    |
| 22pt    | 29px    | 1.8em    | 180%    |
| 24pt    | 32px    | 2em      | 200%    |
| 26pt    | 35px    | 2.2em    | 220%    |
| 27pt    | 36px    | 2.25em   | 225%    |
| 28pt    | 37px    | 2.3em    | 230%    |
| 29pt    | 38px    | 2.35em   | 235%    |
| 30pt    | 40px    | 2.45em   | 245%    |
| 32pt    | 42px    | 2.55em   | 255%    |
| 34pt    | 45px    | 2.75em   | 275%    |
| 36pt    | 48px    | 3em      | 300%    |
+---------+---------+----------+---------+

Source

  • Got it, so I should use the Crop Photoshop and measure font size in PX? just like I do with the other elements.

  • I believe you can save this table as a reference, so you won’t even need to measure it. (I think it’s highly unlikely that you’ll need something bigger than 48px)

  • Show ball guy, thank you very much. You have the source of this table?

  • 1

    Oops, I thought I added in the answer... (now it’s there).

  • 1

    "Always use px in css", and why this?

  • Let’s say maybe I wasn’t clear enough. My goal was to say: always use px for absolute values (instead of pt/cm/etc) because they are not so well established in css.

  • 2

    I remember back in the days of IE6 and maybe 7, the px was poorly seen because it prevented the zoom of the text with CTRL++. I also remember recommending not to use px in style sheets for printing. Result: today I get a little lost with this, I do not know what is worth and what is not worth, and why.

  • It would not be easier to use directly the pt?

  • 1

    no, the recommended is: % or em for conventional texts. px for absolute values where necessary (images and places need absolute values not to break the layout). And pt for printing and only for this.

Show 4 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.