How can I convert point to pixel ?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Mds
Forum Contributor
Posts: 110
Joined: Tue Apr 22, 2008 8:56 pm
Contact:

How can I convert point to pixel ?

Post by Mds »

Hi
I wanna convert point to pixel. for example 36pt equals with ...px

Thank you
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: How can I convert point to pixel ?

Post by pickle »

I may be way off, but I usually add 2 from pt to px. So 36pt would be 38px. A quick way to tell is to write a page & specify the font size of an element in pt. Install Web Developer, type Ctrl + Shift + F & click on that element. The font size will be displayed in px.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: How can I convert point to pixel ?

Post by onion2k »

It depends on the font, operating system, browser, browser text size, and screen resolution. You can't really say "36pt text is 38px tall" because in a lot of circumstances it won't be.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: How can I convert point to pixel ?

Post by pickle »

onion2k wrote:It depends on the font, operating system, browser, browser text size, and screen resolution. You can't really say "36pt text is 38px tall" because in a lot of circumstances it won't be.
Ya, I figured it was a rough guess at best.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply