Google Answers Logo
View Question
 
Q: How many pixels are there? ( Answered 5 out of 5 stars,   1 Comment )
Question  
Subject: How many pixels are there?
Category: Computers > Internet
Asked by: respree-ga
List Price: $5.00
Posted: 30 Jan 2003 08:05 PST
Expires: 01 Mar 2003 08:05 PST
Question ID: 155251
How many horizontal pixels does the following text occupy inclusive of
the opening and closing parenthesis?

(Total: $100.00)

Given:

1) IE font size is set to large AND
2) Screen resolution is set to 800 x 600 AND
3) HTML font size is set to "1" AND
4) HTML font type is "verdana"

Please provide some support (links) for your answer.

Request for Question Clarification by hammer-ga on 30 Jan 2003 08:19 PST
How are you setting the IE font size to "large". You can set it Larger
or Largest, but I don't see "Large", unless you are using a
stylesheet.

- Hammer

Clarification of Question by respree-ga on 30 Jan 2003 08:30 PST
CLARICATION:  I meant to say "Largest," not Large.

From the IE bar:

View -> Text Size --> Largest
Answer  
Subject: Re: How many pixels are there?
Answered By: hammer-ga on 30 Jan 2003 09:20 PST
Rated:5 out of 5 stars
 
Using the settings you specify, and assuming that the browser is not
set to override any of these settings, IE5 requires 133 x 16 pixels to
display your text.

As to support, I built a web page to your specifications, set my
display settings as you required, set IE's settings as you required,
did a screen capture and measured the text in a graphics program
(GIMP).

Here is the source of the web page:
<HTML>
<HEAD>
</HEAD>
<BODY>
<FONT SIZE=1 FACE="Verdana">(Total: $100.00)</FONT>
</BODY>
</HTML>

- Hammer

Clarification of Answer by hammer-ga on 30 Jan 2003 09:26 PST
BTW, alan_dershowitz is correct. You can't depend on any particular
version of any particular browser to do anything in particular on any
particular day. *sigh*

- Hammer

Request for Answer Clarification by respree-ga on 30 Jan 2003 13:57 PST
Thanks Hammer for your response.

However, I do not believe your answer is correct.

If a screen measures 800 pixels wide and you're saying the text
occupies 133 pixels, then the text "(Total: $100.00)" should display
6.01503759398496241 times (800 divided 133).  Said another way, it
should display (repeat) a minumum of 6 times (assuming your 133 pixel
answer is correct).  Right and left margins have been set to 0. Of
course, the text would "wrap" on one of the letters 7th occurence of
the phrase.

Please follow the link below, which (on my computer at least) only
displays it 5 times (not 6) before the line breaks. (set browser font
to "largest" and screen resolution to 800 x 600, then view link)
 www.respree.com/scstore/sitepages/temp.html

My conclusion is that it is actually 'larger' than 133 pixels.

I'm not a graphics expert, but I'm not sure if your screencap approach
makes sense.  Does the screen 'precisely' capture the 'exact'
dimensions of what is visually displayed by the html, pixel by pixel.

Will give you a chance to clarify or submit a different answer before
I rate.

Let me know if my math theory is flawed in some way.

Thanks.

Clarification of Answer by hammer-ga on 30 Jan 2003 14:45 PST
Your math does not take into account that you are not allowed to have
the entire 800 pixel screen width. The portion of the browser where
the page is displayed is not 800 pixels wide. If you have your browser
maximized, and have no sidebars open, it is 800 pixels minus the
window decoration (border) and, in some cases, the scroll bar width,
which is usually about 18 pixels. If we assume 2 pixels on each side
for the window decoration, then you only get 796 pixels to work with.
796/133=5.98 repetitions. If we also take away 18 pixels for the
scroll bar, then you are left with 778 pixels. 778/133=5.85
repetitions. In both cases, the browser will try to wrap at a space,
so your test page wraps at the space after the colon in the sixth
repetition.

To answer your concern about the method used, I have extensive
graphics experience. The screen capture approach is valid. It "takes a
picture" of the browser window, pixel by pixel.

Incidentally, you have a small syntax error in your source. 
rightmarin="0" should be rightmargin="0"

- Hammer
respree-ga rated this answer:5 out of 5 stars
I stand corrected.  You are correct, I neglected to account for the
pixels occupied by the browser's borders.  Based on your
clarification, I agree with your answer.  Thanks very much for all
your help.

Comments  
Subject: Re: How many pixels are there?
From: alan_dershowitz-ga on 30 Jan 2003 09:21 PST
 
Just an FYI, you cannot rely on the browser to give you the font nor
the font size you code, since this is all customizable through user
stylesheets. Microsoft has changes IE's default stylesheet before, so
it may not even be consistent among all versions of IE. Browsers will
also do font substitutions for fonts if they are not available,
although someone would have to delete Verdana from Windows for IE to
not have it.

I'm not discouraging you from finding your answer, since I don't know
why you need this information, just mentioning a caveat that exists if
you are relying on this information for creating a publicly available
webpage.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy