# Thread: some math

1. ## some math

Hi guys,

I need you to do me a math, I think it's easy and tricky at the same time.

I have a pair value of font size and line height, 13px-20px, where 13px is font size and 20px is line height.

Condition, if font-size increases by 1, line-height will increase by 2. So 14px font-size will result 22px line height.

Now, if given a font-size value, can you figure out the line height?

2. is 13 the base font size ALWAYS?

3. If the font is 13px, the line height must be 20px.
If the font is 14px, the line height must be 22px.
If the font is 15px, the line height must be 24px.

So I give you font of 200px can you get the line height?

4. ok i haven't done this in years, this sounds like homework... I almost have it

5. Try doubling the font size and subtracting 6. This works with the three examples you showed.

6. Originally Posted by WebMachine
Try doubling the font size and subtracting 6. This works with the three examples you showed.
It always works.

The lineheight starts at 20, and for every fontsize > 13, 2 will be added, so we get:

lineheight = 20 + (fontsize-13) * 2

which is equivalent to:

lineheight = 20 + 2*fontsize - 26

and that is equal to:

lineheight = 2*fontsize - 6

7. Congrat Webmachine and ScallioXTX, with very concise explanation. Thanks Guys!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•