[css3-fonts] Nested 'bolder' and 'lighter' question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
54 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[css3-fonts] Nested 'bolder' and 'lighter' question

fantasai

The spec isn't clear on what exactly happens here, so the CSSWG
decided to ask web designers what they expect. So far I have two
responses and they don't match. Anyone else have an opinion? :)

fantasai wrote:

> Given
>
>   <a>
>     Text A
>     <b style="font-weight: bolder">
>       Text B
>       <c style="font-weight: bolder">
>         Text C
>         <d style="font-weight: lighter">
>           Text D
>         </d>
>       </c>
>     </b>
>   </a>
>
> If you have three different weights in your font (normal, bold,
> extra-bold) then
>   - Text A will be normal
>   - Text B will be bold
>   - Text C will be extra-bold
>   - Text D will be bold
>
> If you have only two weights in your font (normal, bold) then
>   - Text A will be normal
>   - Text B will be bold
>   - Text C will be bold
>
> What should Text D be? Bold or normal?

I would say bold, if I were being so bold. -- Andy Clarke

I say it goes to normal. -- Molly Holzschlag

~fantasai




Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

Bill Brown-17

fantasai wrote:

>
> The spec isn't clear on what exactly happens here, so the CSSWG
> decided to ask web designers what they expect. So far I have two
> responses and they don't match. Anyone else have an opinion? :)
>
> fantasai wrote:
>> Given
>>
>>   <a>
>>     Text A
>>     <b style="font-weight: bolder">
>>       Text B
>>       <c style="font-weight: bolder">
>>         Text C
>>         <d style="font-weight: lighter">
>>           Text D
>>         </d>
>>       </c>
>>     </b>
>>   </a>
>>
>> If you have three different weights in your font (normal, bold,
>> extra-bold) then
>>   - Text A will be normal
>>   - Text B will be bold
>>   - Text C will be extra-bold
>>   - Text D will be bold
>>
>> If you have only two weights in your font (normal, bold) then
>>   - Text A will be normal
>>   - Text B will be bold
>>   - Text C will be bold
>>
>> What should Text D be? Bold or normal?
>
> I would say bold, if I were being so bold. -- Andy Clarke
>
> I say it goes to normal. -- Molly Holzschlag

Mathematically speaking, I think of it like this:
normal = 0, bolder = +1, lighter = -1
So, bold values:
A = 0, B = 1, C = 2, D = 1

D is bold, in both cases.

With a two-weight font, it must be assumed that anything with a value
greater than 0 must be bold, 0 or lower is normal. The assumption has to
be that if the author wanted normal (0), s/he would have specified a
reset, or normal.

It's the reverse of this argument:
<a>Text A
  <b style="font-weight: lighter">Text B (-1)
    <c style="font-weight: lighter">Text C (-2)
      <d style="font-weight: bolder">Text D (-1)
      </d>
    </c>
  </b>
</a>

D would have to be normal in this case, not bold.

If no options existed for setting bold or normal, I would agree that
bolder=bold and that lighter=normal, but since there are options for
setting those values, I don't see how one can extrapolate any other
meaning for the author than by using the math.

Or am I missing something completely?



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TheHolierGrail.com | MacNimble.com | Cyber-Sandbox.com | Anytowne.com
Bill Brown, Web Developer - "From dot concept to dot com since 1999"
"The intuitive mind is a sacred gift and the rational mind is a
faithful servant. We have created a society that honors the servant and
has forgotten the gift. -- Albert Einstein
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

François REMY
In reply to this post by fantasai
From: "fantasai" <[hidden email]>
Sent: Wednesday, August 27, 2008 8:23 PM
To: <[hidden email]>
Subject: [css3-fonts] Nested 'bolder' and 'lighter' question

>
> The spec isn't clear on what exactly happens here, so the CSSWG
> decided to ask web designers what they expect. So far I have two
> responses and they don't match. Anyone else have an opinion? :)
>
> fantasai wrote:
>> Given
>>
>>   <a>
>>     Text A
>>     <b style="font-weight: bolder">
>>       Text B
>>       <c style="font-weight: bolder">
>>         Text C
>>         <d style="font-weight: lighter">
>>           Text D
>>         </d>
>>       </c>
>>     </b>
>>   </a>
>>
>> If you have three different weights in your font (normal, bold,
>> extra-bold) then
>>   - Text A will be normal
>>   - Text B will be bold
>>   - Text C will be extra-bold
>>   - Text D will be bold
>>
>> If you have only two weights in your font (normal, bold) then
>>   - Text A will be normal
>>   - Text B will be bold
>>   - Text C will be bold
>>
>> What should Text D be? Bold or normal?
 
I would say "bold" because bolder should be the same as opening a brace :
 
bolder { // Here we have bold
    bolder { // Here we have extra-bold, computed as bold which is the closest UI representation of extra-bold
        ligther { // Here we have bold
        }
    }
}
I've another proposal. But I don't know if it's possible.

I joined here some images to show my idea in action (I used the 'Arial' font but as if this font doesn't have any bold mode).
 
My proposal is to do an outline (0.5px for 'bold' from normal or 'extra-bold' from 'bold', 0.75px for 'extra-bold' from 'normal') to emulate a bolder mode that's not supported by the font.
 
Ligther than normal :
Normal :
Bold : very light outline of 1px
Extra-bold : normal outline of 1px
Extra-extra-bold : important outline of 1px

>
> I would say bold, if I were being so bold. -- Andy Clarke
>
> I say it goes to normal. -- Molly Holzschlag
>
> ~fantasai
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

Brad Kemper-2
In reply to this post by fantasai

On Aug 27, 2008, at 11:23 AM, fantasai <[hidden email]>  
wrote:

>
> The spec isn't clear on what exactly happens here, so the CSSWG
> decided to ask web designers what they expect. So far I have two
> responses and they don't match. Anyone else have an opinion? :)
>
> fantasai wrote:
>> Given
>>  <a>
>>    Text A
>>    <b style="font-weight: bolder">
>>      Text B
>>      <c style="font-weight: bolder">
>>        Text C
>>        <d style="font-weight: lighter">
>>          Text D
>>        </d>
>>      </c>
>>    </b>
>>  </a>
>> If you have three different weights in your font (normal, bold,
>> extra-bold) then
>>  - Text A will be normal
>>  - Text B will be bold
>>  - Text C will be extra-bold
>>  - Text D will be bold
>> If you have only two weights in your font (normal, bold) then
>>  - Text A will be normal
>>  - Text B will be bold
>>  - Text C will be bold
>> What should Text D be? Bold or normal?
>
> I would say bold, if I were being so bold. -- Andy Clarke
>
> I say it goes to normal. -- Molly Holzschlag
>
> ~fantasai

This looks to me like a good reason not to use bolder and lighter.  
That said, it seems clear that the author intended the four weights in  
the four places listed first. The one that failed was the extrabold of  
C. That should not also cause the intended bold of D to fail too. The  
UA should not try to determine if D<C is more important to this  
particular author than D=B, but rather just limit the damage to C  
being  not really bold enough.

So I would say D=bold.
   

Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

Brad Kemper-2
In reply to this post by François REMY
On Aug 27, 2008, at 12:12 PM, François REMY <[hidden email]> wrote:

From: "fantasai" <[hidden email]>
Sent: Wednesday, August 27, 2008 8:23 PM
To: <[hidden email]>
Subject: [css3-fonts] Nested 'bolder' and 'lighter' question

>
> The spec isn't clear on what exactly happens here, so the CSSWG
> decided to ask web designers what they expect. So far I have two
> responses and they don't match. Anyone else have an opinion? :)
>
> fantasai wrote:
>> Given
>>
>>   <a>
>>     Text A
>>     <b style="font-weight: bolder">
>>       Text B
>>       <c style="font-weight: bolder">
>>         Text C
>>         <d style="font-weight: lighter">
>>           Text D
>>         </d>
>>       </c>
>>     </b>
>>   </a>
>>
>> If you have three different weights in your font (normal, bold,
>> extra-bold) then
>>   - Text A will be normal
>>   - Text B will be bold
>>   - Text C will be extra-bold
>>   - Text D will be bold
>>
>> If you have only two weights in your font (normal, bold) then
>>   - Text A will be normal
>>   - Text B will be bold
>>   - Text C will be bold
>>
>> What should Text D be? Bold or normal?
 
I would say "bold" because bolder should be the same as opening a brace :
 
bolder { // Here we have bold
    bolder { // Here we have extra-bold, computed as bold which is the closest UI representation of extra-bold
        ligther { // Here we have bold
        }
    }
}

I've another proposal. But I don't know if it's possible.

I joined here some images to show my idea in action (I used the 'Arial' font but as if this font doesn't have any bold mode).
 
My proposal is to do an outline (0.5px for 'bold' from normal or 'extra-bold' from 'bold', 0.75px for 'extra-bold' from 'normal') to emulate a bolder mode that's not supported by the font.
 
Ligther than normal :
Normal :<AF5.bmp>
Bold : <AFA.bmp>very light outline of 1px
Extra-bold : <AFC.bmp>normal outline of 1px
Extra-extra-bold : <AFD.bmp>important outline of 1px


Good idea. But I would prefer some reasonable em measurement for the stroke instead of px, so that it scaled better. And some extra letterspacing to allow for the space taken up by the stroke. Bolder letters are normally wider too, so that should not be a problem. 



>
> I would say bold, if I were being so bold. -- Andy Clarke
>
> I say it goes to normal. -- Molly Holzschlag
>
> ~fantasai
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

Zack Weinberg-6
In reply to this post by fantasai

fantasai <[hidden email]> wrote:
> The spec isn't clear on what exactly happens here, so the CSSWG
> decided to ask web designers what they expect. So far I have two
> responses and they don't match. Anyone else have an opinion? :)

I talked this over with a friend who's a web designer, and we came up
with, um, a proposal replacing all the rules for font-weight.  It
happens to make Text D bold in the case where there are only two
weights in the font.  It goes like this:

 - The effect of font-weight:bolder is to add 100 to the inherited
   value of font-weight; so normal/400 becomes 500, 500 becomes 600,
   and so on.
 - Similarly, font-weight:lighter subtracts 100 from the inherited
   value.

 - Actual font weights are assigned to font-weight numbers by packing
   them as closely as possible around normal/400.  Thus, if your font
   has two weights (normal and bold) normal is used for 100-400 and
   bold is used for 500-900; if it has three weights (normal, bold,
   extra-bold), normal is 100-400, bold is 500, extra-bold is 600+;
   and if it has three weights (light, normal, bold), they would take
   100-300, 400, 500-900 respectively.

 - We didn't discuss what happens if you apply "lighter" to an
   inherited value of 100, or "bolder" to an inherited value of 900.
   I can make a case for having them saturate or for having them
   just keep incrementing/decrementing but saying that all out-of-range
   values are equivalent to the limits.

 - It may be appropriate to also change font-weight:bold to be
   equivalent to font-weight:500.  I'm not sure whether there
   are fonts out there with weights intermediate between what we
   usually call "normal" and "bold".

Tangentially, I would add that whatever rules are adopted for
font-weight:bolder/lighter, the WG should make sure to
apply the same rules to font-stretch:wider/narrower.

zw

Reply | Threaded
Open this post in threaded view
|

RE: [css3-fonts] Nested 'bolder' and 'lighter' question

Sylvain Galineau
In reply to this post by fantasai


> > Given
> >
> >   <a>
> >     Text A
> >     <b style="font-weight: bolder">
> >       Text B
> >       <c style="font-weight: bolder">
> >         Text C
> >         <d style="font-weight: lighter">
> >           Text D
> >         </d>
> >       </c>
> >     </b>
> >   </a>
> >
> > If you have three different weights in your font (normal, bold,
> > extra-bold) then
> >   - Text A will be normal
> >   - Text B will be bold
> >   - Text C will be extra-bold
> >   - Text D will be bold
> >
> > If you have only two weights in your font (normal, bold) then
> >   - Text A will be normal
> >   - Text B will be bold
> >   - Text C will be bold
> >
> > What should Text D be? Bold or normal

>From CSS 2.1 15.6 Font boldness, I would have expected bold i.e. :

Normal weight -> 100,200,300,400,500
Bold weight -> 600,700,800,900

Assuming a's font-weight is 400 then :

b -> 700
c -> 800
d -> 700

Note that I am not necessarily saying this is the right way to do it or my own preference. But this is how I understand the specification's prose in this case.

Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

fantasai
In reply to this post by Zack Weinberg-6

Zack Weinberg wrote:

>
> I talked this over with a friend who's a web designer, and we came up
> with, um, a proposal replacing all the rules for font-weight.  It
> happens to make Text D bold in the case where there are only two
> weights in the font.  It goes like this:
>
>  - The effect of font-weight:bolder is to add 100 to the inherited
>    value of font-weight; so normal/400 becomes 500, 500 becomes 600,
>    and so on.
>  - Similarly, font-weight:lighter subtracts 100 from the inherited
>    value.
>
>  - Actual font weights are assigned to font-weight numbers by packing
>    them as closely as possible around normal/400.  Thus, if your font
>    has two weights (normal and bold) normal is used for 100-400 and
>    bold is used for 500-900; if it has three weights (normal, bold,
>    extra-bold), normal is 100-400, bold is 500, extra-bold is 600+;
>    and if it has three weights (light, normal, bold), they would take
>    100-300, 400, 500-900 respectively.
>
>  - We didn't discuss what happens if you apply "lighter" to an
>    inherited value of 100, or "bolder" to an inherited value of 900.
>    I can make a case for having them saturate or for having them
>    just keep incrementing/decrementing but saying that all out-of-range
>    values are equivalent to the limits.
>
>  - It may be appropriate to also change font-weight:bold to be
>    equivalent to font-weight:500.  I'm not sure whether there
>    are fonts out there with weights intermediate between what we
>    usually call "normal" and "bold".

Have you looked at what's spec'd currently? Because it's more
sophisticated than mapping directly to numbers. It's just undefined
for the nested 'bolder'/'lighter' case.

> Tangentially, I would add that whatever rules are adopted for
> font-weight:bolder/lighter, the WG should make sure to
> apply the same rules to font-stretch:wider/narrower.

Of course.

~fantasai

Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

David Singer
In reply to this post by Zack Weinberg-6

At 12:47  -0700 27/08/08, Zack Weinberg wrote:

>fantasai <[hidden email]> wrote:
>>  The spec isn't clear on what exactly happens here, so the CSSWG
>>  decided to ask web designers what they expect. So far I have two
>>  responses and they don't match. Anyone else have an opinion? :)
>
>I talked this over with a friend who's a web designer, and we came up
>with, um, a proposal replacing all the rules for font-weight.  It
>happens to make Text D bold in the case where there are only two
>weights in the font.  It goes like this:
>
>  - The effect of font-weight:bolder is to add 100 to the inherited
>    value of font-weight; so normal/400 becomes 500, 500 becomes 600,
>    and so on.
>  - Similarly, font-weight:lighter subtracts 100 from the inherited
>    value.
>
>  - Actual font weights are assigned to font-weight numbers by packing
>    them as closely as possible around normal/400.  Thus, if your font
>    has two weights (normal and bold) normal is used for 100-400 and
>    bold is used for 500-900; if it has three weights (normal, bold,
>    extra-bold), normal is 100-400, bold is 500, extra-bold is 600+;
>    and if it has three weights (light, normal, bold), they would take
>    100-300, 400, 500-900 respectively.
>
>  - We didn't discuss what happens if you apply "lighter" to an
>    inherited value of 100, or "bolder" to an inherited value of 900.
>    I can make a case for having them saturate or for having them
>    just keep incrementing/decrementing but saying that all out-of-range
>    values are equivalent to the limits.
>
>  - It may be appropriate to also change font-weight:bold to be
>    equivalent to font-weight:500.  I'm not sure whether there
>    are fonts out there with weights intermediate between what we
>    usually call "normal" and "bold".

yes, semi-bold does exist in some fonts.

>
>Tangentially, I would add that whatever rules are adopted for
>font-weight:bolder/lighter, the WG should make sure to
>apply the same rules to font-stretch:wider/narrower.

I agree that we need to appeal to broader general principles to
answer the question.

The un-answerable question in the example is "is it more important to
the designer/author that D be different from B or from C?  That is,
should it be normal (different from C) or bold (different from B)?"

This cannot be answered.  We have to look at more general principles
about when values in general get 'clamped' to the implemented range,
or rounded to the closest implemented value, and so on, as you have
above.
--
David Singer
Apple/QuickTime

Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

Simetrical-3
In reply to this post by fantasai

On Wed, Aug 27, 2008 at 2:23 PM, fantasai <[hidden email]> wrote:

> fantasai wrote:
>>
>> Given
>>
>>  <a>
>>    Text A
>>    <b style="font-weight: bolder">
>>      Text B
>>      <c style="font-weight: bolder">
>>        Text C
>>        <d style="font-weight: lighter">
>>          Text D
>>        </d>
>>      </c>
>>    </b>
>>  </a>
>>
>> If you have three different weights in your font (normal, bold,
>> extra-bold) then
>>  - Text A will be normal
>>  - Text B will be bold
>>  - Text C will be extra-bold
>>  - Text D will be bold
>>
>> If you have only two weights in your font (normal, bold) then
>>  - Text A will be normal
>>  - Text B will be bold
>>  - Text C will be bold
>>
>> What should Text D be? Bold or normal?

Well, if someone is using "bolder" n times in a row, they probably
assume that there are at least n fonts bolder than the default one.
So the intended effect is almost certainly the first case: normal,
bold, extra-bold, bold.  Otherwise, why would you have the second
"bolder"?  So the ideal behavior is clear.

The problem is: what's the closest we can get to this ideal?  One
angle would be to say that the closest you could get is normal, bold,
bold, bold.  This is an obvious route.  The problem is, then you're
effectively ignoring two distinctions you were asked to make: two of
the rules are no-ops.  If you make it normal, bold, bold, normal, then
only one of the rules is a no-op, which is in a way closer.  To take
this line of thought to an extreme, an even closer representation
would be (assuming a "light" font exists) light, normal, bold, normal,
which preserves all rules -- just shifted down.  (But that's not
really practical.)

The question is one of intent, I think.  What are some cases where
this actually comes up?  What sorts of semantics would most often
dictate the use of nested bolder/lighter?  I can't come up with an
example that's not pretty contrived.

Reply | Threaded
Open this post in threaded view
|

RE: [css3-fonts] Nested 'bolder' and 'lighter' question

Molly E. Holzschlag

> The question is one of intent, I think.  What are some cases where
> this actually comes up?  What sorts of semantics would most often
> dictate the use of nested bolder/lighter?  I can't come up with an
> example that's not pretty contrived.

This, too has been bothering me. I've never seen (or imagined) a real-life use for this. This is why I suggested "normal" because nesting spans to achieve a visual result is a no-no in best practices. From a typographic point of view, the only way I could see a scenario like this playing out would be to apply color, not font weight.

Imagine a paragraph that has three different font weights being used. It can easily become unreadable.

FWIW,
M

-=-
Molly E. Holzschlag
Web Standards and Practices Education and Outreach
Molly.Com, Inc.

http://molly.com/


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Simetrical
> Sent: Wednesday, August 27, 2008 2:17 PM
> To: fantasai
> Cc: [hidden email]
> Subject: Re: [css3-fonts] Nested 'bolder' and 'lighter' question
>
>
> On Wed, Aug 27, 2008 at 2:23 PM, fantasai
> <[hidden email]> wrote:
> > fantasai wrote:
> >>
> >> Given
> >>
> >>  <a>
> >>    Text A
> >>    <b style="font-weight: bolder">
> >>      Text B
> >>      <c style="font-weight: bolder">
> >>        Text C
> >>        <d style="font-weight: lighter">
> >>          Text D
> >>        </d>
> >>      </c>
> >>    </b>
> >>  </a>
> >>
> >> If you have three different weights in your font (normal, bold,
> >> extra-bold) then
> >>  - Text A will be normal
> >>  - Text B will be bold
> >>  - Text C will be extra-bold
> >>  - Text D will be bold
> >>
> >> If you have only two weights in your font (normal, bold) then
> >>  - Text A will be normal
> >>  - Text B will be bold
> >>  - Text C will be bold
> >>
> >> What should Text D be? Bold or normal?
>
> Well, if someone is using "bolder" n times in a row, they probably
> assume that there are at least n fonts bolder than the default one.
> So the intended effect is almost certainly the first case: normal,
> bold, extra-bold, bold.  Otherwise, why would you have the second
> "bolder"?  So the ideal behavior is clear.
>
> The problem is: what's the closest we can get to this ideal?  One
> angle would be to say that the closest you could get is normal, bold,
> bold, bold.  This is an obvious route.  The problem is, then you're
> effectively ignoring two distinctions you were asked to make: two of
> the rules are no-ops.  If you make it normal, bold, bold, normal, then
> only one of the rules is a no-op, which is in a way closer.  To take
> this line of thought to an extreme, an even closer representation
> would be (assuming a "light" font exists) light, normal, bold, normal,
> which preserves all rules -- just shifted down.  (But that's not
> really practical.)
>



Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

Zack Weinberg-6
In reply to this post by fantasai

fantasai <[hidden email]> wrote:

> Zack Weinberg wrote:
> >  - Actual font weights are assigned to font-weight numbers by
> >    packing them as closely as possible around normal/400.  Thus, if
> >    your font has two weights (normal and bold) normal is used for
> >    100-400 and bold is used for 500-900; if it has three weights
> >    (normal, bold, extra-bold), normal is 100-400, bold is 500,
> >    extra-bold is 600+; and if it has three weights (light, normal,
> >    bold), they would take 100-300, 400, 500-900 respectively.
> >
> >  - It may be appropriate to also change font-weight:bold to be
> >    equivalent to font-weight:500.  I'm not sure whether there
> >    are fonts out there with weights intermediate between what we
> >    usually call "normal" and "bold".
>
> Have you looked at what's spec'd currently? Because it's more
> sophisticated than mapping directly to numbers. It's just undefined
> for the nested 'bolder'/'lighter' case.

Yeah, I have; I'm just not convinced it's better than the "pack them as
closely as possible around 400" rule.  The present wording is trying to
fit all of these constraints simultaneously:

1. The "normal" and "bold" keywords map to fixed numeric weights.

2. Those fixed numeric weights correspond to the underlying font weights
   intended as the default and the simple boldface, respectively.
   (This requires that those numbers are more than 100 apart, because
   some fonts have intermediate weights.)

3. The "lighter" and "bolder" keywords, except possibly when "lighter"
   is nested inside "bolder" or vice versa (that being the undefined
   case you originally brought up), will always change the visible
   weight when there is another underlying font weight available in
   that direction.

4. The "lighter" and "bolder" keywords make a simple arithmetic change
   to the inherited numeric weight.  (This isn't overtly in the wording
   but my web designer friend took it as a presupposition; from my
   implementor's perspective, anything else would be substantially more
   difficult, q.v. Moz bug 93725.)

I think one of these will have to give in order to achieve defined
behavior in all cases; I think #3 is the most important rule from the
designer's perspective, and #4 from the implementor's; thus my
proposal, which abandons #2 in some cases (when a font has weights
bolder than "bold" but not intermediate between "normal" and "bold").
Unfortunately, I'd guess that this is a common case, and this is why I
suggested changing "bold" to map to 500 instead of 700 - which would
break normal/semibold/bold, but we can't have it both ways...

zw

Reply | Threaded
Open this post in threaded view
|

RE: [css3-fonts] Nested 'bolder' and 'lighter' question

Sylvain Galineau
In reply to this post by Simetrical-3
> The question is one of intent, I think.  What are some cases where
> this actually comes up?  What sorts of semantics would most often
> dictate the use of nested bolder/lighter?  I can't come up with an
> example that's not pretty contrived.

It is contrived. Not only are the relative weights nested but the font has only two weights. So whichever value we will specify to be 'right' may match the author's intent only half the time...

However unlikely in the real world, I believe the original question may have had two parts : what would you expect, and what does the spec say ? Given the rules it defines to assign numeric font weights and how bolder/lighter affect the property's value, I think it says D would be bold.

Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

Nicholas Shanks
In reply to this post by fantasai
On 27 Aug 2008, at 8:23 pm, fantasai wrote:

> fantasai wrote:
>
>> What should Text D be? Bold or normal?
>
> I would say bold, if I were being so bold. -- Andy Clarke
>
> I say it goes to normal. -- Molly Holzschlag


I vote with Molly.

Use case:

Text spans A, B, and C are all written by different authors (e.g. some  
kind of aggregated content), who happen to be called A, B and C. Text  
D is written by Author C

B doesn't know A has made the container of his text bolder, and
C doesn't know B has made the container of her text bolder

Author C expects her content to be in a normal weight, and applies  
‘lighter’ to some portion of that. Author C wants span containing text  
D to look different from the surrounding text. So it should go from  
Bold to Normal, regardless of the failure earlier of Author B to force  
C's text to be emboldened.


In my belief this corresponds to the ascending and descending of  
ordered lists as defined in CSS2.1

— Nicholas Shanks.


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Fwd: [css3-fonts] Nested 'bolder' and 'lighter' question

Tab Atkins Jr.
In reply to this post by fantasai
Posted to list, rather than assuming that only fantasai would care about my opinions.  ^_^

---------- Forwarded message ----------
From: Tab Atkins Jr. <[hidden email]>
Date: Wed, Aug 27, 2008 at 1:48 PM
Subject: Re: [css3-fonts] Nested 'bolder' and 'lighter' question
To: fantasai <[hidden email]>


On Wed, Aug 27, 2008 at 1:23 PM, fantasai <[hidden email]> wrote:

The spec isn't clear on what exactly happens here, so the CSSWG
decided to ask web designers what they expect. So far I have two
responses and they don't match. Anyone else have an opinion? :)

fantasai wrote:
Given

 <a>
   Text A
   <b style="font-weight: bolder">
     Text B
     <c style="font-weight: bolder">
       Text C
       <d style="font-weight: lighter">
         Text D
       </d>
     </c>
   </b>
 </a>

If you have three different weights in your font (normal, bold,
extra-bold) then
 - Text A will be normal
 - Text B will be bold
 - Text C will be extra-bold
 - Text D will be bold

If you have only two weights in your font (normal, bold) then
 - Text A will be normal
 - Text B will be bold
 - Text C will be bold

What should Text D be? Bold or normal?

I would say bold, if I were being so bold. -- Andy Clarke

I say it goes to normal. -- Molly Holzschlag

~fantasai

Keep it bold.  I recognize and appreciate the arguments for making D go to normal (when you specify a bolder/lighter, you want a noticeable difference if possible), but must bow to the fact that I really, *really* want my bolder/lighter commands to balance appropriately, regardless of the font being used.  Letting D go to normal would mean that in any nontrivial set of nested bolder/lighter commands, I have *no* way of knowing what level I'm actually at (since I don't have final control over what font the user is viewing my page with), which could result in some really weird-looking text and possibly screw up the expressed semantics of my text something fierce.  The possibility of losing some meaning expressed by the extra-bolding in font that don't support the extra-bold face is easier to live with.

~TJ

Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

Tab Atkins Jr.
In reply to this post by Simetrical-3
On Wed, Aug 27, 2008 at 4:17 PM, Simetrical <[hidden email]> wrote:

On Wed, Aug 27, 2008 at 2:23 PM, fantasai <[hidden email]> wrote:
> fantasai wrote:
>>
>> Given
>>
>>  <a>
>>    Text A
>>    <b style="font-weight: bolder">
>>      Text B
>>      <c style="font-weight: bolder">
>>        Text C
>>        <d style="font-weight: lighter">
>>          Text D
>>        </d>
>>      </c>
>>    </b>
>>  </a>
>>
>> If you have three different weights in your font (normal, bold,
>> extra-bold) then
>>  - Text A will be normal
>>  - Text B will be bold
>>  - Text C will be extra-bold
>>  - Text D will be bold
>>
>> If you have only two weights in your font (normal, bold) then
>>  - Text A will be normal
>>  - Text B will be bold
>>  - Text C will be bold
>>
>> What should Text D be? Bold or normal?

Well, if someone is using "bolder" n times in a row, they probably
assume that there are at least n fonts bolder than the default one.
So the intended effect is almost certainly the first case: normal,
bold, extra-bold, bold.  Otherwise, why would you have the second
"bolder"?  So the ideal behavior is clear.

The problem is: what's the closest we can get to this ideal?  One
angle would be to say that the closest you could get is normal, bold,
bold, bold.  This is an obvious route.  The problem is, then you're
effectively ignoring two distinctions you were asked to make: two of
the rules are no-ops.  If you make it normal, bold, bold, normal, then
only one of the rules is a no-op, which is in a way closer.  To take
this line of thought to an extreme, an even closer representation
would be (assuming a "light" font exists) light, normal, bold, normal,
which preserves all rules -- just shifted down.  (But that's not
really practical.)

You're looking specifically at weight changes, and measuring the number of defects where a weight change is expected to occur and does not.  I don't believe this is a useful metric, though.  Consider this markup:

<a>
  Text A
  <b style="font-weight: bolder;">
    Text B
    <c style="font-weight: bolder;">
      Text C
    </c>
    Text D
  </b>
</a>

In an ideal world, Text C would be extra-bold.  If your font does not have an extra-bold weight, though, C will be merely bold.  This is completely uncontroversial, and clear from both spec and common sense.  However, according to your metric this example has two defects as well, as Text C should be darker than Text B (it isn't) and Text D should be lighter than Text C (it isn't).  Would your conclusion, then, be to lighten Text D?

I feel a more reasonable metric is to measure the weight *value* defects, rather than the weight *change* defects.  This would give my provided code a single defect, which seems reasonable.  Looking at the OP's code, making Text D bold would give it a single defect, while making it normal would give it two defects.

The question is one of intent, I think.  What are some cases where
this actually comes up?  What sorts of semantics would most often
dictate the use of nested bolder/lighter?  I can't come up with an
example that's not pretty contrived.

Simple real-world example - nested <strong> tags, for extra-special importance.

~TJ
Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

John Daggett
In reply to this post by fantasai


I think a simple addition makes the original example a little more interesting, add "Text E" after the <c> element.  Now you have:

  <a>
    Text A
    <b style="font-weight: bolder">
    Text B
    <c style="font-weight: bolder">
      Text C
      <d style="font-weight: lighter">
        Text D
      </d>
    </c>
    Text E
    </b>
  </a>

With a font with just two weights, Text E will be bold in all scenarios.  If Text D is normal, then Text E will be lighter than text next to it in an element that should be bolder.

I don't think there's really a better answer here, either way there's a visual compromise.  In this situation I think it's best to keep the solution as simple as possible, so that authors can understand the behavior and implementors don't need to construct tricky code simply to handle edge cases like this.

Regards,

John

Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

Simetrical-3
In reply to this post by Tab Atkins Jr.

On Wed, Aug 27, 2008 at 7:10 PM, Tab Atkins Jr. <[hidden email]> wrote:

> You're looking specifically at weight changes, and measuring the number of
> defects where a weight change is expected to occur and does not.  I don't
> believe this is a useful metric, though.  Consider this markup:
>
> <a>
>   Text A
>   <b style="font-weight: bolder;">
>     Text B
>     <c style="font-weight: bolder;">
>       Text C
>     </c>
>     Text D
>   </b>
> </a>
>
> In an ideal world, Text C would be extra-bold.  If your font does not have
> an extra-bold weight, though, C will be merely bold.  This is completely
> uncontroversial, and clear from both spec and common sense.  However,
> according to your metric this example has two defects as well, as Text C
> should be darker than Text B (it isn't) and Text D should be lighter than
> Text C (it isn't).  Would your conclusion, then, be to lighten Text D?

A reasonable counterpoint.

> Simple real-world example - nested <strong> tags, for extra-special
> importance.

Yes, but when would you nest two <strong> tags in each other and
*then* have a font-weight: lighter inside?  What would be a snippet of
HTML that does that and isn't obviously contrived?

Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

Innovimax SARL
In reply to this post by fantasai

My interpretation would be :

* bolder : if there is a possibility to make the text bolder, please do
* lighter : if there is a possibility to make the text lighter, please do

In this case, text D should be "normal"

My two cents

Mohamed

On Wed, Aug 27, 2008 at 8:22 PM, fantasai <[hidden email]> wrote:

>
> The spec isn't clear on what exactly happens here, so the CSSWG
> decided to ask web designers what they expect. So far I have two
> responses and they don't match. Anyone else have an opinion? :)
>
> fantasai wrote:
>>
>> Given
>>
>>  <a>
>>    Text A
>>    <b style="font-weight: bolder">
>>      Text B
>>      <c style="font-weight: bolder">
>>        Text C
>>        <d style="font-weight: lighter">
>>          Text D
>>        </d>
>>      </c>
>>    </b>
>>  </a>
>>
>> If you have three different weights in your font (normal, bold,
>> extra-bold) then
>>  - Text A will be normal
>>  - Text B will be bold
>>  - Text C will be extra-bold
>>  - Text D will be bold
>>
>> If you have only two weights in your font (normal, bold) then
>>  - Text A will be normal
>>  - Text B will be bold
>>  - Text C will be bold
>>
>> What should Text D be? Bold or normal?
>
> I would say bold, if I were being so bold. -- Andy Clarke
>
> I say it goes to normal. -- Molly Holzschlag
>
> ~fantasai
>
>
>



--
Innovimax SARL
Consulting, Training & XML Development
9, impasse des Orteaux
75020 Paris
Tel : +33 9 52 475787
Fax : +33 1 4356 1746
http://www.innovimax.fr
RCS Paris 488.018.631
SARL au capital de 10.000 €

Reply | Threaded
Open this post in threaded view
|

Re: [css3-fonts] Nested 'bolder' and 'lighter' question

Daniel Glazman
In reply to this post by John Daggett

John Daggett wrote:

> I don't think there's really a better answer here, either way
> there's a visual compromise.  In this situation I think it's
> best to keep the solution as simple as possible, so that
> authors can understand the behavior and implementors don't
> need to construct tricky code simply to handle edge cases
> like this.

I agree.

I think the original intent of the CSS WG and browser implementors
is not understandable from a web author's point of view. CSS uses
english keywords like "bolder" and "lighter" to make the language
simple, easy to learn and use. If the user (hear web author) has to
learn a complex algo related to font matching, its browser, plaftorm,
OS, and so on to be able to figure out what means "bolder", we'd better
drop entirely that value, IMHO...

Let me take another example:

<span style="font-weight: lighter;">
   <span style="font-weight: bolder;">
     <span style="font-weight: bolder;">
       AAAA
       BBBB
     </span>
   </span>
</span>

where A is a unicode char rendered using a font that has bold and
extra-bold while B is a unicode chat rendered using a font that has
only bold... What's the weight of As and the weight of Bs ?


</Daniel>

123