Table of Contents

Class TextSpan

Namespace
DrawnUi.Draw
Assembly
DrawnUi.Maui.dll
public class TextSpan : Element, INotifyPropertyChanged, IElementController, IVisualTreeElement, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IElement, IDisposable
Inheritance
TextSpan
Implements
Derived
Inherited Members
Extension Methods

Constructors

TextSpan()

public TextSpan()

Fields

FontSizeProperty

public static readonly BindableProperty FontSizeProperty

Field Value

BindableProperty

Rects

Relative to DrawingRect

public readonly List<SKRect> Rects

Field Value

List<SKRect>

TextColorProperty

public static readonly BindableProperty TextColorProperty

Field Value

BindableProperty

TextProperty

public static readonly BindableProperty TextProperty

Field Value

BindableProperty

_fontAutoSet

protected bool _fontAutoSet

Field Value

bool

Properties

AutoFindFont

If any glyph cannot be rendered with selected font try find system font that supports it and switch to it for the whole span

public bool AutoFindFont { get; set; }

Property Value

bool

BackgroundColor

public Color BackgroundColor { get; set; }

Property Value

Color

CommandTapped

public ICommand CommandTapped { get; set; }

Property Value

ICommand

DebugString

public string DebugString { get; }

Property Value

string

Default

public static TextSpan Default { get; }

Property Value

TextSpan

DrawingOffset

Rendering offset, set when combining spans. Ofset of the first line.

public SKPoint DrawingOffset { get; set; }

Property Value

SKPoint

FontDetectedWith

public int FontDetectedWith { get; set; }

Property Value

int

FontFamily

public string FontFamily { get; set; }

Property Value

string

FontSize

public double FontSize { get; set; }

Property Value

double

FontWeight

public int FontWeight { get; set; }

Property Value

int

ForceCaptureInput

When no tap handler or command are set this forces to listen to taps anyway

public bool ForceCaptureInput { get; set; }

Property Value

bool

Glyphs

Ig can be drawn char by char with char spacing etc we use this

public List<UsedGlyph> Glyphs { get; protected set; }

Property Value

List<UsedGlyph>

HasDecorations

public bool HasDecorations { get; }

Property Value

bool

HasSetColor

public bool HasSetColor { get; set; }

Property Value

bool

HasSetFont

public bool HasSetFont { get; set; }

Property Value

bool

HasSetSize

public bool HasSetSize { get; set; }

Property Value

bool

HasTapHandler

Will listen to gestures

public bool HasTapHandler { get; }

Property Value

bool

IsBold

public bool IsBold { get; set; }

Property Value

bool

IsItalic

public bool IsItalic { get; set; }

Property Value

bool

LineHeight

public float LineHeight { get; set; }

Property Value

float

LineSpacing

public float LineSpacing { get; set; }

Property Value

float

NeedShape

public bool NeedShape { get; set; }

Property Value

bool

Paint

public SKPaint Paint { get; set; }

Property Value

SKPaint

ParagraphColor

public Color ParagraphColor { get; set; }

Property Value

Color

ParentControl

protected SkiaControl ParentControl { get; }

Property Value

SkiaControl

RenderingScale

public float RenderingScale { get; set; }

Property Value

float

Shape

If text can be drawn only shaped we use this

public string Shape { get; protected set; }

Property Value

string

Strikeout

public bool Strikeout { get; set; }

Property Value

bool

StrikeoutColor

public Color StrikeoutColor { get; set; }

Property Value

Color

StrikeoutWidth

In points

public double StrikeoutWidth { get; set; }

Property Value

double

Tag

public string Tag { get; set; }

Property Value

string

Text

public string Text { get; set; }

Property Value

string

TextColor

public Color TextColor { get; set; }

Property Value

Color

TextFiltered

public string TextFiltered { get; protected set; }

Property Value

string

TypeFace

public SKTypeface TypeFace { get; set; }

Property Value

SKTypeface

Underline

public bool Underline { get; set; }

Property Value

bool

UnderlineWidth

In points, if set to negative will be in pixels instead.

public double UnderlineWidth { get; set; }

Property Value

double

Methods

CheckGlyphsCanBeRendered()

Parse glyphs, setup typeface, replace unrenderable glyphs with fallback character

public void CheckGlyphsCanBeRendered()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public virtual void Dispose()

FireTap()

public virtual void FireTap()

HitIsInside(float, float)

public virtual bool HitIsInside(float x, float y)

Parameters

x float
y float

Returns

bool

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.

SetupPaint(double, SKPaint)

Update the paint with current format properties

public SKPaint SetupPaint(double scale, SKPaint defaultPaint)

Parameters

scale double
defaultPaint SKPaint

Returns

SKPaint

UpdateFont()

protected virtual void UpdateFont()

Events

Tapped

public event EventHandler<ControlTappedEventArgs> Tapped

Event Type

EventHandler<ControlTappedEventArgs>