SkPaint paint; paint.setTextSize(20); SkPaint::FontMetrics fontMetrics; paint.getFontMetrics(&fontMetrics);
SkPaint paint; paint.setTypeface(SkTypeface::MakeFromFile("Arial.ttf")); SkPaint::FontMetrics fontMetrics; paint.getFontMetrics(&fontMetrics);The above code sets the typeface of the paint object to Arial and gets the font metrics. The SkPaint class is provided by the Skia Graphics Library.