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; }
public void SetFont(Font f) { _fontSize = f.Size; }
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); } }
public void SetFont(Font font) { _font = font; }
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; }
public AndroidGraphics(Canvas canvas) { _c = canvas; _font = null; SetColor (Colors.Black); }
public void SetFont(Font f) { }