Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Member Functions | List of all members
SkShaper Class Referenceabstract

#include <SkShaper.h>

Inheritance diagram for SkShaper:
SkShaperPrimitive SkShaper_CoreText

Classes

class  BiDiRunIterator
 
struct  Feature
 
class  FontRunIterator
 
class  LanguageRunIterator
 
class  RunHandler
 
class  RunIterator
 
class  ScriptRunIterator
 
class  TrivialBiDiRunIterator
 
class  TrivialFontRunIterator
 
class  TrivialLanguageRunIterator
 
class  TrivialScriptRunIterator
 

Public Member Functions

 SkShaper ()
 
virtual ~SkShaper ()
 
virtual void shape (const char *utf8, size_t utf8Bytes, const SkFont &srcFont, bool leftToRight, SkScalar width, RunHandler *) const =0
 
virtual void shape (const char *utf8, size_t utf8Bytes, FontRunIterator &, BiDiRunIterator &, ScriptRunIterator &, LanguageRunIterator &, SkScalar width, RunHandler *) const =0
 
virtual void shape (const char *utf8, size_t utf8Bytes, FontRunIterator &, BiDiRunIterator &, ScriptRunIterator &, LanguageRunIterator &, const Feature *features, size_t featuresSize, SkScalar width, RunHandler *) const =0
 

Static Public Member Functions

static std::unique_ptr< SkShaperMakePrimitive ()
 
static std::unique_ptr< SkShaperMake (sk_sp< SkFontMgr > fallback=nullptr)
 
static void PurgeCaches ()
 
static std::unique_ptr< FontRunIteratorMakeFontMgrRunIterator (const char *utf8, size_t utf8Bytes, const SkFont &font, sk_sp< SkFontMgr > fallback)
 
static std::unique_ptr< SkShaper::FontRunIteratorMakeFontMgrRunIterator (const char *utf8, size_t utf8Bytes, const SkFont &font, sk_sp< SkFontMgr > fallback, const char *requestName, SkFontStyle requestStyle, const SkShaper::LanguageRunIterator *)
 
static std::unique_ptr< BiDiRunIteratorMakeBiDiRunIterator (const char *utf8, size_t utf8Bytes, uint8_t bidiLevel)
 
static std::unique_ptr< ScriptRunIteratorMakeScriptRunIterator (const char *utf8, size_t utf8Bytes, SkFourByteTag script)
 
static std::unique_ptr< LanguageRunIteratorMakeStdLanguageRunIterator (const char *utf8, size_t utf8Bytes)
 

Detailed Description

Definition at line 52 of file SkShaper.h.

Constructor & Destructor Documentation

◆ SkShaper()

SkShaper::SkShaper ( )

Definition at line 80 of file SkShaper.cpp.

80{}

◆ ~SkShaper()

SkShaper::~SkShaper ( )
virtual

Definition at line 81 of file SkShaper.cpp.

81{}

Member Function Documentation

◆ Make()

std::unique_ptr< SkShaper > SkShaper::Make ( sk_sp< SkFontMgr fallback = nullptr)
static

Definition at line 36 of file SkShaper.cpp.

36 {
37#if defined(SK_SHAPER_HARFBUZZ_AVAILABLE) && defined(SK_SHAPER_UNICODE_AVAILABLE)
38 std::unique_ptr<SkShaper> shaper = MakeShapeThenWrap(std::move(fallback));
39 if (shaper) {
40 return shaper;
41 }
42#elif defined(SK_SHAPER_CORETEXT_AVAILABLE)
43 if (auto shaper = SkShapers::CT::CoreText()) {
44 return shaper;
45 }
46#endif
48}
SKSHAPER_API std::unique_ptr< SkShaper > CoreText()
SKSHAPER_API std::unique_ptr< SkShaper > PrimitiveText()
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port fallback
Definition: switches.h:154

◆ MakeBiDiRunIterator()

std::unique_ptr< SkShaper::BiDiRunIterator > SkShaper::MakeBiDiRunIterator ( const char *  utf8,
size_t  utf8Bytes,
uint8_t  bidiLevel 
)
static

Definition at line 57 of file SkShaper.cpp.

57 {
58#if defined(SK_SHAPER_UNICODE_AVAILABLE)
59 std::unique_ptr<SkShaper::BiDiRunIterator> bidi = MakeIcuBiDiRunIterator(utf8, utf8Bytes, bidiLevel);
60 if (bidi) {
61 return bidi;
62 }
63#endif
64 return std::make_unique<SkShaper::TrivialBiDiRunIterator>(bidiLevel, utf8Bytes);
65}

◆ MakeFontMgrRunIterator() [1/2]

std::unique_ptr< SkShaper::FontRunIterator > SkShaper::MakeFontMgrRunIterator ( const char *  utf8,
size_t  utf8Bytes,
const SkFont font,
sk_sp< SkFontMgr fallback 
)
static

Definition at line 187 of file SkShaper.cpp.

189{
190 return std::make_unique<FontMgrRunIterator>(utf8, utf8Bytes, font, std::move(fallback));
191}
font
Font Metadata and Metrics.

◆ MakeFontMgrRunIterator() [2/2]

std::unique_ptr< SkShaper::FontRunIterator > SkShaper::MakeFontMgrRunIterator ( const char *  utf8,
size_t  utf8Bytes,
const SkFont font,
sk_sp< SkFontMgr fallback,
const char *  requestName,
SkFontStyle  requestStyle,
const SkShaper::LanguageRunIterator language 
)
static

Definition at line 194 of file SkShaper.cpp.

198{
199 return std::make_unique<FontMgrRunIterator>(utf8, utf8Bytes, font, std::move(fallback),
200 requestName, requestStyle, language);
201}

◆ MakePrimitive()

std::unique_ptr< SkShaper > SkShaper::MakePrimitive ( )
static

Definition at line 250 of file SkShaper_primitive.cpp.

◆ MakeScriptRunIterator()

std::unique_ptr< SkShaper::ScriptRunIterator > SkShaper::MakeScriptRunIterator ( const char *  utf8,
size_t  utf8Bytes,
SkFourByteTag  script 
)
static

Definition at line 68 of file SkShaper.cpp.

68 {
69#if defined(SK_SHAPER_HARFBUZZ_AVAILABLE) && defined(SK_SHAPER_UNICODE_AVAILABLE)
70 std::unique_ptr<SkShaper::ScriptRunIterator> script =
71 SkShapers::HB::ScriptRunIterator(utf8, utf8Bytes, scriptTag);
72 if (script) {
73 return script;
74 }
75#endif
76 return std::make_unique<SkShaper::TrivialScriptRunIterator>(scriptTag, utf8Bytes);
77}
SKSHAPER_API std::unique_ptr< SkShaper::ScriptRunIterator > ScriptRunIterator(const char *utf8, size_t utf8Bytes)

◆ MakeStdLanguageRunIterator()

std::unique_ptr< SkShaper::LanguageRunIterator > SkShaper::MakeStdLanguageRunIterator ( const char *  utf8,
size_t  utf8Bytes 
)
static

Definition at line 204 of file SkShaper.cpp.

204 {
205 return std::make_unique<TrivialLanguageRunIterator>(std::locale().name().c_str(), utf8Bytes);
206}
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ PurgeCaches()

void SkShaper::PurgeCaches ( )
static

Definition at line 50 of file SkShaper.cpp.

50 {
51#if defined(SK_SHAPER_HARFBUZZ_AVAILABLE) && defined(SK_SHAPER_UNICODE_AVAILABLE)
53#endif
54}
SKSHAPER_API void PurgeCaches()

◆ shape() [1/3]

virtual void SkShaper::shape ( const char *  utf8,
size_t  utf8Bytes,
const SkFont srcFont,
bool  leftToRight,
SkScalar  width,
RunHandler  
) const
pure virtual

◆ shape() [2/3]

virtual void SkShaper::shape ( const char *  utf8,
size_t  utf8Bytes,
FontRunIterator ,
BiDiRunIterator ,
ScriptRunIterator ,
LanguageRunIterator ,
const Feature features,
size_t  featuresSize,
SkScalar  width,
RunHandler  
) const
pure virtual

◆ shape() [3/3]

virtual void SkShaper::shape ( const char *  utf8,
size_t  utf8Bytes,
FontRunIterator ,
BiDiRunIterator ,
ScriptRunIterator ,
LanguageRunIterator ,
SkScalar  width,
RunHandler  
) const
pure virtual

The documentation for this class was generated from the following files: