예제 #1
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;
 }
예제 #2
0
 public void SetFont(Font f)
 {
     _fontSize = f.Size;
 }
예제 #3
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);
            }
        }
예제 #4
0
 public void SetFont(Font font)
 {
     _font = font;
 }
예제 #5
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;
 }
예제 #6
0
 public AndroidGraphics(Canvas canvas)
 {
     _c = canvas;
     _font = null;
     SetColor (Colors.Black);
 }
예제 #7
0
 public void SetFont(Font f)
 {
 }