53 if (hb_in_range<hb_codepoint_t> (
c, 0xC2u, 0xDFu))
57 (
t1 =
text[0] - 0x80u) <= 0x3Fu))
59 c = ((
c&0x1Fu)<<6) |
t1;
65 else if (hb_in_range<hb_codepoint_t> (
c, 0xE0u, 0xEFu))
69 (
t1 =
text[0] - 0x80u) <= 0x3Fu &&
70 (
t2 =
text[1] - 0x80u) <= 0x3Fu))
72 c = ((
c&0xFu)<<12) | (
t1<<6) |
t2;
73 if (
unlikely (
c < 0x0800u || hb_in_range<hb_codepoint_t> (
c, 0xD800u, 0xDFFFu)))
80 else if (hb_in_range<hb_codepoint_t> (
c, 0xF0u, 0xF4u))
84 (
t1 =
text[0] - 0x80u) <= 0x3Fu &&
85 (
t2 =
text[1] - 0x80u) <= 0x3Fu &&
86 (
t3 =
text[2] - 0x80u) <= 0x3Fu))
88 c = ((
c&0x7u)<<18) | (
t1<<12) | (
t2<<6) |
t3;
89 if (
unlikely (!hb_in_range<hb_codepoint_t> (
c, 0x10000u, 0x10FFFFu)))
104 *unicode = replacement;
121 *unicode = replacement;
132 if (unicode < 0x0080u)
return 1;
133 if (unicode < 0x0800u)
return 2;
134 if (unicode < 0x10000u)
return 3;
135 if (unicode < 0x110000u)
return 4;
144 if (
unlikely (unicode >= 0xD800u && (unicode <= 0xDFFFu || unicode > 0x10FFFFu)))
146 if (unicode < 0x0080u)
148 else if (unicode < 0x0800u)
152 *
text++ = 0xC0u + (0x1Fu & (unicode >> 6));
153 *
text++ = 0x80u + (0x3Fu & (unicode ));
156 else if (unicode < 0x10000u)
160 *
text++ = 0xE0u + (0x0Fu & (unicode >> 12));
161 *
text++ = 0x80u + (0x3Fu & (unicode >> 6));
162 *
text++ = 0x80u + (0x3Fu & (unicode ));
169 *
text++ = 0xF0u + (0x07u & (unicode >> 18));
170 *
text++ = 0x80u + (0x3Fu & (unicode >> 12));
171 *
text++ = 0x80u + (0x3Fu & (unicode >> 6));
172 *
text++ = 0x80u + (0x3Fu & (unicode ));
180 template <
typename TCodepo
int>
183 static_assert (
sizeof (TCodepoint) == 2,
"");
194 if (
likely (!hb_in_range<hb_codepoint_t> (
c, 0xD800u, 0xDFFFu)))
204 if (
likely (hb_in_range<hb_codepoint_t> (
l, 0xDC00u, 0xDFFFu)))
207 *unicode = (
c << 10) +
l - ((0xD800u << 10) - 0x10000u + 0xDC00u);
214 *unicode = replacement;
226 if (
likely (!hb_in_range<hb_codepoint_t> (
c, 0xD800u, 0xDFFFu)))
236 if (
likely (hb_in_range<hb_codepoint_t> (
h, 0xD800u, 0xDBFFu)))
239 *unicode = (
h << 10) +
c - ((0xD800u << 10) - 0x10000u + 0xDC00u);
246 *unicode = replacement;
262 return unicode < 0x10000 ? 1 : 2;
270 if (
unlikely (unicode >= 0xD800u && (unicode <= 0xDFFFu || unicode > 0x10FFFFu)))
272 if (unicode < 0x10000u)
277 *
text++ = 0xD800u + (unicode >> 10);
278 *
text++ = 0xDC00u + (unicode & 0x03FFu);
288 template <
typename TCodepo
int,
bool val
idate=true>
291 static_assert (
sizeof (TCodepoint) == 4,
"");
294 static const TCodepoint *
302 *unicode = replacement;
306 static const TCodepoint *
314 *unicode = replacement;
337 if (validate &&
unlikely (unicode >= 0xD800u && (unicode <= 0xDFFFu || unicode > 0x10FFFFu)))
410 if (*unicode >= 0x0080u)
411 *unicode = replacement;
422 if (*unicode >= 0x0080u)
423 *unicode = replacement;
void const void *obj HB_UNUSED
hb_utf32_xe_t< uint32_t > hb_utf32_t
hb_utf32_xe_t< uint32_t, false > hb_utf32_novalidate_t
hb_utf16_xe_t< uint16_t > hb_utf16_t
hb_utf16_xe_t< OT::HBUINT16 > hb_utf16_be_t
PCRE2_SIZE PRIV() strlen(PCRE2_SPTR str)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
[4]
GLfloat GLfloat GLfloat GLfloat h
static const codepoint_t * prev(const codepoint_t *text, const codepoint_t *start HB_UNUSED, hb_codepoint_t *unicode, hb_codepoint_t replacement)
static const codepoint_t * next(const codepoint_t *text, const codepoint_t *end HB_UNUSED, hb_codepoint_t *unicode, hb_codepoint_t replacement HB_UNUSED)
static unsigned int encode_len(hb_codepoint_t unicode HB_UNUSED)
static codepoint_t * encode(codepoint_t *text, const codepoint_t *end HB_UNUSED, hb_codepoint_t unicode)
static unsigned int strlen(const codepoint_t *text)
static const codepoint_t * prev(const codepoint_t *text, const codepoint_t *start HB_UNUSED, hb_codepoint_t *unicode, hb_codepoint_t replacement HB_UNUSED)
static codepoint_t * encode(codepoint_t *text, const codepoint_t *end HB_UNUSED, hb_codepoint_t unicode)
static const codepoint_t * next(const codepoint_t *text, const codepoint_t *end HB_UNUSED, hb_codepoint_t *unicode, hb_codepoint_t replacement HB_UNUSED)
static unsigned int encode_len(hb_codepoint_t unicode HB_UNUSED)
static unsigned int strlen(const codepoint_t *text)
static const codepoint_t * prev(const codepoint_t *text, const codepoint_t *start, hb_codepoint_t *unicode, hb_codepoint_t replacement)
static codepoint_t * encode(codepoint_t *text, const codepoint_t *end, hb_codepoint_t unicode)
static unsigned int strlen(const codepoint_t *text)
static const codepoint_t * next(const codepoint_t *text, const codepoint_t *end, hb_codepoint_t *unicode, hb_codepoint_t replacement)
static unsigned int encode_len(hb_codepoint_t unicode)
static unsigned int strlen(const TCodepoint *text)
static const TCodepoint * prev(const TCodepoint *text, const TCodepoint *start HB_UNUSED, hb_codepoint_t *unicode, hb_codepoint_t replacement)
static const TCodepoint * next(const TCodepoint *text, const TCodepoint *end HB_UNUSED, hb_codepoint_t *unicode, hb_codepoint_t replacement)
static unsigned int encode_len(hb_codepoint_t unicode HB_UNUSED)
static codepoint_t * encode(codepoint_t *text, const codepoint_t *end HB_UNUSED, hb_codepoint_t unicode)
static codepoint_t * encode(codepoint_t *text, const codepoint_t *end, hb_codepoint_t unicode)
static const codepoint_t * prev(const codepoint_t *text, const codepoint_t *start, hb_codepoint_t *unicode, hb_codepoint_t replacement)
static unsigned int encode_len(hb_codepoint_t unicode)
static unsigned int strlen(const codepoint_t *text)
static const codepoint_t * next(const codepoint_t *text, const codepoint_t *end, hb_codepoint_t *unicode, hb_codepoint_t replacement)