Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions
SkShaper_skunicode.cpp File Reference
#include "include/core/SkRefCnt.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkDebug.h"
#include "include/private/base/SkTFitsIn.h"
#include "modules/skshaper/include/SkShaper.h"
#include "modules/skshaper/include/SkShaper_skunicode.h"
#include "modules/skunicode/include/SkUnicode.h"
#include "src/base/SkUTF.h"
#include <cstddef>
#include <cstdint>
#include <memory>
#include <utility>

Go to the source code of this file.

Classes

class  SkUnicodeBidiRunIterator
 

Namespaces

namespace  SkShapers
 
namespace  SkShapers::unicode
 

Typedefs

using SkUnicodeBidi = std::unique_ptr< SkBidiIterator >
 

Functions

static SkUnichar utf8_next (const char **ptr, const char *end)
 
sk_sp< SkUnicodeget_unicode ()
 
SKSHAPER_API std::unique_ptr< SkShaper::BiDiRunIteratorSkShapers::unicode::BidiRunIterator (sk_sp< SkUnicode > unicode, const char *utf8, size_t utf8Bytes, uint8_t bidiLevel)
 

Typedef Documentation

◆ SkUnicodeBidi

using SkUnicodeBidi = std::unique_ptr<SkBidiIterator>

Definition at line 21 of file SkShaper_skunicode.cpp.

Function Documentation

◆ get_unicode()

sk_sp< SkUnicode > get_unicode ( )

Definition at line 89 of file SkShaper_skunicode.cpp.

89 {
90#if defined(SK_UNICODE_ICU_IMPLEMENTATION)
91 if (auto unicode = SkUnicodes::ICU::Make()) {
92 return unicode;
93 }
94#endif // defined(SK_UNICODE_ICU_IMPLEMENTATION)
95#if defined(SK_UNICODE_LIBGRAPHEME_IMPLEMENTATION)
96 if (auto unicode = SkUnicodes::Libgrapheme::Make()) {
97 return unicode;
98 }
99#endif
100#if defined(SK_UNICODE_ICU4X_IMPLEMENTATION)
101 if (auto unicode = SkUnicodes::ICU4X::Make()) {
102 return unicode;
103 }
104#endif
105 return nullptr;
106}
SKUNICODE_API sk_sp< SkUnicode > Make()
SKUNICODE_API sk_sp< SkUnicode > Make()
SKUNICODE_API sk_sp< SkUnicode > Make()

◆ utf8_next()

static SkUnichar utf8_next ( const char **  ptr,
const char *  end 
)
inlinestatic

Replaces invalid utf-8 sequences with REPLACEMENT CHARACTER U+FFFD.

Definition at line 24 of file SkShaper_skunicode.cpp.

24 {
25 SkUnichar val = SkUTF::NextUTF8(ptr, end);
26 return val < 0 ? 0xFFFD : val;
27}
int32_t SkUnichar
Definition SkTypes.h:175
glong glong end
SK_SPI SkUnichar NextUTF8(const char **ptr, const char *end)
Definition SkUTF.cpp:118