Beispiel #1
0
 public float GetEmHeight(FontStyle style)
 {
     using (var paint = new SKPaint())
     {
         paint.Typeface = SKTypeface.FromTypeface(_typeface, style.ToSKTypefaceStyle());
         return(paint.FontMetrics.Top);
     }
 }
Beispiel #2
0
        //Note: BB Added
        public Font(FontFamily fontFamily, float size, FontStyle fontStyle, GraphicsUnit graphicsUnit)
        {
            _fontFamily     = fontFamily;
            _paint          = new SKPaint();
            _paint.TextSize = size;
            _style          = fontStyle;
            _paint.Typeface = SKTypeface.FromTypeface(_fontFamily.Typeface, fontStyle.ToSKTypefaceStyle());

            //TODO: What to use graphics Unit for?
        }