Advertisement
Guest User

Untitled

a guest
Oct 1st, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. // In skia, one can choose a font with the following code.
  2.  
  3. sk_sp<SkTypeface> typeface =
  4. SkTypeface::MakeFromName("Latin Modern Roman",
  5. SkFontStyle::FromOldStyle(SkTypeface::kNormal));
  6. SkPaint paint;
  7. paint.setTypeface(typeface);
  8.  
  9. // display a sentence
  10. static const char message[] = "Hello World";
  11. canvas->drawText(message, strlen(message), 0, 0, paint);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement