public void SetFont (Font f) { if (f != _lastFont) { _lastFont = f; SelectFont (); } }
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); }
public void SetFont (Font f) { _fontSize = f.Size; }
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; } }
public static void DrawString(this IGraphics g, string s, PointF p, Font f) { g.SetFont (f); g.DrawString (s, p.X, p.Y); }
public void SetFont (Font f) { }
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; } }
public SvgGraphicsFontMetrics (Font font) { _height = font.Size; }
public void SetFont (Font f) { //_lastFont = f; }
public void SetFont (Font font) { _font = font; }
public AndroidGraphics (Canvas canvas) { _c = canvas; _font = null; SetColor (Colors.Black); }
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; }
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); } }
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; }