63 {
64 FcConfig* config = build_fontconfig_with_fontfile("/fonts/Distortable.ttf");
65
68 if (!typeface) {
69 ERRORF(
reporter,
"Could not find typeface. FcVersion: %d", FcGetVersion());
70 return;
71 }
72
77
82
85
86 constexpr float kTextSize = 20;
87
88 std::unique_ptr<SkStreamAsset> distortableStream(
90 if (!distortableStream) {
91 return;
92 }
93
96
97 for (
int i = 0;
i < 10; ++
i) {
101 coordinates[] = {{tag, styleValue}};
103 position = {coordinates,
std::size(coordinates)};
104
108 kTextSize);
110
112 typeface->makeClone(
SkFontArguments().setVariationDesignPosition(position)), kTextSize);
114
115 constexpr char text[] =
"abc";
116
118 canvasStream.drawString(
text, point.
fX, point.
fY, fontStream,
paint);
119
121 canvasClone.drawString(
text, point.
fX, point.
fY, fontClone,
paint);
122
125 }
126}
static bool bitmap_compare(const SkBitmap &ref, const SkBitmap &test)
std::unique_ptr< SkStreamAsset > GetResourceAsStream(const char *resource, bool useFileStream)
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorWHITE
SK_API sk_sp< SkFontMgr > SkFontMgr_New_FontConfig(FcConfig *fc)
#define SkDoubleToScalar(x)
static constexpr SkFourByteTag SkSetFourByteTag(char a, char b, char c, char d)
#define REPORTER_ASSERT(r, cond,...)
void allocN32Pixels(int width, int height, bool isOpaque=false)
sk_sp< SkTypeface > makeFromStream(std::unique_ptr< SkStreamAsset >, int ttcIndex=0) const
sk_sp< SkTypeface > legacyMakeTypeface(const char familyName[], SkFontStyle style) const
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
sk_sp< SkFontMgr > fontMgr
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
static constexpr SkPoint Make(float x, float y)