void onDraw(SkCanvas* canvas) override { SkPaint paint; paint.setAntiAlias(true); paint.setLCDRenderText(true); paint.setSubpixelText(true); paint.setTextSize(17); static const char* gNames[] = { "Helvetica Neue", "Arial" }; SkAutoTUnref<SkFontStyleSet> fset; for (size_t i = 0; i < SK_ARRAY_COUNT(gNames); ++i) { fset.reset(fFM->matchFamily(gNames[i])); if (fset->count() > 0) { break; } } if (nullptr == fset.get()) { return; } canvas->translate(20, 40); this->exploreFamily(canvas, paint, fset); canvas->translate(150, 0); this->iterateFamily(canvas, paint, fset); }
int onCountFamilies() const override { return fFamilyNames->count(); }