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); }
/// <summary> /// Gets the computed font. /// </summary> public SKTypeface GetFont() => Font ?? _parent?.GetFont() ?? Theme.UIFont;
public SKTypeface GetFont() => Font ?? _parent.GetFont();