public IFontMetrics GetFontMetrics() { var f = _lastFont; if (f == null) { throw new InvalidOperationException("Cannot call GetFontMetrics before calling SetFont."); } var fm = f.Tag as CoreGraphicsFontMetrics; if (fm == null) { fm = new CoreGraphicsFontMetrics(_attrs); f.Tag = fm; } return(fm); }
public IFontMetrics GetFontMetrics() { var f = _lastFont; if (f == null) throw new InvalidOperationException ("Cannot call GetFontMetrics before calling SetFont."); var fm = f.Tag as CoreGraphicsFontMetrics; if (fm == null) { fm = new CoreGraphicsFontMetrics (); f.Tag = fm; } if (fm.Widths == null) { fm.MeasureText (_c, _lastFont); } return fm; }