CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_char.h>
Public Member Functions | |
Char () | |
Char (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 |
CharCategory | Category () const |
CartoTypeCore::BidiType | 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 | Code { 0 } |
Static Public Attributes | |
static constexpr int | KMaxCaseVariantLength = 2 |
static constexpr uint32_t | KFirstFontSelector = 0xF000 |
static constexpr uint32_t | KDefaultFontSelector = 0xF3FF |
static constexpr uint32_t | KLastFontSelector = KDefaultFontSelector |
static constexpr uint32_t | KFontSelectorCount = KLastFontSelector - KFirstFontSelector |
static constexpr uint32_t | KFirstBoxStyleSelector = 0xF400 |
static constexpr uint32_t | KLastBoxStyleSelector = 0xF7FE |
static constexpr uint32_t | KBoxStyleSelectorCount = KLastBoxStyleSelector - KFirstBoxStyleSelector + 1 |
static constexpr uint32_t | KEndOfBox = 0xF7FF |
static constexpr uint32_t | KBaselineSelector = 0xF800 |
static constexpr uint32_t | KFirstCartoTypePrivateUseCharacter = KFirstFontSelector |
static constexpr uint32_t | KLastCartoTypePrivateUseCharacter = KBaselineSelector |
A class to provide Unicode character properties. A Char 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 Char with the character code 0.
|
inline |
Construct a Char from a Unicode code point (without checking its validity as such).
int32_t CartoTypeCore::Char::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.
BidiType CartoTypeCore::Char::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 BidiType::ON (other neutral).
CharCategory CartoTypeCore::Char::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 CharCategoryFlag::Cn (other, not assigned).
void CartoTypeCore::Char::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 CartoTypeCore::Char::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 CartoTypeCore::Char::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 CartoTypeCore::Char::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 CartoTypeCore::Char::IsWhitespace | ( | ) | const |
Returns true if this character is whitespace: in one of the categories Zs, Zl, or Zp.
int32_t CartoTypeCore::Char::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 CartoTypeCore::Char::Code { 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 |
The number of box style selectors.
|
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 CartoTypeCore.
|
staticconstexpr |
The start of a range of private use characters to select fonts.
|
staticconstexpr |
The number of font selectors, excluding the default font selector.
|
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 CartoTypeCore.
|
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.