Beispiel #1
0
        public static FormattedTextImpl Create(string text, string fontFamilyName, double fontSize, FontStyle fontStyle,
                                               TextAlignment textAlignment, FontWeight fontWeight)
        {
            var typeface = TypefaceCache.GetTypeface(fontFamilyName, fontStyle, fontWeight);

            FormattedTextImpl instance = new FormattedTextImpl(text);

            instance.Paint.Typeface  = typeface;
            instance.Paint.TextSize  = (float)fontSize;
            instance.Paint.TextAlign = textAlignment.ToSKTextAlign();
            instance.Rebuild();
            return(instance);
        }
 public IFormattedTextImpl CreateFormattedText(string text, string fontFamilyName, double fontSize, FontStyle fontStyle,
                                               TextAlignment textAlignment, FontWeight fontWeight, TextWrapping wrapping)
 {
     return(FormattedTextImpl.Create(text, fontFamilyName, fontSize, fontStyle, textAlignment, fontWeight));
 }