コード例 #1
0
        public static SKSize MeasureText(string text, ControlStyle style)
        {
            var bounds = SKRect.Empty;

            using var paint = new SKPaint { Typeface = style.GetFont(), TextSize = style.GetFontSize() };

            paint.MeasureText(text, ref bounds);
            return(bounds.Size);
        }
コード例 #2
0
ファイル: ControlStyle.cs プロジェクト: xush1611/Modern.Forms
 /// <summary>
 /// Gets the computed font size.
 /// </summary>
 public int GetFontSize() => FontSize ?? _parent?.GetFontSize() ?? Theme.FontSize;
コード例 #3
0
 public int GetFontSize() => FontSize ?? _parent.GetFontSize();