MonoTouch.Dialog.JsonElement.ToFont C# (CSharp) Method

ToFont() static private method

static private ToFont ( string kvalue ) : UIKit.UIFont
kvalue string
return UIKit.UIFont
		static UIFont ToFont (string kvalue)
		{
			int q = kvalue.LastIndexOf ("-");
			string fname = kvalue;
			float fsize = 0;

			if (q != -1) {
				float.TryParse (kvalue.Substring (q+1), out fsize);
				fname = kvalue.Substring (0, q);
			}
			if (fsize <= 0)
				fsize = UIFont.SystemFontSize;

			var f = UIFont.FromName (fname, fsize);
			if (f == null)
				return UIFont.SystemFontOfSize (12);
			return f;
		}