Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Applet printing

Reply
Thread Tools

Applet printing

 
 
Ben C
Guest
Posts: n/a
 
      11-03-2007
On 2007-11-03, dorayme <> wrote:
> In article <472b6e1d$0$25482$>,
> JWS <> wrote:
>
>> dorayme wrote:
>>
>> > Also try the other thing I suggested and leave it out
>> > altogether

>>
>> No, I wouldn't do that; it is a taste thing. The 20% 'leading'
>> makes the text (IMHO) more readable than when the lines are just
>> packed together without strips of lead between them. I tried it
>> again just now, and decided I really want the 20% extra space.
>>
>> Do you have an explanation of why 1.2 does not equal 120%?

[...]
> As you might appreciate, a pure number acts as a multiplier of
> the elements font-size. But a percentage is different. I rewrote
> the following to include a spiel on percentages which might
> explain the situation to you a bit. Please forgive me if there
> are any typos or mistakes. Will correct any that are pointed out
> of course:
>
> http://netweaver.com.au/test/lineHeight.html


I think the point is that if you inherit a percentage line-height, you
get that percentage of the font-size of the ancestor that you inherited
line-height from.

This is because you don't inherit it as a percentage, but you inherit
the result of that percentage applied to the ancestor it was set on.

But if you inherit a pure number line height, you inherit it _as a pure
number_, and you get that multiplied by your own font-size.

The spec is rather unclear on this:

<number>

The used value of the property is this number multiplied by the
element's font size. Negative values are illegal. The computed value [p.
88] is the same as the specified value.

<percentage>

The computed value [p. 88] of the property is this percentage
multiplied by the element's computed font size. Negative values are
illegal.

They sound the same, until you consider inheritance: you compute the
computed value before bequeathing a property to your descendents.

So, in your example, #percentage has line-height: 72% and font-size:
50px. Its computed line-height is therefore 36px. So <p class="small">
inherits 36px directly, not 72%.

But if you give #percentage line-height of .72, then <p class="small">
inherits .72 (since for <number>, above, "the computed value is the same
as the specified value"). That's why in that case it gets .72 of its
_own_ font-size.
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      11-03-2007
On Nov 3, 1:08 am, JWS <j...@my.home> wrote:
....
> ...What alternatives
> do you use for putting interactive programs on the Web? ..


Your applet is well suited to being launched using Java
Web Start* (JWS, coincidental with your posting name!).
It would end up as 'free floating', but then, this type of
animation applet hardly needs a browser window wrapped
around it.

If you wanted to take it further, it seems also well suited to
being deployed as a screensaver, I could throw it up on-screen
and watch those harmonic patterns for hours. If interested,
check the SaverBeans** project.

* <http://www.physci.org/jws/#jtest>
** <https://screensavers.dev.java.net/>

Andrew T.

 
Reply With Quote
 
 
 
 
JWS
Guest
Posts: n/a
 
      11-03-2007
dorayme wrote:

> As I said at the time of raising the idea of leaving it out, the
> default for most browsers is about 1.2.


But not for Mozilla products on Linux! I definitely need the line
in the css. That is why I didn't understand, at first, your
suggestion to leave it out. I just rebooted into Windows and
messed with my css, and you are right, 20 % of leading is applied
by IE and Firefox by default (I do not know where exactly this is
set). So I would suggest that for the benefit of the Linux users,
line-height: 1.2 (not 120%) should be put into the css. It does
not harm the Windows and (presumably) Mac users.

Linux users can also set it by default on the user side by editing
userContent.css, but I would guess most users do not even know
that this file exists.

Regards, Jan

 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      11-03-2007
In article <>,
Ben C <> wrote:

> On 2007-11-03, dorayme
> >
> > http://netweaver.com.au/test/lineHeight.html

>
> I think the point is that if you inherit a percentage line-height, you
> get that percentage of the font-size of the ancestor that you inherited
> line-height from.
>
> This is because you don't inherit it as a percentage, but you inherit
> the result of that percentage applied to the ancestor it was set on.
>


Certainly right. I chose the absurdly big 'ancestral' 50px to
help see a case of this.

> The spec is rather unclear on this:


I agree. As so often, One stares at the specs, forms about 4
alternative pics in the brain as to what the meaning or
implications really are, shrugs, makes some test cases and the
pennies start to drop - with any luck. Then one goes back to the
specs and they look a bit clearer. <g>

--
dorayme
 
Reply With Quote
 
Ben C
Guest
Posts: n/a
 
      11-03-2007
On 2007-11-03, dorayme <> wrote:
> In article <>,
> Ben C <> wrote:
>
>> On 2007-11-03, dorayme
>> >
>> > http://netweaver.com.au/test/lineHeight.html

>>
>> I think the point is that if you inherit a percentage line-height, you
>> get that percentage of the font-size of the ancestor that you inherited
>> line-height from.
>>
>> This is because you don't inherit it as a percentage, but you inherit
>> the result of that percentage applied to the ancestor it was set on.
>>

>
> Certainly right. I chose the absurdly big 'ancestral' 50px to
> help see a case of this.
>
>> The spec is rather unclear on this:

>
> I agree. As so often, One stares at the specs, forms about 4
> alternative pics in the brain as to what the meaning or
> implications really are, shrugs, makes some test cases and the
> pennies start to drop - with any luck. Then one goes back to the
> specs and they look a bit clearer. <g>


Indeed, I only figured out what the spec was talking about after looking
at your example.

But if you read the bit about "cascading" it does explain (more or less)
that it's computed values that are inherited. That suddenly makes the
line-height section make more sense.
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      11-03-2007
In article <>,
Ben C <> wrote:

> On 2007-11-03, dorayme <> wrote:
> > In article <>,
> > Ben C <> wrote:
> >
> >> On 2007-11-03, dorayme
> >> >
> >> > http://netweaver.com.au/test/lineHeight.html
> >>


> >> The spec is rather unclear on this:

> >
> > I agree. As so often, One stares at the specs, forms about 4
> > alternative pics in the brain as to what the meaning or
> > implications really are, shrugs, makes some test cases and the
> > pennies start to drop - with any luck. Then one goes back to the
> > specs and they look a bit clearer. <g>

>
> Indeed, I only figured out what the spec was talking about after looking
> at your example.
>
> But if you read the bit about "cascading" it does explain (more or less)
> that it's computed values that are inherited. That suddenly makes the
> line-height section make more sense.


Yes, it does. All a matter of it registering, be nice if it was
at the time one consults the specs. I have always been impressed
by how some people here (including you of course) seem able to
read the specs with as much clarity as you do. I tend to have to
do it with more hindsight. I recall Jukka Korpela pointing out
about the trap of units for line-height in an exchange with me
ages ago and it was a salutary lesson.

--
dorayme
 
Reply With Quote
 
Ben C
Guest
Posts: n/a
 
      11-03-2007
On 2007-11-03, dorayme <> wrote:
> In article <>,
> Ben C <> wrote:
>
>> On 2007-11-03, dorayme <> wrote:

[...]
>> > I agree. As so often, One stares at the specs, forms about 4
>> > alternative pics in the brain as to what the meaning or
>> > implications really are, shrugs, makes some test cases and the
>> > pennies start to drop - with any luck. Then one goes back to the
>> > specs and they look a bit clearer. <g>

>>
>> Indeed, I only figured out what the spec was talking about after looking
>> at your example.
>>
>> But if you read the bit about "cascading" it does explain (more or less)
>> that it's computed values that are inherited. That suddenly makes the
>> line-height section make more sense.

>
> Yes, it does. All a matter of it registering, be nice if it was at the
> time one consults the specs. I have always been impressed by how some
> people here (including you of course) seem able to read the specs with
> as much clarity as you do. I tend to have to do it with more
> hindsight.


It's all hindsight on my part too, but you do reach a point (after a lot
of trying things out) where the penny drops and you can tell what most
of it is talking about.

But then it still isn't so easy to explain it because you find yourself
starting to use the same incomprehensible jargon yourself.

> I recall Jukka Korpela pointing out about the trap of units for
> line-height in an exchange with me ages ago and it was a salutary
> lesson.


As far as I can see one almost always would want to use 1.2 rather than
120%. That's the simple lesson to take away here.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 2 11-27-2010 12:12 PM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:52 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:50 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:28 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-18-2007 10:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57