Well, after further research and experimentation there's definitely a bug in the ComponentOne library. Specifically, the overload I happened to have used here returned the wrong hight. If you specific an available width explicitly, you get the correct height. Specifically, this code generates the correct data:
var resultHeight = _doc.MeasureString(text, pdfFont, double.MaxValue).Height;
var resultWidth = _doc.MeasureString(text, pdfFont).Width;
return new Tuple<double,double>(resultHeight, resultWidth);
Note the addition of the third parameter for the height only -- double.MaxValue
. The width is correctly calculated in both cases, but the height is only correctly calculated if you provide that double
parameter. I chose double.MaxValue
in this case simply because I don't know how wide the string is going to turn out to be so I don't want to risk being given a multi-line height.