getTextSizeFromFont method
Measure the text with the input font and returns the size.
Implementation
SizeF getTextSizeFromFont(String text, Font font) {
SizeF size = SizeF.empty;
switch (font.name.toLowerCase()) {
case 'arial':
size = _getArialTextSize(text, font);
break;
case 'times new roman':
size = _getTimesNewRomanTextSize(text, font);
break;
case 'courier new':
size = _getCourierTextSize(text, font);
break;
case 'tahoma':
size = _getTahomaTextSize(text, font);
break;
case 'verdana':
size = _getVerdanaTextSize(text, font);
break;
case 'calibri':
default:
size = _getCalibriTextSize(text, font);
break;
}
return size;
}