CartoType C++ API 7.8.2, 2022-03-25
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_char.h>
Public Member Functions | |
TChar () | |
TChar (int32_t aCode) | |
void | GetLowerCase (int32_t *aText, int32_t &aTextLength) const |
void | GetTitleCase (int32_t *aText, int32_t &aTextLength) const |
void | GetUpperCase (int32_t *aText, int32_t &aTextLength) const |
TCharCategory | Category () const |
TBidiType | BidiType () const |
int32_t | Mirrored () const |
int32_t | AccentStripped () const |
bool | IsAlphanumeric () const |
bool | IsWhitespace () const |
Static Public Member Functions | |
static bool | InWord (int32_t aCode) |
Public Attributes | |
int32_t | iCode { 0 } |
Static Public Attributes | |
static constexpr int | KMaxCaseVariantLength = 2 |
static constexpr uint32_t | KFirstFontSelector = 0xF000 |
static constexpr uint32_t | KDefaultFontSelector = 0xF0FF |
static constexpr uint32_t | KLastFontSelector = KDefaultFontSelector |
static constexpr uint32_t | KFirstBoxStyleSelector = 0xF100 |
static constexpr uint32_t | KLastBoxStyleSelector = 0xF1FE |
static constexpr uint32_t | KEndOfBox = 0xF1FF |
static constexpr uint32_t | KBaselineSelector = 0xF200 |
static constexpr uint32_t | KFirstCartoTypePrivateUseCharacter = KFirstFontSelector |
static constexpr uint32_t | KLastCartoTypePrivateUseCharacter = KBaselineSelector |
A class to provide Unicode character properties. A TChar object holds a single character encoded using its Unicode code point. Surrogates have no meaning in this context. All signed 32-bit values are valid but not all are defined as characters. Non-character values give consistent default values: for example, the uppercase version of a non-character value is the same value.
|
inline |
Create a TChar with the character code 0.
|
inline |
Construct a TChar from a Unicode code point (without checking its validity as such).
int32_t CartoType::TChar::AccentStripped | ( | ) | const |
Returns the character stripped of any accent. This function is limited at the moment and does not handle all accented characters, only a commonly used subset. It is used in fuzzy matching in text searches.
TBidiType CartoType::TChar::BidiType | ( | ) | const |
Returns the bidirectional type of a character as defined in the Unicode Standard. For characters outside the Basic Multilingual Plane (U+0000...U+FFFF) this function returns TBidiType::ON (other neutral).
TCharCategory CartoType::TChar::Category | ( | ) | const |
Returns the general category of a character as defined in the Unicode Standard. For characters outside the Basic Multilingual Plane (U+0000...U+FFFF) this function returns TCharCategoryFlag::Cn (other, not assigned).
void CartoType::TChar::GetLowerCase | ( | int32_t * | aText, |
int32_t & | aTextLength | ||
) | const |
Returns the lower-case version of a character as a sequence of one or more characters. If there is no lower-case variant this function returns the original character. For characters outside the Basic Multilingual Plane (U+0000...U+FFFF) this function returns the original character.
void CartoType::TChar::GetTitleCase | ( | int32_t * | aText, |
int32_t & | aTextLength | ||
) | const |
Returns the title-case version of a character as a sequence of one or more characters. If there is no title-case variant this function returns the original character. For characters outside the Basic Multilingual Plane (U+0000...U+FFFF) this function returns the original character.
void CartoType::TChar::GetUpperCase | ( | int32_t * | aText, |
int32_t & | aTextLength | ||
) | const |
Returns the upper-case (capital) version of a character as a sequence of one or more characters. If there is no upper-case variant this function returns the original character. For characters outside the Basic Multilingual Plane (U+0000...U+FFFF) this function returns the original character.
|
inlinestatic |
Return true if a character code is in a word. Words are defined as sequences of letters and combining marks.
bool CartoType::TChar::IsAlphanumeric | ( | ) | const |
Returns true if this character is a letter or a digit: in one of the categories Lu, Ll, Lt, Lm, Lo, Nd, Nl or No.
bool CartoType::TChar::IsWhitespace | ( | ) | const |
Returns true if this character is whitespace: in one of the categories Zs, Zl, or Zp.
int32_t CartoType::TChar::Mirrored | ( | ) | const |
Returns the mirrored version of the character; that is, the character to be displayed if the text is drawn from right to left. For example, the mirrored version of '[' is ']'. For characters outside the Basic Multilingual Plane (U+0000...U+FFFF) this function returns the original character.
int32_t CartoType::TChar::iCode { 0 } |
The Unicode code point of the character.
|
staticconstexpr |
A character to set the baseline of a box to the baseline of the current line.
|
staticconstexpr |
A private use character to select the default font.
|
staticconstexpr |
A character to mark the end of a box.
|
staticconstexpr |
The start of a range of private use characters to select box styles (background and outline).
|
staticconstexpr |
The first private use character used by CartoType.
|
staticconstexpr |
The start of a range of private use characters to select fonts.
|
staticconstexpr |
The end of a range of private use characters to select box styles (background and outline).
|
staticconstexpr |
The last private use character used by CartoType.
|
staticconstexpr |
The end of a range of private use characters to select fonts.
|
staticconstexpr |
A case variant can be no longer than this number of UTF32 characters. For example, the upper-case variant of U+00DF is 'SS' and is two characters long.