public void SetFont (Font f)
		{
			if (f != _lastFont) {
				_lastFont = f;
				SelectFont ();
			}
		}
示例#2
0
		public static void DrawString(this IGraphics g, string s, RectangleF p, Font f, LineBreakMode lineBreak, TextAlignment align)
		{
			g.SetFont (f);
			g.DrawString (s, p.Left, p.Top, p.Width, p.Height, lineBreak, align);
		}
示例#3
0
		public void SetFont (Font f)
		{
			_fontSize = f.Size;
		}
示例#4
0
		public static Font BoldUserFixedPitchFontOfSize (int size) {
			if (size >= _boldUserFixedPitchFonts.Length) {
				return new Font ("Monospace", FontOptions.Bold, size);
			}
			else {
				var f = _boldUserFixedPitchFonts[size];
				if (f == null) {
					f = new Font ("Monospace", FontOptions.Bold, size);
					_boldUserFixedPitchFonts[size] = f;
				}
				return f;
			}
		}
示例#5
0
		public static void DrawString(this IGraphics g, string s, PointF p, Font f)
		{
			g.SetFont (f);
			g.DrawString (s, p.X, p.Y);
		}
示例#6
0
		public void SetFont (Font f)
		{
		}
示例#7
0
		public static Font SystemFontOfSize (int size) {
			if (size >= _systemFonts.Length) {
				return new Font ("SystemFont", FontOptions.None, size);
			}
			else {
				var f = _systemFonts[size];
				if (f == null) {
					f = new Font ("SystemFont", FontOptions.None, size);
					_systemFonts[size] = f;
				}
				return f;
			}
		}
示例#8
0
		public SvgGraphicsFontMetrics (Font font)
		{
			_height = font.Size;
		}
示例#9
0
		public void SetFont (Font f)
		{
			//_lastFont = f;
		}
示例#10
0
		public void SetFont (Font font)
		{
			_font = font;
		}
示例#11
0
		public AndroidGraphics (Canvas canvas)
		{
			_c = canvas;
			_font = null;
			SetColor (Colors.Black);
		}
示例#12
0
		public static IFontMetrics GetFontMetrics (Font font)
		{
			var fi = GetFontInfo (font);
			if (fi.FontMetrics == null) {
				var paint = new Paint ();
				ApplyFontToPaint (font, paint); // This ensures font metrics
			}
			return fi.FontMetrics;
		}
示例#13
0
		static void ApplyFontToPaint (Font f, Paint p)
		{
			var fi = GetFontInfo (f);

			p.SetTypeface (fi.Typeface);
			p.TextSize = f.Size;

			if (fi.FontMetrics == null) {
				fi.FontMetrics = new AndroidFontMetrics (p);
			}
		}
示例#14
0
		static AndroidFontInfo GetFontInfo (Font f)
		{
			var fi = f.Tag as AndroidFontInfo;
			if (fi == null) {
				var tf = f.IsBold ? Typeface.DefaultBold : Typeface.Default;
				fi = new AndroidFontInfo {
					Typeface = tf,
				};
				f.Tag = fi;
			}
			return fi;
		}