Bidi.SetPara Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
SetPara(IAttributedCharacterIterator) |
Perform the Unicode Bidi algorithm on a given paragraph, as defined in the Unicode Standard Annex #9, version 13, also described in The Unicode Standard, Version 4. |
SetPara(Char[], SByte, Byte[]) |
Perform the Unicode Bidi algorithm. |
SetPara(String, SByte, Byte[]) |
Perform the Unicode Bidi algorithm. |
SetPara(IAttributedCharacterIterator)
Perform the Unicode Bidi algorithm on a given paragraph, as defined in the Unicode Standard Annex #9, version 13, also described in The Unicode Standard, Version 4.
[Android.Runtime.Register("setPara", "(Ljava/text/AttributedCharacterIterator;)V", "GetSetPara_Ljava_text_AttributedCharacterIterator_Handler", ApiSince=29)]
public virtual void SetPara (Java.Text.IAttributedCharacterIterator? paragraph);
[<Android.Runtime.Register("setPara", "(Ljava/text/AttributedCharacterIterator;)V", "GetSetPara_Ljava_text_AttributedCharacterIterator_Handler", ApiSince=29)>]
abstract member SetPara : Java.Text.IAttributedCharacterIterator -> unit
override this.SetPara : Java.Text.IAttributedCharacterIterator -> unit
Parameters
- paragraph
- IAttributedCharacterIterator
a paragraph of text with optional character and paragraph attribute information
- Attributes
Remarks
Perform the Unicode Bidi algorithm on a given paragraph, as defined in the Unicode Standard Annex #9, version 13, also described in The Unicode Standard, Version 4.0 .
This method takes a paragraph of text and computes the left-right-directionality of each character. The text should not contain any Unicode block separators.
The RUN_DIRECTION attribute in the text, if present, determines the base direction (left-to-right or right-to-left). If not present, the base direction is computed using the Unicode Bidirectional Algorithm, defaulting to left-to-right if there are no strong directional characters in the text. This attribute, if present, must be applied to all the text in the paragraph.
The BIDI_EMBEDDING attribute in the text, if present, represents embedding level information. Negative values indicate overrides at the absolute value of the level. Positive values indicate embeddings. (See #MAX_EXPLICIT_LEVEL
.) Where values are zero or not defined, the base embedding level as determined by the base direction is assumed.
The NUMERIC_SHAPING attribute in the text, if present, converts European digits to other decimal digits before running the bidi algorithm. This attribute, if present, must be applied to all the text in the paragraph.
If the entire text is all of the same directionality, then the method may not perform all the steps described by the algorithm, i.e., some levels may not be the same as if all steps were performed. This is not relevant for unidirectional text.<br> For example, in pure LTR text with numbers the numbers would get a resolved level of 2 higher than the surrounding text according to the algorithm. This implementation may set all resolved levels to the same value in such a case.
Java documentation for android.icu.text.Bidi.setPara(java.text.AttributedCharacterIterator)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
SetPara(Char[], SByte, Byte[])
Perform the Unicode Bidi algorithm.
[Android.Runtime.Register("setPara", "([CB[B)V", "GetSetPara_arrayCBarrayBHandler", ApiSince=29)]
public virtual void SetPara (char[]? chars, sbyte paraLevel, byte[]? embeddingLevels);
[<Android.Runtime.Register("setPara", "([CB[B)V", "GetSetPara_arrayCBarrayBHandler", ApiSince=29)>]
abstract member SetPara : char[] * sbyte * byte[] -> unit
override this.SetPara : char[] * sbyte * byte[] -> unit
Parameters
- chars
- Char[]
contains the text that the Bidi algorithm will be performed
on. This text can be retrieved with getText()
or
getTextAsString
.<br>
- paraLevel
- SByte
specifies the default level for the text;
it is typically 0 (LTR) or 1 (RTL).
If the method shall determine the paragraph level from the text,
then paraLevel
can be set to
either LEVEL_DEFAULT_LTR
or LEVEL_DEFAULT_RTL
; if the text contains multiple
paragraphs, the paragraph level shall be determined separately for
each paragraph; if a paragraph does not include any strongly typed
character, then the desired default is used (0 for LTR or 1 for RTL).
Any other value between 0 and MAX_EXPLICIT_LEVEL
is also valid, with odd levels indicating RTL.
- embeddingLevels
- Byte[]
(in) may be used to preset the embedding and
override levels, ignoring characters like LRE and PDF in the text.
A level overrides the directional property of its corresponding
(same index) character if the level has the
LEVEL_OVERRIDE
bit set.<br><br>
Aside from that bit, it must be
paraLevel<=embeddingLevels[]<=MAX_EXPLICIT_LEVEL
,
except that level 0 is always allowed.
Level 0 for a paragraph separator prevents reordering of paragraphs;
this only works reliably if LEVEL_OVERRIDE
is also set for paragraph separators.
Level 0 for other characters is treated as a wildcard
and is lifted up to the resolved level of the surrounding paragraph.<br><br>
<strong>Caution: </strong>A reference to this array, not a copy
of the levels, will be stored in the Bidi
object;
the embeddingLevels
should not be modified to avoid unexpected results on subsequent
Bidi operations. However, the setPara()
and
setLine()
methods may modify some or all of the
levels.<br><br>
<strong>Note:</strong> the embeddingLevels
array must
have one entry for each character in text
.
- Attributes
Remarks
Perform the Unicode Bidi algorithm. It is defined in the Unicode Standard Annex #9.
This method takes a piece of plain text containing one or more paragraphs, with or without externally specified embedding levels from styled text and computes the left-right-directionality of each character.
If the entire text is all of the same directionality, then the method may not perform all the steps described by the algorithm, i.e., some levels may not be the same as if all steps were performed. This is not relevant for unidirectional text.<br> For example, in pure LTR text with numbers the numbers would get a resolved level of 2 higher than the surrounding text according to the algorithm. This implementation may set all resolved levels to the same value in such a case.
The text can be composed of multiple paragraphs. Occurrence of a block separator in the text terminates a paragraph, and whatever comes next starts a new paragraph. The exception to this rule is when a Carriage Return (CR) is followed by a Line Feed (LF). Both CR and LF are block separators, but in that case, the pair of characters is considered as terminating the preceding paragraph, and a new paragraph will be started by a character coming after the LF.
The text is stored internally as an array of characters. Therefore the documentation will refer to indexes of the characters in the text.
Java documentation for android.icu.text.Bidi.setPara(char[], byte, byte[])
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
SetPara(String, SByte, Byte[])
Perform the Unicode Bidi algorithm.
[Android.Runtime.Register("setPara", "(Ljava/lang/String;B[B)V", "GetSetPara_Ljava_lang_String_BarrayBHandler", ApiSince=29)]
public virtual void SetPara (string? text, sbyte paraLevel, byte[]? embeddingLevels);
[<Android.Runtime.Register("setPara", "(Ljava/lang/String;B[B)V", "GetSetPara_Ljava_lang_String_BarrayBHandler", ApiSince=29)>]
abstract member SetPara : string * sbyte * byte[] -> unit
override this.SetPara : string * sbyte * byte[] -> unit
Parameters
- text
- String
contains the text that the Bidi algorithm will be performed
on. This text can be retrieved with getText()
or
getTextAsString
.<br>
- paraLevel
- SByte
specifies the default level for the text;
it is typically 0 (LTR) or 1 (RTL).
If the method shall determine the paragraph level from the text,
then paraLevel
can be set to
either LEVEL_DEFAULT_LTR
or LEVEL_DEFAULT_RTL
; if the text contains multiple
paragraphs, the paragraph level shall be determined separately for
each paragraph; if a paragraph does not include any strongly typed
character, then the desired default is used (0 for LTR or 1 for RTL).
Any other value between 0 and MAX_EXPLICIT_LEVEL
is also valid, with odd levels indicating RTL.
- embeddingLevels
- Byte[]
(in) may be used to preset the embedding and override levels,
ignoring characters like LRE and PDF in the text.
A level overrides the directional property of its corresponding
(same index) character if the level has the
LEVEL_OVERRIDE
bit set.<br><br>
Aside from that bit, it must be
paraLevel<=embeddingLevels[]<=MAX_EXPLICIT_LEVEL
,
except that level 0 is always allowed.
Level 0 for a paragraph separator prevents reordering of paragraphs;
this only works reliably if LEVEL_OVERRIDE
is also set for paragraph separators.
Level 0 for other characters is treated as a wildcard
and is lifted up to the resolved level of the surrounding paragraph.<br><br>
<strong>Caution: </strong>A reference to this array, not a copy
of the levels, will be stored in the Bidi
object;
the embeddingLevels
should not be modified to avoid unexpected results on subsequent
Bidi operations. However, the setPara()
and
setLine()
methods may modify some or all of the
levels.<br><br>
<strong>Note:</strong> the embeddingLevels
array must
have one entry for each character in text
.
- Attributes
Remarks
Perform the Unicode Bidi algorithm. It is defined in the Unicode Standard Annex #9.
This method takes a piece of plain text containing one or more paragraphs, with or without externally specified embedding levels from styled text and computes the left-right-directionality of each character.
If the entire text is all of the same directionality, then the method may not perform all the steps described by the algorithm, i.e., some levels may not be the same as if all steps were performed. This is not relevant for unidirectional text.<br> For example, in pure LTR text with numbers the numbers would get a resolved level of 2 higher than the surrounding text according to the algorithm. This implementation may set all resolved levels to the same value in such a case.
The text can be composed of multiple paragraphs. Occurrence of a block separator in the text terminates a paragraph, and whatever comes next starts a new paragraph. The exception to this rule is when a Carriage Return (CR) is followed by a Line Feed (LF). Both CR and LF are block separators, but in that case, the pair of characters is considered as terminating the preceding paragraph, and a new paragraph will be started by a character coming after the LF.
Although the text is passed here as a String
, it is stored internally as an array of characters. Therefore the documentation will refer to indexes of the characters in the text.
Java documentation for android.icu.text.Bidi.setPara(java.lang.String, byte, byte[])
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.