I don't know where you are reading this, so I left the massive
cross-posting intact.
> What is a method or set of methods that can determine all of the font
> characteristics of any web page?
Use CSS. Do you know what this is at this point?
> By font characteristics I mean typeface name, point size, foreground
> color, background color, bold, underline, et cetera.
Forget about 'point size'. Points are for printing. Use percentages for
font sizing (discussed almost daily in these groups). Don't use pixels,
either, for the oft-stated reasons.
body {
background-color: #f5f5f5;
font-family: sans-serif;
font-size: 100%;
color: #000000;
}
For bold text:
This is <strong>bold text</strong> in most browsers. This is
<u>underlined</u> in most browsers, though you shouldn't use it because
people will think it is a link. <em>Emphasized text</em> may be a better
choice.
> I am a visual C++ programmer, and will be learning .NET very soon, so
> if there is a simplified way using either of these tools, I would
> prefer this simpler way.
It is a very simple task to add a link in the <head> of the document to
a style sheet that will work for the entire web site.
--
-bts
-Warning: I brake for lawn deer
>> By font characteristics I mean typeface name, point size, foreground
>> color, background color, bold, underline, et cetera.
>
> Forget about 'point size'. Points are for printing. Use percentages for
> font sizing (discussed almost daily in these groups). Don't use pixels,
> either, for the oft-stated reasons.
I must know the point size. Imagine that I am writing a browser, and must
display any webpage.
> "Beauregard T. Shagnasty" <a.non...@example.invalid> wrote:
>> In alt.html, Peter Olcott wrote:
>>
>>> What is a method or set of methods that can determine all of the
>>> font characteristics of any web page?
>>
>> Use CSS. Do you know what this is at this point?
>>
> I am not writing webpages I am parsing websites. I have no choice in
> how any of these websites are written.
OK, you did not make that clear at all.
>>> By font characteristics I mean typeface name, point size, foreground
>>> color, background color, bold, underline, et cetera.
>>
>> Forget about 'point size'. Points are for printing. Use percentages
>> for font sizing (discussed almost daily in these groups). Don't use
>> pixels, either, for the oft-stated reasons.
>
> I must know the point size. Imagine that I am writing a browser, and
> must display any webpage.
Then, as I see it, you are doomed before you start. What will your
parser do when it comes to a site - with no HTML presentation - that has
"font-size: smaller" in the CSS file? The actual size of the appearance
of the text in my browser is entirely dependant on my local settings.
Points are still for printing.
It will do whatever the browser does, the browser must ultimately determine a
point size, so by whatever means the browser uses, I must also use.
(Follow ups set to alt.html as its the only group in the list I read)
> What is a method or set of methods that can determine all of the font
> characteristics of any web page? By font characteristics I mean typeface
> name, point size, foreground color, background color, bold, underline, et
> cetera.
It depends on what:
* Presentational HTML is used
* Author stylesheets are set (which may be modified by JavaScript, e.g. I've
seen scripts that change the font size based on the window width)
* User stylesheets are set
* Browser default stylesheets are set (or whatever means of determining
default rendering the browser uses if not stylesheets)
* User preferences
* Fonts installed on the system displaying the page
http://www.w3.org/TR/CSS2/ describes CSS and includes a suggested browser
default stylesheet for HTML 4.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is