Tizen(Headless) Native API
6.0
|
Abstract Unicode Text API.
Required Header
#include <utils_i18n.h>
Overview
Unicode Script Information.
Functions | |
int | i18n_uscript_get_codes (const char *language, i18n_uscript_code_e *codes, int32_t capacity, int32_t *length) |
Gets the script codes associated with the specified language. | |
const char * | i18n_uscript_get_name (i18n_uscript_code_e script_code) |
Gets the script name for the specified script code. | |
const char * | i18n_uscript_get_short_name (i18n_uscript_code_e script_code) |
Gets the short script name for the specified script code. | |
int | i18n_uscript_get_script (i18n_uchar32 codepoint, i18n_uscript_code_e *script_code) |
Gets the script code associated with the given codepoint. | |
i18n_ubool | i18n_uscript_has_script (i18n_uchar32 codepoint, i18n_uscript_code_e script_code) |
Gets a value indicating whether the Script Extensions of the specified codepoint contain the specified script. | |
int | i18n_uscript_get_script_extensions (i18n_uchar32 codepoint, i18n_uscript_code_e *scripts, int32_t capacity, int32_t *length) |
Gets the Script Extensions for the specified codepoint. | |
int | i18n_uscript_get_sample_string (i18n_uscript_code_e script, i18n_uchar *sample, int32_t capacity, int32_t *length) |
Gets the script sample character string. | |
i18n_uscript_usage_e | i18n_uscript_get_usage (i18n_uscript_code_e script) |
Returns the script usage according to UAX #31 Unicode Identifier and Pattern Syntax. | |
i18n_ubool | i18n_uscript_is_right_to_left (i18n_uscript_code_e script) |
Gets a value indicating whether the script is written right-to-left. | |
i18n_ubool | i18n_uscript_breaks_between_letters (i18n_uscript_code_e script) |
Gets a value indicating whether the script allows line breaks between letters (excluding hyphenation). | |
i18n_ubool | i18n_uscript_is_cased (i18n_uscript_code_e script) |
Gets a value indicating whether the script case distinctions in modern usage are customary. |
Enumeration Type Documentation
enum i18n_uscript_code_e |
Constants for ISO 15924 script codes.
- Since :
- 2.4
- Enumerator:
enum i18n_uscript_usage_e |
Script usage constants. See UAX #31 Unicode Identifier and Pattern Syntax. http://www.unicode.org/reports/tr31/#Table_Candidate_Characters_for_Exclusion_from_Identifiers.
- Since :
- 6.0
- Enumerator:
Function Documentation
Gets a value indicating whether the script allows line breaks between letters (excluding hyphenation).
Such a script typically requires dictionary-based line breaking. For example, Hani and Thai.
- Since :
- 6.0
- Parameters:
-
[in] script Script code
- Returns:
- TRUE if the script allows line breaks between letters
int i18n_uscript_get_codes | ( | const char * | language, |
i18n_uscript_code_e * | codes, | ||
int32_t | capacity, | ||
int32_t * | length | ||
) |
Gets the script codes associated with the specified language.
The language is described using either locale, ISO 15924 name or ISO 15924 abbreviation. Example: If "Malayam" or "Mlym" is given, the expected result is I18N_USCRIPT_MALAYALAM. Note: To search by short or long script alias only, use i18n_uchar_get_property_value_enum() instead. That does a fast lookup with no access of the locale data.
- Since :
- 6.0
- Remarks:
- codes must be allocated before calling the function. If the required capacity is greater than the capacity of codes, then the length is set to the required capacity and I18N_ERROR_BUFFER_OVERFLOW is returned.
- Parameters:
-
[in] language The language, for which the script codes are to be retrieved [in,out] codes The array of codes associated with the specified language [in] capacity Capacity of the codes array [out] length The number of items written to the array, or the required capacity if the array's capacity is insufficient
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
I18N_ERROR_NONE Successful I18N_ERROR_INVALID_PARAMETER Invalid function parameter I18N_ERROR_OUT_OF_MEMORY Out of memory I18N_ERROR_BUFFER_OVERFLOW The supplied array codes is of insufficient capacity
const char* i18n_uscript_get_name | ( | i18n_uscript_code_e | script_code | ) |
Gets the script name for the specified script code.
Returns the long unicode script name, if there is one. Otherwise returns the 4-letter ISO 15924 script code Example: If I18N_USCRIPT_MALAYALAM is given, the expected output is "Malayam".
- Since :
- 6.0
- Parameters:
-
[in] script_code Uscript code enum
- Returns:
- long script name as given in PropertyValueAliases.txt, or the 4-letter code, or NULL if i18n_uscript_code_e is invalid
int i18n_uscript_get_sample_string | ( | i18n_uscript_code_e | script, |
i18n_uchar * | sample, | ||
int32_t | capacity, | ||
int32_t * | length | ||
) |
Gets the script sample character string.
This string normally consists of one code point but might be longer. The string is empty if the script is not encoded.
- Since :
- 6.0
- Remarks:
- sample must be allocated before calling the function. If the required capacity is greater than the capacity of sample, then the length is set to the required capacity and I18N_ERROR_BUFFER_OVERFLOW is returned.
- Parameters:
-
[in] script Script code [in,out] sample The sample string for the specified codepoint [in] capacity The number of i18n_uchar characters that sample can hold [out] length The number of i18n_uchar characters written to the string, or the required capacity if the string's capacity is insufficient
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
I18N_ERROR_NONE Successful I18N_ERROR_INVALID_PARAMETER Invalid function parameter I18N_ERROR_OUT_OF_MEMORY Out of memory I18N_ERROR_BUFFER_OVERFLOW The supplied array sample is of insufficient capacity
int i18n_uscript_get_script | ( | i18n_uchar32 | codepoint, |
i18n_uscript_code_e * | script_code | ||
) |
Gets the script code associated with the given codepoint.
If the specified codepoint is invalid, the script code returned is equal to 0. Example: If 0x0D02 is given, the expected output is I18N_USCRIPT_MALAYALAM.
- Since :
- 6.0
- Parameters:
-
[in] codepoint i18n_uchar32 codepoint [out] script_code The code of the script, that the specified codepoint belongs to.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
I18N_ERROR_NONE Successful I18N_ERROR_INVALID_PARAMETER Invalid function parameter I18N_ERROR_OUT_OF_MEMORY Out of memory
int i18n_uscript_get_script_extensions | ( | i18n_uchar32 | codepoint, |
i18n_uscript_code_e * | scripts, | ||
int32_t | capacity, | ||
int32_t * | length | ||
) |
Gets the Script Extensions for the specified codepoint.
- If codepoint does have Script Extensions, then the Script property value (normally Common or Inherited) is not included.
- If codepoint does not have Script Extensions, then the one Script code is written to the output array.
- If codepoint is not a valid code point, then the one I18N_USCRIPT_UNKNOWN code is written.
Some characters are commonly used in multiple scripts. For more information, see UAX #24: http://www.unicode.org/reports/tr24/.
- Since :
- 6.0
- Remarks:
- scripts must be allocated before calling the function. If the required capacity is greater than the capacity of scripts, then the length is set to the required capacity and I18N_ERROR_BUFFER_OVERFLOW is returned.
- Parameters:
-
[in] codepoint Code point [in,out] scripts The array of Script Extensions for the specified codepoint [in] capacity Capacity of the scripts array [out] length The number of items written to the array, or the required capacity if the array's capacity is insufficient
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
I18N_ERROR_NONE Successful I18N_ERROR_INVALID_PARAMETER Invalid function parameter I18N_ERROR_OUT_OF_MEMORY Out of memory I18N_ERROR_BUFFER_OVERFLOW The supplied array scripts is of insufficient capacity
const char* i18n_uscript_get_short_name | ( | i18n_uscript_code_e | script_code | ) |
Gets the short script name for the specified script code.
Returns the 4-letter ISO 15924 script code, which is the same as the short Unicode script name if Unicode has names for the script. Example: If I18N_USCRIPT_MALAYALAM is given, the expected output is "Mlym".
- Since :
- 6.0
- Parameters:
-
[in] script_code Uscript code enum
- Returns:
- short script name (4-letter code), or NULL if script_code is invalid
Returns the script usage according to UAX #31 Unicode Identifier and Pattern Syntax.
Returns I18N_USCRIPT_USAGE_NOT_ENCODED if the script is not encoded in Unicode.
- Since :
- 6.0
- Parameters:
-
[in] script Script code
- Returns:
- script usage
i18n_ubool i18n_uscript_has_script | ( | i18n_uchar32 | codepoint, |
i18n_uscript_code_e | script_code | ||
) |
Gets a value indicating whether the Script Extensions of the specified codepoint contain the specified script.
If codepoint does not have explicit Script Extensions, then this tests whether codepoint has the Script property value script_code. Some characters are commonly used in multiple scripts. For more information, see UAX #24: http://www.unicode.org/reports/tr24/.
- Since :
- 6.0
- Parameters:
-
[in] codepoint Code point [in] script_code Script code
- Returns:
- TRUE if script_code is in Script Extensions (codepoint)
Gets a value indicating whether the script case distinctions in modern usage are customary.
For example, Latn and Cyrl.
- Since :
- 6.0
- Parameters:
-
[in] script Script code
- Returns:
- TRUE if the script is cased
Gets a value indicating whether the script is written right-to-left.
For example, Arab and Hebr.
- Since :
- 6.0
- Parameters:
-
[in] script Script code
- Returns:
- TRUE if the script is right-to-left