the problem is as follows
i have a variable amount of data that needs to be displayed in a fixed amount of space
i know the argument style="font-size:13px;line-height:113%;" in an html output will adjust the size of the font and the line spacing and that the numbers can be replaced with variables by doing
style="font-size:".$fontsize".px;line-height:".$line_height."%;"
and i can also use an incremented variable to count the number of lines output
and i can run the function multiple times with different paramaters and return ouptut based on parameters fed to the function such as
Code:
function($mode) {
/*code goes here*/
$output['html']=$html_output;
$output['font_size']=$font_size;
$output['line_height]=$line_height;
return $output[$mode];
}
then call the function with
Code:
$html=function('html');
$fontsize=function('font_size);
$line_height=function('line_height');
to get the desired output
(or just place them inline with the html code as if they were variables)
the question is how would i calculate the values of $font_size and $line_height based on the counted number of lines and the number of pixels i have available for output?
in short, i need a forumla for doing such