Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
		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;
		}