Class TextUtils

Definition

Namespace:
Tizen.NUI.BaseComponents
Assembly:
Tizen.NUI.dll
C#
Copy
public static class TextUtils : object
Inheritance
TextUtils

Methods

View Source

ConvertToRgba8888(PixelBuffer, Vector4, Boolean)

Converts a @p pixelBuffer with pixel format A8 to RGBA8888 using the given @p color. @note Does nothing if the @p pixelBuffer is not A8.

Declaration
C#
Copy
public static PixelBuffer ConvertToRgba8888(PixelBuffer pixelBuffer, Vector4 color, bool multiplyByAlpha)
Parameters
Type Name Description
PixelBuffer pixelBuffer

The pixel buffer with pixel format A8

Vector4 color

The color used to convert to RGBA8888

Boolean multiplyByAlpha

multiplyByAlpha Whether to multiply the @p color with the alpha value of the @p pixel @p buffer.

Returns
Type Description
PixelBuffer

The pixel buffer converted to RGBA8888.

View Source

CopyToClipboard(TextEditor)

Copy the previously selected text from the text control into the clipboard.

Declaration
C#
Copy
public static string CopyToClipboard(TextEditor textEditor)
Parameters
Type Name Description
TextEditor textEditor

The textEditor control from which the text is copied.

Returns
Type Description
String

The copied text.

API Level: 9
View Source

CopyToClipboard(TextField)

Copy the previously selected text from the text control into the clipboard.

Declaration
C#
Copy
public static string CopyToClipboard(TextField textField)
Parameters
Type Name Description
TextField textField

The textField control from which the text is copied.

Returns
Type Description
String

The copied text.

API Level: 9
View Source

CreateShadow(ShadowParameters)

Creates a shadow for the text given in the input pixel buffer. The function returns a RGBA8888 pixel buffer with the text and its shadow rendered on it.

The pixel format of the @e input pixel buffer could be an A8 or an RGBA8888. If it's an A8 pixel buffer, it uses the given @e textColor to give color to the text. Otherwise it uses the color of the @e input pixel buffer.

Declaration
C#
Copy
public static PixelBuffer CreateShadow(ShadowParameters shadowParameters)
Parameters
Type Name Description
ShadowParameters shadowParameters

The parameters needed to create the text's shadow.

Returns
Type Description
PixelBuffer

A pixel buffer with the text and the shadow rendered on it.

View Source

CutToClipboard(TextEditor)

Cut the previously selected text from the text control into the clipboard.

Declaration
C#
Copy
public static string CutToClipboard(TextEditor textEditor)
Parameters
Type Name Description
TextEditor textEditor

The textEditor control from which the text is cut.

Returns
Type Description
String

The cut text.

API Level: 9
View Source

CutToClipboard(TextField)

Cut the previously selected text from the text control into the clipboard.

Declaration
C#
Copy
public static string CutToClipboard(TextField textField)
Parameters
Type Name Description
TextField textField

The textField control from which the text is cut.

Returns
Type Description
String

The cut text.

API Level: 9
View Source

GetFontInfoList(PropertyArray)

This method converts a FontInfo property array to a list and returns it. The FontInfo PropertyArray. A list of FontInfo struct.

Declaration
C#
Copy
public static List<FontInfo> GetFontInfoList(PropertyArray fontArray)
Parameters
Type Name Description
PropertyArray fontArray
Returns
Type Description
List<FontInfo>
View Source

GetFontSizeScale(SystemSettingsFontSize)

It returns a float value according to SystemSettingsFontSize. The returned value can be used for FontSizeScale property. The SystemSettingsFontSize enum value. A float value for FontSizeScale property.

Declaration
C#
Copy
public static float GetFontSizeScale(SystemSettingsFontSize systemSettingsFontSize)
Parameters
Type Name Description
SystemSettingsFontSize systemSettingsFontSize
Returns
Type Description
Single
View Source

GetLastCharacterIndex(RendererParameters)

Splits the text in pages of the size given in @p textParameters @note The returned indices are indices to utf32 characters. The input text is encoded in utf8. An array with the indices of the last character of each page

Declaration
C#
Copy
public static PropertyArray GetLastCharacterIndex(RendererParameters textParameters)
Parameters
Type Name Description
RendererParameters textParameters
Returns
Type Description
PropertyArray
View Source

GetMapToTextFitArray(PropertyMap)

This method converts a TextFitArray property map to a TextFitArray and returns it. The TextFitArray PropertyMap. A TextFitArray struct.

Declaration
C#
Copy
public static TextFitArray GetMapToTextFitArray(PropertyMap textFitArrayMap)
Parameters
Type Name Description
PropertyMap textFitArrayMap
Returns
Type Description
TextFitArray
View Source

PasteTo(TextEditor)

Paste the most recently copied/cut text item from the clipboard into the text control.

Declaration
C#
Copy
public static void PasteTo(TextEditor textEditor)
Parameters
Type Name Description
TextEditor textEditor

The textEditor control into which the text is pasted.

Remarks

The pasted text will be inserted in the current cursor position and if the text control has no focus, the text will be appended to the last cursor position and the text control will gain focus. If some text inside the text control is selected, it will be replaced by the pasted text.

API Level: 9
View Source

PasteTo(TextField)

Paste the most recently copied/cut text item from the clipboard into the text control.

Declaration
C#
Copy
public static void PasteTo(TextField textField)
Parameters
Type Name Description
TextField textField

The textField control into which the text is pasted.

Remarks

The pasted text will be inserted in the current cursor position and if the text control has no focus, the text will be appended to the last cursor position and the text control will gain focus. If some text inside the text control is selected, it will be replaced by the pasted text.

API Level: 9
View Source

Render(RendererParameters, ref EmbeddedItemInfo[])

Renders text into a pixel buffer. @note: Can process a mark-up string. @note: It does the font selection, RTL reordering, shaping and layouting. @note: The width of the pixel buffer may be different to the given @e textWidth due to some padding pixels added.

The text is laid-out for the given size @e (textWidth,textHeight). If the @e multiLineEnabled option is enabled, the text will wrap in lines. If the @e ellipsisEnabled option is enabled, the text will be ellided if there is no more space for new lines.

It won't be rendered the parts of the text exceeding the boundaries of the given width and height.

If the given @e textHeight is zero, a big enough pixel buffer will be created to render the full text.

If the given @e textWidth is zero, the 'natural size' of the text will be used to create the pixel buffer to render the full text.

If the radius is not zero, the text will be laid-out following a circular path. In that case the text is laid-out in a single line.

If the mark-up string contains embedded items, the @p embeddedItemLayout vector contains the layout info of each embedded item.

Declaration
C#
Copy
public static PixelBuffer Render(RendererParameters textParameters, ref EmbeddedItemInfo[] embeddedItemLayout)
Parameters
Type Name Description
RendererParameters textParameters

The text and style options.

EmbeddedItemInfo[] embeddedItemLayout

The layout info of the embedded items

Returns
Type Description
PixelBuffer

A pixel buffer with the text rendered on it.

View Source

UpdateBuffer(PixelBuffer, PixelBuffer, UInt32, UInt32, Boolean)

Updates the @p dst pixel buffer with the data from @p src pixel buffer. @note Both pixel buffers must have the same pixel format. Does nothing if both pixel format are different. @note The function does nothing if the @p src pixel buffer doesn't fit into the @p dst pixel buffer.

The @p src pixel buffer could be blended with the @p dst pixel buffer if @p blend is set to @e true.

Declaration
C#
Copy
public static void UpdateBuffer(PixelBuffer src, PixelBuffer dst, uint x, uint y, bool blend)
Parameters
Type Name Description
PixelBuffer src

The pixel buffer from where the data is read.

PixelBuffer dst

The pixel buffer where the data is written.

UInt32 x

The top left corner's X within the destination pixel buffer.

UInt32 y

The top left corner's y within the destination pixel buffer.

Boolean blend

Whether to blend the source pixel buffer with the destination pixel buffer as background.