HighDots Forums  

Setting exact space below baseline

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Setting exact space below baseline in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jacob Weber
 
Posts: n/a

Default Setting exact space below baseline - 07-02-2004 , 10:01 AM







Hello. Is it possible to specify the exact space between two lines,
measured from the baseline of the top line to the ascenders of the
second line?

I tried adding the space with padding-bottom, but it adds it below the
descenders. So the actual space between lines is larger than I specified.

Jacob

Reply With Quote
  #2  
Old   
Jacob Weber
 
Posts: n/a

Default Re: Setting exact space below baseline - 07-02-2004 , 01:02 PM






In article <jacob-45C538.10011002072004 (AT) news03 (DOT) east.earthlink.net>,
Jacob Weber <jacob (AT) jacobweber (DOT) com> wrote:

Quote:
Hello. Is it possible to specify the exact space between two lines,
measured from the baseline of the top line to the ascenders of the
second line?

I tried adding the space with padding-bottom, but it adds it below the
descenders. So the actual space between lines is larger than I specified.

Jacob

I should add that I could make it work with line-height, but that would
require me to know the font size in advance.

Jacob


Reply With Quote
  #3  
Old   
PeterMcC
 
Posts: n/a

Default Re: Setting exact space below baseline - 07-02-2004 , 01:31 PM



Jacob Weber wrote in
<jacob-B71E4A.13022402072004 (AT) news03 (DOT) east.earthlink.net>

Quote:
In article <jacob-45C538.10011002072004 (AT) news03 (DOT) east.earthlink.net>,
Jacob Weber <jacob (AT) jacobweber (DOT) com> wrote:

Hello. Is it possible to specify the exact space between two lines,
measured from the baseline of the top line to the ascenders of the
second line?

I tried adding the space with padding-bottom, but it adds it below
the descenders. So the actual space between lines is larger than I
specified.

Jacob


I should add that I could make it work with line-height, but that
would require me to know the font size in advance.
At a guess, you're setting the font in px - can you get line-height to work
in the way you want if you set the font/line height in % or em?

--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.



Reply With Quote
  #4  
Old   
Steve Pugh
 
Posts: n/a

Default Re: Setting exact space below baseline - 07-02-2004 , 01:34 PM



Jacob Weber <jacob (AT) jacobweber (DOT) com> wrote:
Quote:
In article <jacob-45C538.10011002072004 (AT) news03 (DOT) east.earthlink.net>,
Jacob Weber <jacob (AT) jacobweber (DOT) com> wrote:

Hello. Is it possible to specify the exact space between two lines,
measured from the baseline of the top line to the ascenders of the
second line?

I tried adding the space with padding-bottom, but it adds it below the
descenders. So the actual space between lines is larger than I specified.

I should add that I could make it work with line-height, but that would
require me to know the font size in advance.
Why?
line-height: 1.2; sets the line-height to be 1.2 times the font-size,
doesn't matter what the font size is.

If this isn't enough then I think you're not giving us all the details
of your particular situation.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>


Reply With Quote
  #5  
Old   
Neal
 
Posts: n/a

Default Re: Setting exact space below baseline - 07-02-2004 , 01:45 PM



On Fri, 2 Jul 2004 18:31:28 +0100, PeterMcC <peter (AT) mccourt (DOT) org.uk> wrote:

Quote:
Jacob Weber wrote in
jacob-B71E4A.13022402072004 (AT) new....earthlink.net

In article <jacob-45C538.10011002072004 (AT) news03 (DOT) east.earthlink.net>,
Jacob Weber <jacob (AT) jacobweber (DOT) com> wrote:

Hello. Is it possible to specify the exact space between two lines,
measured from the baseline of the top line to the ascenders of the
second line?

I tried adding the space with padding-bottom, but it adds it below
the descenders. So the actual space between lines is larger than I
specified.

Jacob


I should add that I could make it work with line-height, but that
would require me to know the font size in advance.

At a guess, you're setting the font in px - can you get line-height to
work
in the way you want if you set the font/line height in % or em?

*sigh* THIS is why we always request a URL to a test case...


Reply With Quote
  #6  
Old   
Jacob Weber
 
Posts: n/a

Default Re: Setting exact space below baseline - 07-02-2004 , 03:10 PM



Quote:
In article <jacob-45C538.10011002072004 (AT) news03 (DOT) east.earthlink.net>,
Jacob Weber <jacob (AT) jacobweber (DOT) com> wrote:

Hello. Is it possible to specify the exact space between two lines,
measured from the baseline of the top line to the ascenders of the
second line?

I tried adding the space with padding-bottom, but it adds it below
the descenders. So the actual space between lines is larger than I
specified.

Jacob


I should add that I could make it work with line-height, but that
would require me to know the font size in advance.

At a guess, you're setting the font in px - can you get line-height to
work
in the way you want if you set the font/line height in % or em?


*sigh* THIS is why we always request a URL to a test case...

Okay, you can stop your sighing.

http://www.jacobweber.com/style_test.html

As you can see, the two lines have a certain amount of space between
them. I'd like to be able to specify that, in pixels.

But my fonts are specified as percentages, so I don't know the exact
pixel size. If I set line-height in pixels, I would have to guess. If I
set line-height in %, I wouldn't be able to set the exact number of
pixels between the lines.

Hope that helps,
Jacob


Reply With Quote
  #7  
Old   
Steve Pugh
 
Posts: n/a

Default Re: Setting exact space below baseline - 07-02-2004 , 03:40 PM



Jacob Weber <jacob (AT) jacobweber (DOT) com> wrote:

Quote:
http://www.jacobweber.com/style_test.html

As you can see, the two lines have a certain amount of space between
them. I'd like to be able to specify that, in pixels.

But my fonts are specified as percentages, so I don't know the exact
pixel size. If I set line-height in pixels, I would have to guess. If I
set line-height in %, I wouldn't be able to set the exact number of
pixels between the lines.
So, for some users the text might be 10px tall and for others it
mightbe 100px tall, but you want the space between the lines of text
to always be, for example, 5px.

Put that way, does it make sense to want such a thing?

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>


Reply With Quote
  #8  
Old   
Jacob Weber
 
Posts: n/a

Default Re: Setting exact space below baseline - 07-02-2004 , 04:31 PM



In article <rcebe0hnucra182chggakniv5f6hqrgffr (AT) 4ax (DOT) com>,
Steve Pugh <steve (AT) pugh (DOT) net> wrote:

Quote:
So, for some users the text might be 10px tall and for others it
mightbe 100px tall, but you want the space between the lines of text
to always be, for example, 5px.

Put that way, does it make sense to want such a thing?
Exactly. I'm implementing a design, and the designers specified the
space between lines in pixels, although the font size itself is
browser-dependent. Is this possible?

Jacob


Reply With Quote
  #9  
Old   
Steve Pugh
 
Posts: n/a

Default Re: Setting exact space below baseline - 07-02-2004 , 04:52 PM



Jacob Weber <jacob (AT) jacobweber (DOT) com> wrote:
Quote:
In article <rcebe0hnucra182chggakniv5f6hqrgffr (AT) 4ax (DOT) com>,
Steve Pugh <steve (AT) pugh (DOT) net> wrote:

So, for some users the text might be 10px tall and for others it
mightbe 100px tall, but you want the space between the lines of text
to always be, for example, 5px.

Put that way, does it make sense to want such a thing?

Exactly.
Does this mean that you agree with me that it doesn't make sense to
want such a thing?

Quote:
I'm implementing a design, and the designers specified the
space between lines in pixels, although the font size itself is
browser-dependent.
Fake it. Specify the line height so that the space is the desired size
at the designer's font-size (which is likely to be the factory
setting). It will then scale accordingly at other font sizes. Best of
both worlds.

Did the designer really specify percentage font sizes and pixel
spacing between lines? Or did you "translate" his font sizes into
percentages?

Quote:
Is this possible?
No.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>


Reply With Quote
  #10  
Old   
Claire Tucker
 
Posts: n/a

Default Re: Setting exact space below baseline - 07-02-2004 , 04:58 PM



On Fri, 02 Jul 2004 20:31:30 GMT, Jacob Weber <jacob (AT) jacobweber (DOT) com>
wrote:

Quote:
In article <rcebe0hnucra182chggakniv5f6hqrgffr (AT) 4ax (DOT) com>,
Steve Pugh <steve (AT) pugh (DOT) net> wrote:

So, for some users the text might be 10px tall and for others it
mightbe 100px tall, but you want the space between the lines of text
to always be, for example, 5px.

Put that way, does it make sense to want such a thing?

Exactly. I'm implementing a design, and the designers specified the
space between lines in pixels, although the font size itself is
browser-dependent. Is this possible?

I think your designers are broken, actually, but assuming you want to
persue this what you really need is a line-spacing property rather
than a line-height.

Unfortunately, line-spacing isn't in CSS Level 2. As far as I recall,
it isn't in CSS Level 3 either, but since it'll be many years before
that's implemented by browsers that's more just a sidenote.

Your only option here is to set your font size in pixels or to give in
and let the line height be dependent on the font-size. I'd pick the
latter, but then I don't tend to allow so-called designers to override
well-considered good practices in web authoring.

Good luck,
-Claire


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.