Table of Contents

Class TextFormat

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The TextFormat interface represents specific formatting that should be applied to a range of text in an editable text region that's attached to an EditContext instance. The text formatting is requested by the {{glossary("Input Method Editor")}} (IME) window that the user is composing text with.
[Value("TextFormat")]
public class TextFormat
Inheritance
TextFormat
Inherited Members

Remarks

When using one of the default editable regions of the web, such as a <textarea> element, IME composition is handled by the browser and operating system for you. For example, when using Japanese IME in a textarea, on Windows, the following text formats can be applied:

When creating your own custom editable region by using the {{domxref("EditContext API", "", "", "nocode")}}, you need to handle IME composition yourself. You should listen for the EditContexttextformatupdate event, which gives you the list of text formats that the IME window wants to apply to the text being composed. You should then update the formatting of the text displayed in your editable region accordingly.

See also on MDN

Constructors

TextFormat()

public TextFormat()

TextFormat(TextFormatInit)

NOTE
Experimental
The TextFormat() constructor returns a new TextFormat object.
public TextFormat(TextFormatInit options = null)

Parameters

options TextFormatInit

Remarks

-The TextFormat interface it belongs to.

See also on MDN

Properties

RangeEnd

NOTE
Experimental
The rangeEnd property of the TextFormat interface indicates the end position of the text range that needs to be formatted with the given text format.
[Value("rangeEnd")]
public ulong RangeEnd { get; }

Property Value

ulong

A Number.

Remarks

-The TextFormat interface it belongs to.

See also on MDN

RangeStart

NOTE
Experimental
The rangeStart property of the TextFormat interface indicates the start position of the text range that needs to be formatted with the given text format.
[Value("rangeStart")]
public ulong RangeStart { get; }

Property Value

ulong

A Number.

Remarks

-The TextFormat interface it belongs to.

See also on MDN

UnderlineStyle

NOTE
Experimental
The underlineStyle property of the TextFormat interface indicates the style of the underline that needs to be applied to the text range that is being formatted.
[Value("underlineStyle")]
public UnderlineStyle UnderlineStyle { get; }

Property Value

UnderlineStyle

A String that is one of the following values:

Remarks

-The TextFormat interface it belongs to.

See also on MDN

UnderlineThickness

NOTE
Experimental
The underlineThickness property of the TextFormat interface indicates the thickness of the underline that needs to be applied to the text range that is being formatted.
[Value("underlineThickness")]
public UnderlineThickness UnderlineThickness { get; }

Property Value

UnderlineThickness

A String that is one of the following values:

Remarks

-The TextFormat interface it belongs to.

See also on MDN