17const char kFontResource[] =
"fonts/ahem.ttf";
18const char kTtcResource[] =
"fonts/test.ttc";
19const char kVariableResource[] =
"fonts/test_glyphs-glyf_colr_1_variable.ttf";
20constexpr size_t kNumVariableAxes = 44;
22struct AxisExpectation {
27} axisExpectations[] = {
83 char notAnSfnt[] =
"I_AM_NOT_AN_SFNT";
84 std::unique_ptr<SkStreamAsset> notSfntStream =
105 args.setCollectionIndex(1);
113 args.setCollectionIndex(1000);
120 constexpr size_t kNameTableSize = 11310;
121 constexpr size_t kTestOffset = 1310;
122 constexpr size_t kTestLength = 500;
123 char destBuffer[kNameTableSize] = {0};
131 testTypeface->
getTableData(nameTableTag, 0, kNameTableSize,
nullptr) ==
135 testTypeface->
getTableData(nameTableTag, 0, kNameTableSize, destBuffer) ==
140 testTypeface->
getTableData(nameTableTag, 0, kTestLength, destBuffer) == kTestLength);
143 nameTableTag, kTestOffset, kTestLength, destBuffer) == kTestLength);
147 testTypeface->
getTableData(nameTableTag, kTestOffset, kNameTableSize, destBuffer) ==
148 kNameTableSize - kTestOffset);
153 nameTableTag, kNameTableSize, kNameTableSize, destBuffer) == 0);
155 testTypeface->
getTableData(nameTableTag, kNameTableSize, 0,
nullptr) == 0);
159 nameTableTag, kNameTableSize - 1, kNameTableSize, destBuffer) == 1);
162 testTypeface->
getTableData(nameTableTag, 0, kNameTableSize + 10, destBuffer) ==
166 testTypeface->
getTableData(nameTableTag, 0, kTestLength,
nullptr) ==
171 testTypeface->
getTableData(nonExistantTag, 0, kNameTableSize, destBuffer) ==
174 testTypeface->
getTableData(nonExistantTag, 0, 0,
nullptr) ==
177 testTypeface->
getTableData(nonExistantTag, kTestOffset, 0,
nullptr) == 0);
181 constexpr size_t kNumTags = 11;
209 kSwpsCoordinateFirst, kSwpsCoordinateSecond, kSwpeCoordinate, kInvalidCoordinate};
226 const int retrievedClonedNumAxes =
229 "retrievedClonedNumAxes: %d", retrievedClonedNumAxes);
231 retrieveCoordinates[0].axis == kSwpsCoordinateSecond.
axis &&
232 retrieveCoordinates[0].
value == kSwpsCoordinateSecond.
value);
234 retrieveCoordinates[1].axis == kSwpeCoordinate.
axis &&
235 retrieveCoordinates[1].
value == kSwpeCoordinate.
value);
249 for (
size_t i = 0;
i < kNumVariableAxes; ++
i) {
263 constexpr size_t kArrayTooSmall = 3;
DEF_TEST(Fontations_DoNotMakeFromNull, reporter)
std::unique_ptr< SkStreamAsset > GetResourceAsStream(const char *resource, bool useFileStream)
SK_API sk_sp< SkTypeface > SkTypeface_Make_Fontations(std::unique_ptr< SkStreamAsset > fontData, const SkFontArguments &args)
static constexpr SkFourByteTag SkSetFourByteTag(char a, char b, char c, char d)
#define REPORTER_ASSERT(r, cond,...)
static std::unique_ptr< SkMemoryStream > MakeDirect(const void *data, size_t length)
int getVariationDesignParameters(SkFontParameters::Variation::Axis parameters[], int parameterCount) const
int getTableTags(SkFontTableTag tags[]) const
int getVariationDesignPosition(SkFontArguments::VariationPosition::Coordinate coordinates[], int coordinateCount) const
size_t getTableData(SkFontTableTag tag, size_t offset, size_t length, void *data) const
sk_sp< SkTypeface > makeClone(const SkFontArguments &) const
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
static float max(float r, float g, float b)
static float min(float r, float g, float b)
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
const Coordinate * coordinates