What is the *preferred* way of defining text size - CCS using %... using "x-small"

A

Andy Dingley

Of course it has.

Rubbish, Jukka,

I have two monitors and a KVM switch. I press a button and the image
jumps from one to the other. The "10 pt" characters are now
physically bigger or smaller -- they're the same number of pixels
(defined by some bizarre combination of system and user configuration)
but their physical size is _entirely_ unpredictable to the browser and
machine I'm viewing them on.

And that's the simple case, without even trying to view the page from
my phone.


(Oh, Richard - you're _still_ an idiot)/
 
J

Jukka K. Korpela

Andy Dingley said:
Rubbish, Jukka,

Please refer to the definition of "pt" in the CSS specifications.
I have two monitors and a KVM switch.

That's completely irrelevant to the definition of "pt".
I press a button

That's completely irrelevant to the definition of "pt".
and the image jumps from one to the other.

That's completely irrelevant to the definition of "pt".
The "10 pt" characters are now
physically bigger or smaller

They are not "10 pt" characters. They might be characters for which
font-size: 10pt has been specified. What happens then depends on the
browser, its settings, and environments, among other things.

When you say font-size: 10pt in CSS, it's just a suggestion, and
browsers might ignore it or take it into account so that the actual
font size is an approximation of 10pt.

This by no means changes the definition of "pt" or makes it obscure.

Similarly, if you were asked to give someone 10 grams of sugar, then
you would, if you reacted positively to the request, give some amount
of sugar that is close to 10 g, but it would be virtually certain that
it is not exactly 10 g - there would most probably be at least a
deviation of a few yoctograms, perhaps even milligrams or, gasp, grams.
This would, however, not by any means change the definition of gram.

Followups trimmed using the normal randomization technique.
 
A

Andy Dingley

Please refer to the definition of "pt" in the CSS specifications.

I'm not sure if I've seen every reference to it (I hate the CSS specs
and find them very hard to follow). But AFAIK, they're all of this
form:

:> Absolute length units are only useful when the physical properties
:> of the output medium are known. The absolute units are:
:> [in, cm, mm, pt, pc]
:>
:> * pt: points — the points used by CSS 2.1 are equal to 1/72th of an inch.

So, absolute length units are "only useful" under conditions that we
can't meet in this case.

When you say font-size: 10pt in CSS, it's just a suggestion, and
browsers might ignore it or take it into account so that the actual
font size is an approximation of 10pt.

This by no means changes the definition of "pt" or makes it obscure.

Agreed. So why do you claim that "10pt has a meaning when used for
screen display" ?

Now there's a literalist semantic argument here where _of_course_
"10pt has a _meaning_" in this context - no-one would disagree with
that. My assertion is the only sensible interpretation to make in a
HTML user group, not a standards definition body -- the statement has
the meaning "The value of the physical dimension implied by 10pt is
undefined"

Of course there is a defaulting mechanism, But this is unreliable on
most systems and has to be regarded as unreliable when authoring.
Similarly, if you were asked to give someone 10 grams of sugar, then
you would, if you reacted positively to the request, give some amount
of sugar that is close to 10 g, but it would be virtually certain that
it is not exactly 10 g

Of course. But in your scenario, I would give the second neighbour who
asks for 10g of sugar twice as much, because they brought a bigger
teacup to collect it in.
 
T

Toby Inkster

Andy said:
the statement has the meaning "The value of the physical dimension
implied by 10pt is undefined"

No it's not. It's defined as being a font with a line-height of 0.138889
inches (correct to 6 decimal places). Quite a simple definition.
 
J

Jukka K. Korpela

Andy Dingley said:
:> Absolute length units are only useful when the physical
:> properties of the output medium are known. The absolute units
:> are: [in, cm, mm, pt, pc]
:>
:> * pt: points — the points used by CSS 2.1 are equal to 1/72th
:> of an inch.

So, absolute length units are "only useful" under conditions that
we can't meet in this case.

Maybe, though the draft (as well as CSS 1.0 and CSS 2.0) use fairly
vague wordings - "are only useful" is loose prose, not a normative
statement.

But the point (no pun intended) is that there _is_ a rigorous
definition. (The inch is, by definition, exactly 0.0254 meters.)
Agreed. So why do you claim that "10pt has a meaning when used for
screen display" ?

Because its definition in no way depends on where it is used.
Whether it is useful, or good practice, or kosher, is something
different.
Now there's a literalist semantic argument here where _of_course_
"10pt has a _meaning_" in this context

Fine. "Semantic" means 'related to meaning', so what other arguments
than semantic arguments would you use to discuss the meaning of
something? And it's a literal matter since in this case, the meaning is
defined literally and rigorously.
Of course there is a defaulting mechanism, But this is unreliable
on most systems and has to be regarded as unreliable when
authoring.

I have no idea of what you are talking about here.
Of course. But in your scenario, I would give the second neighbour
who asks for 10g of sugar twice as much, because they brought a
bigger teacup to collect it in.

Why would you do that?

To repeat my point, it might well be unwise to pt sizes, except in user
style sheets. Actually I strongly think they should be avoided. But
_not_ because the font size suggestion in pt units would itself be
vague or even undefined. Rather, because it is _exact_ (and ultimately
specifies the point size using the physical unit meter). The variation
caused by browsers in using the suggestion are of no help here, since
they are, as you describe, largely uncontrollable - and could even be
unpredictable.
 
N

Neal

Toby said:
No it's not. It's defined as being a font with a line-height of 0.138889
inches (correct to 6 decimal places). Quite a simple definition.

You've defined the physical size of 10pt. But if you set a webpage at
10pt, and I view it on my system, and I measure the height of the
character on the screen with a ruler or other device, will the height
always be 0.138889... inches? Or will it vary?
 
T

Toby Inkster

Neal said:
You've defined the physical size of 10pt. But if you set a webpage at
10pt, and I view it on my system, and I measure the height of the
character on the screen with a ruler or other device, will the height
always be 0.138889... inches? Or will it vary?

Your system may display the font incorrectly, but that doesn't effect the
fact that 10pt is a well-defined size.

It's like saying that a centimetre is undefined because I can't remember
where I put my tape measure.
 
M

MALdito

Jukka K. Korpela said:
Please refer to the definition of "pt" in the CSS specifications.


That's completely irrelevant to the definition of "pt".


That's completely irrelevant to the definition of "pt".


That's completely irrelevant to the definition of "pt".


They are not "10 pt" characters. They might be characters for which
font-size: 10pt has been specified. What happens then depends on the
browser, its settings, and environments, among other things.

When you say font-size: 10pt in CSS, it's just a suggestion, and
browsers might ignore it or take it into account so that the actual
font size is an approximation of 10pt.

This by no means changes the definition of "pt" or makes it obscure.

Similarly, if you were asked to give someone 10 grams of sugar, then
you would, if you reacted positively to the request, give some amount
of sugar that is close to 10 g, but it would be virtually certain that
it is not exactly 10 g - there would most probably be at least a
deviation of a few yoctograms, perhaps even milligrams or, gasp, grams.
This would, however, not by any means change the definition of gram.

Followups trimmed using the normal randomization technique.


Why not use pixels? (seems to me that they are more accurate than pts in the
screen)


--
--------------------------------------
Part of the "No Signature Movement"
My site: http://www.webbasica.com
And for all those spammers out there,
knock yourself out:
(e-mail address removed)
 
J

Jukka K. Korpela

Toby Inkster said:
No it's not. It's defined as being a font with a line-height of
0.138889 inches (correct to 6 decimal places). Quite a simple
definition.

No, 10pt means a certain length (with the approximative value you gave)
- of anything you use it for. You can set various dimensions in pt
units in CSS. Whether that's useful is a different issue.

When used for font-size, it sets the font size, which is defined as the
height of the font, which is a typographic property of a font.
Line height is a different issue, and it's not a property of a font,
and normally the line height should be larger than the font size,
for readability, and can be set using the line-height property.

Using the font shorthand (a risky business - people either
misunderstand the concept or at least forget its details at times)
you can set both the font-size and the line-height (along with the
font-family at least):
font: 10pt/12pt Arial;
 
N

Neal

Your system may display the font incorrectly, but that doesn't effect the
fact that 10pt is a well-defined size.

It's like saying that a centimetre is undefined because I can't remember
where I put my tape measure.

But on a practical level, using pt for the web is useless because of this
variance. That's what I thought the whole point [:)] was - while pt refers
to a particular size, dependably getting someone else's system to do it
that way is impossible.
 
K

kchayka

MALdito said:
Why not use pixels? (seems to me that they are more accurate than pts in the
screen)

You must be new around here or you wouldn't have even suggested this. :)
 
A

Andy Dingley

Why not use pixels? (seems to me that they are more accurate than pts in the
screen)

They are "more accurate" - that's rather the problem.

On the web, you have no idea what resolution a user is using, how big
their screen is, or how good their eyesight is. Even limiting this to
just "desktop browsers", there's easily a factor of two variation
between the physical size of a pixel on different systems. A pixel
size that's appropriate and readable on one may be terrible on
another.

The solution would be to use "em" units everywhere. It's also a good
idea that "body text" should always be 1 em, for consistent
readability between sites.

However IE is buggy, so use "100%" instead. This still means "1em",
but it avoids a bug.
 
A

Andy Dingley

But the point (no pun intended) is that there _is_ a rigorous
definition. (The inch is, by definition, exactly 0.0254 meters.)

There is no rigorous definition (for screen display on the web), as
there is no rigorous definition of the inch in those circumstances.
 
A

Andy Dingley

No it's not. It's defined as being a font with a line-height of 0.138889
inches (correct to 6 decimal places). Quite a simple definition.

Simple, but it depends on a notion of a "web screen inch", which is
both undefinable and known to be inconsistent between users.

There could exist systems where the OS has a workable "inch" mechanism
that is calibrated to the monitor in use. But these systems are still
rare (actually they're common, but are rarely set correctly). There's
also the problem that monitor switching or even multi-monitor systems
can affect "the size of an inch".
 
J

Jukka K. Korpela

Andy Dingley said:
There is no rigorous definition (for screen display on the web), as
there is no rigorous definition of the inch in those circumstances.

The inch is invariably 0.0254 meters (= 25.4 mm), by definition.
The meter is defined in terms of the speed of light in vacuum
(a universal physical constant) and the second, which in turn has been
rigorously defined in terms of the frequency of specific type of
radiation emitted by cesium 133 in well-defined circumstances.
Your screen display won't change those physical constants.
 
N

Neal

The inch is invariably 0.0254 meters (= 25.4 mm), by definition.
The meter is defined in terms of the speed of light in vacuum
(a universal physical constant) and the second, which in turn has been
rigorously defined in terms of the frequency of specific type of
radiation emitted by cesium 133 in well-defined circumstances.
Your screen display won't change those physical constants.

Yeah, yeah, yada, yada, cesium 133 and all those other New Wave bands.

But the question really is this:

If I set

body {font-size: 10pt;}

and I go around to every computer I can find, load that up, and actually
measure the rendered size of the character on the screen, will it always
be the same? Will it always equal 0.138889... inches?

Answer: no.

That is why people are saying that while pt refers to something specific,
when applied to www screen display we have no means to predict whether
that specific size will happen or not.
 
J

Jukka K. Korpela

Neal said:
But the question really is this:

Well, _a_ question. Not the question on the Subject line, for example.
If I set

body {font-size: 10pt;}

and I go around to every computer I can find, load that up, and
actually measure the rendered size of the character on the screen,
will it always be the same? Will it always equal 0.138889...
inches?

No, of course not. And the same applies to _any_ value for the
font-size property. So it proves nothing about the pt unit
specifically.

(This includes, but is surely not limited to, the fact that in most
fonts we use, the height of every character is considerably smaller
than the height of the font.)
 
A

Andy Dingley

The inch is invariably 0.0254 meters (= 25.4 mm), by definition.
The meter is defined in terms of the speed of light in vacuum
(a universal physical constant) and the second, which in turn has been
rigorously defined in terms of the frequency of specific type of
radiation emitted by cesium 133 in well-defined circumstances.
Your screen display won't change those physical constants.


And this month's contender for the Viz "Mr Logic" award goes to Jukka!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top