FormattedText
[MSDN: 1 2]。 private double GetBaselineOffset(double size, FontFamily family = null, FontWeight? weight = null, FontStyle? style = null, FontStretch? stretch = null)
{
var temp = new TextBlock();
temp.FontSize = size;
temp.FontFamily = family ?? temp.FontFamily;
temp.FontStretch = stretch ?? temp.FontStretch;
temp.FontStyle = style ?? temp.FontStyle;
temp.FontWeight = weight ?? temp.FontWeight;
var _size = new Size(10000, 10000);
var location = new Point(0, 0);
temp.Measure(_size);
temp.Arrange(new Rect(location, _size));
return temp.BaselineOffset;
}