Class TextUtils
Definition
- Namespace:
- Tizen.NUI.BaseComponents
- Assembly:
- Tizen.NUI.dll
public static class TextUtils
- Inheritance
-
objectTextUtils
Methods
View SourceConvertToRgba8888(PixelBuffer, Vector4, bool)
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
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 |
bool | 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. |
CopyToClipboard(TextEditor)
Copy the previously selected text from the text control into the clipboard.
Declaration
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. |
CopyToClipboard(TextField)
Copy the previously selected text from the text control into the clipboard.
Declaration
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. |
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
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. |
CutToClipboard(TextEditor)
Cut the previously selected text from the text control into the clipboard.
Declaration
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. |
CutToClipboard(TextField)
Cut the previously selected text from the text control into the clipboard.
Declaration
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. |
GetFontInfoList(PropertyArray)
This method converts a FontInfo property array to a list and returns it.
The FontInfo PropertyArray.Declaration
public static List<FontInfo> GetFontInfoList(PropertyArray fontArray)
Parameters
Type | Name | Description |
---|---|---|
PropertyArray | fontArray |
Returns
Type | Description |
---|---|
List<><FontInfo> |
GetFontSizeScale(SystemSettingsFontSize)
It returns a float value according to SystemSettingsFontSize. The returned value can be used for FontSizeScale property.
The SystemSettingsFontSize enum value.Declaration
public static float GetFontSizeScale(SystemSettingsFontSize systemSettingsFontSize)
Parameters
Type | Name | Description |
---|---|---|
SystemSettingsFontSize | systemSettingsFontSize |
Returns
Type | Description |
---|---|
float |
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.
Declaration
public static PropertyArray GetLastCharacterIndex(RendererParameters textParameters)
Parameters
Type | Name | Description |
---|---|---|
RendererParameters | textParameters |
Returns
Type | Description |
---|---|
PropertyArray |
GetMapToTextFitArray(PropertyMap)
This method converts a TextFitArray property map to a TextFitArray and returns it.
The TextFitArray PropertyMap.Declaration
public static TextFitArray GetMapToTextFitArray(PropertyMap textFitArrayMap)
Parameters
Type | Name | Description |
---|---|---|
PropertyMap | textFitArrayMap |
Returns
Type | Description |
---|---|
TextFitArray |
PasteTo(TextEditor)
Paste the most recently copied/cut text item from the clipboard into the text control.
Declaration
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.
PasteTo(TextField)
Paste the most recently copied/cut text item from the clipboard into the text control.
Declaration
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.
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
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. |
UpdateBuffer(PixelBuffer, PixelBuffer, uint, uint, bool)
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
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. |
uint | x | The top left corner's X within the destination pixel buffer. |
uint | y | The top left corner's y within the destination pixel buffer. |
bool | blend | Whether to blend the source pixel buffer with the destination pixel buffer as background. |