static SKFontStyle() { normal = new SKFontStyleStatic(SKFontStyleWeight.Normal, SKFontStyleWidth.Normal, SKFontStyleSlant.Upright); bold = new SKFontStyleStatic(SKFontStyleWeight.Bold, SKFontStyleWidth.Normal, SKFontStyleSlant.Upright); italic = new SKFontStyleStatic(SKFontStyleWeight.Normal, SKFontStyleWidth.Normal, SKFontStyleSlant.Italic); boldItalic = new SKFontStyleStatic(SKFontStyleWeight.Bold, SKFontStyleWidth.Normal, SKFontStyleSlant.Italic); }
public void GetStyle(int index, out SKFontStyle fontStyle, out string styleName) { fontStyle = new SKFontStyle(); using (var str = new SKString()) { SkiaApi.sk_fontstyleset_get_style(Handle, index, fontStyle.Handle, str.Handle); styleName = (string)str; } }
public SKTypeface MatchFamily(string familyName, SKFontStyle style) { if (style == null) { throw new ArgumentNullException(nameof(style)); } return(GetObject <SKTypeface> (SkiaApi.sk_fontmgr_match_family_style(Handle, familyName, style.Handle))); }
public static SKTypeface FromFamilyName(string familyName, SKFontStyle style) { if (style == null) { throw new ArgumentNullException(nameof(style)); } return(GetObject <SKTypeface> (SkiaApi.sk_typeface_create_from_name_with_font_style(familyName, style.Handle))); }
public SKTypeface CreateTypeface(SKFontStyle style) { if (style == null) { throw new ArgumentNullException(nameof(style)); } return(GetObject <SKTypeface> (SkiaApi.sk_fontstyleset_match_style(Handle, style.Handle))); }
public SKTypeface MatchFamily(string familyName, SKFontStyle style) { if (style == null) { throw new ArgumentNullException(nameof(style)); } var tf = SKTypeface.GetObject(SkiaApi.sk_fontmgr_match_family_style(Handle, familyName, style.Handle)); tf?.PreventPublicDisposal(); return(tf); }
public static SKTypeface FromFamilyName(string familyName, SKFontStyle style) { if (style == null) { throw new ArgumentNullException(nameof(style)); } var tf = GetObject(SkiaApi.sk_typeface_create_from_name(familyName, style.Handle)); tf?.PreventPublicDisposal(); return(tf); }
public SKTypeface MatchCharacter(string familyName, SKFontStyle style, string[] bcp47, int character) { if (style == null) { throw new ArgumentNullException(nameof(style)); } // TODO: work around for https://bugs.chromium.org/p/skia/issues/detail?id=6196 if (familyName == null) { familyName = string.Empty; } return(GetObject <SKTypeface> (SkiaApi.sk_fontmgr_match_family_style_character(Handle, familyName, style.Handle, bcp47, bcp47?.Length ?? 0, character))); }