-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[base-dir] Add a function to get the base direction of a text
This is a lightweight function equivalent to ICU's ubidi_getBaseDirection, which just determines the base direction of a piece of text. This is intended for use when the caller just wants the base directionality, and no further bidi processing will be required. Returns Direction::Ltr or Direction::Rtl according to the first strong character (bidi type L, R, or AL) found in the text (outside of isolate embeddings). If no strong character is found, returns Direction::Mixed (meaning Neutral in this context, but to avoid breaking API compatibility I didn't want to add a Neutral value to the Direction enum, and creating a new BaseDirection enum here seemed like overkill).
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters