29#if defined(SK_SHAPER_CORETEXT_AVAILABLE)
33#if defined(SK_SHAPER_HARFBUZZ_AVAILABLE)
37#if defined(SK_UNICODE_ICU_IMPLEMENTATION)
41#if defined(SK_UNICODE_LIBGRAPHEME_IMPLEMENTATION)
45#if defined(SK_UNICODE_ICU4X_IMPLEMENTATION)
52 "When in the Course of human events it becomes necessary for one people "
53 "to dissolve the political bands which have connected them with another "
54 "and to assume among the powers of the earth, the separate and equal "
55 "station to which the Laws of Nature and of Nature's God entitle them, "
56 "a decent respect to the opinions of mankind requires that they should "
57 "declare the causes which impel them to the separation.";
61#if defined(SK_UNICODE_ICU_IMPLEMENTATION)
66#if defined(SK_UNICODE_LIBGRAPHEME_IMPLEMENTATION)
71#if defined(SK_UNICODE_ICU4X_IMPLEMENTATION)
91 return std::make_unique<SkShaper::TrivialBiDiRunIterator>(bidiLevel, utf8Bytes);
94#if defined(SK_SHAPER_HARFBUZZ_AVAILABLE) && defined(SK_SHAPER_UNICODE_AVAILABLE)
108 return std::make_unique<SkShaper::TrivialScriptRunIterator>(scriptTag, utf8Bytes);
111#if defined(SK_SHAPER_HARFBUZZ_AVAILABLE) && defined(SK_SHAPER_UNICODE_AVAILABLE)
112static std::unique_ptr<SkShaper::ScriptRunIterator> make_harfbuzz_script_runner(
114 std::unique_ptr<SkShaper::ScriptRunIterator>
script =
119 return std::make_unique<SkShaper::TrivialScriptRunIterator>(scriptTag, utf8Bytes);
129 : fShaper(fact()), fBidiCallback(bidi), fScriptRunCallback(
script) {
160 for (
int i = 9;
i < 24;
i += 2) {
161#if defined(SK_SHAPER_HARFBUZZ_AVAILABLE) && defined(SK_SHAPER_UNICODE_AVAILABLE)
167 srcFont.setSubpixel(
true);
170 size_t utf8Bytes =
sizeof(
gText) - 1;
173 std::unique_ptr<SkShaper::BiDiRunIterator> bidi =
179 std::unique_ptr<SkShaper::LanguageRunIterator> language(
186 std::unique_ptr<SkShaper::ScriptRunIterator>
script =
187 fScriptRunCallback(
utf8, utf8Bytes, undeterminedScript);
192 std::unique_ptr<SkShaper::FontRunIterator>
font(
221 std::unique_ptr<SkShaper> fShaper;
231#if defined(SK_SHAPER_CORETEXT_AVAILABLE)
238#if defined(SK_SHAPER_HARFBUZZ_AVAILABLE) && defined(SK_SHAPER_UNICODE_AVAILABLE)
245 make_harfbuzz_script_runner,
256 const char text[] =
"world";
259 this->drawTest(canvas,
266#if defined(SK_SHAPER_CORETEXT_AVAILABLE)
267 this->drawTest(canvas,
275#if defined(SK_SHAPER_HARFBUZZ_AVAILABLE) && defined(SK_SHAPER_UNICODE_AVAILABLE)
283 make_harfbuzz_script_runner);
293 std::unique_ptr<SkShaper> shaper,
302 srcFont.setSubpixel(
true);
304 size_t len = strlen(str);
307 std::unique_ptr<SkShaper::BiDiRunIterator> bidi =
313 std::unique_ptr<SkShaper::LanguageRunIterator> language(
320 std::unique_ptr<SkShaper::ScriptRunIterator>
script(
321 scriptRunCallback(str,
len, undeterminedScript));
326 std::unique_ptr<SkShaper::FontRunIterator>
font(
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
sk_sp< SkUnicode > get_unicode()
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
static constexpr SkFourByteTag SkSetFourByteTag(char a, char b, char c, char d)
DEF_SLIDE(return new TextBoxSlide(SkShapers::Primitive::PrimitiveText, make_trivial_bidi, make_trivial_script_runner, "primitive");)
static std::unique_ptr< SkShaper::ScriptRunIterator > make_trivial_script_runner(const char *, size_t utf8Bytes, SkFourByteTag scriptTag)
std::unique_ptr< SkShaper >(* ShaperFactory)()
static std::unique_ptr< SkShaper::BiDiRunIterator > make_trivial_bidi(sk_sp< SkUnicode >, const char *, size_t utf8Bytes, uint8_t bidiLevel)
static const char gText[]
std::unique_ptr< SkShaper::BiDiRunIterator >(*)(sk_sp< SkUnicode > unicode, const char *utf8, size_t utf8Bytes, uint8_t bidiLevel) MakeBidiIteratorCallback
std::unique_ptr< SkShaper::ScriptRunIterator >(*)(const char *utf8, size_t utf8Bytes, SkFourByteTag script) MakeScriptRunCallback
void draw(SkCanvas *canvas) override
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
static sk_sp< SkFontMgr > RefEmpty()
static constexpr SkFontStyle Bold()
void setSize(SkScalar textSize)
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
static std::unique_ptr< FontRunIterator > MakeFontMgrRunIterator(const char *utf8, size_t utf8Bytes, const SkFont &font, sk_sp< SkFontMgr > fallback)
static std::unique_ptr< LanguageRunIterator > MakeStdLanguageRunIterator(const char *utf8, size_t utf8Bytes)
void draw(SkCanvas *canvas) override
void load(SkScalar w, SkScalar h) override
void resize(SkScalar w, SkScalar h) override
TextBoxSlide(ShaperFactory fact, MakeBidiIteratorCallback bidi, MakeScriptRunCallback script, const char suffix[])
SKSHAPER_API std::unique_ptr< SkShaper > CoreText()
SKSHAPER_API std::unique_ptr< SkShaper > ShaperDrivenWrapper(sk_sp< SkUnicode > unicode, sk_sp< SkFontMgr > fallback)
SKSHAPER_API void PurgeCaches()
SKSHAPER_API std::unique_ptr< SkShaper::ScriptRunIterator > ScriptRunIterator(const char *utf8, size_t utf8Bytes)
SKSHAPER_API std::unique_ptr< SkShaper > PrimitiveText()
SKSHAPER_API std::unique_ptr< SkShaper::BiDiRunIterator > BidiRunIterator(sk_sp< SkUnicode > unicode, const char *utf8, size_t utf8Bytes, uint8_t bidiLevel)
SKUNICODE_API sk_sp< SkUnicode > Make()
SKUNICODE_API sk_sp< SkUnicode > Make()
SKUNICODE_API sk_sp< SkUnicode > Make()
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
font
Font Metadata and Metrics.
static constexpr SkRect MakeWH(float w, float h)