runrunforest — 2010-09-28T13:39:50-04:00 — #1
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?
scallioxtx — 2010-09-28T18:05:42-04:00 — #2
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
runrunforest — 2010-09-29T00:24:18-04:00 — #3
Congrat Webmachine and ScallioXTX, with very concise explanation. Thanks Guys!
runrunforest — 2010-09-28T13:57:20-04:00 — #4
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?
webmachine — 2010-09-28T17:51:43-04:00 — #5
Try doubling the font size and subtracting 6. This works with the three examples you showed.
rguy84 — 2010-09-28T13:52:19-04:00 — #6
is 13 the base font size ALWAYS?
rguy84 — 2010-09-28T14:13:47-04:00 — #7
ok i haven't done this in years, this sounds like homework... I almost have it