FontTypeface.IHandler

References
[AutoInitialize(false)] public interface FontTypeface.IHandler : Widget.IHandler
Platform handler interface for the FontTypeface class

Properties

FontStyle

#
FontStyle FontStyle { get; }
Gets the style of this typeface
Remarks: This style does not fully describe the characteristics of the typeface, just very broad characteristics.

ID

string ID { get; set; }
Gets or sets an ID for the widget
inherited fromWidget.IHandler
Remarks: Some platforms may use this to identify controls (e.g. web)

IsSymbol

#
bool IsSymbol { get; }
Gets a value indicating that this font is a symbol font and not generally used for text

Name

#
string Name { get; }
Gets the name of this typeface
Remarks: The name of the typeface typically includes hints to the style of the type

NativeHandle

nint NativeHandle { get; }
Gets the native platform-specific handle for integration purposes
inherited fromWidget.IHandler

PostScriptName

#Since v2.11
string PostScriptName { get; }
Gets the PostScript name of this typeface, which is a unique name for this typeface that is used by the operating system to identify it.

Methods

Create

#
void Create(FontFamily family)
Called when creating a FontTypeface for the specified FontFamily

Create

#
void Create(Stream stream)
Called when creating a FontTypeface for the specified font file stream.
Remarks: Note that the Family must not be null after this call.
stream (Stream)Stream of the font file to load in this typeface

Create

#
void Create(string fileName)
Called when creating a FontTypeface for the specified font file name.
Remarks: Note that the Family must not be null after this call.
fileName (string)Path to the font file to load in this typeface

HandleEvent

void HandleEvent(string id, bool defaultEvent = false)
Called to handle a specific event
inherited fromWidget.IHandler
Remarks: Most events are late bound by this method. Instead of wiring all events, this will be called with an event string that is defined by the control. This is called automatically when attaching to events, but must be called manually when users of the control only override the event's On... method.
id (string)ID of the event to handle
defaultEvent (bool = false)True if the event is default (e.g. overridden or via an event handler subscription)

HasCharacterRanges

#
bool HasCharacterRanges(IEnumerable<Range<int>> ranges)
Gets a value indicating that this font supports the character ranges specified
ranges (IEnumerable<Range<int>>)Ranges to test
True if the font supports all characters in the specified ranges, false otherwise

Initialize

void Initialize()
Called after the widget is constructed
inherited fromWidget.IHandler
Remarks: This gets called automatically after the control is constructed and the Widget.IHandler.Widget and Widget.Platform properties are set. When the handler has specialized construction methods, then the AutoInitializeAttribute can be used to disable automatic initialization. In this case, it is the responsibility of the subclass to call Widget.Initialize()

UnhandleEvent

virtual void UnhandleEvent(string id)
Called when the last subscriber to an event has been removed, so the platform can stop listening for it.
inherited fromWidget.IHandler
Remarks: Only reached for events whose remove accessor uses PropertyStore.RemoveHandlerEvent(string, Delegate), and only for events that were attached because something subscribed to them. An event attached because the widget overrides its On[Event] method is never detached, since it has to keep firing regardless. Most events stay attached for the life of the widget, which costs nothing. Detaching is worth wiring up for the few that hold onto something expensive or process wide while they are attached, such as a system wide hook. Handlers deriving from WidgetHandler<TWidget> get an implementation of this that dispatches to WidgetHandler<TWidget>.DetachEvent(string), which is what to override.
id (string)ID of the event to stop handling