Helpers for truncating text based on number of lines to display?

I have a number of situations where I have a list of items to show
where each item listed will show some details (e.g. title) and a
summary block of text. The user can click to view the item by itself
for more details, full text, and editing.

Up til now I’ve been using truncate() to clip the text for summary to
some char count and guessing what will result in my desired 2 or 3
lines of summary text. But this isn’t really very good because I can
never be assured of the number of lines that will result due to where
the lines break on the text and differences in rendered text size in
diff browsers.

Are there helpers or code snippets that address this situation?
Something in rails? Something in javascript?