Table of Contents

Class SkiaLabel

Namespace
DrawnUi.Draw
Assembly
DrawnUi.Maui.dll

A high-performance text rendering control that provides advanced text formatting, layout, and styling capabilities using SkiaSharp for rendering.

[ContentProperty("Spans")]
public class SkiaLabel : SkiaControl, INotifyPropertyChanged, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IVisualElementController, IElementController, IView, ITransform, IElement, IVisualTreeElement, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, IHasAfterEffects, ISkiaControl, IDrawnBase, ICanBeUpdatedWithContext, ICanBeUpdated, ISkiaDisposable, IDisposable, ISkiaGestureListener, IText, ITextStyle
Inheritance
SkiaLabel
Implements
Derived
Inherited Members
Extension Methods

Remarks

SkiaLabel offers rich text formatting with features including:

  • Multi-line text with various alignment options
  • Rich text styling with spans for portions of text
  • Text shadows and gradient effects
  • Font customization including weight, family, and size
  • Emoji rendering support
  • Text transformation and decoration
  • Line height and spacing control
  • Text measurement and truncation

Performance is optimized through text layout caching, glyph measurement caching, and intelligent rendering that only processes visible portions of text.

Constructors

SkiaLabel()

public SkiaLabel()

SkiaLabel(string)

public SkiaLabel(string text)

Parameters

text string

Fields

AutoFontProperty

public static readonly BindableProperty AutoFontProperty

Field Value

BindableProperty

AutoSizeProperty

public static readonly BindableProperty AutoSizeProperty

Field Value

BindableProperty

AutoSizeTextProperty

public static readonly BindableProperty AutoSizeTextProperty

Field Value

BindableProperty

CharacterSpacingProperty

public static readonly BindableProperty CharacterSpacingProperty

Field Value

BindableProperty

DebugColor

public static Color DebugColor

Field Value

Color

DebugSpans

public static bool DebugSpans

Field Value

bool

DrawWhenEmptyProperty

public static readonly BindableProperty DrawWhenEmptyProperty

Field Value

BindableProperty

DropShadowColorProperty

public static readonly BindableProperty DropShadowColorProperty

Field Value

BindableProperty

DropShadowOffsetXProperty

public static readonly BindableProperty DropShadowOffsetXProperty

Field Value

BindableProperty

DropShadowOffsetYProperty

public static readonly BindableProperty DropShadowOffsetYProperty

Field Value

BindableProperty

DropShadowSizeProperty

public static readonly BindableProperty DropShadowSizeProperty

Field Value

BindableProperty

FallbackCharacterProperty

public static readonly BindableProperty FallbackCharacterProperty

Field Value

BindableProperty

FontAttributesProperty

public static readonly BindableProperty FontAttributesProperty

Field Value

BindableProperty

FontFamilyProperty

public static readonly BindableProperty FontFamilyProperty

Field Value

BindableProperty

FontSizeProperty

public static readonly BindableProperty FontSizeProperty

Field Value

BindableProperty

FontWeightProperty

public static readonly BindableProperty FontWeightProperty

Field Value

BindableProperty

FormatProperty

public static readonly BindableProperty FormatProperty

Field Value

BindableProperty

FormattedTextProperty

public static readonly BindableProperty FormattedTextProperty

Field Value

BindableProperty

GliphsInvalidated

protected bool GliphsInvalidated

Field Value

bool

GradientByLinesProperty

public static readonly BindableProperty GradientByLinesProperty

Field Value

BindableProperty

HorizontalTextAlignmentProperty

public static readonly BindableProperty HorizontalTextAlignmentProperty

Field Value

BindableProperty

KeepSpacesOnLineBreaksProperty

public static readonly BindableProperty KeepSpacesOnLineBreaksProperty

Field Value

BindableProperty

LineBreakModeProperty

public static readonly BindableProperty LineBreakModeProperty

Field Value

BindableProperty

LineHeightProperty

public static readonly BindableProperty LineHeightProperty

Field Value

BindableProperty

LineHeightUniformProperty

public static readonly BindableProperty LineHeightUniformProperty

Field Value

BindableProperty

LineSpacingProperty

public static readonly BindableProperty LineSpacingProperty

Field Value

BindableProperty

LockSetup

protected static object LockSetup

Field Value

object

MaxLinesProperty

public static readonly BindableProperty MaxLinesProperty

Field Value

BindableProperty

MonoForDigitsProperty

public static readonly BindableProperty MonoForDigitsProperty

Field Value

BindableProperty

PaintDeco

public SKPaint PaintDeco

Field Value

SKPaint

PaintDefault

public SKPaint PaintDefault

Field Value

SKPaint

PaintShadow

public SKPaint PaintShadow

Field Value

SKPaint

PaintStroke

public SKPaint PaintStroke

Field Value

SKPaint

ParagraphSpacingProperty

public static readonly BindableProperty ParagraphSpacingProperty

Field Value

BindableProperty

RenderLimit

protected int RenderLimit

Field Value

int

SensorRotationProperty

public static readonly BindableProperty SensorRotationProperty

Field Value

BindableProperty

Shaper

protected SKShaper Shaper

Field Value

SKShaper

StrokeColorProperty

public static readonly BindableProperty StrokeColorProperty

Field Value

BindableProperty

StrokeGradientProperty

public static readonly BindableProperty StrokeGradientProperty

Field Value

BindableProperty

StrokeWidthProperty

public static readonly BindableProperty StrokeWidthProperty

Field Value

BindableProperty

TextColorProperty

public static readonly BindableProperty TextColorProperty

Field Value

BindableProperty

TextProperty

public static readonly BindableProperty TextProperty

Field Value

BindableProperty

TextTransformProperty

public static readonly BindableProperty TextTransformProperty

Field Value

BindableProperty

Trail

public static string Trail

Field Value

string

TypeFaceProperty

public static readonly BindableProperty TypeFaceProperty

Field Value

BindableProperty

VerticalTextAlignmentProperty

public static readonly BindableProperty VerticalTextAlignmentProperty

Field Value

BindableProperty

_fontFamily

protected string _fontFamily

Field Value

string

_spans

protected readonly SkiaLabel.SpanCollection _spans

Field Value

SkiaLabel.SpanCollection

charMonoWidthPixels

protected float charMonoWidthPixels

Field Value

float

fontUnderline

protected float fontUnderline

Field Value

float

Properties

AutoFont

Find and set system font where the first glyph in text is present

public bool AutoFont { get; set; }

Property Value

bool

AutoSize

Gets or sets how the label automatically adjusts font size to fit available space.

public AutoSizeType AutoSize { get; set; }

Property Value

AutoSizeType

Remarks

Available auto-sizing options:

  • None (default): No auto-sizing, text uses the exact FontSize specified
  • TextToWidth: Adjusts font size to fit the width of the label
  • TextToHeight: Adjusts font size to fit the height of the label
  • TextToView: Adjusts font size to fit both width and height of the label

When auto-sizing is enabled, the label will automatically reduce the font size when necessary to make the text fit within the available space. The minimum font size is determined by the AutoSizeText property.

This is useful for:

  • Responsive layouts where available space may vary
  • Dynamic text where length may change at runtime
  • Ensuring text is fully visible within fixed space constraints

Note that auto-sizing can impact performance, especially with frequently changing text or container sizes.

AutoSizeText

Can use this text for auto-sizing the font instead if the real Text

public string AutoSizeText { get; set; }

Property Value

string

CanDraw

public override bool CanDraw { get; }

Property Value

bool

CharacterSpacing

This applies ONLY when CharByChar is enabled

public double CharacterSpacing { get; set; }

Property Value

double

DrawWhenEmpty

public bool DrawWhenEmpty { get; set; }

Property Value

bool

DropShadowColor

public Color DropShadowColor { get; set; }

Property Value

Color

DropShadowOffsetX

To make DropShadow act like shadow

public double DropShadowOffsetX { get; set; }

Property Value

double

DropShadowOffsetY

public double DropShadowOffsetY { get; set; }

Property Value

double

DropShadowSize

public double DropShadowSize { get; set; }

Property Value

double

FallbackCharacter

Character to show when glyph is not found in font

public char FallbackCharacter { get; set; }

Property Value

char

Font

TODO IText?

public Font Font { get; }

Property Value

Font

FontAttributes

[TypeConverter(typeof(DrawnFontAttributesConverter))]
public FontAttributes FontAttributes { get; set; }

Property Value

FontAttributes

FontFamily

Gets or sets the font family name used for rendering the text.

public string FontFamily { get; set; }

Property Value

string

Remarks

Set this property to use a specific font for rendering text. You can use:

  • System fonts: "Arial", "Helvetica", "Times New Roman", etc.
  • Custom fonts that have been registered with the app

For custom fonts, you need to:

  1. Add the font file to your project (typically in Resources/Fonts folder)
  2. Register it in MauiProgram.cs using:
    fonts.AddFont("FontFileName.ttf", "CustomFontName");
    
  3. Reference it using the "CustomFontName" alias

When used with FontWeight, you can specify different weights of the same font family.

If empty (default), a fallback system font will be used.

FontMetrics

public SKFontMetrics FontMetrics { get; protected set; }

Property Value

SKFontMetrics

FontRegistrar

public static IFontRegistrar FontRegistrar { get; }

Property Value

IFontRegistrar

FontSize

Gets or sets the font size in device-independent units.

[TypeConverter(typeof(FontSizeConverter))]
public double FontSize { get; set; }

Property Value

double

Remarks

Font size determines the height of the text in device-independent units:

  • Default is 12.0 units
  • Larger values make text bigger
  • Smaller values make text smaller

In XAML, you can use named font sizes by setting this property to "Small", "Medium", "Large", etc. The FontSizeConverter will convert these to appropriate numeric values.

When AutoSize is enabled, this value becomes the minimum or initial font size.

For best rendering quality, especially with small text, consider using integer values.

FontWeight

Gets or sets the weight (thickness) of the font.

public int FontWeight { get; set; }

Property Value

int

Remarks

Font weight is specified as an integer value, typically in the range of 100-900:

  • 100: Thin
  • 200: Extra Light (Ultra Light)
  • 300: Light
  • 400: Normal/Regular (default)
  • 500: Medium
  • 600: Semi Bold (Demi Bold)
  • 700: Bold
  • 800: Extra Bold (Ultra Bold)
  • 900: Black (Heavy)

This property requires that fonts be properly registered with font weight information. Use the following approach in your MauiProgram.cs:

fonts.AddFont("Roboto-Light.ttf", "Roboto", FontWeight.Light);
fonts.AddFont("Roboto-Regular.ttf", "Roboto", FontWeight.Regular);
fonts.AddFont("Roboto-Medium.ttf", "Roboto", FontWeight.Medium);
fonts.AddFont("Roboto-Bold.ttf", "Roboto", FontWeight.Bold);

A value of 0 means the default weight will be used.

Format

public string Format { get; set; }

Property Value

string

FormattedText

public FormattedString FormattedText { get; set; }

Property Value

FormattedString

GradientByLines

public bool GradientByLines { get; set; }

Property Value

bool

HorizontalTextAlignment

Gets or sets the horizontal alignment of text within the label.

public DrawTextAlignment HorizontalTextAlignment { get; set; }

Property Value

DrawTextAlignment

Remarks

Available alignment options:

  • Start: Aligns text to the left (or right in RTL languages)
  • Center: Centers text horizontally
  • End: Aligns text to the right (or left in RTL languages)
  • FillWords: Stretches text to fill the width by adjusting word spacing
  • FillWordsFull: Similar to FillWords but with more aggressive stretching
  • FillCharacters: Stretches text by adjusting character spacing
  • FillCharactersFull: Similar to FillCharacters but with more aggressive stretching

The Fill options are useful for justified text alignment, creating evenly distributed text that spans the entire width of the label.

KeepSpacesOnLineBreaks

public bool KeepSpacesOnLineBreaks { get; set; }

Property Value

bool

LineBreakMode

Gets or sets how text is handled when it exceeds the available width.

public LineBreakMode LineBreakMode { get; set; }

Property Value

LineBreakMode

Remarks

Available modes:

  • TailTruncation (default): Truncates at the end with an ellipsis (...)
  • HeadTruncation: Truncates at the beginning with an ellipsis
  • MiddleTruncation: Truncates in the middle with an ellipsis
  • CharacterWrap: Wraps to a new line at any character
  • WordWrap: Wraps to a new line at word boundaries
  • NoWrap: Does not wrap text; long text may be clipped or extend beyond container

This property only affects how text that doesn't fit in the available space is handled. It works in conjunction with MaxLines to control text overflow behavior.

For single-line text fields, TailTruncation is commonly used. For multi-line text, WordWrap is typically preferred.

LineHeight

Gets or sets the line height as a multiple of the font size, multiplier of how much space will be allocated for a line. Note that this is different from LineSpacing.

public double LineHeight { get; set; }

Property Value

double

LineHeightUniform

Should we draw with the maximum line height when lines have different height.

public bool LineHeightUniform { get; set; }

Property Value

bool

LineSpacing

Default is 1.0

public double LineSpacing { get; set; }

Property Value

double

MaxLines

Gets or sets the maximum number of lines to display.

public int MaxLines { get; set; }

Property Value

int

Remarks

This property limits the number of text lines rendered:

  • -1 (default): No limit, all lines are displayed
  • 0: No lines are displayed (text is hidden)
  • 1: Single line only (similar to a single-line text field)
  • 2+: Specific number of lines maximum

When text exceeds the maximum number of lines, the overflow behavior is determined by the LineBreakMode property. For example, with LineBreakMode.TailTruncation, excess text will be replaced with an ellipsis (...).

This property is useful for creating fixed-height text areas or previews where you want to show only a limited number of lines.

MonoForDigits

The character to be taken for its width when want digits to simulate Mono, for example "8", default is null.

public string MonoForDigits { get; set; }

Property Value

string

NeedSetText

protected bool NeedSetText { get; set; }

Property Value

bool

ParagraphSpacing

Default is 0.25

public double ParagraphSpacing { get; set; }

Property Value

double

SensorRotation

public double SensorRotation { get; set; }

Property Value

double

SpaceBetweenParagraphs

todo move this to some font info data block otherwise we wont be able to have multiple fonts

public double SpaceBetweenParagraphs { get; }

Property Value

double

Spans

Gets the collection of text spans for rich text formatting.

public IList<TextSpan> Spans { get; }

Property Value

IList<TextSpan>

Remarks

Spans allow you to apply different styling to portions of text within the label. Each TextSpan can have its own:

  • Text content
  • Font attributes (weight, family, size)
  • Text color
  • Background color
  • Text decorations (underline, strikethrough)
  • Custom styles

Spans are rendered in the order they appear in the collection.

Example XAML usage:

<draw:SkiaLabel>
    <draw:SkiaLabel.Spans>
        <draw:TextSpan Text="This is " />
        <draw:TextSpan Text="bold" FontAttributes="Bold" TextColor="Red" />
        <draw:TextSpan Text=" text" />
    </draw:SkiaLabel.Spans>
</draw:SkiaLabel>

When spans are used, the Text property is ignored. To reset to using the Text property, clear the Spans collection.

StrokeColor

Gets or sets the color of the text outline stroke.

public Color StrokeColor { get; set; }

Property Value

Color

Remarks

When set to a non-transparent color and used with a non-zero StrokeWidth, this creates an outline effect around the text. This can be used for:

  • Creating outlined text for better visibility on variable backgrounds
  • Stylistic effects like outlined fonts
  • Creating text that stands out with contrasting outline

The default is Transparent, which means no outline is drawn. For the outline to be visible, both StrokeColor and StrokeWidth must be set.

StrokeGradient

public SkiaGradient StrokeGradient { get; set; }

Property Value

SkiaGradient

StrokeWidth

public double StrokeWidth { get; set; }

Property Value

double

Text

Gets or sets the text content to be displayed by the label.

public string Text { get; set; }

Property Value

string

Remarks

This is the primary property for setting simple text content. For rich text with multiple styles, use the Spans collection or FormattedText property instead.

The text supports:

  • Multiline content (use newline characters)
  • Text transformations via TextTransform property
  • Truncation via LineBreakMode property
  • Auto-sizing via AutoSize property

When Text is set, any existing FormattedText or Spans will be replaced.

TextColor

Gets or sets the color used to display the text.

public Color TextColor { get; set; }

Property Value

Color

Remarks

This property sets the default color for all text within the label. Individual spans can override this color for portions of text when using the Spans collection or FormattedText.

The default color is GreenYellow, which is easily visible during development. You should explicitly set this to your desired text color.

For gradient text, use the TextGradient property instead of or in conjunction with this property.

TextInternal

protected string TextInternal { get; set; }

Property Value

string

TextTransform

public TextTransform TextTransform { get; set; }

Property Value

TextTransform

TypeFace

public SKTypeface TypeFace { get; set; }

Property Value

SKTypeface

VerticalTextAlignment

Gets or sets the vertical alignment of text within the label.

public TextAlignment VerticalTextAlignment { get; set; }

Property Value

TextAlignment

Remarks

Available alignment options:

  • Start: Aligns text to the top of the label
  • Center: Centers text vertically within the label
  • End: Aligns text to the bottom of the label

This property is particularly useful when the label height is larger than the text content height, allowing control over where the text is positioned vertically within the available space.

Methods

ApplyBindingContext()

public override void ApplyBindingContext()

AreAllGlyphsAvailable(string, SKTypeface)

public static List<bool> AreAllGlyphsAvailable(string text, SKTypeface typeface)

Parameters

text string
typeface SKTypeface

Returns

List<bool>

CalculateMargins()

Summing up Margins and AddMargin.. properties

public override void CalculateMargins()

CutLineToFit(SKPaint, string, float)

public (int Limit, float Width) CutLineToFit(SKPaint paint, string textIn, float maxWidth)

Parameters

paint SKPaint
textIn string
maxWidth float

Returns

(int Limit, float Width)

DecomposeText(string, SKPaint, SKPoint, float, float, int, bool, TextSpan, float)

protected SkiaLabel.DecomposedText DecomposeText(string text, SKPaint paint, SKPoint firstLineOffset, float maxWidth, float maxHeight, int maxLines, bool needsShaping, TextSpan span, float scale)

Parameters

text string
paint SKPaint
firstLineOffset SKPoint
maxWidth float
maxHeight float
maxLines int
needsShaping bool
span TextSpan
scale float

Returns

SkiaLabel.DecomposedText

DrawCharacter(SKCanvas, int, int, ReadOnlySpan<char>, float, float, SKPaint, SKPaint, SKPaint, SKRect, float)

This is called when CharByChar is enabled You can override it to apply custom effects to every letter

protected virtual void DrawCharacter(SKCanvas canvas, int lineIndex, int letterIndex, ReadOnlySpan<char> characters, float x, float y, SKPaint paint, SKPaint paintStroke, SKPaint paintDropShadow, SKRect destination, float scale)

Parameters

canvas SKCanvas
lineIndex int
letterIndex int
characters ReadOnlySpan<char>
x float
y float
paint SKPaint
paintStroke SKPaint
paintDropShadow SKPaint
destination SKRect
scale float

DrawLines(DrawingContext, SKPaint, SKPoint, IEnumerable<TextLine>)

public void DrawLines(DrawingContext ctx, SKPaint paintDefault, SKPoint startOffset, IEnumerable<TextLine> lines)

Parameters

ctx DrawingContext
paintDefault SKPaint
startOffset SKPoint
lines IEnumerable<TextLine>

DrawSpanDecorations(SKCanvas, TextSpan, float, float, float)

protected void DrawSpanDecorations(SKCanvas canvas, TextSpan span, float xStart, float xEnd, float y)

Parameters

canvas SKCanvas
span TextSpan
xStart float
xEnd float
y float

DrawText(SKCanvas, float, float, ReadOnlySpan<char>, SKPaint, SKPaint, SKPaint, float)

public void DrawText(SKCanvas canvas, float x, float y, ReadOnlySpan<char> characters, SKPaint textPaint, SKPaint strokePaint, SKPaint paintDropShadow, float scale)

Parameters

canvas SKCanvas
x float
y float
characters ReadOnlySpan<char>
textPaint SKPaint
strokePaint SKPaint
paintDropShadow SKPaint
scale float

DrawText(SKCanvas, float, float, string, SKPaint, SKPaint, SKPaint, float)

If strokePaint==null will not stroke

public void DrawText(SKCanvas canvas, float x, float y, string text, SKPaint textPaint, SKPaint strokePaint, SKPaint paintDropShadow, float scale)

Parameters

canvas SKCanvas
x float
y float
text string
textPaint SKPaint
strokePaint SKPaint
paintDropShadow SKPaint
scale float

GetGlyphs(string, SKTypeface)

public static List<UsedGlyph> GetGlyphs(string text, SKTypeface typeface)

Parameters

text string
typeface SKTypeface

Returns

List<UsedGlyph>

GetResultSize(Result)

public static SKSize GetResultSize(SKShaper.Result result)

Parameters

result SKShaper.Result

Returns

SKSize

GetShapedText(SKShaper, string, float, float, SKPaint)

public static SKShaper.Result GetShapedText(SKShaper shaper, string text, float x, float y, SKPaint paint)

Parameters

shaper SKShaper
text string
x float
y float
paint SKPaint

Returns

SKShaper.Result

GetSpaceBetweenLines(float)

public double GetSpaceBetweenLines(float lineHeight)

Parameters

lineHeight float

Returns

double

Invalidate()

Base calls InvalidateInternal and InvalidateParent

public override void Invalidate()

InvalidateText()

public virtual void InvalidateText()

IsGlyphAlwaysAvailable(string)

public static bool IsGlyphAlwaysAvailable(string glyphText)

Parameters

glyphText string

Returns

bool

LastNonSpaceIndex(string)

public static int LastNonSpaceIndex(string text)

Parameters

text string

Returns

int

LastNonSpaceIndexOptimized(ReadOnlySpan<char>)

Optimized version of LastNonSpaceIndex that works with spans

public static int LastNonSpaceIndexOptimized(ReadOnlySpan<char> textSpan)

Parameters

textSpan ReadOnlySpan<char>

Returns

int

MeasureLineGlyphs(SKPaint, string, bool, float)

protected (float Width, LineGlyph[] Glyphs) MeasureLineGlyphs(SKPaint paint, string text, bool needsShaping, float scale)

Parameters

paint SKPaint
text string
needsShaping bool
scale float

Returns

(float Width, LineGlyph[] Glyphs)

MeasureText(SKPaint, string, ref SKRect)

Returns text taken size in pixels. Accounts paint transforms like skew etc.

public void MeasureText(SKPaint paint, string text, ref SKRect bounds)

Parameters

paint SKPaint
text string
bounds SKRect

MeasureTextWidthWithAdvance(SKPaint, ReadOnlySpan<char>)

public static float MeasureTextWidthWithAdvance(SKPaint paint, ReadOnlySpan<char> textSpan)

Parameters

paint SKPaint
textSpan ReadOnlySpan<char>

Returns

float

MeasureTextWidthWithAdvance(SKPaint, string)

public static float MeasureTextWidthWithAdvance(SKPaint paint, string text)

Parameters

paint SKPaint
text string

Returns

float

MergeSpansForLines(TextSpan, TextLine, TextLine)

public void MergeSpansForLines(TextSpan span, TextLine line, TextLine previousSpanLastLine)

Parameters

span TextSpan
line TextLine
previousSpanLastLine TextLine

NeedUpdateFont(BindableObject, object, object)

protected static void NeedUpdateFont(BindableObject bindable, object oldvalue, object newvalue)

Parameters

bindable BindableObject
oldvalue object
newvalue object

NeedsRTL(string)

public static bool NeedsRTL(string text)

Parameters

text string

Returns

bool

OnDisposing()

Base performs some cleanup actions with Superview

public override void OnDisposing()

OnFocusChanged(bool)

This will be called only for views registered at Superview.FocusedChild. The view must return true of false to indicate if it accepts focus.

public virtual bool OnFocusChanged(bool focus)

Parameters

focus bool

Returns

bool

OnFontUpdated()

A new TypeFace was set

protected virtual void OnFontUpdated()

OnLayoutReady()

Layout was changed with dimensions above zero. Rather a helper method, can you more generic OnLayoutChanged().

protected override void OnLayoutReady()

OnMeasuring(float, float, float)

Input in POINTS

public override ScaledSize OnMeasuring(float widthConstraint, float heightConstraint, float scale)

Parameters

widthConstraint float
heightConstraint float
scale float

Returns

ScaledSize

OnPropertyChanged(string)

Method that is called when a bound property is changed.

protected override void OnPropertyChanged(string propertyName = null)

Parameters

propertyName string

The name of the bound property that changed.

OnScaleChanged()

public override void OnScaleChanged()

OnSpanTapped(TextSpan)

Return null if you wish not to consume

public virtual ISkiaGestureListener OnSpanTapped(TextSpan span)

Parameters

span TextSpan

Returns

ISkiaGestureListener

OnTextChanged()

protected virtual void OnTextChanged()

OnWillDisposeWithChildren()

The OnDisposing might come with a delay to avoid disposing resources at use. This method will be called without delay when Dispose() is invoked. Disposed will set to True and for Views their OnWillDisposeWithChildren will be called.

public override void OnWillDisposeWithChildren()

Paint(DrawingContext)

This is the main drawing routine you should override to draw something. Base one paints background color inside DrawingRect that was defined by Arrange inside base.Draw. Pass arguments if you want to use some time-frozen data for painting at any time from any thread..

protected override void Paint(DrawingContext ctx)

Parameters

ctx DrawingContext

ProcessGestures(SkiaGesturesParameters, GestureEventProcessingInfo)

public override ISkiaGestureListener ProcessGestures(SkiaGesturesParameters args, GestureEventProcessingInfo apply)

Parameters

args SkiaGesturesParameters
apply GestureEventProcessingInfo

Returns

ISkiaGestureListener

ReplaceFont()

protected void ReplaceFont()

ResetTextCalculations()

protected void ResetTextCalculations()

SetTextInternal()

Aplies transforms etc

protected virtual void SetTextInternal()

SetupBackgroundPaint(SKPaint, SKRect)

Overriding this to be able to control either control background is drawn (when background color is set) or gradient can be drawn over text

protected override bool SetupBackgroundPaint(SKPaint paint, SKRect destination)

Parameters

paint SKPaint
destination SKRect

Returns

bool

SetupDefaultPaint(float)

protected virtual void SetupDefaultPaint(float scale)

Parameters

scale float

SetupShaper(SKTypeface)

protected void SetupShaper(SKTypeface typeface)

Parameters

typeface SKTypeface

SpanPostDraw(SKCanvas, TextSpan, SKRect, float)

protected virtual void SpanPostDraw(SKCanvas canvas, TextSpan span, SKRect rect, float textY)

Parameters

canvas SKCanvas
span TextSpan
rect SKRect
textY float

TextWasChanged(BindableObject, object, object)

protected static void TextWasChanged(BindableObject bindable, object oldvalue, object newvalue)

Parameters

bindable BindableObject
oldvalue object
newvalue object

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

UnicodeNeedsShaping(int)

public static bool UnicodeNeedsShaping(int unicodeCharacter)

Parameters

unicodeCharacter int

Returns

bool

UpdateFont()

protected virtual void UpdateFont()

Events

SpansCollectionChanged

public event NotifyCollectionChangedEventHandler SpansCollectionChanged

Event Type

NotifyCollectionChangedEventHandler